rain

Crates.iorain
lib.rsrain
version1.0.1
sourcesrc
created_at2017-01-04 13:16:30.697339
updated_at2019-01-13 14:46:28.024542
descriptionVisualize vertical data inside your terminal.
homepagehttps://github.com/saschagrunert/rain
repositoryhttps://github.com/saschagrunert/rain
max_upload_size
id7918
size182,970
Sascha Grunert (saschagrunert)

documentation

https://docs.rs/rain

README

rain

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

Visualize vertical data inside your terminal :sweat_drops:

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.

Commit count: 28

cargo fmt