|
| 1 | +# JavaScript 3D Slicer |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +This demo application belongs to the set of examples for LightningChart JS, data visualization library for JavaScript. |
| 6 | + |
| 7 | +LightningChart JS is entirely GPU accelerated and performance optimized charting library for presenting massive amounts of data. It offers an easy way of creating sophisticated and interactive charts and adding them to your website or web application. |
| 8 | + |
| 9 | +The demo can be used as an example or a seed project. Local execution requires the following steps: |
| 10 | + |
| 11 | +- Make sure that relevant version of [Node.js](https://nodejs.org/en/download/) is installed |
| 12 | +- Open the project folder in a terminal: |
| 13 | + |
| 14 | + npm install # fetches dependencies |
| 15 | + npm start # builds an application and starts the development server |
| 16 | + |
| 17 | +- The application is available at _http://localhost:8080_ in your browser, webpack-dev-server provides hot reload functionality. |
| 18 | + |
| 19 | + |
| 20 | +## Description |
| 21 | + |
| 22 | +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. |
| 23 | + |
| 24 | +The 3D crosshair is rendered using three *Line Series*, and the draggable slice markers in the 2D charts are created with `axis.addConstantLine()`. |
| 25 | + |
| 26 | +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()`. |
| 27 | +```js |
| 28 | + // 2D Series |
| 29 | + seriesWH.clear() |
| 30 | + seriesWH.appendJSON(sliceData) |
| 31 | + |
| 32 | + // 3D Series |
| 33 | + lineSeriesX.clear() |
| 34 | + lineSeriesX.add([{ x: minX, y: yPoint, z: zPoint }, { x: maxX, y: yPoint, z: zPoint }]) |
| 35 | + |
| 36 | + // Constant line |
| 37 | + xAxisWHLine.setValue(value) |
| 38 | +``` |
| 39 | + |
| 40 | +When using real-time or frequently updated charts, defining a maximum sample count is strongly recommended. |
| 41 | +Preallocating memory in this way is essential for stable performance and helps prevent rendering issues or crashes when large volumes of data are added. |
| 42 | + |
| 43 | + |
| 44 | +LiDAR data source: [Philipp Urech](https://sketchfab.com/3d-models/parque-copan-ddfa8cf8aafa4d619e429d9e653ffe81) - Licensed under Creative Commons Attribute. |
| 45 | + |
| 46 | +The same LiDAR data is also used in this example: [3D LiDAR Park Visualization](https://lightningchart.com/js-charts/interactive-examples/examples/lcjs-example-0910-3dLiDARPark.html). |
| 47 | + |
| 48 | +## API Links |
| 49 | + |
| 50 | +* [3D chart] |
| 51 | +* [3D axis] |
| 52 | +* [3D point cloud series] |
| 53 | +* [3D line series] |
| 54 | +* [XY chart] |
| 55 | +* [Point series] |
| 56 | +* [Constant lines] |
| 57 | + |
| 58 | + |
| 59 | +## Support |
| 60 | + |
| 61 | +If you notice an error in the example code, please open an issue on [GitHub][0] repository of the entire example. |
| 62 | + |
| 63 | +Official [API documentation][1] can be found on [LightningChart][2] website. |
| 64 | + |
| 65 | +If the docs and other materials do not solve your problem as well as implementation help is needed, ask on [StackOverflow][3] (tagged lightningchart). |
| 66 | + |
| 67 | +If you think you found a bug in the LightningChart JavaScript library, please contact sales@lightningchart.com. |
| 68 | + |
| 69 | +Direct developer email support can be purchased through a [Support Plan][4] or by contacting sales@lightningchart.com. |
| 70 | + |
| 71 | +[0]: https://github.com/Arction/ |
| 72 | +[1]: https://lightningchart.com/lightningchart-js-api-documentation/ |
| 73 | +[2]: https://lightningchart.com |
| 74 | +[3]: https://stackoverflow.com/questions/tagged/lightningchart |
| 75 | +[4]: https://lightningchart.com/support-services/ |
| 76 | + |
| 77 | +© LightningChart Ltd 2009-2025. All rights reserved. |
| 78 | + |
| 79 | + |
| 80 | +[3D chart]: https://lightningchart.com/js-charts/api-documentation/v8.1.0/classes/Chart3D.html |
| 81 | +[3D axis]: https://lightningchart.com/js-charts/api-documentation/v8.1.0/classes/Axis3D.html |
| 82 | +[3D point cloud series]: https://lightningchart.com/js-charts/api-documentation/v8.1.0/classes/PointCloudSeries3D.html |
| 83 | +[3D line series]: https://lightningchart.com/js-charts/api-documentation/v8.1.0/classes/LineSeries3D.html |
| 84 | +[XY chart]: https://lightningchart.com/js-charts/api-documentation/v8.1.0/classes/ChartXY.html |
| 85 | +[Point series]: https://lightningchart.com/js-charts/api-documentation/v8.1.0/classes/PointLineAreaSeries.html |
| 86 | +[Constant lines]: https://lightningchart.com/js-charts/api-documentation/v8.1.0/classes/ConstantLine.html |
| 87 | + |
0 commit comments