pub struct EuvChartState { /* private fields */ }Expand description
Mutable interactive runtime state governing legend toggles, zoom window, magic-type, data-view, pie pop-out, and hover pointer.
Implementations§
Source§impl EuvChartState
Interactive state transitions for EuvChartState.
impl EuvChartState
Interactive state transitions for EuvChartState.
Sourcepub fn from_option(option: &EuvChartOption) -> Self
pub fn from_option(option: &EuvChartOption) -> Self
Sourcepub fn is_series_visible(&self, name: &str) -> bool
pub fn is_series_visible(&self, name: &str) -> bool
Sourcepub fn toggle_series(&mut self, name: &str) -> bool
pub fn toggle_series(&mut self, name: &str) -> bool
Sourcepub fn set_zoom(&mut self, start_pct: f32, end_pct: f32, min_span_pct: f32)
pub fn set_zoom(&mut self, start_pct: f32, end_pct: f32, min_span_pct: f32)
Sets the active zoom percentage window [start_pct, end_pct] respecting min_span_pct.
§Arguments
&Self- Mutable chart state.f32- Requested lower percentage.f32- Requested upper percentage.f32- Minimum allowed span percentage.
Sourcepub fn zoom_by_wheel(
&mut self,
wheel_delta: f32,
anchor_frac: f32,
min_span_pct: f32,
) -> bool
pub fn zoom_by_wheel( &mut self, wheel_delta: f32, anchor_frac: f32, min_span_pct: f32, ) -> bool
Zooms the active window centered around normalized plot cursor anchor_frac in [0.0, 1.0].
§Arguments
&Self- Mutable chart state.f32- Wheel delta (negative zooms in, positive zooms out).f32- Normalized horizontal cursor position in[0.0, 1.0].f32- Minimum allowed span percentage.
§Returns
bool- True when the zoom window changed.
Sourcepub fn pan_by_pct(&mut self, delta_pct: f32) -> bool
pub fn pan_by_pct(&mut self, delta_pct: f32) -> bool
Sourcepub fn cycle_magic_type(&mut self) -> EuvChartMagicType
pub fn cycle_magic_type(&mut self) -> EuvChartMagicType
Sourcepub fn toggle_data_view(&mut self) -> bool
pub fn toggle_data_view(&mut self) -> bool
Sourcepub fn toggle_pie_slice(&mut self, idx: usize)
pub fn toggle_pie_slice(&mut self, idx: usize)
Toggles radial pop-out selection for pie slice idx.
§Arguments
&Self- Mutable chart state.usize- Clicked slice index.
Sourcepub fn restore(&mut self, option: &EuvChartOption)
pub fn restore(&mut self, option: &EuvChartOption)
Restores legend visibility, zoom bounds, magic type, pie selection, and data-view back to option defaults.
§Arguments
&Self- Mutable chart state.&EuvChartOption- Declarative chart option defaults.
Sourcepub fn without_hover(&self) -> Self
pub fn without_hover(&self) -> Self
Sourcepub fn selected_pie_slice_opt(&self) -> Option<usize>
pub fn selected_pie_slice_opt(&self) -> Option<usize>
Source§impl EuvChartState
impl EuvChartState
pub fn get_zoom_start_pct(&self) -> f32
pub fn get_mut_zoom_start_pct(&mut self) -> &mut f32
pub fn set_zoom_start_pct(&mut self, val: f32) -> &mut Self
pub fn get_zoom_end_pct(&self) -> f32
pub fn get_mut_zoom_end_pct(&mut self) -> &mut f32
pub fn set_zoom_end_pct(&mut self, val: f32) -> &mut Self
pub fn get_magic_type(&self) -> EuvChartMagicType
pub fn get_mut_magic_type(&mut self) -> &mut EuvChartMagicType
pub fn set_magic_type(&mut self, val: EuvChartMagicType) -> &mut Self
pub fn get_data_view_open(&self) -> bool
pub fn get_mut_data_view_open(&mut self) -> &mut bool
pub fn set_data_view_open(&mut self, val: bool) -> &mut Self
pub fn get_mut_selected_pie_slice(&mut self) -> &mut Option<usize>
pub fn set_selected_pie_slice(&mut self, val: Option<usize>) -> &mut Self
pub fn get_mut_hover_pos(&mut self) -> &mut Option<Point>
pub fn set_hover_pos(&mut self, val: Option<Point>) -> &mut Self
Trait Implementations§
Source§impl Clone for EuvChartState
impl Clone for EuvChartState
Source§impl Debug for EuvChartState
impl Debug for EuvChartState
Source§impl Default for EuvChartState
Default neutral interactive state spanning 0%..=100% with all series visible.
impl Default for EuvChartState
Default neutral interactive state spanning 0%..=100% with all series visible.
Source§impl PartialEq for EuvChartState
impl PartialEq for EuvChartState
impl StructuralPartialEq for EuvChartState
Auto Trait Implementations§
impl Forget for EuvChartState
impl Freeze for EuvChartState
impl Move for EuvChartState
impl RefUnwindSafe for EuvChartState
impl Send for EuvChartStatewhere
RawVecInner: Send,
impl Sync for EuvChartStatewhere
RawVecInner: Sync,
impl Unpin for EuvChartState
impl UnsafeUnpin for EuvChartState
impl UnwindSafe for EuvChartStatewhere
RawVecInner: UnwindSafe,
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