From 7ec78dee8ecf7ef522a7df860558243a4e8c67ec Mon Sep 17 00:00:00 2001 From: Rodrigo Mologni Date: Fri, 11 Feb 2022 14:02:35 -0300 Subject: [PATCH 1/2] add showScalarBar and scalarBarTitle in GeometryRepresentation --- .../GeometryRepresentation.react.js | 19 +++++++++++++++++++ usage.py | 2 ++ 2 files changed, 21 insertions(+) diff --git a/src/lib/components/GeometryRepresentation.react.js b/src/lib/components/GeometryRepresentation.react.js index 222de2f..ebccb52 100644 --- a/src/lib/components/GeometryRepresentation.react.js +++ b/src/lib/components/GeometryRepresentation.react.js @@ -19,6 +19,9 @@ export default function GeometryRepresentation(props) { GeometryRepresentation.defaultProps = { colorMapPreset: 'erdc_rainbow_bright', colorDataRange: [0, 1], + showCubeAxes: false, + showScalarBar: false, + scalarBarTitle: '', }; GeometryRepresentation.propTypes = { @@ -63,6 +66,22 @@ GeometryRepresentation.propTypes = { */ cubeAxesStyle: PropTypes.object, + /** + * Show hide scalar bar for that representation + */ + showScalarBar: PropTypes.bool, + + /** + * Use given string as title for scalar bar. By default it is empty (no title). + */ + scalarBarTitle: PropTypes.string, + + /** + * Configure scalar bar style by overriding the set of properties defined + * https://github.com/Kitware/vtk-js/blob/master/Sources/Rendering/Core/ScalarBarActor/index.js#L776-L796 + */ + scalarBarStyle: PropTypes.object, + children: PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.node), PropTypes.node, diff --git a/usage.py b/usage.py index 8885322..2d25702 100644 --- a/usage.py +++ b/usage.py @@ -44,6 +44,8 @@ "pointSize": 10, }, colorDataRange=[0, 3], + showScalarBar=True, + scalarBarTitle="Temperature", mapper={ "colorByArrayName": "Temperature", "scalarMode": 3, From ac98222fac2977bbe99d4bb52ecd0bbe23aa9439 Mon Sep 17 00:00:00 2001 From: Rodrigo Mologni Date: Tue, 22 Feb 2022 16:11:14 -0300 Subject: [PATCH 2/2] update PointCloudRepresentation * add showCubeAxes * add showScalarBar * add scalarBarTitle --- .../PointCloudRepresentation.react.js | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/lib/components/PointCloudRepresentation.react.js b/src/lib/components/PointCloudRepresentation.react.js index eb7a164..3ec4a1f 100644 --- a/src/lib/components/PointCloudRepresentation.react.js +++ b/src/lib/components/PointCloudRepresentation.react.js @@ -18,6 +18,9 @@ PointCloudRepresentation.defaultProps = { xyz: [0, 0, 0], colorMapPreset: 'erdc_rainbow_bright', colorDataRange: [0, 1], + showCubeAxes: false, + showScalarBar: false, + scalarBarTitle: '', }; PointCloudRepresentation.propTypes = { @@ -57,4 +60,31 @@ PointCloudRepresentation.propTypes = { * Properties to set to the actor.property */ property: PropTypes.object, + + /** + * Show/Hide Cube Axes for the given representation + */ + showCubeAxes: PropTypes.bool, + + /** + * Configure cube Axes style by overriding the set of properties defined + * https://github.com/Kitware/vtk-js/blob/HEAD/Sources/Rendering/Core/CubeAxesActor/index.js#L703-L719 + */ + cubeAxesStyle: PropTypes.object, + + /** + * Show hide scalar bar for that representation + */ + showScalarBar: PropTypes.bool, + + /** + * Use given string as title for scalar bar. By default it is empty (no title). + */ + scalarBarTitle: PropTypes.string, + + /** + * Configure scalar bar style by overriding the set of properties defined + * https://github.com/Kitware/vtk-js/blob/master/Sources/Rendering/Core/ScalarBarActor/index.js#L776-L796 + */ + scalarBarStyle: PropTypes.object, };