8 releases (2 stable)

1.0.1 Jan 13, 2019
1.0.0 Oct 3, 2018
0.3.1 Feb 1, 2017
0.2.2 Jan 5, 2017
0.1.0 Jan 4, 2017

#1063 in Command line utilities

Download history 14/week @ 2021-02-20 4/week @ 2021-02-27 3/week @ 2021-03-06 4/week @ 2021-03-13 21/week @ 2021-03-20 19/week @ 2021-03-27 19/week @ 2021-04-03 14/week @ 2021-04-10 12/week @ 2021-04-17 5/week @ 2021-04-24 13/week @ 2021-05-01 7/week @ 2021-05-08 11/week @ 2021-05-15 5/week @ 2021-05-22 4/week @ 2021-05-29 12/week @ 2021-06-05

51 downloads per month
Used in ceramic

MIT license

160KB
258 lines

rain

Build Status Coverage Status master doc rain License MIT Crates.io doc.rs

Visualize vertical data inside your terminal 💦

This library helps you to display line based data vertically within your terminal. The color of the actual graph represents its value, whereas blue is low and red is high. These color bounds will be calculated automatically during runtime. Beside this, the terminal dimensions are adapted during runtime, too. If no data was added to a line, their terminal line is dashed.

Example

Example usage

use rain::Graph;

// Get a drawing area
let mut graph = Graph::new();

// Get some line identifiers
let l1 = "Line 1";
let l2 = "Line 1";
let l3 = "Line 1";

// Add some values and print
assert!(graph.add(l1, 0).is_ok());
assert!(graph.add(l2, 0).is_ok());
graph.print();

// Add more values and print
assert!(graph.add(l2, 5).is_ok());
assert!(graph.add(l3, 10).is_ok());
graph.print();

// Remove a line and print
assert!(graph.remove(l1).is_ok());
graph.print();

Contributing

You want to contribute to this project? Wow, thanks! So please just fork it and send me a pull request.

Dependencies

~1.3–1.8MB
~40K SLoC