项目作者: kjagiello

项目描述 :
Diagrams as code
高级语言: Rust
项目地址: git://github.com/kjagiello/diagwiz.git
创建时间: 2021-03-30T18:20:25Z
项目社区:https://github.com/kjagiello/diagwiz

开源协议:MIT License

下载


diagwiz — diagrams as code

CI Security audit

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.

Supported diagrams

Online playground

You can experiment building diagrams with diagwiz using the
online playground.

Installation

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.

Download a nightly binary

Visit the nightly release page
and download a binary compatible with your system.

Install from source

  1. cargo install --git https://github.com/kjagiello/diagwiz

Usage example

  1. $ cat <<EOF > example.diag
  2. alias ali = "Alice"
  3. ali->Bob: "Hello!"
  4. Bob->Bob: "(Bob thinks)"
  5. Bob-->ali: "Hello back!"
  6. EOF
  7. $ diagwiz < example.diag
  8. ┌───────┐ ┌─────┐
  9. Alice Bob
  10. └───────┘ └─────┘
  11. Hello!
  12. │──────────────▶│
  13. │─┐
  14. (Bob thinks)
  15. │◀┘
  16. Hello back!
  17. │◀--------------│
  18. ┌───────┐ ┌─────┐
  19. Alice Bob
  20. └───────┘ └─────┘

Known issues

  • 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.