Skip to content

Commit 1ec36a9

Browse files
authored
Merge pull request #8042 from MicrosoftDocs/users/v-smoliakova/update-mermaid-documentation
[Repos/Wiki] Mermaid: Add information about new supported diagram types
2 parents 56069f1 + 77fdb13 commit 1ec36a9

File tree

4 files changed

+86
-0
lines changed

4 files changed

+86
-0
lines changed

docs/project/wiki/markdown-guidance.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,9 @@ Mermaid lets you create diagrams and visualizations by using text and code. The
896896
- [User Journey](https://mermaid.js.org/syntax/userJourney.html)
897897
- [Pie chart](https://mermaid.js.org/syntax/pie.html)
898898
- [Requirements diagram](https://mermaid.js.org/syntax/requirementDiagram.html)
899+
- [Gitgraph diagrams](https://mermaid.js.org/syntax/gitgraph.html)
900+
- [Entity Relationship diagrams](https://mermaid.js.org/syntax/entityRelationshipDiagram.html)
901+
- [Timeline diagrams](https://mermaid.js.org/syntax/timeline.html)
899902
900903
For more information, see the [Mermaid release notes](https://github.com/mermaid-js/mermaid/releases).
901904
@@ -1125,6 +1128,89 @@ Here's the published view of the requirements diagram:
11251128
11261129
:::image type="content" source="media/wiki/wiki-mermaid-requirements-diagram.png" alt-text="Screenshot of the Mermaid Live Editor with the code for a requirements diagram and a preview of the published view." lightbox="media/wiki/wiki-mermaid-requirements-diagram.png":::
11271130
1131+
#### Example: Gitgraph diagram
1132+
1133+
A git graph diagram (type `gitGraph`) is used to visualize Git operations like commits, branches, and merges.
1134+
1135+
The following example shows how to add a git graph diagram to a wiki page:
1136+
1137+
```md
1138+
::: mermaid
1139+
gitGraph
1140+
commit id: "Initial commit"
1141+
branch develop
1142+
commit id: "Develop commit 1"
1143+
commit id: "Develop commit 2"
1144+
checkout main
1145+
commit id: "Main commit 1"
1146+
merge develop id: "Merge develop into main"
1147+
branch feature
1148+
checkout feature
1149+
commit id: "Feature commit 1"
1150+
checkout develop
1151+
commit id: "Develop commit 3"
1152+
checkout feature
1153+
merge develop id: "Merge develop into feature"
1154+
:::
1155+
```
1156+
1157+
Here's the published view of the git graph diagram:
1158+
1159+
:::image type="content" source="media/wiki/wiki-mermaid-git-graph-diagram.png" alt-text="Screenshot of the Mermaid Live Editor with the code for a git graph diagram and a preview of the published view." lightbox="media/wiki/wiki-mermaid-git-graph-diagram.png":::
1160+
1161+
#### Example: Entity Relationship diagram
1162+
1163+
An entity relationship diagram (type `erDiagram`) is used to model the relationships between entities in a system, such as a database or an application. These diagrams help in understanding and designing the structure of data and its interrelationships.
1164+
1165+
The following example shows how to add an entity relationship diagram to a wiki page:
1166+
1167+
```md
1168+
::: mermaid
1169+
erDiagram
1170+
CUSTOMER {
1171+
string name
1172+
string address
1173+
}
1174+
ORDER {
1175+
int orderNumber
1176+
string product
1177+
}
1178+
CUSTOMER ||--o{ ORDER : places
1179+
:::
1180+
```
1181+
1182+
Here's the published view of the entity relationship diagram:
1183+
1184+
:::image type="content" source="media/wiki/wiki-mermaid-entity-relationship-diagram.png" alt-text="Screenshot of the Mermaid Live Editor with the code for an entity relationship diagram and a preview of the published view." lightbox="media/wiki/wiki-mermaid-entity-relationship-diagram.png":::
1185+
1186+
#### Example: Timeline diagram
1187+
1188+
A timeline diagram (type `timeline`) is used to visualize events in chronological order, making it easier to track progress or historical events.
1189+
1190+
The following example shows how to add a Timeline diagram to a wiki page:
1191+
1192+
```md
1193+
::: mermaid
1194+
timeline
1195+
title Project Development Timeline
1196+
section Planning
1197+
Project kickoff : 2025-01-01
1198+
Requirements gathering : 2025-01-15
1199+
section Development
1200+
Initial development : 2025-02-01
1201+
First prototype : 2025-03-01
1202+
section Testing
1203+
Alpha testing : 2025-04-01
1204+
Beta testing : 2025-05-01
1205+
section Release
1206+
Public release : 2025-06-01
1207+
:::
1208+
```
1209+
1210+
Here's the published view of the timeline diagram:
1211+
1212+
:::image type="content" source="media/wiki/wiki-mermaid-timeline-diagram.png" alt-text="Screenshot of the Mermaid Live Editor with the code for a timeline diagram and a preview of the published view." lightbox="media/wiki/wiki-mermaid-timeline-diagram.png":::
1213+
11281214
::: moniker-end
11291215
11301216
::: moniker range="<=azure-devops"
51.7 KB
Loading
72.8 KB
Loading
55.3 KB
Loading

0 commit comments

Comments
 (0)