pub struct StatsWidget { /* private fields */ }Expand description
A scrollable statistics table over a set of named items.
The widget holds only display configuration (update mode, on-limits toggle, last-computed rows); the data is borrowed at render time so the caller owns item storage. This keeps the widget free of GPU/plot state and makes the formatting and computation paths unit-testable.
Implementations§
Source§impl StatsWidget
impl StatsWidget
Sourcepub fn update_mode(&self) -> UpdateMode
pub fn update_mode(&self) -> UpdateMode
Current update mode.
Sourcepub fn set_update_mode(&mut self, mode: UpdateMode)
pub fn set_update_mode(&mut self, mode: UpdateMode)
Set the update mode (silx setUpdateMode).
Sourcepub fn on_visible_data(&self) -> bool
pub fn on_visible_data(&self) -> bool
Whether statistics are restricted to the visible data range.
Sourcepub fn set_on_visible_data(&mut self, value: bool)
pub fn set_on_visible_data(&mut self, value: bool)
Set whether to restrict statistics to the visible data range
(silx setStatsOnVisibleData).
Sourcepub fn request_update(&mut self)
pub fn request_update(&mut self)
Request a recompute on the next Self::recompute / Self::ui call,
regardless of update mode (silx manual update button).
Sourcepub fn recompute(
&mut self,
inputs: &[(&str, StatsInput<'_>)],
viewport: Option<((f64, f64), (f64, f64))>,
)
pub fn recompute( &mut self, inputs: &[(&str, StatsInput<'_>)], viewport: Option<((f64, f64), (f64, f64))>, )
Recompute the cached rows from the supplied inputs if needed.
In UpdateMode::Auto this always recomputes; in
UpdateMode::Manual it recomputes only when an update was requested.
viewport is the visible data rectangle ((x0, x1), (y0, y1)), used
only when on-visible-data is enabled.
Sourcepub fn ui(
&mut self,
ui: &mut Ui,
inputs: &[(&str, StatsInput<'_>)],
viewport: Option<((f64, f64), (f64, f64))>,
)
pub fn ui( &mut self, ui: &mut Ui, inputs: &[(&str, StatsInput<'_>)], viewport: Option<((f64, f64), (f64, f64))>, )
Render the toolbar (update-mode + visible-data toggles) and the table.
inputs is the current set of (label, data) items; viewport is the
visible data rectangle used when the on-visible-data toggle is on.
Trait Implementations§
Source§impl Clone for StatsWidget
impl Clone for StatsWidget
Source§fn clone(&self) -> StatsWidget
fn clone(&self) -> StatsWidget
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StatsWidget
impl Debug for StatsWidget
Source§impl Default for StatsWidget
impl Default for StatsWidget
Source§fn default() -> StatsWidget
fn default() -> StatsWidget
Auto Trait Implementations§
impl Freeze for StatsWidget
impl RefUnwindSafe for StatsWidget
impl Send for StatsWidget
impl Sync for StatsWidget
impl Unpin for StatsWidget
impl UnsafeUnpin for StatsWidget
impl UnwindSafe for StatsWidget
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.