metro
Metro is a crate for creating and rendering graphs
similar to git log --graph
.
Usage
Add this to your Cargo.toml
:
[]
= "0.1"
Releases
Release notes are available in the repo at CHANGELOG.md.
Example Output
The code for creating the following example, can be found after the graph.
* Station 1
* Station 2
* Station 3
|\
| * Station 4
| |\
| * | Station 5
| | * Station 6
* | | Station 7
| * | Station 8
| | * Station 9
| | |\
| | | |\
| | | | | Station 10 (Detached)
| |_|_|/
|/| | |
| | | * Station 11
| " | |
| / /
* | | Station 12
| * | Station 13
| | * Station 14
| |/
|/|
| * Station 15
| "
* Station 16
Example Using Metro
The following example outputs the graph above.
use Metro;
let mut metro = new;
let mut track1 = metro.new_track;
track1.add_station;
track1.add_station;
track1.add_station;
let mut track2 = track1.split;
track2.add_station;
let mut track3 = track2.split;
track2.add_station;
track3.add_station;
track1.add_station;
track2.add_station;
track3.add_station;
let mut track4 = track3.split;
let track5 = track4.split;
metro.add_station;
track5.join;
track4.add_station;
track2.stop;
track1.add_station;
track3.add_station;
track4.add_station;
track4.join;
track3.add_station;
track3.stop;
track1.add_station;
let string = metro.to_string.unwrap;
println!;
Example Using Event
The following example outputs the graph above.
use *;
let events = ;
let string = to_string.unwrap;
println!;