dolfinx
dolfinx copied to clipboard
Reconsider interactive visualization in notebooks and release Docker images
We currently use pyvista for in code visualization.
This works for rendering static figures in notebooks and jupyterlab.
There exists packages that can rendering interactive windows in notebooks:
- Pyvtk_simple
- ITKWidgets
However, neither is fully stable with jupyterlab 3.x, only working on a subset of systems. Another drawback is that ITKWidgets requires ~ 2GB of extra packages (itk-core etc), doubling the size of the docker images.
We should pay attention to the development of these packages, and see if they improve such that we can put them in a release image.
@jorgensd any updates on this? pyvista has an updated page on the topic at https://docs.pyvista.org/user-guide/jupyter/index.html.
pyvista has come a long way since, and now has very good support for interactive plotting in Jupyter.
@jorgensd do we need to add trame, or does it get installed with pyvista?
trame is now the new recommend way of using pyvista with jupyter.
For using trame, we would have to add (according to the docs https://docs.pyvista.org/user-guide/jupyter/trame.html#trame-jupyter):
python3 -m pip install 'jupyterlab>=3' ipywidgets 'pyvista[all,trame]'
However, I think we should figure out what deps in pyvista[all] is actually needed, as it also installs
other backends, such as pythreejs and panel: https://github.com/pyvista/pyvista/blob/main/pyproject.toml#L41-L49
which we do not want
@jorgensd can we close this now with all the pyvista changes?
I'll revisit this soon (need to check the latest release of pyvista).