using PyVista from pure-python web framework #4748
-
|
Lately, development is taking a turn towards the browser, web-based apps, the cloud, whatever you call it. I am not a full stack developer but, thankfully, quite a few pure-python web-development frameworks have popped up: nicegui, solara, reflex, etc. I looked at Trame but seems a bit convoluted; sure, the vtk widget is well documented, but when it comes to the other widgets typical of a dashboard application, they seem to rely in Vuetify and one needs to look the docs for javascript and convert to python...not cool. Could I use PyVista from within one of these web frameworks? I do see mention of a trame backend. But, in general, web-based use of PyVista is not very clear in the documentation or, somehow, jupyter-notebook oriented. For frontend widgets and the like, I find something like reflex and nicegui much easier to use than trame; but I also want to take advantage of VTK, somehow. And so, would it be too much to ask for a PyVista example for the browser that shows the same minimal trame/examples/06_vtk/01_SimpleCone ? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
|
Earlier PyVista had flask examples, but these have been removed. |
Beta Was this translation helpful? Give feedback.
-
|
Wait, what? Are you asking me what I asked "you"? I asked first! Or I don't know what you mean. Otherwise, I am asking for an example python program that shows the use of pyvista in a non-jupyter, web-based context. |
Beta Was this translation helpful? Give feedback.
-
|
Ha, ha, no worries. Here is my confusion...the way I see it, pyVista already:
So, how come it cannot render in a browser, outside a jupyter notebook? |
Beta Was this translation helpful? Give feedback.
The following thread will answer your question.
https://discourse.holoviz.org/t/trame-support-in-panel-to-fully-support-vtk/5275/1
The conclusion is that PyVista relies on the help of ipywidgets to plot on Jupyter. Therefore, in order to display PyVista in the browser, a framework is needed to display the output of ipywidgets in the browser, such as Panel from the Holoviz project.
Edit: Here is the code and output.