1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//! This module provides scalers for continuous range of values, color maps, discrete values like
//! `&str` and time values using [`chrono::DateTime`].
//!
//! ```
//! use vizkit::scale::ScaleContinuous;
//!
//! // Dimensions for a chart for instance
//! let width = 1000.;
//! let margin_left = 30.;
//! let margin_right = 20.;
//!
//! // domain of x values
//! let x_min = 20.;
//! let x_max = 50.;
//!
//! let scale = ScaleContinuous::linear()
//! .domain([x_min, x_max])
//! .range([margin_left, width - margin_right]);
//!
//! // Start of domain
//! assert_eq!(scale.scale(x_min), margin_left);
//! // Middle of domain
//! assert_eq!(scale.scale((x_max + x_min) * 0.5), (width - margin_right + margin_left) * 0.5);
//! // End of domain
//! assert_eq!(scale.scale(x_max), width - margin_right);
//! ```
pub use ScaleTime;
pub use ;
/// Axis trait used for generating tick values and tick positions along a direction for axis
/// iterators.
///
/// ## See also
///
/// This trait is used by the following functions:
///
/// - [`axis_top_iter`][`crate::draw::axis_top_iter`]
/// - [`axis_right_iter`][`crate::draw::axis_right_iter`]
/// - [`axis_bottom_iter`][`crate::draw::axis_bottom_iter`]
/// - [`axis_left_iter`][`crate::draw::axis_left_iter`]