pub struct ScalePoint { /* private fields */ }Implementations§
Source§impl ScalePoint
impl ScalePoint
pub fn new(domain: Vec<SharedString>, range: (f32, f32)) -> Self
Sourcepub fn from_len(domain_len: usize, range: (f32, f32)) -> Self
pub fn from_len(domain_len: usize, range: (f32, f32)) -> Self
Build an index-based point scale without cloning/storing every label. This is useful for dense native charts where label text is painted from a separate sparse axis-label list, while data points still need stable original-index positioning.
pub fn tick_index(&self, index: usize) -> Option<f32>
pub fn tick(&self, value: &SharedString) -> Option<f32>
Trait Implementations§
Source§impl Clone for ScalePoint
impl Clone for ScalePoint
Source§fn clone(&self) -> ScalePoint
fn clone(&self) -> ScalePoint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScalePoint
impl Debug for ScalePoint
Source§impl PartialEq for ScalePoint
impl PartialEq for ScalePoint
Source§fn eq(&self, other: &ScalePoint) -> bool
fn eq(&self, other: &ScalePoint) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ScalePoint
Auto Trait Implementations§
impl Freeze for ScalePoint
impl RefUnwindSafe for ScalePoint
impl Send for ScalePoint
impl Sync for ScalePoint
impl Unpin for ScalePoint
impl UnsafeUnpin for ScalePoint
impl UnwindSafe for ScalePoint
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more