Trait Ranged

Source
pub trait Ranged {
    type ValueType;

    // Required methods
    fn map(&self, value: &Self::ValueType, limit: (i32, i32)) -> i32;
    fn key_points(&self, max_points: usize) -> Vec<Self::ValueType>;
    fn range(&self) -> Range<Self::ValueType>;

    // Provided method
    fn axis_pixel_range(&self, limit: (i32, i32)) -> Range<i32> { ... }
}
Expand description

The trait that indicates we have a ordered and ranged value Which is used to describe the axis

Required Associated Types§

Source

type ValueType

The type of this value

Required Methods§

Source

fn map(&self, value: &Self::ValueType, limit: (i32, i32)) -> i32

This function maps the value to i32, which is the drawing coordinate

Source

fn key_points(&self, max_points: usize) -> Vec<Self::ValueType>

This function gives the key points that we can draw a grid based on this

Source

fn range(&self) -> Range<Self::ValueType>

Get the range of this value

Provided Methods§

Source

fn axis_pixel_range(&self, limit: (i32, i32)) -> Range<i32>

This function provides the on-axis part of its range

Implementors§