Skip to content

Commit 52ccc32

Browse files
committed
Rename plot::Plot to page::Page
1 parent e9f37d2 commit 52ccc32

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

examples/histogram_svg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ fn main() {
44
let data = [0.3, 0.5, 6.4, 5.3, 3.6, 3.6, 3.5, 7.5, 4.0];
55
let h = plotlib::histogram::Histogram::from_vec(&data, 10);
66
let v = plotlib::view::View::new().add(&h);
7-
plotlib::plot::Plot::single(&v).save("histogram.svg");
7+
plotlib::page::Page::single(&v).save("histogram.svg");
88
}

examples/histogram_text.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ fn main() {
44
let data = [0.3, 0.5, 6.4, 5.3, 3.6, 3.6, 3.5, 7.5, 4.0];
55
let h = plotlib::histogram::Histogram::from_vec(&data, 10);
66
let v = plotlib::view::View::new().add(&h);
7-
println!("{}", plotlib::plot::Plot::single(&v).to_text());
7+
println!("{}", plotlib::page::Page::single(&v).to_text());
88
}

examples/scatter_svg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn main() {
1414
.y_range(-2., 6.)
1515
.x_label("Some varying variable")
1616
.y_label("The repsonse of something");
17-
plotlib::plot::Plot::single(&v).save("scatter.svg");
17+
plotlib::page::Page::single(&v).save("scatter.svg");
1818

1919
/*
2020
//

examples/scatter_text.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ fn main() {
1212
.y_range(-2., 6.)
1313
.x_label("Some varying variable")
1414
.y_label("The repsonse of something");
15-
println!("{}", plotlib::plot::Plot::single(&v).to_text());
15+
println!("{}", plotlib::page::Page::single(&v).to_text());
1616
}

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Five main components of the plotlib pipeline:
1111
1. Data
1212
2. Representation
1313
3. View
14-
4. Plot
14+
4. Page
1515
5. Rendering
1616
1717
**Data** is the plain Rust data structure that the user brings along.
@@ -36,7 +36,7 @@ Each dimension from the representation is mapped onto an axis.
3636
A view can contain multiple representations as long as they can be mapped on to the axes.
3737
For example a 2D 'matrix' histogram could be displayed as a flat grid or as a 3D LEGO plot.
3838
39-
A **plot** is the whole 'page'. It can contain multiple views and specifies how they are laid out.
39+
A **page** is the whole page. It can contain multiple views and specifies how they are laid out.
4040
4141
Finally the **rendering** is the actual output.
4242
This could be an SVG, a PNG, an ASCII plot or an interactive web page.
@@ -53,11 +53,11 @@ Example
5353
each of which is the bounds and the counts.
5454
Blue bars with no casing.
5555
- *View*: Dimension 0 mapped to x-axis with range 5-19 and counts mapped to y-axis with range 0-60
56-
- *Plot*: A single view on the page
56+
- *Page*: A single view on the page
5757
- *Rendering*: An SVG
5858
5959
It starts from the end and works backwards.
60-
The Rendering (an SVG in this case) knows how to layout a *plot*.
60+
The Rendering (an SVG in this case) knows how to layout a *page*.
6161
It finds a single view inside and so creates the axes for it.
6262
It knows how to draw the axes for the view.
6363
It also knows how to draw each representation onto that view,
@@ -69,7 +69,7 @@ extern crate svg;
6969

7070
mod representation;
7171
pub mod view;
72-
pub mod plot;
72+
pub mod page;
7373

7474
pub mod histogram;
7575
pub mod scatter;

src/plot.rs renamed to src/page.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
The `plot` module provides structures for laying out and rendering multiple views.
2+
The `page` module provides structures for laying out and rendering multiple views.
33
*/
44

55
use std::path::Path;
@@ -12,19 +12,19 @@ use svg::Document;
1212
use view::View;
1313

1414
/**
15-
A single page plot laying out the views in a grid
15+
A single page page laying out the views in a grid
1616
*/
17-
pub struct Plot<'a> {
17+
pub struct Page<'a> {
1818
views: Vec<&'a View<'a>>,
1919
num_views: u32,
2020
}
2121

22-
impl<'a> Plot<'a> {
22+
impl<'a> Page<'a> {
2323
/**
2424
Creates a plot containing a single view
2525
*/
2626
pub fn single(view: &'a View) -> Self {
27-
Plot {
27+
Page {
2828
views: vec![view],
2929
num_views: 1,
3030
}

0 commit comments

Comments
 (0)