Trame interface for PyVista. Provides web-based 3D viewers, Jupyter backends, scene exporters, and a Sphinx directive for embedding interactive plots in docs.
This package was extracted from the pyvista.trame subpackage so the
trame stack can release on its own cadence. PyVista discovers installed
functionality through entry points, so existing user code keeps working
once trame-pyvista is installed.
pip install trame-pyvistaFor Jupyter:
pip install "trame-pyvista[jupyter]"The notebook widgets are anywidgets. When the
Jupyter server runs in a separate environment from the kernel (JupyterHub,
nb_conda_kernels), install anywidget in the server environment too.
For marimo:
pip install "trame-pyvista[marimo]"-
Jupyter backends:
trame,server,client,html. Registered with PyVista via thepyvista.jupyter_backendsentry-point group, sopv.set_jupyter_backend('trame')works oncetrame-pyvistais installed. -
marimo: with PyVista 0.50 or newer (
pip install "pyvista[marimo]"),pl.show()andmesh.plot()render inline andjupyter_backendorpv.set_jupyter_backendpicks the backend, as in Jupyter. With older PyVista, end a cell withpl.trame.show(mode=...)instead.htmlworks in any marimo session, whiletrame,serverandclientneed the browser on the machine running marimo. See examples/marimo/viewer.py. -
Plotter views:
PyVistaLocalView,PyVistaRemoteView,PyVistaRemoteLocalViewfor embedding in trame apps. -
plotter.tramenamespace: registered as a PyVista plotter component so exporters live under the trame namespace:import pyvista as pv pl = pv.Plotter() pl.add_mesh(pv.Sphere()) pl.trame.export_vtksz('scene.vtksz') pl.trame.export_html('scene.html')
-
Sphinx directive:
trame_pyvista.sphinx_extprovides theofflineviewerdirective used by PyVista docs to embed exported.vtkszscenes. Add toconf.py:extensions = ['trame_pyvista.sphinx_ext']
import pyvista as pv
pv.set_jupyter_backend('trame')
pl = pv.Plotter()
pl.add_mesh(pv.Wavelet())
pl.show()Custom UI:
from trame_pyvista import plotter_ui
ui = plotter_ui(plotter, mode='trame')See examples/ for runnable scripts covering local/remote views, custom
UIs, and toolbar customization.
just sync # create venv and install dev deps
just test # unit tests
just test-playwright # Sphinx + browser integration tests
just lint # pre-commit (ruff, etc.)
just typecheck
just buildMIT. See LICENSE.