https://github.com/deltamaniac/rascii
Simple plotting using ASCII
https://github.com/deltamaniac/rascii
ascii ascii-art plotting rustlang
Last synced: 6 months ago
JSON representation
Simple plotting using ASCII
- Host: GitHub
- URL: https://github.com/deltamaniac/rascii
- Owner: DeltaManiac
- License: mit
- Created: 2018-06-29T13:54:40.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-11T09:54:29.000Z (over 7 years ago)
- Last Synced: 2025-01-19T23:47:40.235Z (about 1 year ago)
- Topics: ascii, ascii-art, plotting, rustlang
- Language: Rust
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rasciigraph
Rascii graph is a rust implementation of [asciietch](https://github.com/linkedin/asciietch).
It follows the same principals of trying to draw graph with simple characters
Runs on Rust nightly as it uses the [Iterator::step_by](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.step_by) trait.
## Examples
Plotting from the first 7 integers in a decreasing order
```rust
rasciigraph::grapher::graph(vec![7.0, 6.0, 5.0, 4.5, 3.5, 2.7, 1_f64], None, None);
```
```
* Upper Value :7.00 ****************************************************************************************************************************************************************
-
\
\
\
\
\
|
-
* Lower Value :1.00 * Mean:4.24* Std Dev:2.03***************************************************************************************************************************************
```
Plotting Sine Wave times ten
```rust
let mut rand_vec = Vec::new();
for i in 0..360 {
rand_vec.push(f64::sin(i as f64) * 10.0);
}
rasciigraph::grapher::graph(rand_vec, None, None);
```
```
* Upper Value :10.00 ***************************************************************************************************************************************************************
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- || || || - - - || || || || - - || || || || - - || || || || - - || || || || - - || || || || - - || || || || - - - || || || -
-- || || || || || || -- || || || || || || -- || || || || || || -- || || || || || || -- || || || || || || -- || || || || || || -- || || || || || || -- || || || || || || --
| || || || || || |\ | |/ | || || || || |\ | |/ | || || || || |\ | |/ | || || || || |\ | |/ | || || || || |\ | |/ | || || || || |\ | |/ | || || || || |\ | |/ | || || || || || | |-
|/ | || || || |\ | || || | || || || |\ | || || | || || || |\ | || || | || || || |\ | || || |/ | || || || | || || |/ | || || || | || || |/ | || || || | || || |/ | || || || |\ | ||
|| |/ | || || | || || || |/ | || || | || || || |/ | || || | || || || |/ | || || | || || || || | || || |\ | || || || | || || |\ | || || || | || || |\ | || || || | || || |\ | || ||
|| || |/ | |\ | || || || || |/ | |\ | || || || || |/ | |\ | || || || || |/ | |\ | || || || || |/ | |\ | || || || || |/ | |\ | || || || || |/ | |\ | || || || || |/ | |\ | || || ||
|| || || -/ || || || || || || -/ || || || || || || -/ || || || || || || -/ || || || || || || -/ || || || || || || -/ || || || || || || -/ || || || || || || -/ || || || ||
|| - - - || || || || - - || || || || - - || || || || - - || || || || - - || || || || - - || || || || - - || || || || - - - || ||
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Lower Value :-10.00 * Mean:0.02* Std Dev:7.07*************************************************************************************************************************************
```
Plotting some Random Values without height and width constraints
```rust
rasciigraph::grapher::graph(
vec![
7.2, 7.3, 7.4, 6.4, 5.2, 5.0, 5.1, 5.9, 5.7, 4.2, 3.3, 2.6, 72.0, 2.1, 2.3, 3.2, 6.2,
2.2, 1.1,
],
None,
None,
);
```
```
* Upper Value :72.00 ***************************************************************************************************************************************************************
-
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
--- ||
-------- || --
- -/ --
* Lower Value :1.10 * Mean:8.13* Std Dev:15.59**************************************************************************************************************************************
```
Plotting some Random Values with height and width constraints
```rust
rasciigraph::grapher::graph(
vec![
7.2, 7.3, 7.4, 6.4, 5.2, 5.0, 5.1, 5.9, 5.7, 4.2, 3.3, 2.6, 72.0, 2.1, 2.3, 3.2, 6.2,
2.2, 1.1,
],
Some(10),
Some(10),
);
```
```
* Upper Value :72.00
-
||
||
||
||
||
||
||
-- ||
---/ |-
- -
* Lower Value :1.10 * Mean:8.13* Std Dev:15.59
```
More examples [here](https://github.com/DeltaManiac/rascii/blob/master/examples/hello.rs)
To run examples execute
```sh
cargo run --example hello
```