Metadata-Version: 2.4
Name: trame-pyvista
Version: 0.1.1
Summary: Trame interface for PyVista
Author-email: The PyVista Developers <info@pyvista.org>
License-Expression: MIT
Project-URL: Homepage, https://github.com/pyvista/trame-pyvista
Project-URL: Issues, https://github.com/pyvista/trame-pyvista/issues
Project-URL: Repository, https://github.com/pyvista/trame-pyvista
Keywords: vtk,trame,pyvista,jupyter,visualization
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyvista>=0.48
Requires-Dist: trame>=2.5.2
Requires-Dist: trame-client>=2.12.7
Requires-Dist: trame-server!=3.7.*,!=3.8.0,>=2.11.7
Requires-Dist: trame-vtk!=2.10.3,!=2.11.0,!=2.11.1,!=2.11.2,!=2.11.3,!=2.11.4,!=2.11.5,!=2.11.6,<2.11.9,>=2.5.8
Requires-Dist: trame-vuetify>=2.3.1
Provides-Extra: jupyter
Requires-Dist: ipywidgets; extra == "jupyter"
Requires-Dist: jupyter-server-proxy; extra == "jupyter"
Requires-Dist: nest-asyncio2; extra == "jupyter"
Provides-Extra: sphinx
Requires-Dist: docutils; extra == "sphinx"
Requires-Dist: sphinx; extra == "sphinx"
Provides-Extra: test
Requires-Dist: ipython; extra == "test"
Requires-Dist: ipywidgets; extra == "test"
Requires-Dist: nest-asyncio2; extra == "test"
Requires-Dist: pytest>=8.0; extra == "test"
Requires-Dist: pytest-cov>=5.0; extra == "test"
Provides-Extra: playwright
Requires-Dist: matplotlib; extra == "playwright"
Requires-Dist: numpydoc; extra == "playwright"
Requires-Dist: playwright; extra == "playwright"
Requires-Dist: sphinx; extra == "playwright"
Requires-Dist: sphinx-book-theme; extra == "playwright"
Requires-Dist: sphinx-design; extra == "playwright"
Requires-Dist: sphinx-gallery; extra == "playwright"
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: ruff>=0.15; extra == "dev"
Requires-Dist: trame-pyvista[jupyter,playwright,sphinx,test]; extra == "dev"
Dynamic: license-file

# trame-pyvista

[Trame][trame] interface for [PyVista][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.

[trame]: https://kitware.github.io/trame/
[pyvista]: https://pyvista.org

## Install

```bash
pip install trame-pyvista
```

For Jupyter:

```bash
pip install "trame-pyvista[jupyter]"
```

## What you get

- **Jupyter backends**: `trame`, `server`, `client`, `html`. Registered
  with PyVista via the `pyvista.jupyter_backends` entry-point group, so
  `pv.set_jupyter_backend('trame')` works once `trame-pyvista` is
  installed.
- **Plotter views**: `PyVistaLocalView`, `PyVistaRemoteView`,
  `PyVistaRemoteLocalView` for embedding in trame apps.
- **`plotter.trame` namespace**: registered as a PyVista plotter
  component so exporters live under the trame namespace:

  ```python
  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_ext` provides the
  `offlineviewer` directive used by PyVista docs to embed exported
  `.vtksz` scenes. Add to `conf.py`:

  ```python
  extensions = ['trame_pyvista.sphinx_ext']
  ```

## Usage

```python
import pyvista as pv

pv.set_jupyter_backend('trame')
pl = pv.Plotter()
pl.add_mesh(pv.Wavelet())
pl.show()
```

Custom UI:

```python
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.

## Development

Uses [`uv`][uv] and [`just`][just]:

```bash
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 build
```

[uv]: https://docs.astral.sh/uv/
[just]: https://just.systems/

## License

MIT. See [LICENSE](LICENSE).
