Trait Scale

Source
pub trait Scale<T> {
    // Required methods
    fn scale(&self, domain: &T) -> f32;
    fn ticks(&self) -> Vec<T>;
    fn kind(&self) -> ScaleKind;
    fn bandwidth(&self) -> f32;
    fn is_range_reversed(&self) -> bool;
    fn tick_offset(&self) -> f32;
}
Expand description

Scale represents an axis scale that is used in views and chart.

Required Methods§

Source

fn scale(&self, domain: &T) -> f32

Scale the provided domain value for a scale range.

Source

fn ticks(&self) -> Vec<T>

Get the list of ticks that represent the scale on an axis.

Source

fn kind(&self) -> ScaleKind

Get the scale kind.

Source

fn bandwidth(&self) -> f32

Get the scale bandwidth.

Source

fn is_range_reversed(&self) -> bool

Check if scale range is reversed.

Source

fn tick_offset(&self) -> f32

Get the offset for each tick.

Implementors§