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,
pub state: HeatmapState,
}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.
state: HeatmapStateObservable interaction state (FC-3).
Implementations§
Source§impl HeatmapView
impl HeatmapView
pub fn new( title: impl Into<String>, rows: usize, cols: usize, data: Vec<f64>, ) -> Self
Sourcepub fn state(&self) -> &HeatmapState
pub fn state(&self) -> &HeatmapState
FC-3: read the complete observable interaction state.
Sourcepub fn update(&mut self, msg: HeatmapMsg) -> Vec<HeatmapEffect>
pub fn update(&mut self, msg: HeatmapMsg) -> Vec<HeatmapEffect>
FC-2/FC-8: the single mutation path. Apply one HeatmapMsg; no effects.
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 CopySource for HeatmapView
impl CopySource for HeatmapView
Source§fn copy_kinds(&self) -> &[ClipKind]
fn copy_kinds(&self) -> &[ClipKind]
Source§fn copy_payload(&self) -> Option<ClipPayload>
fn copy_payload(&self) -> Option<ClipPayload>
Source§impl Elm for HeatmapView
impl Elm for HeatmapView
Source§type Model = HeatmapState
type Model = HeatmapState
Source§type Msg = HeatmapMsg
type Msg = HeatmapMsg
Model.Source§type Effect = HeatmapEffect
type Effect = HeatmapEffect
enum Effect {} when the component does no I/O.Source§fn title(&self) -> &str
fn title(&self) -> &str
Facet::title).Source§fn state(&self) -> &HeatmapState
fn state(&self) -> &HeatmapState
Source§fn update(&mut self, msg: HeatmapMsg) -> Vec<HeatmapEffect>
fn update(&mut self, msg: HeatmapMsg) -> Vec<HeatmapEffect>
Source§impl Facet for HeatmapView
impl Facet for HeatmapView
Source§fn component(&self) -> &'static str
fn component(&self) -> &'static str
The pane’s DEV-ID, derived with zero per-pane code: module_path!()
expands at the CALL site, so a bridged pane in facett-geomap reports
facett_geomap, which devid::normalize maps
to the registry component geomap. Override in the extras block to say
something else.
Source§fn ui(&mut self, ui: &mut Ui)
fn ui(&mut self, ui: &mut Ui)
FC-9: the view is pure (paints + emits Msgs); FC-2: mutation only
via update. The immediate-mode trait just bridges the two.
fn title(&self) -> &str
Source§fn copy(&mut self) -> Option<String>
fn copy(&mut self) -> Option<String>
fn state_json(&self) -> Value
Source§fn update_json(&mut self, _msg_json: &str)
fn update_json(&mut self, _msg_json: &str)
title/ui/state_json/update_json),
and it is defaulted to a no-op so it is purely ADDITIVE: every existing
impl Facet keeps compiling unchanged, while a facet that wants the writable
input surface overrides it (an Elm-backed facet routes the JSON through its
update). With this default in place Facet and Panel
share the same four-method shape, which is what lets the blanket
impl<T: Facet> Panel for T (see panel) make every
Facet a Panel for free. Unknown/undriven messages are ignored — the
default simply does nothing.fn severity(&self) -> Severity
Source§fn set_scale(&mut self, _scale: f32)
fn set_scale(&mut self, _scale: f32)
Source§fn scale_range(&self) -> (f32, f32)
fn scale_range(&self) -> (f32, f32)
[min, max], relative to native (1.0), that this facet’s uniform
scale may be driven over. FacetDeck::scale_active clamps into it. Read moreSource§fn selection_json(&self) -> Value
fn selection_json(&self) -> Value
state_json by
convention). Null when nothing/none selectable.Source§fn cut(&mut self) -> Option<String>
fn cut(&mut self) -> Option<String>
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)>
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).Source§fn kind(&self) -> &'static str
fn kind(&self) -> &'static str
"jobview", "graphpan", "table"). Two
instances with the same kind can exchange portable state; the empty
default "" means opted out of cross-instance clone.Source§fn portable_state(&self) -> Option<Value>
fn portable_state(&self) -> Option<Value>
None = not cloneable. Kept SEPARATE from
state_json (the introspection dump, which may carry
derived / render-only data) so this stays round-trippable through
load_state.Source§fn load_state(&mut self, _state: &Value) -> bool
fn load_state(&mut self, _state: &Value) -> bool
portable_state
on a same-kind sibling. Returns true if accepted. Default false
(opt-in per component).Auto Trait Implementations§
impl Forget for HeatmapView
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§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Panel for T
impl<T> Panel for T
Source§fn ui(&mut self, ui: &mut Ui)
fn ui(&mut self, ui: &mut Ui)
ui; the wasm
backend paints a decoded display-list; headless paints nothing.Source§fn state_json(&self) -> Value
fn state_json(&self) -> Value
Source§fn update_json(&mut self, msg_json: &str)
fn update_json(&mut self, msg_json: &str)
Source§fn severity(&self) -> Severity
fn severity(&self) -> Severity
Facet::severity; the blanket impl below forwards
to it. Defaulted to [Severity::Info](crate::Severity::Info) so it is
purely ADDITIVE — no existing Panel backend has to change. The Robot-UI
HARD GATE fails on any driven pane that returns
Severity::Error.Source§fn component(&self) -> &'static str
fn component(&self) -> &'static str
Facet::component;
the blanket impl below forwards to it. Defaulted to "" so it is purely
ADDITIVE — no existing Panel backend has to change.