Trait Ranged

pub trait Ranged {
    type FormatOption: DefaultValueFormatOption;
    type ValueType;

    // Required methods
    fn map(&self, value: &Self::ValueType, limit: (i32, i32)) -> i32;
    fn key_points<Hint>(&self, hint: Hint) -> Vec<Self::ValueType>
       where Hint: KeyPointHint;
    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§

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, if Debug trait is not impl for the Self::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.

type ValueType

The type of this value in this range specification

Required Methods§

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

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

fn key_points<Hint>(&self, hint: Hint) -> Vec<Self::ValueType>
where Hint: KeyPointHint,

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

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

Get the range of this value

Provided Methods§

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

This function provides the on-axis part of its range

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

§

impl Ranged for RangedCoordf32

§

impl Ranged for RangedCoordf64

§

impl Ranged for RangedCoordi32

§

impl Ranged for RangedCoordi64

§

impl Ranged for RangedCoordi128

§

impl Ranged for RangedCoordisize

§

impl Ranged for RangedCoordu32

§

impl Ranged for RangedCoordu64

§

impl Ranged for RangedCoordu128

§

impl Ranged for RangedCoordusize

§

impl Ranged for RangedDuration

§

impl<'a, T> Ranged for RangedSlice<'a, T>
where T: PartialEq,

§

impl<D> Ranged for SegmentedCoord<D>
where D: DiscreteRanged,

§

impl<D> Ranged for RangedDate<D>
where D: TimeValue + Sub<Output = TimeDelta> + Add<TimeDelta, Output = D> + Datelike + Clone,

§

impl<DT> Ranged for RangedDateTime<DT>
where DT: TimeValue + Clone + PartialOrd + Add<TimeDelta, Output = DT> + Sub<Output = TimeDelta> + Datelike + Timelike, RangedDate<<DT as TimeValue>::DateType>: Ranged<ValueType = <DT as TimeValue>::DateType>,

§

impl<P, S> Ranged for NestedRange<P, S>
where P: DiscreteRanged, S: Ranged,

§

impl<R> Ranged for WithKeyPointMethod<R>
where R: Ranged,

§

impl<R> Ranged for WithKeyPoints<R>
where R: Ranged, <R as Ranged>::ValueType: Clone,

§

impl<T> Ranged for Monthly<T>
where T: TimeValue + Clone, Range<T>: AsRangedCoord<Value = T>,

§

impl<T> Ranged for Yearly<T>
where T: TimeValue + Clone, Range<T>: AsRangedCoord<Value = T>,

§

impl<T> Ranged for GroupBy<T>
where T: DiscreteRanged,

§

impl<T, S, R> Ranged for Linspace<T, S, R>
where T: Ranged, S: Clone, R: LinspaceRoundingMethod<<T as Ranged>::ValueType>, <T as Ranged>::ValueType: Add<S, Output = <T as Ranged>::ValueType> + PartialOrd + Clone,

§

impl<V> Ranged for LogCoord<V>
where V: LogScalable,