pub struct PatternAxis {
pub column: String,
pub min: Option<f64>,
pub max: Option<f64>,
pub cells: u32,
}Expand description
One axis of the grid, over one output column.
Fields§
§column: StringOutput column, a reducer column such as Infected:max.
min: Option<f64>Lower bound, or None for an automatic range.
max: Option<f64>Upper bound, or None for an automatic range.
cells: u32Number of cells from the lower bound to the upper bound, all of one width.
Implementations§
Source§impl PatternAxis
impl PatternAxis
Sourcepub fn bounded(
column: impl Into<String>,
min: f64,
max: f64,
cells: u32,
) -> Self
pub fn bounded( column: impl Into<String>, min: f64, max: f64, cells: u32, ) -> Self
Returns an axis over column from min to max, cut into cells cells.
Sourcepub fn automatic(column: impl Into<String>, cells: u32) -> Self
pub fn automatic(column: impl Into<String>, cells: u32) -> Self
Returns an axis over column cut into cells cells, whose range is taken from the initial samples.
Sourcepub fn range(&self) -> Option<(f64, f64)>
pub fn range(&self) -> Option<(f64, f64)>
Returns the lower and upper bounds, or None unless both bounds are given.
Sourcepub fn is_automatic(&self) -> bool
pub fn is_automatic(&self) -> bool
Returns whether the range is left to the initial samples, with neither bound given.
Sourcepub fn cell_index(&self, value: f64) -> Option<(u32, bool)>
pub fn cell_index(&self, value: f64) -> Option<(u32, bool)>
Returns the index of the cell value lands in and whether value lay outside the axis, or None for an
axis without both bounds.
A value below the lower bound or above the upper bound lands in the edge cell nearer to it, and NaN in the
first cell. Each such value lies outside the axis.