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§
Required Methods§
Sourcefn map(&self, value: &Self::ValueType, limit: (i32, i32)) -> i32
fn map(&self, value: &Self::ValueType, limit: (i32, i32)) -> i32
This function maps the value to i32, which is the drawing coordinate
Sourcefn key_points(&self, max_points: usize) -> Vec<Self::ValueType>
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