├── .Rbuildignore ├── .babelrc ├── .circleci └── config.yml ├── .eslintignore ├── .eslintrc ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .npmignore ├── .prettierrc ├── .pylintrc ├── CODE_OF_CONDUCT.md ├── DESCRIPTION ├── LICENSE ├── MANIFEST.in ├── NAMESPACE ├── Project.toml ├── R ├── internal.R ├── vtkAlgorithm.R ├── vtkCalculator.R ├── vtkCellData.R ├── vtkDataArray.R ├── vtkFieldData.R ├── vtkGeometryRepresentation.R ├── vtkGlyphRepresentation.R ├── vtkImageData.R ├── vtkMesh.R ├── vtkPointCloudRepresentation.R ├── vtkPointData.R ├── vtkPolyData.R ├── vtkReader.R ├── vtkShareDataSet.R ├── vtkSliceRepresentation.R ├── vtkView.R ├── vtkVolume.R ├── vtkVolumeController.R ├── vtkVolumeDataRepresentation.R └── vtkVolumeRepresentation.R ├── README.md ├── _validate_init.py ├── dash_vtk ├── Algorithm.py ├── Calculator.py ├── CellData.py ├── DataArray.py ├── FieldData.py ├── GeometryRepresentation.py ├── GlyphRepresentation.py ├── ImageData.py ├── Mesh.py ├── PointCloudRepresentation.py ├── PointData.py ├── PolyData.py ├── Reader.py ├── ShareDataSet.py ├── SliceRepresentation.py ├── View.py ├── Volume.py ├── VolumeController.py ├── VolumeDataRepresentation.py ├── VolumeRepresentation.py ├── __init__.py ├── _imports_.py ├── async-ReactVTK.js ├── async-ReactVTK.js.LICENSE.txt ├── async-ReactVTK.js.map ├── dash_vtk.min.js ├── dash_vtk.min.js.LICENSE.txt ├── dash_vtk.min.js.map ├── metadata.json ├── package-info.json └── utils │ ├── __init__.py │ └── vtk.py ├── demos ├── data │ ├── citations.txt │ ├── cow-nonormals.obj │ ├── ct_lung │ │ ├── 1-01.dcm │ │ ├── 1-02.dcm │ │ ├── 1-03.dcm │ │ ├── 1-04.dcm │ │ ├── 1-05.dcm │ │ ├── 1-06.dcm │ │ ├── 1-07.dcm │ │ ├── 1-08.dcm │ │ ├── 1-09.dcm │ │ ├── 1-10.dcm │ │ ├── 1-11.dcm │ │ ├── 1-12.dcm │ │ ├── 1-13.dcm │ │ ├── 1-14.dcm │ │ ├── 1-15.dcm │ │ ├── 1-16.dcm │ │ ├── 1-17.dcm │ │ ├── 1-18.dcm │ │ ├── 1-19.dcm │ │ ├── 1-20.dcm │ │ ├── 1-21.dcm │ │ ├── 1-22.dcm │ │ ├── 1-23.dcm │ │ ├── 1-24.dcm │ │ ├── 1-25.dcm │ │ ├── 1-26.dcm │ │ ├── 1-27.dcm │ │ ├── 1-28.dcm │ │ ├── 1-29.dcm │ │ └── 1-30.dcm │ ├── head.vti │ ├── mri_brain │ │ ├── 1-01.dcm │ │ ├── 1-02.dcm │ │ ├── 1-03.dcm │ │ ├── 1-04.dcm │ │ ├── 1-05.dcm │ │ ├── 1-06.dcm │ │ ├── 1-07.dcm │ │ ├── 1-08.dcm │ │ ├── 1-09.dcm │ │ ├── 1-10.dcm │ │ ├── 1-11.dcm │ │ ├── 1-12.dcm │ │ ├── 1-13.dcm │ │ ├── 1-14.dcm │ │ ├── 1-15.dcm │ │ ├── 1-16.dcm │ │ ├── 1-17.dcm │ │ ├── 1-18.dcm │ │ ├── 1-19.dcm │ │ ├── 1-20.dcm │ │ ├── 1-21.dcm │ │ ├── 1-22.dcm │ │ ├── 1-23.dcm │ │ └── 1-24.dcm │ ├── mri_pancreas │ │ ├── 1-01.dcm │ │ ├── 1-02.dcm │ │ ├── 1-03.dcm │ │ ├── 1-04.dcm │ │ ├── 1-05.dcm │ │ ├── 1-06.dcm │ │ ├── 1-07.dcm │ │ ├── 1-08.dcm │ │ ├── 1-09.dcm │ │ ├── 1-10.dcm │ │ ├── 1-11.dcm │ │ ├── 1-12.dcm │ │ ├── 1-13.dcm │ │ ├── 1-14.dcm │ │ ├── 1-15.dcm │ │ ├── 1-16.dcm │ │ ├── 1-17.dcm │ │ ├── 1-18.dcm │ │ ├── 1-19.dcm │ │ ├── 1-20.dcm │ │ ├── 1-21.dcm │ │ ├── 1-22.dcm │ │ ├── 1-23.dcm │ │ ├── 1-24.dcm │ │ ├── 1-25.dcm │ │ ├── 1-26.dcm │ │ ├── 1-27.dcm │ │ ├── 1-28.dcm │ │ ├── 1-29.dcm │ │ ├── 1-30.dcm │ │ ├── 1-31.dcm │ │ ├── 1-32.dcm │ │ ├── 1-33.dcm │ │ ├── 1-34.dcm │ │ ├── 1-35.dcm │ │ └── 1-36.dcm │ ├── pumpkin_tall_10k.obj │ ├── teapot.obj │ └── teddy.obj ├── dicom-ct-lung │ ├── README.md │ ├── app.py │ ├── demo.jpg │ └── requirements.txt ├── dicom-mri-brain │ ├── README.md │ ├── app.py │ ├── demo.jpg │ └── requirements.txt ├── dicom-mri-pancreas │ ├── README.md │ ├── app.py │ ├── demo.jpg │ └── requirements.txt ├── pyvista-point-cloud │ ├── README.md │ ├── app.py │ ├── demo.jpg │ └── requirements.txt ├── pyvista-terrain-following-mesh │ ├── README.md │ ├── app.py │ ├── demo.jpg │ └── requirements.txt ├── requirements.txt ├── slice-rendering │ ├── README.md │ ├── app.py │ ├── demo.jpg │ └── requirements.txt ├── synthetic-volume-rendering │ ├── README.md │ ├── app.py │ ├── demo.jpg │ └── requirements.txt ├── usage-algorithm │ ├── Procfile │ ├── README.md │ ├── app.py │ ├── demo.jpg │ ├── requirements.txt │ └── runtime.txt ├── usage-vtk-cfd │ ├── README.md │ ├── app.py │ ├── data │ │ ├── bike.vtp │ │ └── tunnel.vtu │ ├── demo.jpg │ └── requirements.txt └── volume-rendering │ ├── README.md │ ├── app.py │ ├── demo.jpg │ └── requirements.txt ├── deps ├── async-ReactVTK.js ├── async-ReactVTK.js.LICENSE.txt ├── async-ReactVTK.js.map ├── dash_vtk.min.js ├── dash_vtk.min.js.LICENSE.txt └── dash_vtk.min.js.map ├── docs ├── CHANGELOG.md ├── CONTRIBUTING.md ├── README.md ├── REFERENCES.md ├── generate_references.py ├── images │ ├── fields.jpg │ ├── imagedata.jpg │ ├── polydata.jpg │ └── vtk-demo.gif ├── review_checklist.md └── tutorials │ ├── s00_point_cloud.py │ ├── s01_mesh.py │ ├── s02_mesh_field.py │ ├── s03_volume.py │ ├── s04_slice.py │ ├── s05_volume_slice.py │ ├── s06_vtk_mesh.py │ ├── s07_vtk_volume.py │ ├── t00_geometry_rendering.py │ ├── t01_volume_rendering.py │ ├── t02_imagedata.py │ ├── t03_polydata.py │ ├── t04_algorithm.py │ ├── t05_reader.py │ └── t06_shared_dataset.py ├── index.html ├── inst └── deps │ ├── async-ReactVTK.js │ ├── async-ReactVTK.js.LICENSE.txt │ ├── async-ReactVTK.js.map │ ├── dash_vtk.min.js │ ├── dash_vtk.min.js.LICENSE.txt │ └── dash_vtk.min.js.map ├── man ├── vtkAlgorithm.Rd ├── vtkCalculator.Rd ├── vtkCellData.Rd ├── vtkDataArray.Rd ├── vtkFieldData.Rd ├── vtkGeometryRepresentation.Rd ├── vtkGlyphRepresentation.Rd ├── vtkImageData.Rd ├── vtkMesh.Rd ├── vtkPointCloudRepresentation.Rd ├── vtkPointData.Rd ├── vtkPolyData.Rd ├── vtkReader.Rd ├── vtkShareDataSet.Rd ├── vtkSliceRepresentation.Rd ├── vtkView.Rd ├── vtkVolume.Rd ├── vtkVolumeController.Rd ├── vtkVolumeDataRepresentation.Rd └── vtkVolumeRepresentation.Rd ├── package-lock.json ├── package.json ├── pytest.ini ├── requirements.txt ├── setup.py ├── src ├── DashVtk.jl ├── demo │ ├── App.js │ └── index.js ├── lib │ ├── AsyncReactVTK.js │ ├── ReactVTK.js │ ├── components │ │ ├── Algorithm.react.js │ │ ├── Calculator.react.js │ │ ├── CellData.react.js │ │ ├── DataArray.react.js │ │ ├── FieldData.react.js │ │ ├── GeometryRepresentation.react.js │ │ ├── GlyphRepresentation.react.js │ │ ├── ImageData.react.js │ │ ├── Mesh.react.js │ │ ├── PointCloudRepresentation.react.js │ │ ├── PointData.react.js │ │ ├── PolyData.react.js │ │ ├── Reader.react.js │ │ ├── ShareDataSet.react.js │ │ ├── SliceRepresentation.react.js │ │ ├── View.react.js │ │ ├── Volume.react.js │ │ ├── VolumeController.react.js │ │ ├── VolumeDataRepresentation.react.js │ │ └── VolumeRepresentation.react.js │ └── index.js ├── vtk_algorithm.jl ├── vtk_calculator.jl ├── vtk_celldata.jl ├── vtk_dataarray.jl ├── vtk_fielddata.jl ├── vtk_geometryrepresentation.jl ├── vtk_glyphrepresentation.jl ├── vtk_imagedata.jl ├── vtk_mesh.jl ├── vtk_pointcloudrepresentation.jl ├── vtk_pointdata.jl ├── vtk_polydata.jl ├── vtk_reader.jl ├── vtk_sharedataset.jl ├── vtk_slicerepresentation.jl ├── vtk_view.jl ├── vtk_volume.jl ├── vtk_volumecontroller.jl ├── vtk_volumedatarepresentation.jl └── vtk_volumerepresentation.jl ├── tests ├── __init__.py ├── requirements.txt ├── test_percy.py └── test_render.py ├── usage-simple.py ├── usage.py ├── webpack.config.js └── webpack.serve.config.js /.Rbuildignore: -------------------------------------------------------------------------------- 1 | # ignore JS config files/folders 2 | node_modules/ 3 | coverage/ 4 | src/ 5 | lib/ 6 | .babelrc 7 | .builderrc 8 | .eslintrc 9 | .npmignore 10 | .editorconfig 11 | .eslintignore 12 | .prettierrc 13 | .circleci 14 | .github 15 | 16 | # demo folder has special meaning in R 17 | # this should hopefully make it still 18 | # allow for the possibility to make R demos 19 | demo/.*\.js 20 | demo/.*\.html 21 | demo/.*\.css 22 | 23 | # ignore Python files/folders 24 | setup.py 25 | usage.py 26 | setup.py 27 | requirements.txt 28 | MANIFEST.in 29 | CHANGELOG.md 30 | test/ 31 | # CRAN has weird LICENSE requirements 32 | LICENSE.txt 33 | ^.*\.Rproj$ 34 | ^\.Rproj\.user$ 35 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-env", "@babel/preset-react"], 3 | "env": { 4 | "production": { 5 | "plugins": ["@babel/plugin-proposal-object-rest-spread", "styled-jsx/babel"] 6 | }, 7 | "development": { 8 | "plugins": ["@babel/plugin-proposal-object-rest-spread", "styled-jsx/babel"] 9 | }, 10 | "test": { 11 | "plugins": ["@babel/plugin-proposal-object-rest-spread", "styled-jsx/babel-test"] 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | *.css 2 | registerServiceWorker.js -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # These owners will be the default owners for everything in 2 | # the repo. Unless a later match takes precedence 3 | * @jourdain 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | #### Description 19 | 20 | #### Steps/Code to Reproduce 21 | 48 | 49 | #### Expected Results 50 | 51 | 52 | #### Actual Results 53 | 54 | 55 | #### Versions 56 | 65 | 66 | 67 | 71 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | ## About 8 | 14 | 15 | 16 | ## Description of changes 17 | 20 | 21 | ## Pre-Merge checklist 22 | - [ ] The project was correctly built with `npm run build`. 23 | - [ ] If there was any conflict, it was solved correctly. 24 | - [ ] All changes were documented in CHANGELOG.md. 25 | - [ ] All tests on CircleCI have passed. 26 | - [ ] All Percy visual changes have been approved. 27 | - [ ] Two people have :dancer:'d the pull request. You can be one of these people if you are a Dash core contributor. 28 | 29 | 30 | ## Reference Issues 31 | 40 | 41 | Closes #[issue number] 42 | 43 | 44 | ## Other comments -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # dependencies 2 | /node_modules 3 | 4 | # testing 5 | /coverage 6 | 7 | # misc 8 | .DS_Store 9 | .env.local 10 | .env.development.local 11 | .env.test.local 12 | .env.production.local 13 | 14 | npm-debug.log* 15 | yarn-debug.log* 16 | yarn-error.log* 17 | 18 | # Development folders and files 19 | public 20 | src 21 | scripts 22 | config 23 | .travis.yml 24 | CHANGELOG.md 25 | README.md 26 | 27 | *venv -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "tabWidth": 4, 3 | "singleQuote": true, 4 | "bracketSpacing": false, 5 | "trailingComma": "es5" 6 | } 7 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: dashVtk 2 | Title: React based declarative usage of vtk.js for Dash 3 | Version: 0.0.9 4 | Description: React based declarative usage of vtk.js for Dash 5 | Depends: R (>= 3.0.2) 6 | Imports: 7 | Suggests: 8 | License: MIT + file LICENSE 9 | URL: https://github.com/plotly/dash-vtk 10 | BugReports: https://github.com/plotly/dash-vtk/issues 11 | Encoding: UTF-8 12 | LazyData: true 13 | KeepSource: true 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021-2024 Plotly Technologies Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include dash_vtk/dash_vtk.min.js 2 | include dash_vtk/dash_vtk.min.js.map 3 | include dash_vtk/async-ReactVTK.js 4 | include dash_vtk/async-ReactVTK.js.map 5 | include dash_vtk/metadata.json 6 | include dash_vtk/package-info.json 7 | include README.md 8 | include LICENSE 9 | include package.json 10 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | export(vtkAlgorithm) 4 | export(vtkCalculator) 5 | export(vtkCellData) 6 | export(vtkDataArray) 7 | export(vtkFieldData) 8 | export(vtkGeometryRepresentation) 9 | export(vtkGlyphRepresentation) 10 | export(vtkImageData) 11 | export(vtkMesh) 12 | export(vtkPointCloudRepresentation) 13 | export(vtkPointData) 14 | export(vtkPolyData) 15 | export(vtkReader) 16 | export(vtkShareDataSet) 17 | export(vtkSliceRepresentation) 18 | export(vtkView) 19 | export(vtkVolume) 20 | export(vtkVolumeController) 21 | export(vtkVolumeDataRepresentation) 22 | export(vtkVolumeRepresentation) 23 | -------------------------------------------------------------------------------- /Project.toml: -------------------------------------------------------------------------------- 1 | 2 | name = "DashVtk" 3 | uuid = "1b08a953-4be3-4667-9a23-818b1eccd4c7" 4 | authors = ["Kitware Inc and Plotly Technologies "] 5 | version = "0.0.9" 6 | 7 | [deps] 8 | Dash = "1b08a953-4be3-4667-9a23-3db579824955" 9 | 10 | [compat] 11 | julia = "1.2" 12 | Dash = "0.1.3" 13 | -------------------------------------------------------------------------------- /R/internal.R: -------------------------------------------------------------------------------- 1 | .dashVtk_js_metadata <- function() { 2 | deps_metadata <- list(`dash_vtk` = structure(list(name = "dash_vtk", 3 | version = "0.0.9", src = list(href = NULL, 4 | file = "deps"), meta = NULL, 5 | script = 'dash_vtk.min.js', 6 | stylesheet = NULL, head = NULL, attachment = NULL, package = "dashVtk", 7 | all_files = FALSE), class = "html_dependency"), 8 | `dash_vtk` = structure(list(name = "dash_vtk", 9 | version = "0.0.9", src = list(href = NULL, 10 | file = "deps"), meta = NULL, 11 | script = 'dash_vtk.min.js.map', 12 | stylesheet = NULL, head = NULL, attachment = NULL, package = "dashVtk", 13 | all_files = FALSE, dynamic = TRUE), class = "html_dependency"), 14 | `dash_vtk` = structure(list(name = "dash_vtk", 15 | version = "0.0.9", src = list(href = NULL, 16 | file = "deps"), meta = NULL, 17 | script = 'async-ReactVTK.js', 18 | stylesheet = NULL, head = NULL, attachment = NULL, package = "dashVtk", 19 | all_files = FALSE, async = TRUE), class = "html_dependency"), 20 | `dash_vtk` = structure(list(name = "dash_vtk", 21 | version = "0.0.9", src = list(href = NULL, 22 | file = "deps"), meta = NULL, 23 | script = 'async-ReactVTK.js.map', 24 | stylesheet = NULL, head = NULL, attachment = NULL, package = "dashVtk", 25 | all_files = FALSE, dynamic = TRUE), class = "html_dependency")) 26 | return(deps_metadata) 27 | } 28 | -------------------------------------------------------------------------------- /R/vtkAlgorithm.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | vtkAlgorithm <- function(children=NULL, id=NULL, port=NULL, state=NULL, vtkClass=NULL) { 4 | 5 | props <- list(children=children, id=id, port=port, state=state, vtkClass=vtkClass) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'Algorithm', 12 | namespace = 'dash_vtk', 13 | propNames = c('children', 'id', 'port', 'state', 'vtkClass'), 14 | package = 'dashVtk' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/vtkCalculator.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | vtkCalculator <- function(children=NULL, id=NULL, arrays=NULL, formula=NULL, location=NULL, name=NULL, port=NULL) { 4 | 5 | props <- list(children=children, id=id, arrays=arrays, formula=formula, location=location, name=name, port=port) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'Calculator', 12 | namespace = 'dash_vtk', 13 | propNames = c('children', 'id', 'arrays', 'formula', 'location', 'name', 'port'), 14 | package = 'dashVtk' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/vtkCellData.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | vtkCellData <- function(children=NULL) { 4 | 5 | props <- list(children=children) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'CellData', 12 | namespace = 'dash_vtk', 13 | propNames = c('children'), 14 | package = 'dashVtk' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/vtkDataArray.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | vtkDataArray <- function(id=NULL, name=NULL, numberOfComponents=NULL, registration=NULL, type=NULL, values=NULL) { 4 | 5 | props <- list(id=id, name=name, numberOfComponents=numberOfComponents, registration=registration, type=type, values=values) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'DataArray', 12 | namespace = 'dash_vtk', 13 | propNames = c('id', 'name', 'numberOfComponents', 'registration', 'type', 'values'), 14 | package = 'dashVtk' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/vtkFieldData.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | vtkFieldData <- function(children=NULL) { 4 | 5 | props <- list(children=children) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'FieldData', 12 | namespace = 'dash_vtk', 13 | propNames = c('children'), 14 | package = 'dashVtk' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/vtkGeometryRepresentation.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | vtkGeometryRepresentation <- function(children=NULL, id=NULL, actor=NULL, colorDataRange=NULL, colorMapPreset=NULL, cubeAxesStyle=NULL, mapper=NULL, property=NULL, showCubeAxes=NULL) { 4 | 5 | props <- list(children=children, id=id, actor=actor, colorDataRange=colorDataRange, colorMapPreset=colorMapPreset, cubeAxesStyle=cubeAxesStyle, mapper=mapper, property=property, showCubeAxes=showCubeAxes) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'GeometryRepresentation', 12 | namespace = 'dash_vtk', 13 | propNames = c('children', 'id', 'actor', 'colorDataRange', 'colorMapPreset', 'cubeAxesStyle', 'mapper', 'property', 'showCubeAxes'), 14 | package = 'dashVtk' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/vtkGlyphRepresentation.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | vtkGlyphRepresentation <- function(children=NULL, id=NULL, actor=NULL, colorDataRange=NULL, colorMapPreset=NULL, mapper=NULL, property=NULL) { 4 | 5 | props <- list(children=children, id=id, actor=actor, colorDataRange=colorDataRange, colorMapPreset=colorMapPreset, mapper=mapper, property=property) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'GlyphRepresentation', 12 | namespace = 'dash_vtk', 13 | propNames = c('children', 'id', 'actor', 'colorDataRange', 'colorMapPreset', 'mapper', 'property'), 14 | package = 'dashVtk' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/vtkImageData.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | vtkImageData <- function(children=NULL, id=NULL, dimensions=NULL, direction=NULL, origin=NULL, port=NULL, spacing=NULL) { 4 | 5 | props <- list(children=children, id=id, dimensions=dimensions, direction=direction, origin=origin, port=port, spacing=spacing) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'ImageData', 12 | namespace = 'dash_vtk', 13 | propNames = c('children', 'id', 'dimensions', 'direction', 'origin', 'port', 'spacing'), 14 | package = 'dashVtk' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/vtkMesh.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | vtkMesh <- function(id=NULL, port=NULL, state=NULL) { 4 | 5 | props <- list(id=id, port=port, state=state) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'Mesh', 12 | namespace = 'dash_vtk', 13 | propNames = c('id', 'port', 'state'), 14 | package = 'dashVtk' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/vtkPointCloudRepresentation.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | vtkPointCloudRepresentation <- function(colorDataRange=NULL, colorMapPreset=NULL, property=NULL, rgb=NULL, rgba=NULL, scalars=NULL, xyz=NULL) { 4 | 5 | props <- list(colorDataRange=colorDataRange, colorMapPreset=colorMapPreset, property=property, rgb=rgb, rgba=rgba, scalars=scalars, xyz=xyz) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'PointCloudRepresentation', 12 | namespace = 'dash_vtk', 13 | propNames = c('colorDataRange', 'colorMapPreset', 'property', 'rgb', 'rgba', 'scalars', 'xyz'), 14 | package = 'dashVtk' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/vtkPointData.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | vtkPointData <- function(children=NULL) { 4 | 5 | props <- list(children=children) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'PointData', 12 | namespace = 'dash_vtk', 13 | propNames = c('children'), 14 | package = 'dashVtk' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/vtkPolyData.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | vtkPolyData <- function(children=NULL, id=NULL, connectivity=NULL, lines=NULL, points=NULL, polys=NULL, port=NULL, strips=NULL, verts=NULL) { 4 | 5 | props <- list(children=children, id=id, connectivity=connectivity, lines=lines, points=points, polys=polys, port=port, strips=strips, verts=verts) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'PolyData', 12 | namespace = 'dash_vtk', 13 | propNames = c('children', 'id', 'connectivity', 'lines', 'points', 'polys', 'port', 'strips', 'verts'), 14 | package = 'dashVtk' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/vtkReader.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | vtkReader <- function(children=NULL, id=NULL, parseAsArrayBuffer=NULL, parseAsText=NULL, port=NULL, renderOnUpdate=NULL, resetCameraOnUpdate=NULL, url=NULL, vtkClass=NULL) { 4 | 5 | props <- list(children=children, id=id, parseAsArrayBuffer=parseAsArrayBuffer, parseAsText=parseAsText, port=port, renderOnUpdate=renderOnUpdate, resetCameraOnUpdate=resetCameraOnUpdate, url=url, vtkClass=vtkClass) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'Reader', 12 | namespace = 'dash_vtk', 13 | propNames = c('children', 'id', 'parseAsArrayBuffer', 'parseAsText', 'port', 'renderOnUpdate', 'resetCameraOnUpdate', 'url', 'vtkClass'), 14 | package = 'dashVtk' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/vtkShareDataSet.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | vtkShareDataSet <- function(children=NULL, id=NULL, name=NULL, port=NULL) { 4 | 5 | props <- list(children=children, id=id, name=name, port=port) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'ShareDataSet', 12 | namespace = 'dash_vtk', 13 | propNames = c('children', 'id', 'name', 'port'), 14 | package = 'dashVtk' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/vtkSliceRepresentation.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | vtkSliceRepresentation <- function(children=NULL, id=NULL, actor=NULL, colorDataRange=NULL, colorMapPreset=NULL, iSlice=NULL, jSlice=NULL, kSlice=NULL, mapper=NULL, property=NULL, xSlice=NULL, ySlice=NULL, zSlice=NULL) { 4 | 5 | props <- list(children=children, id=id, actor=actor, colorDataRange=colorDataRange, colorMapPreset=colorMapPreset, iSlice=iSlice, jSlice=jSlice, kSlice=kSlice, mapper=mapper, property=property, xSlice=xSlice, ySlice=ySlice, zSlice=zSlice) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'SliceRepresentation', 12 | namespace = 'dash_vtk', 13 | propNames = c('children', 'id', 'actor', 'colorDataRange', 'colorMapPreset', 'iSlice', 'jSlice', 'kSlice', 'mapper', 'property', 'xSlice', 'ySlice', 'zSlice'), 14 | package = 'dashVtk' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/vtkView.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | vtkView <- function(children=NULL, id=NULL, background=NULL, cameraParallelProjection=NULL, cameraPosition=NULL, cameraViewUp=NULL, className=NULL, clickInfo=NULL, hoverInfo=NULL, interactorSettings=NULL, pickingModes=NULL, style=NULL, triggerRender=NULL, triggerResetCamera=NULL) { 4 | 5 | props <- list(children=children, id=id, background=background, cameraParallelProjection=cameraParallelProjection, cameraPosition=cameraPosition, cameraViewUp=cameraViewUp, className=className, clickInfo=clickInfo, hoverInfo=hoverInfo, interactorSettings=interactorSettings, pickingModes=pickingModes, style=style, triggerRender=triggerRender, triggerResetCamera=triggerResetCamera) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'View', 12 | namespace = 'dash_vtk', 13 | propNames = c('children', 'id', 'background', 'cameraParallelProjection', 'cameraPosition', 'cameraViewUp', 'className', 'clickInfo', 'hoverInfo', 'interactorSettings', 'pickingModes', 'style', 'triggerRender', 'triggerResetCamera'), 14 | package = 'dashVtk' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/vtkVolume.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | vtkVolume <- function(id=NULL, port=NULL, state=NULL) { 4 | 5 | props <- list(id=id, port=port, state=state) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'Volume', 12 | namespace = 'dash_vtk', 13 | propNames = c('id', 'port', 'state'), 14 | package = 'dashVtk' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/vtkVolumeController.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | vtkVolumeController <- function(id=NULL, rescaleColorMap=NULL, size=NULL) { 4 | 5 | props <- list(id=id, rescaleColorMap=rescaleColorMap, size=size) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'VolumeController', 12 | namespace = 'dash_vtk', 13 | propNames = c('id', 'rescaleColorMap', 'size'), 14 | package = 'dashVtk' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/vtkVolumeDataRepresentation.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | vtkVolumeDataRepresentation <- function(id=NULL, colorDataRange=NULL, colorMapPreset=NULL, controllerSize=NULL, dimensions=NULL, mapper=NULL, origin=NULL, property=NULL, rescaleColorMap=NULL, rgb=NULL, rgba=NULL, scalars=NULL, scalarsType=NULL, spacing=NULL, volume=NULL, volumeController=NULL) { 4 | 5 | props <- list(id=id, colorDataRange=colorDataRange, colorMapPreset=colorMapPreset, controllerSize=controllerSize, dimensions=dimensions, mapper=mapper, origin=origin, property=property, rescaleColorMap=rescaleColorMap, rgb=rgb, rgba=rgba, scalars=scalars, scalarsType=scalarsType, spacing=spacing, volume=volume, volumeController=volumeController) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'VolumeDataRepresentation', 12 | namespace = 'dash_vtk', 13 | propNames = c('id', 'colorDataRange', 'colorMapPreset', 'controllerSize', 'dimensions', 'mapper', 'origin', 'property', 'rescaleColorMap', 'rgb', 'rgba', 'scalars', 'scalarsType', 'spacing', 'volume', 'volumeController'), 14 | package = 'dashVtk' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/vtkVolumeRepresentation.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | vtkVolumeRepresentation <- function(children=NULL, id=NULL, colorDataRange=NULL, colorMapPreset=NULL, mapper=NULL, property=NULL, volume=NULL) { 4 | 5 | props <- list(children=children, id=id, colorDataRange=colorDataRange, colorMapPreset=colorMapPreset, mapper=mapper, property=property, volume=volume) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'VolumeRepresentation', 12 | namespace = 'dash_vtk', 13 | propNames = c('children', 'id', 'colorDataRange', 'colorMapPreset', 'mapper', 'property', 'volume'), 14 | package = 'dashVtk' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /_validate_init.py: -------------------------------------------------------------------------------- 1 | """ 2 | DO NOT MODIFY 3 | This file is used to validate your publish settings. 4 | """ 5 | from __future__ import print_function 6 | 7 | import os 8 | import sys 9 | import importlib 10 | 11 | 12 | components_package = 'dash_vtk' 13 | 14 | components_lib = importlib.import_module(components_package) 15 | 16 | missing_dist_msg = 'Warning {} was not found in `{}.__init__.{}`!!!' 17 | missing_manifest_msg = ''' 18 | Warning {} was not found in `MANIFEST.in`! 19 | It will not be included in the build! 20 | ''' 21 | 22 | with open('MANIFEST.in', 'r') as f: 23 | manifest = f.read() 24 | 25 | 26 | def check_dist(dist, filename): 27 | # Support the dev bundle. 28 | if filename.endswith('dev.js'): 29 | return True 30 | 31 | return any( 32 | filename in x 33 | for d in dist 34 | for x in ( 35 | [d.get('relative_package_path')] 36 | if not isinstance(d.get('relative_package_path'), list) 37 | else d.get('relative_package_path') 38 | ) 39 | ) 40 | 41 | 42 | def check_manifest(filename): 43 | return filename in manifest 44 | 45 | 46 | def check_file(dist, filename): 47 | if not check_dist(dist, filename): 48 | print( 49 | missing_dist_msg.format(filename, components_package, '_js_dist'), 50 | file=sys.stderr 51 | ) 52 | if not check_manifest(filename): 53 | print(missing_manifest_msg.format(filename), 54 | file=sys.stderr) 55 | 56 | 57 | for cur, _, files in os.walk(components_package): 58 | for f in files: 59 | 60 | if f.endswith('js'): 61 | # noinspection PyProtectedMember 62 | check_file(components_lib._js_dist, f) 63 | elif f.endswith('css'): 64 | # noinspection PyProtectedMember 65 | check_file(components_lib._css_dist, f) 66 | elif not f.endswith('py'): 67 | check_manifest(f) 68 | -------------------------------------------------------------------------------- /dash_vtk/Algorithm.py: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | from dash.development.base_component import Component, _explicitize_args 4 | 5 | 6 | class Algorithm(Component): 7 | """An Algorithm component. 8 | Algorithm is exposing a source or filter to a downstream filter 9 | It takes the following set of properties: 10 | - vtkClass: vtkClassName 11 | - state: {} 12 | 13 | Keyword arguments: 14 | 15 | - children (list of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional) 16 | 17 | - id (string; optional): 18 | The ID used to identify this component. 19 | 20 | - port (number; default 0): 21 | downstream connection port. 22 | 23 | - state (dict; optional): 24 | set of property values for vtkClass. 25 | 26 | - vtkClass (string; default 'vtkConeSource'): 27 | vtkClass name.""" 28 | @_explicitize_args 29 | def __init__(self, children=None, id=Component.UNDEFINED, port=Component.UNDEFINED, vtkClass=Component.UNDEFINED, state=Component.UNDEFINED, **kwargs): 30 | self._prop_names = ['children', 'id', 'port', 'state', 'vtkClass'] 31 | self._type = 'Algorithm' 32 | self._namespace = 'dash_vtk' 33 | self._valid_wildcard_attributes = [] 34 | self.available_properties = ['children', 'id', 'port', 'state', 'vtkClass'] 35 | self.available_wildcard_properties = [] 36 | _explicit_args = kwargs.pop('_explicit_args') 37 | _locals = locals() 38 | _locals.update(kwargs) # For wildcard attrs 39 | args = {k: _locals[k] for k in _explicit_args if k != 'children'} 40 | for k in []: 41 | if k not in args: 42 | raise TypeError( 43 | 'Required argument `' + k + '` was not specified.') 44 | super(Algorithm, self).__init__(children=children, **args) 45 | -------------------------------------------------------------------------------- /dash_vtk/Calculator.py: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | from dash.development.base_component import Component, _explicitize_args 4 | 5 | 6 | class Calculator(Component): 7 | """A Calculator component. 8 | Calculator is exposing a source or filter to a downstream filter 9 | It takes the following set of properties: 10 | - name: 'scalars' // name of the generated field 11 | - location: 'POINT' // POINT/CELL 12 | - arrays: [] // Name of array to have access in formula 13 | - formula: fn 14 | 15 | Keyword arguments: 16 | 17 | - children (list of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional) 18 | 19 | - id (string; optional): 20 | The ID used to identify this component. 21 | 22 | - arrays (list of strings; optional): 23 | List of fields you want available for your formula. 24 | 25 | - location (string; default 'POINT'): 26 | Field location [POINT, CELL, COORDINATE, SCALARS, ]. 27 | 28 | - name (string; default 'scalars'): 29 | Field name. 30 | 31 | - port (number; default 0): 32 | downstream connection port.""" 33 | @_explicitize_args 34 | def __init__(self, children=None, id=Component.UNDEFINED, port=Component.UNDEFINED, name=Component.UNDEFINED, location=Component.UNDEFINED, arrays=Component.UNDEFINED, formula=Component.UNDEFINED, **kwargs): 35 | self._prop_names = ['children', 'id', 'arrays', 'location', 'name', 'port'] 36 | self._type = 'Calculator' 37 | self._namespace = 'dash_vtk' 38 | self._valid_wildcard_attributes = [] 39 | self.available_properties = ['children', 'id', 'arrays', 'location', 'name', 'port'] 40 | self.available_wildcard_properties = [] 41 | _explicit_args = kwargs.pop('_explicit_args') 42 | _locals = locals() 43 | _locals.update(kwargs) # For wildcard attrs 44 | args = {k: _locals[k] for k in _explicit_args if k != 'children'} 45 | for k in []: 46 | if k not in args: 47 | raise TypeError( 48 | 'Required argument `' + k + '` was not specified.') 49 | super(Calculator, self).__init__(children=children, **args) 50 | -------------------------------------------------------------------------------- /dash_vtk/CellData.py: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | from dash.development.base_component import Component, _explicitize_args 4 | 5 | 6 | class CellData(Component): 7 | """A CellData component. 8 | CellData is exposing a vtkCellData to a downstream element 9 | 10 | Keyword arguments: 11 | 12 | - children (list of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional)""" 13 | @_explicitize_args 14 | def __init__(self, children=None, **kwargs): 15 | self._prop_names = ['children'] 16 | self._type = 'CellData' 17 | self._namespace = 'dash_vtk' 18 | self._valid_wildcard_attributes = [] 19 | self.available_properties = ['children'] 20 | self.available_wildcard_properties = [] 21 | _explicit_args = kwargs.pop('_explicit_args') 22 | _locals = locals() 23 | _locals.update(kwargs) # For wildcard attrs 24 | args = {k: _locals[k] for k in _explicit_args if k != 'children'} 25 | for k in []: 26 | if k not in args: 27 | raise TypeError( 28 | 'Required argument `' + k + '` was not specified.') 29 | super(CellData, self).__init__(children=children, **args) 30 | -------------------------------------------------------------------------------- /dash_vtk/DataArray.py: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | from dash.development.base_component import Component, _explicitize_args 4 | 5 | 6 | class DataArray(Component): 7 | """A DataArray component. 8 | DataArray is creating a vtkDataArray for the container fields 9 | It takes the following set of properties: 10 | - type: 'Float32Array', 'Float64Array', 'Uint16Array', ... 11 | - values: [number, number, ...] 12 | - numberOfComponents: 1, 13 | - registration: 'addArray', 'setScalars', ... 14 | 15 | Keyword arguments: 16 | 17 | - id (string; optional): 18 | The ID used to identify this component. 19 | 20 | - name (string; default 'scalars'): 21 | Field name. 22 | 23 | - numberOfComponents (number; default 1): 24 | Number of components / Tuple size. 25 | 26 | - registration (string; default 'addArray'): 27 | Name of the method to call on the fieldData (addArray, setScalars, 28 | setVectors...). 29 | 30 | - type (string; default 'Float32Array'): 31 | Typed array name. 32 | 33 | - values (list of numbers; optional): 34 | Actual values to use inside our array.""" 35 | @_explicitize_args 36 | def __init__(self, id=Component.UNDEFINED, type=Component.UNDEFINED, name=Component.UNDEFINED, values=Component.UNDEFINED, numberOfComponents=Component.UNDEFINED, registration=Component.UNDEFINED, **kwargs): 37 | self._prop_names = ['id', 'name', 'numberOfComponents', 'registration', 'type', 'values'] 38 | self._type = 'DataArray' 39 | self._namespace = 'dash_vtk' 40 | self._valid_wildcard_attributes = [] 41 | self.available_properties = ['id', 'name', 'numberOfComponents', 'registration', 'type', 'values'] 42 | self.available_wildcard_properties = [] 43 | _explicit_args = kwargs.pop('_explicit_args') 44 | _locals = locals() 45 | _locals.update(kwargs) # For wildcard attrs 46 | args = {k: _locals[k] for k in _explicit_args if k != 'children'} 47 | for k in []: 48 | if k not in args: 49 | raise TypeError( 50 | 'Required argument `' + k + '` was not specified.') 51 | super(DataArray, self).__init__(**args) 52 | -------------------------------------------------------------------------------- /dash_vtk/FieldData.py: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | from dash.development.base_component import Component, _explicitize_args 4 | 5 | 6 | class FieldData(Component): 7 | """A FieldData component. 8 | FieldData is exposing a FieldData to a downstream element 9 | 10 | Keyword arguments: 11 | 12 | - children (list of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional)""" 13 | @_explicitize_args 14 | def __init__(self, children=None, **kwargs): 15 | self._prop_names = ['children'] 16 | self._type = 'FieldData' 17 | self._namespace = 'dash_vtk' 18 | self._valid_wildcard_attributes = [] 19 | self.available_properties = ['children'] 20 | self.available_wildcard_properties = [] 21 | _explicit_args = kwargs.pop('_explicit_args') 22 | _locals = locals() 23 | _locals.update(kwargs) # For wildcard attrs 24 | args = {k: _locals[k] for k in _explicit_args if k != 'children'} 25 | for k in []: 26 | if k not in args: 27 | raise TypeError( 28 | 'Required argument `' + k + '` was not specified.') 29 | super(FieldData, self).__init__(children=children, **args) 30 | -------------------------------------------------------------------------------- /dash_vtk/Mesh.py: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | from dash.development.base_component import Component, _explicitize_args 4 | 5 | 6 | class Mesh(Component): 7 | """A Mesh component. 8 | Mesh is exposing a vtkPolyData to a downstream filter 9 | It takes the following set of properties: 10 | - state: { mesh: { ...polydata-props }, field: { ...dataArray } } 11 | 12 | Keyword arguments: 13 | 14 | - id (string; optional): 15 | The ID used to identify this component. 16 | 17 | - port (number; default 0): 18 | downstream connection port. 19 | 20 | - state (dict; default { mesh: { points: [] },}): 21 | State of the mesh.""" 22 | @_explicitize_args 23 | def __init__(self, id=Component.UNDEFINED, port=Component.UNDEFINED, state=Component.UNDEFINED, **kwargs): 24 | self._prop_names = ['id', 'port', 'state'] 25 | self._type = 'Mesh' 26 | self._namespace = 'dash_vtk' 27 | self._valid_wildcard_attributes = [] 28 | self.available_properties = ['id', 'port', 'state'] 29 | self.available_wildcard_properties = [] 30 | _explicit_args = kwargs.pop('_explicit_args') 31 | _locals = locals() 32 | _locals.update(kwargs) # For wildcard attrs 33 | args = {k: _locals[k] for k in _explicit_args if k != 'children'} 34 | for k in []: 35 | if k not in args: 36 | raise TypeError( 37 | 'Required argument `' + k + '` was not specified.') 38 | super(Mesh, self).__init__(**args) 39 | -------------------------------------------------------------------------------- /dash_vtk/PointCloudRepresentation.py: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | from dash.development.base_component import Component, _explicitize_args 4 | 5 | 6 | class PointCloudRepresentation(Component): 7 | """A PointCloudRepresentation component. 8 | PointCloudRepresentation expect the following set of properties 9 | - xyz: [x0, y0, z0, x1, ..., zn] 10 | - rgb: [...] 11 | - rgba: [...] 12 | - scalars: [...] 13 | 14 | Keyword arguments: 15 | 16 | - colorDataRange (list of numbers; default [0, 1]): 17 | Data range use for the colorMap. 18 | 19 | - colorMapPreset (string; default 'erdc_rainbow_bright'): 20 | Preset name for the lookup table color map. 21 | 22 | - property (dict; optional): 23 | Properties to set to the actor.property. 24 | 25 | - rgb (list of numbers; optional): 26 | Use RGB values to attach to the points/vertex. 27 | 28 | - rgba (list of numbers; optional): 29 | Use RGBA values to attach to the points/vertex. 30 | 31 | - scalars (list of numbers; optional): 32 | Field values to attach to the points. 33 | 34 | - xyz (list of numbers; default [0, 0, 0]): 35 | Points coordinates.""" 36 | @_explicitize_args 37 | def __init__(self, xyz=Component.UNDEFINED, rgb=Component.UNDEFINED, rgba=Component.UNDEFINED, scalars=Component.UNDEFINED, colorMapPreset=Component.UNDEFINED, colorDataRange=Component.UNDEFINED, property=Component.UNDEFINED, **kwargs): 38 | self._prop_names = ['colorDataRange', 'colorMapPreset', 'property', 'rgb', 'rgba', 'scalars', 'xyz'] 39 | self._type = 'PointCloudRepresentation' 40 | self._namespace = 'dash_vtk' 41 | self._valid_wildcard_attributes = [] 42 | self.available_properties = ['colorDataRange', 'colorMapPreset', 'property', 'rgb', 'rgba', 'scalars', 'xyz'] 43 | self.available_wildcard_properties = [] 44 | _explicit_args = kwargs.pop('_explicit_args') 45 | _locals = locals() 46 | _locals.update(kwargs) # For wildcard attrs 47 | args = {k: _locals[k] for k in _explicit_args if k != 'children'} 48 | for k in []: 49 | if k not in args: 50 | raise TypeError( 51 | 'Required argument `' + k + '` was not specified.') 52 | super(PointCloudRepresentation, self).__init__(**args) 53 | -------------------------------------------------------------------------------- /dash_vtk/PointData.py: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | from dash.development.base_component import Component, _explicitize_args 4 | 5 | 6 | class PointData(Component): 7 | """A PointData component. 8 | PointData is exposing a vtkPointData to a downstream element 9 | 10 | Keyword arguments: 11 | 12 | - children (list of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional)""" 13 | @_explicitize_args 14 | def __init__(self, children=None, **kwargs): 15 | self._prop_names = ['children'] 16 | self._type = 'PointData' 17 | self._namespace = 'dash_vtk' 18 | self._valid_wildcard_attributes = [] 19 | self.available_properties = ['children'] 20 | self.available_wildcard_properties = [] 21 | _explicit_args = kwargs.pop('_explicit_args') 22 | _locals = locals() 23 | _locals.update(kwargs) # For wildcard attrs 24 | args = {k: _locals[k] for k in _explicit_args if k != 'children'} 25 | for k in []: 26 | if k not in args: 27 | raise TypeError( 28 | 'Required argument `' + k + '` was not specified.') 29 | super(PointData, self).__init__(children=children, **args) 30 | -------------------------------------------------------------------------------- /dash_vtk/ShareDataSet.py: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | from dash.development.base_component import Component, _explicitize_args 4 | 5 | 6 | class ShareDataSet(Component): 7 | """A ShareDataSet component. 8 | ShareDataSet capture a dataset or a source and allow it to use it in another 9 | pipeline or representation. 10 | 11 | Keyword arguments: 12 | 13 | - children (list of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional) 14 | 15 | - id (string; optional): 16 | The ID used to identify this component. 17 | 18 | - name (string; default 'shared'): 19 | Unique dataset name to cross reference. 20 | 21 | - port (number; default 0): 22 | downstream connection port.""" 23 | @_explicitize_args 24 | def __init__(self, children=None, id=Component.UNDEFINED, port=Component.UNDEFINED, name=Component.UNDEFINED, **kwargs): 25 | self._prop_names = ['children', 'id', 'name', 'port'] 26 | self._type = 'ShareDataSet' 27 | self._namespace = 'dash_vtk' 28 | self._valid_wildcard_attributes = [] 29 | self.available_properties = ['children', 'id', 'name', 'port'] 30 | self.available_wildcard_properties = [] 31 | _explicit_args = kwargs.pop('_explicit_args') 32 | _locals = locals() 33 | _locals.update(kwargs) # For wildcard attrs 34 | args = {k: _locals[k] for k in _explicit_args if k != 'children'} 35 | for k in []: 36 | if k not in args: 37 | raise TypeError( 38 | 'Required argument `' + k + '` was not specified.') 39 | super(ShareDataSet, self).__init__(children=children, **args) 40 | -------------------------------------------------------------------------------- /dash_vtk/Volume.py: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | from dash.development.base_component import Component, _explicitize_args 4 | 5 | 6 | class Volume(Component): 7 | """A Volume component. 8 | Volume is exposing a vtkImageData to a downstream filter 9 | It takes the following set of properties: 10 | - state: { image: { ...imagedata-props }, field: { ...dataArray } } 11 | 12 | Keyword arguments: 13 | 14 | - id (string; optional): 15 | The ID used to identify this component. 16 | 17 | - port (number; default 0): 18 | downstream connection port. 19 | 20 | - state (dict; default { image: { dimension: [10, 10, 10] },}): 21 | State of the volume.""" 22 | @_explicitize_args 23 | def __init__(self, id=Component.UNDEFINED, port=Component.UNDEFINED, state=Component.UNDEFINED, **kwargs): 24 | self._prop_names = ['id', 'port', 'state'] 25 | self._type = 'Volume' 26 | self._namespace = 'dash_vtk' 27 | self._valid_wildcard_attributes = [] 28 | self.available_properties = ['id', 'port', 'state'] 29 | self.available_wildcard_properties = [] 30 | _explicit_args = kwargs.pop('_explicit_args') 31 | _locals = locals() 32 | _locals.update(kwargs) # For wildcard attrs 33 | args = {k: _locals[k] for k in _explicit_args if k != 'children'} 34 | for k in []: 35 | if k not in args: 36 | raise TypeError( 37 | 'Required argument `' + k + '` was not specified.') 38 | super(Volume, self).__init__(**args) 39 | -------------------------------------------------------------------------------- /dash_vtk/VolumeController.py: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | from dash.development.base_component import Component, _explicitize_args 4 | 5 | 6 | class VolumeController(Component): 7 | """A VolumeController component. 8 | VolumeController is a GUI to control the piecewise function 9 | 10 | Keyword arguments: 11 | 12 | - id (string; optional): 13 | The ID used to identify this component. 14 | 15 | - rescaleColorMap (boolean; default True): 16 | Use opacity range to rescale color map. 17 | 18 | - size (list of numbers; default [400, 150]): 19 | Controller size in pixels.""" 20 | @_explicitize_args 21 | def __init__(self, id=Component.UNDEFINED, size=Component.UNDEFINED, rescaleColorMap=Component.UNDEFINED, **kwargs): 22 | self._prop_names = ['id', 'rescaleColorMap', 'size'] 23 | self._type = 'VolumeController' 24 | self._namespace = 'dash_vtk' 25 | self._valid_wildcard_attributes = [] 26 | self.available_properties = ['id', 'rescaleColorMap', 'size'] 27 | self.available_wildcard_properties = [] 28 | _explicit_args = kwargs.pop('_explicit_args') 29 | _locals = locals() 30 | _locals.update(kwargs) # For wildcard attrs 31 | args = {k: _locals[k] for k in _explicit_args if k != 'children'} 32 | for k in []: 33 | if k not in args: 34 | raise TypeError( 35 | 'Required argument `' + k + '` was not specified.') 36 | super(VolumeController, self).__init__(**args) 37 | -------------------------------------------------------------------------------- /dash_vtk/VolumeRepresentation.py: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | from dash.development.base_component import Component, _explicitize_args 4 | 5 | 6 | class VolumeRepresentation(Component): 7 | """A VolumeRepresentation component. 8 | VolumeRepresentation is responsible to convert a vtkPolyData into rendering 9 | It takes the following set of properties: 10 | - colorBy: ['POINTS', ''], 11 | - pointSize: 1, 12 | - color: [1,1,1], 13 | 14 | Keyword arguments: 15 | 16 | - children (list of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional) 17 | 18 | - id (string; optional): 19 | The ID used to identify this component. 20 | 21 | - colorDataRange (list of numbers | string; default 'auto'): 22 | Data range use for the colorMap. 23 | 24 | - colorMapPreset (string; default 'erdc_rainbow_bright'): 25 | Preset name for the lookup table color map. 26 | 27 | - mapper (dict; optional): 28 | Properties to set to the mapper. 29 | 30 | - property (dict; optional): 31 | Properties to set to the volume.property. 32 | 33 | - volume (dict; optional): 34 | Properties to set to the volume.""" 35 | @_explicitize_args 36 | def __init__(self, children=None, id=Component.UNDEFINED, mapper=Component.UNDEFINED, volume=Component.UNDEFINED, property=Component.UNDEFINED, colorMapPreset=Component.UNDEFINED, colorDataRange=Component.UNDEFINED, **kwargs): 37 | self._prop_names = ['children', 'id', 'colorDataRange', 'colorMapPreset', 'mapper', 'property', 'volume'] 38 | self._type = 'VolumeRepresentation' 39 | self._namespace = 'dash_vtk' 40 | self._valid_wildcard_attributes = [] 41 | self.available_properties = ['children', 'id', 'colorDataRange', 'colorMapPreset', 'mapper', 'property', 'volume'] 42 | self.available_wildcard_properties = [] 43 | _explicit_args = kwargs.pop('_explicit_args') 44 | _locals = locals() 45 | _locals.update(kwargs) # For wildcard attrs 46 | args = {k: _locals[k] for k in _explicit_args if k != 'children'} 47 | for k in []: 48 | if k not in args: 49 | raise TypeError( 50 | 'Required argument `' + k + '` was not specified.') 51 | super(VolumeRepresentation, self).__init__(children=children, **args) 52 | -------------------------------------------------------------------------------- /dash_vtk/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function as _ 2 | 3 | import os as _os 4 | import sys as _sys 5 | import json 6 | 7 | import dash as _dash 8 | 9 | # noinspection PyUnresolvedReferences 10 | from ._imports_ import * 11 | from ._imports_ import __all__ 12 | 13 | if not hasattr(_dash, '__plotly_dash') and not hasattr(_dash, 'development'): 14 | print('Dash was not successfully imported. ' 15 | 'Make sure you don\'t have a file ' 16 | 'named \n"dash.py" in your current directory.', file=_sys.stderr) 17 | _sys.exit(1) 18 | 19 | _basepath = _os.path.dirname(__file__) 20 | _filepath = _os.path.abspath(_os.path.join(_basepath, 'package-info.json')) 21 | with open(_filepath) as f: 22 | package = json.load(f) 23 | 24 | package_name = package['name'].replace(' ', '_').replace('-', '_') 25 | __version__ = package['version'] 26 | 27 | _current_path = _os.path.dirname(_os.path.abspath(__file__)) 28 | 29 | _this_module = _sys.modules[__name__] 30 | 31 | 32 | _js_dist = [ 33 | { 34 | 'relative_package_path': 'dash_vtk.min.js', 35 | 'external_url': 'https://unpkg.com/{0}@{2}/{1}/{1}.min.js'.format( 36 | package_name, __name__, __version__), 37 | 'namespace': package_name 38 | }, 39 | { 40 | 'relative_package_path': 'dash_vtk.min.js.map', 41 | 'external_url': 'https://unpkg.com/{0}@{2}/{1}/{1}.min.js.map'.format( 42 | package_name, __name__, __version__), 43 | 'namespace': package_name, 44 | 'dynamic': True 45 | }, 46 | { 47 | 'relative_package_path': 'async-ReactVTK.js', 48 | 'external_url': 'https://unpkg.com/{0}@{2}/{1}/async-ReactVTK.js'.format( 49 | package_name, __name__, __version__), 50 | 'namespace': package_name, 51 | 'async': True 52 | }, 53 | { 54 | 'relative_package_path': 'async-ReactVTK.js.map', 55 | 'external_url': 'https://unpkg.com/{0}@{2}/{1}/async-ReactVTK.js.map'.format( 56 | package_name, __name__, __version__), 57 | 'namespace': package_name, 58 | 'dynamic': True 59 | } 60 | ] 61 | 62 | _css_dist = [] 63 | 64 | 65 | for _component in __all__: 66 | setattr(locals()[_component], '_js_dist', _js_dist) 67 | setattr(locals()[_component], '_css_dist', _css_dist) 68 | -------------------------------------------------------------------------------- /dash_vtk/_imports_.py: -------------------------------------------------------------------------------- 1 | from .Algorithm import Algorithm 2 | from .Calculator import Calculator 3 | from .CellData import CellData 4 | from .DataArray import DataArray 5 | from .FieldData import FieldData 6 | from .GeometryRepresentation import GeometryRepresentation 7 | from .GlyphRepresentation import GlyphRepresentation 8 | from .ImageData import ImageData 9 | from .Mesh import Mesh 10 | from .PointCloudRepresentation import PointCloudRepresentation 11 | from .PointData import PointData 12 | from .PolyData import PolyData 13 | from .Reader import Reader 14 | from .ShareDataSet import ShareDataSet 15 | from .SliceRepresentation import SliceRepresentation 16 | from .View import View 17 | from .Volume import Volume 18 | from .VolumeController import VolumeController 19 | from .VolumeDataRepresentation import VolumeDataRepresentation 20 | from .VolumeRepresentation import VolumeRepresentation 21 | 22 | __all__ = [ 23 | "Algorithm", 24 | "Calculator", 25 | "CellData", 26 | "DataArray", 27 | "FieldData", 28 | "GeometryRepresentation", 29 | "GlyphRepresentation", 30 | "ImageData", 31 | "Mesh", 32 | "PointCloudRepresentation", 33 | "PointData", 34 | "PolyData", 35 | "Reader", 36 | "ShareDataSet", 37 | "SliceRepresentation", 38 | "View", 39 | "Volume", 40 | "VolumeController", 41 | "VolumeDataRepresentation", 42 | "VolumeRepresentation" 43 | ] -------------------------------------------------------------------------------- /dash_vtk/async-ReactVTK.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /*! 2 | * The buffer module from node.js, for the browser. 3 | * 4 | * @author Feross Aboukhadijeh 5 | * @license MIT 6 | */ 7 | 8 | /*! 9 | * The buffer module from node.js, for the browser. 10 | * 11 | * @author Feross Aboukhadijeh 12 | * @license MIT 13 | */ 14 | 15 | /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ 16 | 17 | /*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */ 18 | -------------------------------------------------------------------------------- /dash_vtk/async-ReactVTK.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":[],"names":[],"mappings":"","file":"async-ReactVTK.js","sourceRoot":""} -------------------------------------------------------------------------------- /dash_vtk/dash_vtk.min.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":[],"names":[],"mappings":"","file":"dash_vtk.min.js","sourceRoot":""} -------------------------------------------------------------------------------- /dash_vtk/utils/__init__.py: -------------------------------------------------------------------------------- 1 | from .vtk import to_mesh_state, to_volume_state, presets, preset_as_options 2 | -------------------------------------------------------------------------------- /demos/data/citations.txt: -------------------------------------------------------------------------------- 1 | Pancreas MRI: 2 | Citation: Tatum, J., Kalen, J., Ileva, lilia, L, R., S, K., N, P., Jacobs, P., Sanders, C., A, J., Difilippantonio, S., L, T., hollingshead, melinda, J, P., Y, E., Clunie, D., Y, L., Suloway, C., Smith, K., U, W., … Doroshow, J. (n.d.). Imaging characterization of a metastatic patient derived model of adenocarcinoma pancreas: PDMR-292921-168-R. The Cancer Imaging Archive. https://doi.org/10.7937/TCIA.2020.PCAK-8Z10 3 | 4 | Brain MRI: 5 | URL: https://wiki.cancerimagingarchive.net/display/Public/Brain-Tumor-Progression 6 | Citation: Schmainda KM, Prah M (2018). Data from Brain-Tumor-Progression. The Cancer Imaging Archive. http://doi.org/10.7937/K9/TCIA.2018.15quzvnb 7 | 8 | Lung CT: 9 | URL: https://wiki.cancerimagingarchive.net/pages/viewpage.action?pageId=70224216#70224216bcab02c187174a288dbcbf95d26179e8 10 | Citation: Li, P., Wang, S., Li, T., Lu, J., HuangFu, Y., & Wang, D. (2020). A Large-Scale CT and PET/CT Dataset for Lung Cancer Diagnosis [Data set]. The Cancer Imaging Archive. https://doi.org/10.7937/TCIA.2020.NNC2-0461 -------------------------------------------------------------------------------- /demos/data/ct_lung/1-01.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-01.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-02.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-02.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-03.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-03.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-04.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-04.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-05.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-05.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-06.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-06.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-07.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-07.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-08.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-08.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-09.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-09.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-10.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-10.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-11.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-11.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-12.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-12.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-13.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-13.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-14.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-14.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-15.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-15.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-16.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-16.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-17.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-17.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-18.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-18.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-19.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-19.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-20.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-20.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-21.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-21.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-22.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-22.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-23.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-23.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-24.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-24.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-25.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-25.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-26.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-26.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-27.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-27.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-28.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-28.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-29.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-29.dcm -------------------------------------------------------------------------------- /demos/data/ct_lung/1-30.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/ct_lung/1-30.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-01.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-01.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-02.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-02.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-03.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-03.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-04.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-04.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-05.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-05.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-06.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-06.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-07.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-07.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-08.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-08.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-09.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-09.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-10.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-10.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-11.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-11.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-12.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-12.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-13.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-13.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-14.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-14.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-15.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-15.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-16.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-16.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-17.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-17.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-18.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-18.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-19.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-19.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-20.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-20.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-21.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-21.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-22.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-22.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-23.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-23.dcm -------------------------------------------------------------------------------- /demos/data/mri_brain/1-24.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_brain/1-24.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-01.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-01.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-02.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-02.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-03.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-03.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-04.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-04.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-05.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-05.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-06.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-06.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-07.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-07.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-08.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-08.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-09.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-09.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-10.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-10.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-11.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-11.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-12.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-12.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-13.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-13.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-14.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-14.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-15.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-15.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-16.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-16.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-17.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-17.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-18.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-18.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-19.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-19.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-20.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-20.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-21.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-21.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-22.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-22.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-23.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-23.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-24.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-24.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-25.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-25.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-26.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-26.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-27.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-27.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-28.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-28.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-29.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-29.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-30.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-30.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-31.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-31.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-32.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-32.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-33.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-33.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-34.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-34.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-35.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-35.dcm -------------------------------------------------------------------------------- /demos/data/mri_pancreas/1-36.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/data/mri_pancreas/1-36.dcm -------------------------------------------------------------------------------- /demos/dicom-ct-lung/README.md: -------------------------------------------------------------------------------- 1 | # Visualizing MRi volumes from dicom files 2 | 3 | ![Image demo](./demo.jpg) 4 | 5 | ## Instructions 6 | 7 | See instructions from [README.md](../../README.md) to create a virtual environment and install the dependencies. 8 | 9 | 10 | ## Acknowledgements 11 | 12 | Dataset: [Lung CT](https://wiki.cancerimagingarchive.net/pages/viewpage.action?pageId=70224216#70224216bcab02c187174a288dbcbf95d26179e8) 13 | 14 | ``` 15 | Citation: Li, P., Wang, S., Li, T., Lu, J., HuangFu, Y., & Wang, D. (2020). A Large-Scale CT and PET/CT Dataset for Lung Cancer Diagnosis [Data set]. The Cancer Imaging Archive. https://doi.org/10.7937/TCIA.2020.NNC2-0461 16 | ``` -------------------------------------------------------------------------------- /demos/dicom-ct-lung/app.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | import dash 4 | import dash_html_components as html 5 | import itk 6 | 7 | import dash_vtk 8 | from dash_vtk.utils import to_volume_state 9 | 10 | # Place a DICOM series (a set of per-file slices) in a directory. ITK sorts, sets spatial metadata, etc. 11 | demo_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 12 | itk_image = itk.imread(os.path.join(demo_dir, "data", "ct_lung")) 13 | 14 | # Convert itk.Image to vtkImageData 15 | vtk_image = itk.vtk_image_from_image(itk_image) 16 | volume_state = to_volume_state(vtk_image) 17 | 18 | 19 | vtk_view = dash_vtk.View( 20 | dash_vtk.VolumeRepresentation( 21 | children=[ 22 | dash_vtk.VolumeController(), 23 | dash_vtk.Volume(state=volume_state), 24 | ] 25 | ) 26 | ) 27 | 28 | app = dash.Dash(__name__) 29 | server = app.server 30 | 31 | app.layout = html.Div( 32 | style={"height": "calc(100vh - 50px)", "width": "100%"}, 33 | children=[html.Div(vtk_view, style={"height": "100%", "width": "100%"})], 34 | ) 35 | 36 | 37 | if __name__ == "__main__": 38 | app.run_server(debug=True) 39 | -------------------------------------------------------------------------------- /demos/dicom-ct-lung/demo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/dicom-ct-lung/demo.jpg -------------------------------------------------------------------------------- /demos/dicom-ct-lung/requirements.txt: -------------------------------------------------------------------------------- 1 | # If you skipped `pip install -e ../../`, the package below will be retrieved from pypi: 2 | dash-vtk 3 | dash-bootstrap-components 4 | vtk 5 | numpy 6 | itk==5.2.1 7 | -------------------------------------------------------------------------------- /demos/dicom-mri-brain/README.md: -------------------------------------------------------------------------------- 1 | # Visualizing CT Scans as volume from dicom files 2 | 3 | ![Image demo](./demo.jpg) 4 | 5 | ## Instructions 6 | 7 | See instructions from [README.md](../../README.md) to create a virtual environment and install the dependencies. 8 | 9 | 10 | ## Acknowledgements 11 | 12 | The datasets used here include: 13 | 14 | [Brain MRI](https://wiki.cancerimagingarchive.net/display/Public/Brain-Tumor-Progression) 15 | 16 | ``` 17 | Citation: Schmainda KM, Prah M (2018). Data from Brain-Tumor-Progression. The Cancer Imaging Archive. http://doi.org/10.7937/K9/TCIA.2018.15quzvnb 18 | ``` 19 | -------------------------------------------------------------------------------- /demos/dicom-mri-brain/app.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | import dash 4 | import dash_html_components as html 5 | import dash_bootstrap_components as dbc 6 | import itk 7 | 8 | import dash_vtk 9 | from dash_vtk.utils import to_volume_state 10 | 11 | 12 | def dcm_to_volume(dir_path): 13 | itk_image = itk.imread(dir_path) 14 | vtk_image = itk.vtk_image_from_image(itk_image) 15 | volume_state = to_volume_state(vtk_image) 16 | 17 | return volume_state 18 | 19 | 20 | # Place a DICOM series (a set of per-file slices) in a directory. ITK sorts, sets spatial metadata, etc. 21 | demo_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 22 | volume_state = dcm_to_volume(os.path.join(demo_dir, "data", "mri_brain")) 23 | 24 | app = dash.Dash(__name__) 25 | server = app.server 26 | 27 | vtk_view = dash_vtk.View( 28 | dash_vtk.VolumeRepresentation( 29 | [dash_vtk.VolumeController(), dash_vtk.Volume(state=volume_state)] 30 | ) 31 | ) 32 | 33 | app.layout = html.Div( 34 | style={"height": "calc(100vh - 50px)", "width": "100%"}, 35 | children=[html.Div(style={"height": "100%", "width": "100%"}, children=vtk_view)], 36 | ) 37 | 38 | 39 | if __name__ == "__main__": 40 | app.run_server(debug=True) 41 | -------------------------------------------------------------------------------- /demos/dicom-mri-brain/demo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/dicom-mri-brain/demo.jpg -------------------------------------------------------------------------------- /demos/dicom-mri-brain/requirements.txt: -------------------------------------------------------------------------------- 1 | # If you skipped `pip install -e ../../`, the package below will be retrieved from pypi: 2 | dash-vtk 3 | dash-bootstrap-components 4 | vtk 5 | numpy 6 | itk==5.2.1 7 | -------------------------------------------------------------------------------- /demos/dicom-mri-pancreas/README.md: -------------------------------------------------------------------------------- 1 | # Visualizing MRi volumes from dicom files 2 | 3 | ![Image demo](./demo.jpg) 4 | 5 | ## Instructions 6 | 7 | See instructions from [README.md](../../README.md) to create a virtual environment and install the dependencies. 8 | 9 | 10 | ## Acknowledgements 11 | 12 | The datasets used here include: 13 | 14 | [Pancreas MRI](https://wiki.cancerimagingarchive.net/display/Public/Imaging+characterization+of+a+metastatic+patient+derived+model+of+adenocarcinoma+pancreas%3A+PDMR-292921-168-R) 15 | ``` 16 | Citation: Tatum, J., Kalen, J., Ileva, lilia, L, R., S, K., N, P., Jacobs, P., Sanders, C., A, J., Difilippantonio, S., L, T., hollingshead, melinda, J, P., Y, E., Clunie, D., Y, L., Suloway, C., Smith, K., U, W., … Doroshow, J. (n.d.). Imaging characterization of a metastatic patient derived model of adenocarcinoma pancreas: PDMR-292921-168-R. The Cancer Imaging Archive. https://doi.org/10.7937/TCIA.2020.PCAK-8Z10 17 | ``` -------------------------------------------------------------------------------- /demos/dicom-mri-pancreas/app.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | import dash 4 | import dash_html_components as html 5 | import dash_bootstrap_components as dbc 6 | import itk 7 | 8 | import dash_vtk 9 | from dash_vtk.utils import to_volume_state 10 | 11 | 12 | def dcm_to_volume(dir_path): 13 | itk_image = itk.imread(dir_path) 14 | vtk_image = itk.vtk_image_from_image(itk_image) 15 | volume_state = to_volume_state(vtk_image) 16 | 17 | return volume_state 18 | 19 | 20 | # Place a DICOM series (a set of per-file slices) in a directory. ITK sorts, sets spatial metadata, etc. 21 | demo_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 22 | volume_state = dcm_to_volume(os.path.join(demo_dir, "data", "mri_pancreas")) 23 | 24 | app = dash.Dash(__name__) 25 | server = app.server 26 | 27 | vtk_view = dash_vtk.View( 28 | dash_vtk.VolumeRepresentation( 29 | [dash_vtk.VolumeController(), dash_vtk.Volume(state=volume_state)] 30 | ) 31 | ) 32 | 33 | app.layout = html.Div( 34 | style={"height": "calc(100vh - 50px)", "width": "100%"}, 35 | children=[html.Div(style={"height": "100%", "width": "100%"}, children=vtk_view)], 36 | ) 37 | 38 | 39 | if __name__ == "__main__": 40 | app.run_server(debug=True) 41 | -------------------------------------------------------------------------------- /demos/dicom-mri-pancreas/demo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/dicom-mri-pancreas/demo.jpg -------------------------------------------------------------------------------- /demos/dicom-mri-pancreas/requirements.txt: -------------------------------------------------------------------------------- 1 | # If you skipped `pip install -e ../../`, the package below will be retrieved from pypi: 2 | dash-vtk 3 | dash-bootstrap-components 4 | vtk 5 | numpy 6 | itk==5.2.1 7 | -------------------------------------------------------------------------------- /demos/pyvista-point-cloud/README.md: -------------------------------------------------------------------------------- 1 | # Demo of `dash_vtk.PointCloudRepresentation` 2 | 3 | ![A demo of the usage-pyvista-point-cloud app](./demo.jpg) 4 | 5 | ## Instructions 6 | 7 | See instructions from [README.md](../../README.md) to create a virtual environment and install the dependencies. 8 | 9 | ## Goal 10 | 11 | The goal of that example is to show you how you can use PyVista 12 | to get a PointCloud and render it using dash-vtk on the client side. 13 | 14 | For that specific example we rely on `PointCloudRepresentation` to render a point cloud via a simplified element 15 | that encapsulate the following structure. 16 | 17 | ``` 18 | 24 | 25 | {nbComponents && ( 26 | 27 | 33 | 34 | )} 35 | 36 | 37 | ``` 38 | -------------------------------------------------------------------------------- /demos/pyvista-point-cloud/app.py: -------------------------------------------------------------------------------- 1 | import dash 2 | import dash_vtk 3 | import dash_html_components as html 4 | import dash_core_components as dcc 5 | from dash.dependencies import Input, Output, State 6 | 7 | import numpy as np 8 | import pyvista as pv 9 | from pyvista import examples 10 | 11 | np.random.seed(42) 12 | 13 | # Get point cloud data from PyVista 14 | dataset = examples.download_lidar() 15 | subset = 0.2 16 | selection = np.random.randint( 17 | low=0, high=dataset.n_points - 1, size=int(dataset.n_points * subset) 18 | ) 19 | points = dataset.points[selection] 20 | xyz = points.ravel() 21 | elevation = points[:, -1].ravel() 22 | min_elevation = np.amin(elevation) 23 | max_elevation = np.amax(elevation) 24 | print(f"Number of points: {points.shape}") 25 | print(f"Elevation range: [{min_elevation}, {max_elevation}]") 26 | 27 | # Setup VTK rendering of PointCloud 28 | app = dash.Dash(__name__) 29 | server = app.server 30 | 31 | vtk_view = dash_vtk.View( 32 | [ 33 | dash_vtk.PointCloudRepresentation( 34 | xyz=xyz, 35 | scalars=elevation, 36 | colorDataRange=[min_elevation, max_elevation], 37 | property={"pointSize": 2}, 38 | ) 39 | ] 40 | ) 41 | 42 | app.layout = html.Div( 43 | style={"height": "calc(100vh - 16px)"}, 44 | children=[html.Div(vtk_view, style={"height": "100%", "width": "100%"})], 45 | ) 46 | 47 | if __name__ == "__main__": 48 | app.run_server(debug=True) 49 | -------------------------------------------------------------------------------- /demos/pyvista-point-cloud/demo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/pyvista-point-cloud/demo.jpg -------------------------------------------------------------------------------- /demos/pyvista-point-cloud/requirements.txt: -------------------------------------------------------------------------------- 1 | # If you skipped `pip install -e ../../`, the package below will be retrieved from pypi: 2 | dash-vtk 3 | pyvista 4 | numpy 5 | vtk -------------------------------------------------------------------------------- /demos/pyvista-terrain-following-mesh/README.md: -------------------------------------------------------------------------------- 1 | # Demo of Terrain deformation using PyVista and dash-vtk 2 | 3 | ![A demo of the usage-pyvista-point-cloud app](./demo.jpg) 4 | 5 | ## Instructions 6 | 7 | See instructions from [README.md](../../README.md) to create a virtual environment and install the dependencies. 8 | 9 | ## Goal 10 | 11 | The goal of that example is to show you how you can use PyVista 12 | to get a mesh and transform it using dash-vtk for its rendering. 13 | -------------------------------------------------------------------------------- /demos/pyvista-terrain-following-mesh/demo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/pyvista-terrain-following-mesh/demo.jpg -------------------------------------------------------------------------------- /demos/pyvista-terrain-following-mesh/requirements.txt: -------------------------------------------------------------------------------- 1 | # If you skipped `pip install -e ../../`, the package below will be retrieved from pypi: 2 | dash-vtk 3 | dash-bootstrap-components 4 | pyvista 5 | numpy 6 | vtk -------------------------------------------------------------------------------- /demos/requirements.txt: -------------------------------------------------------------------------------- 1 | -r ./usage-algorithm/requirements.txt 2 | -r ./pyvista-terrain-following-mesh/requirements.txt 3 | -r ./slice-rendering/requirements.txt 4 | -r ./pyvista-point-cloud/requirements.txt 5 | -r ./volume-rendering/requirements.txt 6 | -r ./usage-vtk-cfd/requirements.txt 7 | -r ./usage-algorithm/requirements.txt 8 | -r ./synthetic-volume-rendering/requirements.txt 9 | -r ./dicom-ct-lung/requirements.txt 10 | -r ./dicom-mri-brain/requirements.txt 11 | -r ./dicom-mri-pancreas/requirements.txt -------------------------------------------------------------------------------- /demos/slice-rendering/README.md: -------------------------------------------------------------------------------- 1 | # Demo of multi-view rendering of Volume and slices 2 | 3 | ![A demo of the slice-rendering app](./demo.jpg) 4 | 5 | ## Instructions 6 | 7 | See instructions from [README.md](../../README.md) to create a virtual environment and install the dependencies. 8 | 9 | ## Goal 10 | 11 | This example aims to show how to load a vtkImageData using VTK and push it to the dash-vtk components for rendering. 12 | In that example we create 1 vtkImageData that get shared on the client side across 2 views where one is doing volume rendering and the other is doing 3 slices of that same volume. 13 | -------------------------------------------------------------------------------- /demos/slice-rendering/demo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/slice-rendering/demo.jpg -------------------------------------------------------------------------------- /demos/slice-rendering/requirements.txt: -------------------------------------------------------------------------------- 1 | # If you skipped `pip install -e ../../`, the package below will be retrieved from pypi: 2 | dash-vtk 3 | dash-bootstrap-components 4 | vtk 5 | numpy 6 | -------------------------------------------------------------------------------- /demos/synthetic-volume-rendering/README.md: -------------------------------------------------------------------------------- 1 | # Demo of volume rendering 2 | 3 | ![A demo of the synthetic-volume-rendering app](./demo.jpg) 4 | 5 | ## Instructions 6 | 7 | See instructions from [README.md](../../README.md) to create a virtual environment and install the dependencies. 8 | 9 | ## Goal 10 | 11 | This example aims to show how do volume rendering of a synthetic image data by only providing the grid information and values. 12 | -------------------------------------------------------------------------------- /demos/synthetic-volume-rendering/app.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | import dash 4 | import dash_vtk 5 | import dash_html_components as html 6 | 7 | random.seed(42) 8 | 9 | app = dash.Dash(__name__) 10 | server = app.server 11 | 12 | volume_view = dash_vtk.View( 13 | children=dash_vtk.VolumeDataRepresentation( 14 | spacing=[1, 1, 1], 15 | dimensions=[10, 10, 10], 16 | origin=[0, 0, 0], 17 | scalars=[random.random() for _ in range(1000)], 18 | rescaleColorMap=False, 19 | ) 20 | ) 21 | 22 | app.layout = html.Div( 23 | style={"height": "calc(100vh - 16px)"}, 24 | children=[ 25 | html.Div(children=volume_view, style={"height": "100%", "width": "100%"}) 26 | ], 27 | ) 28 | 29 | if __name__ == "__main__": 30 | app.run_server(debug=True) 31 | -------------------------------------------------------------------------------- /demos/synthetic-volume-rendering/demo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/synthetic-volume-rendering/demo.jpg -------------------------------------------------------------------------------- /demos/synthetic-volume-rendering/requirements.txt: -------------------------------------------------------------------------------- 1 | # If you skipped `pip install -e ../../`, the package below will be retrieved from pypi: 2 | dash-vtk -------------------------------------------------------------------------------- /demos/usage-algorithm/Procfile: -------------------------------------------------------------------------------- 1 | web: gunicorn app:server -------------------------------------------------------------------------------- /demos/usage-algorithm/README.md: -------------------------------------------------------------------------------- 1 | # Demo of `dash_vtk.Algorithm` 2 | 3 | ![A demo of the usage-algorithm app](./demo.jpg) 4 | 5 | ## Instructions 6 | 7 | See instructions from [README.md](../../README.md) to create a virtual environment and install the dependencies. 8 | 9 | ## Goal 10 | 11 | This example aims to show how to use the element to instanciate and control a vtk source. 12 | -------------------------------------------------------------------------------- /demos/usage-algorithm/demo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/usage-algorithm/demo.jpg -------------------------------------------------------------------------------- /demos/usage-algorithm/requirements.txt: -------------------------------------------------------------------------------- 1 | # If you skipped `pip install -e ../../`, the package below will be retrieved from pypi: 2 | dash-vtk 3 | dash-bootstrap-components -------------------------------------------------------------------------------- /demos/usage-algorithm/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.7.6 -------------------------------------------------------------------------------- /demos/usage-vtk-cfd/README.md: -------------------------------------------------------------------------------- 1 | # Demo of VTK for data processing and dash-vtk for rendering 2 | 3 | ![A demo of the pyvista-point-cloud app](./demo.jpg) 4 | 5 | ## Instructions 6 | 7 | See instructions from [README.md](../../README.md) to create a virtual environment and install the dependencies. 8 | 9 | ## Goal 10 | 11 | The goal of that example is to show you how you can use PyVista/VTK to load and process some CFD dataset and dynamically adjust some filter parameters and render the result in a 3D Web view using dash-vtk. 12 | -------------------------------------------------------------------------------- /demos/usage-vtk-cfd/data/bike.vtp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/usage-vtk-cfd/data/bike.vtp -------------------------------------------------------------------------------- /demos/usage-vtk-cfd/data/tunnel.vtu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/usage-vtk-cfd/data/tunnel.vtu -------------------------------------------------------------------------------- /demos/usage-vtk-cfd/demo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/usage-vtk-cfd/demo.jpg -------------------------------------------------------------------------------- /demos/usage-vtk-cfd/requirements.txt: -------------------------------------------------------------------------------- 1 | # If you skipped `pip install -e ../../`, the package below will be retrieved from pypi: 2 | dash >= 1.19.0 3 | dash-vtk 4 | dash-bootstrap-components 5 | pyvista 6 | numpy 7 | vtk -------------------------------------------------------------------------------- /demos/volume-rendering/README.md: -------------------------------------------------------------------------------- 1 | # Demo of volume rendering 2 | 3 | ![A demo of the volume-rendering app](./demo.jpg) 4 | 5 | ## Instructions 6 | 7 | See instructions from [README.md](../../README.md) to create a virtual environment and install the dependencies. 8 | 9 | ## Goal 10 | 11 | This example aims to show how to load a vtkImageData using VTK and push it to the dash-vtk components for doing Volume rendering. 12 | -------------------------------------------------------------------------------- /demos/volume-rendering/app.py: -------------------------------------------------------------------------------- 1 | import os 2 | import dash 3 | import dash_html_components as html 4 | 5 | import dash_vtk 6 | from dash_vtk.utils import to_volume_state 7 | 8 | import vtk 9 | 10 | # Data file path 11 | demo_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 12 | head_vti = os.path.join(demo_dir, "data", "head.vti") 13 | 14 | # Load dataset from dist 15 | reader = vtk.vtkXMLImageDataReader() 16 | reader.SetFileName(head_vti) 17 | reader.Update() 18 | 19 | volume_state = to_volume_state(reader.GetOutput()) 20 | 21 | vtk_view = dash_vtk.View( 22 | dash_vtk.VolumeRepresentation( 23 | children=[ 24 | dash_vtk.VolumeController(), 25 | dash_vtk.Volume(state=volume_state), 26 | ] 27 | ) 28 | ) 29 | 30 | app = dash.Dash(__name__) 31 | server = app.server 32 | 33 | app.layout = html.Div( 34 | style={"height": "calc(100vh - 16px)", "width": "100%"}, 35 | children=[html.Div(vtk_view, style={"height": "100%", "width": "100%"})], 36 | ) 37 | 38 | if __name__ == "__main__": 39 | app.run_server(debug=True) 40 | -------------------------------------------------------------------------------- /demos/volume-rendering/demo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/demos/volume-rendering/demo.jpg -------------------------------------------------------------------------------- /demos/volume-rendering/requirements.txt: -------------------------------------------------------------------------------- 1 | # If you skipped `pip install -e ../../`, the package below will be retrieved from pypi: 2 | dash-vtk 3 | dash 4 | vtk 5 | numpy -------------------------------------------------------------------------------- /deps/async-ReactVTK.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /*! 2 | * The buffer module from node.js, for the browser. 3 | * 4 | * @author Feross Aboukhadijeh 5 | * @license MIT 6 | */ 7 | 8 | /*! 9 | * The buffer module from node.js, for the browser. 10 | * 11 | * @author Feross Aboukhadijeh 12 | * @license MIT 13 | */ 14 | 15 | /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ 16 | 17 | /*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */ 18 | -------------------------------------------------------------------------------- /deps/async-ReactVTK.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":[],"names":[],"mappings":"","file":"async-ReactVTK.js","sourceRoot":""} -------------------------------------------------------------------------------- /deps/dash_vtk.min.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":[],"names":[],"mappings":"","file":"dash_vtk.min.js","sourceRoot":""} -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | * [Interactive Docs & User Guide](http://dash.plotly.com/vtk) 2 | * [Instructions for contributions](./CONTRIBUTING.md) 3 | * [API Reference](./REFERENCES.md) -------------------------------------------------------------------------------- /docs/generate_references.py: -------------------------------------------------------------------------------- 1 | import os 2 | import inspect 3 | 4 | import dash_vtk 5 | 6 | def create_signature(c, prefix='dash_vtk.'): 7 | name = c.__name__ 8 | args = str(inspect.signature(c)) 9 | for r in ['=undefined', '=None', '=required']: 10 | args = args.replace(r, '') 11 | 12 | clean_signature = f"{prefix}{name}{args}" 13 | 14 | return clean_signature 15 | 16 | 17 | components = [ 18 | dash_vtk.Algorithm, 19 | dash_vtk.Calculator, 20 | dash_vtk.CellData, 21 | dash_vtk.DataArray, 22 | dash_vtk.FieldData, 23 | dash_vtk.GeometryRepresentation, 24 | dash_vtk.ImageData, 25 | dash_vtk.Mesh, 26 | dash_vtk.PointCloudRepresentation, 27 | dash_vtk.PointData, 28 | dash_vtk.PolyData, 29 | dash_vtk.Reader, 30 | dash_vtk.ShareDataSet, 31 | dash_vtk.SliceRepresentation, 32 | dash_vtk.View, 33 | dash_vtk.Volume, 34 | dash_vtk.VolumeController, 35 | dash_vtk.VolumeDataRepresentation, 36 | dash_vtk.VolumeRepresentation 37 | ] 38 | 39 | with open('./docs/REFERENCES.md', 'w') as f: 40 | f.write("# Components Reference\n\n") 41 | for c in components: 42 | f.write(f"- [{c.__name__}](#{c.__name__})\n") 43 | for c in components: 44 | print(c.__name__) 45 | f.write(f"\n## {c.__name__}\n\n") 46 | f.write(f"```python\n{create_signature(c)}\n```\n\n") 47 | f.write(c.__doc__ + '\n\n') 48 | f.write("[Back to menu](#components-reference)\n\n") 49 | -------------------------------------------------------------------------------- /docs/images/fields.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/docs/images/fields.jpg -------------------------------------------------------------------------------- /docs/images/imagedata.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/docs/images/imagedata.jpg -------------------------------------------------------------------------------- /docs/images/polydata.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/docs/images/polydata.jpg -------------------------------------------------------------------------------- /docs/images/vtk-demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/docs/images/vtk-demo.gif -------------------------------------------------------------------------------- /docs/tutorials/s00_point_cloud.py: -------------------------------------------------------------------------------- 1 | import dash 2 | import dash_html_components as html 3 | import dash_vtk 4 | import random 5 | 6 | xyz = [] 7 | for i in range(10000): 8 | xyz.append(random.random()) # x 9 | xyz.append(random.random()) # y 10 | xyz.append(random.random() * 0.01) # z 11 | 12 | content = dash_vtk.View( 13 | children=[ 14 | dash_vtk.GeometryRepresentation( 15 | property={ 'pointSize': 3 }, 16 | children=[dash_vtk.PolyData(points=xyz, connectivity='points')], 17 | ), 18 | ], 19 | ) 20 | 21 | # Dash setup 22 | app = dash.Dash(__name__) 23 | server = app.server 24 | 25 | app.layout = html.Div( 26 | style={"width": "100%", "height": "calc(100vh - 15px)"}, 27 | children=[content], 28 | ) 29 | 30 | if __name__ == "__main__": 31 | app.run_server(debug=True) 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /docs/tutorials/s01_mesh.py: -------------------------------------------------------------------------------- 1 | import dash 2 | import dash_html_components as html 3 | import dash_vtk 4 | 5 | content = dash_vtk.View([ 6 | dash_vtk.GeometryRepresentation( 7 | children=[ 8 | dash_vtk.PolyData( 9 | points=[ 10 | 0, 0, 0, 11 | 1, 0, 0, 12 | 0, 1, 0, 13 | 1, 1, 0, 14 | ], 15 | lines=[3, 1, 3, 2], 16 | polys=[3, 0, 1, 2], 17 | ), 18 | ], 19 | ), 20 | ]) 21 | 22 | # Dash setup 23 | app = dash.Dash(__name__) 24 | server = app.server 25 | app.layout = html.Div( 26 | style={"width": "100%", "height": "calc(100vh - 15px)"}, 27 | children=[content], 28 | ) 29 | 30 | if __name__ == "__main__": 31 | app.run_server(debug=True) 32 | -------------------------------------------------------------------------------- /docs/tutorials/s02_mesh_field.py: -------------------------------------------------------------------------------- 1 | import dash 2 | import dash_html_components as html 3 | 4 | import dash_vtk 5 | 6 | content = dash_vtk.View([ 7 | dash_vtk.GeometryRepresentation( 8 | children=[ 9 | dash_vtk.PolyData( 10 | points=[ 11 | 0, 0, 0, 12 | 1, 0, 0, 13 | 0, 1, 0, 14 | 1, 1, 0, 15 | ], 16 | lines=[3, 1, 3, 2], 17 | polys=[3, 0, 1, 2], 18 | children=[ 19 | dash_vtk.PointData([ 20 | dash_vtk.DataArray( 21 | registration='setScalars', 22 | name='onPoints', 23 | values=[0, 0.33, 0.66, 1], 24 | ) 25 | ]), 26 | dash_vtk.CellData([ 27 | dash_vtk.DataArray( 28 | # registration='setScalars', 29 | name='onCells', 30 | values=[0, 1], 31 | ) 32 | ]) 33 | ], 34 | ), 35 | ], 36 | ), 37 | ]) 38 | 39 | # Dash setup 40 | app = dash.Dash(__name__) 41 | server = app.server 42 | 43 | app.layout = html.Div( 44 | style={"width": "100%", "height": "calc(100vh - 15px)"}, 45 | children=[content], 46 | ) 47 | 48 | if __name__ == "__main__": 49 | app.run_server(debug=True) 50 | -------------------------------------------------------------------------------- /docs/tutorials/s03_volume.py: -------------------------------------------------------------------------------- 1 | import dash 2 | import random 3 | import dash_html_components as html 4 | import dash_vtk 5 | 6 | field = [random.random()*i for i in range(10*10*10)] 7 | 8 | content = dash_vtk.View([ 9 | dash_vtk.VolumeRepresentation([ 10 | dash_vtk.VolumeController(), 11 | dash_vtk.ImageData( 12 | dimensions=[10, 10, 10], 13 | spacing=[1,1,1], 14 | origin=[-4,-4,-4], 15 | children=[ 16 | dash_vtk.PointData([ 17 | dash_vtk.DataArray( 18 | registration='setScalars', 19 | values=field, 20 | ) 21 | ]) 22 | ], 23 | ), 24 | ]), 25 | ]) 26 | 27 | # Dash setup 28 | app = dash.Dash(__name__) 29 | server = app.server 30 | 31 | app.layout = html.Div( 32 | style={"width": "100%", "height": "calc(100vh - 15px)"}, 33 | children=[content], 34 | ) 35 | 36 | if __name__ == "__main__": 37 | app.run_server(debug=True) 38 | -------------------------------------------------------------------------------- /docs/tutorials/s04_slice.py: -------------------------------------------------------------------------------- 1 | import dash 2 | import random 3 | import dash_html_components as html 4 | import dash_vtk 5 | 6 | field = [random.random()*i for i in range(10*10*10)] 7 | 8 | content = dash_vtk.View([ 9 | dash_vtk.SliceRepresentation( 10 | property={'colorWindow':500, 'colorLevel':200}, 11 | iSlice=5, 12 | children=[ 13 | dash_vtk.ImageData( 14 | dimensions=[10, 10, 10], 15 | spacing=[1, 1, 1], 16 | origin=[-4, -4, -4], 17 | children=[ 18 | dash_vtk.PointData([ 19 | dash_vtk.DataArray( 20 | registration='setScalars', 21 | values=field, 22 | ) 23 | ]) 24 | ], 25 | ), 26 | ], 27 | ), 28 | ]) 29 | 30 | # Dash setup 31 | app = dash.Dash(__name__) 32 | server = app.server 33 | 34 | app.layout = html.Div( 35 | style={"width": "100%", "height": "calc(100vh - 15px)"}, 36 | children=[content], 37 | ) 38 | 39 | if __name__ == "__main__": 40 | app.run_server(debug=True) 41 | -------------------------------------------------------------------------------- /docs/tutorials/s05_volume_slice.py: -------------------------------------------------------------------------------- 1 | import dash 2 | import random 3 | import dash_html_components as html 4 | import dash_vtk 5 | 6 | field = [random.random()*i for i in range(10*10*10)] 7 | 8 | content = dash_vtk.View([ 9 | dash_vtk.VolumeRepresentation([ 10 | dash_vtk.VolumeController(), 11 | dash_vtk.ShareDataSet([ 12 | dash_vtk.ImageData( 13 | dimensions=[10, 10, 10], 14 | spacing=[1, 1, 1], 15 | origin=[-4, -4, -4], 16 | children=[ 17 | dash_vtk.PointData([ 18 | dash_vtk.DataArray( 19 | registration='setScalars', 20 | values=field, 21 | ) 22 | ]) 23 | ], 24 | ), 25 | ]), 26 | ]), 27 | dash_vtk.SliceRepresentation( 28 | property={'colorWindow':500, 'colorLevel':200}, 29 | iSlice=5, 30 | children=[dash_vtk.ShareDataSet()], 31 | ), 32 | ]) 33 | 34 | # Dash setup 35 | app = dash.Dash(__name__) 36 | server = app.server 37 | 38 | app.layout = html.Div( 39 | style={"width": "100%", "height": "calc(100vh - 15px)"}, 40 | children=[content], 41 | ) 42 | 43 | if __name__ == "__main__": 44 | app.run_server(debug=True) 45 | -------------------------------------------------------------------------------- /docs/tutorials/s06_vtk_mesh.py: -------------------------------------------------------------------------------- 1 | import vtk 2 | import os 3 | import dash 4 | import dash_vtk 5 | from dash_vtk.utils import to_mesh_state 6 | import dash_html_components as html 7 | 8 | repo_path = os.path.dirname(os.path.dirname( 9 | os.path.dirname(os.path.abspath(__file__)))) 10 | head_vti = os.path.join(repo_path, 'demos', 'data', 'head.vti') 11 | 12 | # Load dataset from dist 13 | reader = vtk.vtkXMLImageDataReader() 14 | reader.SetFileName(head_vti) 15 | reader.Update() 16 | 17 | # Extract iso-mesh from image 18 | contour = vtk.vtkContourFilter() 19 | contour.SetInputConnection(reader.GetOutputPort()) 20 | contour.SetNumberOfContours(1) 21 | contour.SetValue(0, 1500) 22 | contour.Update() 23 | 24 | # Get mesh to dash_vtk 25 | mesh_state = to_mesh_state(contour.GetOutput()) 26 | 27 | content = dash_vtk.View([ 28 | dash_vtk.GeometryRepresentation([ 29 | dash_vtk.Mesh(state=mesh_state) 30 | ]), 31 | ]) 32 | 33 | # Dash setup 34 | app = dash.Dash(__name__) 35 | server = app.server 36 | app.layout = html.Div( 37 | style={"width": "100%", "height": "calc(100vh - 15px)"}, 38 | children=[content], 39 | ) 40 | 41 | if __name__ == "__main__": 42 | app.run_server(debug=True) 43 | -------------------------------------------------------------------------------- /docs/tutorials/s07_vtk_volume.py: -------------------------------------------------------------------------------- 1 | import vtk 2 | import os 3 | import dash 4 | import dash_vtk 5 | from dash_vtk.utils import to_volume_state 6 | import dash_html_components as html 7 | 8 | repo_path = os.path.dirname(os.path.dirname( 9 | os.path.dirname(os.path.abspath(__file__)))) 10 | head_vti = os.path.join(repo_path, 'demos', 'data', 'head.vti') 11 | 12 | # Load dataset from dist 13 | reader = vtk.vtkXMLImageDataReader() 14 | reader.SetFileName(head_vti) 15 | reader.Update() 16 | 17 | # Get mesh to dash_vtk 18 | volume_state = to_volume_state(reader.GetOutput()) 19 | 20 | content = dash_vtk.View([ 21 | dash_vtk.VolumeRepresentation([ 22 | dash_vtk.VolumeController(), 23 | dash_vtk.Volume(state=volume_state) 24 | ]), 25 | ]) 26 | 27 | # Dash setup 28 | app = dash.Dash(__name__) 29 | server = app.server 30 | app.layout = html.Div( 31 | style={"width": "100%", "height": "calc(100vh - 15px)"}, 32 | children=[content], 33 | ) 34 | 35 | if __name__ == "__main__": 36 | app.run_server(debug=True) 37 | -------------------------------------------------------------------------------- /docs/tutorials/t00_geometry_rendering.py: -------------------------------------------------------------------------------- 1 | import dash 2 | import dash_html_components as html 3 | 4 | import dash_vtk 5 | from dash_vtk.utils import to_mesh_state 6 | 7 | from vtk.vtkImagingCore import vtkRTAnalyticSource 8 | 9 | # Use VTK to get some data 10 | data_source = vtkRTAnalyticSource() 11 | data_source.Update() # <= Execute source to produce an output 12 | dataset = data_source.GetOutput() 13 | 14 | # Use helper to get a mesh structure that can be passed as-is to a Mesh 15 | # RTData is the name of the field 16 | mesh_state = to_mesh_state(dataset) 17 | 18 | content = dash_vtk.View([ 19 | dash_vtk.GeometryRepresentation([ 20 | dash_vtk.Mesh(state=mesh_state) 21 | ]), 22 | ]) 23 | 24 | # Dash setup 25 | app = dash.Dash(__name__) 26 | server = app.server 27 | 28 | app.layout = html.Div( 29 | style={"width": "100%", "height": "calc(100vh - 15px)"}, 30 | children=[content], 31 | ) 32 | 33 | if __name__ == "__main__": 34 | app.run_server(debug=True) 35 | -------------------------------------------------------------------------------- /docs/tutorials/t01_volume_rendering.py: -------------------------------------------------------------------------------- 1 | import dash 2 | import dash_html_components as html 3 | 4 | import dash_vtk 5 | from dash_vtk.utils import to_volume_state 6 | 7 | from vtk.vtkImagingCore import vtkRTAnalyticSource 8 | 9 | # Use VTK to get some data 10 | data_source = vtkRTAnalyticSource() 11 | data_source.Update() # <= Execute source to produce an output 12 | dataset = data_source.GetOutput() 13 | 14 | # Use helper to get a volume structure that can be passed as-is to a Volume 15 | volume_state = to_volume_state(dataset) # No need to select field 16 | 17 | content = dash_vtk.View([ 18 | dash_vtk.VolumeRepresentation([ 19 | # GUI to control Volume Rendering 20 | # + Setup good default at startup 21 | dash_vtk.VolumeController(), 22 | # Actual volume 23 | dash_vtk.Volume(state=volume_state), 24 | ]), 25 | ]) 26 | 27 | # Dash setup 28 | app = dash.Dash(__name__) 29 | server = app.server 30 | 31 | app.layout = html.Div( 32 | style={"width": "100%", "height": "calc(100vh - 15px)"}, 33 | children=[content], 34 | ) 35 | 36 | if __name__ == "__main__": 37 | app.run_server(debug=True) 38 | -------------------------------------------------------------------------------- /docs/tutorials/t02_imagedata.py: -------------------------------------------------------------------------------- 1 | import dash 2 | import dash_html_components as html 3 | 4 | import dash_vtk 5 | 6 | content = dash_vtk.View([ 7 | dash_vtk.VolumeRepresentation([ 8 | # GUI to control Volume Rendering 9 | # + Setup good default at startup 10 | dash_vtk.VolumeController(), 11 | # Actual Imagedata 12 | dash_vtk.ImageData( 13 | dimensions=[5, 5, 5], 14 | origin=[-2, -2, -2], 15 | spacing=[1, 1, 1], 16 | children=[ 17 | dash_vtk.PointData([ 18 | dash_vtk.DataArray( 19 | registration="setScalars", 20 | values=list(range(5*5*5)), 21 | ) 22 | ]) 23 | ], 24 | ), 25 | ]), 26 | ]) 27 | 28 | # Dash setup 29 | app = dash.Dash(__name__) 30 | server = app.server 31 | 32 | app.layout = html.Div( 33 | style={"width": "100%", "height": "calc(100vh - 15px)"}, 34 | children=[content], 35 | ) 36 | 37 | if __name__ == "__main__": 38 | app.run_server(debug=True) 39 | -------------------------------------------------------------------------------- /docs/tutorials/t03_polydata.py: -------------------------------------------------------------------------------- 1 | import dash 2 | import dash_html_components as html 3 | 4 | import dash_vtk 5 | 6 | content = dash_vtk.View([ 7 | dash_vtk.GeometryRepresentation( 8 | children=[ 9 | dash_vtk.PolyData( 10 | points=[ 11 | 0,0,0, 12 | 1,0,0, 13 | 0,1,0, 14 | 1,1,0, 15 | ], 16 | lines=[3, 1, 3, 2], 17 | polys=[3, 0, 1, 2], 18 | children=[ 19 | dash_vtk.PointData([ 20 | dash_vtk.DataArray( 21 | #registration='setScalars', # To activate field 22 | name='onPoints', 23 | values=[0, 0.33, 0.66, 1], 24 | ) 25 | ]), 26 | dash_vtk.CellData([ 27 | dash_vtk.DataArray( 28 | # registration='setScalars', # To activate field 29 | name='onCells', 30 | values=[0, 1], 31 | ) 32 | ]) 33 | ], 34 | ), 35 | ], 36 | ), 37 | ]) 38 | 39 | # Dash setup 40 | app = dash.Dash(__name__) 41 | server = app.server 42 | 43 | app.layout = html.Div( 44 | style={"width": "100%", "height": "calc(100vh - 15px)"}, 45 | children=[content], 46 | ) 47 | 48 | if __name__ == "__main__": 49 | app.run_server(debug=True) 50 | -------------------------------------------------------------------------------- /docs/tutorials/t04_algorithm.py: -------------------------------------------------------------------------------- 1 | import os 2 | import dash 3 | import dash_html_components as html 4 | 5 | import dash_vtk 6 | 7 | content = dash_vtk.View([ 8 | dash_vtk.GeometryRepresentation( 9 | mapper={ 10 | 'colorByArrayName': 'layer', 11 | 'scalarMode': 4, 12 | 'interpolateScalarsBeforeMapping': False, 13 | }, 14 | colorMapPreset="jet", 15 | colorDataRange=[0.2, 0.9], 16 | children=[ 17 | dash_vtk.Algorithm( 18 | vtkClass="vtkConcentricCylinderSource", 19 | state={ 20 | 'height': 0.25, 21 | 'radius': [0.2, 0.3, 0.4, 0.6, 0.7, 0.8, 0.9, 1], 22 | 'cellFields': [0, 0.2, 0.4, 0.6, 0.7, 0.8, 0.9, 1], 23 | 'mask': [1, 0, 1, 0, 1, 0, 1, 1], 24 | 'resolution': 60, 25 | 'skipInnerFaces': True, 26 | 'startTheta': 45, 27 | 'endTheta': 315, 28 | 'center': [0, 0, 0.5], 29 | }, 30 | ), 31 | ] 32 | ), 33 | ]) 34 | 35 | # Dash setup 36 | app = dash.Dash(__name__) 37 | server = app.server 38 | 39 | app.layout = html.Div( 40 | style={"width": "100%", "height": "calc(100vh - 15px)"}, 41 | children=[content], 42 | ) 43 | 44 | if __name__ == "__main__": 45 | app.run_server(debug=True) 46 | -------------------------------------------------------------------------------- /docs/tutorials/t05_reader.py: -------------------------------------------------------------------------------- 1 | import os 2 | import dash 3 | import dash_html_components as html 4 | 5 | import dash_vtk 6 | 7 | # Data file path 8 | files = ['cow-nonormals.obj', 'pumpkin_tall_10k.obj', 'teapot.obj', 'teddy.obj'] 9 | root_repo_path = os.path.dirname(os.path.dirname( 10 | os.path.dirname(os.path.abspath(__file__)))) 11 | obj_file = os.path.join(root_repo_path, "demos", "data", files[0]) 12 | 13 | 14 | txt_content = None 15 | with open(obj_file, 'r') as file: 16 | txt_content = file.read() 17 | 18 | content = dash_vtk.View([ 19 | dash_vtk.GeometryRepresentation([ 20 | dash_vtk.Reader( 21 | vtkClass="vtkOBJReader", 22 | parseAsText=txt_content, 23 | ), 24 | ]), 25 | ]) 26 | 27 | # Dash setup 28 | app = dash.Dash(__name__) 29 | server = app.server 30 | 31 | app.layout = html.Div( 32 | style={"width": "100%", "height": "calc(100vh - 15px)"}, 33 | children=[content], 34 | ) 35 | 36 | if __name__ == "__main__": 37 | app.run_server(debug=True) 38 | -------------------------------------------------------------------------------- /docs/tutorials/t06_shared_dataset.py: -------------------------------------------------------------------------------- 1 | import dash 2 | import dash_html_components as html 3 | 4 | import dash_vtk 5 | from dash_vtk.utils import to_volume_state 6 | 7 | from vtk.vtkImagingCore import vtkRTAnalyticSource 8 | 9 | # Use VTK to get some data 10 | data_source = vtkRTAnalyticSource() 11 | data_source.Update() # <= Execute source to produce an output 12 | dataset = data_source.GetOutput() 13 | 14 | # Use helper to get a volume structure that can be passed as-is to a Volume 15 | volume_state = to_volume_state(dataset) # No need to select field 16 | 17 | content = dash_vtk.View([ 18 | dash_vtk.VolumeRepresentation([ 19 | # GUI to control Volume Rendering 20 | # + Setup good default at startup 21 | dash_vtk.VolumeController(), 22 | # Actual volume 23 | dash_vtk.ShareDataSet([ 24 | dash_vtk.Volume(state=volume_state), 25 | ]), 26 | ]), 27 | dash_vtk.SliceRepresentation( 28 | iSlice=10, 29 | children=[ 30 | dash_vtk.ShareDataSet(), 31 | ] 32 | ), 33 | dash_vtk.SliceRepresentation( 34 | jSlice=10, 35 | children=[ 36 | dash_vtk.ShareDataSet(), 37 | ] 38 | ), 39 | dash_vtk.SliceRepresentation( 40 | kSlice=10, 41 | children=[ 42 | dash_vtk.ShareDataSet(), 43 | ] 44 | ), 45 | ]) 46 | 47 | # Dash setup 48 | app = dash.Dash(__name__) 49 | server = app.server 50 | 51 | app.layout = html.Div( 52 | style={"width": "100%", "height": "calc(100vh - 15px)"}, 53 | children=[content], 54 | ) 55 | 56 | if __name__ == "__main__": 57 | app.run_server(debug=True) 58 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | my-dash-component 5 | 6 | 7 |
8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /inst/deps/async-ReactVTK.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /*! 2 | * The buffer module from node.js, for the browser. 3 | * 4 | * @author Feross Aboukhadijeh 5 | * @license MIT 6 | */ 7 | 8 | /*! 9 | * The buffer module from node.js, for the browser. 10 | * 11 | * @author Feross Aboukhadijeh 12 | * @license MIT 13 | */ 14 | 15 | /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ 16 | 17 | /*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */ 18 | -------------------------------------------------------------------------------- /inst/deps/async-ReactVTK.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":[],"names":[],"mappings":"","file":"async-ReactVTK.js","sourceRoot":""} -------------------------------------------------------------------------------- /inst/deps/dash_vtk.min.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":[],"names":[],"mappings":"","file":"dash_vtk.min.js","sourceRoot":""} -------------------------------------------------------------------------------- /man/vtkAlgorithm.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{vtkAlgorithm} 3 | 4 | \alias{vtkAlgorithm} 5 | 6 | \title{Algorithm component} 7 | 8 | \description{ 9 | Algorithm is exposing a source or filter to a downstream filter It takes the following set of properties: - vtkClass: vtkClassName - state: {} 10 | } 11 | 12 | \usage{ 13 | vtkAlgorithm(children=NULL, id=NULL, port=NULL, state=NULL, vtkClass=NULL) 14 | } 15 | 16 | \arguments{ 17 | \item{children}{List of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number. } 18 | 19 | \item{id}{Character. The ID used to identify this component.} 20 | 21 | \item{port}{Numeric. downstream connection port} 22 | 23 | \item{state}{Named list. set of property values for vtkClass} 24 | 25 | \item{vtkClass}{Character. vtkClass name} 26 | } 27 | 28 | \value{named list of JSON elements corresponding to React.js properties and their values} 29 | 30 | -------------------------------------------------------------------------------- /man/vtkCalculator.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{vtkCalculator} 3 | 4 | \alias{vtkCalculator} 5 | 6 | \title{Calculator component} 7 | 8 | \description{ 9 | Calculator is exposing a source or filter to a downstream filter It takes the following set of properties: - name: 'scalars' // name of the generated field - location: 'POINT' // POINT/CELL - arrays: [] // Name of array to have access in formula - formula: fn 10 | } 11 | 12 | \usage{ 13 | vtkCalculator(children=NULL, id=NULL, arrays=NULL, formula=NULL, 14 | location=NULL, name=NULL, port=NULL) 15 | } 16 | 17 | \arguments{ 18 | \item{children}{List of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number. } 19 | 20 | \item{id}{Character. The ID used to identify this component.} 21 | 22 | \item{arrays}{List of characters. List of fields you want available for your formula} 23 | 24 | \item{formula}{Field formula} 25 | 26 | \item{location}{Character. Field location [POINT, CELL, COORDINATE, SCALARS, ]} 27 | 28 | \item{name}{Character. Field name} 29 | 30 | \item{port}{Numeric. downstream connection port} 31 | } 32 | 33 | \value{named list of JSON elements corresponding to React.js properties and their values} 34 | 35 | -------------------------------------------------------------------------------- /man/vtkCellData.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{vtkCellData} 3 | 4 | \alias{vtkCellData} 5 | 6 | \title{CellData component} 7 | 8 | \description{ 9 | CellData is exposing a vtkCellData to a downstream element 10 | } 11 | 12 | \usage{ 13 | vtkCellData(children=NULL) 14 | } 15 | 16 | \arguments{ 17 | \item{children}{List of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number. } 18 | } 19 | 20 | \value{named list of JSON elements corresponding to React.js properties and their values} 21 | 22 | -------------------------------------------------------------------------------- /man/vtkDataArray.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{vtkDataArray} 3 | 4 | \alias{vtkDataArray} 5 | 6 | \title{DataArray component} 7 | 8 | \description{ 9 | DataArray is creating a vtkDataArray for the container fields It takes the following set of properties: - type: 'Float32Array', 'Float64Array', 'Uint16Array', ... - values: [number, number, ...] - numberOfComponents: 1, - registration: 'addArray', 'setScalars', ... 10 | } 11 | 12 | \usage{ 13 | vtkDataArray(id=NULL, name=NULL, numberOfComponents=NULL, 14 | registration=NULL, type=NULL, values=NULL) 15 | } 16 | 17 | \arguments{ 18 | \item{id}{Character. The ID used to identify this component.} 19 | 20 | \item{name}{Character. Field name} 21 | 22 | \item{numberOfComponents}{Numeric. Number of components / Tuple size} 23 | 24 | \item{registration}{Character. Name of the method to call on the fieldData (addArray, setScalars, setVectors...)} 25 | 26 | \item{type}{Character. Typed array name} 27 | 28 | \item{values}{List of numerics. Actual values to use inside our array} 29 | } 30 | 31 | \value{named list of JSON elements corresponding to React.js properties and their values} 32 | 33 | -------------------------------------------------------------------------------- /man/vtkFieldData.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{vtkFieldData} 3 | 4 | \alias{vtkFieldData} 5 | 6 | \title{FieldData component} 7 | 8 | \description{ 9 | FieldData is exposing a FieldData to a downstream element 10 | } 11 | 12 | \usage{ 13 | vtkFieldData(children=NULL) 14 | } 15 | 16 | \arguments{ 17 | \item{children}{List of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number. } 18 | } 19 | 20 | \value{named list of JSON elements corresponding to React.js properties and their values} 21 | 22 | -------------------------------------------------------------------------------- /man/vtkGeometryRepresentation.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{vtkGeometryRepresentation} 3 | 4 | \alias{vtkGeometryRepresentation} 5 | 6 | \title{GeometryRepresentation component} 7 | 8 | \description{ 9 | GeometryRepresentation is responsible to convert a vtkPolyData into rendering It takes the following set of properties: - actor: Properties to assign to the vtkActor - mapper: Properties to assign to the vtkMapper - property: Properties to assign to the vtkProperty (actor.getProperty()) - colorMapPreset: Name of the preset to use for controlling the color mapping - colorDataRange: Range to use for the color scale 10 | } 11 | 12 | \usage{ 13 | vtkGeometryRepresentation(children=NULL, id=NULL, actor=NULL, colorDataRange=NULL, 14 | colorMapPreset=NULL, cubeAxesStyle=NULL, mapper=NULL, 15 | property=NULL, showCubeAxes=NULL) 16 | } 17 | 18 | \arguments{ 19 | \item{children}{List of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number. } 20 | 21 | \item{id}{Character. The ID used to identify this component.} 22 | 23 | \item{actor}{Named list. Properties to set to the actor} 24 | 25 | \item{colorDataRange}{List of numerics. Data range use for the colorMap} 26 | 27 | \item{colorMapPreset}{Character. Preset name for the lookup table color map} 28 | 29 | \item{cubeAxesStyle}{Named list. Configure cube Axes style by overriding the set of properties defined 30 | https://github.com/Kitware/vtk-js/blob/HEAD/Sources/Rendering/Core/CubeAxesActor/index.js#L703-L719} 31 | 32 | \item{mapper}{Named list. Properties to set to the actor} 33 | 34 | \item{property}{Named list. Properties to set to the actor.property} 35 | 36 | \item{showCubeAxes}{Logical. Show/Hide Cube Axes for the given representation} 37 | } 38 | 39 | \value{named list of JSON elements corresponding to React.js properties and their values} 40 | 41 | -------------------------------------------------------------------------------- /man/vtkGlyphRepresentation.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{vtkGlyphRepresentation} 3 | 4 | \alias{vtkGlyphRepresentation} 5 | 6 | \title{GlyphRepresentation component} 7 | 8 | \description{ 9 | GlyphRepresentation using a source on port=1 as Glyph and the points of the source on port=0 to position the given glyphs It takes the following set of properties: - actor: Properties to assign to the vtkActor - mapper: Properties to assign to the vtkGlyph3DMapper - property: Properties to assign to the vtkProperty (actor.getProperty()) - colorMapPreset: Name of the preset to use for controlling the color mapping - colorDataRange: Range to use for the color scale 10 | } 11 | 12 | \usage{ 13 | vtkGlyphRepresentation(children=NULL, id=NULL, actor=NULL, colorDataRange=NULL, 14 | colorMapPreset=NULL, mapper=NULL, property=NULL) 15 | } 16 | 17 | \arguments{ 18 | \item{children}{List of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number. } 19 | 20 | \item{id}{Character. The ID used to identify this component.} 21 | 22 | \item{actor}{Named list. Properties to set to the actor} 23 | 24 | \item{colorDataRange}{List of numerics. Data range use for the colorMap} 25 | 26 | \item{colorMapPreset}{Character. Preset name for the lookup table color map} 27 | 28 | \item{mapper}{Named list. Properties to set to the vtkGlyph3DMapper} 29 | 30 | \item{property}{Named list. Properties to set to the actor.property} 31 | } 32 | 33 | \value{named list of JSON elements corresponding to React.js properties and their values} 34 | 35 | -------------------------------------------------------------------------------- /man/vtkImageData.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{vtkImageData} 3 | 4 | \alias{vtkImageData} 5 | 6 | \title{ImageData component} 7 | 8 | \description{ 9 | ImageData is exposing a vtkImageData to a downstream filter It takes the following set of properties: - dimensions: [nx, ny, nz], - origin: [0, 0, 0] - spacing: [1, 1, 1] - direction: [ 1, 0, 0, 0, 1, 0, 0, 0, 1 ] 10 | } 11 | 12 | \usage{ 13 | vtkImageData(children=NULL, id=NULL, dimensions=NULL, direction=NULL, 14 | origin=NULL, port=NULL, spacing=NULL) 15 | } 16 | 17 | \arguments{ 18 | \item{children}{List of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number. } 19 | 20 | \item{id}{Character. The ID used to identify this component.} 21 | 22 | \item{dimensions}{List of numerics. Number of points along x, y, z} 23 | 24 | \item{direction}{List of numerics. 3x3 matrix use to orient the image data} 25 | 26 | \item{origin}{List of numerics. World coordinate of the lower left corner of your vtkImageData (i=0, j=0, k=0).} 27 | 28 | \item{port}{Numeric. downstream connection port} 29 | 30 | \item{spacing}{List of numerics. Spacing along x, y, z between points in world coordinates} 31 | } 32 | 33 | \value{named list of JSON elements corresponding to React.js properties and their values} 34 | 35 | -------------------------------------------------------------------------------- /man/vtkMesh.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{vtkMesh} 3 | 4 | \alias{vtkMesh} 5 | 6 | \title{Mesh component} 7 | 8 | \description{ 9 | Mesh is exposing a vtkPolyData to a downstream filter It takes the following set of properties: - state: { mesh: { ...polydata-props }, field: { ...dataArray } } 10 | } 11 | 12 | \usage{ 13 | vtkMesh(id=NULL, port=NULL, state=NULL) 14 | } 15 | 16 | \arguments{ 17 | \item{id}{Character. The ID used to identify this component.} 18 | 19 | \item{port}{Numeric. downstream connection port} 20 | 21 | \item{state}{Named list. State of the mesh} 22 | } 23 | 24 | \value{named list of JSON elements corresponding to React.js properties and their values} 25 | 26 | -------------------------------------------------------------------------------- /man/vtkPointCloudRepresentation.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{vtkPointCloudRepresentation} 3 | 4 | \alias{vtkPointCloudRepresentation} 5 | 6 | \title{PointCloudRepresentation component} 7 | 8 | \description{ 9 | PointCloudRepresentation expect the following set of properties - xyz: [x0, y0, z0, x1, ..., zn] - rgb: [...] - rgba: [...] - scalars: [...] 10 | } 11 | 12 | \usage{ 13 | vtkPointCloudRepresentation(colorDataRange=NULL, colorMapPreset=NULL, property=NULL, 14 | rgb=NULL, rgba=NULL, scalars=NULL, xyz=NULL) 15 | } 16 | 17 | \arguments{ 18 | \item{colorDataRange}{List of numerics. Data range use for the colorMap} 19 | 20 | \item{colorMapPreset}{Character. Preset name for the lookup table color map} 21 | 22 | \item{property}{Named list. Properties to set to the actor.property} 23 | 24 | \item{rgb}{List of numerics. Use RGB values to attach to the points/vertex} 25 | 26 | \item{rgba}{List of numerics. Use RGBA values to attach to the points/vertex} 27 | 28 | \item{scalars}{List of numerics. Field values to attach to the points} 29 | 30 | \item{xyz}{List of numerics. Points coordinates} 31 | } 32 | 33 | \value{named list of JSON elements corresponding to React.js properties and their values} 34 | 35 | -------------------------------------------------------------------------------- /man/vtkPointData.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{vtkPointData} 3 | 4 | \alias{vtkPointData} 5 | 6 | \title{PointData component} 7 | 8 | \description{ 9 | PointData is exposing a vtkPointData to a downstream element 10 | } 11 | 12 | \usage{ 13 | vtkPointData(children=NULL) 14 | } 15 | 16 | \arguments{ 17 | \item{children}{List of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number. } 18 | } 19 | 20 | \value{named list of JSON elements corresponding to React.js properties and their values} 21 | 22 | -------------------------------------------------------------------------------- /man/vtkPolyData.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{vtkPolyData} 3 | 4 | \alias{vtkPolyData} 5 | 6 | \title{PolyData component} 7 | 8 | \description{ 9 | PolyData is exposing a vtkPolyData to a downstream filter It takes the following set of properties: - points: [x, y, z, x, y, z, ...], - verts: [cellSize, pointId0, pointId1, ..., cellSize, pointId0, ...] - lines: [cellSize, pointId0, pointId1, ..., cellSize, pointId0, ...] - polys: [cellSize, pointId0, pointId1, ..., cellSize, pointId0, ...] - strips: [cellSize, pointId0, pointId1, ..., cellSize, pointId0, ...] Cell connectivity helper property: - connectivity: 'manual', // [manual, points, triangles, strips] 10 | } 11 | 12 | \usage{ 13 | vtkPolyData(children=NULL, id=NULL, connectivity=NULL, lines=NULL, 14 | points=NULL, polys=NULL, port=NULL, strips=NULL, verts=NULL) 15 | } 16 | 17 | \arguments{ 18 | \item{children}{List of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number. } 19 | 20 | \item{id}{Character. The ID used to identify this component.} 21 | 22 | \item{connectivity}{Character. Type of connectivity `manual` or implicit such as `points`, `triangles`, `strips`} 23 | 24 | \item{lines}{List of numerics. lines cells} 25 | 26 | \item{points}{List of numerics. xyz coordinates} 27 | 28 | \item{polys}{List of numerics. polys cells} 29 | 30 | \item{port}{Numeric. downstream connection port} 31 | 32 | \item{strips}{List of numerics. strips cells} 33 | 34 | \item{verts}{List of numerics. verts cells} 35 | } 36 | 37 | \value{named list of JSON elements corresponding to React.js properties and their values} 38 | 39 | -------------------------------------------------------------------------------- /man/vtkReader.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{vtkReader} 3 | 4 | \alias{vtkReader} 5 | 6 | \title{Reader component} 7 | 8 | \description{ 9 | Reader is exposing a reader to a downstream filter It takes the following set of properties: - vtkClass: vtk.js reader class name - url: string - parseAsText: string - parseAsArrayBuffer: base64String 10 | } 11 | 12 | \usage{ 13 | vtkReader(children=NULL, id=NULL, parseAsArrayBuffer=NULL, 14 | parseAsText=NULL, port=NULL, renderOnUpdate=NULL, 15 | resetCameraOnUpdate=NULL, url=NULL, vtkClass=NULL) 16 | } 17 | 18 | \arguments{ 19 | \item{children}{List of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number. } 20 | 21 | \item{id}{Character. The ID used to identify this component.} 22 | 23 | \item{parseAsArrayBuffer}{Character. set binary data to process from base64 string} 24 | 25 | \item{parseAsText}{Character. set text data to process} 26 | 27 | \item{port}{Numeric. downstream connection port} 28 | 29 | \item{renderOnUpdate}{Logical. Automatically render on data loaded} 30 | 31 | \item{resetCameraOnUpdate}{Logical. Automatically reset camera on data loaded} 32 | 33 | \item{url}{Character. set of url to fetch data from} 34 | 35 | \item{vtkClass}{Character. vtkClass name} 36 | } 37 | 38 | \value{named list of JSON elements corresponding to React.js properties and their values} 39 | 40 | -------------------------------------------------------------------------------- /man/vtkShareDataSet.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{vtkShareDataSet} 3 | 4 | \alias{vtkShareDataSet} 5 | 6 | \title{ShareDataSet component} 7 | 8 | \description{ 9 | ShareDataSet capture a dataset or a source and allow it to use it in another pipeline or representation. 10 | } 11 | 12 | \usage{ 13 | vtkShareDataSet(children=NULL, id=NULL, name=NULL, port=NULL) 14 | } 15 | 16 | \arguments{ 17 | \item{children}{List of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number. } 18 | 19 | \item{id}{Character. The ID used to identify this component.} 20 | 21 | \item{name}{Character. Unique dataset name to cross reference} 22 | 23 | \item{port}{Numeric. downstream connection port} 24 | } 25 | 26 | \value{named list of JSON elements corresponding to React.js properties and their values} 27 | 28 | -------------------------------------------------------------------------------- /man/vtkSliceRepresentation.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{vtkSliceRepresentation} 3 | 4 | \alias{vtkSliceRepresentation} 5 | 6 | \title{SliceRepresentation component} 7 | 8 | \description{ 9 | SliceRepresentation is responsible to convert a vtkPolyData into rendering It takes the following set of properties: - colorBy: ['POINTS', ''], - pointSize: 1, - color: [1,1,1], 10 | } 11 | 12 | \usage{ 13 | vtkSliceRepresentation(children=NULL, id=NULL, actor=NULL, colorDataRange=NULL, 14 | colorMapPreset=NULL, iSlice=NULL, jSlice=NULL, kSlice=NULL, 15 | mapper=NULL, property=NULL, xSlice=NULL, ySlice=NULL, 16 | zSlice=NULL) 17 | } 18 | 19 | \arguments{ 20 | \item{children}{List of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number. } 21 | 22 | \item{id}{Character. The ID used to identify this component.} 23 | 24 | \item{actor}{Named list. Properties to set to the slice/actor} 25 | 26 | \item{colorDataRange}{List of numerics | character. Data range use for the colorMap} 27 | 28 | \item{colorMapPreset}{Character. Preset name for the lookup table color map} 29 | 30 | \item{iSlice}{Numeric. index of the slice along i} 31 | 32 | \item{jSlice}{Numeric. index of the slice along j} 33 | 34 | \item{kSlice}{Numeric. index of the slice along k} 35 | 36 | \item{mapper}{Named list. Properties to set to the mapper} 37 | 38 | \item{property}{Named list. Properties to set to the volume.property} 39 | 40 | \item{xSlice}{Numeric. index of the slice along x} 41 | 42 | \item{ySlice}{Numeric. index of the slice along y} 43 | 44 | \item{zSlice}{Numeric. index of the slice along z} 45 | } 46 | 47 | \value{named list of JSON elements corresponding to React.js properties and their values} 48 | 49 | -------------------------------------------------------------------------------- /man/vtkVolume.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{vtkVolume} 3 | 4 | \alias{vtkVolume} 5 | 6 | \title{Volume component} 7 | 8 | \description{ 9 | Volume is exposing a vtkImageData to a downstream filter It takes the following set of properties: - state: { image: { ...imagedata-props }, field: { ...dataArray } } 10 | } 11 | 12 | \usage{ 13 | vtkVolume(id=NULL, port=NULL, state=NULL) 14 | } 15 | 16 | \arguments{ 17 | \item{id}{Character. The ID used to identify this component.} 18 | 19 | \item{port}{Numeric. downstream connection port} 20 | 21 | \item{state}{Named list. State of the volume} 22 | } 23 | 24 | \value{named list of JSON elements corresponding to React.js properties and their values} 25 | 26 | -------------------------------------------------------------------------------- /man/vtkVolumeController.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{vtkVolumeController} 3 | 4 | \alias{vtkVolumeController} 5 | 6 | \title{VolumeController component} 7 | 8 | \description{ 9 | VolumeController is a GUI to control the piecewise function 10 | } 11 | 12 | \usage{ 13 | vtkVolumeController(id=NULL, rescaleColorMap=NULL, size=NULL) 14 | } 15 | 16 | \arguments{ 17 | \item{id}{Character. The ID used to identify this component.} 18 | 19 | \item{rescaleColorMap}{Logical. Use opacity range to rescale color map} 20 | 21 | \item{size}{List of numerics. Controller size in pixels} 22 | } 23 | 24 | \value{named list of JSON elements corresponding to React.js properties and their values} 25 | 26 | -------------------------------------------------------------------------------- /man/vtkVolumeDataRepresentation.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{vtkVolumeDataRepresentation} 3 | 4 | \alias{vtkVolumeDataRepresentation} 5 | 6 | \title{VolumeDataRepresentation component} 7 | 8 | \description{ 9 | VolumeDataRepresentation expect the following set of properties - dimensions: [10, 20, 5] - spacing: [1, 1, 1] - origin: [0, 0, 0] - rgb: [...] - rgba: [...] - scalars: [...] - scalarsType: Float32Array 10 | } 11 | 12 | \usage{ 13 | vtkVolumeDataRepresentation(id=NULL, colorDataRange=NULL, colorMapPreset=NULL, 14 | controllerSize=NULL, dimensions=NULL, mapper=NULL, 15 | origin=NULL, property=NULL, rescaleColorMap=NULL, rgb=NULL, 16 | rgba=NULL, scalars=NULL, scalarsType=NULL, spacing=NULL, 17 | volume=NULL, volumeController=NULL) 18 | } 19 | 20 | \arguments{ 21 | \item{id}{Character. The ID used to identify this component.} 22 | 23 | \item{colorDataRange}{List of numerics | character. Data range use for the colorMap} 24 | 25 | \item{colorMapPreset}{Character. Preset name for the lookup table color map} 26 | 27 | \item{controllerSize}{List of numerics. Controller size in pixels} 28 | 29 | \item{dimensions}{List of numerics. Number of points along x, y, z} 30 | 31 | \item{mapper}{Named list. Properties to set to the mapper} 32 | 33 | \item{origin}{List of numerics. World coordinate of the lower left corner of your vtkImageData (i=0, j=0, k=0).} 34 | 35 | \item{property}{Named list. Properties to set to the volume.property} 36 | 37 | \item{rescaleColorMap}{Logical. Use opacity range to rescale color map} 38 | 39 | \item{rgb}{List of numerics. Use RGB values to attach to the points/vertex} 40 | 41 | \item{rgba}{List of numerics. Use RGBA values to attach to the points/vertex} 42 | 43 | \item{scalars}{List of numerics. Field values to attach to the points} 44 | 45 | \item{scalarsType}{Character. Types of numbers provided in scalars} 46 | 47 | \item{spacing}{List of numerics. Spacing along x, y, z between points in world coordinates} 48 | 49 | \item{volume}{Named list. Properties to set to the volume} 50 | 51 | \item{volumeController}{Logical. Show volumeController} 52 | } 53 | 54 | \value{named list of JSON elements corresponding to React.js properties and their values} 55 | 56 | -------------------------------------------------------------------------------- /man/vtkVolumeRepresentation.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{vtkVolumeRepresentation} 3 | 4 | \alias{vtkVolumeRepresentation} 5 | 6 | \title{VolumeRepresentation component} 7 | 8 | \description{ 9 | VolumeRepresentation is responsible to convert a vtkPolyData into rendering It takes the following set of properties: - colorBy: ['POINTS', ''], - pointSize: 1, - color: [1,1,1], 10 | } 11 | 12 | \usage{ 13 | vtkVolumeRepresentation(children=NULL, id=NULL, colorDataRange=NULL, 14 | colorMapPreset=NULL, mapper=NULL, property=NULL, volume=NULL) 15 | } 16 | 17 | \arguments{ 18 | \item{children}{List of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number. } 19 | 20 | \item{id}{Character. The ID used to identify this component.} 21 | 22 | \item{colorDataRange}{List of numerics | character. Data range use for the colorMap} 23 | 24 | \item{colorMapPreset}{Character. Preset name for the lookup table color map} 25 | 26 | \item{mapper}{Named list. Properties to set to the mapper} 27 | 28 | \item{property}{Named list. Properties to set to the volume.property} 29 | 30 | \item{volume}{Named list. Properties to set to the volume} 31 | } 32 | 33 | \value{named list of JSON elements corresponding to React.js properties and their values} 34 | 35 | -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | testpaths = tests/ 3 | addopts = -rsxX -vv 4 | log_format = %(asctime)s | %(levelname)s | %(name)s:%(lineno)d | %(message)s 5 | log_cli_level = ERROR 6 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # dash is required to call `build:py` 2 | dash[dev]>=1.15.0 3 | -e . 4 | vtk -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import io 2 | import json 3 | import os 4 | from setuptools import setup, find_packages 5 | 6 | 7 | with open('package.json') as f: 8 | package = json.load(f) 9 | 10 | package_name = package["name"].replace(" ", "_").replace("-", "_") 11 | 12 | setup( 13 | name=package_name, 14 | version=package["version"], 15 | author=package['author'], 16 | packages=find_packages(include=[package_name, package_name + ".*"]), 17 | include_package_data=True, 18 | license=package['license'], 19 | description=package.get('description', package_name), 20 | long_description=io.open('README.md', encoding='utf-8').read(), 21 | long_description_content_type='text/markdown', 22 | url='https://github.com/plotly/dash-vtk', 23 | install_requires=['dash', 'vtk'], 24 | classifiers=[ 25 | 'Environment :: Web Environment', 26 | 'Intended Audience :: Developers', 27 | 'Intended Audience :: Education', 28 | 'Intended Audience :: Financial and Insurance Industry', 29 | 'Intended Audience :: Healthcare Industry', 30 | 'Intended Audience :: Manufacturing', 31 | 'Intended Audience :: Science/Research', 32 | 'Programming Language :: Python', 33 | 'Programming Language :: Python :: 3', 34 | 'Programming Language :: Python :: 3.6', 35 | 'Programming Language :: Python :: 3.7', 36 | 'Topic :: Database :: Front-Ends', 37 | 'Topic :: Scientific/Engineering :: Visualization', 38 | 'Topic :: Software Development :: Libraries :: Application Frameworks', 39 | ] 40 | ) 41 | -------------------------------------------------------------------------------- /src/DashVtk.jl: -------------------------------------------------------------------------------- 1 | 2 | module DashVtk 3 | using Dash 4 | 5 | const resources_path = realpath(joinpath( @__DIR__, "..", "deps")) 6 | const version = "0.0.9" 7 | 8 | include("vtk_algorithm.jl") 9 | include("vtk_calculator.jl") 10 | include("vtk_celldata.jl") 11 | include("vtk_dataarray.jl") 12 | include("vtk_fielddata.jl") 13 | include("vtk_geometryrepresentation.jl") 14 | include("vtk_glyphrepresentation.jl") 15 | include("vtk_imagedata.jl") 16 | include("vtk_mesh.jl") 17 | include("vtk_pointcloudrepresentation.jl") 18 | include("vtk_pointdata.jl") 19 | include("vtk_polydata.jl") 20 | include("vtk_reader.jl") 21 | include("vtk_sharedataset.jl") 22 | include("vtk_slicerepresentation.jl") 23 | include("vtk_view.jl") 24 | include("vtk_volume.jl") 25 | include("vtk_volumecontroller.jl") 26 | include("vtk_volumedatarepresentation.jl") 27 | include("vtk_volumerepresentation.jl") 28 | 29 | function __init__() 30 | DashBase.register_package( 31 | DashBase.ResourcePkg( 32 | "dash_vtk", 33 | resources_path, 34 | version = version, 35 | [ 36 | DashBase.Resource( 37 | relative_package_path = "dash_vtk.min.js", 38 | external_url = "https://unpkg.com/dash_vtk@0.0.9/dash_vtk/dash_vtk.min.js", 39 | dynamic = nothing, 40 | async = nothing, 41 | type = :js 42 | ), 43 | DashBase.Resource( 44 | relative_package_path = "dash_vtk.min.js.map", 45 | external_url = "https://unpkg.com/dash_vtk@0.0.9/dash_vtk/dash_vtk.min.js.map", 46 | dynamic = true, 47 | async = nothing, 48 | type = :js 49 | ), 50 | DashBase.Resource( 51 | relative_package_path = "async-ReactVTK.js", 52 | external_url = "https://unpkg.com/dash_vtk@0.0.9/dash_vtk/async-ReactVTK.js", 53 | dynamic = nothing, 54 | async = :true, 55 | type = :js 56 | ), 57 | DashBase.Resource( 58 | relative_package_path = "async-ReactVTK.js.map", 59 | external_url = "https://unpkg.com/dash_vtk@0.0.9/dash_vtk/async-ReactVTK.js.map", 60 | dynamic = true, 61 | async = nothing, 62 | type = :js 63 | ) 64 | ] 65 | ) 66 | 67 | ) 68 | end 69 | end 70 | -------------------------------------------------------------------------------- /src/demo/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | ReactDOM.render(, document.getElementById('root')); 6 | -------------------------------------------------------------------------------- /src/lib/AsyncReactVTK.js: -------------------------------------------------------------------------------- 1 | import { lazy } from 'react'; 2 | 3 | /** 4 | * fakeModules: We need to trick React.lazy into thinking we are 5 | * giving the output of an import("my-module.js") Promise. 6 | */ 7 | const asyncComponentBuilder = name => async () => { 8 | // eslint-disable-next-line 9 | const AsyncReactVTK = import(/* webpackChunkName: "ReactVTK" */ './ReactVTK'); 10 | const ReactVTK = await AsyncReactVTK; 11 | 12 | const reactComponent = ReactVTK.default[name]; 13 | const fakeModule = { default: reactComponent }; 14 | return fakeModule; 15 | } 16 | 17 | const Algorithm = lazy(asyncComponentBuilder("Algorithm")); 18 | const Calculator = lazy(asyncComponentBuilder("Calculator")); 19 | const CellData = lazy(asyncComponentBuilder("CellData")); 20 | const DataArray = lazy(asyncComponentBuilder("DataArray")); 21 | const FieldData = lazy(asyncComponentBuilder("FieldData")); 22 | const GeometryRepresentation = lazy(asyncComponentBuilder("GeometryRepresentation")); 23 | const GlyphRepresentation = lazy(asyncComponentBuilder("GlyphRepresentation")); 24 | const ImageData = lazy(asyncComponentBuilder("ImageData")); 25 | const PointCloudRepresentation = lazy(asyncComponentBuilder("PointCloudRepresentation")); 26 | const PointData = lazy(asyncComponentBuilder("PointData")); 27 | const PolyData = lazy(asyncComponentBuilder("PolyData")); 28 | const Reader = lazy(asyncComponentBuilder("Reader")); 29 | const SliceRepresentation = lazy(asyncComponentBuilder("SliceRepresentation")); 30 | const ShareDataSet = lazy(asyncComponentBuilder("ShareDataSet")); 31 | const View = lazy(asyncComponentBuilder("View")); 32 | const Volume = lazy(asyncComponentBuilder("Volume")); 33 | const VolumeController = lazy(asyncComponentBuilder("VolumeController")); 34 | const VolumeDataRepresentation = lazy(asyncComponentBuilder("VolumeDataRepresentation")); 35 | const VolumeRepresentation = lazy(asyncComponentBuilder("VolumeRepresentation")); 36 | 37 | 38 | export { 39 | Algorithm, 40 | Calculator, 41 | CellData, 42 | DataArray, 43 | FieldData, 44 | GeometryRepresentation, 45 | GlyphRepresentation, 46 | ImageData, 47 | PointCloudRepresentation, 48 | PointData, 49 | PolyData, 50 | Reader, 51 | SliceRepresentation, 52 | ShareDataSet, 53 | View, 54 | Volume, 55 | VolumeController, 56 | VolumeDataRepresentation, 57 | VolumeRepresentation, 58 | }; 59 | -------------------------------------------------------------------------------- /src/lib/ReactVTK.js: -------------------------------------------------------------------------------- 1 | import * as ReactVTK from 'react-vtk-js'; 2 | export default ReactVTK; -------------------------------------------------------------------------------- /src/lib/components/Algorithm.react.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | import { Algorithm as VtkItem } from '../AsyncReactVTK'; 5 | 6 | 7 | /** 8 | * Algorithm is exposing a source or filter to a downstream filter 9 | * It takes the following set of properties: 10 | * - vtkClass: vtkClassName 11 | * - state: {} 12 | */ 13 | export default function Algorithm(props) { 14 | return ; 15 | }; 16 | 17 | Algorithm.defaultProps = { 18 | port: 0, 19 | vtkClass: 'vtkConeSource', 20 | state: {}, 21 | }; 22 | 23 | Algorithm.propTypes = { 24 | /** 25 | * The ID used to identify this component. 26 | */ 27 | id: PropTypes.string, 28 | 29 | /** 30 | * downstream connection port 31 | */ 32 | port: PropTypes.number, 33 | 34 | /** 35 | * vtkClass name 36 | */ 37 | vtkClass: PropTypes.string, 38 | 39 | /** 40 | * set of property values for vtkClass 41 | */ 42 | state: PropTypes.object, 43 | 44 | children: PropTypes.oneOfType([ 45 | PropTypes.arrayOf(PropTypes.node), 46 | PropTypes.node, 47 | ]), 48 | }; 49 | -------------------------------------------------------------------------------- /src/lib/components/Calculator.react.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | import { Calculator as VtkItem } from '../AsyncReactVTK'; 5 | 6 | /** 7 | * Calculator is exposing a source or filter to a downstream filter 8 | * It takes the following set of properties: 9 | * - name: 'scalars' // name of the generated field 10 | * - location: 'POINT' // POINT/CELL 11 | * - arrays: [] // Name of array to have access in formula 12 | * - formula: fn 13 | */ 14 | export default function Calculator(props) { 15 | return ; 16 | }; 17 | 18 | Calculator.defaultProps = { 19 | port: 0, 20 | name: 'scalars', 21 | location: 'POINT', 22 | arrays: [], 23 | formula: (xyz) => xyz[0], 24 | }; 25 | 26 | Calculator.propTypes = { 27 | /** 28 | * The ID used to identify this component. 29 | */ 30 | id: PropTypes.string, 31 | 32 | /** 33 | * downstream connection port 34 | */ 35 | port: PropTypes.number, 36 | 37 | /** 38 | * Field name 39 | */ 40 | name: PropTypes.string, 41 | 42 | /** 43 | * Field location [POINT, CELL, COORDINATE, SCALARS, ] 44 | */ 45 | location: PropTypes.string, 46 | 47 | /** 48 | * List of fields you want available for your formula 49 | */ 50 | arrays: PropTypes.arrayOf(PropTypes.string), 51 | 52 | /** 53 | * Field formula 54 | */ 55 | formula: PropTypes.func, 56 | 57 | children: PropTypes.oneOfType([ 58 | PropTypes.arrayOf(PropTypes.node), 59 | PropTypes.node, 60 | ]), 61 | }; 62 | -------------------------------------------------------------------------------- /src/lib/components/CellData.react.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | import { CellData as VtkItem } from '../AsyncReactVTK'; 5 | 6 | /** 7 | * CellData is exposing a vtkCellData to a downstream element 8 | */ 9 | export default function CellData(props) { 10 | return ; 11 | }; 12 | 13 | CellData.defaultProps = {}; 14 | 15 | CellData.propTypes = { 16 | children: PropTypes.oneOfType([ 17 | PropTypes.arrayOf(PropTypes.node), 18 | PropTypes.node, 19 | ]), 20 | }; 21 | -------------------------------------------------------------------------------- /src/lib/components/DataArray.react.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | import { DataArray as VtkItem } from '../AsyncReactVTK'; 5 | 6 | /** 7 | * DataArray is creating a vtkDataArray for the container fields 8 | * It takes the following set of properties: 9 | * - type: 'Float32Array', 'Float64Array', 'Uint16Array', ... 10 | * - values: [number, number, ...] 11 | * - numberOfComponents: 1, 12 | * - registration: 'addArray', 'setScalars', ... 13 | */ 14 | export default function DataArray(props) { 15 | return ; 16 | }; 17 | 18 | DataArray.defaultProps = { 19 | name: 'scalars', 20 | type: 'Float32Array', 21 | values: [], 22 | numberOfComponents: 1, 23 | registration: 'addArray', 24 | }; 25 | 26 | DataArray.propTypes = { 27 | /** 28 | * The ID used to identify this component. 29 | */ 30 | id: PropTypes.string, 31 | 32 | /** 33 | * Typed array name 34 | */ 35 | type: PropTypes.string, 36 | 37 | /** 38 | * Field name 39 | */ 40 | name: PropTypes.string, 41 | 42 | /** 43 | * Actual values to use inside our array 44 | */ 45 | values: PropTypes.arrayOf(PropTypes.number), 46 | 47 | /** 48 | * Number of components / Tuple size 49 | */ 50 | numberOfComponents: PropTypes.number, 51 | 52 | /** 53 | * Name of the method to call on the fieldData (addArray, setScalars, setVectors...) 54 | */ 55 | registration: PropTypes.string, 56 | }; 57 | -------------------------------------------------------------------------------- /src/lib/components/FieldData.react.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | import { FieldData as VtkItem } from '../AsyncReactVTK'; 5 | 6 | /** 7 | * FieldData is exposing a FieldData to a downstream element 8 | */ 9 | export default function FieldData(props) { 10 | return ; 11 | }; 12 | 13 | FieldData.defaultProps = {}; 14 | 15 | FieldData.propTypes = { 16 | children: PropTypes.oneOfType([ 17 | PropTypes.arrayOf(PropTypes.node), 18 | PropTypes.node, 19 | ]), 20 | }; 21 | -------------------------------------------------------------------------------- /src/lib/components/GlyphRepresentation.react.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | import { GlyphRepresentation as VtkItem } from '../AsyncReactVTK'; 5 | 6 | /** 7 | * GlyphRepresentation using a source on port=1 as Glyph and the points of the source on port=0 to position the given glyphs 8 | * It takes the following set of properties: 9 | * - actor: Properties to assign to the vtkActor 10 | * - mapper: Properties to assign to the vtkGlyph3DMapper 11 | * - property: Properties to assign to the vtkProperty (actor.getProperty()) 12 | * - colorMapPreset: Name of the preset to use for controlling the color mapping 13 | * - colorDataRange: Range to use for the color scale 14 | */ 15 | export default function GeometryRepresentation(props) { 16 | return ; 17 | }; 18 | 19 | GeometryRepresentation.defaultProps = { 20 | colorMapPreset: 'erdc_rainbow_bright', 21 | colorDataRange: [0, 1], 22 | }; 23 | 24 | GeometryRepresentation.propTypes = { 25 | /** 26 | * The ID used to identify this component. 27 | */ 28 | id: PropTypes.string, 29 | 30 | /** 31 | * Properties to set to the actor 32 | */ 33 | actor: PropTypes.object, 34 | 35 | /** 36 | * Properties to set to the vtkGlyph3DMapper 37 | */ 38 | mapper: PropTypes.object, 39 | 40 | /** 41 | * Properties to set to the actor.property 42 | */ 43 | property: PropTypes.object, 44 | 45 | /** 46 | * Preset name for the lookup table color map 47 | */ 48 | colorMapPreset: PropTypes.string, 49 | 50 | /** 51 | * Data range use for the colorMap 52 | */ 53 | colorDataRange: PropTypes.arrayOf(PropTypes.number), 54 | 55 | children: PropTypes.oneOfType([ 56 | PropTypes.arrayOf(PropTypes.node), 57 | PropTypes.node, 58 | ]), 59 | }; 60 | -------------------------------------------------------------------------------- /src/lib/components/ImageData.react.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | import { ImageData as VtkItem } from '../AsyncReactVTK'; 5 | 6 | /** 7 | * ImageData is exposing a vtkImageData to a downstream filter 8 | * It takes the following set of properties: 9 | * - dimensions: [nx, ny, nz], 10 | * - origin: [0, 0, 0] 11 | * - spacing: [1, 1, 1] 12 | * - direction: [ 13 | * 1, 0, 0, 14 | * 0, 1, 0, 15 | * 0, 0, 1 16 | * ] 17 | */ 18 | export default function ImageData(props) { 19 | return ; 20 | }; 21 | 22 | ImageData.defaultProps = { 23 | port: 0, 24 | dimensions: [1, 1, 1], 25 | spacing: [1, 1, 1], 26 | origin: [0, 0, 0], 27 | direction: [ 28 | 1, 0, 0, 29 | 0, 1, 0, 30 | 0, 0, 1, 31 | ], 32 | }; 33 | 34 | ImageData.propTypes = { 35 | /** 36 | * The ID used to identify this component. 37 | */ 38 | id: PropTypes.string, 39 | 40 | /** 41 | * downstream connection port 42 | */ 43 | port: PropTypes.number, 44 | 45 | /** 46 | * Number of points along x, y, z 47 | */ 48 | dimensions: PropTypes.arrayOf(PropTypes.number), 49 | 50 | /** 51 | * Spacing along x, y, z between points in world coordinates 52 | */ 53 | spacing: PropTypes.arrayOf(PropTypes.number), 54 | 55 | /** 56 | * World coordinate of the lower left corner of your vtkImageData (i=0, j=0, k=0). 57 | */ 58 | origin: PropTypes.arrayOf(PropTypes.number), 59 | 60 | /** 61 | * 3x3 matrix use to orient the image data 62 | */ 63 | direction: PropTypes.arrayOf(PropTypes.number), 64 | 65 | children: PropTypes.oneOfType([ 66 | PropTypes.arrayOf(PropTypes.node), 67 | PropTypes.node, 68 | ]), 69 | }; 70 | -------------------------------------------------------------------------------- /src/lib/components/Mesh.react.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | import { PolyData, PointData, CellData, DataArray } from '../AsyncReactVTK'; 5 | 6 | /** 7 | * Mesh is exposing a vtkPolyData to a downstream filter 8 | * It takes the following set of properties: 9 | * - state: { mesh: { ...polydata-props }, field: { ...dataArray } } 10 | */ 11 | export default function Mesh(props) { 12 | return ( 13 | 14 | 19 | 20 | {props.state.field && props.state.field.location === 'PointData' && 21 | 25 | } 26 | {props.state.pointArrays && props.state.pointArrays.map((array) => ())} 27 | 28 | 29 | {props.state.field && props.state.field.location === 'CellData' && 30 | 34 | } 35 | {props.state.cellArrays && props.state.cellArrays.map((array) => ())} 36 | 37 | 38 | 39 | ); 40 | }; 41 | 42 | Mesh.defaultProps = { 43 | port: 0, 44 | state: { 45 | mesh: { points: [] }, 46 | } 47 | }; 48 | 49 | Mesh.propTypes = { 50 | /** 51 | * The ID used to identify this component. 52 | */ 53 | id: PropTypes.string, 54 | 55 | /** 56 | * downstream connection port 57 | */ 58 | port: PropTypes.number, 59 | 60 | /** 61 | * State of the mesh 62 | */ 63 | state: PropTypes.object, 64 | }; 65 | -------------------------------------------------------------------------------- /src/lib/components/PointData.react.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | import { PointData as VtkItem } from '../AsyncReactVTK'; 5 | 6 | /** 7 | * PointData is exposing a vtkPointData to a downstream element 8 | */ 9 | export default function PointData(props) { 10 | return ; 11 | }; 12 | 13 | PointData.defaultProps = {}; 14 | 15 | PointData.propTypes = { 16 | children: PropTypes.oneOfType([ 17 | PropTypes.arrayOf(PropTypes.node), 18 | PropTypes.node, 19 | ]), 20 | }; 21 | -------------------------------------------------------------------------------- /src/lib/components/PolyData.react.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | import { PolyData as VtkItem } from '../AsyncReactVTK'; 5 | 6 | /** 7 | * PolyData is exposing a vtkPolyData to a downstream filter 8 | * It takes the following set of properties: 9 | * - points: [x, y, z, x, y, z, ...], 10 | * - verts: [cellSize, pointId0, pointId1, ..., cellSize, pointId0, ...] 11 | * - lines: [cellSize, pointId0, pointId1, ..., cellSize, pointId0, ...] 12 | * - polys: [cellSize, pointId0, pointId1, ..., cellSize, pointId0, ...] 13 | * - strips: [cellSize, pointId0, pointId1, ..., cellSize, pointId0, ...] 14 | * Cell connectivity helper property: 15 | * - connectivity: 'manual', // [manual, points, triangles, strips] 16 | */ 17 | export default function PolyData(props) { 18 | return ; 19 | }; 20 | 21 | PolyData.defaultProps = { 22 | port: 0, 23 | points: [], 24 | connectivity: 'manual', 25 | }; 26 | 27 | PolyData.propTypes = { 28 | /** 29 | * The ID used to identify this component. 30 | */ 31 | id: PropTypes.string, 32 | 33 | /** 34 | * downstream connection port 35 | */ 36 | port: PropTypes.number, 37 | 38 | /** 39 | * xyz coordinates 40 | */ 41 | points: PropTypes.arrayOf(PropTypes.number), 42 | 43 | /** 44 | * verts cells 45 | */ 46 | verts: PropTypes.arrayOf(PropTypes.number), 47 | 48 | /** 49 | * lines cells 50 | */ 51 | lines: PropTypes.arrayOf(PropTypes.number), 52 | 53 | /** 54 | * polys cells 55 | */ 56 | polys: PropTypes.arrayOf(PropTypes.number), 57 | 58 | /** 59 | * strips cells 60 | */ 61 | strips: PropTypes.arrayOf(PropTypes.number), 62 | 63 | /** 64 | * Type of connectivity `manual` or implicit such as `points`, `triangles`, `strips` 65 | */ 66 | connectivity: PropTypes.string, 67 | 68 | children: PropTypes.oneOfType([ 69 | PropTypes.arrayOf(PropTypes.node), 70 | PropTypes.node, 71 | ]), 72 | }; 73 | -------------------------------------------------------------------------------- /src/lib/components/Reader.react.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | import { Reader as VtkItem } from '../AsyncReactVTK'; 5 | 6 | /** 7 | * Reader is exposing a reader to a downstream filter 8 | * It takes the following set of properties: 9 | * - vtkClass: vtk.js reader class name 10 | * - url: string 11 | * - parseAsText: string 12 | * - parseAsArrayBuffer: base64String 13 | */ 14 | export default function Reader(props) { 15 | return ; 16 | }; 17 | 18 | Reader.defaultProps = { 19 | port: 0, 20 | vtkClass: '', 21 | renderOnUpdate: true, 22 | resetCameraOnUpdate: true, 23 | }; 24 | 25 | Reader.propTypes = { 26 | /** 27 | * The ID used to identify this component. 28 | */ 29 | id: PropTypes.string, 30 | 31 | /** 32 | * downstream connection port 33 | */ 34 | port: PropTypes.number, 35 | 36 | /** 37 | * vtkClass name 38 | */ 39 | vtkClass: PropTypes.string, 40 | 41 | /** 42 | * set of url to fetch data from 43 | */ 44 | url: PropTypes.string, 45 | 46 | /** 47 | * set text data to process 48 | */ 49 | parseAsText: PropTypes.string, 50 | 51 | /** 52 | * set binary data to process from base64 string 53 | */ 54 | parseAsArrayBuffer: PropTypes.string, 55 | 56 | /** 57 | * Automatically render on data loaded 58 | */ 59 | renderOnUpdate: PropTypes.bool, 60 | 61 | /** 62 | * Automatically reset camera on data loaded 63 | */ 64 | resetCameraOnUpdate: PropTypes.bool, 65 | 66 | children: PropTypes.oneOfType([ 67 | PropTypes.arrayOf(PropTypes.node), 68 | PropTypes.node, 69 | ]), 70 | }; 71 | -------------------------------------------------------------------------------- /src/lib/components/ShareDataSet.react.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | import { ShareDataSet as VtkItem } from '../AsyncReactVTK'; 5 | 6 | /** 7 | * ShareDataSet capture a dataset or a source and allow it to use it in another 8 | * pipeline or representation. 9 | */ 10 | export default function ShareDataSet(props) { 11 | return ; 12 | }; 13 | 14 | ShareDataSet.defaultProps = { 15 | port: 0, 16 | name: 'shared', 17 | }; 18 | 19 | ShareDataSet.propTypes = { 20 | /** 21 | * The ID used to identify this component. 22 | */ 23 | id: PropTypes.string, 24 | 25 | /** 26 | * downstream connection port 27 | */ 28 | port: PropTypes.number, 29 | 30 | /** 31 | * Unique dataset name to cross reference 32 | */ 33 | name: PropTypes.string, 34 | 35 | children: PropTypes.oneOfType([ 36 | PropTypes.arrayOf(PropTypes.node), 37 | PropTypes.node, 38 | ]), 39 | }; 40 | -------------------------------------------------------------------------------- /src/lib/components/SliceRepresentation.react.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | import { SliceRepresentation as VtkItem } from '../AsyncReactVTK'; 5 | 6 | /** 7 | * SliceRepresentation is responsible to convert a vtkPolyData into rendering 8 | * It takes the following set of properties: 9 | * - colorBy: ['POINTS', ''], 10 | * - pointSize: 1, 11 | * - color: [1,1,1], 12 | */ 13 | export default function SliceRepresentation(props) { 14 | return ; 15 | }; 16 | 17 | SliceRepresentation.defaultProps = { 18 | colorMapPreset: 'erdc_rainbow_bright', 19 | colorDataRange: 'auto', 20 | }; 21 | 22 | SliceRepresentation.propTypes = { 23 | /** 24 | * The ID used to identify this component. 25 | */ 26 | id: PropTypes.string, 27 | 28 | /** 29 | * Properties to set to the mapper 30 | */ 31 | mapper: PropTypes.object, 32 | 33 | /** 34 | * Properties to set to the slice/actor 35 | */ 36 | actor: PropTypes.object, 37 | 38 | /** 39 | * Properties to set to the volume.property 40 | */ 41 | property: PropTypes.object, 42 | 43 | /** 44 | * Preset name for the lookup table color map 45 | */ 46 | colorMapPreset: PropTypes.string, 47 | 48 | /** 49 | * Data range use for the colorMap 50 | */ 51 | colorDataRange: PropTypes.oneOfType([ 52 | PropTypes.arrayOf(PropTypes.number), 53 | PropTypes.string, 54 | ]), 55 | 56 | /** 57 | * index of the slice along i 58 | */ 59 | iSlice: PropTypes.number, 60 | 61 | /** 62 | * index of the slice along j 63 | */ 64 | jSlice: PropTypes.number, 65 | 66 | /** 67 | * index of the slice along k 68 | */ 69 | kSlice: PropTypes.number, 70 | 71 | /** 72 | * index of the slice along x 73 | */ 74 | xSlice: PropTypes.number, 75 | 76 | /** 77 | * index of the slice along y 78 | */ 79 | ySlice: PropTypes.number, 80 | 81 | /** 82 | * index of the slice along z 83 | */ 84 | zSlice: PropTypes.number, 85 | 86 | children: PropTypes.oneOfType([ 87 | PropTypes.arrayOf(PropTypes.node), 88 | PropTypes.node, 89 | ]), 90 | }; 91 | -------------------------------------------------------------------------------- /src/lib/components/Volume.react.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | import { ImageData, PointData, DataArray } from '../AsyncReactVTK'; 5 | 6 | /** 7 | * Volume is exposing a vtkImageData to a downstream filter 8 | * It takes the following set of properties: 9 | * - state: { image: { ...imagedata-props }, field: { ...dataArray } } 10 | */ 11 | export default function Volume(props) { 12 | return ( 13 | 18 | {props.state.field && 19 | 20 | 24 | 25 | } 26 | 27 | ); 28 | }; 29 | 30 | Volume.defaultProps = { 31 | port: 0, 32 | state: { 33 | image: { dimension: [10, 10, 10] }, 34 | } 35 | }; 36 | 37 | Volume.propTypes = { 38 | /** 39 | * The ID used to identify this component. 40 | */ 41 | id: PropTypes.string, 42 | 43 | /** 44 | * downstream connection port 45 | */ 46 | port: PropTypes.number, 47 | 48 | /** 49 | * State of the volume 50 | */ 51 | state: PropTypes.object, 52 | }; 53 | -------------------------------------------------------------------------------- /src/lib/components/VolumeController.react.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-magic-numbers */ 2 | import React from 'react'; 3 | import PropTypes from 'prop-types'; 4 | 5 | import { VolumeController as VtkItem } from '../AsyncReactVTK'; 6 | 7 | /** 8 | * VolumeController is a GUI to control the piecewise function 9 | */ 10 | export default function VolumeController(props) { 11 | return ; 12 | }; 13 | 14 | VolumeController.defaultProps = { 15 | size: [400, 150], 16 | rescaleColorMap: true, 17 | }; 18 | 19 | VolumeController.propTypes = { 20 | /** 21 | * The ID used to identify this component. 22 | */ 23 | id: PropTypes.string, 24 | 25 | /** 26 | * Controller size in pixels 27 | */ 28 | size: PropTypes.arrayOf(PropTypes.number), 29 | 30 | /** 31 | * Use opacity range to rescale color map 32 | */ 33 | rescaleColorMap: PropTypes.bool, 34 | }; 35 | -------------------------------------------------------------------------------- /src/lib/components/VolumeRepresentation.react.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | import { VolumeRepresentation as VtkItem } from '../AsyncReactVTK'; 5 | 6 | /** 7 | * VolumeRepresentation is responsible to convert a vtkPolyData into rendering 8 | * It takes the following set of properties: 9 | * - colorBy: ['POINTS', ''], 10 | * - pointSize: 1, 11 | * - color: [1,1,1], 12 | */ 13 | export default function VolumeRepresentation(props) { 14 | return ; 15 | }; 16 | 17 | VolumeRepresentation.defaultProps = { 18 | colorMapPreset: 'erdc_rainbow_bright', 19 | colorDataRange: 'auto', 20 | }; 21 | 22 | VolumeRepresentation.propTypes = { 23 | /** 24 | * The ID used to identify this component. 25 | */ 26 | id: PropTypes.string, 27 | 28 | /** 29 | * Properties to set to the mapper 30 | */ 31 | mapper: PropTypes.object, 32 | 33 | /** 34 | * Properties to set to the volume 35 | */ 36 | volume: PropTypes.object, 37 | 38 | /** 39 | * Properties to set to the volume.property 40 | */ 41 | property: PropTypes.object, 42 | 43 | /** 44 | * Preset name for the lookup table color map 45 | */ 46 | colorMapPreset: PropTypes.string, 47 | 48 | /** 49 | * Data range use for the colorMap 50 | */ 51 | colorDataRange: PropTypes.oneOfType([ 52 | PropTypes.arrayOf(PropTypes.number), 53 | PropTypes.string, 54 | ]), 55 | 56 | children: PropTypes.oneOfType([ 57 | PropTypes.arrayOf(PropTypes.node), 58 | PropTypes.node, 59 | ]), 60 | }; 61 | -------------------------------------------------------------------------------- /src/lib/index.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/prefer-default-export */ 2 | import Algorithm from './components/Algorithm.react'; 3 | import Calculator from './components/Calculator.react'; 4 | import CellData from './components/CellData.react'; 5 | import DataArray from './components/DataArray.react'; 6 | import FieldData from './components/FieldData.react'; 7 | import GeometryRepresentation from './components/GeometryRepresentation.react'; 8 | import GlyphRepresentation from './components/GlyphRepresentation.react'; 9 | import ImageData from './components/ImageData.react'; 10 | import Mesh from './components/Mesh.react'; 11 | import PointCloudRepresentation from './components/PointCloudRepresentation.react'; 12 | import PointData from './components/PointData.react'; 13 | import PolyData from './components/PolyData.react'; 14 | import Reader from './components/Reader.react'; 15 | import ShareDataSet from './components/ShareDataSet.react'; 16 | import SliceRepresentation from './components/SliceRepresentation.react'; 17 | import View from './components/View.react'; 18 | import Volume from './components/Volume.react'; 19 | import VolumeController from './components/VolumeController.react'; 20 | import VolumeDataRepresentation from './components/VolumeDataRepresentation.react'; 21 | import VolumeRepresentation from './components/VolumeRepresentation.react'; 22 | 23 | export { 24 | Algorithm, 25 | Calculator, 26 | CellData, 27 | DataArray, 28 | FieldData, 29 | GeometryRepresentation, 30 | GlyphRepresentation, 31 | ImageData, 32 | Mesh, 33 | PointCloudRepresentation, 34 | PointData, 35 | PolyData, 36 | Reader, 37 | ShareDataSet, 38 | SliceRepresentation, 39 | View, 40 | Volume, 41 | VolumeController, 42 | VolumeDataRepresentation, 43 | VolumeRepresentation, 44 | }; 45 | -------------------------------------------------------------------------------- /src/vtk_algorithm.jl: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | export vtk_algorithm 4 | 5 | """ 6 | vtk_algorithm(;kwargs...) 7 | vtk_algorithm(children::Any;kwargs...) 8 | vtk_algorithm(children_maker::Function;kwargs...) 9 | 10 | 11 | An Algorithm component. 12 | Algorithm is exposing a source or filter to a downstream filter 13 | It takes the following set of properties: 14 | - vtkClass: vtkClassName 15 | - state: {} 16 | Keyword arguments: 17 | - `children` (Array of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional) 18 | - `id` (String; optional): The ID used to identify this component. 19 | - `port` (Real; optional): downstream connection port 20 | - `state` (Dict; optional): set of property values for vtkClass 21 | - `vtkClass` (String; optional): vtkClass name 22 | """ 23 | function vtk_algorithm(; kwargs...) 24 | available_props = Symbol[:children, :id, :port, :state, :vtkClass] 25 | wild_props = Symbol[] 26 | return Component("vtk_algorithm", "Algorithm", "dash_vtk", available_props, wild_props; kwargs...) 27 | end 28 | 29 | vtk_algorithm(children::Any; kwargs...) = vtk_algorithm(;kwargs..., children = children) 30 | vtk_algorithm(children_maker::Function; kwargs...) = vtk_algorithm(children_maker(); kwargs...) 31 | 32 | -------------------------------------------------------------------------------- /src/vtk_calculator.jl: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | export vtk_calculator 4 | 5 | """ 6 | vtk_calculator(;kwargs...) 7 | vtk_calculator(children::Any;kwargs...) 8 | vtk_calculator(children_maker::Function;kwargs...) 9 | 10 | 11 | A Calculator component. 12 | Calculator is exposing a source or filter to a downstream filter 13 | It takes the following set of properties: 14 | - name: 'scalars' // name of the generated field 15 | - location: 'POINT' // POINT/CELL 16 | - arrays: [] // Name of array to have access in formula 17 | - formula: fn 18 | Keyword arguments: 19 | - `children` (Array of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional) 20 | - `id` (String; optional): The ID used to identify this component. 21 | - `arrays` (Array of Strings; optional): List of fields you want available for your formula 22 | - `location` (String; optional): Field location [POINT, CELL, COORDINATE, SCALARS, ] 23 | - `name` (String; optional): Field name 24 | - `port` (Real; optional): downstream connection port 25 | """ 26 | function vtk_calculator(; kwargs...) 27 | available_props = Symbol[:children, :id, :arrays, :location, :name, :port] 28 | wild_props = Symbol[] 29 | return Component("vtk_calculator", "Calculator", "dash_vtk", available_props, wild_props; kwargs...) 30 | end 31 | 32 | vtk_calculator(children::Any; kwargs...) = vtk_calculator(;kwargs..., children = children) 33 | vtk_calculator(children_maker::Function; kwargs...) = vtk_calculator(children_maker(); kwargs...) 34 | 35 | -------------------------------------------------------------------------------- /src/vtk_celldata.jl: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | export vtk_celldata 4 | 5 | """ 6 | vtk_celldata(;kwargs...) 7 | vtk_celldata(children::Any;kwargs...) 8 | vtk_celldata(children_maker::Function;kwargs...) 9 | 10 | 11 | A CellData component. 12 | CellData is exposing a vtkCellData to a downstream element 13 | Keyword arguments: 14 | - `children` (Array of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional) 15 | """ 16 | function vtk_celldata(; kwargs...) 17 | available_props = Symbol[:children] 18 | wild_props = Symbol[] 19 | return Component("vtk_celldata", "CellData", "dash_vtk", available_props, wild_props; kwargs...) 20 | end 21 | 22 | vtk_celldata(children::Any; kwargs...) = vtk_celldata(;kwargs..., children = children) 23 | vtk_celldata(children_maker::Function; kwargs...) = vtk_celldata(children_maker(); kwargs...) 24 | 25 | -------------------------------------------------------------------------------- /src/vtk_dataarray.jl: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | export vtk_dataarray 4 | 5 | """ 6 | vtk_dataarray(;kwargs...) 7 | 8 | A DataArray component. 9 | DataArray is creating a vtkDataArray for the container fields 10 | It takes the following set of properties: 11 | - type: 'Float32Array', 'Float64Array', 'Uint16Array', ... 12 | - values: [number, number, ...] 13 | - numberOfComponents: 1, 14 | - registration: 'addArray', 'setScalars', ... 15 | Keyword arguments: 16 | - `id` (String; optional): The ID used to identify this component. 17 | - `name` (String; optional): Field name 18 | - `numberOfComponents` (Real; optional): Number of components / Tuple size 19 | - `registration` (String; optional): Name of the method to call on the fieldData (addArray, setScalars, setVectors...) 20 | - `type` (String; optional): Typed array name 21 | - `values` (Array of Reals; optional): Actual values to use inside our array 22 | """ 23 | function vtk_dataarray(; kwargs...) 24 | available_props = Symbol[:id, :name, :numberOfComponents, :registration, :type, :values] 25 | wild_props = Symbol[] 26 | return Component("vtk_dataarray", "DataArray", "dash_vtk", available_props, wild_props; kwargs...) 27 | end 28 | 29 | -------------------------------------------------------------------------------- /src/vtk_fielddata.jl: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | export vtk_fielddata 4 | 5 | """ 6 | vtk_fielddata(;kwargs...) 7 | vtk_fielddata(children::Any;kwargs...) 8 | vtk_fielddata(children_maker::Function;kwargs...) 9 | 10 | 11 | A FieldData component. 12 | FieldData is exposing a FieldData to a downstream element 13 | Keyword arguments: 14 | - `children` (Array of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional) 15 | """ 16 | function vtk_fielddata(; kwargs...) 17 | available_props = Symbol[:children] 18 | wild_props = Symbol[] 19 | return Component("vtk_fielddata", "FieldData", "dash_vtk", available_props, wild_props; kwargs...) 20 | end 21 | 22 | vtk_fielddata(children::Any; kwargs...) = vtk_fielddata(;kwargs..., children = children) 23 | vtk_fielddata(children_maker::Function; kwargs...) = vtk_fielddata(children_maker(); kwargs...) 24 | 25 | -------------------------------------------------------------------------------- /src/vtk_geometryrepresentation.jl: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | export vtk_geometryrepresentation 4 | 5 | """ 6 | vtk_geometryrepresentation(;kwargs...) 7 | vtk_geometryrepresentation(children::Any;kwargs...) 8 | vtk_geometryrepresentation(children_maker::Function;kwargs...) 9 | 10 | 11 | A GeometryRepresentation component. 12 | GeometryRepresentation is responsible to convert a vtkPolyData into rendering 13 | It takes the following set of properties: 14 | - actor: Properties to assign to the vtkActor 15 | - mapper: Properties to assign to the vtkMapper 16 | - property: Properties to assign to the vtkProperty (actor.getProperty()) 17 | - colorMapPreset: Name of the preset to use for controlling the color mapping 18 | - colorDataRange: Range to use for the color scale 19 | Keyword arguments: 20 | - `children` (Array of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional) 21 | - `id` (String; optional): The ID used to identify this component. 22 | - `actor` (Dict; optional): Properties to set to the actor 23 | - `colorDataRange` (Array of Reals; optional): Data range use for the colorMap 24 | - `colorMapPreset` (String; optional): Preset name for the lookup table color map 25 | - `cubeAxesStyle` (Dict; optional): Configure cube Axes style by overriding the set of properties defined 26 | https://github.com/Kitware/vtk-js/blob/HEAD/Sources/Rendering/Core/CubeAxesActor/index.js#L703-L719 27 | - `mapper` (Dict; optional): Properties to set to the actor 28 | - `property` (Dict; optional): Properties to set to the actor.property 29 | - `showCubeAxes` (Bool; optional): Show/Hide Cube Axes for the given representation 30 | """ 31 | function vtk_geometryrepresentation(; kwargs...) 32 | available_props = Symbol[:children, :id, :actor, :colorDataRange, :colorMapPreset, :cubeAxesStyle, :mapper, :property, :showCubeAxes] 33 | wild_props = Symbol[] 34 | return Component("vtk_geometryrepresentation", "GeometryRepresentation", "dash_vtk", available_props, wild_props; kwargs...) 35 | end 36 | 37 | vtk_geometryrepresentation(children::Any; kwargs...) = vtk_geometryrepresentation(;kwargs..., children = children) 38 | vtk_geometryrepresentation(children_maker::Function; kwargs...) = vtk_geometryrepresentation(children_maker(); kwargs...) 39 | 40 | -------------------------------------------------------------------------------- /src/vtk_glyphrepresentation.jl: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | export vtk_glyphrepresentation 4 | 5 | """ 6 | vtk_glyphrepresentation(;kwargs...) 7 | vtk_glyphrepresentation(children::Any;kwargs...) 8 | vtk_glyphrepresentation(children_maker::Function;kwargs...) 9 | 10 | 11 | A GlyphRepresentation component. 12 | GlyphRepresentation using a source on port=1 as Glyph and the points of the source on port=0 to position the given glyphs 13 | It takes the following set of properties: 14 | - actor: Properties to assign to the vtkActor 15 | - mapper: Properties to assign to the vtkGlyph3DMapper 16 | - property: Properties to assign to the vtkProperty (actor.getProperty()) 17 | - colorMapPreset: Name of the preset to use for controlling the color mapping 18 | - colorDataRange: Range to use for the color scale 19 | Keyword arguments: 20 | - `children` (Array of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional) 21 | - `id` (String; optional): The ID used to identify this component. 22 | - `actor` (Dict; optional): Properties to set to the actor 23 | - `colorDataRange` (Array of Reals; optional): Data range use for the colorMap 24 | - `colorMapPreset` (String; optional): Preset name for the lookup table color map 25 | - `mapper` (Dict; optional): Properties to set to the vtkGlyph3DMapper 26 | - `property` (Dict; optional): Properties to set to the actor.property 27 | """ 28 | function vtk_glyphrepresentation(; kwargs...) 29 | available_props = Symbol[:children, :id, :actor, :colorDataRange, :colorMapPreset, :mapper, :property] 30 | wild_props = Symbol[] 31 | return Component("vtk_glyphrepresentation", "GlyphRepresentation", "dash_vtk", available_props, wild_props; kwargs...) 32 | end 33 | 34 | vtk_glyphrepresentation(children::Any; kwargs...) = vtk_glyphrepresentation(;kwargs..., children = children) 35 | vtk_glyphrepresentation(children_maker::Function; kwargs...) = vtk_glyphrepresentation(children_maker(); kwargs...) 36 | 37 | -------------------------------------------------------------------------------- /src/vtk_imagedata.jl: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | export vtk_imagedata 4 | 5 | """ 6 | vtk_imagedata(;kwargs...) 7 | vtk_imagedata(children::Any;kwargs...) 8 | vtk_imagedata(children_maker::Function;kwargs...) 9 | 10 | 11 | An ImageData component. 12 | ImageData is exposing a vtkImageData to a downstream filter 13 | It takes the following set of properties: 14 | - dimensions: [nx, ny, nz], 15 | - origin: [0, 0, 0] 16 | - spacing: [1, 1, 1] 17 | - direction: [ 18 | 1, 0, 0, 19 | 0, 1, 0, 20 | 0, 0, 1 21 | ] 22 | Keyword arguments: 23 | - `children` (Array of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional) 24 | - `id` (String; optional): The ID used to identify this component. 25 | - `dimensions` (Array of Reals; optional): Number of points along x, y, z 26 | - `direction` (Array of Reals; optional): 3x3 matrix use to orient the image data 27 | - `origin` (Array of Reals; optional): World coordinate of the lower left corner of your vtkImageData (i=0, j=0, k=0). 28 | - `port` (Real; optional): downstream connection port 29 | - `spacing` (Array of Reals; optional): Spacing along x, y, z between points in world coordinates 30 | """ 31 | function vtk_imagedata(; kwargs...) 32 | available_props = Symbol[:children, :id, :dimensions, :direction, :origin, :port, :spacing] 33 | wild_props = Symbol[] 34 | return Component("vtk_imagedata", "ImageData", "dash_vtk", available_props, wild_props; kwargs...) 35 | end 36 | 37 | vtk_imagedata(children::Any; kwargs...) = vtk_imagedata(;kwargs..., children = children) 38 | vtk_imagedata(children_maker::Function; kwargs...) = vtk_imagedata(children_maker(); kwargs...) 39 | 40 | -------------------------------------------------------------------------------- /src/vtk_mesh.jl: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | export vtk_mesh 4 | 5 | """ 6 | vtk_mesh(;kwargs...) 7 | 8 | A Mesh component. 9 | Mesh is exposing a vtkPolyData to a downstream filter 10 | It takes the following set of properties: 11 | - state: { mesh: { ...polydata-props }, field: { ...dataArray } } 12 | Keyword arguments: 13 | - `id` (String; optional): The ID used to identify this component. 14 | - `port` (Real; optional): downstream connection port 15 | - `state` (Dict; optional): State of the mesh 16 | """ 17 | function vtk_mesh(; kwargs...) 18 | available_props = Symbol[:id, :port, :state] 19 | wild_props = Symbol[] 20 | return Component("vtk_mesh", "Mesh", "dash_vtk", available_props, wild_props; kwargs...) 21 | end 22 | 23 | -------------------------------------------------------------------------------- /src/vtk_pointcloudrepresentation.jl: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | export vtk_pointcloudrepresentation 4 | 5 | """ 6 | vtk_pointcloudrepresentation(;kwargs...) 7 | 8 | A PointCloudRepresentation component. 9 | PointCloudRepresentation expect the following set of properties 10 | - xyz: [x0, y0, z0, x1, ..., zn] 11 | - rgb: [...] 12 | - rgba: [...] 13 | - scalars: [...] 14 | Keyword arguments: 15 | - `colorDataRange` (Array of Reals; optional): Data range use for the colorMap 16 | - `colorMapPreset` (String; optional): Preset name for the lookup table color map 17 | - `property` (Dict; optional): Properties to set to the actor.property 18 | - `rgb` (Array of Reals; optional): Use RGB values to attach to the points/vertex 19 | - `rgba` (Array of Reals; optional): Use RGBA values to attach to the points/vertex 20 | - `scalars` (Array of Reals; optional): Field values to attach to the points 21 | - `xyz` (Array of Reals; optional): Points coordinates 22 | """ 23 | function vtk_pointcloudrepresentation(; kwargs...) 24 | available_props = Symbol[:colorDataRange, :colorMapPreset, :property, :rgb, :rgba, :scalars, :xyz] 25 | wild_props = Symbol[] 26 | return Component("vtk_pointcloudrepresentation", "PointCloudRepresentation", "dash_vtk", available_props, wild_props; kwargs...) 27 | end 28 | 29 | -------------------------------------------------------------------------------- /src/vtk_pointdata.jl: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | export vtk_pointdata 4 | 5 | """ 6 | vtk_pointdata(;kwargs...) 7 | vtk_pointdata(children::Any;kwargs...) 8 | vtk_pointdata(children_maker::Function;kwargs...) 9 | 10 | 11 | A PointData component. 12 | PointData is exposing a vtkPointData to a downstream element 13 | Keyword arguments: 14 | - `children` (Array of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional) 15 | """ 16 | function vtk_pointdata(; kwargs...) 17 | available_props = Symbol[:children] 18 | wild_props = Symbol[] 19 | return Component("vtk_pointdata", "PointData", "dash_vtk", available_props, wild_props; kwargs...) 20 | end 21 | 22 | vtk_pointdata(children::Any; kwargs...) = vtk_pointdata(;kwargs..., children = children) 23 | vtk_pointdata(children_maker::Function; kwargs...) = vtk_pointdata(children_maker(); kwargs...) 24 | 25 | -------------------------------------------------------------------------------- /src/vtk_polydata.jl: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | export vtk_polydata 4 | 5 | """ 6 | vtk_polydata(;kwargs...) 7 | vtk_polydata(children::Any;kwargs...) 8 | vtk_polydata(children_maker::Function;kwargs...) 9 | 10 | 11 | A PolyData component. 12 | PolyData is exposing a vtkPolyData to a downstream filter 13 | It takes the following set of properties: 14 | - points: [x, y, z, x, y, z, ...], 15 | - verts: [cellSize, pointId0, pointId1, ..., cellSize, pointId0, ...] 16 | - lines: [cellSize, pointId0, pointId1, ..., cellSize, pointId0, ...] 17 | - polys: [cellSize, pointId0, pointId1, ..., cellSize, pointId0, ...] 18 | - strips: [cellSize, pointId0, pointId1, ..., cellSize, pointId0, ...] 19 | Cell connectivity helper property: 20 | - connectivity: 'manual', // [manual, points, triangles, strips] 21 | Keyword arguments: 22 | - `children` (Array of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional) 23 | - `id` (String; optional): The ID used to identify this component. 24 | - `connectivity` (String; optional): Type of connectivity `manual` or implicit such as `points`, `triangles`, `strips` 25 | - `lines` (Array of Reals; optional): lines cells 26 | - `points` (Array of Reals; optional): xyz coordinates 27 | - `polys` (Array of Reals; optional): polys cells 28 | - `port` (Real; optional): downstream connection port 29 | - `strips` (Array of Reals; optional): strips cells 30 | - `verts` (Array of Reals; optional): verts cells 31 | """ 32 | function vtk_polydata(; kwargs...) 33 | available_props = Symbol[:children, :id, :connectivity, :lines, :points, :polys, :port, :strips, :verts] 34 | wild_props = Symbol[] 35 | return Component("vtk_polydata", "PolyData", "dash_vtk", available_props, wild_props; kwargs...) 36 | end 37 | 38 | vtk_polydata(children::Any; kwargs...) = vtk_polydata(;kwargs..., children = children) 39 | vtk_polydata(children_maker::Function; kwargs...) = vtk_polydata(children_maker(); kwargs...) 40 | 41 | -------------------------------------------------------------------------------- /src/vtk_reader.jl: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | export vtk_reader 4 | 5 | """ 6 | vtk_reader(;kwargs...) 7 | vtk_reader(children::Any;kwargs...) 8 | vtk_reader(children_maker::Function;kwargs...) 9 | 10 | 11 | A Reader component. 12 | Reader is exposing a reader to a downstream filter 13 | It takes the following set of properties: 14 | - vtkClass: vtk.js reader class name 15 | - url: string 16 | - parseAsText: string 17 | - parseAsArrayBuffer: base64String 18 | Keyword arguments: 19 | - `children` (Array of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional) 20 | - `id` (String; optional): The ID used to identify this component. 21 | - `parseAsArrayBuffer` (String; optional): set binary data to process from base64 string 22 | - `parseAsText` (String; optional): set text data to process 23 | - `port` (Real; optional): downstream connection port 24 | - `renderOnUpdate` (Bool; optional): Automatically render on data loaded 25 | - `resetCameraOnUpdate` (Bool; optional): Automatically reset camera on data loaded 26 | - `url` (String; optional): set of url to fetch data from 27 | - `vtkClass` (String; optional): vtkClass name 28 | """ 29 | function vtk_reader(; kwargs...) 30 | available_props = Symbol[:children, :id, :parseAsArrayBuffer, :parseAsText, :port, :renderOnUpdate, :resetCameraOnUpdate, :url, :vtkClass] 31 | wild_props = Symbol[] 32 | return Component("vtk_reader", "Reader", "dash_vtk", available_props, wild_props; kwargs...) 33 | end 34 | 35 | vtk_reader(children::Any; kwargs...) = vtk_reader(;kwargs..., children = children) 36 | vtk_reader(children_maker::Function; kwargs...) = vtk_reader(children_maker(); kwargs...) 37 | 38 | -------------------------------------------------------------------------------- /src/vtk_sharedataset.jl: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | export vtk_sharedataset 4 | 5 | """ 6 | vtk_sharedataset(;kwargs...) 7 | vtk_sharedataset(children::Any;kwargs...) 8 | vtk_sharedataset(children_maker::Function;kwargs...) 9 | 10 | 11 | A ShareDataSet component. 12 | ShareDataSet capture a dataset or a source and allow it to use it in another 13 | pipeline or representation. 14 | Keyword arguments: 15 | - `children` (Array of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional) 16 | - `id` (String; optional): The ID used to identify this component. 17 | - `name` (String; optional): Unique dataset name to cross reference 18 | - `port` (Real; optional): downstream connection port 19 | """ 20 | function vtk_sharedataset(; kwargs...) 21 | available_props = Symbol[:children, :id, :name, :port] 22 | wild_props = Symbol[] 23 | return Component("vtk_sharedataset", "ShareDataSet", "dash_vtk", available_props, wild_props; kwargs...) 24 | end 25 | 26 | vtk_sharedataset(children::Any; kwargs...) = vtk_sharedataset(;kwargs..., children = children) 27 | vtk_sharedataset(children_maker::Function; kwargs...) = vtk_sharedataset(children_maker(); kwargs...) 28 | 29 | -------------------------------------------------------------------------------- /src/vtk_slicerepresentation.jl: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | export vtk_slicerepresentation 4 | 5 | """ 6 | vtk_slicerepresentation(;kwargs...) 7 | vtk_slicerepresentation(children::Any;kwargs...) 8 | vtk_slicerepresentation(children_maker::Function;kwargs...) 9 | 10 | 11 | A SliceRepresentation component. 12 | SliceRepresentation is responsible to convert a vtkPolyData into rendering 13 | It takes the following set of properties: 14 | - colorBy: ['POINTS', ''], 15 | - pointSize: 1, 16 | - color: [1,1,1], 17 | Keyword arguments: 18 | - `children` (Array of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional) 19 | - `id` (String; optional): The ID used to identify this component. 20 | - `actor` (Dict; optional): Properties to set to the slice/actor 21 | - `colorDataRange` (Array of Reals | String; optional): Data range use for the colorMap 22 | - `colorMapPreset` (String; optional): Preset name for the lookup table color map 23 | - `iSlice` (Real; optional): index of the slice along i 24 | - `jSlice` (Real; optional): index of the slice along j 25 | - `kSlice` (Real; optional): index of the slice along k 26 | - `mapper` (Dict; optional): Properties to set to the mapper 27 | - `property` (Dict; optional): Properties to set to the volume.property 28 | - `xSlice` (Real; optional): index of the slice along x 29 | - `ySlice` (Real; optional): index of the slice along y 30 | - `zSlice` (Real; optional): index of the slice along z 31 | """ 32 | function vtk_slicerepresentation(; kwargs...) 33 | available_props = Symbol[:children, :id, :actor, :colorDataRange, :colorMapPreset, :iSlice, :jSlice, :kSlice, :mapper, :property, :xSlice, :ySlice, :zSlice] 34 | wild_props = Symbol[] 35 | return Component("vtk_slicerepresentation", "SliceRepresentation", "dash_vtk", available_props, wild_props; kwargs...) 36 | end 37 | 38 | vtk_slicerepresentation(children::Any; kwargs...) = vtk_slicerepresentation(;kwargs..., children = children) 39 | vtk_slicerepresentation(children_maker::Function; kwargs...) = vtk_slicerepresentation(children_maker(); kwargs...) 40 | 41 | -------------------------------------------------------------------------------- /src/vtk_volume.jl: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | export vtk_volume 4 | 5 | """ 6 | vtk_volume(;kwargs...) 7 | 8 | A Volume component. 9 | Volume is exposing a vtkImageData to a downstream filter 10 | It takes the following set of properties: 11 | - state: { image: { ...imagedata-props }, field: { ...dataArray } } 12 | Keyword arguments: 13 | - `id` (String; optional): The ID used to identify this component. 14 | - `port` (Real; optional): downstream connection port 15 | - `state` (Dict; optional): State of the volume 16 | """ 17 | function vtk_volume(; kwargs...) 18 | available_props = Symbol[:id, :port, :state] 19 | wild_props = Symbol[] 20 | return Component("vtk_volume", "Volume", "dash_vtk", available_props, wild_props; kwargs...) 21 | end 22 | 23 | -------------------------------------------------------------------------------- /src/vtk_volumecontroller.jl: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | export vtk_volumecontroller 4 | 5 | """ 6 | vtk_volumecontroller(;kwargs...) 7 | 8 | A VolumeController component. 9 | VolumeController is a GUI to control the piecewise function 10 | Keyword arguments: 11 | - `id` (String; optional): The ID used to identify this component. 12 | - `rescaleColorMap` (Bool; optional): Use opacity range to rescale color map 13 | - `size` (Array of Reals; optional): Controller size in pixels 14 | """ 15 | function vtk_volumecontroller(; kwargs...) 16 | available_props = Symbol[:id, :rescaleColorMap, :size] 17 | wild_props = Symbol[] 18 | return Component("vtk_volumecontroller", "VolumeController", "dash_vtk", available_props, wild_props; kwargs...) 19 | end 20 | 21 | -------------------------------------------------------------------------------- /src/vtk_volumedatarepresentation.jl: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | export vtk_volumedatarepresentation 4 | 5 | """ 6 | vtk_volumedatarepresentation(;kwargs...) 7 | 8 | A VolumeDataRepresentation component. 9 | VolumeDataRepresentation expect the following set of properties 10 | - dimensions: [10, 20, 5] 11 | - spacing: [1, 1, 1] 12 | - origin: [0, 0, 0] 13 | - rgb: [...] 14 | - rgba: [...] 15 | - scalars: [...] 16 | - scalarsType: Float32Array 17 | Keyword arguments: 18 | - `id` (String; optional): The ID used to identify this component. 19 | - `colorDataRange` (Array of Reals | String; optional): Data range use for the colorMap 20 | - `colorMapPreset` (String; optional): Preset name for the lookup table color map 21 | - `controllerSize` (Array of Reals; optional): Controller size in pixels 22 | - `dimensions` (Array of Reals; optional): Number of points along x, y, z 23 | - `mapper` (Dict; optional): Properties to set to the mapper 24 | - `origin` (Array of Reals; optional): World coordinate of the lower left corner of your vtkImageData (i=0, j=0, k=0). 25 | - `property` (Dict; optional): Properties to set to the volume.property 26 | - `rescaleColorMap` (Bool; optional): Use opacity range to rescale color map 27 | - `rgb` (Array of Reals; optional): Use RGB values to attach to the points/vertex 28 | - `rgba` (Array of Reals; optional): Use RGBA values to attach to the points/vertex 29 | - `scalars` (Array of Reals; optional): Field values to attach to the points 30 | - `scalarsType` (String; optional): Types of numbers provided in scalars 31 | - `spacing` (Array of Reals; optional): Spacing along x, y, z between points in world coordinates 32 | - `volume` (Dict; optional): Properties to set to the volume 33 | - `volumeController` (Bool; optional): Show volumeController 34 | """ 35 | function vtk_volumedatarepresentation(; kwargs...) 36 | available_props = Symbol[:id, :colorDataRange, :colorMapPreset, :controllerSize, :dimensions, :mapper, :origin, :property, :rescaleColorMap, :rgb, :rgba, :scalars, :scalarsType, :spacing, :volume, :volumeController] 37 | wild_props = Symbol[] 38 | return Component("vtk_volumedatarepresentation", "VolumeDataRepresentation", "dash_vtk", available_props, wild_props; kwargs...) 39 | end 40 | 41 | -------------------------------------------------------------------------------- /src/vtk_volumerepresentation.jl: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | export vtk_volumerepresentation 4 | 5 | """ 6 | vtk_volumerepresentation(;kwargs...) 7 | vtk_volumerepresentation(children::Any;kwargs...) 8 | vtk_volumerepresentation(children_maker::Function;kwargs...) 9 | 10 | 11 | A VolumeRepresentation component. 12 | VolumeRepresentation is responsible to convert a vtkPolyData into rendering 13 | It takes the following set of properties: 14 | - colorBy: ['POINTS', ''], 15 | - pointSize: 1, 16 | - color: [1,1,1], 17 | Keyword arguments: 18 | - `children` (Array of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional) 19 | - `id` (String; optional): The ID used to identify this component. 20 | - `colorDataRange` (Array of Reals | String; optional): Data range use for the colorMap 21 | - `colorMapPreset` (String; optional): Preset name for the lookup table color map 22 | - `mapper` (Dict; optional): Properties to set to the mapper 23 | - `property` (Dict; optional): Properties to set to the volume.property 24 | - `volume` (Dict; optional): Properties to set to the volume 25 | """ 26 | function vtk_volumerepresentation(; kwargs...) 27 | available_props = Symbol[:children, :id, :colorDataRange, :colorMapPreset, :mapper, :property, :volume] 28 | wild_props = Symbol[] 29 | return Component("vtk_volumerepresentation", "VolumeRepresentation", "dash_vtk", available_props, wild_props; kwargs...) 30 | end 31 | 32 | vtk_volumerepresentation(children::Any; kwargs...) = vtk_volumerepresentation(;kwargs..., children = children) 33 | vtk_volumerepresentation(children_maker::Function; kwargs...) = vtk_volumerepresentation(children_maker(); kwargs...) 34 | 35 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-vtk/32195915653a7fd9930faec6a029fe6636cc64c2/tests/__init__.py -------------------------------------------------------------------------------- /tests/requirements.txt: -------------------------------------------------------------------------------- 1 | # Packages needed to run the tests. 2 | # Switch into a virtual environment 3 | # pip install -r requirements.txt 4 | 5 | dash[ci,dev,testing]>=2.1.0 6 | Pillow 7 | -r ../demos/requirements.txt 8 | -------------------------------------------------------------------------------- /tests/test_percy.py: -------------------------------------------------------------------------------- 1 | import base64 2 | from io import BytesIO 3 | import os 4 | import time 5 | 6 | import dash 7 | import dash_core_components as dcc 8 | import dash_html_components as html 9 | from dash.dependencies import Input, Output 10 | from PIL import Image 11 | 12 | 13 | def pil_to_b64(im, ext="jpeg"): 14 | if ext == "jpg": 15 | ext = "jpeg" 16 | 17 | if ext == "jpeg" and im.mode in ("RGBA", "LA"): 18 | background = Image.new(im.mode[:-1], im.size, (255, 255, 255)) 19 | background.paste(im, im.split()[-1]) 20 | im = background 21 | 22 | buffer = BytesIO() 23 | im.save(buffer, format=ext) 24 | encoded = base64.b64encode(buffer.getvalue()).decode("utf-8") 25 | 26 | return f"data:image/{ext};base64, " + encoded 27 | 28 | 29 | def build_app(imgs): 30 | app = dash.Dash(__name__) 31 | app.layout = html.Div( 32 | [html.Img(id="display"), dcc.Location(id="url", refresh=False)] 33 | ) 34 | 35 | @app.callback(Output("display", "src"), [Input("url", "pathname")]) 36 | def update_image(url): 37 | if url in [None, "/"]: 38 | return dash.no_update 39 | return pil_to_b64(imgs[url.strip("/")], ext="png") 40 | 41 | return app 42 | 43 | 44 | def test_percy(dash_duo): 45 | img_dir = "/tmp/dash_artifacts" if not dash_duo._is_windows() else os.getenv("TEMP") 46 | imgs = { 47 | fname.replace(".png", ".py"): Image.open(os.path.join(img_dir, fname)) 48 | for fname in os.listdir(img_dir) 49 | } 50 | 51 | app = build_app(imgs) 52 | dash_duo.start_server(app) 53 | 54 | for name in imgs: 55 | dash_duo.wait_for_page(url="http://127.0.0.1:8050/" + name) 56 | time.sleep(2) 57 | dash_duo.percy_snapshot(name) 58 | -------------------------------------------------------------------------------- /tests/test_render.py: -------------------------------------------------------------------------------- 1 | import os 2 | import time 3 | import warnings 4 | 5 | 6 | from dash.testing.application_runners import import_app 7 | 8 | 9 | def take_snapshot(dash_duo, name): 10 | target = "/tmp/dash_artifacts" if not dash_duo._is_windows() else os.getenv("TEMP") 11 | try: 12 | os.makedirs(target, exist_ok=True) 13 | except OSError: 14 | warnings.warn("Unable to create the target directory", OSError) 15 | 16 | dash_duo.driver.save_screenshot("{}/{}.png".format(target, name)) 17 | 18 | 19 | names = [ 20 | "usage", 21 | "demos.pyvista-terrain-following-mesh.app", 22 | "demos.pyvista-point-cloud.app", 23 | "demos.dicom-ct-lung.app", 24 | "demos.dicom-mri-brain.app", 25 | "demos.dicom-mri-pancreas.app", 26 | "demos.slice-rendering.app", 27 | "demos.volume-rendering.app", 28 | "demos.usage-vtk-cfd.app", 29 | "demos.usage-algorithm.app", 30 | "demos.synthetic-volume-rendering.app", 31 | ] 32 | 33 | tutorials = [ 34 | "docs.tutorials.t04_algorithm", 35 | "docs.tutorials.t05_reader", 36 | "docs.tutorials.s02_mesh_field", 37 | "docs.tutorials.s05_volume_slice", 38 | "docs.tutorials.t01_volume_rendering", 39 | "docs.tutorials.s04_slice", 40 | "docs.tutorials.s03_volume", 41 | "docs.tutorials.t03_polydata", 42 | "docs.tutorials.s01_mesh", 43 | "docs.tutorials.s00_point_cloud", 44 | "docs.tutorials.s06_vtk_mesh", 45 | "docs.tutorials.t02_imagedata", 46 | "docs.tutorials.t00_geometry_rendering", 47 | "docs.tutorials.t06_shared_dataset", 48 | "docs.tutorials.s07_vtk_volume", 49 | ] 50 | 51 | 52 | def build_test(name, sleep=10): 53 | def test_fn(dash_duo): 54 | app = import_app(name) 55 | dash_duo.start_server(app) 56 | dash_duo.wait_for_element("canvas", timeout=30) 57 | time.sleep(sleep) 58 | take_snapshot(dash_duo, name.replace("demos.", "")) 59 | dash_duo.percy_snapshot(name) 60 | 61 | return test_fn 62 | 63 | 64 | for n in names: 65 | var_name = "test_" + n.replace("-", "_").replace("demos.", "").replace(".app", "") 66 | locals()[var_name] = build_test(n, sleep=20) 67 | 68 | for n in tutorials: 69 | var_name = "test_" + n 70 | locals()[var_name] = build_test(n, sleep=5) 71 | -------------------------------------------------------------------------------- /usage-simple.py: -------------------------------------------------------------------------------- 1 | import dash_vtk 2 | import dash 3 | from dash.dependencies import Input, Output 4 | import dash_html_components as html 5 | 6 | app = dash.Dash(__name__) 7 | server = app.server 8 | 9 | app.layout = html.Div( 10 | style={"width": "100%", "height": "calc(100vh - 16px)"}, 11 | children=[ 12 | dash_vtk.View( 13 | id="view", 14 | ), 15 | html.Div(id="output"), 16 | ], 17 | ) 18 | 19 | 20 | if __name__ == "__main__": 21 | app.run_server(debug=True) 22 | -------------------------------------------------------------------------------- /webpack.serve.config.js: -------------------------------------------------------------------------------- 1 | const config = require('./webpack.config.js'); 2 | const path = require('path'); 3 | 4 | config.entry = {main: './src/demo/index.js'}; 5 | config.output = { 6 | filename: './output.js', 7 | path: path.resolve(__dirname), 8 | }; 9 | config.mode = 'development'; 10 | config.externals = undefined; // eslint-disable-line 11 | config.devtool = 'inline-source-map'; 12 | module.exports = config; 13 | --------------------------------------------------------------------------------