Skip to content

Documents · API reference

Visualization API

The plot verb uses the custom HTML cube viewer. Fire plotting still uses a Plotly hull backend; Lexcube is a separate optional widget integration. This reference does not switch or unify those renderers.

v.plot() selects state from condition Datasets and event_active from event results. Dimensional dispatch is explicit: 3-D time-space data use the interactive cube, 2-D spatial summaries use a static map, and 1-D temporal summaries use a static line. Ambiguous Datasets require variable= and unsupported shapes fail before a notebook representation is returned.

CubePlot

Internal object model for cube visualizations.

The class glues the grammar-of-graphics pieces together while keeping the streaming pipeline intact. It powers both pipe-style usage (v.plot) and advanced layering/faceting examples used throughout the docs.

to_html()

save(path, format=None, dpi=150)

Save the cube figure to disk.

Currently supports HTML output natively. PNG export can be added in environments with a headless browser; for now a clear error is raised guiding users to HTML snapshots.

Themes and aesthetics

Theme configuration for cube plots.

CSS variables and font sizes flow through to the generated HTML so captions, titles, axes, and legends match report-ready styling. Themes are intentionally lightweight: adjust only what is needed while leaving streaming behavior untouched.

Return the default "studio" theme.

Aesthetic mapping for cube plots.

Mirrors ggplot's aes by mapping data variables to visuals. Only the fields relevant to the cube viewer are exposed (fill, alpha, and slice selection), keeping the API small while matching the grammar-of-graphics vocabulary documented on the website.

Camera/coordinate configuration for cube plots.

HTML display helper

Return an IFrame pointing at a self-contained cube viewer file.

Jupyter will happily render <iframe> blocks while sanitizing inline <script> tags. Writing the viewer to disk and loading it in an IFrame keeps the JavaScript intact without requiring notebook trust.

Optional Lexcube helper

Create a Lexcube widget from a 3-D (time, y, x) cube.

Lexcube is optional. Install cubedynamics[viz] and restart the notebook kernel before calling this helper; a missing extra raises :class:LexcubeUnavailableError with that guidance.

The show_cube_lexcube verb wraps this helper as a pass-through pipe stage. Lexcube is not installed by the core package. Install it with python -m pip install "cubedynamics[viz]", restart the notebook kernel, and use a compatible Jupyter frontend.

See also

Cube viewer guide · Viewer invariants · Fire rendering architecture · Observed-data notebooks