Warning: This project is in early experimental stage. Functionality is subject to change and YMMV. Feel free to open an issue if you have any suggestions, Rust tips & tricks (my first Rust project) or stumbled upon any bugs.
You can experiment building diagrams with diagwiz using the online playground.
As the package is currently in experimental stage, you can install it by building it from the source or by downloading the pre-compiled binary from the latest nightly release.
Visit the nightly release page and download a binary compatible with your system.
cargo install --git https://github.com/kjagiello/diagwiz
$ cat <<EOF > example.diag
alias ali = "Alice"
ali->Bob: "Hello!"
Bob->Bob: "(Bob thinks)"
Bob-->ali: "Hello back!"
EOF
$ diagwiz < example.diag
┌───────┐ ┌─────┐
│ Alice │ │ Bob │
└───────┘ └─────┘
│ Hello! │
│──────────────▶│
│ │
│ │─┐
│ │ │ (Bob thinks)
│ │◀┘
│ │
│ Hello back! │
│◀--------------│
│ │
┌───────┐ ┌─────┐
│ Alice │ │ Bob │
└───────┘ └─────┘
- Characters with a column width other than 1 cause artifacts in the ASCII representation of a diagram
- For some inputs, the generated layout might change on every run. This is due to the Cassowary algorithm implementation not being deterministic and finding multiple optimal solutions for the given constraints.