JavaScript 3D Slicer
Example of interactive 3D point-cloud slicing with linked 2D views. Click a point in the 3D Chart or drag slice lines in the 2D Charts to inspect the data from multiple perspectives.
The 3D crosshair is rendered using three Line Series, and the draggable slice markers in the 2D charts are created with axis.addConstantLine().
When the selection changes (either by clicking in 3D or dragging a 2D line), the slice series are refreshed by clearing the previous points and adding the newly computed slice. Slice line positions are synchronized using constantLine.setValue().
// 2D Series
seriesWH.clear()
seriesWH.appendJSON(sliceData)
// 3D Series
lineSeriesX.clear()
lineSeriesX.add([{ x: minX, y: yPoint, z: zPoint }, { x: maxX, y: yPoint, z: zPoint }])
// Constant line
xAxisWHLine.setValue(value)When using real-time or frequently updated charts, defining a maximum sample count is strongly recommended.
Preallocating memory in this way is essential for stable performance and helps prevent rendering issues or crashes when large volumes of data are added.
LiDAR data source: Philipp Urech - Licensed under Creative Commons Attribute.
The same LiDAR data is also used in this example: 3D LiDAR Park Visualization.