pub struct MatrixRef {
pub columns: Vec<ColumnId>,
pub orientation: MatrixOrientation,
pub grid_layout: GridLayout,
}Expand description
A 2-D grid declared as a bundle of column ids — and nothing more.
There is no separate matrix container, no renderer-side registry, and no new
data trait. The grid is those columns in the pool; this says which ones and
how to read them. Keeping the declaration inline in the render type is what
lets Config + series fully define the picture: an id pointing at
something the renderer holds privately would not.
z statistics come from the constituent columns’ own cached min / max /
min_positive, combined. No GPU round trip, no second extent engine.
Fields§
§columns: Vec<ColumnId>The grid’s constituent columns, in grid order.
orientation: MatrixOrientationWhether each constituent column is a slice along x or along y.
grid_layout: GridLayoutWhether the coordinate columns hold cell boundaries (n + 1 values) or cell centres (n). Never inferred from the lengths.
Implementations§
Source§impl MatrixRef
impl MatrixRef
Sourcepub fn effective_extent(
&self,
x_len: usize,
y_len: usize,
shortest_column_len: usize,
) -> (usize, usize)
pub fn effective_extent( &self, x_len: usize, y_len: usize, shortest_column_len: usize, ) -> (usize, usize)
Cells along each axis, given the coordinate column lengths.
Returns (cols, rows) in constituent-column order: cols is how many
constituent columns are usable, rows how deep into each of them to
read. A declaration that does not line up with the data is not an
error — the smallest common extent is drawn and the caller reports the
truncation. Refusing to draw would turn a data-shape surprise into a
blank chart.
Sourcepub fn coordinate_cells(&self, x_len: usize, y_len: usize) -> (usize, usize)
pub fn coordinate_cells(&self, x_len: usize, y_len: usize) -> (usize, usize)
Cells the coordinate columns alone can bound, in constituent-column
order: (along, across).
The half of Self::effective_extent that does not depend on the data,
split out because a caller reporting truncation has to know what the
coordinates offered before the grid columns capped it.