pub struct HeatmapView {
pub title: String,
pub rows: usize,
pub cols: usize,
pub data: Vec<f64>,
pub row_labels: Vec<String>,
pub col_labels: Vec<String>,
pub diverging: bool,
}Expand description
A dense matrix in row-major order with optional axis labels.
Fields§
§title: String§rows: usize§cols: usize§data: Vec<f64>Row-major: data[r * cols + c].
row_labels: Vec<String>§col_labels: Vec<String>§diverging: boolUse the diverging ramp (around a midpoint) instead of sequential.
Implementations§
Source§impl HeatmapView
impl HeatmapView
pub fn new( title: impl Into<String>, rows: usize, cols: usize, data: Vec<f64>, ) -> Self
pub fn with_labels(self, rows: Vec<String>, cols: Vec<String>) -> Self
pub fn diverging(self) -> Self
Sourcepub fn get(&self, row: usize, col: usize) -> Option<f64>
pub fn get(&self, row: usize, col: usize) -> Option<f64>
Value at (row, col), or None if out of bounds / ragged data.
Sourcepub fn value_range(&self) -> Option<(f64, f64)>
pub fn value_range(&self) -> Option<(f64, f64)>
(min, max) over the finite cells.
Trait Implementations§
Source§impl Facet for HeatmapView
impl Facet for HeatmapView
fn title(&self) -> &str
Source§fn copy(&mut self) -> Option<String>
fn copy(&mut self) -> Option<String>
Clipboard hooks — see clipboard.rs. Defaults: nothing to give/take.
Returns the text to place on the clipboard (None = nothing copyable now).
fn ui(&mut self, ui: &mut Ui)
fn state_json(&self) -> Value
Source§fn set_scale(&mut self, _scale: f32)
fn set_scale(&mut self, _scale: f32)
Set the uniform scale; clamp internally. Default no-op (not scalable).
Source§fn selection_json(&self) -> Value
fn selection_json(&self) -> Value
The current selection as JSON (also folded into
state_json by
convention). Null when nothing/none selectable.Source§fn cut(&mut self) -> Option<String>
fn cut(&mut self) -> Option<String>
Like
copy, but also removes the selection. Default delegates to copy.Source§fn as_any_mut(&mut self) -> Option<&mut (dyn Any + 'static)>
fn as_any_mut(&mut self) -> Option<&mut (dyn Any + 'static)>
Optional downcast handle for hosts that need typed access to a specific
facet living inside a
FacetDeck (e.g. a robot-UI driver clicking an
app-level control that must forward to a concrete component’s own API).
Defaulted to None so no existing facet has to change; a component opts in
by returning Some(self).Auto Trait Implementations§
impl Freeze for HeatmapView
impl RefUnwindSafe for HeatmapView
impl Send for HeatmapView
impl Sync for HeatmapView
impl Unpin for HeatmapView
impl UnsafeUnpin for HeatmapView
impl UnwindSafe for HeatmapView
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more