https://github.com/jonathanwoollett-light/draw-dag
Draws directed acyclic graphs.
https://github.com/jonathanwoollett-light/draw-dag
Last synced: 3 months ago
JSON representation
Draws directed acyclic graphs.
- Host: GitHub
- URL: https://github.com/jonathanwoollett-light/draw-dag
- Owner: JonathanWoollett-Light
- Created: 2024-01-17T22:11:34.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-01-17T22:56:20.000Z (over 1 year ago)
- Last Synced: 2025-03-02T02:54:01.032Z (4 months ago)
- Language: Rust
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# draw-dag
```rust
let a = allocate(1, Vec::new());
let b = allocate(2, Vec::new());
let c = allocate(3, Vec::new());
let d = allocate(4, Vec::new());
let e = allocate(5, vec![a]);
let f = allocate(6, Vec::new());
let g = allocate(7, vec![b]);
let h = allocate(8, vec![d, c]);
let i = allocate(9, vec![e]);
let j = allocate(10, vec![h, g, f]);
let k = allocate(11, vec![j, i]);
let l = allocate(12, vec![k]);let graph = draw_dag(l, 1);
```becomes
```text
12
│
11
├───┐
9 10
│ ├──┬──┐
5 6 7 8
│ │ ├──┐
1 2 3 4
```