pub struct ChartState { /* private fields */ }Expand description
Minimal mutable state shared between render frames in interactive mode.
The goal is not to be a full chart implementation – the existing Chart
struct already handles that. Instead this type acts as a convenient
scratch-pad that front-ends can own and mutate while delegating heavy work
to Chart.
Note: Data management is the responsibility of the frontend. This state only tracks interaction state (pan, zoom, etc.).
Implementations§
Source§impl ChartState
impl ChartState
pub fn new() -> Self
Sourcepub fn handle_event(&mut self, ev: ChartEvent)
pub fn handle_event(&mut self, ev: ChartEvent)
Front-ends call this whenever an interaction happens.
Sourcepub fn check_needs_redraw(&mut self) -> bool
pub fn check_needs_redraw(&mut self) -> bool
True if something changed since the last time the flag was queried.
Sourcepub fn reset_zoom(&mut self)
pub fn reset_zoom(&mut self)
Reset zoom factor to 1.0.
Trait Implementations§
Source§impl Clone for ChartState
impl Clone for ChartState
Source§fn clone(&self) -> ChartState
fn clone(&self) -> ChartState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ChartState
impl RefUnwindSafe for ChartState
impl Send for ChartState
impl Sync for ChartState
impl Unpin for ChartState
impl UnsafeUnpin for ChartState
impl UnwindSafe for ChartState
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