Where does the URL data gets stored from paraview lite?

Dear all,

I am working on Paraview lite for vtk visualization. With respect to this, I have configured the dataDir in launcher.json file to be loaded as "dataDir": "/home/data/pvw/10"
where 10 is the directory name or number.

  1. The url which is getting loaded in the browser is http://localhost/lite/?data=/10. I am able to see the visualization whenever the URL is triggered.

  2. As there are multiple directories which are to be visualized, I wanted to know if the value provided in the URL can be fetched in the dataDir configuration dynamically. As per my understanding, I think that the value entered in URL (data=/10) is getting assigned to a variable.

Requirement

  1. As per requirement, I am looking to change the dataDir configuration based on the data entered in the URL. For eg, we are looking something as below:

    "dataDir": "/home/data/pvw/${variable}"

Note: {variable} - I am expecting this variable will be having the value as “10”, which is passed in URL http://localhost/lite/?data=/10.

  1. Let me know which variable has this data stored? If not, is there any other work around to achieve it?

Regards,
Sunag R A.

First of all you need to have the ${variable} in your command line (in launcher config) not in the property section as they won’t be resolved at the same time.

If you use ${variable} in your command line, you will need to provide ?variable=10 in your URL. But if you don’t like the name variable, that is fine, you can use ?sunag=10 and have in your command line ${sunag}.

Hope that make sense,

Seb

Dear Sebastien,

So, ${variable} or ${sunag} is now assigned in the “cmd” in launch config file.

So, if the user enters different directory numbers like 10, 20, 30 at same time in different url (say, ?sunag=10, ?sunag=20 and so on), how can I get that value assigned to ${sunag} variable.?

Regards,
Sunag R A.

This is happening by default and by design. You don’t have to do anything, that is the all point of having a launcher and using the URL to extend the config from it. But that only work when the user connect. Once the process is running for that user, you need to go through the websocket using RPC or pub/sub to ask that process to do more things that were not initially known.

I guess I don’t understand your question or what you are trying to do as for me things are straight forward and I don’t see where you get lost.

To summarize:

  • the url can be used to provide as many information as your application needs at startup

To me that summary encompass what you are trying to do. After that you just need to tweak your application to leverage that user input the way you want.

Maybe you are missing the point of the launcher. Did you read this?

Okay. I will try to make it clear with what I need.

  1. I have read the documentation and have worked around the launcher for loading a single directory when the url is used. This works well.

  2. What I am trying to make it work is that, the “dataDir” in the “properties” of launcher takes a static argument and opens only that particular directory which is given.

"properties": {
      "web_path": "/home/data/pv/pv-5.9.0/share/paraview-5.9/web",
      "python_exec": "/home/data/pv/pv-5.9.0/bin/pvpython",
      "dataDir": "/home/data/pvw/dir1"
    },
  1. When the URL is provided, the paraview-lite opens with /home/data/pvw/dir1 location.

  2. If at the same time, say, there are users who need to look at different “directory”, for eg: /home/data/pvw/dir2 and /home/data/pvw/dir3**.

  3. Since the launcher is static file, I need to kill the process of /home/data/pvw/dir1 instance and change to another directory by tweaking in launcher file and run the start.sh file again everytime.

Remarks:

So, from this understanding, what I observed is that

  1. At a particular time, we can visualize the contents of only one particular directory location

Question

  1. How to modify the launcher config in such a way that we can view different directories at same time where URL endpoint is different for different directories.?

URL eg:

http://localhost/lite/?data=dir1 should show the contents from dir1 location,
http://localhost/lite/?data=dir2 should show the contents from dir2 location and so on at same time.

Hope it is understood?

Regards,
Sunag R A.

Your point (5) is wrong. Each user connecting is getting a new process. As long as they decide which directory they want to look at from the URL at their startup time, you are good. No need to kill any process or even restart the launcher.

Like I said, you don’t understand the point of the launcher and what it is doing for you, hence your confusion.
Please post the command line section of the launcher so I can post the solution for you.

The launcher config is static but string replacement is happening based on what the user is providing from the URL, that is why you do not need to change such config or restart the launcher.

Dear Sebastien,

Below is the launcher “properties” and “cmd” section.

"properties": {
      "web_path": "/home/data/pv/pv-5.9.0/share/paraview-5.9/web",
      "python_exec": "/home/data/pv/pv-5.9.0/bin/pvpython",
      "dataDir": "/home/data/pvw/dir1"
    },
    "apps": {
      "paraview-lite": {
        "cmd": [
          "${python_exec}",
	      "${web_path}/lite/server/pvw-lite.py",
          "--port", "${port}",
	      "--data", "${dataDir}",
          "--authKey", "${secret}"
        ],
        "ready_line" : "Starting factory"
      }

Here “–data” is assigned to “dataDir” in properties section which contains one directory.

Thank you.

Regards,
Sunag R A.

"properties": {
  "web_path": "/home/data/pv/pv-5.9.0/share/paraview-5.9/web",
  "python_exec": "/home/data/pv/pv-5.9.0/bin/pvpython",
  "dataDir": "/home/data/pvw"
},
"apps": {
  "paraview-lite": {
    "cmd": [
      "${python_exec}",
      "${web_path}/lite/server/pvw-lite.py",
      "--port", "${port}",
      "--data", "${dataDir}/${data}",
      "--authKey", "${secret}"
    ],
    "ready_line" : "Starting factory"
}
1 Like

Dear Sebastien,

As you mentioned, I was literally confused with the contents in the launcher file.

Now, I am able to get different directories based on URL assignment.

Thanks for the patience and support.

Regards,
Sunag R A.

1 Like