Automatically load data into ParaView Glance?


#1

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?


(Sebastien Jourdain) #2

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


#3

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?


#4

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

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


(Aron Helser) #5

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’ from origin ‘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.


#6

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


#7

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

<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?


(Sebastien Jourdain) #8

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 which may not have the CORS limitation.


#9

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

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?