Expand description
The declarative description of a plot: its marks, axes, and styling.
PlotSpec is to plot what
SceneSpec is to chart3d — a fluent builder
the app assembles each frame and hands to the widget, which resolves it
(in draw_ops) to the reused DrawOp::Scene3D data
layer plus themed axis/grid/legend chrome.
Following the house two-tier convention, each mark has a terse
default-style adder on the builder (PlotSpec::line,
PlotSpec::scatter) and a full-control escape hatch (the standalone
[line]/scatter builders + PlotSpec::add_mark) for power users.
Structs§
- Axis
- One axis’s configuration: its
Scaleand an optional title. - Line
Mark - A line mark: a series drawn as a connected polyline (segments + round
join/cap discs, per the reuse-the-pipelines decision).
color = Noneauto-assigns from the theme’s series palette at resolve time. - Plot
Spec - The full declarative description of a plot: marks, per-axis scales, view
behaviour, and styling. Assemble fluently and pass to
plot: - Plot
Style - Plot-level styling: background, gridlines, and MSAA. Maps to the reused
scene’s
SceneStyleat resolve time (the plot draws its own axis/grid chrome, so the scene’s own grid/axes are left off). - Scatter
Mark - A scatter mark: a series drawn as discrete markers.
color = Noneauto-assigns from the theme’s series palette at resolve time.
Enums§
- Legend
Position - Where a plot’s legend sits — a corner of the data rect. Set via
PlotSpec::legend; the spec’slegendisNone(no legend) by default. - Mark
- One mark in a plot. Construct with the [
line]/scatterbuilders or thePlotSpecadders. - Plot
Controls - Pointer control scheme for a
plot, the 2D analogue ofCameraControlsforchart3d: the app picks one on the spec and there is deliberately no built-in scheme-picker widget. Double-click always resets to the full extent and the wheel always zooms the time (X) axis, regardless of scheme; the scheme selects what the primary (unmodified) left-drag does, withShiftdoing the other.
Constants§
- DEFAULT_
LINE_ WIDTH - Default line width, in screen pixels.
- DEFAULT_
MARKER_ SIZE - Default scatter marker size, in screen pixels.
Functions§
- line
- Build a default-styled
LineMarkfrom a series — the standalone escape-hatch form (chain.color(...)/.width(...), then add withPlotSpec::add_mark). - scatter
- Build a default-styled
ScatterMarkfrom a series — the standalone escape-hatch form.