Skip to main content

EuvChartAxisScale

Struct EuvChartAxisScale 

Source
pub struct EuvChartAxisScale { /* private fields */ }
Expand description

Resolved numeric, category, time, or logarithmic axis scale ready for pixel projection.

Implementations§

Source§

impl EuvChartAxisScale

Projection and inverse-mapping methods for EuvChartAxisScale.

Source

pub fn normalize(&self, value: f32) -> f32

Normalizes a domain value into [0.0, 1.0] respecting Category, Value, Time, Log, and inverse.

§Arguments
  • &Self - Computed axis scale.
  • f32 - Domain value or category index.
§Returns
  • f32 - Normalized coordinate in [0.0, 1.0] (unclamped when outside range).
Source

pub fn map_x(&self, value: f32, plot_rect: Rect) -> f32

Projects a domain value onto a horizontal pixel coordinate inside plot_rect.

§Arguments
  • &Self - Horizontal axis scale.
  • f32 - Domain value or category index.
  • Rect - Target plot rectangle.
§Returns
  • f32 - Logical X pixel coordinate.
Source

pub fn map_y(&self, value: f32, plot_rect: Rect) -> f32

Projects a domain value onto a vertical pixel coordinate inside plot_rect (bottom-up for numeric axes, top-down for category bars).

§Arguments
  • &Self - Vertical axis scale.
  • f32 - Domain value or category index.
  • Rect - Target plot rectangle.
§Returns
  • f32 - Logical Y pixel coordinate.
Source

pub fn baseline_y(&self, plot_rect: Rect) -> f32

Returns the baseline pixel Y corresponding to 0.0 (clamped inside plot_rect).

§Arguments
  • &Self - Vertical numeric axis scale.
  • Rect - Target plot rectangle.
§Returns
  • f32 - Baseline Y coordinate in logical pixels.
Source

pub fn baseline_x(&self, plot_rect: Rect) -> f32

Returns the baseline pixel X corresponding to 0.0 (clamped inside plot_rect) for horizontal bar charts.

§Arguments
  • &Self - Horizontal numeric axis scale.
  • Rect - Target plot rectangle.
§Returns
  • f32 - Baseline X coordinate in logical pixels.
Source

pub fn visible_slot_count(&self) -> f32

Returns the continuous visible category slot count for stable candle/bar width computation during panning.

§Arguments
  • &Self - Axis scale reference.
§Returns
  • f32 - Positive visible category slot count.
Source

pub fn category_label_at(&self, global_idx: usize) -> Option<&str>

Resolves the category label for a global sample index when inside the active slice.

§Arguments
  • &Self - Category axis scale reference.
  • usize - Global zero-based category index.
§Returns
  • Option<&str> - Matching category label when available.
Source§

impl EuvChartAxisScale

Source

pub fn get_axis_type(&self) -> EuvChartAxisType

Source

pub fn get_mut_axis_type(&mut self) -> &mut EuvChartAxisType

Source

pub fn set_axis_type(&mut self, val: EuvChartAxisType) -> &mut Self

Source

pub fn get_min(&self) -> f32

Source

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

Source

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

Source

pub fn get_max(&self) -> f32

Source

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

Source

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

Source

pub fn get_inverse(&self) -> bool

Source

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

Source

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

Source

pub fn get_ticks(&self) -> &Vec<f32>

Source

pub fn get_mut_ticks(&mut self) -> &mut Vec<f32>

Source

pub fn set_ticks(&mut self, val: Vec<f32>) -> &mut Self

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn get_window_start(&self) -> f32

Source

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

Source

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

Source

pub fn get_window_span(&self) -> f32

Source

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

Source

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

Source

pub fn get_category_base_index(&self) -> usize

Source

pub fn get_mut_category_base_index(&mut self) -> &mut usize

Source

pub fn set_category_base_index(&mut self, val: usize) -> &mut Self

Trait Implementations§

Source§

impl Clone for EuvChartAxisScale

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 EuvChartAxisScale

Source§

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

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

impl PartialEq for EuvChartAxisScale

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 EuvChartAxisScale

Auto Trait Implementations§

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.