Skip to main content

PlotAdapter

Struct PlotAdapter 

Source
pub struct PlotAdapter<'source, K: Marker> { /* private fields */ }
Expand description

A native exact-family plot and an optional safely borrowed array lookup context. Direct views are snapshotted and released at each binding; .into() releases the retained source and moves the owned native plot without rendering. Self::into_parts also preserves the source-free binding metadata.

Implementations§

Source§

impl<K: PointAlpha> PlotAdapter<'_, K>

Source

pub fn point_alpha(self, input: impl AlphaInput) -> Result<Self, AdapterError>

Bind observation coefficients or pass through a native encoding without reinterpretation.

Source

pub fn point_alpha_cells( self, input: impl AlphaInput, ) -> Result<Self, AdapterError>

Bind already-expanded coefficients without repeating source rows.

Source

pub fn point_alpha_linear( self, input: impl NumericInput, domain: (f64, f64), range: (f64, f64), ) -> Result<Self, AdapterError>

Materialize the native linear declaration on the bound numeric variable.

Source

pub fn point_alpha_map( self, input: impl NumericInput, mapper: impl FnOnce(NumericValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>

Map numeric row values once, preserving the native declaration through expansion.

Source

pub fn point_alpha_map_categories( self, input: impl CategoryInput, mapper: impl FnOnce(CategoryValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>

Map categorical row values once before expansion.

Source

pub fn point_alpha_cells_map( self, input: impl NumericInput, mapper: impl FnOnce(NumericValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>

Map explicitly expanded numeric slots without row repetition.

Source

pub fn point_alpha_cells_map_categories( self, input: impl CategoryInput, mapper: impl FnOnce(CategoryValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>

Map explicitly expanded categorical slots without row repetition.

Source

pub fn point_alpha_single( self, input: impl AlphaValuesInput, ) -> Result<Self, AdapterError>

Explicitly broadcast exactly one bound alpha value.

Source

pub fn point_alpha_single_map( self, input: impl NumericInput, mapper: impl FnOnce(NumericValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>

Map exactly one numeric member and explicitly broadcast its declaration.

Source

pub fn point_alpha_single_map_categories( self, input: impl CategoryInput, mapper: impl FnOnce(CategoryValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>

Map exactly one categorical member and explicitly broadcast its declaration.

Source

pub fn point_alpha_keyed<I, S, B>( self, keys: I, input: impl AlphaValuesInput, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Bind exact series/aggregate keys; observations are never implicitly reduced.

Source

pub fn point_alpha_keyed_from_data<I, S, B>( self, source: impl ArraySource, keys: I, input: impl AlphaValuesInput, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Bind an independent selector source eagerly, retaining no borrow of it.

Source

pub fn point_alpha_keyed_map<I, S, B>( self, keys: I, input: impl NumericInput, mapper: impl FnOnce(NumericValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map numeric alpha for exact actual series/aggregate selectors.

Source

pub fn point_alpha_keyed_map_from_data<I, S, B>( self, source: impl ArraySource, keys: I, input: impl NumericInput, mapper: impl FnOnce(NumericValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map numeric alpha in an independent selector source.

Source

pub fn point_alpha_keyed_map_categories<I, S, B>( self, keys: I, input: impl CategoryInput, mapper: impl FnOnce(CategoryValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map categorical alpha for exact series/aggregate selectors.

Source

pub fn point_alpha_keyed_map_categories_from_data<I, S, B>( self, source: impl ArraySource, keys: I, input: impl CategoryInput, mapper: impl FnOnce(CategoryValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map categorical alpha in an independent selector source.

Source

pub fn point_alpha_columns<I, S, B>( self, column_key: impl SourceRowsInput, other_keys: I, values: impl AlphaValuesInput, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Key alpha by logical source-column indices, not display labels or private field strings.

Source

pub fn point_alpha_columns_from_data<I, S, B>( self, source: impl ArraySource, column_key: impl SourceRowsInput, other_keys: I, values: impl AlphaValuesInput, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Bind generated-column alpha from an independent selector source.

Source

pub fn point_alpha_columns_map<I, S, B>( self, column_key: impl SourceRowsInput, other_keys: I, input: impl NumericInput, mapper: impl FnOnce(NumericValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map numeric alpha on exact generated-column selectors.

Source

pub fn point_alpha_columns_map_from_data<I, S, B>( self, source: impl ArraySource, column_key: impl SourceRowsInput, other_keys: I, input: impl NumericInput, mapper: impl FnOnce(NumericValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map numeric generated-column alpha in an independent source.

Source

pub fn point_alpha_columns_map_categories<I, S, B>( self, column_key: impl SourceRowsInput, other_keys: I, input: impl CategoryInput, mapper: impl FnOnce(CategoryValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map categorical alpha on exact generated-column selectors.

Source

pub fn point_alpha_columns_map_categories_from_data<I, S, B>( self, source: impl ArraySource, column_key: impl SourceRowsInput, other_keys: I, input: impl CategoryInput, mapper: impl FnOnce(CategoryValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map categorical generated-column alpha in an independent source.

Source§

impl<K: LineAlpha> PlotAdapter<'_, K>

Source

pub fn line_alpha(self, input: impl AlphaInput) -> Result<Self, AdapterError>

Bind observation coefficients or pass through a native encoding without reinterpretation.

Source

pub fn line_alpha_cells( self, input: impl AlphaInput, ) -> Result<Self, AdapterError>

Bind already-expanded coefficients without repeating source rows.

Source

pub fn line_alpha_linear( self, input: impl NumericInput, domain: (f64, f64), range: (f64, f64), ) -> Result<Self, AdapterError>

Materialize the native linear declaration on the bound numeric variable.

Source

pub fn line_alpha_map( self, input: impl NumericInput, mapper: impl FnOnce(NumericValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>

Map numeric row values once, preserving the native declaration through expansion.

Source

pub fn line_alpha_map_categories( self, input: impl CategoryInput, mapper: impl FnOnce(CategoryValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>

Map categorical row values once before expansion.

Source

pub fn line_alpha_cells_map( self, input: impl NumericInput, mapper: impl FnOnce(NumericValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>

Map explicitly expanded numeric slots without row repetition.

Source

pub fn line_alpha_cells_map_categories( self, input: impl CategoryInput, mapper: impl FnOnce(CategoryValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>

Map explicitly expanded categorical slots without row repetition.

Source

pub fn line_alpha_single( self, input: impl AlphaValuesInput, ) -> Result<Self, AdapterError>

Explicitly broadcast exactly one bound alpha value.

Source

pub fn line_alpha_single_map( self, input: impl NumericInput, mapper: impl FnOnce(NumericValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>

Map exactly one numeric member and explicitly broadcast its declaration.

Source

pub fn line_alpha_single_map_categories( self, input: impl CategoryInput, mapper: impl FnOnce(CategoryValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>

Map exactly one categorical member and explicitly broadcast its declaration.

Source

pub fn line_alpha_keyed<I, S, B>( self, keys: I, input: impl AlphaValuesInput, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Bind exact series/aggregate keys; observations are never implicitly reduced.

Source

pub fn line_alpha_keyed_from_data<I, S, B>( self, source: impl ArraySource, keys: I, input: impl AlphaValuesInput, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Bind an independent selector source eagerly, retaining no borrow of it.

Source

pub fn line_alpha_keyed_map<I, S, B>( self, keys: I, input: impl NumericInput, mapper: impl FnOnce(NumericValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map numeric alpha for exact actual series/aggregate selectors.

Source

pub fn line_alpha_keyed_map_from_data<I, S, B>( self, source: impl ArraySource, keys: I, input: impl NumericInput, mapper: impl FnOnce(NumericValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map numeric alpha in an independent selector source.

Source

pub fn line_alpha_keyed_map_categories<I, S, B>( self, keys: I, input: impl CategoryInput, mapper: impl FnOnce(CategoryValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map categorical alpha for exact series/aggregate selectors.

Source

pub fn line_alpha_keyed_map_categories_from_data<I, S, B>( self, source: impl ArraySource, keys: I, input: impl CategoryInput, mapper: impl FnOnce(CategoryValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map categorical alpha in an independent selector source.

Source

pub fn line_alpha_columns<I, S, B>( self, column_key: impl SourceRowsInput, other_keys: I, values: impl AlphaValuesInput, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Key alpha by logical source-column indices, not display labels or private field strings.

Source

pub fn line_alpha_columns_from_data<I, S, B>( self, source: impl ArraySource, column_key: impl SourceRowsInput, other_keys: I, values: impl AlphaValuesInput, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Bind generated-column alpha from an independent selector source.

Source

pub fn line_alpha_columns_map<I, S, B>( self, column_key: impl SourceRowsInput, other_keys: I, input: impl NumericInput, mapper: impl FnOnce(NumericValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map numeric alpha on exact generated-column selectors.

Source

pub fn line_alpha_columns_map_from_data<I, S, B>( self, source: impl ArraySource, column_key: impl SourceRowsInput, other_keys: I, input: impl NumericInput, mapper: impl FnOnce(NumericValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map numeric generated-column alpha in an independent source.

Source

pub fn line_alpha_columns_map_categories<I, S, B>( self, column_key: impl SourceRowsInput, other_keys: I, input: impl CategoryInput, mapper: impl FnOnce(CategoryValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map categorical alpha on exact generated-column selectors.

Source

pub fn line_alpha_columns_map_categories_from_data<I, S, B>( self, source: impl ArraySource, column_key: impl SourceRowsInput, other_keys: I, input: impl CategoryInput, mapper: impl FnOnce(CategoryValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map categorical generated-column alpha in an independent source.

Source§

impl<K: FillAlpha> PlotAdapter<'_, K>

Source

pub fn fill_alpha(self, input: impl AlphaInput) -> Result<Self, AdapterError>

Bind observation coefficients or pass through a native encoding without reinterpretation.

Source

pub fn fill_alpha_cells( self, input: impl AlphaInput, ) -> Result<Self, AdapterError>

Bind already-expanded coefficients without repeating source rows.

Source

pub fn fill_alpha_linear( self, input: impl NumericInput, domain: (f64, f64), range: (f64, f64), ) -> Result<Self, AdapterError>

Materialize the native linear declaration on the bound numeric variable.

Source

pub fn fill_alpha_map( self, input: impl NumericInput, mapper: impl FnOnce(NumericValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>

Map numeric row values once, preserving the native declaration through expansion.

Source

pub fn fill_alpha_map_categories( self, input: impl CategoryInput, mapper: impl FnOnce(CategoryValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>

Map categorical row values once before expansion.

Source

pub fn fill_alpha_cells_map( self, input: impl NumericInput, mapper: impl FnOnce(NumericValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>

Map explicitly expanded numeric slots without row repetition.

Source

pub fn fill_alpha_cells_map_categories( self, input: impl CategoryInput, mapper: impl FnOnce(CategoryValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>

Map explicitly expanded categorical slots without row repetition.

Source

pub fn fill_alpha_single( self, input: impl AlphaValuesInput, ) -> Result<Self, AdapterError>

Explicitly broadcast exactly one bound alpha value.

Source

pub fn fill_alpha_single_map( self, input: impl NumericInput, mapper: impl FnOnce(NumericValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>

Map exactly one numeric member and explicitly broadcast its declaration.

Source

pub fn fill_alpha_single_map_categories( self, input: impl CategoryInput, mapper: impl FnOnce(CategoryValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>

Map exactly one categorical member and explicitly broadcast its declaration.

Source

pub fn fill_alpha_keyed<I, S, B>( self, keys: I, input: impl AlphaValuesInput, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Bind exact series/aggregate keys; observations are never implicitly reduced.

Source

pub fn fill_alpha_keyed_from_data<I, S, B>( self, source: impl ArraySource, keys: I, input: impl AlphaValuesInput, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Bind an independent selector source eagerly, retaining no borrow of it.

Source

pub fn fill_alpha_keyed_map<I, S, B>( self, keys: I, input: impl NumericInput, mapper: impl FnOnce(NumericValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map numeric alpha for exact actual series/aggregate selectors.

Source

pub fn fill_alpha_keyed_map_from_data<I, S, B>( self, source: impl ArraySource, keys: I, input: impl NumericInput, mapper: impl FnOnce(NumericValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map numeric alpha in an independent selector source.

Source

pub fn fill_alpha_keyed_map_categories<I, S, B>( self, keys: I, input: impl CategoryInput, mapper: impl FnOnce(CategoryValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map categorical alpha for exact series/aggregate selectors.

Source

pub fn fill_alpha_keyed_map_categories_from_data<I, S, B>( self, source: impl ArraySource, keys: I, input: impl CategoryInput, mapper: impl FnOnce(CategoryValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map categorical alpha in an independent selector source.

Source

pub fn fill_alpha_columns<I, S, B>( self, column_key: impl SourceRowsInput, other_keys: I, values: impl AlphaValuesInput, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Key alpha by logical source-column indices, not display labels or private field strings.

Source

pub fn fill_alpha_columns_from_data<I, S, B>( self, source: impl ArraySource, column_key: impl SourceRowsInput, other_keys: I, values: impl AlphaValuesInput, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Bind generated-column alpha from an independent selector source.

Source

pub fn fill_alpha_columns_map<I, S, B>( self, column_key: impl SourceRowsInput, other_keys: I, input: impl NumericInput, mapper: impl FnOnce(NumericValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map numeric alpha on exact generated-column selectors.

Source

pub fn fill_alpha_columns_map_from_data<I, S, B>( self, source: impl ArraySource, column_key: impl SourceRowsInput, other_keys: I, input: impl NumericInput, mapper: impl FnOnce(NumericValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map numeric generated-column alpha in an independent source.

Source

pub fn fill_alpha_columns_map_categories<I, S, B>( self, column_key: impl SourceRowsInput, other_keys: I, input: impl CategoryInput, mapper: impl FnOnce(CategoryValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map categorical alpha on exact generated-column selectors.

Source

pub fn fill_alpha_columns_map_categories_from_data<I, S, B>( self, source: impl ArraySource, column_key: impl SourceRowsInput, other_keys: I, input: impl CategoryInput, mapper: impl FnOnce(CategoryValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map categorical generated-column alpha in an independent source.

Source§

impl PlotAdapter<'_, Histogram>

Source

pub fn fill_alpha_bins<I, S, B>( self, lower: impl NumericInput, upper: impl NumericInput, facets: I, values: impl AlphaValuesInput, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Bind exact histogram bin intervals and optional facet keys, without sample reduction.

Source

pub fn fill_alpha_bins_from_data<I, S, B>( self, source: impl ArraySource, lower: impl NumericInput, upper: impl NumericInput, facets: I, values: impl AlphaValuesInput, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Bind explicit bin alpha in an independent result source, retaining no borrow.

Source§

impl PlotAdapter<'_, Histogram>

Source

pub fn fill_alpha_bins_map<I, S, B>( self, lower: impl NumericInput, upper: impl NumericInput, facets: I, input: impl NumericInput, mapper: impl FnOnce(NumericValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map alpha for explicit native bin intervals, never sample rows.

Source

pub fn fill_alpha_bins_map_from_data<I, S, B>( self, source: impl ArraySource, lower: impl NumericInput, upper: impl NumericInput, facets: I, input: impl NumericInput, mapper: impl FnOnce(NumericValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Materialize an explicit bin mapping in an independent result source.

Source§

impl PlotAdapter<'_, Histogram>

Source

pub fn fill_alpha_bins_map_categories<I, S, B>( self, lower: impl NumericInput, upper: impl NumericInput, facets: I, input: impl CategoryInput, mapper: impl FnOnce(CategoryValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Map alpha for explicit native bin intervals, never sample rows.

Source

pub fn fill_alpha_bins_map_categories_from_data<I, S, B>( self, source: impl ArraySource, lower: impl NumericInput, upper: impl NumericInput, facets: I, input: impl CategoryInput, mapper: impl FnOnce(CategoryValues) -> Result<AlphaValues>, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, B)>, S: AsRef<str>, B: CategoryInput,

Materialize an explicit bin mapping in an independent result source.

Source§

impl<'source> PlotAdapter<'source, Regression>

Source

pub fn new( x: impl NumericInput, y: impl NumericInput, ) -> Result<Self, AdapterError>

Bind direct inputs for native Regression new mode.

Source

pub fn from_data( source: impl ArraySource + 'source, x: impl NumericInput, y: impl NumericInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native Regression new mode.

Source§

impl<'source> PlotAdapter<'source, Marginal>

Source

pub fn new( x: impl NumericInput, y: impl NumericInput, ) -> Result<Self, AdapterError>

Bind direct inputs for native Marginal new mode.

Source

pub fn from_data( source: impl ArraySource + 'source, x: impl NumericInput, y: impl NumericInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native Marginal new mode.

Source§

impl<'source> PlotAdapter<'source, Histogram>

Source

pub fn new(samples: impl NumericInput) -> Result<Self, AdapterError>

Bind direct inputs for native Histogram new mode.

Source

pub fn from_data( source: impl ArraySource + 'source, samples: impl NumericInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native Histogram new mode.

Source§

impl<'source> PlotAdapter<'source, Density>

Source

pub fn new(value: impl NumericInput) -> Result<Self, AdapterError>

Bind direct inputs for native Density new mode.

Source

pub fn from_data( source: impl ArraySource + 'source, value: impl NumericInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native Density new mode.

Source§

impl<'source> PlotAdapter<'source, Qq>

Source

pub fn new(value: impl NumericInput) -> Result<Self, AdapterError>

Bind direct inputs for native Qq new mode.

Source

pub fn from_data( source: impl ArraySource + 'source, value: impl NumericInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native Qq new mode.

Source§

impl<'source> PlotAdapter<'source, PointInterval>

Source

pub fn new( category: impl CategoryInput, estimate: impl NumericInput, lower: impl NumericInput, upper: impl NumericInput, ) -> Result<Self, AdapterError>

Bind direct inputs for native PointInterval new mode.

Source

pub fn from_data( source: impl ArraySource + 'source, category: impl CategoryInput, estimate: impl NumericInput, lower: impl NumericInput, upper: impl NumericInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native PointInterval new mode.

Source§

impl<'source> PlotAdapter<'source, Trajectory>

Source

pub fn new( x: impl AxisInput, y: impl NumericInput, group: impl CategoryInput, ) -> Result<Self, AdapterError>

Bind direct inputs for native Trajectory new mode.

Source

pub fn from_data( source: impl ArraySource + 'source, x: impl AxisInput, y: impl NumericInput, group: impl CategoryInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native Trajectory new mode.

Source§

impl<'source> PlotAdapter<'source, Trajectory>

Source

pub fn new_numeric_x( x: impl NumericInput, y: impl NumericInput, group: impl CategoryInput, ) -> Result<Self, AdapterError>

Bind direct inputs for native Trajectory new_numeric_x mode.

Source

pub fn from_data_numeric_x( source: impl ArraySource + 'source, x: impl NumericInput, y: impl NumericInput, group: impl CategoryInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native Trajectory new_numeric_x mode.

Source§

impl<'source> PlotAdapter<'source, Trajectory>

Source

pub fn new_categorical_x( x: impl CategoryInput, y: impl NumericInput, group: impl CategoryInput, ) -> Result<Self, AdapterError>

Bind direct inputs for native Trajectory new_categorical_x mode.

Source

pub fn from_data_categorical_x( source: impl ArraySource + 'source, x: impl CategoryInput, y: impl NumericInput, group: impl CategoryInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native Trajectory new_categorical_x mode.

Source§

impl<'source> PlotAdapter<'source, LinePath>

Source

pub fn new( x: impl NumericInput, y: impl NumericInput, ) -> Result<Self, AdapterError>

Bind direct inputs for native LinePath new mode.

Source

pub fn from_data( source: impl ArraySource + 'source, x: impl NumericInput, y: impl NumericInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native LinePath new mode.

Source§

impl<'source> PlotAdapter<'source, LinePath>

Source

pub fn grouped( x: impl NumericInput, y: impl NumericInput, group: impl CategoryInput, ) -> Result<Self, AdapterError>

Bind direct inputs for native LinePath grouped mode.

Source

pub fn grouped_from_data( source: impl ArraySource + 'source, x: impl NumericInput, y: impl NumericInput, group: impl CategoryInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native LinePath grouped mode.

Source§

impl<'source> PlotAdapter<'source, Interaction>

Source

pub fn new( condition: impl CategoryInput, estimate: impl NumericInput, group: impl CategoryInput, lower: impl NumericInput, upper: impl NumericInput, ) -> Result<Self, AdapterError>

Bind direct inputs for native Interaction new mode.

Source

pub fn from_data( source: impl ArraySource + 'source, condition: impl CategoryInput, estimate: impl NumericInput, group: impl CategoryInput, lower: impl NumericInput, upper: impl NumericInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native Interaction new mode.

Source§

impl<'source> PlotAdapter<'source, Coefficient>

Source

pub fn new( term: impl CategoryInput, estimate: impl NumericInput, ) -> Result<Self, AdapterError>

Bind direct inputs for native Coefficient new mode.

Source

pub fn from_data( source: impl ArraySource + 'source, term: impl CategoryInput, estimate: impl NumericInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native Coefficient new mode.

Source§

impl<'source> PlotAdapter<'source, Coefficient>

Source

pub fn with_intervals( term: impl CategoryInput, estimate: impl NumericInput, lower: impl NumericInput, upper: impl NumericInput, ) -> Result<Self, AdapterError>

Bind direct inputs for native Coefficient with_intervals mode.

Source

pub fn with_intervals_from_data( source: impl ArraySource + 'source, term: impl CategoryInput, estimate: impl NumericInput, lower: impl NumericInput, upper: impl NumericInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native Coefficient with_intervals mode.

Source§

impl<'source> PlotAdapter<'source, Forest>

Source

pub fn new( term: impl CategoryInput, estimate: impl NumericInput, lower: impl NumericInput, upper: impl NumericInput, reference: f64, ) -> Result<Self, AdapterError>

Bind direct inputs for native Forest new mode.

Source

pub fn from_data( source: impl ArraySource + 'source, term: impl CategoryInput, estimate: impl NumericInput, lower: impl NumericInput, upper: impl NumericInput, reference: f64, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native Forest new mode.

Source§

impl<'source> PlotAdapter<'source, Dumbbell>

Source

pub fn new( category: impl CategoryInput, left: impl NumericInput, right: impl NumericInput, endpoints: DumbbellEndpoints, ) -> Result<Self, AdapterError>

Bind direct inputs for native Dumbbell new mode.

Source

pub fn from_data( source: impl ArraySource + 'source, category: impl CategoryInput, left: impl NumericInput, right: impl NumericInput, endpoints: DumbbellEndpoints, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native Dumbbell new mode.

Source§

impl<'source> PlotAdapter<'source, Heatmap>

Source

pub fn records( x: impl CategoryInput, y: impl CategoryInput, fill: impl NumericInput, ) -> Result<Self, AdapterError>

Bind direct inputs for native Heatmap records mode.

Source

pub fn records_from_data( source: impl ArraySource + 'source, x: impl CategoryInput, y: impl CategoryInput, fill: impl NumericInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native Heatmap records mode.

Source§

impl<'source> PlotAdapter<'source, StackedBar>

Source

pub fn new( category: impl CategoryInput, value: impl NumericInput, series: impl CategoryInput, ) -> Result<Self, AdapterError>

Bind direct inputs for native StackedBar new mode.

Source

pub fn from_data( source: impl ArraySource + 'source, category: impl CategoryInput, value: impl NumericInput, series: impl CategoryInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native StackedBar new mode.

Source§

impl<'source> PlotAdapter<'source, StackedHorizontalBar>

Source

pub fn new( category: impl CategoryInput, value: impl NumericInput, series: impl CategoryInput, ) -> Result<Self, AdapterError>

Bind direct inputs for native StackedHorizontalBar new mode.

Source

pub fn from_data( source: impl ArraySource + 'source, category: impl CategoryInput, value: impl NumericInput, series: impl CategoryInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native StackedHorizontalBar new mode.

Source§

impl<'source> PlotAdapter<'source, Beeswarm>

Source

pub fn new( category: impl CategoryInput, value: impl NumericInput, ) -> Result<Self, AdapterError>

Bind direct inputs for native Beeswarm new mode.

Source

pub fn from_data( source: impl ArraySource + 'source, category: impl CategoryInput, value: impl NumericInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native Beeswarm new mode.

Source§

impl<'source> PlotAdapter<'source, Beeswarm>

Source

pub fn colored( category: impl CategoryInput, value: impl NumericInput, color: impl ColorSourceInput, ) -> Result<Self, AdapterError>

Bind direct observations with a fixed or continuously mapped color.

Source

pub fn colored_from_data( source: impl ArraySource + 'source, category: impl CategoryInput, value: impl NumericInput, color: impl ColorSourceInput, ) -> Result<Self, AdapterError>

Bind source columns or direct values with a fixed or mapped color.

Source§

impl<'source> PlotAdapter<'source, Waterfall>

Source

pub fn new( category: impl CategoryInput, delta: impl NumericInput, base: f64, ) -> Result<Self, AdapterError>

Bind direct inputs for native Waterfall new mode.

Source

pub fn from_data( source: impl ArraySource + 'source, category: impl CategoryInput, delta: impl NumericInput, base: f64, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native Waterfall new mode.

Source§

impl<'source> PlotAdapter<'source, Bar>

Source

pub fn new( category: impl CategoryInput, samples: impl NumericInput, ) -> Result<Self, AdapterError>

Bind direct inputs for native Bar new mode.

Source

pub fn from_data( source: impl ArraySource + 'source, category: impl CategoryInput, samples: impl NumericInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native Bar new mode.

Source§

impl<'source> PlotAdapter<'source, Bar>

Source

pub fn with_error_bar( category: impl CategoryInput, samples: impl NumericInput, policy: impl Into<ErrorBar>, ) -> Result<Self, AdapterError>

Bind direct inputs for native Bar with_error_bar mode.

Source

pub fn with_error_bar_from_data( source: impl ArraySource + 'source, category: impl CategoryInput, samples: impl NumericInput, policy: impl Into<ErrorBar>, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native Bar with_error_bar mode.

Source§

impl<'source> PlotAdapter<'source, Bar>

Source

pub fn estimates( category: impl CategoryInput, estimate: impl NumericInput, ) -> Result<Self, AdapterError>

Bind direct inputs for native Bar estimates mode.

Source

pub fn estimates_from_data( source: impl ArraySource + 'source, category: impl CategoryInput, estimate: impl NumericInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native Bar estimates mode.

Source§

impl<'source> PlotAdapter<'source, Bar>

Source

pub fn estimates_with_error_bars( category: impl CategoryInput, estimate: impl NumericInput, lower: impl NumericInput, upper: impl NumericInput, ) -> Result<Self, AdapterError>

Bind direct inputs for native Bar estimates_with_error_bars mode.

Source

pub fn estimates_with_error_bars_from_data( source: impl ArraySource + 'source, category: impl CategoryInput, estimate: impl NumericInput, lower: impl NumericInput, upper: impl NumericInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native Bar estimates_with_error_bars mode.

Source§

impl<'source> PlotAdapter<'source, HorizontalBar>

Source

pub fn new( category: impl CategoryInput, samples: impl NumericInput, ) -> Result<Self, AdapterError>

Bind direct inputs for native HorizontalBar new mode.

Source

pub fn from_data( source: impl ArraySource + 'source, category: impl CategoryInput, samples: impl NumericInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native HorizontalBar new mode.

Source§

impl<'source> PlotAdapter<'source, HorizontalBar>

Source

pub fn with_error_bar( category: impl CategoryInput, samples: impl NumericInput, policy: impl Into<ErrorBar>, ) -> Result<Self, AdapterError>

Bind direct inputs for native HorizontalBar with_error_bar mode.

Source

pub fn with_error_bar_from_data( source: impl ArraySource + 'source, category: impl CategoryInput, samples: impl NumericInput, policy: impl Into<ErrorBar>, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native HorizontalBar with_error_bar mode.

Source§

impl<'source> PlotAdapter<'source, HorizontalBar>

Source

pub fn estimates( category: impl CategoryInput, estimate: impl NumericInput, ) -> Result<Self, AdapterError>

Bind direct inputs for native HorizontalBar estimates mode.

Source

pub fn estimates_from_data( source: impl ArraySource + 'source, category: impl CategoryInput, estimate: impl NumericInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native HorizontalBar estimates mode.

Source§

impl<'source> PlotAdapter<'source, HorizontalBar>

Source

pub fn estimates_with_error_bars( category: impl CategoryInput, estimate: impl NumericInput, lower: impl NumericInput, upper: impl NumericInput, ) -> Result<Self, AdapterError>

Bind direct inputs for native HorizontalBar estimates_with_error_bars mode.

Source

pub fn estimates_with_error_bars_from_data( source: impl ArraySource + 'source, category: impl CategoryInput, estimate: impl NumericInput, lower: impl NumericInput, upper: impl NumericInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct inputs for native HorizontalBar estimates_with_error_bars mode.

Source§

impl PlotAdapter<'_, Line>

Source

pub fn band( self, lower: impl NumericSeriesInput, upper: impl NumericSeriesInput, ) -> Result<Self, AdapterError>

Bind bounds with exactly the line’s single-variable or selected-column shape.

Source§

impl<'source> PlotAdapter<'source, Matrix>

Source

pub fn new(variables: impl ColumnsInput) -> Result<Self, AdapterError>

Use direct matrix columns as variables and rows as observations.

Source

pub fn from_data( source: impl ArraySource + 'source, columns: impl ColumnsInput, ) -> Result<Self, AdapterError>

Select ordered logical columns, or .. for every column.

Source

pub fn numeric_from_data( source: impl ArraySource + 'source, ) -> Result<Self, AdapterError>

Explicit numeric discovery on a homogeneous source uses all columns.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn title(self, text: impl Into<Text>) -> Self

Forward native crate::Plot::title configuration.

Examples found in repository?
examples/strided_heatmap.rs (line 73)
11fn main() -> Result<(), Box<dyn std::error::Error>> {
12    let mut arguments = std::env::args_os().skip(1);
13    let directory = match arguments.next() {
14        Some(path) if !path.is_empty() => std::path::PathBuf::from(path),
15        Some(_) => return Err("output directory must not be empty".into()),
16        None => std::env::current_dir()?,
17    };
18    if arguments.next().is_some() {
19        return Err("usage: strided_heatmap [output-directory]".into());
20    }
21    std::fs::create_dir_all(&directory)?;
22    // ANCHOR: strided-values
23    // Interleaved quality-control columns are deliberately excluded by the view.
24    let measurements = array![
25        [0.2, 99.0, 0.8, 99.0, 1.4, 99.0, 1.7, 99.0],
26        [0.1, 99.0, 0.6, 99.0, 1.1, 99.0, 1.3, 99.0],
27        [-0.1, 99.0, -0.5, 99.0, -0.9, 99.0, -1.4, 99.0],
28        [0.0, 99.0, 0.3, 99.0, 0.9, 99.0, 1.2, 99.0],
29    ];
30    let times = ["0 h", "2 h", "6 h", "12 h"];
31    let programs = [
32        "Inflammation",
33        "Stress response",
34        "Cell cycle",
35        "DNA repair",
36    ];
37    let present = array![
38        [true, true, true, true],
39        [true, true, true, true],
40        [true, false, true, true],
41        [true, true, true, true],
42    ];
43    let highlights = array![
44        [false, false, false, true],
45        [false, false, false, false],
46        [false, false, false, true],
47        [false, false, false, false],
48    ];
49    let cell_ids = array![
50        [101u64, 102, 103, 104],
51        [105, 106, 107, 108],
52        [109, 110, 111, 112],
53        [113, 114, 115, 116]
54    ];
55    let heatmap = nd::Heatmap::new((measurements.slice(s![.., ..;2]), present.view()))?
56        .highlight_cells(highlights.view())?
57        .source_rows(cell_ids.view())?;
58    // ANCHOR_END: strided-values
59    // ANCHOR: strided-plot
60    heatmap
61        .labels(Labels::raw())
62        .x_labels(times)?
63        .y_labels(programs)?
64        .x_label("Time after stimulus")
65        .y_label("Response program")
66        .color_label("Response (log2 fold change)")
67        .continuous_color_scale(ContinuousColorScale::diverging(
68            0.0,
69            None,
70            Some(ColorDomain::exact(-2.0, 2.0)?),
71        )?)
72        .size(780, 480)
73        .title("Response programs from a strided assay matrix")
74        .caption("Synthetic illustration · alternate source columns · one missing cell · no inferred clustering")
75        .svg(directory.join("strided_heatmap.svg"))?
76        .svg_preserve_text(directory.join("strided_heatmap_text.svg"))?;
77    // ANCHOR_END: strided-plot
78    Ok(())
79}
Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn subtitle(self, text: impl Into<Text>) -> Self

Forward native crate::Plot::subtitle configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn caption(self, text: impl Into<Text>) -> Self

Forward native crate::Plot::caption configuration.

Examples found in repository?
examples/strided_heatmap.rs (line 74)
11fn main() -> Result<(), Box<dyn std::error::Error>> {
12    let mut arguments = std::env::args_os().skip(1);
13    let directory = match arguments.next() {
14        Some(path) if !path.is_empty() => std::path::PathBuf::from(path),
15        Some(_) => return Err("output directory must not be empty".into()),
16        None => std::env::current_dir()?,
17    };
18    if arguments.next().is_some() {
19        return Err("usage: strided_heatmap [output-directory]".into());
20    }
21    std::fs::create_dir_all(&directory)?;
22    // ANCHOR: strided-values
23    // Interleaved quality-control columns are deliberately excluded by the view.
24    let measurements = array![
25        [0.2, 99.0, 0.8, 99.0, 1.4, 99.0, 1.7, 99.0],
26        [0.1, 99.0, 0.6, 99.0, 1.1, 99.0, 1.3, 99.0],
27        [-0.1, 99.0, -0.5, 99.0, -0.9, 99.0, -1.4, 99.0],
28        [0.0, 99.0, 0.3, 99.0, 0.9, 99.0, 1.2, 99.0],
29    ];
30    let times = ["0 h", "2 h", "6 h", "12 h"];
31    let programs = [
32        "Inflammation",
33        "Stress response",
34        "Cell cycle",
35        "DNA repair",
36    ];
37    let present = array![
38        [true, true, true, true],
39        [true, true, true, true],
40        [true, false, true, true],
41        [true, true, true, true],
42    ];
43    let highlights = array![
44        [false, false, false, true],
45        [false, false, false, false],
46        [false, false, false, true],
47        [false, false, false, false],
48    ];
49    let cell_ids = array![
50        [101u64, 102, 103, 104],
51        [105, 106, 107, 108],
52        [109, 110, 111, 112],
53        [113, 114, 115, 116]
54    ];
55    let heatmap = nd::Heatmap::new((measurements.slice(s![.., ..;2]), present.view()))?
56        .highlight_cells(highlights.view())?
57        .source_rows(cell_ids.view())?;
58    // ANCHOR_END: strided-values
59    // ANCHOR: strided-plot
60    heatmap
61        .labels(Labels::raw())
62        .x_labels(times)?
63        .y_labels(programs)?
64        .x_label("Time after stimulus")
65        .y_label("Response program")
66        .color_label("Response (log2 fold change)")
67        .continuous_color_scale(ContinuousColorScale::diverging(
68            0.0,
69            None,
70            Some(ColorDomain::exact(-2.0, 2.0)?),
71        )?)
72        .size(780, 480)
73        .title("Response programs from a strided assay matrix")
74        .caption("Synthetic illustration · alternate source columns · one missing cell · no inferred clustering")
75        .svg(directory.join("strided_heatmap.svg"))?
76        .svg_preserve_text(directory.join("strided_heatmap_text.svg"))?;
77    // ANCHOR_END: strided-plot
78    Ok(())
79}
Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn x_label(self, text: impl Into<Text>) -> Self

Forward native crate::Plot::x_label configuration.

Examples found in repository?
examples/strided_heatmap.rs (line 64)
11fn main() -> Result<(), Box<dyn std::error::Error>> {
12    let mut arguments = std::env::args_os().skip(1);
13    let directory = match arguments.next() {
14        Some(path) if !path.is_empty() => std::path::PathBuf::from(path),
15        Some(_) => return Err("output directory must not be empty".into()),
16        None => std::env::current_dir()?,
17    };
18    if arguments.next().is_some() {
19        return Err("usage: strided_heatmap [output-directory]".into());
20    }
21    std::fs::create_dir_all(&directory)?;
22    // ANCHOR: strided-values
23    // Interleaved quality-control columns are deliberately excluded by the view.
24    let measurements = array![
25        [0.2, 99.0, 0.8, 99.0, 1.4, 99.0, 1.7, 99.0],
26        [0.1, 99.0, 0.6, 99.0, 1.1, 99.0, 1.3, 99.0],
27        [-0.1, 99.0, -0.5, 99.0, -0.9, 99.0, -1.4, 99.0],
28        [0.0, 99.0, 0.3, 99.0, 0.9, 99.0, 1.2, 99.0],
29    ];
30    let times = ["0 h", "2 h", "6 h", "12 h"];
31    let programs = [
32        "Inflammation",
33        "Stress response",
34        "Cell cycle",
35        "DNA repair",
36    ];
37    let present = array![
38        [true, true, true, true],
39        [true, true, true, true],
40        [true, false, true, true],
41        [true, true, true, true],
42    ];
43    let highlights = array![
44        [false, false, false, true],
45        [false, false, false, false],
46        [false, false, false, true],
47        [false, false, false, false],
48    ];
49    let cell_ids = array![
50        [101u64, 102, 103, 104],
51        [105, 106, 107, 108],
52        [109, 110, 111, 112],
53        [113, 114, 115, 116]
54    ];
55    let heatmap = nd::Heatmap::new((measurements.slice(s![.., ..;2]), present.view()))?
56        .highlight_cells(highlights.view())?
57        .source_rows(cell_ids.view())?;
58    // ANCHOR_END: strided-values
59    // ANCHOR: strided-plot
60    heatmap
61        .labels(Labels::raw())
62        .x_labels(times)?
63        .y_labels(programs)?
64        .x_label("Time after stimulus")
65        .y_label("Response program")
66        .color_label("Response (log2 fold change)")
67        .continuous_color_scale(ContinuousColorScale::diverging(
68            0.0,
69            None,
70            Some(ColorDomain::exact(-2.0, 2.0)?),
71        )?)
72        .size(780, 480)
73        .title("Response programs from a strided assay matrix")
74        .caption("Synthetic illustration · alternate source columns · one missing cell · no inferred clustering")
75        .svg(directory.join("strided_heatmap.svg"))?
76        .svg_preserve_text(directory.join("strided_heatmap_text.svg"))?;
77    // ANCHOR_END: strided-plot
78    Ok(())
79}
Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn y_label(self, text: impl Into<Text>) -> Self

Forward native crate::Plot::y_label configuration.

Examples found in repository?
examples/strided_heatmap.rs (line 65)
11fn main() -> Result<(), Box<dyn std::error::Error>> {
12    let mut arguments = std::env::args_os().skip(1);
13    let directory = match arguments.next() {
14        Some(path) if !path.is_empty() => std::path::PathBuf::from(path),
15        Some(_) => return Err("output directory must not be empty".into()),
16        None => std::env::current_dir()?,
17    };
18    if arguments.next().is_some() {
19        return Err("usage: strided_heatmap [output-directory]".into());
20    }
21    std::fs::create_dir_all(&directory)?;
22    // ANCHOR: strided-values
23    // Interleaved quality-control columns are deliberately excluded by the view.
24    let measurements = array![
25        [0.2, 99.0, 0.8, 99.0, 1.4, 99.0, 1.7, 99.0],
26        [0.1, 99.0, 0.6, 99.0, 1.1, 99.0, 1.3, 99.0],
27        [-0.1, 99.0, -0.5, 99.0, -0.9, 99.0, -1.4, 99.0],
28        [0.0, 99.0, 0.3, 99.0, 0.9, 99.0, 1.2, 99.0],
29    ];
30    let times = ["0 h", "2 h", "6 h", "12 h"];
31    let programs = [
32        "Inflammation",
33        "Stress response",
34        "Cell cycle",
35        "DNA repair",
36    ];
37    let present = array![
38        [true, true, true, true],
39        [true, true, true, true],
40        [true, false, true, true],
41        [true, true, true, true],
42    ];
43    let highlights = array![
44        [false, false, false, true],
45        [false, false, false, false],
46        [false, false, false, true],
47        [false, false, false, false],
48    ];
49    let cell_ids = array![
50        [101u64, 102, 103, 104],
51        [105, 106, 107, 108],
52        [109, 110, 111, 112],
53        [113, 114, 115, 116]
54    ];
55    let heatmap = nd::Heatmap::new((measurements.slice(s![.., ..;2]), present.view()))?
56        .highlight_cells(highlights.view())?
57        .source_rows(cell_ids.view())?;
58    // ANCHOR_END: strided-values
59    // ANCHOR: strided-plot
60    heatmap
61        .labels(Labels::raw())
62        .x_labels(times)?
63        .y_labels(programs)?
64        .x_label("Time after stimulus")
65        .y_label("Response program")
66        .color_label("Response (log2 fold change)")
67        .continuous_color_scale(ContinuousColorScale::diverging(
68            0.0,
69            None,
70            Some(ColorDomain::exact(-2.0, 2.0)?),
71        )?)
72        .size(780, 480)
73        .title("Response programs from a strided assay matrix")
74        .caption("Synthetic illustration · alternate source columns · one missing cell · no inferred clustering")
75        .svg(directory.join("strided_heatmap.svg"))?
76        .svg_preserve_text(directory.join("strided_heatmap_text.svg"))?;
77    // ANCHOR_END: strided-plot
78    Ok(())
79}
Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn clear_title_style(self) -> Self

Forward native crate::Plot::clear_title_style configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn clear_title_layout(self) -> Self

Forward native crate::Plot::clear_title_layout configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn clear_subtitle_style(self) -> Self

Forward native crate::Plot::clear_subtitle_style configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn clear_subtitle_layout(self) -> Self

Forward native crate::Plot::clear_subtitle_layout configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn clear_caption_style(self) -> Self

Forward native crate::Plot::clear_caption_style configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn clear_caption_layout(self) -> Self

Forward native crate::Plot::clear_caption_layout configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn clear_x_label_style(self) -> Self

Forward native crate::Plot::clear_x_label_style configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn clear_x_label_layout(self) -> Self

Forward native crate::Plot::clear_x_label_layout configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn clear_y_label_style(self) -> Self

Forward native crate::Plot::clear_y_label_style configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn clear_y_label_layout(self) -> Self

Forward native crate::Plot::clear_y_label_layout configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn clear_color_label_style(self) -> Self
where K: ContinuousColor,

Forward native crate::Plot::clear_color_label_style configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn clear_color_label_layout(self) -> Self
where K: ContinuousColor,

Forward native crate::Plot::clear_color_label_layout configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn title_alignment(self, alignment: TextAlignment) -> Self

Forward native crate::Plot::title_alignment configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn subtitle_alignment(self, alignment: TextAlignment) -> Self

Forward native crate::Plot::subtitle_alignment configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn theme(self, theme: impl Into<Option<Theme>>) -> Self

Forward native crate::Plot::theme configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn default_theme(self, theme: impl Into<Option<Theme>>) -> Self

Forward native crate::Plot::default_theme configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn width(self, width: u32) -> Self

Forward native crate::Plot::width configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn max_width(self, maximum: u32) -> Self

Forward native crate::Plot::max_width configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn size(self, width: u32, height: u32) -> Self

Forward native crate::Plot::size configuration.

Examples found in repository?
examples/strided_heatmap.rs (line 72)
11fn main() -> Result<(), Box<dyn std::error::Error>> {
12    let mut arguments = std::env::args_os().skip(1);
13    let directory = match arguments.next() {
14        Some(path) if !path.is_empty() => std::path::PathBuf::from(path),
15        Some(_) => return Err("output directory must not be empty".into()),
16        None => std::env::current_dir()?,
17    };
18    if arguments.next().is_some() {
19        return Err("usage: strided_heatmap [output-directory]".into());
20    }
21    std::fs::create_dir_all(&directory)?;
22    // ANCHOR: strided-values
23    // Interleaved quality-control columns are deliberately excluded by the view.
24    let measurements = array![
25        [0.2, 99.0, 0.8, 99.0, 1.4, 99.0, 1.7, 99.0],
26        [0.1, 99.0, 0.6, 99.0, 1.1, 99.0, 1.3, 99.0],
27        [-0.1, 99.0, -0.5, 99.0, -0.9, 99.0, -1.4, 99.0],
28        [0.0, 99.0, 0.3, 99.0, 0.9, 99.0, 1.2, 99.0],
29    ];
30    let times = ["0 h", "2 h", "6 h", "12 h"];
31    let programs = [
32        "Inflammation",
33        "Stress response",
34        "Cell cycle",
35        "DNA repair",
36    ];
37    let present = array![
38        [true, true, true, true],
39        [true, true, true, true],
40        [true, false, true, true],
41        [true, true, true, true],
42    ];
43    let highlights = array![
44        [false, false, false, true],
45        [false, false, false, false],
46        [false, false, false, true],
47        [false, false, false, false],
48    ];
49    let cell_ids = array![
50        [101u64, 102, 103, 104],
51        [105, 106, 107, 108],
52        [109, 110, 111, 112],
53        [113, 114, 115, 116]
54    ];
55    let heatmap = nd::Heatmap::new((measurements.slice(s![.., ..;2]), present.view()))?
56        .highlight_cells(highlights.view())?
57        .source_rows(cell_ids.view())?;
58    // ANCHOR_END: strided-values
59    // ANCHOR: strided-plot
60    heatmap
61        .labels(Labels::raw())
62        .x_labels(times)?
63        .y_labels(programs)?
64        .x_label("Time after stimulus")
65        .y_label("Response program")
66        .color_label("Response (log2 fold change)")
67        .continuous_color_scale(ContinuousColorScale::diverging(
68            0.0,
69            None,
70            Some(ColorDomain::exact(-2.0, 2.0)?),
71        )?)
72        .size(780, 480)
73        .title("Response programs from a strided assay matrix")
74        .caption("Synthetic illustration · alternate source columns · one missing cell · no inferred clustering")
75        .svg(directory.join("strided_heatmap.svg"))?
76        .svg_preserve_text(directory.join("strided_heatmap_text.svg"))?;
77    // ANCHOR_END: strided-plot
78    Ok(())
79}
Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn color_label(self, label: impl Into<Text>) -> Self
where K: ContinuousColor,

Forward native crate::Plot::color_label configuration.

Examples found in repository?
examples/strided_heatmap.rs (line 66)
11fn main() -> Result<(), Box<dyn std::error::Error>> {
12    let mut arguments = std::env::args_os().skip(1);
13    let directory = match arguments.next() {
14        Some(path) if !path.is_empty() => std::path::PathBuf::from(path),
15        Some(_) => return Err("output directory must not be empty".into()),
16        None => std::env::current_dir()?,
17    };
18    if arguments.next().is_some() {
19        return Err("usage: strided_heatmap [output-directory]".into());
20    }
21    std::fs::create_dir_all(&directory)?;
22    // ANCHOR: strided-values
23    // Interleaved quality-control columns are deliberately excluded by the view.
24    let measurements = array![
25        [0.2, 99.0, 0.8, 99.0, 1.4, 99.0, 1.7, 99.0],
26        [0.1, 99.0, 0.6, 99.0, 1.1, 99.0, 1.3, 99.0],
27        [-0.1, 99.0, -0.5, 99.0, -0.9, 99.0, -1.4, 99.0],
28        [0.0, 99.0, 0.3, 99.0, 0.9, 99.0, 1.2, 99.0],
29    ];
30    let times = ["0 h", "2 h", "6 h", "12 h"];
31    let programs = [
32        "Inflammation",
33        "Stress response",
34        "Cell cycle",
35        "DNA repair",
36    ];
37    let present = array![
38        [true, true, true, true],
39        [true, true, true, true],
40        [true, false, true, true],
41        [true, true, true, true],
42    ];
43    let highlights = array![
44        [false, false, false, true],
45        [false, false, false, false],
46        [false, false, false, true],
47        [false, false, false, false],
48    ];
49    let cell_ids = array![
50        [101u64, 102, 103, 104],
51        [105, 106, 107, 108],
52        [109, 110, 111, 112],
53        [113, 114, 115, 116]
54    ];
55    let heatmap = nd::Heatmap::new((measurements.slice(s![.., ..;2]), present.view()))?
56        .highlight_cells(highlights.view())?
57        .source_rows(cell_ids.view())?;
58    // ANCHOR_END: strided-values
59    // ANCHOR: strided-plot
60    heatmap
61        .labels(Labels::raw())
62        .x_labels(times)?
63        .y_labels(programs)?
64        .x_label("Time after stimulus")
65        .y_label("Response program")
66        .color_label("Response (log2 fold change)")
67        .continuous_color_scale(ContinuousColorScale::diverging(
68            0.0,
69            None,
70            Some(ColorDomain::exact(-2.0, 2.0)?),
71        )?)
72        .size(780, 480)
73        .title("Response programs from a strided assay matrix")
74        .caption("Synthetic illustration · alternate source columns · one missing cell · no inferred clustering")
75        .svg(directory.join("strided_heatmap.svg"))?
76        .svg_preserve_text(directory.join("strided_heatmap_text.svg"))?;
77    // ANCHOR_END: strided-plot
78    Ok(())
79}
Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn color_label_format(self, format: NumericFormat) -> Self
where K: ContinuousColor,

Forward native crate::Plot::color_label_format configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn heatmap_null_row_annotation( self, annotation: HeatmapNullRowAnnotation, ) -> Self
where K: HeatmapOptions,

Forward native crate::Plot::heatmap_null_row_annotation configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn estimate_labels(self, format: NumericFormat) -> Self

Forward native crate::Plot::estimate_labels configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn significance_mark_style(self, style: SignificanceMarkStyle) -> Self

Forward native crate::Plot::significance_mark_style configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn text_annotation(self, annotation: PlotTextAnnotation) -> Self
where K: TextAnnotation,

Forward native crate::Plot::text_annotation configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn x_category_labels(self, selection: CategoryLabelSelection) -> Self
where K: CategoricalX,

Forward native crate::Plot::x_category_labels configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn y_category_labels(self, selection: CategoryLabelSelection) -> Self
where K: CategoricalY,

Forward native crate::Plot::y_category_labels configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn category_order(self, order: impl Into<CategoryOrder>) -> Self
where K: CategoryOrder,

Forward native crate::Plot::category_order configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn x_category_order(self, order: impl Into<CategoryOrder>) -> Self
where K: HeatmapOptions,

Forward native crate::Plot::x_category_order configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn y_category_order(self, order: impl Into<CategoryOrder>) -> Self
where K: HeatmapOptions,

Forward native crate::Plot::y_category_order configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn x_limits(self, min: f64, max: f64) -> Self
where K: NumericX,

Forward native crate::Plot::x_limits configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn y_limits(self, min: f64, max: f64) -> Self
where K: NumericY,

Forward native crate::Plot::y_limits configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn x_ticks(self, ticks: Vec<AxisTick>) -> Self
where K: NumericX,

Forward native crate::Plot::x_ticks configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn y_ticks(self, ticks: Vec<AxisTick>) -> Self
where K: NumericY,

Forward native crate::Plot::y_ticks configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn x_tick_generation(self, generation: TickGeneration) -> Self
where K: NumericX,

Forward native crate::Plot::x_tick_generation configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn y_tick_generation(self, generation: TickGeneration) -> Self
where K: NumericY,

Forward native crate::Plot::y_tick_generation configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn x_tick_format(self, format: NumericFormat) -> Self
where K: NumericX,

Forward native crate::Plot::x_tick_format configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn y_tick_format(self, format: NumericFormat) -> Self
where K: NumericY,

Forward native crate::Plot::y_tick_format configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn guide(self, guide: GuideSpec) -> Self
where K: Guides,

Forward native crate::Plot::guide configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn categorical_color_scale(self, scale: CategoricalColorScale) -> Self

Forward native crate::Plot::categorical_color_scale configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn continuous_color_scale(self, scale: ContinuousColorScale) -> Self
where K: ContinuousColor,

Forward native crate::Plot::continuous_color_scale configuration.

Examples found in repository?
examples/strided_heatmap.rs (lines 67-71)
11fn main() -> Result<(), Box<dyn std::error::Error>> {
12    let mut arguments = std::env::args_os().skip(1);
13    let directory = match arguments.next() {
14        Some(path) if !path.is_empty() => std::path::PathBuf::from(path),
15        Some(_) => return Err("output directory must not be empty".into()),
16        None => std::env::current_dir()?,
17    };
18    if arguments.next().is_some() {
19        return Err("usage: strided_heatmap [output-directory]".into());
20    }
21    std::fs::create_dir_all(&directory)?;
22    // ANCHOR: strided-values
23    // Interleaved quality-control columns are deliberately excluded by the view.
24    let measurements = array![
25        [0.2, 99.0, 0.8, 99.0, 1.4, 99.0, 1.7, 99.0],
26        [0.1, 99.0, 0.6, 99.0, 1.1, 99.0, 1.3, 99.0],
27        [-0.1, 99.0, -0.5, 99.0, -0.9, 99.0, -1.4, 99.0],
28        [0.0, 99.0, 0.3, 99.0, 0.9, 99.0, 1.2, 99.0],
29    ];
30    let times = ["0 h", "2 h", "6 h", "12 h"];
31    let programs = [
32        "Inflammation",
33        "Stress response",
34        "Cell cycle",
35        "DNA repair",
36    ];
37    let present = array![
38        [true, true, true, true],
39        [true, true, true, true],
40        [true, false, true, true],
41        [true, true, true, true],
42    ];
43    let highlights = array![
44        [false, false, false, true],
45        [false, false, false, false],
46        [false, false, false, true],
47        [false, false, false, false],
48    ];
49    let cell_ids = array![
50        [101u64, 102, 103, 104],
51        [105, 106, 107, 108],
52        [109, 110, 111, 112],
53        [113, 114, 115, 116]
54    ];
55    let heatmap = nd::Heatmap::new((measurements.slice(s![.., ..;2]), present.view()))?
56        .highlight_cells(highlights.view())?
57        .source_rows(cell_ids.view())?;
58    // ANCHOR_END: strided-values
59    // ANCHOR: strided-plot
60    heatmap
61        .labels(Labels::raw())
62        .x_labels(times)?
63        .y_labels(programs)?
64        .x_label("Time after stimulus")
65        .y_label("Response program")
66        .color_label("Response (log2 fold change)")
67        .continuous_color_scale(ContinuousColorScale::diverging(
68            0.0,
69            None,
70            Some(ColorDomain::exact(-2.0, 2.0)?),
71        )?)
72        .size(780, 480)
73        .title("Response programs from a strided assay matrix")
74        .caption("Synthetic illustration · alternate source columns · one missing cell · no inferred clustering")
75        .svg(directory.join("strided_heatmap.svg"))?
76        .svg_preserve_text(directory.join("strided_heatmap_text.svg"))?;
77    // ANCHOR_END: strided-plot
78    Ok(())
79}
Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn color_by_sign(self) -> Self
where K: SignedBars,

Forward native crate::Plot::color_by_sign configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn zero_line(self) -> Self
where K: ZeroLine,

Forward native crate::Plot::zero_line configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn hide_point_outline(self) -> Self
where K: PointOutline,

Forward native crate::Plot::hide_point_outline configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn show_markers(self, visible: bool) -> Self
where K: Markers,

Forward native crate::Plot::show_markers configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn legend(self, policy: LegendPolicy) -> Self
where K: Legend,

Forward native crate::Plot::legend configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn legend_composition(self, composition: LegendComposition) -> Self
where K: Legend,

Forward native crate::Plot::legend_composition configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn raw_overlay(self, overlay: RawOverlay) -> Self
where K: RawOverlay,

Forward native crate::Plot::raw_overlay configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn estimate_status( self, statuses: impl IntoIterator<Item = EstimateStatus>, ) -> Self
where K: EstimateStatus,

Forward native crate::Plot::estimate_status configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn x_tick_text_layout(self, layout: TextLayout) -> Self
where K: XAxisText,

Forward native crate::Plot::x_tick_text_layout configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn y_tick_text_layout(self, layout: TextLayout) -> Self
where K: YAxisText,

Forward native crate::Plot::y_tick_text_layout configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn facet_row_text_layout(self, layout: TextLayout) -> Self
where K: Facet,

Forward native crate::Plot::facet_row_text_layout configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn facet_column_text_layout(self, layout: TextLayout) -> Self
where K: Facet,

Forward native crate::Plot::facet_column_text_layout configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn estimate_detail_text_layout(self, layout: TextLayout) -> Self

Forward native crate::Plot::estimate_detail_text_layout configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn significance_text_layout(self, layout: TextLayout) -> Self

Forward native crate::Plot::significance_text_layout configuration.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn guide_text_layout(self, role: GuideTextRole, layout: TextLayout) -> Self
where K: Legend,

Forward native crate::Plot::guide_text_layout configuration.

Source§

impl PlotAdapter<'_, Heatmap>

Source

pub fn layout(self, layout: HeatmapLayout) -> Self

Forward native Heatmap layout configuration.

Source§

impl PlotAdapter<'_, Heatmap>

Source

pub fn annotations(self, annotations: HeatmapAnnotations) -> Self

Forward native Heatmap annotations configuration.

Source§

impl PlotAdapter<'_, Heatmap>

Source

pub fn value_text_layout(self, layout: TextLayout) -> Self

Forward native Heatmap value_text_layout configuration.

Source§

impl PlotAdapter<'_, Heatmap>

Source

pub fn null_row_text_layout(self, layout: TextLayout) -> Self

Forward native Heatmap null_row_text_layout configuration.

Source§

impl PlotAdapter<'_, Forest>

Source

pub fn scale(self, scale: AxisScale) -> Self

Forward native Forest scale configuration.

Source§

impl PlotAdapter<'_, Bar>

Source

pub fn spacing(self, spacing: BarSpacing) -> Self

Forward native Bar spacing configuration.

Source§

impl PlotAdapter<'_, HorizontalBar>

Source

pub fn spacing(self, spacing: BarSpacing) -> Self

Forward native HorizontalBar spacing configuration.

Source§

impl PlotAdapter<'_, Histogram>

Source

pub fn bins(self, bins: HistogramBins) -> Self

Forward native Histogram bins configuration.

Source§

impl PlotAdapter<'_, Histogram>

Source

pub fn stat(self, stat: HistogramStat) -> Self

Forward native Histogram stat configuration.

Source§

impl PlotAdapter<'_, Histogram>

Source

pub fn composite(self, composite: HistogramComposite) -> Self

Forward native Histogram composite configuration.

Source§

impl PlotAdapter<'_, Qq>

Source

pub fn reference_line(self, line: QqLine) -> Self

Forward native Qq reference_line configuration.

Source§

impl PlotAdapter<'_, Regression>

Source

pub fn band(self, band: RegressionBand) -> Self

Forward native Regression band configuration.

Source§

impl PlotAdapter<'_, LinePath>

Source

pub fn style(self, style: LinePathStyle) -> Self

Forward native LinePath style configuration.

Source§

impl PlotAdapter<'_, Raincloud>

Source

pub fn hue_label(self, label: impl Into<Text>) -> Self

Forward native Raincloud hue_label configuration.

Source§

impl PlotAdapter<'_, Raincloud>

Source

pub fn clear_hue_label_style(self) -> Self

Forward native Raincloud clear_hue_label_style configuration.

Source§

impl PlotAdapter<'_, Raincloud>

Source

pub fn clear_hue_label_layout(self) -> Self

Forward native Raincloud clear_hue_label_layout configuration.

Source§

impl PlotAdapter<'_, Coefficient>

Source

pub fn reference_line(self, value: f64) -> Self

Forward native Coefficient reference_line configuration.

Source§

impl PlotAdapter<'_, Interaction>

Source

pub fn connectors(self, visible: bool) -> Self

Forward native Interaction connectors configuration.

Source§

impl PlotAdapter<'_, Interaction>

Source

pub fn styles(self, styles: impl IntoIterator<Item = InteractionStyle>) -> Self

Forward native Interaction styles configuration.

Source§

impl PlotAdapter<'_, Waterfall>

Source

pub fn total_format(self, format: NumericFormat) -> Self

Forward native Waterfall total_format configuration.

Source§

impl PlotAdapter<'_, Waterfall>

Source

pub fn total_labels(self, labels: WaterfallLabels) -> Self

Forward native Waterfall total_labels configuration.

Source§

impl PlotAdapter<'_, Waterfall>

Source

pub fn total_text_layout(self, layout: TextLayout) -> Self

Forward native Waterfall total_text_layout configuration.

Source§

impl PlotAdapter<'_, Matrix>

Source

pub fn matrix_row_text_layout(self, layout: TextLayout) -> Self

Forward native Matrix matrix_row_text_layout configuration.

Source§

impl PlotAdapter<'_, Matrix>

Source

pub fn matrix_column_text_layout(self, layout: TextLayout) -> Self

Forward native Matrix matrix_column_text_layout configuration.

Source§

impl PlotAdapter<'_, Line>

Source

pub fn point_layer(self, layer: impl Into<PointLayer>) -> Self

Append an independently bound native or adapter layer.

Source§

impl PlotAdapter<'_, Bar>

Source

pub fn point_layer(self, layer: impl Into<BarPointLayer>) -> Self

Append an independently bound native or adapter layer.

Source§

impl PlotAdapter<'_, HorizontalBar>

Source

pub fn point_layer(self, layer: impl Into<BarPointLayer>) -> Self

Append an independently bound native or adapter layer.

Source§

impl<K: Facet> PlotAdapter<'_, K>

Source

pub fn get_facet(&self) -> Option<&FacetSpec>

Borrow the currently bound native facet.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn get_theme(&self) -> Option<&Theme>

Borrow the explicitly selected local theme.

Source

pub fn get_default_theme(&self) -> Option<&Theme>

Borrow the retained construction default.

Source

pub fn get_point_alpha(&self) -> &AlphaEncoding

Inspect the authored point alpha encoding without ending source lookup.

Source

pub fn get_line_alpha(&self) -> &AlphaEncoding

Inspect the authored line alpha encoding without ending source lookup.

Source

pub fn get_fill_alpha(&self) -> &AlphaEncoding

Inspect the authored fill alpha encoding without ending source lookup.

Source

pub fn get_labels(&self) -> &Labels

Borrow the native authored label policy.

Source

pub fn size_with_unit( self, width: f64, height: f64, unit: SizeUnit, ) -> Result<Self>

Request an exact physical size, retaining the native source lookup.

Source

pub fn preflight(&self) -> Result<()>

Validate the chart without publishing or releasing source lookup.

Source

pub fn preflight_with_operation(&self, options: &OperationOptions) -> Result<()>

Use the native per-call options without releasing source lookup.

Source

pub fn render(&self) -> Result<Output>

Freeze one reusable output without publishing or releasing source lookup.

Source

pub fn render_with_operation( &self, options: &OperationOptions, ) -> Result<Output>

Use the native per-call options without releasing source lookup.

Source

pub fn render_with_results(&self) -> Result<RenderWithResults>

Freeze one output and the scientific values from that same native preparation.

Source

pub fn render_with_results_with_operation( &self, options: &OperationOptions, ) -> Result<RenderWithResults>

Use explicit options for the same-preparation result operation.

Source

pub fn significance<P>( self, annotations: impl IntoIterator<Item = Significance<P>>, ) -> Self
where K: Significance<P>,

Append caller-owned native significance annotations with their placement type.

Source

pub fn svg(&self, path: impl AsRef<Path>) -> Result<Output>

Render and publish SVG, returning the native reusable Output.

Examples found in repository?
examples/strided_heatmap.rs (line 75)
11fn main() -> Result<(), Box<dyn std::error::Error>> {
12    let mut arguments = std::env::args_os().skip(1);
13    let directory = match arguments.next() {
14        Some(path) if !path.is_empty() => std::path::PathBuf::from(path),
15        Some(_) => return Err("output directory must not be empty".into()),
16        None => std::env::current_dir()?,
17    };
18    if arguments.next().is_some() {
19        return Err("usage: strided_heatmap [output-directory]".into());
20    }
21    std::fs::create_dir_all(&directory)?;
22    // ANCHOR: strided-values
23    // Interleaved quality-control columns are deliberately excluded by the view.
24    let measurements = array![
25        [0.2, 99.0, 0.8, 99.0, 1.4, 99.0, 1.7, 99.0],
26        [0.1, 99.0, 0.6, 99.0, 1.1, 99.0, 1.3, 99.0],
27        [-0.1, 99.0, -0.5, 99.0, -0.9, 99.0, -1.4, 99.0],
28        [0.0, 99.0, 0.3, 99.0, 0.9, 99.0, 1.2, 99.0],
29    ];
30    let times = ["0 h", "2 h", "6 h", "12 h"];
31    let programs = [
32        "Inflammation",
33        "Stress response",
34        "Cell cycle",
35        "DNA repair",
36    ];
37    let present = array![
38        [true, true, true, true],
39        [true, true, true, true],
40        [true, false, true, true],
41        [true, true, true, true],
42    ];
43    let highlights = array![
44        [false, false, false, true],
45        [false, false, false, false],
46        [false, false, false, true],
47        [false, false, false, false],
48    ];
49    let cell_ids = array![
50        [101u64, 102, 103, 104],
51        [105, 106, 107, 108],
52        [109, 110, 111, 112],
53        [113, 114, 115, 116]
54    ];
55    let heatmap = nd::Heatmap::new((measurements.slice(s![.., ..;2]), present.view()))?
56        .highlight_cells(highlights.view())?
57        .source_rows(cell_ids.view())?;
58    // ANCHOR_END: strided-values
59    // ANCHOR: strided-plot
60    heatmap
61        .labels(Labels::raw())
62        .x_labels(times)?
63        .y_labels(programs)?
64        .x_label("Time after stimulus")
65        .y_label("Response program")
66        .color_label("Response (log2 fold change)")
67        .continuous_color_scale(ContinuousColorScale::diverging(
68            0.0,
69            None,
70            Some(ColorDomain::exact(-2.0, 2.0)?),
71        )?)
72        .size(780, 480)
73        .title("Response programs from a strided assay matrix")
74        .caption("Synthetic illustration · alternate source columns · one missing cell · no inferred clustering")
75        .svg(directory.join("strided_heatmap.svg"))?
76        .svg_preserve_text(directory.join("strided_heatmap_text.svg"))?;
77    // ANCHOR_END: strided-plot
78    Ok(())
79}
Source

pub fn svg_with_operation( &self, path: impl AsRef<Path>, options: &OperationOptions, ) -> Result<Output>

Render and publish using the native operation options.

Source

pub fn svg_preserve_text(&self, path: impl AsRef<Path>) -> Result<Output>

Render and publish SVG retaining selectable text.

Source

pub fn svg_preserve_text_with_operation( &self, path: impl AsRef<Path>, options: &OperationOptions, ) -> Result<Output>

Render and publish using the native operation options.

Source

pub fn png(&self, path: impl AsRef<Path>) -> Result<Output>

Render and publish a 300-DPI PNG.

Source

pub fn png_with_operation( &self, path: impl AsRef<Path>, options: &OperationOptions, ) -> Result<Output>

Render and publish using the native operation options.

Source

pub fn png_preview(&self, path: impl AsRef<Path>) -> Result<Output>

Render and publish a source-sized PNG.

Source

pub fn png_preview_with_operation( &self, path: impl AsRef<Path>, options: &OperationOptions, ) -> Result<Output>

Render and publish using the native operation options.

Source

pub fn png_with_options( &self, path: impl AsRef<Path>, options: PngOptions, ) -> Result<Output>

Publish using native caller-owned PNG sizing and encoding options.

Source

pub fn png_with_options_with_operation( &self, path: impl AsRef<Path>, options: PngOptions, operation: &OperationOptions, ) -> Result<Output>

Render and publish using native device and operation options.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn data_roles(&self) -> Result<Vec<DataRoleInfo>, AdapterError>

Discover actual original inputs in the native plot.

Source

pub fn data_roles_at( &self, target: &ElementRef, ) -> Result<Vec<DataRoleInfo>, AdapterError>

Inspect original inputs of an actual declaration.

Source

pub fn data_roles_in( &self, panel: &PanelPath, ) -> Result<Vec<DataRoleInfo>, AdapterError>

Inspect original inputs of actual declarations in a panel.

Source

pub fn data( &self, selector: impl Into<DataSelector>, ) -> Result<DataValue, AdapterError>

Read an actual original input, without source lookup.

Source

pub fn elements( &self, query: ElementQuery, ) -> Result<Vec<ElementRef>, AdapterError>

Discover actual native scientific layer declarations.

Source

pub fn element_ref( &self, query: impl Into<ElementQuery>, ) -> Result<ElementRef, AdapterError>

Find an actual native declaration.

Source

pub fn read_element( &self, reference: &ElementRef, ) -> Result<ElementSnapshot, AdapterError>

Read an owning native declaration snapshot.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn get_significance(&self) -> Option<&[SignificanceAnnotation]>

Read actual supplied significance annotations.

Source§

impl PlotAdapter<'_, Histogram>

Source

pub fn stat_result(&self) -> Result<HistogramResult>

Prepare actual scientific values without rendering.

Source

pub fn stat_result_with_operation( &self, options: &OperationOptions, ) -> Result<HistogramResult>

Prepare with native operation options.

Source

pub fn stat_result_in(&self, panel: &PanelPath) -> Result<HistogramResult>

Prepare actual values for the selected scientific panel.

Source

pub fn stat_result_in_with_operation( &self, panel: &PanelPath, options: &OperationOptions, ) -> Result<HistogramResult>

Prepare the selected panel with explicit operation options.

Source§

impl PlotAdapter<'_, Density>

Source

pub fn stat_result(&self) -> Result<DensityResult>

Prepare actual scientific values without rendering.

Source

pub fn stat_result_with_operation( &self, options: &OperationOptions, ) -> Result<DensityResult>

Prepare with native operation options.

Source

pub fn stat_result_in(&self, panel: &PanelPath) -> Result<DensityResult>

Prepare actual values for the selected scientific panel.

Source

pub fn stat_result_in_with_operation( &self, panel: &PanelPath, options: &OperationOptions, ) -> Result<DensityResult>

Prepare the selected panel with explicit operation options.

Source§

impl PlotAdapter<'_, Qq>

Source

pub fn stat_result(&self) -> Result<ProbabilityPlotResult>

Prepare actual scientific values without rendering.

Source

pub fn stat_result_with_operation( &self, options: &OperationOptions, ) -> Result<ProbabilityPlotResult>

Prepare with native operation options.

Source

pub fn stat_result_in(&self, panel: &PanelPath) -> Result<ProbabilityPlotResult>

Prepare actual values for the selected scientific panel.

Source

pub fn stat_result_in_with_operation( &self, panel: &PanelPath, options: &OperationOptions, ) -> Result<ProbabilityPlotResult>

Prepare the selected panel with explicit operation options.

Source§

impl PlotAdapter<'_, Regression>

Source

pub fn stat_result(&self) -> Result<FitResult>

Prepare actual scientific values without rendering.

Source

pub fn stat_result_with_operation( &self, options: &OperationOptions, ) -> Result<FitResult>

Prepare with native operation options.

Source

pub fn stat_result_in(&self, panel: &PanelPath) -> Result<FitResult>

Prepare actual values for the selected scientific panel.

Source

pub fn stat_result_in_with_operation( &self, panel: &PanelPath, options: &OperationOptions, ) -> Result<FitResult>

Prepare the selected panel with explicit operation options.

Source§

impl PlotAdapter<'_, Bar>

Source

pub fn stat_result(&self) -> Result<StatResult>

Prepare actual scientific values without rendering.

Source

pub fn stat_result_with_operation( &self, options: &OperationOptions, ) -> Result<StatResult>

Prepare with native operation options.

Source

pub fn stat_result_in(&self, panel: &PanelPath) -> Result<StatResult>

Prepare actual values for the selected scientific panel.

Source

pub fn stat_result_in_with_operation( &self, panel: &PanelPath, options: &OperationOptions, ) -> Result<StatResult>

Prepare the selected panel with explicit operation options.

Source§

impl PlotAdapter<'_, HorizontalBar>

Source

pub fn stat_result(&self) -> Result<StatResult>

Prepare actual scientific values without rendering.

Source

pub fn stat_result_with_operation( &self, options: &OperationOptions, ) -> Result<StatResult>

Prepare with native operation options.

Source

pub fn stat_result_in(&self, panel: &PanelPath) -> Result<StatResult>

Prepare actual values for the selected scientific panel.

Source

pub fn stat_result_in_with_operation( &self, panel: &PanelPath, options: &OperationOptions, ) -> Result<StatResult>

Prepare the selected panel with explicit operation options.

Source§

impl PlotAdapter<'_, StackedBar>

Source

pub fn stat_result(&self) -> Result<StatResult>

Prepare actual scientific values without rendering.

Source

pub fn stat_result_with_operation( &self, options: &OperationOptions, ) -> Result<StatResult>

Prepare with native operation options.

Source

pub fn stat_result_in(&self, panel: &PanelPath) -> Result<StatResult>

Prepare actual values for the selected scientific panel.

Source

pub fn stat_result_in_with_operation( &self, panel: &PanelPath, options: &OperationOptions, ) -> Result<StatResult>

Prepare the selected panel with explicit operation options.

Source§

impl PlotAdapter<'_, StackedHorizontalBar>

Source

pub fn stat_result(&self) -> Result<StatResult>

Prepare actual scientific values without rendering.

Source

pub fn stat_result_with_operation( &self, options: &OperationOptions, ) -> Result<StatResult>

Prepare with native operation options.

Source

pub fn stat_result_in(&self, panel: &PanelPath) -> Result<StatResult>

Prepare actual values for the selected scientific panel.

Source

pub fn stat_result_in_with_operation( &self, panel: &PanelPath, options: &OperationOptions, ) -> Result<StatResult>

Prepare the selected panel with explicit operation options.

Source§

impl PlotAdapter<'_, Interaction>

Source

pub fn stat_result(&self) -> Result<StatResult>

Prepare actual scientific values without rendering.

Source

pub fn stat_result_with_operation( &self, options: &OperationOptions, ) -> Result<StatResult>

Prepare with native operation options.

Source

pub fn stat_result_in(&self, panel: &PanelPath) -> Result<StatResult>

Prepare actual values for the selected scientific panel.

Source

pub fn stat_result_in_with_operation( &self, panel: &PanelPath, options: &OperationOptions, ) -> Result<StatResult>

Prepare the selected panel with explicit operation options.

Source§

impl PlotAdapter<'_, Waterfall>

Source

pub fn stat_result(&self) -> Result<StatResult>

Prepare actual scientific values without rendering.

Source

pub fn stat_result_with_operation( &self, options: &OperationOptions, ) -> Result<StatResult>

Prepare with native operation options.

Source

pub fn stat_result_in(&self, panel: &PanelPath) -> Result<StatResult>

Prepare actual values for the selected scientific panel.

Source

pub fn stat_result_in_with_operation( &self, panel: &PanelPath, options: &OperationOptions, ) -> Result<StatResult>

Prepare the selected panel with explicit operation options.

Source§

impl PlotAdapter<'_, Boxplot>

Source

pub fn stat_result(&self) -> Result<BoxSummary>

Prepare actual scientific values without rendering.

Source

pub fn stat_result_with_operation( &self, options: &OperationOptions, ) -> Result<BoxSummary>

Prepare with native operation options.

Source

pub fn stat_result_in(&self, panel: &PanelPath) -> Result<BoxSummary>

Prepare actual values for the selected scientific panel.

Source

pub fn stat_result_in_with_operation( &self, panel: &PanelPath, options: &OperationOptions, ) -> Result<BoxSummary>

Prepare the selected panel with explicit operation options.

Source§

impl PlotAdapter<'_, Violin>

Source

pub fn stat_result(&self) -> Result<DensityProfiles>

Prepare actual scientific values without rendering.

Source

pub fn stat_result_with_operation( &self, options: &OperationOptions, ) -> Result<DensityProfiles>

Prepare with native operation options.

Source

pub fn stat_result_in(&self, panel: &PanelPath) -> Result<DensityProfiles>

Prepare actual values for the selected scientific panel.

Source

pub fn stat_result_in_with_operation( &self, panel: &PanelPath, options: &OperationOptions, ) -> Result<DensityProfiles>

Prepare the selected panel with explicit operation options.

Source§

impl PlotAdapter<'_, Raincloud>

Source

pub fn stat_result(&self) -> Result<RaincloudGeometry>

Prepare actual scientific values without rendering.

Source

pub fn stat_result_with_operation( &self, options: &OperationOptions, ) -> Result<RaincloudGeometry>

Prepare with native operation options.

Source

pub fn stat_result_in(&self, panel: &PanelPath) -> Result<RaincloudGeometry>

Prepare actual values for the selected scientific panel.

Source

pub fn stat_result_in_with_operation( &self, panel: &PanelPath, options: &OperationOptions, ) -> Result<RaincloudGeometry>

Prepare the selected panel with explicit operation options.

Source§

impl PlotAdapter<'_, PointInterval>

Source

pub fn stat_result(&self) -> Result<StatResult>

Prepare actual scientific values without rendering.

Source

pub fn stat_result_with_operation( &self, options: &OperationOptions, ) -> Result<StatResult>

Prepare with native operation options.

Source

pub fn stat_result_in(&self, panel: &PanelPath) -> Result<StatResult>

Prepare actual values for the selected scientific panel.

Source

pub fn stat_result_in_with_operation( &self, panel: &PanelPath, options: &OperationOptions, ) -> Result<StatResult>

Prepare the selected panel with explicit operation options.

Source§

impl PlotAdapter<'_, Forest>

Source

pub fn stat_result(&self) -> Result<StatResult>

Prepare actual scientific values without rendering.

Source

pub fn stat_result_with_operation( &self, options: &OperationOptions, ) -> Result<StatResult>

Prepare with native operation options.

Source

pub fn stat_result_in(&self, panel: &PanelPath) -> Result<StatResult>

Prepare actual values for the selected scientific panel.

Source

pub fn stat_result_in_with_operation( &self, panel: &PanelPath, options: &OperationOptions, ) -> Result<StatResult>

Prepare the selected panel with explicit operation options.

Source§

impl PlotAdapter<'_, Coefficient>

Source

pub fn stat_result(&self) -> Result<StatResult>

Prepare actual scientific values without rendering.

Source

pub fn stat_result_with_operation( &self, options: &OperationOptions, ) -> Result<StatResult>

Prepare with native operation options.

Source

pub fn stat_result_in(&self, panel: &PanelPath) -> Result<StatResult>

Prepare actual values for the selected scientific panel.

Source

pub fn stat_result_in_with_operation( &self, panel: &PanelPath, options: &OperationOptions, ) -> Result<StatResult>

Prepare the selected panel with explicit operation options.

Source§

impl PlotAdapter<'_, Density>

Source

pub fn stat_result_group( &self, panel: &PanelPath, group: &GroupKey, ) -> Result<DensityResult>

Prepare the actual selected original group of a density panel.

Source

pub fn stat_result_group_with_operation( &self, panel: &PanelPath, group: &GroupKey, options: &OperationOptions, ) -> Result<DensityResult>

Prepare an original density group with per-call resource options.

Source§

impl PlotAdapter<'_, Marginal>

Source

pub fn stat_result_group( &self, panel: &PanelPath, group: &GroupKey, ) -> Result<DensityResult>

Prepare the actual selected original group of a density panel.

Source

pub fn stat_result_group_with_operation( &self, panel: &PanelPath, group: &GroupKey, options: &OperationOptions, ) -> Result<DensityResult>

Prepare an original density group with per-call resource options.

Source§

impl PlotAdapter<'_, Matrix>

Source

pub fn stat_result_group( &self, panel: &PanelPath, group: &GroupKey, ) -> Result<DensityResult>

Prepare the actual selected original group of a density panel.

Source

pub fn stat_result_group_with_operation( &self, panel: &PanelPath, group: &GroupKey, options: &OperationOptions, ) -> Result<DensityResult>

Prepare an original density group with per-call resource options.

Source§

impl PlotAdapter<'_, Marginal>

Source

pub fn stat_result_in(&self, panel: &PanelPath) -> Result<DensityResult>

Prepare actual density values for the selected scientific region.

Source

pub fn stat_result_in_with_operation( &self, panel: &PanelPath, options: &OperationOptions, ) -> Result<DensityResult>

Prepare the selected region with operation options.

Source§

impl PlotAdapter<'_, Matrix>

Source

pub fn stat_result_in(&self, panel: &PanelPath) -> Result<DensityResult>

Prepare actual density values for the selected scientific region.

Source

pub fn stat_result_in_with_operation( &self, panel: &PanelPath, options: &OperationOptions, ) -> Result<DensityResult>

Prepare the selected region with operation options.

Source§

impl<'source> PlotAdapter<'source, Histogram>

Source

pub fn geometry( lower: impl NumericInput, upper: impl NumericInput, height: impl NumericInput, stat: HistogramStat, ) -> Result<Self, AdapterError>

Snapshot supplied bin edges and heights, with their declared statistic.

Source

pub fn geometry_from_data( source: impl ArraySource + 'source, lower: impl NumericInput, upper: impl NumericInput, height: impl NumericInput, stat: HistogramStat, ) -> Result<Self, AdapterError>

Snapshot the selected bin columns and retain only their main lookup context.

Source§

impl<'source> PlotAdapter<'source, Raincloud>

Source

pub fn geometry( category: impl CategoryInput, q1: impl NumericInput, median: impl NumericInput, q3: impl NumericInput, density_category: impl CategoryInput, density_y: impl NumericInput, normalized_width: impl NumericInput, point_category: impl CategoryInput, point_y: impl NumericInput, normalized_strip: impl NumericInput, category_dimension: impl Into<String>, value_dimension: impl Into<String>, ) -> Result<Self, AdapterError>

Snapshot complete geometry from direct columns in main/auxiliary domain order, followed by scientific dimension names.

Source

pub fn geometry_from_data( source: impl ArraySource + 'source, density_source: Option<&dyn ArraySource>, points_source: Option<&dyn ArraySource>, category: impl CategoryInput, q1: impl NumericInput, median: impl NumericInput, q3: impl NumericInput, density_category: impl CategoryInput, density_y: impl NumericInput, normalized_width: impl NumericInput, point_category: impl CategoryInput, point_y: impl NumericInput, normalized_strip: impl NumericInput, category_dimension: impl Into<String>, value_dimension: impl Into<String>, ) -> Result<Self, AdapterError>

Snapshot independently selected/direct component columns. The main source is retained; each optional auxiliary source is used only for its own domain, with no cross-domain selector fallback.

Source§

impl<'source> PlotAdapter<'source, Raincloud>

Source

pub fn geometry_with_hue( category: impl CategoryInput, hue: impl CategoryInput, q1: impl NumericInput, median: impl NumericInput, q3: impl NumericInput, density_category: impl CategoryInput, density_hue: impl CategoryInput, density_y: impl NumericInput, normalized_width: impl NumericInput, point_category: impl CategoryInput, point_hue: impl CategoryInput, point_y: impl NumericInput, normalized_strip: impl NumericInput, category_dimension: impl Into<String>, value_dimension: impl Into<String>, hue_dimension: impl Into<String>, ) -> Result<Self, AdapterError>

Snapshot complete geometry from direct columns in main/auxiliary domain order, followed by scientific dimension names.

Source

pub fn geometry_with_hue_from_data( source: impl ArraySource + 'source, density_source: Option<&dyn ArraySource>, points_source: Option<&dyn ArraySource>, category: impl CategoryInput, hue: impl CategoryInput, q1: impl NumericInput, median: impl NumericInput, q3: impl NumericInput, density_category: impl CategoryInput, density_hue: impl CategoryInput, density_y: impl NumericInput, normalized_width: impl NumericInput, point_category: impl CategoryInput, point_hue: impl CategoryInput, point_y: impl NumericInput, normalized_strip: impl NumericInput, category_dimension: impl Into<String>, value_dimension: impl Into<String>, hue_dimension: impl Into<String>, ) -> Result<Self, AdapterError>

Snapshot independently selected/direct component columns. The main source is retained; each optional auxiliary source is used only for its own domain, with no cross-domain selector fallback.

Source§

impl PlotAdapter<'_, Raincloud>

Source

pub fn from_geometry(geometry: RaincloudGeometry) -> Self

Consume an already owned native raincloud geometry directly.

Source

pub fn get_geometry(&self) -> Option<&RaincloudGeometry>

Borrow the actual supplied raincloud geometry.

Source§

impl PlotAdapter<'_, Histogram>

Source

pub fn from_geometry(geometry: HistogramGeometry) -> Self

Consume an already owned native histogram geometry directly.

Source

pub fn get_geometry(&self) -> Option<&HistogramGeometry>

Borrow the actual supplied geometry, if any.

Source

pub fn kde( self, x: impl NumericInput, density: impl NumericInput, ) -> Result<Self, AdapterError>

Add or replace the given KDE using direct columns in its own domain.

Source

pub fn kde_from_data( self, source: impl ArraySource, x: impl NumericInput, density: impl NumericInput, ) -> Result<Self, AdapterError>

Snapshot KDE columns from their own auxiliary source.

Source

pub fn rug( self, x: impl NumericInput, baseline: impl NumericInput, top: impl NumericInput, ) -> Result<Self, AdapterError>

Add or replace independently supplied rug segments from direct columns.

Source

pub fn rug_from_data( self, source: impl ArraySource, x: impl NumericInput, baseline: impl NumericInput, top: impl NumericInput, ) -> Result<Self, AdapterError>

Snapshot rug columns from their own auxiliary source.

Source

pub fn value_dimension( self, name: impl Into<String>, ) -> Result<Self, AdapterError>

Set the original scientific x dimension of supplied geometry.

Source

pub fn height_dimension( self, name: impl Into<String>, ) -> Result<Self, AdapterError>

Set the original scientific height dimension of supplied geometry.

Source

pub fn composite_precomputed_kde( self, x: impl NumericInput, y: impl NumericInput, ) -> Result<Self, AdapterError>

Snapshot direct KDE columns for the sample-owned KDE+rug composite. Samples, bins, stat and the main lookup context are unchanged.

Source

pub fn composite_precomputed_kde_from_data( self, source: impl ArraySource, x: impl NumericInput, y: impl NumericInput, ) -> Result<Self, AdapterError>

Snapshot KDE from an independent source, retaining no borrow of it and never using the main source as a selector fallback.

Source§

impl<'source> PlotAdapter<'source, Heatmap>

Source

pub fn new(grid: impl ColumnsInput) -> Result<Self, AdapterError>

Bind a numeric matrix with logical rows top-to-bottom and columns left-to-right.

Examples found in repository?
examples/strided_heatmap.rs (line 55)
11fn main() -> Result<(), Box<dyn std::error::Error>> {
12    let mut arguments = std::env::args_os().skip(1);
13    let directory = match arguments.next() {
14        Some(path) if !path.is_empty() => std::path::PathBuf::from(path),
15        Some(_) => return Err("output directory must not be empty".into()),
16        None => std::env::current_dir()?,
17    };
18    if arguments.next().is_some() {
19        return Err("usage: strided_heatmap [output-directory]".into());
20    }
21    std::fs::create_dir_all(&directory)?;
22    // ANCHOR: strided-values
23    // Interleaved quality-control columns are deliberately excluded by the view.
24    let measurements = array![
25        [0.2, 99.0, 0.8, 99.0, 1.4, 99.0, 1.7, 99.0],
26        [0.1, 99.0, 0.6, 99.0, 1.1, 99.0, 1.3, 99.0],
27        [-0.1, 99.0, -0.5, 99.0, -0.9, 99.0, -1.4, 99.0],
28        [0.0, 99.0, 0.3, 99.0, 0.9, 99.0, 1.2, 99.0],
29    ];
30    let times = ["0 h", "2 h", "6 h", "12 h"];
31    let programs = [
32        "Inflammation",
33        "Stress response",
34        "Cell cycle",
35        "DNA repair",
36    ];
37    let present = array![
38        [true, true, true, true],
39        [true, true, true, true],
40        [true, false, true, true],
41        [true, true, true, true],
42    ];
43    let highlights = array![
44        [false, false, false, true],
45        [false, false, false, false],
46        [false, false, false, true],
47        [false, false, false, false],
48    ];
49    let cell_ids = array![
50        [101u64, 102, 103, 104],
51        [105, 106, 107, 108],
52        [109, 110, 111, 112],
53        [113, 114, 115, 116]
54    ];
55    let heatmap = nd::Heatmap::new((measurements.slice(s![.., ..;2]), present.view()))?
56        .highlight_cells(highlights.view())?
57        .source_rows(cell_ids.view())?;
58    // ANCHOR_END: strided-values
59    // ANCHOR: strided-plot
60    heatmap
61        .labels(Labels::raw())
62        .x_labels(times)?
63        .y_labels(programs)?
64        .x_label("Time after stimulus")
65        .y_label("Response program")
66        .color_label("Response (log2 fold change)")
67        .continuous_color_scale(ContinuousColorScale::diverging(
68            0.0,
69            None,
70            Some(ColorDomain::exact(-2.0, 2.0)?),
71        )?)
72        .size(780, 480)
73        .title("Response programs from a strided assay matrix")
74        .caption("Synthetic illustration · alternate source columns · one missing cell · no inferred clustering")
75        .svg(directory.join("strided_heatmap.svg"))?
76        .svg_preserve_text(directory.join("strided_heatmap_text.svg"))?;
77    // ANCHOR_END: strided-plot
78    Ok(())
79}
Source

pub fn from_data( source: impl ArraySource + 'source, columns: impl ColumnsInput, ) -> Result<Self, AdapterError>

Select ordered source columns, or .. for every column.

Source

pub fn x_labels<I, S>(self, labels: I) -> Result<Self, AdapterError>
where I: IntoIterator<Item = S>, S: Into<String>,

Assign literal column display labels without merging positional identities.

Examples found in repository?
examples/strided_heatmap.rs (line 62)
11fn main() -> Result<(), Box<dyn std::error::Error>> {
12    let mut arguments = std::env::args_os().skip(1);
13    let directory = match arguments.next() {
14        Some(path) if !path.is_empty() => std::path::PathBuf::from(path),
15        Some(_) => return Err("output directory must not be empty".into()),
16        None => std::env::current_dir()?,
17    };
18    if arguments.next().is_some() {
19        return Err("usage: strided_heatmap [output-directory]".into());
20    }
21    std::fs::create_dir_all(&directory)?;
22    // ANCHOR: strided-values
23    // Interleaved quality-control columns are deliberately excluded by the view.
24    let measurements = array![
25        [0.2, 99.0, 0.8, 99.0, 1.4, 99.0, 1.7, 99.0],
26        [0.1, 99.0, 0.6, 99.0, 1.1, 99.0, 1.3, 99.0],
27        [-0.1, 99.0, -0.5, 99.0, -0.9, 99.0, -1.4, 99.0],
28        [0.0, 99.0, 0.3, 99.0, 0.9, 99.0, 1.2, 99.0],
29    ];
30    let times = ["0 h", "2 h", "6 h", "12 h"];
31    let programs = [
32        "Inflammation",
33        "Stress response",
34        "Cell cycle",
35        "DNA repair",
36    ];
37    let present = array![
38        [true, true, true, true],
39        [true, true, true, true],
40        [true, false, true, true],
41        [true, true, true, true],
42    ];
43    let highlights = array![
44        [false, false, false, true],
45        [false, false, false, false],
46        [false, false, false, true],
47        [false, false, false, false],
48    ];
49    let cell_ids = array![
50        [101u64, 102, 103, 104],
51        [105, 106, 107, 108],
52        [109, 110, 111, 112],
53        [113, 114, 115, 116]
54    ];
55    let heatmap = nd::Heatmap::new((measurements.slice(s![.., ..;2]), present.view()))?
56        .highlight_cells(highlights.view())?
57        .source_rows(cell_ids.view())?;
58    // ANCHOR_END: strided-values
59    // ANCHOR: strided-plot
60    heatmap
61        .labels(Labels::raw())
62        .x_labels(times)?
63        .y_labels(programs)?
64        .x_label("Time after stimulus")
65        .y_label("Response program")
66        .color_label("Response (log2 fold change)")
67        .continuous_color_scale(ContinuousColorScale::diverging(
68            0.0,
69            None,
70            Some(ColorDomain::exact(-2.0, 2.0)?),
71        )?)
72        .size(780, 480)
73        .title("Response programs from a strided assay matrix")
74        .caption("Synthetic illustration · alternate source columns · one missing cell · no inferred clustering")
75        .svg(directory.join("strided_heatmap.svg"))?
76        .svg_preserve_text(directory.join("strided_heatmap_text.svg"))?;
77    // ANCHOR_END: strided-plot
78    Ok(())
79}
Source

pub fn y_labels<I, S>(self, labels: I) -> Result<Self, AdapterError>
where I: IntoIterator<Item = S>, S: Into<String>,

Assign literal row display labels without changing source membership.

Examples found in repository?
examples/strided_heatmap.rs (line 63)
11fn main() -> Result<(), Box<dyn std::error::Error>> {
12    let mut arguments = std::env::args_os().skip(1);
13    let directory = match arguments.next() {
14        Some(path) if !path.is_empty() => std::path::PathBuf::from(path),
15        Some(_) => return Err("output directory must not be empty".into()),
16        None => std::env::current_dir()?,
17    };
18    if arguments.next().is_some() {
19        return Err("usage: strided_heatmap [output-directory]".into());
20    }
21    std::fs::create_dir_all(&directory)?;
22    // ANCHOR: strided-values
23    // Interleaved quality-control columns are deliberately excluded by the view.
24    let measurements = array![
25        [0.2, 99.0, 0.8, 99.0, 1.4, 99.0, 1.7, 99.0],
26        [0.1, 99.0, 0.6, 99.0, 1.1, 99.0, 1.3, 99.0],
27        [-0.1, 99.0, -0.5, 99.0, -0.9, 99.0, -1.4, 99.0],
28        [0.0, 99.0, 0.3, 99.0, 0.9, 99.0, 1.2, 99.0],
29    ];
30    let times = ["0 h", "2 h", "6 h", "12 h"];
31    let programs = [
32        "Inflammation",
33        "Stress response",
34        "Cell cycle",
35        "DNA repair",
36    ];
37    let present = array![
38        [true, true, true, true],
39        [true, true, true, true],
40        [true, false, true, true],
41        [true, true, true, true],
42    ];
43    let highlights = array![
44        [false, false, false, true],
45        [false, false, false, false],
46        [false, false, false, true],
47        [false, false, false, false],
48    ];
49    let cell_ids = array![
50        [101u64, 102, 103, 104],
51        [105, 106, 107, 108],
52        [109, 110, 111, 112],
53        [113, 114, 115, 116]
54    ];
55    let heatmap = nd::Heatmap::new((measurements.slice(s![.., ..;2]), present.view()))?
56        .highlight_cells(highlights.view())?
57        .source_rows(cell_ids.view())?;
58    // ANCHOR_END: strided-values
59    // ANCHOR: strided-plot
60    heatmap
61        .labels(Labels::raw())
62        .x_labels(times)?
63        .y_labels(programs)?
64        .x_label("Time after stimulus")
65        .y_label("Response program")
66        .color_label("Response (log2 fold change)")
67        .continuous_color_scale(ContinuousColorScale::diverging(
68            0.0,
69            None,
70            Some(ColorDomain::exact(-2.0, 2.0)?),
71        )?)
72        .size(780, 480)
73        .title("Response programs from a strided assay matrix")
74        .caption("Synthetic illustration · alternate source columns · one missing cell · no inferred clustering")
75        .svg(directory.join("strided_heatmap.svg"))?
76        .svg_preserve_text(directory.join("strided_heatmap_text.svg"))?;
77    // ANCHOR_END: strided-plot
78    Ok(())
79}
Source

pub fn row_labels( self, values: impl CategoryInput, ) -> Result<Self, AdapterError>

Bind row display metadata from a categorical source column or direct vector.

Source

pub fn highlight_cells( self, values: impl BooleanInput, ) -> Result<Self, AdapterError>

Bind Boolean records or a same-shape cell grid; true highlights, not masks.

Examples found in repository?
examples/strided_heatmap.rs (line 56)
11fn main() -> Result<(), Box<dyn std::error::Error>> {
12    let mut arguments = std::env::args_os().skip(1);
13    let directory = match arguments.next() {
14        Some(path) if !path.is_empty() => std::path::PathBuf::from(path),
15        Some(_) => return Err("output directory must not be empty".into()),
16        None => std::env::current_dir()?,
17    };
18    if arguments.next().is_some() {
19        return Err("usage: strided_heatmap [output-directory]".into());
20    }
21    std::fs::create_dir_all(&directory)?;
22    // ANCHOR: strided-values
23    // Interleaved quality-control columns are deliberately excluded by the view.
24    let measurements = array![
25        [0.2, 99.0, 0.8, 99.0, 1.4, 99.0, 1.7, 99.0],
26        [0.1, 99.0, 0.6, 99.0, 1.1, 99.0, 1.3, 99.0],
27        [-0.1, 99.0, -0.5, 99.0, -0.9, 99.0, -1.4, 99.0],
28        [0.0, 99.0, 0.3, 99.0, 0.9, 99.0, 1.2, 99.0],
29    ];
30    let times = ["0 h", "2 h", "6 h", "12 h"];
31    let programs = [
32        "Inflammation",
33        "Stress response",
34        "Cell cycle",
35        "DNA repair",
36    ];
37    let present = array![
38        [true, true, true, true],
39        [true, true, true, true],
40        [true, false, true, true],
41        [true, true, true, true],
42    ];
43    let highlights = array![
44        [false, false, false, true],
45        [false, false, false, false],
46        [false, false, false, true],
47        [false, false, false, false],
48    ];
49    let cell_ids = array![
50        [101u64, 102, 103, 104],
51        [105, 106, 107, 108],
52        [109, 110, 111, 112],
53        [113, 114, 115, 116]
54    ];
55    let heatmap = nd::Heatmap::new((measurements.slice(s![.., ..;2]), present.view()))?
56        .highlight_cells(highlights.view())?
57        .source_rows(cell_ids.view())?;
58    // ANCHOR_END: strided-values
59    // ANCHOR: strided-plot
60    heatmap
61        .labels(Labels::raw())
62        .x_labels(times)?
63        .y_labels(programs)?
64        .x_label("Time after stimulus")
65        .y_label("Response program")
66        .color_label("Response (log2 fold change)")
67        .continuous_color_scale(ContinuousColorScale::diverging(
68            0.0,
69            None,
70            Some(ColorDomain::exact(-2.0, 2.0)?),
71        )?)
72        .size(780, 480)
73        .title("Response programs from a strided assay matrix")
74        .caption("Synthetic illustration · alternate source columns · one missing cell · no inferred clustering")
75        .svg(directory.join("strided_heatmap.svg"))?
76        .svg_preserve_text(directory.join("strided_heatmap_text.svg"))?;
77    // ANCHOR_END: strided-plot
78    Ok(())
79}
Source§

impl<K: EstimateStatus> PlotAdapter<'_, K>

Source

pub fn estimate_status_boolean( self, input: impl BooleanInput, ) -> Result<Self, AdapterError>

Explicitly map Boolean true/false to Estimated/NotEstimable; null is an error.

Source

pub fn estimate_status_categorical<I, S>( self, input: impl CategoryInput, mapping: I, ) -> Result<Self, AdapterError>
where I: IntoIterator<Item = (S, EstimateStatus)>, S: AsRef<str>,

Map exact raw categorical statuses, rejecting missing/unmapped observations.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn get_estimate_status(&self) -> Option<&EstimateStatusBinding>

Read the native estimate availability declaration, without looking up the source again.

Source§

impl<'source> PlotAdapter<'source, Scatter>

Source

pub fn new( x: impl NumericInput, y: impl NumericSeriesInput, ) -> Result<Self, AdapterError>

Bind actual x coordinates and one numeric variable or an explicit many-y matrix/selection.

Source

pub fn from_data( source: impl ArraySource + 'source, x: impl NumericInput, y: impl NumericSeriesInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct variables and retain later column lookup.

Source

pub fn indexed(variables: impl ColumnsInput) -> Result<Self, AdapterError>

Explicitly choose zero-based logical row position as x.

Source

pub fn indexed_from_data( source: impl ArraySource + 'source, columns: impl ColumnsInput, ) -> Result<Self, AdapterError>

Use row position and an ordered logical-column selection, including ...

Source

pub fn indexed_numeric_from_data( source: impl ArraySource + 'source, ) -> Result<Self, AdapterError>

Explicit numeric discovery on a homogeneous source uses all columns.

Source§

impl<'source> PlotAdapter<'source, Line>

Source

pub fn new( x: impl NumericInput, y: impl NumericSeriesInput, ) -> Result<Self, AdapterError>

Bind actual x coordinates and one numeric variable or an explicit many-y matrix/selection.

Source

pub fn from_data( source: impl ArraySource + 'source, x: impl NumericInput, y: impl NumericSeriesInput, ) -> Result<Self, AdapterError>

Bind logical source columns/direct variables and retain later column lookup.

Source

pub fn indexed(variables: impl ColumnsInput) -> Result<Self, AdapterError>

Explicitly choose zero-based logical row position as x.

Source

pub fn indexed_from_data( source: impl ArraySource + 'source, columns: impl ColumnsInput, ) -> Result<Self, AdapterError>

Use row position and an ordered logical-column selection, including ...

Source

pub fn indexed_numeric_from_data( source: impl ArraySource + 'source, ) -> Result<Self, AdapterError>

Explicit numeric discovery on a homogeneous source uses all columns.

Source§

impl<'source> PlotAdapter<'source, Boxplot>

Source

pub fn new( category: impl CategoryInput, values: impl NumericSeriesInput, ) -> Result<Self, AdapterError>

Bind categories and one or explicitly multiple sample variables.

Source

pub fn from_data( source: impl ArraySource + 'source, category: impl CategoryInput, values: impl NumericSeriesInput, ) -> Result<Self, AdapterError>

Bind source columns/direct samples; generated column identity supplies positioned series.

Source

pub fn columns(variables: impl ColumnsInput) -> Result<Self, AdapterError>

Use logical column identities as categories, with cells as observations.

Source

pub fn columns_from_data( source: impl ArraySource + 'source, columns: impl ColumnsInput, ) -> Result<Self, AdapterError>

Select ordered logical source columns for column-category distributions.

Source

pub fn numeric_columns_from_data( source: impl ArraySource + 'source, ) -> Result<Self, AdapterError>

Explicit numeric discovery on a homogeneous source uses all columns.

Source§

impl<'source> PlotAdapter<'source, Violin>

Source

pub fn new( category: impl CategoryInput, values: impl NumericSeriesInput, ) -> Result<Self, AdapterError>

Bind categories and one or explicitly multiple sample variables.

Source

pub fn from_data( source: impl ArraySource + 'source, category: impl CategoryInput, values: impl NumericSeriesInput, ) -> Result<Self, AdapterError>

Bind source columns/direct samples; generated column identity supplies positioned series.

Source

pub fn columns(variables: impl ColumnsInput) -> Result<Self, AdapterError>

Use logical column identities as categories, with cells as observations.

Source

pub fn columns_from_data( source: impl ArraySource + 'source, columns: impl ColumnsInput, ) -> Result<Self, AdapterError>

Select ordered logical source columns for column-category distributions.

Source

pub fn numeric_columns_from_data( source: impl ArraySource + 'source, ) -> Result<Self, AdapterError>

Explicit numeric discovery on a homogeneous source uses all columns.

Source§

impl<'source> PlotAdapter<'source, Raincloud>

Source

pub fn new( category: impl CategoryInput, values: impl NumericSeriesInput, ) -> Result<Self, AdapterError>

Bind categories and one or explicitly multiple sample variables.

Source

pub fn from_data( source: impl ArraySource + 'source, category: impl CategoryInput, values: impl NumericSeriesInput, ) -> Result<Self, AdapterError>

Bind source columns/direct samples; generated column identity supplies positioned series.

Source

pub fn columns(variables: impl ColumnsInput) -> Result<Self, AdapterError>

Use logical column identities as categories, with cells as observations.

Source

pub fn columns_from_data( source: impl ArraySource + 'source, columns: impl ColumnsInput, ) -> Result<Self, AdapterError>

Select ordered logical source columns for column-category distributions.

Source

pub fn numeric_columns_from_data( source: impl ArraySource + 'source, ) -> Result<Self, AdapterError>

Explicit numeric discovery on a homogeneous source uses all columns.

Source§

impl<K: Marker> PlotAdapter<'_, K>

Source

pub fn column_labels<I, S>(self, labels: I) -> Result<Self, AdapterError>
where I: IntoIterator<Item = S>, S: Into<String>,

Change selected/generated column labels without changing logical column identity.

Source

pub fn source_rows_cells( self, values: impl SourceRowsInput, ) -> Result<Self, AdapterError>
where K: SourceRows,

Bind already-expanded unique IDs without repeating any source row identity.

Source§

impl<K: Hue> PlotAdapter<'_, K>

Source

pub fn hue_columns(self) -> Result<Self, AdapterError>

Use the generated logical-column dimension in this native role.

Source

pub fn hue_cells(self, values: impl CategoryInput) -> Result<Self, AdapterError>

Bind explicitly expanded categories without source-row repetition.

Source§

impl<K: Group> PlotAdapter<'_, K>

Source

pub fn group_columns(self) -> Result<Self, AdapterError>

Use the generated logical-column dimension in this native role.

Source

pub fn group_cells( self, values: impl CategoryInput, ) -> Result<Self, AdapterError>

Bind explicitly expanded categories without source-row repetition.

Source§

impl<K: Series> PlotAdapter<'_, K>

Source

pub fn series_columns(self) -> Result<Self, AdapterError>

Use the generated logical-column dimension in this native role.

Source

pub fn series_cells( self, values: impl CategoryInput, ) -> Result<Self, AdapterError>

Bind explicitly expanded categories without source-row repetition.

Source§

impl<K: Facet> PlotAdapter<'_, K>

Source

pub fn facet_columns_row(self) -> Result<Self, AdapterError>

Facet rows by generated logical-column identity.

Source

pub fn facet_columns_column(self) -> Result<Self, AdapterError>

Facet columns by generated logical-column identity.

Source

pub fn facet_columns_wrap(self, columns: usize) -> Result<Self, AdapterError>

Wrap the generated logical-column dimension.

Source

pub fn facet_row_cells( self, values: impl CategoryInput, ) -> Result<Self, AdapterError>

Facet rows by explicitly expanded categorical slots.

Source

pub fn facet_column_cells( self, values: impl CategoryInput, ) -> Result<Self, AdapterError>

Facet columns by explicitly expanded categorical slots.

Source

pub fn facet_wrap_cells( self, values: impl CategoryInput, columns: usize, ) -> Result<Self, AdapterError>

Wrap explicitly expanded categorical slots.

Source§

impl<K: Facet> PlotAdapter<'_, K>

Source

pub fn facet_grid_row_cells( self, row: impl CategoryInput, column: impl CategoryInput, ) -> Result<Self, AdapterError>

Cross explicitly row/cell-scoped facets, never inferring scope from length.

Source§

impl<K: Facet> PlotAdapter<'_, K>

Source

pub fn facet_grid_column_cells( self, row: impl CategoryInput, column: impl CategoryInput, ) -> Result<Self, AdapterError>

Cross explicitly row/cell-scoped facets, never inferring scope from length.

Source§

impl<K: Facet> PlotAdapter<'_, K>

Source

pub fn facet_grid_cells( self, row: impl CategoryInput, column: impl CategoryInput, ) -> Result<Self, AdapterError>

Cross explicitly row/cell-scoped facets, never inferring scope from length.

Source§

impl<K: Facet> PlotAdapter<'_, K>

Source

pub fn facet_grid_columns_row( self, other: impl CategoryInput, ) -> Result<Self, AdapterError>

Cross generated column identity with an explicitly scoped external facet.

Source§

impl<K: Facet> PlotAdapter<'_, K>

Source

pub fn facet_grid_columns_column( self, other: impl CategoryInput, ) -> Result<Self, AdapterError>

Cross generated column identity with an explicitly scoped external facet.

Source§

impl<K: Facet> PlotAdapter<'_, K>

Source

pub fn facet_grid_columns_row_cells( self, other: impl CategoryInput, ) -> Result<Self, AdapterError>

Cross generated column identity with an explicitly scoped external facet.

Source§

impl<K: Facet> PlotAdapter<'_, K>

Source

pub fn facet_grid_columns_column_cells( self, other: impl CategoryInput, ) -> Result<Self, AdapterError>

Cross generated column identity with an explicitly scoped external facet.

Source§

impl<'source, K: Marker> PlotAdapter<'source, K>

Source

pub fn into_parts(self) -> (Plot<K>, BindingMetadata<K>)

End source lookup and move out the native Plot with its binding metadata.

This does not render, prepare scientific data or retain the source borrow. Keep both returned values from the same configuration together.

use lichtung_plot_ndarray::{Scatter, plots::PlotKind};
use ndarray::array;

let (plot, metadata) = {
    let source = array![[0., 1.], [1., 0.]];
    let adapted = Scatter::from_data(source.view(), 0, 1)?;
    adapted.into_parts()
};
let restored = Scatter::from_parts(plot, metadata);
assert_eq!(restored.kind(), PlotKind::Scatter);
Source

pub fn kind(&self) -> PlotKind

Inspect the native exact family without erasing it.

Source

pub fn labels(self, labels: Labels) -> Self

Replace the authored label policy, retaining captured variable identities.

Examples found in repository?
examples/strided_heatmap.rs (line 61)
11fn main() -> Result<(), Box<dyn std::error::Error>> {
12    let mut arguments = std::env::args_os().skip(1);
13    let directory = match arguments.next() {
14        Some(path) if !path.is_empty() => std::path::PathBuf::from(path),
15        Some(_) => return Err("output directory must not be empty".into()),
16        None => std::env::current_dir()?,
17    };
18    if arguments.next().is_some() {
19        return Err("usage: strided_heatmap [output-directory]".into());
20    }
21    std::fs::create_dir_all(&directory)?;
22    // ANCHOR: strided-values
23    // Interleaved quality-control columns are deliberately excluded by the view.
24    let measurements = array![
25        [0.2, 99.0, 0.8, 99.0, 1.4, 99.0, 1.7, 99.0],
26        [0.1, 99.0, 0.6, 99.0, 1.1, 99.0, 1.3, 99.0],
27        [-0.1, 99.0, -0.5, 99.0, -0.9, 99.0, -1.4, 99.0],
28        [0.0, 99.0, 0.3, 99.0, 0.9, 99.0, 1.2, 99.0],
29    ];
30    let times = ["0 h", "2 h", "6 h", "12 h"];
31    let programs = [
32        "Inflammation",
33        "Stress response",
34        "Cell cycle",
35        "DNA repair",
36    ];
37    let present = array![
38        [true, true, true, true],
39        [true, true, true, true],
40        [true, false, true, true],
41        [true, true, true, true],
42    ];
43    let highlights = array![
44        [false, false, false, true],
45        [false, false, false, false],
46        [false, false, false, true],
47        [false, false, false, false],
48    ];
49    let cell_ids = array![
50        [101u64, 102, 103, 104],
51        [105, 106, 107, 108],
52        [109, 110, 111, 112],
53        [113, 114, 115, 116]
54    ];
55    let heatmap = nd::Heatmap::new((measurements.slice(s![.., ..;2]), present.view()))?
56        .highlight_cells(highlights.view())?
57        .source_rows(cell_ids.view())?;
58    // ANCHOR_END: strided-values
59    // ANCHOR: strided-plot
60    heatmap
61        .labels(Labels::raw())
62        .x_labels(times)?
63        .y_labels(programs)?
64        .x_label("Time after stimulus")
65        .y_label("Response program")
66        .color_label("Response (log2 fold change)")
67        .continuous_color_scale(ContinuousColorScale::diverging(
68            0.0,
69            None,
70            Some(ColorDomain::exact(-2.0, 2.0)?),
71        )?)
72        .size(780, 480)
73        .title("Response programs from a strided assay matrix")
74        .caption("Synthetic illustration · alternate source columns · one missing cell · no inferred clustering")
75        .svg(directory.join("strided_heatmap.svg"))?
76        .svg_preserve_text(directory.join("strided_heatmap_text.svg"))?;
77    // ANCHOR_END: strided-plot
78    Ok(())
79}
Source

pub fn source_rows( self, values: impl SourceRowsInput, ) -> Result<Self, AdapterError>
where K: SourceRows,

Bind unique exact IDs, never repeating row IDs across expanded cells.

Examples found in repository?
examples/strided_heatmap.rs (line 57)
11fn main() -> Result<(), Box<dyn std::error::Error>> {
12    let mut arguments = std::env::args_os().skip(1);
13    let directory = match arguments.next() {
14        Some(path) if !path.is_empty() => std::path::PathBuf::from(path),
15        Some(_) => return Err("output directory must not be empty".into()),
16        None => std::env::current_dir()?,
17    };
18    if arguments.next().is_some() {
19        return Err("usage: strided_heatmap [output-directory]".into());
20    }
21    std::fs::create_dir_all(&directory)?;
22    // ANCHOR: strided-values
23    // Interleaved quality-control columns are deliberately excluded by the view.
24    let measurements = array![
25        [0.2, 99.0, 0.8, 99.0, 1.4, 99.0, 1.7, 99.0],
26        [0.1, 99.0, 0.6, 99.0, 1.1, 99.0, 1.3, 99.0],
27        [-0.1, 99.0, -0.5, 99.0, -0.9, 99.0, -1.4, 99.0],
28        [0.0, 99.0, 0.3, 99.0, 0.9, 99.0, 1.2, 99.0],
29    ];
30    let times = ["0 h", "2 h", "6 h", "12 h"];
31    let programs = [
32        "Inflammation",
33        "Stress response",
34        "Cell cycle",
35        "DNA repair",
36    ];
37    let present = array![
38        [true, true, true, true],
39        [true, true, true, true],
40        [true, false, true, true],
41        [true, true, true, true],
42    ];
43    let highlights = array![
44        [false, false, false, true],
45        [false, false, false, false],
46        [false, false, false, true],
47        [false, false, false, false],
48    ];
49    let cell_ids = array![
50        [101u64, 102, 103, 104],
51        [105, 106, 107, 108],
52        [109, 110, 111, 112],
53        [113, 114, 115, 116]
54    ];
55    let heatmap = nd::Heatmap::new((measurements.slice(s![.., ..;2]), present.view()))?
56        .highlight_cells(highlights.view())?
57        .source_rows(cell_ids.view())?;
58    // ANCHOR_END: strided-values
59    // ANCHOR: strided-plot
60    heatmap
61        .labels(Labels::raw())
62        .x_labels(times)?
63        .y_labels(programs)?
64        .x_label("Time after stimulus")
65        .y_label("Response program")
66        .color_label("Response (log2 fold change)")
67        .continuous_color_scale(ContinuousColorScale::diverging(
68            0.0,
69            None,
70            Some(ColorDomain::exact(-2.0, 2.0)?),
71        )?)
72        .size(780, 480)
73        .title("Response programs from a strided assay matrix")
74        .caption("Synthetic illustration · alternate source columns · one missing cell · no inferred clustering")
75        .svg(directory.join("strided_heatmap.svg"))?
76        .svg_preserve_text(directory.join("strided_heatmap_text.svg"))?;
77    // ANCHOR_END: strided-plot
78    Ok(())
79}
Source

pub fn facet(self, facet: FacetSpec) -> Self
where K: Facet,

Apply a complete native facet without reinterpreting its slots.

Source

pub fn facet_row(self, values: impl CategoryInput) -> Result<Self, AdapterError>
where K: Facet,

Split panel rows by a row-scoped categorical variable.

Source

pub fn facet_column( self, values: impl CategoryInput, ) -> Result<Self, AdapterError>
where K: Facet,

Split panel columns by a row-scoped categorical variable.

Source

pub fn facet_grid( self, row: impl CategoryInput, column: impl CategoryInput, ) -> Result<Self, AdapterError>
where K: Facet,

Cross two row-scoped categorical variables, replacing the complete facet.

Source

pub fn facet_wrap( self, values: impl CategoryInput, columns: usize, ) -> Result<Self, AdapterError>
where K: Facet,

Wrap a row-scoped categorical variable into a positive number of columns.

Source

pub fn facet_scales(self, scales: FacetScales) -> Result<Self, AdapterError>
where K: Facet,

Change scale sharing on an existing facet; each new facet resets this policy.

Source§

impl<K: Marker> PlotAdapter<'static, K>

Source

pub fn from_parts(plot: Plot<K>, metadata: BindingMetadata<K>) -> Self

Restore a native Plot and its metadata without a lookup source.

No scientific validation or version check runs here. The caller must supply the matching Plot/metadata configuration; the family marker alone does not establish that they came from the same version. Direct variable bindings remain available; selectors need an explicit source through Self::from_parts_with_data.

Metadata from another family cannot be paired with this Plot:

ⓘ
use lichtung_plot_ndarray::{kind, Plot, Scatter, binding::BindingMetadata};

fn wrong_family(plot: Plot<kind::Scatter>, metadata: BindingMetadata<kind::Line>) {
    let _ = Scatter::from_parts(plot, metadata);
}
Source

pub fn from_parts_with_data<'source>( plot: Plot<K>, metadata: BindingMetadata<K>, source: impl ArraySource + 'source, ) -> Result<PlotAdapter<'source, K>, AdapterError>

Restore a matching Plot/metadata pair with a new array lookup context.

Validates the source’s structural validity shape exactly as from_data does, without rebinding existing values, rendering or scientific preflight. The source height need not equal the old Plot’s slots; subsequent bindings retain their existing domain-specific alignment checks.

The caller must keep the Plot and metadata from the same configuration.

Source§

impl<K: Hue> PlotAdapter<'_, K>

Source

pub fn hue(self, values: impl CategoryInput) -> Result<Self, AdapterError>

Bind row-scoped native hue from a column or categorical vector.

Source§

impl<K: Group> PlotAdapter<'_, K>

Source

pub fn group(self, values: impl CategoryInput) -> Result<Self, AdapterError>

Bind row-scoped native group from a column or categorical vector.

Source§

impl<K: Series> PlotAdapter<'_, K>

Source

pub fn series(self, values: impl CategoryInput) -> Result<Self, AdapterError>

Bind row-scoped native series from a column or categorical vector.

Source§

impl<K: ExactFamily> PlotAdapter<'_, K>

Source

pub fn erase(self) -> Plot<Any>

End source lookup and return the native erased plot.

Source§

impl<K: Significance<Attached>> PlotAdapter<'_, K>

Source

pub fn significance_attached( self, target: impl SignificanceTargets, marks: impl SignificanceMarks, ) -> Result<Self, AdapterError>

Bind results independently of the primary observation count and append in supplied order.

Source

pub fn significance_attached_from_data( self, source: impl ArraySource, target: impl SignificanceTargets, marks: impl SignificanceMarks, ) -> Result<Self, AdapterError>

Append results from a separate actual source capture.

Source§

impl<K: Significance<Attached>> PlotAdapter<'_, K>

Source

pub fn significance_attached_in_facet( self, target: impl SignificanceTargets, marks: impl SignificanceMarks, facet: impl SignificanceFacets, ) -> Result<Self, AdapterError>

Bind results independently of the primary observation count and append in supplied order.

Source

pub fn significance_attached_in_facet_from_data( self, source: impl ArraySource, target: impl SignificanceTargets, marks: impl SignificanceMarks, facet: impl SignificanceFacets, ) -> Result<Self, AdapterError>

Append results from a separate actual source capture.

Source§

impl<K: Significance<Attached>> PlotAdapter<'_, K>

Source

pub fn significance_attached_in_grid( self, target: impl SignificanceTargets, marks: impl SignificanceMarks, row: impl CategoryInput, column: impl CategoryInput, ) -> Result<Self, AdapterError>

Bind results independently of the primary observation count and append in supplied order.

Source

pub fn significance_attached_in_grid_from_data( self, source: impl ArraySource, target: impl SignificanceTargets, marks: impl SignificanceMarks, row: impl CategoryInput, column: impl CategoryInput, ) -> Result<Self, AdapterError>

Append results from a separate actual source capture.

Source§

impl<K: Significance<Pairwise>> PlotAdapter<'_, K>

Source

pub fn significance_pairwise( self, left: impl SignificanceTargets, right: impl SignificanceTargets, marks: impl SignificanceMarks, ) -> Result<Self, AdapterError>

Bind results independently of the primary observation count and append in supplied order.

Source

pub fn significance_pairwise_from_data( self, source: impl ArraySource, left: impl SignificanceTargets, right: impl SignificanceTargets, marks: impl SignificanceMarks, ) -> Result<Self, AdapterError>

Append results from a separate actual source capture.

Source§

impl<K: Significance<Pairwise>> PlotAdapter<'_, K>

Source

pub fn significance_pairwise_in_facet( self, left: impl SignificanceTargets, right: impl SignificanceTargets, marks: impl SignificanceMarks, facet: impl SignificanceFacets, ) -> Result<Self, AdapterError>

Bind results independently of the primary observation count and append in supplied order.

Source

pub fn significance_pairwise_in_facet_from_data( self, source: impl ArraySource, left: impl SignificanceTargets, right: impl SignificanceTargets, marks: impl SignificanceMarks, facet: impl SignificanceFacets, ) -> Result<Self, AdapterError>

Append results from a separate actual source capture.

Source§

impl<K: Significance<Pairwise>> PlotAdapter<'_, K>

Source

pub fn significance_pairwise_in_grid( self, left: impl SignificanceTargets, right: impl SignificanceTargets, marks: impl SignificanceMarks, row: impl CategoryInput, column: impl CategoryInput, ) -> Result<Self, AdapterError>

Bind results independently of the primary observation count and append in supplied order.

Source

pub fn significance_pairwise_in_grid_from_data( self, source: impl ArraySource, left: impl SignificanceTargets, right: impl SignificanceTargets, marks: impl SignificanceMarks, row: impl CategoryInput, column: impl CategoryInput, ) -> Result<Self, AdapterError>

Append results from a separate actual source capture.

Trait Implementations§

Source§

impl<'source, K: Clone + Marker> Clone for PlotAdapter<'source, K>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<K: Marker> From<PlotAdapter<'_, K>> for Plot<K>

Source§

fn from(adapter: PlotAdapter<'_, K>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'source, K> !RefUnwindSafe for PlotAdapter<'source, K>

§

impl<'source, K> !Send for PlotAdapter<'source, K>

§

impl<'source, K> !Sync for PlotAdapter<'source, K>

§

impl<'source, K> !UnwindSafe for PlotAdapter<'source, K>

§

impl<'source, K> Forget for PlotAdapter<'source, K>

§

impl<'source, K> Freeze for PlotAdapter<'source, K>
where *const ArcInner<()> is !null: Freeze, PhantomData<ArcInner<()>>: Freeze, *const ArcInner<String> is !null: Freeze, PhantomData<ArcInner<String>>: Freeze, *const ArcInner<Vec<FontFamily>> is !null: Freeze, PhantomData<ArcInner<Vec<FontFamily>>>: Freeze, *const ArcInner<TextInstructions> is !null: Freeze, PhantomData<ArcInner<TextInstructions>>: Freeze, *const ArcInner<SharedPayload> is !null: Freeze, PhantomData<ArcInner<SharedPayload>>: Freeze, PhantomData<K>: Freeze, *const RcInner<dyn ArraySource + 'source> is !null: Freeze, PhantomData<RcInner<dyn ArraySource + 'source>>: Freeze, *const ArcInner<BTreeMap<String, String>> is !null: Freeze, PhantomData<ArcInner<BTreeMap<String, String>>>: Freeze, *const ArcInner<BTreeMap<String, CapturedLabel>> is !null: Freeze, PhantomData<ArcInner<BTreeMap<String, CapturedLabel>>>: Freeze, *const ArcInner<str> is !null: Freeze, PhantomData<ArcInner<str>>: Freeze, *const ArcInner<[String]> is !null: Freeze, PhantomData<ArcInner<[String]>>: Freeze, *const ArcInner<[u32]> is !null: Freeze, PhantomData<ArcInner<[u32]>>: Freeze, *const ArcInner<[u64]> is !null: Freeze, PhantomData<ArcInner<[u64]>>: Freeze, *const ArcInner<KeyValues> is !null: Freeze, PhantomData<ArcInner<KeyValues>>: Freeze, *const ArcInner<(RawKey, Arc<str>)> is !null: Freeze, PhantomData<ArcInner<(RawKey, Arc<str>)>>: Freeze, *const ArcInner<SourceInfo> is !null: Freeze, PhantomData<ArcInner<SourceInfo>>: Freeze, *const ArcInner<SourceProjection> is !null: Freeze, PhantomData<ArcInner<SourceProjection>>: Freeze, *const u8 is !null: Freeze, PhantomData<String>: Freeze, PhantomData<usize>: Freeze, PhantomData<u8>: Freeze, PhantomData<RawKey>: Freeze, PhantomData<(String, String)>: Freeze,

§

impl<'source, K> Move for PlotAdapter<'source, K>

§

impl<'source, K> Unpin for PlotAdapter<'source, K>
where K: Unpin, Arc<()>: Unpin, Arc<String>: Unpin, Arc<Vec<FontFamily>>: Unpin, Arc<TextInstructions>: Unpin, Arc<SharedPayload>: Unpin, Rc<dyn ArraySource + 'source>: Unpin, Arc<BTreeMap<String, String>>: Unpin, Arc<BTreeMap<String, CapturedLabel>>: Unpin, Arc<str>: Unpin, Arc<[String]>: Unpin, Arc<[u32]>: Unpin, Arc<[u64]>: Unpin, Arc<KeyValues>: Unpin, Arc<(RawKey, Arc<str>)>: Unpin, Arc<SourceInfo>: Unpin, Arc<SourceProjection>: Unpin, *const u8 is !null: Unpin, Arc<[u8]>: Unpin, Box<RawKey>: Unpin,

§

impl<'source, K> UnsafeUnpin for PlotAdapter<'source, K>
where *const ArcInner<()> is !null: UnsafeUnpin, PhantomData<ArcInner<()>>: UnsafeUnpin, *const ArcInner<String> is !null: UnsafeUnpin, PhantomData<ArcInner<String>>: UnsafeUnpin, *const ArcInner<Vec<FontFamily>> is !null: UnsafeUnpin, PhantomData<ArcInner<Vec<FontFamily>>>: UnsafeUnpin, *const ArcInner<TextInstructions> is !null: UnsafeUnpin, PhantomData<ArcInner<TextInstructions>>: UnsafeUnpin, *const ArcInner<SharedPayload> is !null: UnsafeUnpin, PhantomData<ArcInner<SharedPayload>>: UnsafeUnpin, PhantomData<K>: UnsafeUnpin, *const RcInner<dyn ArraySource + 'source> is !null: UnsafeUnpin, PhantomData<RcInner<dyn ArraySource + 'source>>: UnsafeUnpin, *const ArcInner<BTreeMap<String, String>> is !null: UnsafeUnpin, PhantomData<ArcInner<BTreeMap<String, String>>>: UnsafeUnpin, *const ArcInner<BTreeMap<String, CapturedLabel>> is !null: UnsafeUnpin, PhantomData<ArcInner<BTreeMap<String, CapturedLabel>>>: UnsafeUnpin, *const ArcInner<str> is !null: UnsafeUnpin, PhantomData<ArcInner<str>>: UnsafeUnpin, *const ArcInner<[String]> is !null: UnsafeUnpin, PhantomData<ArcInner<[String]>>: UnsafeUnpin, *const ArcInner<[u32]> is !null: UnsafeUnpin, PhantomData<ArcInner<[u32]>>: UnsafeUnpin, *const ArcInner<[u64]> is !null: UnsafeUnpin, PhantomData<ArcInner<[u64]>>: UnsafeUnpin, *const ArcInner<KeyValues> is !null: UnsafeUnpin, PhantomData<ArcInner<KeyValues>>: UnsafeUnpin, *const ArcInner<(RawKey, Arc<str>)> is !null: UnsafeUnpin, PhantomData<ArcInner<(RawKey, Arc<str>)>>: UnsafeUnpin, *const ArcInner<SourceInfo> is !null: UnsafeUnpin, PhantomData<ArcInner<SourceInfo>>: UnsafeUnpin, *const ArcInner<SourceProjection> is !null: UnsafeUnpin, PhantomData<ArcInner<SourceProjection>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<String>: UnsafeUnpin, PhantomData<usize>: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, PhantomData<RawKey>: UnsafeUnpin, PhantomData<(String, String)>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V