Skip to main content

Module view

Module view 

Source
Expand description

The plot’s pan/zoom view state: a visible data-space window per axis, plus the projection, pan, and zoom algebra that maps between data space and the pixels of the plot’s data rect.

PlotView is to a plot what ViewportView is to a viewport: per-node interaction state, persisted across rebuilds in UiState and keyed by the plot’s .key(...). The difference — and the reason a plot does not reuse the viewport() widget — is that a plot zooms each axis independently and non-uniformly: you can stretch the time axis while the value axis autoscales, and a log axis zooms affine-in-log space. So PlotView carries a separate AxisView per axis and does all of its panning and zooming in scale space (through the axis Scale), exactly the coordinate in which those operations stay affine (see docs/PLOT2D_PLAN.md, decisions 2 and 4).

Structs§

AxisView
The visible window of one axis, in data space (the units the app measures in). For a Scale::Time axis these are epoch seconds; for Scale::Log they are the raw positive values, not their logarithms.
PlotView
A plot’s pan/zoom state: the visible window of each axis. Persisted per node and readable with UiState::plot_view — e.g. for the virtual-data pull, where the app loads or resamples its source to cover the window the user has scrolled into (see docs/PLOT2D_PLAN.md, decision 5).