https://github.com/z2oh/dep_dot
a small utility to compile arbitray directed acyclic graphs (i.e. trees) to the DOT graph description language
https://github.com/z2oh/dep_dot
Last synced: 8 months ago
JSON representation
a small utility to compile arbitray directed acyclic graphs (i.e. trees) to the DOT graph description language
- Host: GitHub
- URL: https://github.com/z2oh/dep_dot
- Owner: z2oh
- License: unlicense
- Created: 2019-11-09T23:08:23.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-10T05:31:28.000Z (over 6 years ago)
- Last Synced: 2025-07-09T04:06:08.778Z (11 months ago)
- Language: Rust
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# dep_dot

A small utility to compile arbitrary directed acyclic graphs (i.e. trees) to the DOT graph description language. The anticipated use case is the visualization of dependency trees.
Two macro helpers are available for constructing graph and node literals. The graph you see to the right is produced by the following code:
```
fn main() {
let g = G![
N!("Root"; 0 => 1, 2, 3, 6),
N!(1 => 4, 5),
N!(2 => 4, 5),
N!(3 => 4, 5),
N!("Leaf 1"; 4),
N!("Leaf 2"; 5),
N!("Leaf 3"; 6),
];
println!("{}", g.gen_dot().unwrap());
}
```
The output can be seen in [`example.dot`](example.dot). When this output is run through `dot` via `cargo run | dot -Tsvg -o example.svg`, you get this [`example.svg`](example.svg).