MermaidJS is library for generating svg charts and diagrams from text. You can edit your mermaid code using Online Mermaid Editor .
Link text
One
Two
Hard edge
Round edge
Decision
Result one
Result two
Alice Bob John Bob thinks a long long time, so long that the text does not fit on a row. Hello Bob, how are you? How about you John? I am good thanks! I am good thanks! Checking with John... Yes... John, how are you? Alice Bob John
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
```mermaid
classDiagram
direction RL
class Student {
- idCard : IdCard
}
class IdCard{
- id : int
- name : string
}
class Bike{
- id : int
- name : string
}
Student "1" --o "1" IdCard : carries
Student "1" --o "1" Bike : rides
```
carries
1
1
rides
1
1
Student
-idCard : IdCard
IdCard
-id : int
-name : string
Bike
-id : int
-name : string
1
2
3
4
5
6
7
8
9
10
11
12
```mermaid
stateDiagram
direction LR
[*] --> A
A --> B
B --> C
state B {
direction LR
a --> b
}
B --> D
```
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
```mermaid
erDiagram
CAR ||--o{ NAMED - DRIVER : allows
CAR {
string registrationNumber
string make
string model
}
PERSON ||-- o { NAMED - DRIVER : is
PERSON {
string firstName
string lastName
int age
}
```
CAR string registrationNumber string make string model NAMED-DRIVER PERSON string firstName string lastName int age allows is
1
2
3
4
5
6
7
8
9
10
11
```mermaid
gantt
title A Gantt Diagram
dateFormat YYYY-MM-DD
section Section
A task :a1, 2014-01-01, 30d
Another task :after a1 , 20d
section Another
Task in sec :2014-01-12 , 12d
another task : 24d
```
A Gantt Diagram 2014-01-05 2014-01-12 2014-01-19 2014-01-26 2014-02-02 2014-02-09 2014-02-16 A task Task in sec another task Another task Section Another A Gantt Diagram
1
2
3
4
5
6
7
8
```mermaid
pie showData
title Key elements in Product X
"Calcium" : 42.96
"Potassium" : 50.05
"Magnesium" : 10.01
"Iron" : 5
```
Key elements in Product X 40% 46% 9% 5% Key elements in Product X Calcium [42.96] Potassium [50.05] Magnesium [10.01] Iron [5]
main nice_feature very_nice_feature 1 2 3 4 5 6 7 customID customTag 8 9
Mermaid also support mindmap now, but we don’t use it yet.
1
2
3
4
5
< script type = "module" >
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@9/dist/mermaid.esm.min.mjs' ;
import mindmap from 'https://cdn.jsdelivr.net/npm/@mermaid-js/mermaid-mindmap@9/dist/mermaid-mindmap.esm.min.mjs' ;
await mermaid .registerExternalDiagrams ([mindmap ]);
< /script>
Hugo Short Code: Mermaid
Alice Bob John Bob thinks a long long time, so long that the text does not fit on a row. Hello Bob, how are you? How about you John? I am good thanks! I am good thanks! Checking with John... Yes... John, how are you? Alice Bob John
Author
houmin
Publish
January 6, 2023
LastMod
January 26, 2023
(87b47d6)
License
CC BY-NC-ND 4.0