pub trait Ranged {
type FormatOption: DefaultValueFormatOption;
type ValueType;
// Required methods
fn map(&self, value: &Self::ValueType, limit: (i32, i32)) -> i32;
fn key_points<Hint: KeyPointHint>(&self, hint: Hint) -> 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 any 1D axis.
Required Associated Types§
sourcetype FormatOption: DefaultValueFormatOption
type FormatOption: DefaultValueFormatOption
This marker decides if Plotters default ValueFormatter implementation should be used. This associated type can be one of the following two types:
-
DefaultFormatting will allow Plotters to automatically impl the formatter based on
Debug
trait, ifDebug
trait is not impl for theSelf::Value
, ValueFormatter will not impl unless you impl it manually. -
NoDefaultFormatting Disable the automatic
Debug
based value formatting. Thus you have to impl the ValueFormatter manually.
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<Hint: KeyPointHint>(&self, hint: Hint) -> Vec<Self::ValueType>
fn key_points<Hint: KeyPointHint>(&self, hint: Hint) -> Vec<Self::ValueType>
This function gives the key points that we can draw a grid based on this