Skip to main content

EuvChartState

Struct EuvChartState 

Source
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.

Source

pub fn from_option(option: &EuvChartOption) -> Self

Initializes chart interaction state from a declarative EuvChartOption.

§Arguments
  • &EuvChartOption - Declarative chart option.
§Returns
  • Self - Initialized state honoring initial series visibility and data-zoom range.
Source

pub fn is_series_visible(&self, name: &str) -> bool

Returns whether the series named name is currently visible.

§Arguments
  • &Self - Chart state.
  • &str - Series name.
§Returns
  • bool - True when visible.
Source

pub fn toggle_series(&mut self, name: &str) -> bool

Toggles visibility for name and returns its new visible boolean state.

§Arguments
  • &Self - Mutable chart state.
  • &str - Series name to toggle.
§Returns
  • bool - New visibility (true = now visible, false = now hidden).
Source

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.
Source

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.
Source

pub fn pan_by_pct(&mut self, delta_pct: f32) -> bool

Pans the active zoomed window horizontally by delta_pct while preserving span length.

§Arguments
  • &Self - Mutable chart state.
  • f32 - Percentage shift along the axis.
§Returns
  • bool - True when the zoom window moved.
Source

pub fn cycle_magic_type(&mut self) -> EuvChartMagicType

Cycles the toolbox MagicType override (Default -> Line -> Bar -> Stack -> Default).

§Arguments
  • &Self - Mutable chart state.
§Returns
  • EuvChartMagicType - Newly active MagicType mode.
Source

pub fn toggle_data_view(&mut self) -> bool

Toggles the tabular DataView panel open or closed.

§Arguments
  • &Self - Mutable chart state.
§Returns
  • bool - New open state.
Source

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.
Source

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.
Source

pub fn without_hover(&self) -> Self

Returns a copy of this chart state with hover_pos cleared for static base-layer paint caching.

§Arguments
  • &Self - Chart state reference.
§Returns
  • Self - Hover-independent chart state key.
Source

pub fn selected_pie_slice_opt(&self) -> Option<usize>

Returns the optional popped-out pie slice index.

§Arguments
  • &Self - Chart state.
§Returns
  • Option<usize> - Active popped-out slice index.
Source

pub fn hover_pos_opt(&self) -> Option<Point>

Returns the optional active hover pointer coordinate.

§Arguments
  • &Self - Chart state.
§Returns
  • Option<Point> - Pointer coordinate in logical canvas space.
Source§

impl EuvChartState

Source

pub fn get_hidden_series(&self) -> &Vec<String>

Source

pub fn get_mut_hidden_series(&mut self) -> &mut Vec<String>

Source

pub fn set_hidden_series(&mut self, val: Vec<String>) -> &mut Self

Source

pub fn get_zoom_start_pct(&self) -> f32

Source

pub fn get_mut_zoom_start_pct(&mut self) -> &mut f32

Source

pub fn set_zoom_start_pct(&mut self, val: f32) -> &mut Self

Source

pub fn get_zoom_end_pct(&self) -> f32

Source

pub fn get_mut_zoom_end_pct(&mut self) -> &mut f32

Source

pub fn set_zoom_end_pct(&mut self, val: f32) -> &mut Self

Source

pub fn get_magic_type(&self) -> EuvChartMagicType

Source

pub fn get_mut_magic_type(&mut self) -> &mut EuvChartMagicType

Source

pub fn set_magic_type(&mut self, val: EuvChartMagicType) -> &mut Self

Source

pub fn get_data_view_open(&self) -> bool

Source

pub fn get_mut_data_view_open(&mut self) -> &mut bool

Source

pub fn set_data_view_open(&mut self, val: bool) -> &mut Self

Source

pub fn get_mut_selected_pie_slice(&mut self) -> &mut Option<usize>

Source

pub fn set_selected_pie_slice(&mut self, val: Option<usize>) -> &mut Self

Source

pub fn get_mut_hover_pos(&mut self) -> &mut Option<Point>

Source

pub fn set_hover_pos(&mut self, val: Option<Point>) -> &mut Self

Trait Implementations§

Source§

impl Clone for EuvChartState

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EuvChartState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EuvChartState

Default neutral interactive state spanning 0%..=100% with all series visible.

Source§

fn default() -> Self

Creates an initial neutral chart interaction state.

§Returns
  • Self - Default chart state.
Source§

impl PartialEq for EuvChartState

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

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 EuvChartState
where RawVecInner: Send,

§

impl Sync for EuvChartState
where RawVecInner: Sync,

§

impl Unpin for EuvChartState
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for EuvChartState

§

impl UnwindSafe for EuvChartState
where RawVecInner: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.