Learn how to use Mermaid.js
to create data-driven diagrams.
Mermaid lets you create diagrams and visualizations using text and code. ~ https://mermaid-js.github.io
GitHub recently included Mermaid support in their Makdown parser: https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid
This means we can now include basic code/data-driven diagrams as living documentation in our projects!
Mermaid diagrams can be used
Now!
The easiest way to test out mermaid and learn is using the Live Editor: https://mermaid.live
The best place for an intro is in the offical docs: Overview for beginners
Sadly, at the time of writing,
VSCode/VSCodium does not have built-in support
for rendering Mermaid.js diagrams.
So when you preview a Markdown
(.md
) file
graph TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{fa:fa-car Decisions}
C -->|One| D[fa:fa-laptop Laptop]
C -->|Two| E[fa:fa-mobile iPhone]
C -->|Three| F[fa:fa-plane Drone]
F -->|Repeat| A
graph TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{fa:fa-car Decisions}
C -->|One| D[fa:fa-laptop Laptop]
C -->|Two| E[fa:fa-mobile iPhone]
C -->|Three| F[fa:fa-plane Drone]
F -->|Repeat| A
sequenceDiagram
Alice->>John: Hello John, how are you?
John-->>Alice: Great!
Alice-)John: See you later!
sequenceDiagram
Alice->>John: Hello John, how are you?
John-->>Alice: Great!
Alice-)John: See you later!
- Awesome diagrams using Mermaid.js: https://dev.to/erfankashani/awesome-diagrams-using-mermaidjs-3am0