# Load json

**URL:** https://discourse.paraview.org/t/load-json/6059
**Category:** Web Support
**Created:** [December 14, 2020, 10:04pm UTC](https://discourse.paraview.org/t/load-json/6059 "2020-12-14T22:04:30Z")
**Posts on this page:** 9
**Page:** 2

<div class="post-metadata">

### Author: ![dsanfra](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dsanfra/32/6650_2.png) [@dsanfra](https://discourse.paraview.org/u/dsanfra)
#### Post date: [May 11, 2021, 11:45pm UTC](https://discourse.paraview.org/t/load-json/6059/21 "2021-05-11T23:45:50Z")

</div>

hi @jourdain ! thanks for your reply

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

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [May 12, 2021, 3:27pm UTC](https://discourse.paraview.org/t/load-json/6059/22 "2021-05-12T15:27:39Z")

</div>

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.

> **[Kitware/paraview-glance](https://github.com/Kitware/paraview-glance/tree/master/data)**
>
> master/data

---

<div class="post-metadata">

### Author: ![dsanfra](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dsanfra/32/6650_2.png) [@dsanfra](https://discourse.paraview.org/u/dsanfra)
#### Post date: [May 14, 2021, 2:06am UTC](https://discourse.paraview.org/t/load-json/6059/23 "2021-05-14T02:06:42Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [May 14, 2021, 2:09pm UTC](https://discourse.paraview.org/t/load-json/6059/24 "2021-05-14T14:09:24Z")

</div>

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

---

<div class="post-metadata">

### Author: ![dsanfra](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dsanfra/32/6650_2.png) [@dsanfra](https://discourse.paraview.org/u/dsanfra)
#### Post date: [May 17, 2021, 3:38pm UTC](https://discourse.paraview.org/t/load-json/6059/25 "2021-05-17T15:38:28Z")

</div>

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

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [May 17, 2021, 5:02pm UTC](https://discourse.paraview.org/t/load-json/6059/26 "2021-05-17T17:02:42Z")

</div>

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)

---

<div class="post-metadata">

### Author: ![dsanfra](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dsanfra/32/6650_2.png) [@dsanfra](https://discourse.paraview.org/u/dsanfra)
#### Post date: [May 17, 2021, 5:13pm UTC](https://discourse.paraview.org/t/load-json/6059/27 "2021-05-17T17:13:49Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [May 17, 2021, 5:34pm UTC](https://discourse.paraview.org/t/load-json/6059/28 "2021-05-17T17:34:38Z")

</div>

Here is an example that you can unzip to see its content.  
[diskout.vtkjs](https://discourse.paraview.org/uploads/short-url/rr2m2NR0OZ70reBq543EnR0fDRB.vtkjs) (1.2 MB)

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [May 17, 2021, 6:11pm UTC](https://discourse.paraview.org/t/load-json/6059/29 "2021-05-17T18:11:04Z")

</div>

Here are the places when data ranges get affected in Glance

```auto
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);

```

[Previous page](https://discourse.paraview.org/t/load-json/6059.md?page=1)
