You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/README.md
+64-51Lines changed: 64 additions & 51 deletions
Original file line number
Diff line number
Diff line change
@@ -440,7 +440,7 @@ Then we have the standard representation set or properties with their defaults:
440
440
441
441
### PointCloudRepresentation
442
442
443
-
The __PointCloudRepresentation__ is just a helper using the following structure to streamline rendering a point cloud dataset.
443
+
The __PointCloudRepresentation__ is just a helper using the following structure to streamline rendering a point cloud dataset. The code snippet below is not fully accurate but it should provide you with some understanding of the kind of simplification that is happening under the hood.
444
444
445
445
```python
446
446
defPointCloudRepresentation(**kwargs):
@@ -475,38 +475,39 @@ The set of convinient properties are as follow:
475
475
476
476
### VolumeDataRepresentation
477
477
478
-
The __VolumeDataRepresentation__ is just a helper using the following structure to streamline rendering a volume.
479
-
480
-
```html
481
-
<VolumeRepresentation
482
-
id={props.id}
483
-
colorMapPreset={props.colorMapPreset}
484
-
colorDataRange={props.colorDataRange}
485
-
property={props.property}
486
-
mapper={props.mapper}
487
-
volume={props.volume}
488
-
>
489
-
{props.volumeController && (
490
-
<VolumeController
491
-
rescaleColorMap={props.rescaleColorMap}
492
-
size={props.controllerSize}
493
-
/>
494
-
)}
495
-
<ImageData
496
-
dimensions={props.dimensions}
497
-
origin={props.origin}
498
-
spacing={props.spacing}
499
-
>
500
-
<PointData>
501
-
<DataArray
502
-
registration='setScalars'
503
-
numberOfComponents={nbComponents}
504
-
values={values}
505
-
type={type}
506
-
/>
507
-
</PointData>
508
-
</ImageData>
509
-
</VolumeRepresentation>
478
+
The __VolumeDataRepresentation__ is just a helper using the following structure to streamline rendering a volume. The code snippet below is not fully accurate but it should provide you with some understanding of the kind of simplification that is happening under the hood.
479
+
480
+
```python
481
+
defVolumeDataRepresentation(**kwargs):
482
+
return dash_vtk.VolumeRepresentation(
483
+
id=kwargs.get('id'),
484
+
colorMapPreset=kwargs.get('colorMapPreset'),
485
+
colorDataRange=kwargs.get('colorDataRange'),
486
+
property=kwargs.get('property'),
487
+
mapper=kwargs.get('mapper'),
488
+
volume=kwargs.get('volume'),
489
+
children=[
490
+
dash_vtk.VolumeController(
491
+
rescaleColorMap=kwargs.get('rescaleColorMap'),
492
+
size=kwargs.get('size'),
493
+
),
494
+
dash_vtk.ImageData(
495
+
dimensions=kwargs.get('dimensions'),
496
+
origin=kwargs.get('origin'),
497
+
spacing=kwargs.get('spacing'),
498
+
children=[
499
+
dash_vtk.PointData([
500
+
dash_vtk.DataArray(
501
+
registration='setScalars',
502
+
values=kwargs.get('scalars'),
503
+
)
504
+
])
505
+
],
506
+
),
507
+
],
508
+
)
509
+
],
510
+
)
510
511
```
511
512
512
513
The set of convinient properties are as follow:
@@ -529,12 +530,18 @@ The set of convinient properties are as follow:
529
530
530
531
This element is a helper on top of __PolyData__ which has a Python helper function that goes with it which will help you map a __vtkDataSet__ into a single property of the __Mesh__ element.
The __Mesh__ element expect a single __state__ property that is internaly split into 2 elements to represent the geometry and the field that you want to optionally attach to your mesh. The structure could be defined as follow:
@@ -558,12 +565,18 @@ The __Mesh__ element expect a single __state__ property that is internaly split
558
565
559
566
This element is a helper on top of __ImageData__ which has a Python helper function that goes with it which will help you map a __vtkImageData__ into a single property of the __Volume__ element.
560
567
561
-
```html
562
-
<ImageData{...props.state.image}>
563
-
<PointData>
564
-
<DataArray{...props.state.field} />
565
-
</PointData>
566
-
</ImageData>
568
+
```py
569
+
defVolume(**kwargs):
570
+
return dash_vtk.ImageData(
571
+
**kwargs.get('state').get('image'),
572
+
children=[
573
+
dash_vtk.PointData([
574
+
dash_vtk.DataArray(
575
+
**kwargs.get('state').get('field'),
576
+
)
577
+
])
578
+
]
579
+
)
567
580
```
568
581
569
582
The __Volume__ element expect a single __state__ property that is internaly split into 2 elements to represent the geometry and the field that you want to optionally attach to your mesh. The structure could be defined as follow:
@@ -797,32 +810,32 @@ Then we made several example using plain VTK for both a CFD example and some med
This example leverage plain VTK on the server side while providing UI controls in __dash__ and leverage __dash_vtk__ to enable local rendering of dynamically computed streamlines inside a wind-tunnel.
0 commit comments