https://github.com/saschagrunert/rain
Visualize vertical data inside your terminal 💦
https://github.com/saschagrunert/rain
data log logger rain rust terminal
Last synced: 10 months ago
JSON representation
Visualize vertical data inside your terminal 💦
- Host: GitHub
- URL: https://github.com/saschagrunert/rain
- Owner: saschagrunert
- License: mit
- Created: 2017-01-04T11:39:52.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-05-07T12:25:57.000Z (over 1 year ago)
- Last Synced: 2024-10-11T23:43:20.877Z (over 1 year ago)
- Topics: data, log, logger, rain, rust, terminal
- Language: Rust
- Homepage:
- Size: 1.52 MB
- Stars: 90
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rain
[](https://travis-ci.org/saschagrunert/rain) [](https://coveralls.io/github/saschagrunert/rain?branch=master) [](https://saschagrunert.github.io/rain) [](https://deps.rs/repo/github/saschagrunert/rain) [](https://github.com/saschagrunert/rain/blob/master/LICENSE) [](https://crates.io/crates/rain) [](https://docs.rs/rain)
## 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 usage
```rust
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.