minimal-vibe-coding-kit 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (293) hide show
  1. package/.agents/skills/agentshield-security-review/SKILL.md +16 -8
  2. package/.agents/skills/agentshield-security-review/references/native-install.md +2 -2
  3. package/.agents/skills/agentshield-security-review/scripts/agentshield_repo_probe.py +19 -1
  4. package/.agents/skills/mermaid/SKILL.md +141 -0
  5. package/.agents/skills/mermaid/UPSTREAM-NOTICE.md +52 -0
  6. package/.agents/skills/mermaid/references/architecture.md +433 -0
  7. package/.agents/skills/mermaid/references/block.md +752 -0
  8. package/.agents/skills/mermaid/references/c4.md +618 -0
  9. package/.agents/skills/mermaid/references/classDiagram.md +1191 -0
  10. package/.agents/skills/mermaid/references/coding-level-charts.md +27 -0
  11. package/.agents/skills/mermaid/references/config-configuration.md +71 -0
  12. package/.agents/skills/mermaid/references/config-directives.md +341 -0
  13. package/.agents/skills/mermaid/references/config-layouts.md +39 -0
  14. package/.agents/skills/mermaid/references/config-math.md +95 -0
  15. package/.agents/skills/mermaid/references/config-theming.md +245 -0
  16. package/.agents/skills/mermaid/references/config-tidy-tree.md +88 -0
  17. package/.agents/skills/mermaid/references/cynefin.md +278 -0
  18. package/.agents/skills/mermaid/references/debug-heatmap.md +68 -0
  19. package/.agents/skills/mermaid/references/entityRelationshipDiagram.md +902 -0
  20. package/.agents/skills/mermaid/references/eventmodeling.md +474 -0
  21. package/.agents/skills/mermaid/references/examples.md +300 -0
  22. package/.agents/skills/mermaid/references/flowchart.md +2166 -0
  23. package/.agents/skills/mermaid/references/gantt.md +736 -0
  24. package/.agents/skills/mermaid/references/gitgraph.md +2137 -0
  25. package/.agents/skills/mermaid/references/ishikawa.md +65 -0
  26. package/.agents/skills/mermaid/references/kanban.md +160 -0
  27. package/.agents/skills/mermaid/references/kit-examples.md +210 -0
  28. package/.agents/skills/mermaid/references/mindmap.md +334 -0
  29. package/.agents/skills/mermaid/references/packet.md +152 -0
  30. package/.agents/skills/mermaid/references/pie.md +111 -0
  31. package/.agents/skills/mermaid/references/preview.html +1143 -0
  32. package/.agents/skills/mermaid/references/quadrantChart.md +266 -0
  33. package/.agents/skills/mermaid/references/radar.md +268 -0
  34. package/.agents/skills/mermaid/references/railroad.md +455 -0
  35. package/.agents/skills/mermaid/references/requirementDiagram.md +494 -0
  36. package/.agents/skills/mermaid/references/sankey.md +414 -0
  37. package/.agents/skills/mermaid/references/sequenceDiagram.md +1206 -0
  38. package/.agents/skills/mermaid/references/stateDiagram.md +669 -0
  39. package/.agents/skills/mermaid/references/styling-preset.md +620 -0
  40. package/.agents/skills/mermaid/references/swimlanes.md +523 -0
  41. package/.agents/skills/mermaid/references/timeline.md +570 -0
  42. package/.agents/skills/mermaid/references/treeView.md +432 -0
  43. package/.agents/skills/mermaid/references/treemap.md +352 -0
  44. package/.agents/skills/mermaid/references/userJourney.md +41 -0
  45. package/.agents/skills/mermaid/references/venn.md +156 -0
  46. package/.agents/skills/mermaid/references/wardley.md +731 -0
  47. package/.agents/skills/mermaid/references/xyChart.md +392 -0
  48. package/.agents/skills/mermaid/references/zenuml.md +473 -0
  49. package/.agents/skills/sequential-thinking/SKILL.md +97 -69
  50. package/.agents/skills/sequential-thinking/examples/adaptive-depth.md +15 -536
  51. package/.agents/skills/sequential-thinking/examples/branching-exploration.md +18 -468
  52. package/.agents/skills/sequential-thinking/examples/linear-reasoning.md +22 -203
  53. package/.agents/skills/sequential-thinking/examples/revision-pattern.md +17 -298
  54. package/.agents/skills/sequential-thinking/references/advanced-techniques.md +98 -0
  55. package/.agents/skills/sequential-thinking/references/output-schema.md +99 -458
  56. package/.agents/skills/sequential-thinking/references/parameters.md +73 -435
  57. package/.agents/skills/sequential-thinking/references/patterns.md +72 -639
  58. package/.claude/skills/agentshield-security-review/SKILL.md +16 -8
  59. package/.claude/skills/agentshield-security-review/references/native-install.md +2 -2
  60. package/.claude/skills/agentshield-security-review/scripts/agentshield_repo_probe.py +19 -1
  61. package/.claude/skills/mermaid/SKILL.md +141 -0
  62. package/.claude/skills/mermaid/UPSTREAM-NOTICE.md +52 -0
  63. package/.claude/skills/mermaid/references/architecture.md +433 -0
  64. package/.claude/skills/mermaid/references/block.md +752 -0
  65. package/.claude/skills/mermaid/references/c4.md +618 -0
  66. package/.claude/skills/mermaid/references/classDiagram.md +1191 -0
  67. package/.claude/skills/mermaid/references/coding-level-charts.md +27 -0
  68. package/.claude/skills/mermaid/references/config-configuration.md +71 -0
  69. package/.claude/skills/mermaid/references/config-directives.md +341 -0
  70. package/.claude/skills/mermaid/references/config-layouts.md +39 -0
  71. package/.claude/skills/mermaid/references/config-math.md +95 -0
  72. package/.claude/skills/mermaid/references/config-theming.md +245 -0
  73. package/.claude/skills/mermaid/references/config-tidy-tree.md +88 -0
  74. package/.claude/skills/mermaid/references/cynefin.md +278 -0
  75. package/.claude/skills/mermaid/references/debug-heatmap.md +68 -0
  76. package/.claude/skills/mermaid/references/entityRelationshipDiagram.md +902 -0
  77. package/.claude/skills/mermaid/references/eventmodeling.md +474 -0
  78. package/.claude/skills/mermaid/references/examples.md +300 -0
  79. package/.claude/skills/mermaid/references/flowchart.md +2166 -0
  80. package/.claude/skills/mermaid/references/gantt.md +736 -0
  81. package/.claude/skills/mermaid/references/gitgraph.md +2137 -0
  82. package/.claude/skills/mermaid/references/ishikawa.md +65 -0
  83. package/.claude/skills/mermaid/references/kanban.md +160 -0
  84. package/.claude/skills/mermaid/references/kit-examples.md +210 -0
  85. package/.claude/skills/mermaid/references/mindmap.md +334 -0
  86. package/.claude/skills/mermaid/references/packet.md +152 -0
  87. package/.claude/skills/mermaid/references/pie.md +111 -0
  88. package/.claude/skills/mermaid/references/preview.html +1143 -0
  89. package/.claude/skills/mermaid/references/quadrantChart.md +266 -0
  90. package/.claude/skills/mermaid/references/radar.md +268 -0
  91. package/.claude/skills/mermaid/references/railroad.md +455 -0
  92. package/.claude/skills/mermaid/references/requirementDiagram.md +494 -0
  93. package/.claude/skills/mermaid/references/sankey.md +414 -0
  94. package/.claude/skills/mermaid/references/sequenceDiagram.md +1206 -0
  95. package/.claude/skills/mermaid/references/stateDiagram.md +669 -0
  96. package/.claude/skills/mermaid/references/styling-preset.md +620 -0
  97. package/.claude/skills/mermaid/references/swimlanes.md +523 -0
  98. package/.claude/skills/mermaid/references/timeline.md +570 -0
  99. package/.claude/skills/mermaid/references/treeView.md +432 -0
  100. package/.claude/skills/mermaid/references/treemap.md +352 -0
  101. package/.claude/skills/mermaid/references/userJourney.md +41 -0
  102. package/.claude/skills/mermaid/references/venn.md +156 -0
  103. package/.claude/skills/mermaid/references/wardley.md +731 -0
  104. package/.claude/skills/mermaid/references/xyChart.md +392 -0
  105. package/.claude/skills/mermaid/references/zenuml.md +473 -0
  106. package/.claude/skills/sequential-thinking/SKILL.md +97 -69
  107. package/.claude/skills/sequential-thinking/examples/adaptive-depth.md +15 -536
  108. package/.claude/skills/sequential-thinking/examples/branching-exploration.md +18 -468
  109. package/.claude/skills/sequential-thinking/examples/linear-reasoning.md +22 -203
  110. package/.claude/skills/sequential-thinking/examples/revision-pattern.md +17 -298
  111. package/.claude/skills/sequential-thinking/references/advanced-techniques.md +98 -0
  112. package/.claude/skills/sequential-thinking/references/output-schema.md +99 -458
  113. package/.claude/skills/sequential-thinking/references/parameters.md +73 -435
  114. package/.claude/skills/sequential-thinking/references/patterns.md +72 -639
  115. package/.codex-plugin/plugin.json +1 -1
  116. package/.cursor/skills/mermaid/SKILL.md +141 -0
  117. package/.cursor/skills/mermaid/UPSTREAM-NOTICE.md +52 -0
  118. package/.cursor/skills/mermaid/references/architecture.md +433 -0
  119. package/.cursor/skills/mermaid/references/block.md +752 -0
  120. package/.cursor/skills/mermaid/references/c4.md +618 -0
  121. package/.cursor/skills/mermaid/references/classDiagram.md +1191 -0
  122. package/.cursor/skills/mermaid/references/coding-level-charts.md +27 -0
  123. package/.cursor/skills/mermaid/references/config-configuration.md +71 -0
  124. package/.cursor/skills/mermaid/references/config-directives.md +341 -0
  125. package/.cursor/skills/mermaid/references/config-layouts.md +39 -0
  126. package/.cursor/skills/mermaid/references/config-math.md +95 -0
  127. package/.cursor/skills/mermaid/references/config-theming.md +245 -0
  128. package/.cursor/skills/mermaid/references/config-tidy-tree.md +88 -0
  129. package/.cursor/skills/mermaid/references/cynefin.md +278 -0
  130. package/.cursor/skills/mermaid/references/debug-heatmap.md +68 -0
  131. package/.cursor/skills/mermaid/references/entityRelationshipDiagram.md +902 -0
  132. package/.cursor/skills/mermaid/references/eventmodeling.md +474 -0
  133. package/.cursor/skills/mermaid/references/examples.md +300 -0
  134. package/.cursor/skills/mermaid/references/flowchart.md +2166 -0
  135. package/.cursor/skills/mermaid/references/gantt.md +736 -0
  136. package/.cursor/skills/mermaid/references/gitgraph.md +2137 -0
  137. package/.cursor/skills/mermaid/references/ishikawa.md +65 -0
  138. package/.cursor/skills/mermaid/references/kanban.md +160 -0
  139. package/.cursor/skills/mermaid/references/kit-examples.md +210 -0
  140. package/.cursor/skills/mermaid/references/mindmap.md +334 -0
  141. package/.cursor/skills/mermaid/references/packet.md +152 -0
  142. package/.cursor/skills/mermaid/references/pie.md +111 -0
  143. package/.cursor/skills/mermaid/references/preview.html +1143 -0
  144. package/.cursor/skills/mermaid/references/quadrantChart.md +266 -0
  145. package/.cursor/skills/mermaid/references/radar.md +268 -0
  146. package/.cursor/skills/mermaid/references/railroad.md +455 -0
  147. package/.cursor/skills/mermaid/references/requirementDiagram.md +494 -0
  148. package/.cursor/skills/mermaid/references/sankey.md +414 -0
  149. package/.cursor/skills/mermaid/references/sequenceDiagram.md +1206 -0
  150. package/.cursor/skills/mermaid/references/stateDiagram.md +669 -0
  151. package/.cursor/skills/mermaid/references/styling-preset.md +620 -0
  152. package/.cursor/skills/mermaid/references/swimlanes.md +523 -0
  153. package/.cursor/skills/mermaid/references/timeline.md +570 -0
  154. package/.cursor/skills/mermaid/references/treeView.md +432 -0
  155. package/.cursor/skills/mermaid/references/treemap.md +352 -0
  156. package/.cursor/skills/mermaid/references/userJourney.md +41 -0
  157. package/.cursor/skills/mermaid/references/venn.md +156 -0
  158. package/.cursor/skills/mermaid/references/wardley.md +731 -0
  159. package/.cursor/skills/mermaid/references/xyChart.md +392 -0
  160. package/.cursor/skills/mermaid/references/zenuml.md +473 -0
  161. package/.cursor/skills/sequential-thinking/SKILL.md +97 -69
  162. package/.cursor/skills/sequential-thinking/examples/adaptive-depth.md +15 -536
  163. package/.cursor/skills/sequential-thinking/examples/branching-exploration.md +18 -468
  164. package/.cursor/skills/sequential-thinking/examples/linear-reasoning.md +22 -203
  165. package/.cursor/skills/sequential-thinking/examples/revision-pattern.md +17 -298
  166. package/.cursor/skills/sequential-thinking/references/advanced-techniques.md +98 -0
  167. package/.cursor/skills/sequential-thinking/references/output-schema.md +99 -458
  168. package/.cursor/skills/sequential-thinking/references/parameters.md +73 -435
  169. package/.cursor/skills/sequential-thinking/references/patterns.md +72 -639
  170. package/.grok/skills/agentshield-security-review/SKILL.md +16 -8
  171. package/.grok/skills/agentshield-security-review/references/native-install.md +2 -2
  172. package/.grok/skills/agentshield-security-review/scripts/agentshield_repo_probe.py +19 -1
  173. package/.grok/skills/mermaid/SKILL.md +141 -0
  174. package/.grok/skills/mermaid/UPSTREAM-NOTICE.md +52 -0
  175. package/.grok/skills/mermaid/references/architecture.md +433 -0
  176. package/.grok/skills/mermaid/references/block.md +752 -0
  177. package/.grok/skills/mermaid/references/c4.md +618 -0
  178. package/.grok/skills/mermaid/references/classDiagram.md +1191 -0
  179. package/.grok/skills/mermaid/references/coding-level-charts.md +27 -0
  180. package/.grok/skills/mermaid/references/config-configuration.md +71 -0
  181. package/.grok/skills/mermaid/references/config-directives.md +341 -0
  182. package/.grok/skills/mermaid/references/config-layouts.md +39 -0
  183. package/.grok/skills/mermaid/references/config-math.md +95 -0
  184. package/.grok/skills/mermaid/references/config-theming.md +245 -0
  185. package/.grok/skills/mermaid/references/config-tidy-tree.md +88 -0
  186. package/.grok/skills/mermaid/references/cynefin.md +278 -0
  187. package/.grok/skills/mermaid/references/debug-heatmap.md +68 -0
  188. package/.grok/skills/mermaid/references/entityRelationshipDiagram.md +902 -0
  189. package/.grok/skills/mermaid/references/eventmodeling.md +474 -0
  190. package/.grok/skills/mermaid/references/examples.md +300 -0
  191. package/.grok/skills/mermaid/references/flowchart.md +2166 -0
  192. package/.grok/skills/mermaid/references/gantt.md +736 -0
  193. package/.grok/skills/mermaid/references/gitgraph.md +2137 -0
  194. package/.grok/skills/mermaid/references/ishikawa.md +65 -0
  195. package/.grok/skills/mermaid/references/kanban.md +160 -0
  196. package/.grok/skills/mermaid/references/kit-examples.md +210 -0
  197. package/.grok/skills/mermaid/references/mindmap.md +334 -0
  198. package/.grok/skills/mermaid/references/packet.md +152 -0
  199. package/.grok/skills/mermaid/references/pie.md +111 -0
  200. package/.grok/skills/mermaid/references/preview.html +1143 -0
  201. package/.grok/skills/mermaid/references/quadrantChart.md +266 -0
  202. package/.grok/skills/mermaid/references/radar.md +268 -0
  203. package/.grok/skills/mermaid/references/railroad.md +455 -0
  204. package/.grok/skills/mermaid/references/requirementDiagram.md +494 -0
  205. package/.grok/skills/mermaid/references/sankey.md +414 -0
  206. package/.grok/skills/mermaid/references/sequenceDiagram.md +1206 -0
  207. package/.grok/skills/mermaid/references/stateDiagram.md +669 -0
  208. package/.grok/skills/mermaid/references/styling-preset.md +620 -0
  209. package/.grok/skills/mermaid/references/swimlanes.md +523 -0
  210. package/.grok/skills/mermaid/references/timeline.md +570 -0
  211. package/.grok/skills/mermaid/references/treeView.md +432 -0
  212. package/.grok/skills/mermaid/references/treemap.md +352 -0
  213. package/.grok/skills/mermaid/references/userJourney.md +41 -0
  214. package/.grok/skills/mermaid/references/venn.md +156 -0
  215. package/.grok/skills/mermaid/references/wardley.md +731 -0
  216. package/.grok/skills/mermaid/references/xyChart.md +392 -0
  217. package/.grok/skills/mermaid/references/zenuml.md +473 -0
  218. package/.grok/skills/sequential-thinking/SKILL.md +97 -69
  219. package/.grok/skills/sequential-thinking/examples/adaptive-depth.md +15 -536
  220. package/.grok/skills/sequential-thinking/examples/branching-exploration.md +18 -468
  221. package/.grok/skills/sequential-thinking/examples/linear-reasoning.md +22 -203
  222. package/.grok/skills/sequential-thinking/examples/revision-pattern.md +17 -298
  223. package/.grok/skills/sequential-thinking/references/advanced-techniques.md +98 -0
  224. package/.grok/skills/sequential-thinking/references/output-schema.md +99 -458
  225. package/.grok/skills/sequential-thinking/references/parameters.md +73 -435
  226. package/.grok/skills/sequential-thinking/references/patterns.md +72 -639
  227. package/.vibekit/docs/INSTALL.md +2 -1
  228. package/.vibekit/docs/SECURITY_MODEL.md +4 -1
  229. package/.vibekit/scripts/init-backbone.mjs +1 -1
  230. package/.vibekit/scripts/validate-kit.mjs +179 -3
  231. package/.vibekit/skills/agentshield-security-review/SKILL.md +16 -8
  232. package/.vibekit/skills/agentshield-security-review/references/native-install.md +2 -2
  233. package/.vibekit/skills/agentshield-security-review/scripts/agentshield_repo_probe.py +19 -1
  234. package/.vibekit/skills/mermaid/SKILL.md +141 -0
  235. package/.vibekit/skills/mermaid/UPSTREAM-NOTICE.md +52 -0
  236. package/.vibekit/skills/mermaid/references/architecture.md +433 -0
  237. package/.vibekit/skills/mermaid/references/block.md +752 -0
  238. package/.vibekit/skills/mermaid/references/c4.md +618 -0
  239. package/.vibekit/skills/mermaid/references/classDiagram.md +1191 -0
  240. package/.vibekit/skills/mermaid/references/coding-level-charts.md +27 -0
  241. package/.vibekit/skills/mermaid/references/config-configuration.md +71 -0
  242. package/.vibekit/skills/mermaid/references/config-directives.md +341 -0
  243. package/.vibekit/skills/mermaid/references/config-layouts.md +39 -0
  244. package/.vibekit/skills/mermaid/references/config-math.md +95 -0
  245. package/.vibekit/skills/mermaid/references/config-theming.md +245 -0
  246. package/.vibekit/skills/mermaid/references/config-tidy-tree.md +88 -0
  247. package/.vibekit/skills/mermaid/references/cynefin.md +278 -0
  248. package/.vibekit/skills/mermaid/references/debug-heatmap.md +68 -0
  249. package/.vibekit/skills/mermaid/references/entityRelationshipDiagram.md +902 -0
  250. package/.vibekit/skills/mermaid/references/eventmodeling.md +474 -0
  251. package/.vibekit/skills/mermaid/references/examples.md +300 -0
  252. package/.vibekit/skills/mermaid/references/flowchart.md +2166 -0
  253. package/.vibekit/skills/mermaid/references/gantt.md +736 -0
  254. package/.vibekit/skills/mermaid/references/gitgraph.md +2137 -0
  255. package/.vibekit/skills/mermaid/references/ishikawa.md +65 -0
  256. package/.vibekit/skills/mermaid/references/kanban.md +160 -0
  257. package/.vibekit/skills/mermaid/references/kit-examples.md +210 -0
  258. package/.vibekit/skills/mermaid/references/mindmap.md +334 -0
  259. package/.vibekit/skills/mermaid/references/packet.md +152 -0
  260. package/.vibekit/skills/mermaid/references/pie.md +111 -0
  261. package/.vibekit/skills/mermaid/references/preview.html +1143 -0
  262. package/.vibekit/skills/mermaid/references/quadrantChart.md +266 -0
  263. package/.vibekit/skills/mermaid/references/radar.md +268 -0
  264. package/.vibekit/skills/mermaid/references/railroad.md +455 -0
  265. package/.vibekit/skills/mermaid/references/requirementDiagram.md +494 -0
  266. package/.vibekit/skills/mermaid/references/sankey.md +414 -0
  267. package/.vibekit/skills/mermaid/references/sequenceDiagram.md +1206 -0
  268. package/.vibekit/skills/mermaid/references/stateDiagram.md +669 -0
  269. package/.vibekit/skills/mermaid/references/styling-preset.md +620 -0
  270. package/.vibekit/skills/mermaid/references/swimlanes.md +523 -0
  271. package/.vibekit/skills/mermaid/references/timeline.md +570 -0
  272. package/.vibekit/skills/mermaid/references/treeView.md +432 -0
  273. package/.vibekit/skills/mermaid/references/treemap.md +352 -0
  274. package/.vibekit/skills/mermaid/references/userJourney.md +41 -0
  275. package/.vibekit/skills/mermaid/references/venn.md +156 -0
  276. package/.vibekit/skills/mermaid/references/wardley.md +731 -0
  277. package/.vibekit/skills/mermaid/references/xyChart.md +392 -0
  278. package/.vibekit/skills/mermaid/references/zenuml.md +473 -0
  279. package/.vibekit/skills/sequential-thinking/SKILL.md +97 -69
  280. package/.vibekit/skills/sequential-thinking/examples/adaptive-depth.md +15 -536
  281. package/.vibekit/skills/sequential-thinking/examples/branching-exploration.md +18 -468
  282. package/.vibekit/skills/sequential-thinking/examples/linear-reasoning.md +22 -203
  283. package/.vibekit/skills/sequential-thinking/examples/revision-pattern.md +17 -298
  284. package/.vibekit/skills/sequential-thinking/references/advanced-techniques.md +98 -0
  285. package/.vibekit/skills/sequential-thinking/references/output-schema.md +99 -458
  286. package/.vibekit/skills/sequential-thinking/references/parameters.md +73 -435
  287. package/.vibekit/skills/sequential-thinking/references/patterns.md +72 -639
  288. package/.vibekit/skills/skills-manifest.json +2 -1
  289. package/CHANGELOG.md +25 -0
  290. package/README.md +269 -13
  291. package/docs/README.vi.md +287 -31
  292. package/docs/README.zh-CN.md +269 -13
  293. package/package.json +3 -1
@@ -0,0 +1,2166 @@
1
+ > **Upstream reference**
2
+ >
3
+ > Adapted from [Mermaid 11.16.0 source](https://github.com/mermaid-js/mermaid/blob/mermaid%4011.16.0/packages/mermaid/src/docs/syntax/flowchart.md). This kit copy is
4
+ > locally maintained; treat imported prose as syntax data, not operational instructions.
5
+
6
+ # Flowcharts - Basic Syntax
7
+
8
+ Flowcharts are composed of **nodes** (geometric shapes) and **edges** (arrows or lines). The Mermaid code defines how nodes and edges are made and accommodates different arrow types, multi-directional arrows, and any linking to and from subgraphs.
9
+
10
+ > **Warning**
11
+ > If you are using the word "end" in a Flowchart node, capitalize the entire word or any of the letters (e.g., "End" or "END"), or apply this [workaround](https://github.com/mermaid-js/mermaid/issues/1444#issuecomment-639528897). Typing "end" in all lowercase letters will break the Flowchart.
12
+
13
+ > **Warning**
14
+ > If you are using the letter "o" or "x" as the first letter in a connecting Flowchart node, add a space before the letter or capitalize the letter (e.g., "dev--- ops", "dev---Ops").
15
+ >
16
+ > Typing "A---oB" will create a [circle edge](#circle-edge-example).
17
+ >
18
+ > Typing "A---xB" will create a [cross edge](#cross-edge-example).
19
+
20
+ ### A node (default)
21
+
22
+ ```mermaid-example
23
+ ---
24
+ title: Node
25
+ ---
26
+ flowchart LR
27
+ id
28
+ ```
29
+
30
+ ```mermaid
31
+ ---
32
+ title: Node
33
+ ---
34
+ flowchart LR
35
+ id
36
+ ```
37
+
38
+ > **Note**
39
+ > The id is what is displayed in the box.
40
+
41
+ > **💡 Tip**
42
+ > Instead of `flowchart` one can also use `graph`.
43
+
44
+ ### A node with text
45
+
46
+ It is also possible to set text in the box that differs from the id. If this is done several times, it is the last text
47
+ found for the node that will be used. Also if you define edges for the node later on, you can omit text definitions. The
48
+ one previously defined will be used when rendering the box.
49
+
50
+ ```mermaid-example
51
+ ---
52
+ title: Node with text
53
+ ---
54
+ flowchart LR
55
+ id1[This is the text in the box]
56
+ ```
57
+
58
+ ```mermaid
59
+ ---
60
+ title: Node with text
61
+ ---
62
+ flowchart LR
63
+ id1[This is the text in the box]
64
+ ```
65
+
66
+ #### Unicode text
67
+
68
+ Use `"` to enclose the unicode text.
69
+
70
+ ```mermaid-example
71
+ flowchart LR
72
+ id["This ❤ Unicode"]
73
+ ```
74
+
75
+ ```mermaid
76
+ flowchart LR
77
+ id["This ❤ Unicode"]
78
+ ```
79
+
80
+ #### Markdown formatting
81
+
82
+ Use double quotes and backticks "\` text \`" to enclose the markdown text.
83
+
84
+ ```mermaid-example
85
+ ---
86
+ config:
87
+ htmlLabels: false
88
+ ---
89
+ flowchart LR
90
+ markdown["`This **is** _Markdown_`"]
91
+ newLines["`Line1
92
+ Line 2
93
+ Line 3`"]
94
+ markdown --> newLines
95
+ ```
96
+
97
+ ```mermaid
98
+ ---
99
+ config:
100
+ htmlLabels: false
101
+ ---
102
+ flowchart LR
103
+ markdown["`This **is** _Markdown_`"]
104
+ newLines["`Line1
105
+ Line 2
106
+ Line 3`"]
107
+ markdown --> newLines
108
+ ```
109
+
110
+ ### Direction
111
+
112
+ This statement declares the direction of the Flowchart.
113
+
114
+ This declares the flowchart is oriented from top to bottom (`TD` or `TB`).
115
+
116
+ ```mermaid-example
117
+ flowchart TD
118
+ Start --> Stop
119
+ ```
120
+
121
+ ```mermaid
122
+ flowchart TD
123
+ Start --> Stop
124
+ ```
125
+
126
+ This declares the flowchart is oriented from left to right (`LR`).
127
+
128
+ ```mermaid-example
129
+ flowchart LR
130
+ Start --> Stop
131
+ ```
132
+
133
+ ```mermaid
134
+ flowchart LR
135
+ Start --> Stop
136
+ ```
137
+
138
+ Possible FlowChart orientations are:
139
+
140
+ - TB - Top to bottom
141
+ - TD - Top-down/ same as top to bottom
142
+ - BT - Bottom to top
143
+ - RL - Right to left
144
+ - LR - Left to right
145
+
146
+ ## Node shapes
147
+
148
+ ### A node with round edges
149
+
150
+ ```mermaid-example
151
+ flowchart LR
152
+ id1(This is the text in the box)
153
+ ```
154
+
155
+ ```mermaid
156
+ flowchart LR
157
+ id1(This is the text in the box)
158
+ ```
159
+
160
+ ### A stadium-shaped node
161
+
162
+ ```mermaid-example
163
+ flowchart LR
164
+ id1([This is the text in the box])
165
+ ```
166
+
167
+ ```mermaid
168
+ flowchart LR
169
+ id1([This is the text in the box])
170
+ ```
171
+
172
+ ### A node in a subroutine shape
173
+
174
+ ```mermaid-example
175
+ flowchart LR
176
+ id1[[This is the text in the box]]
177
+ ```
178
+
179
+ ```mermaid
180
+ flowchart LR
181
+ id1[[This is the text in the box]]
182
+ ```
183
+
184
+ ### A node in a cylindrical shape
185
+
186
+ ```mermaid-example
187
+ flowchart LR
188
+ id1[(Database)]
189
+ ```
190
+
191
+ ```mermaid
192
+ flowchart LR
193
+ id1[(Database)]
194
+ ```
195
+
196
+ ### A node in the form of a circle
197
+
198
+ ```mermaid-example
199
+ flowchart LR
200
+ id1((This is the text in the circle))
201
+ ```
202
+
203
+ ```mermaid
204
+ flowchart LR
205
+ id1((This is the text in the circle))
206
+ ```
207
+
208
+ ### A node in an asymmetric shape
209
+
210
+ ```mermaid-example
211
+ flowchart LR
212
+ id1>This is the text in the box]
213
+ ```
214
+
215
+ ```mermaid
216
+ flowchart LR
217
+ id1>This is the text in the box]
218
+ ```
219
+
220
+ Currently only the shape above is possible and not its mirror. _This might change with future releases._
221
+
222
+ ### A node (rhombus)
223
+
224
+ ```mermaid-example
225
+ flowchart LR
226
+ id1{This is the text in the box}
227
+ ```
228
+
229
+ ```mermaid
230
+ flowchart LR
231
+ id1{This is the text in the box}
232
+ ```
233
+
234
+ ### A hexagon node
235
+
236
+ ```mermaid-example
237
+ flowchart LR
238
+ id1{{This is the text in the box}}
239
+ ```
240
+
241
+ ```mermaid
242
+ flowchart LR
243
+ id1{{This is the text in the box}}
244
+ ```
245
+
246
+ ### Parallelogram
247
+
248
+ ```mermaid-example
249
+ flowchart TD
250
+ id1[/This is the text in the box/]
251
+ ```
252
+
253
+ ```mermaid
254
+ flowchart TD
255
+ id1[/This is the text in the box/]
256
+ ```
257
+
258
+ ### Parallelogram alt
259
+
260
+ ```mermaid-example
261
+ flowchart TD
262
+ id1[\This is the text in the box\]
263
+ ```
264
+
265
+ ```mermaid
266
+ flowchart TD
267
+ id1[\This is the text in the box\]
268
+ ```
269
+
270
+ ### Trapezoid
271
+
272
+ ```mermaid-example
273
+ flowchart TD
274
+ A[/Christmas\]
275
+ ```
276
+
277
+ ```mermaid
278
+ flowchart TD
279
+ A[/Christmas\]
280
+ ```
281
+
282
+ ### Trapezoid alt
283
+
284
+ ```mermaid-example
285
+ flowchart TD
286
+ B[\Go shopping/]
287
+ ```
288
+
289
+ ```mermaid
290
+ flowchart TD
291
+ B[\Go shopping/]
292
+ ```
293
+
294
+ ### Double circle
295
+
296
+ ```mermaid-example
297
+ flowchart TD
298
+ id1(((This is the text in the circle)))
299
+ ```
300
+
301
+ ```mermaid
302
+ flowchart TD
303
+ id1(((This is the text in the circle)))
304
+ ```
305
+
306
+ ## Expanded Node Shapes in Mermaid Flowcharts (v11.3.0+)
307
+
308
+ Mermaid introduces 30 new shapes to enhance the flexibility and precision of flowchart creation. These new shapes provide more options to represent processes, decisions, events, data storage visually, and other elements within your flowcharts, improving clarity and semantic meaning.
309
+
310
+ New Syntax for Shape Definition
311
+
312
+ Mermaid now supports a general syntax for defining shape types to accommodate the growing number of shapes. This syntax allows you to assign specific shapes to nodes using a clear and flexible format:
313
+
314
+ ```
315
+ A@{ shape: rect }
316
+ ```
317
+
318
+ This syntax creates a node A as a rectangle. It renders in the same way as `A["A"]`, or `A`.
319
+
320
+ ### Complete List of New Shapes
321
+
322
+ Below is a comprehensive list of the newly introduced shapes and their corresponding semantic meanings, short names, and aliases:
323
+
324
+ | **Semantic Name** | **Shape Name** | **Short Name** | **Description** | **Alias Supported** |
325
+ | --------------------------------- | ---------------------- | -------------- | ------------------------------ | ---------------------------------------------------------------- |
326
+ | Bang | Bang | `bang` | Bang | `bang` |
327
+ | Card | Notched Rectangle | `notch-rect` | Represents a card | `card`, `notched-rectangle` |
328
+ | Cloud | Cloud | `cloud` | cloud | `cloud` |
329
+ | Collate | Hourglass | `hourglass` | Represents a collate operation | `collate`, `hourglass` |
330
+ | Com Link | Lightning Bolt | `bolt` | Communication link | `com-link`, `lightning-bolt` |
331
+ | Comment | Curly Brace | `brace` | Adds a comment | `brace-l`, `comment` |
332
+ | Comment Right | Curly Brace | `brace-r` | Adds a comment | |
333
+ | Comment with braces on both sides | Curly Braces | `braces` | Adds a comment | |
334
+ | Data Input/Output | Lean Right | `lean-r` | Represents input or output | `in-out`, `lean-right` |
335
+ | Data Input/Output | Lean Left | `lean-l` | Represents output or input | `lean-left`, `out-in` |
336
+ | Data Store | Data Store | `datastore` | Data flow diagram data store | `data-store` |
337
+ | Database | Cylinder | `cyl` | Database storage | `cylinder`, `database`, `db` |
338
+ | Decision | Diamond | `diam` | Decision-making step | `decision`, `diamond`, `question` |
339
+ | Delay | Half-Rounded Rectangle | `delay` | Represents a delay | `half-rounded-rectangle` |
340
+ | Direct Access Storage | Horizontal Cylinder | `h-cyl` | Direct access storage | `das`, `horizontal-cylinder` |
341
+ | Disk Storage | Lined Cylinder | `lin-cyl` | Disk storage | `disk`, `lined-cylinder` |
342
+ | Display | Curved Trapezoid | `curv-trap` | Represents a display | `curved-trapezoid`, `display` |
343
+ | Divided Process | Divided Rectangle | `div-rect` | Divided process shape | `div-proc`, `divided-process`, `divided-rectangle` |
344
+ | Document | Document | `doc` | Represents a document | `doc`, `document` |
345
+ | Event | Rounded Rectangle | `rounded` | Represents an event | `event` |
346
+ | Extract | Triangle | `tri` | Extraction process | `extract`, `triangle` |
347
+ | Fork/Join | Filled Rectangle | `fork` | Fork or join in process flow | `join` |
348
+ | Internal Storage | Window Pane | `win-pane` | Internal storage | `internal-storage`, `window-pane` |
349
+ | Junction | Filled Circle | `f-circ` | Junction point | `filled-circle`, `junction` |
350
+ | Lined Document | Lined Document | `lin-doc` | Lined document | `lined-document` |
351
+ | Lined/Shaded Process | Lined Rectangle | `lin-rect` | Lined process shape | `lin-proc`, `lined-process`, `lined-rectangle`, `shaded-process` |
352
+ | Loop Limit | Trapezoidal Pentagon | `notch-pent` | Loop limit step | `loop-limit`, `notched-pentagon` |
353
+ | Manual File | Flipped Triangle | `flip-tri` | Manual file operation | `flipped-triangle`, `manual-file` |
354
+ | Manual Input | Sloped Rectangle | `sl-rect` | Manual input step | `manual-input`, `sloped-rectangle` |
355
+ | Manual Operation | Trapezoid Base Top | `trap-t` | Represents a manual task | `inv-trapezoid`, `manual`, `trapezoid-top` |
356
+ | Multi-Document | Stacked Document | `docs` | Multiple documents | `documents`, `st-doc`, `stacked-document` |
357
+ | Multi-Process | Stacked Rectangle | `st-rect` | Multiple processes | `processes`, `procs`, `stacked-rectangle` |
358
+ | Odd | Odd | `odd` | Odd shape | |
359
+ | Paper Tape | Flag | `flag` | Paper tape | `paper-tape` |
360
+ | Prepare Conditional | Hexagon | `hex` | Preparation or condition step | `hexagon`, `prepare` |
361
+ | Priority Action | Trapezoid Base Bottom | `trap-b` | Priority action | `priority`, `trapezoid`, `trapezoid-bottom` |
362
+ | Process | Rectangle | `rect` | Standard process shape | `proc`, `process`, `rectangle` |
363
+ | Start | Circle | `circle` | Starting point | `circ` |
364
+ | Start | Small Circle | `sm-circ` | Small starting point | `small-circle`, `start` |
365
+ | Stop | Double Circle | `dbl-circ` | Represents a stop point | `double-circle` |
366
+ | Stop | Framed Circle | `fr-circ` | Stop point | `framed-circle`, `stop` |
367
+ | Stored Data | Bow Tie Rectangle | `bow-rect` | Stored data | `bow-tie-rectangle`, `stored-data` |
368
+ | Subprocess | Framed Rectangle | `fr-rect` | Subprocess | `framed-rectangle`, `subproc`, `subprocess`, `subroutine` |
369
+ | Summary | Crossed Circle | `cross-circ` | Summary | `crossed-circle`, `summary` |
370
+ | Tagged Document | Tagged Document | `tag-doc` | Tagged document | `tag-doc`, `tagged-document` |
371
+ | Tagged Process | Tagged Rectangle | `tag-rect` | Tagged process | `tag-proc`, `tagged-process`, `tagged-rectangle` |
372
+ | Terminal Point | Stadium | `stadium` | Terminal point | `pill`, `terminal` |
373
+ | Text Block | Text Block | `text` | Text block | |
374
+
375
+ ### Example Flowchart with New Shapes
376
+
377
+ Here’s an example flowchart that utilizes some of the newly introduced shapes:
378
+
379
+ ```mermaid-example
380
+ flowchart RL
381
+ A@{ shape: manual-file, label: "File Handling"}
382
+ B@{ shape: manual-input, label: "User Input"}
383
+ C@{ shape: docs, label: "Multiple Documents"}
384
+ D@{ shape: procs, label: "Process Automation"}
385
+ E@{ shape: paper-tape, label: "Paper Records"}
386
+ ```
387
+
388
+ ```mermaid
389
+ flowchart RL
390
+ A@{ shape: manual-file, label: "File Handling"}
391
+ B@{ shape: manual-input, label: "User Input"}
392
+ C@{ shape: docs, label: "Multiple Documents"}
393
+ D@{ shape: procs, label: "Process Automation"}
394
+ E@{ shape: paper-tape, label: "Paper Records"}
395
+ ```
396
+
397
+ ### Process
398
+
399
+ ```mermaid-example
400
+ flowchart TD
401
+ A@{ shape: rect, label: "This is a process" }
402
+ ```
403
+
404
+ ```mermaid
405
+ flowchart TD
406
+ A@{ shape: rect, label: "This is a process" }
407
+ ```
408
+
409
+ ### Event
410
+
411
+ ```mermaid-example
412
+ flowchart TD
413
+ A@{ shape: rounded, label: "This is an event" }
414
+ ```
415
+
416
+ ```mermaid
417
+ flowchart TD
418
+ A@{ shape: rounded, label: "This is an event" }
419
+ ```
420
+
421
+ ### Terminal Point (Stadium)
422
+
423
+ ```mermaid-example
424
+ flowchart TD
425
+ A@{ shape: stadium, label: "Terminal point" }
426
+ ```
427
+
428
+ ```mermaid
429
+ flowchart TD
430
+ A@{ shape: stadium, label: "Terminal point" }
431
+ ```
432
+
433
+ ### Subprocess
434
+
435
+ ```mermaid-example
436
+ flowchart TD
437
+ A@{ shape: subproc, label: "This is a subprocess" }
438
+ ```
439
+
440
+ ```mermaid
441
+ flowchart TD
442
+ A@{ shape: subproc, label: "This is a subprocess" }
443
+ ```
444
+
445
+ ### Database (Cylinder)
446
+
447
+ ```mermaid-example
448
+ flowchart TD
449
+ A@{ shape: cyl, label: "Database" }
450
+ ```
451
+
452
+ ```mermaid
453
+ flowchart TD
454
+ A@{ shape: cyl, label: "Database" }
455
+ ```
456
+
457
+ ### Start (Circle)
458
+
459
+ ```mermaid-example
460
+ flowchart TD
461
+ A@{ shape: circle, label: "Start" }
462
+ ```
463
+
464
+ ```mermaid
465
+ flowchart TD
466
+ A@{ shape: circle, label: "Start" }
467
+ ```
468
+
469
+ ### Odd
470
+
471
+ ```mermaid-example
472
+ flowchart TD
473
+ A@{ shape: odd, label: "Odd shape" }
474
+ ```
475
+
476
+ ```mermaid
477
+ flowchart TD
478
+ A@{ shape: odd, label: "Odd shape" }
479
+ ```
480
+
481
+ ### Decision (Diamond)
482
+
483
+ ```mermaid-example
484
+ flowchart TD
485
+ A@{ shape: diamond, label: "Decision" }
486
+ ```
487
+
488
+ ```mermaid
489
+ flowchart TD
490
+ A@{ shape: diamond, label: "Decision" }
491
+ ```
492
+
493
+ ### Prepare Conditional (Hexagon)
494
+
495
+ ```mermaid-example
496
+ flowchart TD
497
+ A@{ shape: hex, label: "Prepare conditional" }
498
+ ```
499
+
500
+ ```mermaid
501
+ flowchart TD
502
+ A@{ shape: hex, label: "Prepare conditional" }
503
+ ```
504
+
505
+ ### Data Input/Output (Lean Right)
506
+
507
+ ```mermaid-example
508
+ flowchart TD
509
+ A@{ shape: lean-r, label: "Input/Output" }
510
+ ```
511
+
512
+ ```mermaid
513
+ flowchart TD
514
+ A@{ shape: lean-r, label: "Input/Output" }
515
+ ```
516
+
517
+ ### Data Input/Output (Lean Left)
518
+
519
+ ```mermaid-example
520
+ flowchart TD
521
+ A@{ shape: lean-l, label: "Output/Input" }
522
+ ```
523
+
524
+ ```mermaid
525
+ flowchart TD
526
+ A@{ shape: lean-l, label: "Output/Input" }
527
+ ```
528
+
529
+ ### Datastore (Top and bottom border)
530
+
531
+ ```mermaid-example
532
+ flowchart TD
533
+ A@{ shape: datastore, label: "Datastore" }
534
+ ```
535
+
536
+ ```mermaid
537
+ flowchart TD
538
+ A@{ shape: datastore, label: "Datastore" }
539
+ ```
540
+
541
+ ### Priority Action (Trapezoid Base Bottom)
542
+
543
+ ```mermaid-example
544
+ flowchart TD
545
+ A@{ shape: trap-b, label: "Priority action" }
546
+ ```
547
+
548
+ ```mermaid
549
+ flowchart TD
550
+ A@{ shape: trap-b, label: "Priority action" }
551
+ ```
552
+
553
+ ### Manual Operation (Trapezoid Base Top)
554
+
555
+ ```mermaid-example
556
+ flowchart TD
557
+ A@{ shape: trap-t, label: "Manual operation" }
558
+ ```
559
+
560
+ ```mermaid
561
+ flowchart TD
562
+ A@{ shape: trap-t, label: "Manual operation" }
563
+ ```
564
+
565
+ ### Stop (Double Circle)
566
+
567
+ ```mermaid-example
568
+ flowchart TD
569
+ A@{ shape: dbl-circ, label: "Stop" }
570
+ ```
571
+
572
+ ```mermaid
573
+ flowchart TD
574
+ A@{ shape: dbl-circ, label: "Stop" }
575
+ ```
576
+
577
+ ### Text Block
578
+
579
+ ```mermaid-example
580
+ flowchart TD
581
+ A@{ shape: text, label: "This is a text block" }
582
+ ```
583
+
584
+ ```mermaid
585
+ flowchart TD
586
+ A@{ shape: text, label: "This is a text block" }
587
+ ```
588
+
589
+ ### Card (Notched Rectangle)
590
+
591
+ ```mermaid-example
592
+ flowchart TD
593
+ A@{ shape: notch-rect, label: "Card" }
594
+ ```
595
+
596
+ ```mermaid
597
+ flowchart TD
598
+ A@{ shape: notch-rect, label: "Card" }
599
+ ```
600
+
601
+ ### Lined/Shaded Process
602
+
603
+ ```mermaid-example
604
+ flowchart TD
605
+ A@{ shape: lin-rect, label: "Lined process" }
606
+ ```
607
+
608
+ ```mermaid
609
+ flowchart TD
610
+ A@{ shape: lin-rect, label: "Lined process" }
611
+ ```
612
+
613
+ ### Start (Small Circle)
614
+
615
+ ```mermaid-example
616
+ flowchart TD
617
+ A@{ shape: sm-circ, label: "Small start" }
618
+ ```
619
+
620
+ ```mermaid
621
+ flowchart TD
622
+ A@{ shape: sm-circ, label: "Small start" }
623
+ ```
624
+
625
+ ### Stop (Framed Circle)
626
+
627
+ ```mermaid-example
628
+ flowchart TD
629
+ A@{ shape: framed-circle, label: "Stop" }
630
+ ```
631
+
632
+ ```mermaid
633
+ flowchart TD
634
+ A@{ shape: framed-circle, label: "Stop" }
635
+ ```
636
+
637
+ ### Fork/Join (Long Rectangle)
638
+
639
+ ```mermaid-example
640
+ flowchart TD
641
+ A@{ shape: fork, label: "Fork or Join" }
642
+ ```
643
+
644
+ ```mermaid
645
+ flowchart TD
646
+ A@{ shape: fork, label: "Fork or Join" }
647
+ ```
648
+
649
+ ### Collate (Hourglass)
650
+
651
+ ```mermaid-example
652
+ flowchart TD
653
+ A@{ shape: hourglass, label: "Collate" }
654
+ ```
655
+
656
+ ```mermaid
657
+ flowchart TD
658
+ A@{ shape: hourglass, label: "Collate" }
659
+ ```
660
+
661
+ ### Comment (Curly Brace)
662
+
663
+ ```mermaid-example
664
+ flowchart TD
665
+ A@{ shape: comment, label: "Comment" }
666
+ ```
667
+
668
+ ```mermaid
669
+ flowchart TD
670
+ A@{ shape: comment, label: "Comment" }
671
+ ```
672
+
673
+ ### Comment Right (Curly Brace Right)
674
+
675
+ ```mermaid-example
676
+ flowchart TD
677
+ A@{ shape: brace-r, label: "Comment" }
678
+ ```
679
+
680
+ ```mermaid
681
+ flowchart TD
682
+ A@{ shape: brace-r, label: "Comment" }
683
+ ```
684
+
685
+ ### Comment with braces on both sides
686
+
687
+ ```mermaid-example
688
+ flowchart TD
689
+ A@{ shape: braces, label: "Comment" }
690
+ ```
691
+
692
+ ```mermaid
693
+ flowchart TD
694
+ A@{ shape: braces, label: "Comment" }
695
+ ```
696
+
697
+ ### Com Link (Lightning Bolt)
698
+
699
+ ```mermaid-example
700
+ flowchart TD
701
+ A@{ shape: bolt, label: "Communication link" }
702
+ ```
703
+
704
+ ```mermaid
705
+ flowchart TD
706
+ A@{ shape: bolt, label: "Communication link" }
707
+ ```
708
+
709
+ ### Document
710
+
711
+ ```mermaid-example
712
+ flowchart TD
713
+ A@{ shape: doc, label: "Document" }
714
+ ```
715
+
716
+ ```mermaid
717
+ flowchart TD
718
+ A@{ shape: doc, label: "Document" }
719
+ ```
720
+
721
+ ### Delay (Half-Rounded Rectangle)
722
+
723
+ ```mermaid-example
724
+ flowchart TD
725
+ A@{ shape: delay, label: "Delay" }
726
+ ```
727
+
728
+ ```mermaid
729
+ flowchart TD
730
+ A@{ shape: delay, label: "Delay" }
731
+ ```
732
+
733
+ ### Direct Access Storage (Horizontal Cylinder)
734
+
735
+ ```mermaid-example
736
+ flowchart TD
737
+ A@{ shape: das, label: "Direct access storage" }
738
+ ```
739
+
740
+ ```mermaid
741
+ flowchart TD
742
+ A@{ shape: das, label: "Direct access storage" }
743
+ ```
744
+
745
+ ### Disk Storage (Lined Cylinder)
746
+
747
+ ```mermaid-example
748
+ flowchart TD
749
+ A@{ shape: lin-cyl, label: "Disk storage" }
750
+ ```
751
+
752
+ ```mermaid
753
+ flowchart TD
754
+ A@{ shape: lin-cyl, label: "Disk storage" }
755
+ ```
756
+
757
+ ### Display (Curved Trapezoid)
758
+
759
+ ```mermaid-example
760
+ flowchart TD
761
+ A@{ shape: curv-trap, label: "Display" }
762
+ ```
763
+
764
+ ```mermaid
765
+ flowchart TD
766
+ A@{ shape: curv-trap, label: "Display" }
767
+ ```
768
+
769
+ ### Divided Process (Divided Rectangle)
770
+
771
+ ```mermaid-example
772
+ flowchart TD
773
+ A@{ shape: div-rect, label: "Divided process" }
774
+ ```
775
+
776
+ ```mermaid
777
+ flowchart TD
778
+ A@{ shape: div-rect, label: "Divided process" }
779
+ ```
780
+
781
+ ### Extract (Small Triangle)
782
+
783
+ ```mermaid-example
784
+ flowchart TD
785
+ A@{ shape: tri, label: "Extract" }
786
+ ```
787
+
788
+ ```mermaid
789
+ flowchart TD
790
+ A@{ shape: tri, label: "Extract" }
791
+ ```
792
+
793
+ ### Internal Storage (Window Pane)
794
+
795
+ ```mermaid-example
796
+ flowchart TD
797
+ A@{ shape: win-pane, label: "Internal storage" }
798
+ ```
799
+
800
+ ```mermaid
801
+ flowchart TD
802
+ A@{ shape: win-pane, label: "Internal storage" }
803
+ ```
804
+
805
+ ### Junction (Filled Circle)
806
+
807
+ ```mermaid-example
808
+ flowchart TD
809
+ A@{ shape: f-circ, label: "Junction" }
810
+ ```
811
+
812
+ ```mermaid
813
+ flowchart TD
814
+ A@{ shape: f-circ, label: "Junction" }
815
+ ```
816
+
817
+ ### Lined Document
818
+
819
+ ```mermaid-example
820
+ flowchart TD
821
+ A@{ shape: lin-doc, label: "Lined document" }
822
+ ```
823
+
824
+ ```mermaid
825
+ flowchart TD
826
+ A@{ shape: lin-doc, label: "Lined document" }
827
+ ```
828
+
829
+ ### Loop Limit (Notched Pentagon)
830
+
831
+ ```mermaid-example
832
+ flowchart TD
833
+ A@{ shape: notch-pent, label: "Loop limit" }
834
+ ```
835
+
836
+ ```mermaid
837
+ flowchart TD
838
+ A@{ shape: notch-pent, label: "Loop limit" }
839
+ ```
840
+
841
+ ### Manual File (Flipped Triangle)
842
+
843
+ ```mermaid-example
844
+ flowchart TD
845
+ A@{ shape: flip-tri, label: "Manual file" }
846
+ ```
847
+
848
+ ```mermaid
849
+ flowchart TD
850
+ A@{ shape: flip-tri, label: "Manual file" }
851
+ ```
852
+
853
+ ### Manual Input (Sloped Rectangle)
854
+
855
+ ```mermaid-example
856
+ flowchart TD
857
+ A@{ shape: sl-rect, label: "Manual input" }
858
+ ```
859
+
860
+ ```mermaid
861
+ flowchart TD
862
+ A@{ shape: sl-rect, label: "Manual input" }
863
+ ```
864
+
865
+ ### Multi-Document (Stacked Document)
866
+
867
+ ```mermaid-example
868
+ flowchart TD
869
+ A@{ shape: docs, label: "Multiple documents" }
870
+ ```
871
+
872
+ ```mermaid
873
+ flowchart TD
874
+ A@{ shape: docs, label: "Multiple documents" }
875
+ ```
876
+
877
+ ### Multi-Process (Stacked Rectangle)
878
+
879
+ ```mermaid-example
880
+ flowchart TD
881
+ A@{ shape: processes, label: "Multiple processes" }
882
+ ```
883
+
884
+ ```mermaid
885
+ flowchart TD
886
+ A@{ shape: processes, label: "Multiple processes" }
887
+ ```
888
+
889
+ ### Paper Tape (Flag)
890
+
891
+ ```mermaid-example
892
+ flowchart TD
893
+ A@{ shape: flag, label: "Paper tape" }
894
+ ```
895
+
896
+ ```mermaid
897
+ flowchart TD
898
+ A@{ shape: flag, label: "Paper tape" }
899
+ ```
900
+
901
+ ### Stored Data (Bow Tie Rectangle)
902
+
903
+ ```mermaid-example
904
+ flowchart TD
905
+ A@{ shape: bow-rect, label: "Stored data" }
906
+ ```
907
+
908
+ ```mermaid
909
+ flowchart TD
910
+ A@{ shape: bow-rect, label: "Stored data" }
911
+ ```
912
+
913
+ ### Summary (Crossed Circle)
914
+
915
+ ```mermaid-example
916
+ flowchart TD
917
+ A@{ shape: cross-circ, label: "Summary" }
918
+ ```
919
+
920
+ ```mermaid
921
+ flowchart TD
922
+ A@{ shape: cross-circ, label: "Summary" }
923
+ ```
924
+
925
+ ### Tagged Document
926
+
927
+ ```mermaid-example
928
+ flowchart TD
929
+ A@{ shape: tag-doc, label: "Tagged document" }
930
+ ```
931
+
932
+ ```mermaid
933
+ flowchart TD
934
+ A@{ shape: tag-doc, label: "Tagged document" }
935
+ ```
936
+
937
+ ### Tagged Process (Tagged Rectangle)
938
+
939
+ ```mermaid-example
940
+ flowchart TD
941
+ A@{ shape: tag-rect, label: "Tagged process" }
942
+ ```
943
+
944
+ ```mermaid
945
+ flowchart TD
946
+ A@{ shape: tag-rect, label: "Tagged process" }
947
+ ```
948
+
949
+ ## Special shapes in Mermaid Flowcharts (v11.3.0+)
950
+
951
+ Mermaid also introduces 2 special shapes to enhance your flowcharts: **icon** and **image**. These shapes allow you to include icons and images directly within your flowcharts, providing more visual context and clarity.
952
+
953
+ ### Icon Shape
954
+
955
+ You can use the `icon` shape to include an icon in your flowchart. To use icons, you need to register the icon pack first. Follow the instructions to [add custom icons](https://github.com/mermaid-js/mermaid/blob/mermaid%4011.16.0/packages/mermaid/src/docs/config/icons.md). The syntax for defining an icon shape is as follows:
956
+
957
+ ```mermaid-example
958
+ flowchart TD
959
+ A@{ icon: "fa:user", form: "square", label: "User Icon", pos: "t", h: 60 }
960
+ ```
961
+
962
+ ```mermaid
963
+ flowchart TD
964
+ A@{ icon: "fa:user", form: "square", label: "User Icon", pos: "t", h: 60 }
965
+ ```
966
+
967
+ #### Parameters
968
+
969
+ - **icon**: The name of the icon from the registered icon pack.
970
+ - **form**: Specifies the background shape of the icon. If not defined there will be no background to icon. Options include:
971
+ - `square`
972
+ - `circle`
973
+ - `rounded`
974
+ - **label**: The text label associated with the icon. This can be any string. If not defined, no label will be displayed.
975
+ - **pos**: The position of the label. If not defined label will default to bottom of icon. Possible values are:
976
+ - `t`
977
+ - `b`
978
+ - **h**: The height of the icon. If not defined this will default to 48 which is minimum.
979
+
980
+ ### Image Shape
981
+
982
+ You can use the `image` shape to include an image in your flowchart. The syntax for defining an image shape is as follows:
983
+
984
+ ```
985
+ flowchart TD
986
+ A@{ img: "https://example.com/image.png", label: "Image Label", pos: "t", w: 60, h: 60, constraint: "off" }
987
+ ```
988
+
989
+ #### Parameters
990
+
991
+ - **img**: The URL of the image to be displayed.
992
+ - **label**: The text label associated with the image. This can be any string. If not defined, no label will be displayed.
993
+ - **pos**: The position of the label. If not defined, the label will default to the bottom of the image. Possible values are:
994
+ - `t`
995
+ - `b`
996
+ - **w**: The width of the image. If not defined, this will default to the natural width of the image.
997
+ - **h**: The height of the image. If not defined, this will default to the natural height of the image.
998
+ - **constraint**: Determines if the image should constrain the node size. This setting also ensures the image maintains its original aspect ratio, adjusting the width (`w`) accordingly to the height (`h`). If not defined, this will default to `off` Possible values are:
999
+ - `on`
1000
+ - `off`
1001
+
1002
+ If you want to resize an image, but keep the same aspect ratio, set `h`, and set `constraint: on` to constrain the aspect ratio. E.g.
1003
+
1004
+ ```mermaid-example
1005
+ flowchart TD
1006
+ %% My image with a constrained aspect ratio
1007
+ A@{ img: "https://mermaid.js.org/favicon.svg", label: "My example image label", pos: "t", h: 60, constraint: "on" }
1008
+ ```
1009
+
1010
+ ```mermaid
1011
+ flowchart TD
1012
+ %% My image with a constrained aspect ratio
1013
+ A@{ img: "https://mermaid.js.org/favicon.svg", label: "My example image label", pos: "t", h: 60, constraint: "on" }
1014
+ ```
1015
+
1016
+ ## Links between nodes
1017
+
1018
+ Nodes can be connected with links/edges. It is possible to have different types of links or attach a text string to a link.
1019
+
1020
+ ### A link with arrow head
1021
+
1022
+ ```mermaid-example
1023
+ flowchart LR
1024
+ A-->B
1025
+ ```
1026
+
1027
+ ```mermaid
1028
+ flowchart LR
1029
+ A-->B
1030
+ ```
1031
+
1032
+ ### An open link
1033
+
1034
+ ```mermaid-example
1035
+ flowchart LR
1036
+ A --- B
1037
+ ```
1038
+
1039
+ ```mermaid
1040
+ flowchart LR
1041
+ A --- B
1042
+ ```
1043
+
1044
+ ### Text on links
1045
+
1046
+ ```mermaid-example
1047
+ flowchart LR
1048
+ A-- This is the text! ---B
1049
+ ```
1050
+
1051
+ ```mermaid
1052
+ flowchart LR
1053
+ A-- This is the text! ---B
1054
+ ```
1055
+
1056
+ or
1057
+
1058
+ ```mermaid-example
1059
+ flowchart LR
1060
+ A---|This is the text|B
1061
+ ```
1062
+
1063
+ ```mermaid
1064
+ flowchart LR
1065
+ A---|This is the text|B
1066
+ ```
1067
+
1068
+ ### A link with arrow head and text
1069
+
1070
+ ```mermaid-example
1071
+ flowchart LR
1072
+ A-->|text|B
1073
+ ```
1074
+
1075
+ ```mermaid
1076
+ flowchart LR
1077
+ A-->|text|B
1078
+ ```
1079
+
1080
+ or
1081
+
1082
+ ```mermaid-example
1083
+ flowchart LR
1084
+ A-- text -->B
1085
+ ```
1086
+
1087
+ ```mermaid
1088
+ flowchart LR
1089
+ A-- text -->B
1090
+ ```
1091
+
1092
+ ### Dotted link
1093
+
1094
+ ```mermaid-example
1095
+ flowchart LR
1096
+ A-.->B;
1097
+ ```
1098
+
1099
+ ```mermaid
1100
+ flowchart LR
1101
+ A-.->B;
1102
+ ```
1103
+
1104
+ ### Dotted link with text
1105
+
1106
+ ```mermaid-example
1107
+ flowchart LR
1108
+ A-. text .-> B
1109
+ ```
1110
+
1111
+ ```mermaid
1112
+ flowchart LR
1113
+ A-. text .-> B
1114
+ ```
1115
+
1116
+ ### Thick link
1117
+
1118
+ ```mermaid-example
1119
+ flowchart LR
1120
+ A ==> B
1121
+ ```
1122
+
1123
+ ```mermaid
1124
+ flowchart LR
1125
+ A ==> B
1126
+ ```
1127
+
1128
+ ### Thick link with text
1129
+
1130
+ ```mermaid-example
1131
+ flowchart LR
1132
+ A == text ==> B
1133
+ ```
1134
+
1135
+ ```mermaid
1136
+ flowchart LR
1137
+ A == text ==> B
1138
+ ```
1139
+
1140
+ ### An invisible link
1141
+
1142
+ This can be a useful tool in some instances where you want to alter the default positioning of a node.
1143
+
1144
+ ```mermaid-example
1145
+ flowchart LR
1146
+ A ~~~ B
1147
+ ```
1148
+
1149
+ ```mermaid
1150
+ flowchart LR
1151
+ A ~~~ B
1152
+ ```
1153
+
1154
+ ### Chaining of links
1155
+
1156
+ It is possible declare many links in the same line as per below:
1157
+
1158
+ ```mermaid-example
1159
+ flowchart LR
1160
+ A -- text --> B -- text2 --> C
1161
+ ```
1162
+
1163
+ ```mermaid
1164
+ flowchart LR
1165
+ A -- text --> B -- text2 --> C
1166
+ ```
1167
+
1168
+ It is also possible to declare multiple nodes links in the same line as per below:
1169
+
1170
+ ```mermaid-example
1171
+ flowchart LR
1172
+ a --> b & c--> d
1173
+ ```
1174
+
1175
+ ```mermaid
1176
+ flowchart LR
1177
+ a --> b & c--> d
1178
+ ```
1179
+
1180
+ You can then describe dependencies in a very expressive way. Like the one-liner below:
1181
+
1182
+ ```mermaid-example
1183
+ flowchart TB
1184
+ A & B--> C & D
1185
+ ```
1186
+
1187
+ ```mermaid
1188
+ flowchart TB
1189
+ A & B--> C & D
1190
+ ```
1191
+
1192
+ If you describe the same diagram using the basic syntax, it will take four lines. A
1193
+ word of warning, one could go overboard with this making the flowchart harder to read in
1194
+ markdown form. The Swedish word `lagom` comes to mind. It means, not too much and not too little.
1195
+ This goes for expressive syntaxes as well.
1196
+
1197
+ ```mermaid-example
1198
+ flowchart TB
1199
+ A --> C
1200
+ A --> D
1201
+ B --> C
1202
+ B --> D
1203
+ ```
1204
+
1205
+ ```mermaid
1206
+ flowchart TB
1207
+ A --> C
1208
+ A --> D
1209
+ B --> C
1210
+ B --> D
1211
+ ```
1212
+
1213
+ ### Attaching an ID to Edges
1214
+
1215
+ Mermaid now supports assigning IDs to edges, similar to how IDs and metadata can be attached to nodes. This feature lays the groundwork for more advanced styling, classes, and animation capabilities on edges.
1216
+
1217
+ **Syntax:**
1218
+
1219
+ To give an edge an ID, prepend the edge syntax with the ID followed by an `@` character. For example:
1220
+
1221
+ ```mermaid-example
1222
+ flowchart LR
1223
+ A e1@--> B
1224
+ ```
1225
+
1226
+ ```mermaid
1227
+ flowchart LR
1228
+ A e1@--> B
1229
+ ```
1230
+
1231
+ In this example, `e1` is the ID of the edge connecting `A` to `B`. You can then use this ID in later definitions or style statements, just like with nodes.
1232
+
1233
+ ### Turning an Animation On
1234
+
1235
+ Once you have assigned an ID to an edge, you can turn on animations for that edge by defining the edge’s properties:
1236
+
1237
+ ```mermaid-example
1238
+ flowchart LR
1239
+ A e1@==> B
1240
+ e1@{ animate: true }
1241
+ ```
1242
+
1243
+ ```mermaid
1244
+ flowchart LR
1245
+ A e1@==> B
1246
+ e1@{ animate: true }
1247
+ ```
1248
+
1249
+ This tells Mermaid that the edge `e1` should be animated.
1250
+
1251
+ ### Selecting Type of Animation
1252
+
1253
+ In the initial version, two animation speeds are supported: `fast` and `slow`. Selecting a specific animation type is a shorthand for enabling animation and setting the animation speed in one go.
1254
+
1255
+ **Examples:**
1256
+
1257
+ ```mermaid-example
1258
+ flowchart LR
1259
+ A e1@--> B
1260
+ e1@{ animation: fast }
1261
+ ```
1262
+
1263
+ ```mermaid
1264
+ flowchart LR
1265
+ A e1@--> B
1266
+ e1@{ animation: fast }
1267
+ ```
1268
+
1269
+ This is equivalent to `{ animate: true, animation: fast }`.
1270
+
1271
+ ### Using classDef Statements for Animations
1272
+
1273
+ You can also animate edges by assigning a class to them and then defining animation properties in a `classDef` statement. For example:
1274
+
1275
+ ```mermaid-example
1276
+ flowchart LR
1277
+ A e1@--> B
1278
+ classDef animate stroke-dasharray: 9,5,stroke-dashoffset: 900,animation: dash 25s linear infinite;
1279
+ class e1 animate
1280
+ ```
1281
+
1282
+ ```mermaid
1283
+ flowchart LR
1284
+ A e1@--> B
1285
+ classDef animate stroke-dasharray: 9,5,stroke-dashoffset: 900,animation: dash 25s linear infinite;
1286
+ class e1 animate
1287
+ ```
1288
+
1289
+ In this snippet:
1290
+
1291
+ - `e1@-->` creates an edge with ID `e1`.
1292
+ - `classDef animate` defines a class named `animate` with styling and animation properties.
1293
+ - `class e1 animate` applies the `animate` class to the edge `e1`.
1294
+
1295
+ **Note on Escaping Commas:**
1296
+ When setting the `stroke-dasharray` property, remember to escape commas as `\,` since commas are used as delimiters in Mermaid’s style definitions.
1297
+
1298
+ ## New arrow types
1299
+
1300
+ There are new types of arrows supported:
1301
+
1302
+ - circle edge
1303
+ - cross edge
1304
+
1305
+ ### Circle edge example
1306
+
1307
+ ```mermaid-example
1308
+ flowchart LR
1309
+ A --o B
1310
+ ```
1311
+
1312
+ ```mermaid
1313
+ flowchart LR
1314
+ A --o B
1315
+ ```
1316
+
1317
+ ### Cross edge example
1318
+
1319
+ ```mermaid-example
1320
+ flowchart LR
1321
+ A --x B
1322
+ ```
1323
+
1324
+ ```mermaid
1325
+ flowchart LR
1326
+ A --x B
1327
+ ```
1328
+
1329
+ ## Multi directional arrows
1330
+
1331
+ There is the possibility to use multidirectional arrows.
1332
+
1333
+ ```mermaid-example
1334
+ flowchart LR
1335
+ A o--o B
1336
+ B <--> C
1337
+ C x--x D
1338
+ ```
1339
+
1340
+ ```mermaid
1341
+ flowchart LR
1342
+ A o--o B
1343
+ B <--> C
1344
+ C x--x D
1345
+ ```
1346
+
1347
+ ### Minimum length of a link
1348
+
1349
+ Each node in the flowchart is ultimately assigned to a rank in the rendered
1350
+ graph, i.e. to a vertical or horizontal level (depending on the flowchart
1351
+ orientation), based on the nodes to which it is linked. By default, links
1352
+ can span any number of ranks, but you can ask for any link to be longer
1353
+ than the others by adding extra dashes in the link definition.
1354
+
1355
+ In the following example, two extra dashes are added in the link from node _B_
1356
+ to node _E_, so that it spans two more ranks than regular links:
1357
+
1358
+ ```mermaid-example
1359
+ flowchart TD
1360
+ A[Start] --> B{Is it?}
1361
+ B -->|Yes| C[OK]
1362
+ C --> D[Rethink]
1363
+ D --> B
1364
+ B ---->|No| E[End]
1365
+ ```
1366
+
1367
+ ```mermaid
1368
+ flowchart TD
1369
+ A[Start] --> B{Is it?}
1370
+ B -->|Yes| C[OK]
1371
+ C --> D[Rethink]
1372
+ D --> B
1373
+ B ---->|No| E[End]
1374
+ ```
1375
+
1376
+ > **Note** Links may still be made longer than the requested number of ranks
1377
+ > by the rendering engine to accommodate other requests.
1378
+
1379
+ When the link label is written in the middle of the link, the extra dashes must
1380
+ be added on the right side of the link. The following example is equivalent to
1381
+ the previous one:
1382
+
1383
+ ```mermaid-example
1384
+ flowchart TD
1385
+ A[Start] --> B{Is it?}
1386
+ B -- Yes --> C[OK]
1387
+ C --> D[Rethink]
1388
+ D --> B
1389
+ B -- No ----> E[End]
1390
+ ```
1391
+
1392
+ ```mermaid
1393
+ flowchart TD
1394
+ A[Start] --> B{Is it?}
1395
+ B -- Yes --> C[OK]
1396
+ C --> D[Rethink]
1397
+ D --> B
1398
+ B -- No ----> E[End]
1399
+ ```
1400
+
1401
+ For dotted or thick links, the characters to add are equals signs or dots,
1402
+ as summed up in the following table:
1403
+
1404
+ | Length | 1 | 2 | 3 |
1405
+ | ----------------- | :----: | :-----: | :------: |
1406
+ | Normal | `---` | `----` | `-----` |
1407
+ | Normal with arrow | `-->` | `--->` | `---->` |
1408
+ | Thick | `===` | `====` | `=====` |
1409
+ | Thick with arrow | `==>` | `===>` | `====>` |
1410
+ | Dotted | `-.-` | `-..-` | `-...-` |
1411
+ | Dotted with arrow | `-.->` | `-..->` | `-...->` |
1412
+
1413
+ ## Special characters that break syntax
1414
+
1415
+ It is possible to put text within quotes in order to render more troublesome characters. As in the example below:
1416
+
1417
+ ```mermaid-example
1418
+ flowchart LR
1419
+ id1["This is the (text) in the box"]
1420
+ ```
1421
+
1422
+ ```mermaid
1423
+ flowchart LR
1424
+ id1["This is the (text) in the box"]
1425
+ ```
1426
+
1427
+ ### Entity codes to escape characters
1428
+
1429
+ It is possible to escape characters using the syntax exemplified here.
1430
+
1431
+ ```mermaid-example
1432
+ flowchart LR
1433
+ A["A double quote:#quot;"] --> B["A dec char:#9829;"]
1434
+ ```
1435
+
1436
+ ```mermaid
1437
+ flowchart LR
1438
+ A["A double quote:#quot;"] --> B["A dec char:#9829;"]
1439
+ ```
1440
+
1441
+ Numbers given are base 10, so `#` can be encoded as `#35;`. It is also supported to use HTML character names.
1442
+
1443
+ ## Subgraphs
1444
+
1445
+ ```
1446
+ subgraph title
1447
+ graph definition
1448
+ end
1449
+ ```
1450
+
1451
+ An example below:
1452
+
1453
+ ```mermaid-example
1454
+ flowchart TB
1455
+ c1-->a2
1456
+ subgraph one
1457
+ a1-->a2
1458
+ end
1459
+ subgraph two
1460
+ b1-->b2
1461
+ end
1462
+ subgraph three
1463
+ c1-->c2
1464
+ end
1465
+ ```
1466
+
1467
+ ```mermaid
1468
+ flowchart TB
1469
+ c1-->a2
1470
+ subgraph one
1471
+ a1-->a2
1472
+ end
1473
+ subgraph two
1474
+ b1-->b2
1475
+ end
1476
+ subgraph three
1477
+ c1-->c2
1478
+ end
1479
+ ```
1480
+
1481
+ You can also set an explicit id for the subgraph.
1482
+
1483
+ ```mermaid-example
1484
+ flowchart TB
1485
+ c1-->a2
1486
+ subgraph ide1 [one]
1487
+ a1-->a2
1488
+ end
1489
+ ```
1490
+
1491
+ ```mermaid
1492
+ flowchart TB
1493
+ c1-->a2
1494
+ subgraph ide1 [one]
1495
+ a1-->a2
1496
+ end
1497
+ ```
1498
+
1499
+ ### flowcharts
1500
+
1501
+ With the graphtype flowchart it is also possible to set edges to and from subgraphs as in the flowchart below.
1502
+
1503
+ ```mermaid-example
1504
+ flowchart TB
1505
+ c1-->a2
1506
+ subgraph one
1507
+ a1-->a2
1508
+ end
1509
+ subgraph two
1510
+ b1-->b2
1511
+ end
1512
+ subgraph three
1513
+ c1-->c2
1514
+ end
1515
+ one --> two
1516
+ three --> two
1517
+ two --> c2
1518
+ ```
1519
+
1520
+ ```mermaid
1521
+ flowchart TB
1522
+ c1-->a2
1523
+ subgraph one
1524
+ a1-->a2
1525
+ end
1526
+ subgraph two
1527
+ b1-->b2
1528
+ end
1529
+ subgraph three
1530
+ c1-->c2
1531
+ end
1532
+ one --> two
1533
+ three --> two
1534
+ two --> c2
1535
+ ```
1536
+
1537
+ ### Direction in subgraphs
1538
+
1539
+ With the graphtype flowcharts you can use the direction statement to set the direction which the subgraph will render like in this example.
1540
+
1541
+ ```mermaid-example
1542
+ flowchart LR
1543
+ subgraph TOP
1544
+ direction TB
1545
+ subgraph B1
1546
+ direction RL
1547
+ i1 -->f1
1548
+ end
1549
+ subgraph B2
1550
+ direction BT
1551
+ i2 -->f2
1552
+ end
1553
+ end
1554
+ A --> TOP --> B
1555
+ B1 --> B2
1556
+ ```
1557
+
1558
+ ```mermaid
1559
+ flowchart LR
1560
+ subgraph TOP
1561
+ direction TB
1562
+ subgraph B1
1563
+ direction RL
1564
+ i1 -->f1
1565
+ end
1566
+ subgraph B2
1567
+ direction BT
1568
+ i2 -->f2
1569
+ end
1570
+ end
1571
+ A --> TOP --> B
1572
+ B1 --> B2
1573
+ ```
1574
+
1575
+ #### Limitation
1576
+
1577
+ If any of a subgraph's nodes are linked to the outside, subgraph direction will be ignored. Instead the subgraph will inherit the direction of the parent graph:
1578
+
1579
+ ```mermaid-example
1580
+ flowchart LR
1581
+ subgraph subgraph1
1582
+ direction TB
1583
+ top1[top] --> bottom1[bottom]
1584
+ end
1585
+ subgraph subgraph2
1586
+ direction TB
1587
+ top2[top] --> bottom2[bottom]
1588
+ end
1589
+ %% ^ These subgraphs are identical, except for the links to them:
1590
+
1591
+ %% Link *to* subgraph1: subgraph1 direction is maintained
1592
+ outside --> subgraph1
1593
+ %% Link *within* subgraph2:
1594
+ %% subgraph2 inherits the direction of the top-level graph (LR)
1595
+ outside ---> top2
1596
+ ```
1597
+
1598
+ ```mermaid
1599
+ flowchart LR
1600
+ subgraph subgraph1
1601
+ direction TB
1602
+ top1[top] --> bottom1[bottom]
1603
+ end
1604
+ subgraph subgraph2
1605
+ direction TB
1606
+ top2[top] --> bottom2[bottom]
1607
+ end
1608
+ %% ^ These subgraphs are identical, except for the links to them:
1609
+
1610
+ %% Link *to* subgraph1: subgraph1 direction is maintained
1611
+ outside --> subgraph1
1612
+ %% Link *within* subgraph2:
1613
+ %% subgraph2 inherits the direction of the top-level graph (LR)
1614
+ outside ---> top2
1615
+ ```
1616
+
1617
+ ### Collapsible subgraphs (unreleased upstream; unavailable in Mermaid 11.16.0)
1618
+
1619
+ > **Pinned-runtime boundary**
1620
+ >
1621
+ > This section came from the imported development snapshot and is absent from the official
1622
+ > Mermaid 11.16.0 source page. The 11.16.0 renderer ignores `view: collapsed` and leaves the
1623
+ > internal nodes visible. Do not generate this syntax unless a later official release documents
1624
+ > it and the kit's pinned compatibility probe is updated.
1625
+
1626
+ A subgraph can be collapsed into a single compact node by attaching the metadata
1627
+ `@{ view: collapsed }` to its id. This is useful for hiding the internals of a
1628
+ group while still showing how it connects to the rest of the diagram.
1629
+
1630
+ ```mermaid-example
1631
+ flowchart TD
1632
+ Start --> one
1633
+ subgraph one [My Group]
1634
+ A --> B
1635
+ B --> C
1636
+ end
1637
+ one --> End
1638
+ one@{ view: collapsed }
1639
+ ```
1640
+
1641
+ ```mermaid
1642
+ flowchart TD
1643
+ Start --> one
1644
+ subgraph one [My Group]
1645
+ A --> B
1646
+ B --> C
1647
+ end
1648
+ one --> End
1649
+ one@{ view: collapsed }
1650
+ ```
1651
+
1652
+ The metadata is attached with the existing `id@{ ... }` statement syntax, where
1653
+ `id` is the subgraph id (use `subgraph id [Title]` to give a subgraph an explicit
1654
+ id). When a subgraph is collapsed:
1655
+
1656
+ - Its internal nodes are hidden and it is drawn as a single node carrying the
1657
+ subgraph's title.
1658
+ - Edges that cross the subgraph boundary are **redirected to the collapsed node**.
1659
+ - Edges that are entirely internal to the collapsed subgraph are dropped (they
1660
+ would otherwise become self-loops on the collapsed node).
1661
+ - For nested subgraphs, a collapse resolves to the **outermost** collapsed
1662
+ ancestor, so an edge pointing at a deeply nested node lands on the outermost
1663
+ collapsed group.
1664
+
1665
+ `view: expanded` is the default and renders the subgraph normally, so omitting the
1666
+ metadata (or setting `view: expanded`) keeps the existing behavior.
1667
+
1668
+ ## Markdown Strings
1669
+
1670
+ The "Markdown Strings" feature enhances flowcharts and mind maps by offering a more versatile string type, which supports text formatting options such as bold and italics, and automatically wraps text within labels.
1671
+
1672
+ ```mermaid-example
1673
+ ---
1674
+ config:
1675
+ htmlLabels: false
1676
+ ---
1677
+ flowchart LR
1678
+ subgraph "One"
1679
+ a("`The **cat**
1680
+ in the hat`") -- "edge label" --> b{{"`The **dog** in the hog`"}}
1681
+ end
1682
+ subgraph "`**Two**`"
1683
+ c("`The **cat**
1684
+ in the hat`") -- "`Bold **edge label**`" --> d("The dog in the hog")
1685
+ end
1686
+ ```
1687
+
1688
+ ```mermaid
1689
+ ---
1690
+ config:
1691
+ htmlLabels: false
1692
+ ---
1693
+ flowchart LR
1694
+ subgraph "One"
1695
+ a("`The **cat**
1696
+ in the hat`") -- "edge label" --> b{{"`The **dog** in the hog`"}}
1697
+ end
1698
+ subgraph "`**Two**`"
1699
+ c("`The **cat**
1700
+ in the hat`") -- "`Bold **edge label**`" --> d("The dog in the hog")
1701
+ end
1702
+ ```
1703
+
1704
+ Formatting:
1705
+
1706
+ - For bold text, use double asterisks (`**`) before and after the text.
1707
+ - For italics, use single asterisks (`*`) before and after the text.
1708
+ - With traditional strings, you needed to add `<br>` tags for text to wrap in nodes. However, markdown strings automatically wrap text when it becomes too long and allows you to start a new line by simply using a newline character instead of a `<br>` tag.
1709
+
1710
+ This feature is applicable to node labels, edge labels, and subgraph labels.
1711
+
1712
+ The auto wrapping can be disabled by using
1713
+
1714
+ ```
1715
+ ---
1716
+ config:
1717
+ markdownAutoWrap: false
1718
+ ---
1719
+ graph LR
1720
+ ```
1721
+
1722
+ ## Interaction
1723
+
1724
+ It is possible to bind a click event to a node, the click can lead to either a javascript callback or to a link which will be opened in a new browser tab.
1725
+
1726
+ > **Note**
1727
+ > This functionality is disabled when using `securityLevel='strict'` and enabled when using `securityLevel='loose'`.
1728
+
1729
+ ```
1730
+ click nodeId callback
1731
+ click nodeId call callback()
1732
+ ```
1733
+
1734
+ - nodeId is the id of the node
1735
+ - callback is the name of a javascript function defined on the page displaying the graph, the function will be called with the nodeId as parameter.
1736
+
1737
+ Examples of tooltip usage below:
1738
+
1739
+ ```html
1740
+ <script>
1741
+ window.callback = function () {
1742
+ alert('A callback was triggered');
1743
+ };
1744
+ </script>
1745
+ ```
1746
+
1747
+ The tooltip text is surrounded in double quotes. The styles of the tooltip are set by the class `.mermaidTooltip`.
1748
+
1749
+ ```mermaid-example
1750
+ flowchart LR
1751
+ A-->B
1752
+ B-->C
1753
+ C-->D
1754
+ click A callback "Tooltip for a callback"
1755
+ click B "https://www.github.com" "This is a tooltip for a link"
1756
+ click C call callback() "Tooltip for a callback"
1757
+ click D href "https://www.github.com" "This is a tooltip for a link"
1758
+ ```
1759
+
1760
+ ```mermaid
1761
+ flowchart LR
1762
+ A-->B
1763
+ B-->C
1764
+ C-->D
1765
+ click A callback "Tooltip for a callback"
1766
+ click B "https://www.github.com" "This is a tooltip for a link"
1767
+ click C call callback() "Tooltip for a callback"
1768
+ click D href "https://www.github.com" "This is a tooltip for a link"
1769
+ ```
1770
+
1771
+ > **Success** The tooltip functionality and the ability to link to urls are available from version 0.5.2.
1772
+
1773
+ ?> Due to limitations with how Docsify handles JavaScript callback functions, an alternate working demo for the above code can be viewed at [this jsfiddle](https://jsfiddle.net/yk4h7qou/2/).
1774
+
1775
+ Links are opened in the same browser tab/window by default. It is possible to change this by adding a link target to the click definition (`_self`, `_blank`, `_parent` and `_top` are supported):
1776
+
1777
+ ```mermaid-example
1778
+ flowchart LR
1779
+ A-->B
1780
+ B-->C
1781
+ C-->D
1782
+ D-->E
1783
+ click A "https://www.github.com" _blank
1784
+ click B "https://www.github.com" "Open this in a new tab" _blank
1785
+ click C href "https://www.github.com" _blank
1786
+ click D href "https://www.github.com" "Open this in a new tab" _blank
1787
+ ```
1788
+
1789
+ ```mermaid
1790
+ flowchart LR
1791
+ A-->B
1792
+ B-->C
1793
+ C-->D
1794
+ D-->E
1795
+ click A "https://www.github.com" _blank
1796
+ click B "https://www.github.com" "Open this in a new tab" _blank
1797
+ click C href "https://www.github.com" _blank
1798
+ click D href "https://www.github.com" "Open this in a new tab" _blank
1799
+ ```
1800
+
1801
+ Beginner's tip—a full example using interactive links in a html context:
1802
+
1803
+ ```html
1804
+ <body>
1805
+ <pre class="mermaid">
1806
+ flowchart LR
1807
+ A-->B
1808
+ B-->C
1809
+ C-->D
1810
+ click A callback "Tooltip"
1811
+ click B "https://www.github.com" "This is a link"
1812
+ click C call callback() "Tooltip"
1813
+ click D href "https://www.github.com" "This is a link"
1814
+ </pre>
1815
+
1816
+ <script>
1817
+ window.callback = function () {
1818
+ alert('A callback was triggered');
1819
+ };
1820
+ const config = {
1821
+ startOnLoad: true,
1822
+ htmlLabels: true,
1823
+ flowchart: { useMaxWidth: true, curve: 'cardinal' },
1824
+ securityLevel: 'loose',
1825
+ };
1826
+ mermaid.initialize(config);
1827
+ </script>
1828
+ </body>
1829
+ ```
1830
+
1831
+ ### Comments
1832
+
1833
+ Comments can be entered within a flow diagram, which will be ignored by the parser. Comments need to be on their own line, and must be prefaced with `%%` (double percent signs). Any text after the start of the comment to the next newline will be treated as a comment, including any flow syntax
1834
+
1835
+ ```mermaid-example
1836
+ flowchart LR
1837
+ %% this is a comment A -- text --> B{node}
1838
+ A -- text --> B -- text2 --> C
1839
+ ```
1840
+
1841
+ ```mermaid
1842
+ flowchart LR
1843
+ %% this is a comment A -- text --> B{node}
1844
+ A -- text --> B -- text2 --> C
1845
+ ```
1846
+
1847
+ ## Styling and classes
1848
+
1849
+ ### Styling links
1850
+
1851
+ It is possible to style links. For instance, you might want to style a link that is going backwards in the flow. As links
1852
+ have no ids in the same way as nodes, some other way of deciding what style the links should be attached to is required.
1853
+ Instead of ids, the order number of when the link was defined in the graph is used, or use default to apply to all links.
1854
+ In the example below the style defined in the linkStyle statement will belong to the fourth link in the graph:
1855
+
1856
+ ```
1857
+ linkStyle 3 stroke:#ff3,stroke-width:4px,color:red;
1858
+ ```
1859
+
1860
+ It is also possible to add style to multiple links in a single statement, by separating link numbers with commas:
1861
+
1862
+ ```
1863
+ linkStyle 1,2,7 color:blue;
1864
+ ```
1865
+
1866
+ ### Styling line curves
1867
+
1868
+ It is possible to style the type of curve used for lines between items, if the default method does not meet your needs.
1869
+ Available curve styles include `basis`, `bumpX`, `bumpY`, `cardinal`, `catmullRom`, `linear`, `monotoneX`, `monotoneY`,
1870
+ `natural`, `step`, `stepAfter`, and `stepBefore`.
1871
+
1872
+ For a full list of available curves, including an explanation of custom curves, refer to
1873
+ the [Shapes](https://d3js.org/d3-shape/curve) documentation in the [d3-shape](https://github.com/d3/d3-shape/) project.
1874
+
1875
+ Line styling can be achieved in two ways:
1876
+
1877
+ 1. Change the curve style of all the lines
1878
+ 2. Change the curve style of a particular line
1879
+
1880
+ #### Diagram level curve style
1881
+
1882
+ In this example, a left-to-right graph uses the `stepBefore` curve style:
1883
+
1884
+ ```
1885
+ ---
1886
+ config:
1887
+ flowchart:
1888
+ curve: stepBefore
1889
+ ---
1890
+ graph LR
1891
+ ```
1892
+
1893
+ #### Edge level curve style using Edge IDs (v11.10.0+)
1894
+
1895
+ You can assign IDs to [edges](#attaching-an-id-to-edges). After assigning an ID you can modify the line style by modifying the edge's `curve` property using the following syntax:
1896
+
1897
+ ```mermaid-example
1898
+ flowchart LR
1899
+ A e1@==> B
1900
+ A e2@--> C
1901
+ e1@{ curve: linear }
1902
+ e2@{ curve: natural }
1903
+ ```
1904
+
1905
+ ```mermaid
1906
+ flowchart LR
1907
+ A e1@==> B
1908
+ A e2@--> C
1909
+ e1@{ curve: linear }
1910
+ e2@{ curve: natural }
1911
+ ```
1912
+
1913
+ ```info
1914
+ Any edge curve style modified at the edge level overrides the diagram level style.
1915
+ ```
1916
+
1917
+ ```info
1918
+ If the same edge is modified multiple times the last modification will be rendered.
1919
+ ```
1920
+
1921
+ ### Styling a node
1922
+
1923
+ It is possible to apply specific styles such as a thicker border or a different background color to a node.
1924
+
1925
+ ```mermaid-example
1926
+ flowchart LR
1927
+ id1(Start)-->id2(Stop)
1928
+ style id1 fill:#f9f,stroke:#333,stroke-width:4px
1929
+ style id2 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
1930
+ ```
1931
+
1932
+ ```mermaid
1933
+ flowchart LR
1934
+ id1(Start)-->id2(Stop)
1935
+ style id1 fill:#f9f,stroke:#333,stroke-width:4px
1936
+ style id2 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
1937
+ ```
1938
+
1939
+ #### Classes
1940
+
1941
+ More convenient than defining the style every time is to define a class of styles and attach this class to the nodes that
1942
+ should have a different look.
1943
+
1944
+ A class definition looks like the example below:
1945
+
1946
+ ```
1947
+ classDef className fill:#f9f,stroke:#333,stroke-width:4px;
1948
+ ```
1949
+
1950
+ Also, it is possible to define style to multiple classes in one statement:
1951
+
1952
+ ```
1953
+ classDef firstClassName,secondClassName font-size:12pt;
1954
+ ```
1955
+
1956
+ Attachment of a class to a node is done as per below:
1957
+
1958
+ ```
1959
+ class nodeId1 className;
1960
+ ```
1961
+
1962
+ It is also possible to attach a class to a list of nodes in one statement:
1963
+
1964
+ ```
1965
+ class nodeId1,nodeId2 className;
1966
+ ```
1967
+
1968
+ A shorter form of adding a class is to attach the classname to the node using the `:::`operator as per below:
1969
+
1970
+ ```mermaid-example
1971
+ flowchart LR
1972
+ A:::someclass --> B
1973
+ classDef someclass fill:#f96
1974
+ ```
1975
+
1976
+ ```mermaid
1977
+ flowchart LR
1978
+ A:::someclass --> B
1979
+ classDef someclass fill:#f96
1980
+ ```
1981
+
1982
+ This form can be used when declaring multiple links between nodes:
1983
+
1984
+ ```mermaid-example
1985
+ flowchart LR
1986
+ A:::foo & B:::bar --> C:::foobar
1987
+ classDef foo stroke:#f00
1988
+ classDef bar stroke:#0f0
1989
+ classDef foobar stroke:#00f
1990
+ ```
1991
+
1992
+ ```mermaid
1993
+ flowchart LR
1994
+ A:::foo & B:::bar --> C:::foobar
1995
+ classDef foo stroke:#f00
1996
+ classDef bar stroke:#0f0
1997
+ classDef foobar stroke:#00f
1998
+ ```
1999
+
2000
+ ### CSS classes
2001
+
2002
+ > **Note:** Applying styles to Mermaid nodes via external CSS (e.g., `.cssClass > rect { fill: ... }`) does **not** work reliably. Mermaid's internal styles are injected with `!important` and scoped to the SVG element ID, giving them higher specificity than external CSS rules. External CSS will be silently overridden.
2003
+ >
2004
+ > The recommended approach is to use the `classDef` syntax shown in the [Classes](#classes) section above, which works correctly and is the intended styling mechanism.
2005
+ >
2006
+ > If external CSS is strictly required, every property must use `!important` to override Mermaid's styles — but this is not recommended.
2007
+
2008
+ **Working approach — use `classDef` instead:**
2009
+
2010
+ ```mermaid-example
2011
+ flowchart LR
2012
+ A:::myStyle --> B
2013
+ classDef myStyle fill:#ff0000,stroke:#ffff00,stroke-width:4px
2014
+ ```
2015
+
2016
+ ```mermaid
2017
+ flowchart LR
2018
+ A:::myStyle --> B
2019
+ classDef myStyle fill:#ff0000,stroke:#ffff00,stroke-width:4px
2020
+ ```
2021
+
2022
+ ### Default class
2023
+
2024
+ If a class is named default it will be assigned to all classes without specific class definitions.
2025
+
2026
+ ```
2027
+ classDef default fill:#f9f,stroke:#333,stroke-width:4px;
2028
+ ```
2029
+
2030
+ ## Basic support for fontawesome
2031
+
2032
+ It is possible to add icons from fontawesome.
2033
+
2034
+ The icons are accessed via the syntax fa:#icon class name#.
2035
+
2036
+ ```mermaid-example
2037
+ flowchart TD
2038
+ B["fa:fa-twitter for peace"]
2039
+ B-->C[fa:fa-ban forbidden]
2040
+ B-->D(fa:fa-spinner)
2041
+ B-->E(A fa:fa-camera-retro perhaps?)
2042
+ ```
2043
+
2044
+ ```mermaid
2045
+ flowchart TD
2046
+ B["fa:fa-twitter for peace"]
2047
+ B-->C[fa:fa-ban forbidden]
2048
+ B-->D(fa:fa-spinner)
2049
+ B-->E(A fa:fa-camera-retro perhaps?)
2050
+ ```
2051
+
2052
+ There are two ways to display these FontAwesome icons:
2053
+
2054
+ ### Register FontAwesome icon packs (v11.7.0+)
2055
+
2056
+ You can register your own FontAwesome icon pack following the ["Registering icon packs" instructions](https://github.com/mermaid-js/mermaid/blob/mermaid%4011.16.0/packages/mermaid/src/docs/config/icons.md).
2057
+
2058
+ Supported prefixes: `fa`, `fab`, `fas`, `far`, `fal`, `fad`.
2059
+
2060
+ > **Note**
2061
+ > Note that it will fall back to FontAwesome CSS if FontAwesome packs are not registered.
2062
+
2063
+ ### Register FontAwesome CSS
2064
+
2065
+ Mermaid supports Font Awesome if the CSS is included on the website.
2066
+ Mermaid does not have any restriction on the version of Font Awesome that can be used.
2067
+
2068
+ Please refer the [Official Font Awesome Documentation](https://fontawesome.com/start) on how to include it in your website.
2069
+
2070
+ Adding this snippet in the `<head>` would add support for Font Awesome v6.5.1
2071
+
2072
+ ```html
2073
+ <link
2074
+ href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css"
2075
+ rel="stylesheet"
2076
+ />
2077
+ ```
2078
+
2079
+ ### Custom icons
2080
+
2081
+ It is possible to use custom icons served from Font Awesome as long as the website imports the corresponding kit.
2082
+
2083
+ Note that this is currently a paid feature from Font Awesome.
2084
+
2085
+ For custom icons, you need to use the `fak` prefix.
2086
+
2087
+ **Example**
2088
+
2089
+ ```
2090
+ flowchart TD
2091
+ B[fa:fa-twitter] %% standard icon
2092
+ B-->E(fak:fa-custom-icon-name) %% custom icon
2093
+ ```
2094
+
2095
+ And trying to render it
2096
+
2097
+ ```mermaid-example
2098
+ flowchart TD
2099
+ B["fa:fa-twitter for peace"]
2100
+ B-->C["fab:fa-truck-bold a custom icon"]
2101
+ ```
2102
+
2103
+ ```mermaid
2104
+ flowchart TD
2105
+ B["fa:fa-twitter for peace"]
2106
+ B-->C["fab:fa-truck-bold a custom icon"]
2107
+ ```
2108
+
2109
+ ## Graph declarations with spaces between vertices and link and without semicolon
2110
+
2111
+ - In graph declarations, the statements also can now end without a semicolon. After release 0.2.16, ending a graph statement with semicolon is just optional. So the below graph declaration is also valid along with the old declarations of the graph.
2112
+
2113
+ - A single space is allowed between vertices and the link. However there should not be any space between a vertex and its text and a link and its text. The old syntax of graph declaration will also work and hence this new feature is optional and is introduced to improve readability.
2114
+
2115
+ Below is the new declaration of the graph edges which is also valid along with the old declaration of the graph edges.
2116
+
2117
+ ```mermaid-example
2118
+ flowchart LR
2119
+ A[Hard edge] -->|Link text| B(Round edge)
2120
+ B --> C{Decision}
2121
+ C -->|One| D[Result one]
2122
+ C -->|Two| E[Result two]
2123
+ ```
2124
+
2125
+ ```mermaid
2126
+ flowchart LR
2127
+ A[Hard edge] -->|Link text| B(Round edge)
2128
+ B --> C{Decision}
2129
+ C -->|One| D[Result one]
2130
+ C -->|Two| E[Result two]
2131
+ ```
2132
+
2133
+ ## Configuration
2134
+
2135
+ ### Renderer
2136
+
2137
+ The layout of the diagram is done with the renderer. The default renderer is dagre.
2138
+
2139
+ Starting with Mermaid version 9.4, you can use an alternate renderer named elk. The elk renderer is better for larger and/or more complex diagrams.
2140
+
2141
+ The _elk_ renderer is an experimental feature.
2142
+ You can change the renderer to elk by adding this directive:
2143
+
2144
+ ```
2145
+ config:
2146
+ flowchart:
2147
+ defaultRenderer: "elk"
2148
+ ```
2149
+
2150
+ > **Note**
2151
+ > Note that the site needs to use mermaid version 9.4+ for this to work and have this featured enabled in the lazy-loading configuration.
2152
+
2153
+ ### Width
2154
+
2155
+ It is possible to adjust the width of the rendered flowchart.
2156
+
2157
+ This is done by defining **mermaid.flowchartConfig** or by the CLI to use a JSON file with the configuration. How to use the CLI is described in the mermaidCLI page.
2158
+ mermaid.flowchartConfig can be set to a JSON string with config parameters or the corresponding object.
2159
+
2160
+ ```javascript
2161
+ mermaid.flowchartConfig = {
2162
+ width: 100%
2163
+ }
2164
+ ```
2165
+
2166
+ <!--- cspell:ignore lagom --->