Load json

hi @jourdain ! thanks for your reply

Does exists any documentation on the structure of the json used to build the .glance file ?

Unfortunately not. But it match the set of properties defined in your proxy definition.
Generating some and looking at it should be able to help you grasp the structure easily. Just unzip the one available in the repo as they use remote data so they end up very small.

hi @jourdain , thanks for your help!

The repo link you shared was very useful!

Iā€™ve created a lookupTable with a specific data range "dataRange": [0, 5] but itā€™s overridden every time the glance file is loaded in Paraview Glance depending on the data loaded (itā€™s re-scaled to data).

Does exist a flag in the lookupTable to fix the data range values?

Inside the glance file that you are loading, you should be able to fix the color range at your licking and PVGlance should respect that.

If need be you can use ParaView for generating your scene with the proper color range and see how it is done when generating that glance fileā€¦

Arg, ParaView generate a .vtkjs not a glance fileā€¦ So you are probably right, you might not be able to fix the color range in the glance fileā€¦

FYI @Forrest_Li

hi @jourdain , thanks for your reply.

Does it means we canā€™t fix the color range ? So it will always scale depending on the data loaded from the VTK?

Iā€™ve opened a VTK on Paraview and tried to ā€œExport sceneā€ but Paraview crash with several errors.

Does exist any workaround to load and render a file in Paraview Glance with a fixed color range? Maybe another kind of file instead of .glance?

Also if you can point me in the source file where the data re-scale is done I can comment it and build the version customized for my use case.

Iā€™m needing a pragmatic solutions on this but happy to help on a pull request once we get a solution.

Regards

The vtkjs files will allow you to do that. Which has the same concept as the glance file. zip of JSON + data.

Which version of Paraview is crashing for you? 5.8 should work fine.

It might be possible to do it via a glance file but it may need some fix. (not sure and donā€™t know it on top of my head)

hi @jourdain , thanks for your reply.

Iā€™m using Paraview 5.7.0. Will try to update and let you know.

Do you have some example of the vtkjs files ?
Are they(vtkjs and vtk files) conceptually different?

Here is an example that you can unzip to see its content.
diskout.vtkjs (1.2 MB)

Here are the places when data ranges get affected in Glance

io/GlanceVtkJsReader.js
218:            lutProxy.setDataRange(min, max);
231:            pwfProxy.setDataRange(...range);
308:      lutProxy.setDataRange(...allDataRanges[fieldName]);
321:      lutProxy.setDataRange(min, max);

components/controls/ColorBy/script.js
148:          this.setDataRange(lutProxy.getDataRange());
257:        pwfProxy.setDataRange(min, max);
259:        pwfProxy.setDataRange(...this.dataRange);
271:        lutProxy.setDataRange(min, max);
273:        lutProxy.setDataRange(...this.dataRange);
372:        this.setDataRange(lutProxy.getDataRange());
375:    setDataRangeIndex(index, value) {
381:          this.setDataRange(newRange);
385:    resetDataRange() {
386:      this.setDataRange(this.origDataRange);
414:    setDataRange(dataRange) {

components/controls/ColorBy/template.html
62:              @input="setDataRangeIndex(0, $event)"
77:                  @click="resetDataRange"
96:              @input="setDataRangeIndex(1, $event)"

components/widgets/PiecewiseFunctionEditor/script.js
21:    pwfproxy.getLookupTableProxy().setDataRange(...newColorRange);
57:        pwfProxy.getLookupTableProxy().setDataRange(...newColorRange);
1 Like