Trait lc_render::scale::Scale[][src]

pub trait Scale<T> {
    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

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

Scale the provided domain value for a scale range.

fn ticks(&self) -> Vec<T>[src]

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

fn kind(&self) -> ScaleKind[src]

Get the scale kind.

fn bandwidth(&self) -> f32[src]

Get the scale bandwidth.

fn is_range_reversed(&self) -> bool[src]

Check if scale range is reversed.

fn tick_offset(&self) -> f32[src]

Get the offset for each tick.

Implementors

impl Scale<f32> for LinearScale[src]

fn scale(&self, domain: &f32) -> f32[src]

fn ticks(&self) -> Vec<f32>[src]

fn kind(&self) -> ScaleKind[src]

fn bandwidth(&self) -> f32[src]

fn is_range_reversed(&self) -> bool[src]

fn tick_offset(&self) -> f32[src]

impl Scale<String> for BandScale[src]

fn scale(&self, domain: &String) -> f32[src]

fn ticks(&self) -> Vec<String>[src]

fn kind(&self) -> ScaleKind[src]

fn bandwidth(&self) -> f32[src]

fn is_range_reversed(&self) -> bool[src]

fn tick_offset(&self) -> f32[src]