# Automatically load data into ParaView Glance?

**URL:** https://discourse.paraview.org/t/automatically-load-data-into-paraview-glance/1539
**Category:** Web Support
**Created:** [March 27, 2019, 12:10pm UTC](https://discourse.paraview.org/t/automatically-load-data-into-paraview-glance/1539 "2019-03-27T12:10:41Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![johans](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/3ab097/32.png) [@johans](https://discourse.paraview.org/u/johans)
#### Post date: [March 27, 2019, 12:10pm UTC](https://discourse.paraview.org/t/automatically-load-data-into-paraview-glance/1539/1 "2019-03-27T12:10:41Z")

</div>

I have created a desktop app and am exporting simulation data in VTP format compatible with ParaView Glance. Is there an easy way to automatically link the Glance app with the data file so that the end user doesn’t have to “open/load” the data into Glance. I don’t really plan to change, recompile or host my own Glance app, but just automatically add or pre-select the data 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: [March 27, 2019, 2:08pm UTC](https://discourse.paraview.org/t/automatically-load-data-into-paraview-glance/1539/2 "2019-03-27T14:08:52Z")

</div>

If your data are available out in the wild, you can provide the information on where to load the data in the url, this also support several files if need be.

Here is an example `https://kitware.github.io/paraview-glance/app/?name=202-t.glance&url=https://raw.githubusercontent.com/Kitware/paraview-glance/v3.0.1/data/202-t.glance`

---

<div class="post-metadata">

### Author: ![johans](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/3ab097/32.png) [@johans](https://discourse.paraview.org/u/johans)
#### Post date: [March 27, 2019, 4:55pm UTC](https://discourse.paraview.org/t/automatically-load-data-into-paraview-glance/1539/3 "2019-03-27T16:55:27Z")

</div>

Thank you, just the functionality I was looking for.

It does not seem to work with local files or files served with only http, is there possibly some workaround or fix for this?

---

<div class="post-metadata">

### Author: ![johans](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/3ab097/32.png) [@johans](https://discourse.paraview.org/u/johans)
#### Post date: [April 8, 2019, 12:32pm UTC](https://discourse.paraview.org/t/automatically-load-data-into-paraview-glance/1539/4 "2019-04-08T12:32:52Z")

</div>

I have not been able to get this to work with my own data hosted on my own domain, for example

[https://kitware.github.io/paraview-glance/app/?name=featool-multiphysics-airfoil.glance&url=https://www.featool.com/download/featool-multiphysics-airfoil.glance](https://kitware.github.io/paraview-glance/app/?name=featool-multiphysics-airfoil.glance&url=https://www.featool.com/download/featool-multiphysics-airfoil.glance)

Does the glance app maybe need to be hosted on the same domain as the data?

---

<div class="post-metadata">

### Author: ![aron.helser](https://discourse.paraview.org/user_avatar/discourse.paraview.org/aron.helser/32/13_2.png) [@aron.helser](https://discourse.paraview.org/u/aron.helser)
#### Post date: [April 8, 2019, 12:47pm UTC](https://discourse.paraview.org/t/automatically-load-data-into-paraview-glance/1539/5 "2019-04-08T12:47:40Z")

</div>

Yes, exactly. When I try that link, I get this error message in Chrome:  
Access to XMLHttpRequest at ‘[https://www.featool.com/download/featool-multiphysics-airfoil.glance](https://www.featool.com/download/featool-multiphysics-airfoil.glance)’ from origin ‘[https://kitware.github.io](https://kitware.github.io)’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

So if you host ParaView Glance, you can either get data from the same domain, or set the policy to allow downloads from your data server.

---

<div class="post-metadata">

### Author: ![johans](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/3ab097/32.png) [@johans](https://discourse.paraview.org/u/johans)
#### Post date: [April 9, 2019, 7:11am UTC](https://discourse.paraview.org/t/automatically-load-data-into-paraview-glance/1539/6 "2019-04-09T07:11:45Z")

</div>

Thank you, that clears it up, and thanks for making Glance available.

---

<div class="post-metadata">

### Author: ![bernd](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/977dab/32.png) [@bernd](https://discourse.paraview.org/u/bernd)
#### Post date: [April 16, 2019, 11:16am UTC](https://discourse.paraview.org/t/automatically-load-data-into-paraview-glance/1539/7 "2019-04-16T11:16:28Z")

</div>

I have a similar question. Suppose that I have a html document with an iframe pointing to ParaView Glance:

```auto
<iframe src="https://kitware.github.io/paraview-glance/app" id="iframe"></iframe>

```

(How) Can I upload data in the html document via using that iframe? Will this have the same restrictions as mentioned above or can I upload local data this way?

---

<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: [April 16, 2019, 1:44pm UTC](https://discourse.paraview.org/t/automatically-load-data-into-paraview-glance/1539/8 "2019-04-16T13:44:30Z")

</div>

Via the URL, you will get the same restriction. But you should be able to host Glance locally if need be as well.

You could also use [https://unpkg.com/paraview-glance@3.1.1/dist/ParaViewGlance.html](https://unpkg.com/paraview-glance@3.1.1/dist/ParaViewGlance.html) which may not have the CORS limitation.

---

<div class="post-metadata">

### Author: ![bernd](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/977dab/32.png) [@bernd](https://discourse.paraview.org/u/bernd)
#### Post date: [April 16, 2019, 2:30pm UTC](https://discourse.paraview.org/t/automatically-load-data-into-paraview-glance/1539/9 "2019-04-16T14:30:54Z")

</div>

Thank you for the fast answer. For me, pointing to

```auto
https://unpkg.com/paraview-glance@3.1.1/dist/ParaViewGlance.html/?name=202-t.glance&url=https://raw.githubusercontent.com/Kitware/paraview-glance/v3.0.1/data/202-t.glance

```

doesn’t work, it just continues to the standard `ParaViewGlance.html`. It works for the `kitware.github.io` url.

I would anyway prefer to enter the normal address and use javascript from there to set the `name` and `url`. How would this work?

---

<div class="post-metadata">

### Author: ![meihuisu](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/9fc348/32.png) [@meihuisu](https://discourse.paraview.org/u/meihuisu)
#### Post date: [September 20, 2019, 6:54am UTC](https://discourse.paraview.org/t/automatically-load-data-into-paraview-glance/1539/10 "2019-09-20T06:54:55Z")

</div>

Thanks, I was able to host the server locally and load the data in the url as you have suggested but I could not get multiple files version to run,

http:localhost:9999/?name=Indian\_Hill.stl&url=http://localhost:9999/cfm\_data/Indian\_Hill.stl&name=San\_Jose.stl&url=http://localhost:9999/cfm\_data/San\_Jose.stl

---

<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: [September 20, 2019, 2:41pm UTC](https://discourse.paraview.org/t/automatically-load-data-into-paraview-glance/1539/11 "2019-09-20T14:41:20Z")

</div>

You can not have the same key used several times, you need to do something like that

`?url=url1,url2,url3&name=name1,name2,name3`

---

<div class="post-metadata">

### Author: ![meihuisu](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/9fc348/32.png) [@meihuisu](https://discourse.paraview.org/u/meihuisu)
#### Post date: [September 20, 2019, 5:19pm UTC](https://discourse.paraview.org/t/automatically-load-data-into-paraview-glance/1539/12 "2019-09-20T17:19:52Z")

</div>

Arg parser fails to parse the name=name1,name2  
It see it as a single filename.

```
The following files errored while loading:
 IndianHill.stl,SanJose.stl
```

---

<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: [September 21, 2019, 1:44am UTC](https://discourse.paraview.org/t/automatically-load-data-into-paraview-glance/1539/13 "2019-09-21T01:44:16Z")

</div>

try by surrounding the list with `[]` so it will be `?name=[a,b]&url=[c,d]`

---

<div class="post-metadata">

### Author: ![meihuisu](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/9fc348/32.png) [@meihuisu](https://discourse.paraview.org/u/meihuisu)
#### Post date: [September 21, 2019, 4:00am UTC](https://discourse.paraview.org/t/automatically-load-data-into-paraview-glance/1539/14 "2019-09-21T04:00:39Z")

</div>

Worked!!! Now I just to have to figure out if I can color them differently.  
Thanks for the great tool.

---

<div class="post-metadata">

### Author: ![Jaewon\_Chang](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jaewon_chang/32/2641_2.png) [@Jaewon\_Chang](https://discourse.paraview.org/u/Jaewon_Chang)
#### Post date: [January 7, 2020, 8:30am UTC](https://discourse.paraview.org/t/automatically-load-data-into-paraview-glance/1539/15 "2020-01-07T08:30:11Z")

</div>

Hello. I’m trying your example but glance keep says “Error: no data for …”  
Must be mistaking something but cannot find out

[https://kitware.github.io/paraview-glance/app/?name=dataset.vti&url=https://github.com/JaewonAC/dcmdb/raw/master/sample/dataset.vti](https://kitware.github.io/paraview-glance/app/?name=dataset.vti&url=https://github.com/JaewonAC/dcmdb/raw/master/sample/dataset.vti)

---

<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: [January 7, 2020, 11:46am UTC](https://discourse.paraview.org/t/automatically-load-data-into-paraview-glance/1539/16 "2020-01-07T11:46:08Z")

</div>

```auto
Access to XMLHttpRequest at 'https://github.com/JaewonAC/dcmdb/raw/master/sample/dataset.vti' from origin 'https://kitware.github.io' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'https://render.githubusercontent.com' that is not equal to the supplied origin.

```

---

<div class="post-metadata">

### Author: ![Jaewon\_Chang](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jaewon_chang/32/2641_2.png) [@Jaewon\_Chang](https://discourse.paraview.org/u/Jaewon_Chang)
#### Post date: [January 8, 2020, 2:35am UTC](https://discourse.paraview.org/t/automatically-load-data-into-paraview-glance/1539/17 "2020-01-08T02:35:30Z")

</div>

Oops Sorry missed Aron Helser’s reply on above. guess I understand the problem.

---

<div class="post-metadata">

### Author: ![johans](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/3ab097/32.png) [@johans](https://discourse.paraview.org/u/johans)
#### Post date: [February 8, 2020, 1:40pm UTC](https://discourse.paraview.org/t/automatically-load-data-into-paraview-glance/1539/18 "2020-02-08T13:40:21Z")

</div>

Just to follow up on this thread. I have now seen there are Glance html builds that can be used to bundle vtkjs files. I wonder if this would also be possible with plain ascii vtk or vtp files (without the views)? I have tried with

```
Glance.loadFiles/openFile("path_to_my_local_file")

```

calls instead of “importBase64Dataset” but just can not get that to work. Should this be possible at all?

Alternatively, should this be possible to run everything locally as:

```
file:///C:/temp/ParaViewGlance.html/?name=test.vtp&url=file:///C://temp//test.vtp

```

as this will not work either?

---

<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: [February 8, 2020, 2:34pm UTC](https://discourse.paraview.org/t/automatically-load-data-into-paraview-glance/1539/19 "2020-02-08T14:34:30Z")

</div>

importBase64Dataset() can indeed support any file that glance support (i.e.: vtp, vti). But the file in question needs to be properly encoded inside the HTML file. You can see the way we bundle a dataset [here](https://github.com/Kitware/VTK/blob/master/Web/Python/vtkmodules/web/vtkjs_helper.py#L36-L58).

In other words `importBase64Dataset` decode the data and call `loadFiles` internally.

---

<div class="post-metadata">

### Author: ![sharon](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/67e7ee/32.png) [@sharon](https://discourse.paraview.org/u/sharon)
#### Post date: [March 15, 2020, 12:16am UTC](https://discourse.paraview.org/t/automatically-load-data-into-paraview-glance/1539/20 "2020-03-15T00:16:15Z")

</div>

Hi Seb,  
This is also work for ParaView Web?  
How can i test it just on my own pc?  
like, if i already run server by “`.\bin\pvpython.exe .\share\paraview-5.8\web\visualizer\server\pvw-visualizer.py --content .\share\paraview-5.8\web\visualizer\www --data .\examples\ --port 8080`”

Then how to modify “[http://localhost:8080/](http://localhost:8080/)” to auto load file “can.ex2” under “examples” folder?

Thanks and Best Regards,  
Sharon

[Next page](https://discourse.paraview.org/t/automatically-load-data-into-paraview-glance/1539.md?page=2)
