1mod band;
2mod linear;
3mod ordinal;
4mod point;
5mod sealed;
6
7pub use band::ScaleBand;
8pub use linear::ScaleLinear;
9pub use ordinal::ScaleOrdinal;
10pub use point::ScalePoint;
11
12use num_traits::{Num, ToPrimitive};
13
14pub trait PlotValue: sealed::Sealed + Copy + PartialOrd + Num + ToPrimitive + 'static {}
20
21impl PlotValue for f32 {}
22impl PlotValue for f64 {}
23#[cfg(feature = "decimal")]
24impl PlotValue for rust_decimal::Decimal {}
25
26pub trait Scale<T> {
27 fn tick(&self, value: &T) -> Option<f32>;
29
30 fn nearest_index(&self, _tick: f32) -> usize {
33 0
34 }
35}