Diagram Examples
Invalid Diagrams
Those errors should not crash the whole page
Invalid type
No diagram type detected matching given configuration for text: badType
Invalid content
Parse error on line 2:
Sequence Diagram
Sequence Diagram (forest theme directive)
It is possible to override default config locally with Mermaid text directives such as:
%%{init: { "theme": "forest" } }%%
Gantt Chart
Flow Chart
With Markdown:
Class Diagram
State Diagram
Entity Relationship Diagram
User Journey
If there's too much space above it's due to a Mermaid bug
Pie Chart
Requirement Diagram
Gitgraph (Git) Diagram
Mermaid in tabs
- tab-a
- tab-b
The following mermaid diagram is shown:
This mermaid diagram is not displayed:
Mindmap
Quadrant Chart
Architecture Diagram
- See https://mermaid.js.org/syntax/architecture
- See https://github.com/facebook/docusaurus/discussions/10508
ELK Styling
Mermaid provides an ELK layout
Dagre
This diagram explicitly uses the Dagre layout.
has
undertakes
operates_in
serves
employs
manages
allocated
works_on
lives_at
has
supports
for
contains
COMPANY
DEPARTMENT
PROJECT
LOCATION
CLIENT
EMPLOYEE
BUDGET
ADDRESS
SKILL
DEPENDENT
TASK
ELK er diagram layout
This ER diagram should look different, using the ELK layout.
has
undertakes
operates_in
serves
employs
manages
allocated
works_on
lives_at
has
supports
for
contains
COMPANY
DEPARTMENT
PROJECT
LOCATION
CLIENT
EMPLOYEE
BUDGET
ADDRESS
SKILL
DEPENDENT
TASK
Mermaid also provides a way of setting config parameters using a directive %%{init:{"layout":"elk"}}%%
has
undertakes
operates_in
serves
employs
manages
allocated
works_on
lives_at
has
supports
for
contains
COMPANY
DEPARTMENT
PROJECT
LOCATION
CLIENT
EMPLOYEE
BUDGET
ADDRESS
SKILL
DEPENDENT
TASK