Plotter Components#
PyVista exposes a namespaced component extension point on
pyvista.BasePlotter so that third-party packages can attach
namespaced helpers to the plotter without monkey-patching or
subclassing. Once a plugin module is imported, its component becomes
available on every plotter instance as
plotter.<namespace>.<method>(...).
Components are constructed lazily on first attribute access and cached
on the plotter instance. They participate in the plotter lifecycle: a
component class can define optional __plotter_close__ and
__plotter_deep_clean__ dunder methods that PyVista invokes from
BasePlotter.close and
BasePlotter.deep_clean. Both hooks fire only on
components that were actually constructed (touched at least once), in
reverse construction order.
The registration surface mirrors the dataset-accessor API line for line. Plugin authors learn one decorator pattern and apply it to both datasets and the plotter.
|
Register a custom namespaced component on a PyVista plotter class. |
|
Remove a component previously attached to a plotter class. |
Return every plotter component currently registered. |
|
|
Describe one registered plotter component. |
|
Structural protocol for plotter component classes. |