splotch/lib.rs
1//! Plot data in footile
2//!
3//! ## Example Line Plot
4//!
5//! ```rust
6//! use splotch::{plot, Chart, Page, axis::{Horizontal, Vertical}};
7//! use pointy::BBox;
8//!
9//! let data = vec![(13.0, 74.0), (111.0, 37.0), (125.0, 52.0), (190.0, 66.0)];
10//! let domain = {
11//! let mut domain = BBox::new(data.iter().cloned());
12//! domain.extend([0.0, 200.0]);
13//! domain
14//! };
15//! let plot = plot::Line::new("Series", &domain, &data);
16//! let page = Page::default().with_chart(
17//! Chart::default()
18//! .with_title("Line Plot")
19//! .with_axis(Horizontal::new(domain).with_name("X Axis Name"))
20//! .with_axis(Vertical::new(domain).with_name("Y Axis Name").on_right())
21//! .with_plot(&plot),
22//! );
23//! println!("{}", page);
24//! ```
25#![forbid(unsafe_code)]
26
27pub mod axis;
28mod chart;
29mod page;
30pub mod plot;
31pub mod scale;
32mod text;
33
34pub use chart::{Chart, Title};
35pub use page::{AspectRatio, Page};