Scale

Trait Scale 

Source
pub trait Scale<T> {
    // Required method
    fn tick(&self, value: &T) -> Option<f32>;

    // Provided methods
    fn least_index(&self, _tick: f32) -> usize { ... }
    fn least_index_with_domain(&self, _tick: f32, _domain: &[T]) -> (usize, f32) { ... }
}

Required Methods§

Source

fn tick(&self, value: &T) -> Option<f32>

Get the tick of the scale.

Provided Methods§

Source

fn least_index(&self, _tick: f32) -> usize

Get the least index of the scale.

Source

fn least_index_with_domain(&self, _tick: f32, _domain: &[T]) -> (usize, f32)

Get the least index of the scale with the domain.

Implementors§

Source§

impl<T> Scale<T> for ScaleBand<T>
where T: PartialEq,

Source§

impl<T> Scale<T> for ScaleLinear<T>
where T: Copy + PartialOrd + Num + ToPrimitive + Sealed,

Source§

impl<T> Scale<T> for ScalePoint<T>
where T: PartialEq,