Skip to content

Commit c4f5e95

Browse files
committed
Neaten up the main docs page
1 parent cc99176 commit c4f5e95

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

src/lib.rs

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
/*!
22
3-
Data structures and helpers for managing plotting data
3+
# plotlib
4+
5+
plotlib is a data plotting and rendering library/
6+
7+
## Technical
48
59
Five main components of the plotlib pipeline:
610
@@ -10,11 +14,11 @@ Five main components of the plotlib pipeline:
1014
4. Plot
1115
5. Rendering
1216
13-
*Data* is the plain Rust data structure that the user brings along.
17+
**Data** is the plain Rust data structure that the user brings along.
1418
This might be something like a `Vec`, an `ndarray` or a slice.
1519
This will likely be copied or moved from to contruct the *representation*.
1620
17-
The *representation* is the transformed version of that data which is the base plot object.
21+
The **representation** is the transformed version of that data which is the base plot object.
1822
Each representation has N dimensions of input and one dimension of output.
1923
For example a scatter plot has x-values as inputs and for each of those a y-value as an output.
2024
A histogram has bins along one axis as its input and counts (or frequencies) as its output.
@@ -27,14 +31,14 @@ A concrete interpretation of this style is deferred to when the rendering happen
2731
So a scatter plot will know what colour and style to use for the markers,
2832
and a histogram will know which colours to use for its bars.
2933
30-
The *view* is how you want this data to be presented.
34+
The **view** is how you want this data to be presented.
3135
Each dimension from the representation is mapped onto an axis.
3236
A view can contain multiple representations as long as they can be mapped on to the axes.
3337
For example a 2D 'matrix' histogram could be displayed as a flat grid or as a 3D LEGO plot.
3438
35-
A *plot* is the whole 'page'. It can contain multiple views and specifies how they are laid out.
39+
A **plot** is the whole 'page'. It can contain multiple views and specifies how they are laid out.
3640
37-
Finally the rendering is the actual output.
41+
Finally the **rendering** is the actual output.
3842
This could be an SVG, a PNG, an ASCII plot or an interactive web page.
3943
A rendering will not necessarilly be able to show all types of views or representations
4044
and may choose to ignore some.
@@ -44,17 +48,17 @@ or for a particular representation to be displayed across more than one view.
4448
4549
Example
4650
47-
Data: A linear sequence of numbers as a Vec<f64>
48-
Representation: A binned histogram, stored as a list of `Bin`s,
51+
- *Data*: A linear sequence of numbers as a Vec<f64>
52+
- *Representation*: A binned histogram, stored as a list of `Bin`s,
4953
each of which is the bounds and the counts.
5054
Blue bars with no casing.
51-
View: Dimension 0 mapped to x-axis with range 5-19 and counts mapped to y-axis with range 0-60
52-
Plot: A single view on the page
53-
Rendering: An SVG
55+
- *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
57+
- *Rendering*: An SVG
5458
5559
It starts from the end and works backwards.
5660
The Rendering (an SVG in this case) knows how to layout a *plot*.
57-
It finds a single View inside and so creates teh axes for it.
61+
It finds a single view inside and so creates the axes for it.
5862
It knows how to draw the axes for the view.
5963
It also knows how to draw each representation onto that view,
6064
in this case, interpreting the bins and colours to create SVG elements.
@@ -63,13 +67,13 @@ in this case, interpreting the bins and colours to create SVG elements.
6367

6468
extern crate svg;
6569

66-
pub mod representation;
70+
mod representation;
6771
pub mod view;
6872
pub mod plot;
6973

7074
pub mod histogram;
7175
pub mod scatter;
72-
pub mod axis;
73-
pub mod utils;
74-
pub mod text_render;
75-
pub mod svg_render;
76+
mod axis;
77+
mod utils;
78+
mod text_render;
79+
mod svg_render;

0 commit comments

Comments
 (0)