Paraview-lite and RPC functions

Hello. I have a question around paraview and paraview-lite.

I have seen that inside paraview there are RPC functions available https://gitlab.kitware.com/paraview/paraview/-/blob/master/Web/Python/paraview/web/protocols.py?ref_type=heads

My question is, can all the RPC functions in this file be used inside paraview-lite, for example there is a RPC function called “pv.widgets.ruler.add”, is this available for use inside paraview-lite or is this an option that was supported in a previous web gui? If it is avilable is there any existing documentation on using these function to extend paraview-lite?

Thanks in advance for any assistance.

1 Like

The classes within paraview.web.protocols can be registered within any ParaView Web application (even the trame ones) but then you need the client side to make usage of it. Those protocols are either used within public applications like ParaView-Lite or with applications that Kitware created for our customers.

Hello,

The ParaViewWebWidgetManager class is already registered in ParaView-Lite, then I’ve been able to call the pv.widgets.ruler.add RPC function from the client side.
Although it raises an error (which I’m still debugging), the ruler is added with fixed points, but these points seem not movable with the mouse.
Since ParaView-Lite fits most of my needs (features, technical stack…), I would like to extend it, adding a ruler tool similar to the one in ParaView desktop application.
Could you give some directions or steps to achieve that in ParaView-Lite please?

Thanks in advance for your help!

After using the Trace tool in ParaView, I noticed that there is no function call about the ruler, until the Apply button is clicked. Then, I guess the widget to move the ruler’s points is handled on the client side. Is it correct? If so, does it mean I should use a vtk.js widget (e.g. DistanceWidget) to update the ruler in ParaView-Lite?

The widget is managed on the server side, so there is no vtk-js to worry about here.

I don’t remember the details, and therefore, it is tricky to provide proper feedback here.
It will require proper investigation to help you out. Feel free to contact Kitware if you want more focused help.