[Paraview] Embedding the Visualizer app in the browser within an iframe

Claude claude at theweak.link
Fri Jan 13 07:34:28 EST 2017


Hi Debopam,

Thanks for the added details on the gist and congratulations for setting up the server, you are almost there.
For Visualizer to be able to load a file, it will need the argument --load-file (it seems to have disappeared in your config launcher). The option --data specifies the directory, so whatever file you want to load, it must be relative to that directory. For example to load the data file C:/my_data/dir/example1/my_file.vti you could do:
--data is C:/my_data/dir
--load-file is example1/my_file.vti

Here is a question for you: do you want to always have the same data loaded by default or to be able to specify it? 
* If it's always the same, you can directly hardcode it in the launcher config file. Then it will be loaded when you navigate to the paraview URL.
* if it's not always the same, you could use the solution on the gist which is specifying it in the URL directly (there are other alternatives of course). In that case, the URL must contain the file to load (otherwise paraview cannot guess it :)). For instance:
http://localhost:9000/?data=example1/my_file

(The JavaScript code automatically adds the extension .vti, you may change that behavior of course).

I'll be posting the detailed changes on your code in the gist comment shortly.

Let me know
Cheers
Claude 


> On Jan 13, 2017, at 5:05 AM, Debopam Ghoshal <debopamg at gmail.com> wrote:
> 
> Hi Claude,
> 
> I followed your instructions with some modifications since I was having problems. Finally, I was able to configure the Apache front end with the ParaView Web launcher, and now I can view the index page of the visualizer. However, when I choose any of the sample files, they are not being rendered in the visualizer pane. 
> 
> I have added the details in the gist you created at: https://gist.github.com/clavicule/7b8b3963ceb17302cff725f8dc36bc57
> 
> Would appreciate your thoughts on this.
> 
> 
> 
> Cheers & Best Wishes,
> Debopam
> -------------------------------
> 
> 
>> On Thu, Jan 12, 2017 at 5:22 PM, Debopam Ghoshal <debopamg at gmail.com> wrote:
>> Hi Claude
>> 
>> Thank you so much for your detailed explanation. The gist has been very useful. I am working on it at present, and is in the process of smoothening out a few creases because of the operating system I am using (Windows 10).
>> 
>> Will let you know once I am able to use paraview web properly. And in case of any issue, I will bother you once again.
>> 
>> Hi Seb,
>> 
>> Thanks for the link. Much appreciated.
>> 
>> 
>> Cheers & Best Wishes,
>> Debopam
>> -------------------------------
>> 
>>> On Wed, Jan 11, 2017 at 9:48 PM, Sebastien Jourdain <sebastien.jourdain at kitware.com> wrote:
>>> Thanks Claude,
>>> 
>>> Here is the add-on of what functions can be called on Visualizer. (All the function with export)
>>> 
>>> https://github.com/Kitware/visualizer/blob/master/src/app.js
>>> 
>>> We are planning to add some helper for extracting arguments from the URL. We actually add a class in the ParaViewWeb repo, but we haven't got to the point of using it and making it available in visualizer.
>>> 
>>> Seb
>>> 
>>>> On Wed, Jan 11, 2017 at 7:32 AM, claude <claude at theweak.link> wrote:
>>>> Hi Debopam,
>>>> 
>>>> 
>>>> I think there is one thing to consider first before taking care of data being passed through: if you manually start one instance of pvw-visualizer, it means all people connecting to port 8080 will see the same thing and act on the same viewer, which means potentially conflicting with each other action (e.g. a probable disconnection for everyone if one decide to exit maybe?). In that case, you need to have a virtual server that will launch a new process every time someone connect to port 8080. That way, all viewers are independent, the same person can open several viewers, etc.
>>>> 
>>>> 
>>>> Now regarding the data being loaded at startup: you html index file should have a function grabbing the 'data' parameter from a URL, a form, a dropdown menu, etc. then sending it as a key to the Visualizer application (so that the launcher knows which file to load at startup).
>>>> It would have been complicated to explain all the details in a email, so I made a gist with all the files and "code" addressing both points (launcher and data):
>>>> 
>>>> https://gist.github.com/clavicule/7b8b3963ceb17302cff725f8dc36bc57
>>>> 
>>>> Note that this gist was gathered info from the Paraview Web and Visualizer online documentations: kuddos to Paraview people.
>>>> 2nd note: in that gist I'm giving the instructions for Apache server (you could technically choose any other, e.g. NGinx) for Linux.  I see you are on Windows: I don't know how Apache works on Windows but I assume (and hope) the steps and config file should be similar.
>>>> 
>>>> I hope it helps! Good luck!
>>>> cheers
>>>> claude
>>>> 
>>>> 
>>>> 
>>>> 
>>>>> On 01/11/2017 04:10 AM, Debopam Ghoshal wrote:
>>>>> Hi,
>>>>> 
>>>>> We have a requirement where our application will send a request to the paraview web server to render a specific file (which will be available in the data given directory) in the visualizer app, and this will be embedded within our application page as a iframe, whose source is the Visualizer app's index.html.
>>>>> 
>>>>> We are using the pvpython.exe executable to start the paraview web server. The command used to start the server is:
>>>>> 
>>>>> .\bin\pvpython.exe "C:\ParaView-5.2.0-Qt4-OpenGL2-MPI-Windows-64bit\share\paraview-5.2\web\visualizer\server\pvw-visualizer.py" --content "C:\ParaView-5.2.0-Qt4-OpenGL2-MPI-Windows-64bit\share\paraview-5.2\web\visualizer\www" --data "C:\ParaView-5.2.0-Qt4-OpenGL2-MPI-Windows-64bit\data" --port 8080
>>>>> 
>>>>> 
>>>>> From the command, we can see that the web content is being served from the C:\ParaView-5.2.0-Qt4-OpenGL2-MPI-Windows-64bit\share\paraview-5.2\web\visualizer\www directory. The index.html file uses the Visualizer.js script and calls the following functions:
>>>>> 
>>>>> Visualizer.connect({ application: 'visualizer' });
>>>>> Visualizer.autoStopServer(10);
>>>>> 
>>>>> Is there any way to find out the available functions in the Visualizer.js script and call them from our custom html file? What we intend to do is to update the index.html file and
>>>>> a. add a javascript function which will accept a filename to be rendered
>>>>> b. once the filename is received by this function, it will call the visualizer and display the specified file
>>>>> c. in the visualizer page, the open files tab should be hidden.
>>>>> 
>>>>> Please let me know if you require any clarification.
>>>>> 
>>>>> Cheers & Best Wishes,
>>>>> Debopam
>>>>> -------------------------------
>>>>> 
>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> Powered by www.kitware.com
>>>>> 
>>>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>>>> 
>>>>> Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView
>>>>> 
>>>>> Search the list archives at: http://markmail.org/search/?q=ParaView
>>>>> 
>>>>> Follow this link to subscribe/unsubscribe:
>>>>> http://public.kitware.com/mailman/listinfo/paraview
>>>> 
>>>> 
>>>> _______________________________________________
>>>> Powered by www.kitware.com
>>>> 
>>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>>> 
>>>> Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView
>>>> 
>>>> Search the list archives at: http://markmail.org/search/?q=ParaView
>>>> 
>>>> Follow this link to subscribe/unsubscribe:
>>>> http://public.kitware.com/mailman/listinfo/paraview
>>>> 
>>> 
>> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20170113/80136df6/attachment.html>


More information about the ParaView mailing list