agentic-mermaid 0.4.1 → 0.5.3
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.
- package/AGENT_NATIVE.md +94 -627
- package/CHANGELOG.md +651 -0
- package/Instructions_for_agents.md +44 -23
- package/LICENSES/Khroma-MIT.txt +21 -0
- package/LICENSES/Mermaid-MIT.txt +21 -0
- package/LICENSES/es-toolkit-MIT.txt +21 -0
- package/LICENSES/pele-MIT.txt +40 -0
- package/LICENSES/zenuml-core-MIT.txt +21 -0
- package/README.md +93 -50
- package/SECURITY.md +28 -12
- package/THIRD_PARTY_NOTICES.md +60 -0
- package/assets/hero.png +0 -0
- package/dist/agent-core.d.ts +478 -210
- package/dist/agent-core.js +1 -396
- package/dist/agent.d.ts +17 -8
- package/dist/agent.js +1 -408
- package/dist/agentic-mermaid-mcp.js +1 -11
- package/dist/am.js +1 -34562
- package/dist/browser-lazy/chunks/agentic-producer-core-CC6OOLDW.js +1 -0
- package/dist/browser-lazy/chunks/architecture-QUFVKYJR.js +13 -0
- package/dist/browser-lazy/chunks/block-6J3Q63BO.js +11 -0
- package/dist/browser-lazy/chunks/builtin-backends-7SOZZHPF.js +12 -0
- package/dist/browser-lazy/chunks/c4-SQVBZAKJ.js +10 -0
- package/dist/browser-lazy/chunks/chunk-2GPK4VFF.js +5 -0
- package/dist/browser-lazy/chunks/chunk-2I4UPL7Q.js +3 -0
- package/dist/browser-lazy/chunks/chunk-2SH76OTH.js +1 -0
- package/dist/browser-lazy/chunks/chunk-2UIA2IME.js +3 -0
- package/dist/browser-lazy/chunks/chunk-4LHYF3BS.js +1 -0
- package/dist/browser-lazy/chunks/chunk-5B2Z7575.js +1 -0
- package/dist/browser-lazy/chunks/chunk-5FQ534HP.js +1 -0
- package/dist/browser-lazy/chunks/chunk-5UVGUSD6.js +1 -0
- package/dist/browser-lazy/chunks/chunk-5X6MJX3H.js +1 -0
- package/dist/browser-lazy/chunks/chunk-AMJLVPUB.js +4 -0
- package/dist/browser-lazy/chunks/chunk-BU5LHXNJ.js +3 -0
- package/dist/browser-lazy/chunks/chunk-BY2CPG6B.js +1 -0
- package/dist/browser-lazy/chunks/chunk-CN7WTBWB.js +1 -0
- package/dist/browser-lazy/chunks/chunk-CQE4HQEW.js +1 -0
- package/dist/browser-lazy/chunks/chunk-CSFUKSU6.js +1 -0
- package/dist/browser-lazy/chunks/chunk-DF6765YX.js +17 -0
- package/dist/browser-lazy/chunks/chunk-E2WMJZNM.js +1 -0
- package/dist/browser-lazy/chunks/chunk-FAIMVOX5.js +6 -0
- package/dist/browser-lazy/chunks/chunk-GVOEAY52.js +1 -0
- package/dist/browser-lazy/chunks/chunk-HLWUNUCM.js +1 -0
- package/dist/browser-lazy/chunks/chunk-ICC7HBJX.js +1 -0
- package/dist/browser-lazy/chunks/chunk-J35HAQQF.js +20 -0
- package/dist/browser-lazy/chunks/chunk-J7FFAFQF.js +1 -0
- package/dist/browser-lazy/chunks/chunk-LH7HUDKW.js +1 -0
- package/dist/browser-lazy/chunks/chunk-N5ELX7LR.js +2 -0
- package/dist/browser-lazy/chunks/chunk-NMQQMRIR.js +1 -0
- package/dist/browser-lazy/chunks/chunk-NO7ZIVRU.js +1 -0
- package/dist/browser-lazy/chunks/chunk-OZ443IVJ.js +16 -0
- package/dist/browser-lazy/chunks/chunk-PQGPS2YV.js +7 -0
- package/dist/browser-lazy/chunks/chunk-QA6GJQ4X.js +1 -0
- package/dist/browser-lazy/chunks/chunk-RIVTHZAQ.js +1 -0
- package/dist/browser-lazy/chunks/chunk-SZELX2EJ.js +1 -0
- package/dist/browser-lazy/chunks/chunk-TYZOZXUJ.js +22 -0
- package/dist/browser-lazy/chunks/chunk-UL6NDWLL.js +1 -0
- package/dist/browser-lazy/chunks/chunk-VQYYGAXP.js +1 -0
- package/dist/browser-lazy/chunks/chunk-VWVZGQE2.js +1 -0
- package/dist/browser-lazy/chunks/chunk-X2UYKWKM.js +4 -0
- package/dist/browser-lazy/chunks/chunk-YCEICNM6.js +1 -0
- package/dist/browser-lazy/chunks/chunk-Z3FDIVLN.js +20 -0
- package/dist/browser-lazy/chunks/class-5QA4SCTS.js +13 -0
- package/dist/browser-lazy/chunks/decode-63UIZGD2.js +1 -0
- package/dist/browser-lazy/chunks/elk.bundled-L4CADV5W.js +24 -0
- package/dist/browser-lazy/chunks/er-7ZSKGN7Y.js +11 -0
- package/dist/browser-lazy/chunks/eventmodeling-2BPLHWRN.js +19 -0
- package/dist/browser-lazy/chunks/flowchart-NEIMZTB5.js +4 -0
- package/dist/browser-lazy/chunks/forest-implementation-AEP24AIP.js +1 -0
- package/dist/browser-lazy/chunks/gantt-RDPIFYAF.js +11 -0
- package/dist/browser-lazy/chunks/gitgraph-N4Y5RYB7.js +9 -0
- package/dist/browser-lazy/chunks/ishikawa-LD3YBDJN.js +6 -0
- package/dist/browser-lazy/chunks/journey-6YQR5DJX.js +16 -0
- package/dist/browser-lazy/chunks/kanban-PLMJ7NBW.js +20 -0
- package/dist/browser-lazy/chunks/mermaid-yaml-runtime-QVYX4EWK.js +136 -0
- package/dist/browser-lazy/chunks/mindmap-K2UBFO3Y.js +12 -0
- package/dist/browser-lazy/chunks/packet-CUW4QY6Y.js +7 -0
- package/dist/browser-lazy/chunks/pie-7F7UUCG3.js +15 -0
- package/dist/browser-lazy/chunks/quadrant-TOONO2WC.js +10 -0
- package/dist/browser-lazy/chunks/radar-J6JVWVAX.js +16 -0
- package/dist/browser-lazy/chunks/render-core-BZOM3K7D.js +3 -0
- package/dist/browser-lazy/chunks/requirement-CMAKDJPO.js +19 -0
- package/dist/browser-lazy/chunks/sankey-AWXQEP3F.js +13 -0
- package/dist/browser-lazy/chunks/sequence-Q2RJRB4L.js +5 -0
- package/dist/browser-lazy/chunks/state-WRBFQEDX.js +4 -0
- package/dist/browser-lazy/chunks/timeline-D2KILFXM.js +6 -0
- package/dist/browser-lazy/chunks/treemap-N3VYX5D4.js +6 -0
- package/dist/browser-lazy/chunks/xychart-G73OGK66.js +16 -0
- package/dist/browser-lazy/chunks/zenuml-H4BXNYXR.js +16 -0
- package/dist/browser-lazy/index.d.ts +544 -275
- package/dist/browser-lazy/index.js +1 -1
- package/dist/browser.global.js +802 -565
- package/dist/chunk-3LGLPG33.js +2 -0
- package/dist/chunk-7CRDX2QR.js +2 -0
- package/dist/chunk-7PPW2BMO.js +2 -0
- package/dist/chunk-DQDKA5ND.js +2 -0
- package/dist/chunk-EHCMJUMD.js +52 -0
- package/dist/chunk-GVCHLSHH.js +4 -0
- package/dist/chunk-H3NCS2XZ.js +19 -0
- package/dist/chunk-JZOJ4YGS.js +201 -0
- package/dist/chunk-MKE7GNYU.js +146 -0
- package/dist/chunk-NKNFOREZ.js +2 -0
- package/dist/chunk-O7H2UX5K.js +2 -0
- package/dist/chunk-OMY6NRQD.js +58 -0
- package/dist/chunk-UA234O4M.js +4 -0
- package/dist/chunk-VUFVLGTH.js +2 -0
- package/dist/chunk-XU5LPD2D.js +2 -0
- package/dist/cli-YGGTJZH7.js +226 -0
- package/dist/elk-constructor.js +2 -0
- package/dist/elk-constructor.node.js +11 -0
- package/dist/index-EeXqJXr5.d.ts +1223 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +1 -334
- package/dist/jsonl-RPJY6YWO.js +2 -0
- package/dist/mcp-cli-63DYXTVD.js +2 -0
- package/dist/{index-BGA_-6LV.d.ts → paint-certification-6rwQjIv_.d.ts} +5283 -6173
- package/dist/server-5NEOHOFS.js +524 -0
- package/dist/svg-styles-BdnoM7AT.d.ts +724 -0
- package/dist/svg-styles.d.ts +1 -0
- package/dist/svg-styles.js +2 -0
- package/dist/svg.d.ts +13 -0
- package/dist/svg.js +2 -0
- package/dist/types-BcS52Mjt.d.ts +1360 -0
- package/dist/zenuml/chunks/appearance-UOQ5KA6O.js +1 -0
- package/dist/zenuml/chunks/builtin-backends-KDKE7YHO.js +12 -0
- package/dist/zenuml/chunks/chunk-42DXZ5C6.js +4 -0
- package/dist/zenuml/chunks/chunk-7TVYPTDW.js +1 -0
- package/dist/zenuml/chunks/chunk-EVPSMEKN.js +1 -0
- package/dist/zenuml/chunks/chunk-OXQWRSBM.js +20 -0
- package/dist/zenuml/chunks/chunk-QWX77U7G.js +2 -0
- package/dist/zenuml/chunks/chunk-RLJEI7YN.js +29 -0
- package/dist/zenuml/chunks/chunk-RZ6XK5CD.js +29 -0
- package/dist/zenuml/chunks/decode-BWERFDGK.js +1 -0
- package/dist/zenuml/chunks/mermaid-yaml-runtime-KZVU74WU.js +136 -0
- package/dist/zenuml/chunks/render-core-V5RQ737O.js +3 -0
- package/dist/zenuml/chunks/zenuml-EA2ZFRUX.js +20 -0
- package/dist/zenuml-frame.global.js +3626 -0
- package/dist/zenuml.d.ts +83 -0
- package/dist/zenuml.js +1 -0
- package/docs/MCP-DIRECTORY-LISTINGS.md +5 -1
- package/docs/README.md +59 -103
- package/docs/agent-api-cookbook.md +26 -16
- package/docs/agent-mutation-policy.md +86 -15
- package/docs/agent-workflow-examples.md +1 -1
- package/docs/api-advanced.md +385 -0
- package/docs/api.md +320 -366
- package/docs/ascii.md +40 -4
- package/docs/browser.md +46 -7
- package/docs/choosing-a-diagram.md +148 -0
- package/docs/code-mode-impact.md +1 -0
- package/docs/comparison.md +244 -28
- package/docs/computational-aesthetics-prototype-plan.md +10 -10
- package/docs/config.md +60 -2
- package/docs/custom-fonts.md +78 -21
- package/docs/diagram-families.md +160 -10
- package/docs/eventmodeling-and-zenuml.md +165 -0
- package/docs/features.md +21 -19
- package/docs/fork-differences.md +105 -32
- package/docs/getting-started.md +56 -51
- package/docs/layout-certification.md +126 -0
- package/docs/mcp-code-mode-rationale.md +20 -12
- package/docs/mcp-http-transport.md +14 -8
- package/docs/quality.md +145 -15
- package/docs/react.md +76 -31
- package/docs/style-authoring.md +23 -11
- package/docs/svg-semantic-contract.md +104 -4
- package/docs/testing-strategy.md +684 -126
- package/docs/theming.md +27 -8
- package/examples/styles/readme-hero.md +25 -0
- package/examples/styles/readme-hero.mmd +13 -0
- package/examples/styles/readme-hero.style.json +7 -0
- package/package.json +114 -57
- package/server.json +2 -2
- package/skills/agentic-mermaid-diagram-workflow/SKILL.md +26 -8
- package/skills/agentic-mermaid-diagram-workflow/references/cli.md +13 -3
- package/skills/agentic-mermaid-diagram-workflow/references/code-mode.md +2 -1
- package/skills/agentic-mermaid-diagram-workflow/references/flowchart.md +9 -6
- package/skills/agentic-mermaid-diagram-workflow/references/hosted-mcp.md +1 -0
- package/skills/agentic-mermaid-diagram-workflow/references/sequence.md +4 -3
- package/skills/agentic-mermaid-diagram-workflow/references/timeline.md +7 -6
- package/skills/agentic-mermaid-diagram-workflow/references/upstream/agentflow.md +574 -0
- package/skills/agentic-mermaid-diagram-workflow/references/upstream/architecture.md +10 -2
- package/skills/agentic-mermaid-diagram-workflow/references/upstream/c4.md +18 -0
- package/skills/agentic-mermaid-diagram-workflow/references/upstream/classDiagram.md +123 -0
- package/skills/agentic-mermaid-diagram-workflow/references/upstream/cynefin.md +6 -1
- package/skills/agentic-mermaid-diagram-workflow/references/upstream/entityRelationshipDiagram.md +129 -9
- package/skills/agentic-mermaid-diagram-workflow/references/upstream/eventmodeling.md +22 -0
- package/skills/agentic-mermaid-diagram-workflow/references/upstream/flowchart.md +188 -60
- package/skills/agentic-mermaid-diagram-workflow/references/upstream/gitgraph.md +13 -7
- package/skills/agentic-mermaid-diagram-workflow/references/upstream/mindmap.md +110 -1
- package/skills/agentic-mermaid-diagram-workflow/references/upstream/packet.md +38 -0
- package/skills/agentic-mermaid-diagram-workflow/references/upstream/requirementDiagram.md +115 -0
- package/skills/agentic-mermaid-diagram-workflow/references/upstream/sequenceDiagram.md +101 -0
- package/skills/agentic-mermaid-diagram-workflow/references/upstream/stateDiagram.md +87 -0
- package/skills/agentic-mermaid-diagram-workflow/references/upstream/swimlanes.md +105 -2
- package/skills/agentic-mermaid-diagram-workflow/references/upstream/timeline.md +12 -6
- package/skills/agentic-mermaid-diagram-workflow/references/upstream/usecase.md +953 -0
- package/skills/agentic-mermaid-diagram-workflow/references/upstream/venn.md +77 -0
- package/skills/agentic-mermaid-diagram-workflow/references/upstream/xyChart.md +1 -1
- package/dist/browser-lazy/chunks/architecture-KTHE2HX3.js +0 -31
- package/dist/browser-lazy/chunks/chunk-2XCPFAD5.js +0 -46
- package/dist/browser-lazy/chunks/chunk-3H4F7RBT.js +0 -1
- package/dist/browser-lazy/chunks/chunk-4EVLW2NJ.js +0 -1
- package/dist/browser-lazy/chunks/chunk-5Q4S74UO.js +0 -1
- package/dist/browser-lazy/chunks/chunk-6OAPWSDO.js +0 -1
- package/dist/browser-lazy/chunks/chunk-A7L4WWVW.js +0 -143
- package/dist/browser-lazy/chunks/chunk-C7FJO2I3.js +0 -4
- package/dist/browser-lazy/chunks/chunk-D3XXDKIO.js +0 -1
- package/dist/browser-lazy/chunks/chunk-DXA5WL7H.js +0 -4
- package/dist/browser-lazy/chunks/chunk-EPFMQPXX.js +0 -1
- package/dist/browser-lazy/chunks/chunk-FFOHLPDA.js +0 -2
- package/dist/browser-lazy/chunks/chunk-FLD63DXE.js +0 -2
- package/dist/browser-lazy/chunks/chunk-G6OLSHRG.js +0 -7
- package/dist/browser-lazy/chunks/chunk-GRXCKTHX.js +0 -0
- package/dist/browser-lazy/chunks/chunk-I6VE56S7.js +0 -1
- package/dist/browser-lazy/chunks/chunk-KJVNXJ5Y.js +0 -1
- package/dist/browser-lazy/chunks/chunk-L227EPFP.js +0 -11
- package/dist/browser-lazy/chunks/chunk-LNIHDJSF.js +0 -1
- package/dist/browser-lazy/chunks/chunk-M6BT2HIP.js +0 -1
- package/dist/browser-lazy/chunks/chunk-NZRUMODH.js +0 -1
- package/dist/browser-lazy/chunks/chunk-OFRMKQA6.js +0 -1
- package/dist/browser-lazy/chunks/chunk-P7HMSKHJ.js +0 -1
- package/dist/browser-lazy/chunks/chunk-PXKL3O6H.js +0 -1
- package/dist/browser-lazy/chunks/chunk-PZEWZT35.js +0 -1
- package/dist/browser-lazy/chunks/chunk-STQRDZ67.js +0 -1
- package/dist/browser-lazy/chunks/chunk-SUFMSWTX.js +0 -1
- package/dist/browser-lazy/chunks/chunk-T7IJ6V4B.js +0 -3
- package/dist/browser-lazy/chunks/chunk-UAEZO5VL.js +0 -1
- package/dist/browser-lazy/chunks/chunk-WEUWIFG3.js +0 -1
- package/dist/browser-lazy/chunks/chunk-X64T74C5.js +0 -24
- package/dist/browser-lazy/chunks/class-F7R6TJ73.js +0 -9
- package/dist/browser-lazy/chunks/er-BDK7CM5L.js +0 -9
- package/dist/browser-lazy/chunks/flowchart-KFU6XV7S.js +0 -4
- package/dist/browser-lazy/chunks/gantt-I64VVDSP.js +0 -28
- package/dist/browser-lazy/chunks/gitgraph-EDUVJ5IJ.js +0 -8
- package/dist/browser-lazy/chunks/journey-TLO2RNM3.js +0 -40
- package/dist/browser-lazy/chunks/mindmap-OJCNDYPM.js +0 -9
- package/dist/browser-lazy/chunks/pie-HVG6XO7K.js +0 -19
- package/dist/browser-lazy/chunks/quadrant-U6S2L4MJ.js +0 -24
- package/dist/browser-lazy/chunks/radar-ZDLOBTVG.js +0 -32
- package/dist/browser-lazy/chunks/render-core-Y2DFNMQG.js +0 -12
- package/dist/browser-lazy/chunks/sequence-Z4WFS3VB.js +0 -12
- package/dist/browser-lazy/chunks/state-2HV2YGN3.js +0 -4
- package/dist/browser-lazy/chunks/timeline-XM4UFPOC.js +0 -20
- package/dist/browser-lazy/chunks/xychart-7JDHWTQY.js +0 -36
- package/dist/chunk-GGXCNCNA.js +0 -4118
- package/dist/chunk-IVD4NXNE.js +0 -615
- package/dist/chunk-JDMRPUAG.js +0 -37
- package/dist/chunk-JWAAW3FH.js +0 -149
- package/dist/chunk-LCGBT32P.js +0 -62036
- package/dist/chunk-RWMZRUIC.js +0 -4715
- package/dist/mcp-cli-4MLKC3ZH.js +0 -17
- package/docs/mutation-testing.md +0 -285
|
@@ -144,6 +144,125 @@ Possible FlowChart orientations are:
|
|
|
144
144
|
- RL - Right to left
|
|
145
145
|
- LR - Left to right
|
|
146
146
|
|
|
147
|
+
## Default theme, look and layout (v12.0.0+)
|
|
148
|
+
|
|
149
|
+
Flowcharts use the `redux-color` theme and the `neo` look by default, and are laid out by [ELK](https://www.eclipse.org/elk/) rather than Dagre. Not every diagram type
|
|
150
|
+
does — see [Per-diagram defaults](../config/theming.md#per-diagram-defaults) for the list and
|
|
151
|
+
for the order in which Mermaid decides.
|
|
152
|
+
|
|
153
|
+
The same diagram, drawn both ways:
|
|
154
|
+
|
|
155
|
+
### With the defaults
|
|
156
|
+
|
|
157
|
+
```mermaid-example
|
|
158
|
+
flowchart LR
|
|
159
|
+
subgraph Client
|
|
160
|
+
UI[Web app]
|
|
161
|
+
Cache[(Local cache)]
|
|
162
|
+
end
|
|
163
|
+
subgraph Services
|
|
164
|
+
API[API gateway]
|
|
165
|
+
Auth[Auth service]
|
|
166
|
+
Orders[Order service]
|
|
167
|
+
end
|
|
168
|
+
subgraph Storage
|
|
169
|
+
DB[(Orders DB)]
|
|
170
|
+
end
|
|
171
|
+
UI --> API
|
|
172
|
+
UI --> Cache
|
|
173
|
+
API --> Auth
|
|
174
|
+
API --> Orders
|
|
175
|
+
Orders --> DB
|
|
176
|
+
Auth -. token .-> UI
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
```mermaid
|
|
180
|
+
flowchart LR
|
|
181
|
+
subgraph Client
|
|
182
|
+
UI[Web app]
|
|
183
|
+
Cache[(Local cache)]
|
|
184
|
+
end
|
|
185
|
+
subgraph Services
|
|
186
|
+
API[API gateway]
|
|
187
|
+
Auth[Auth service]
|
|
188
|
+
Orders[Order service]
|
|
189
|
+
end
|
|
190
|
+
subgraph Storage
|
|
191
|
+
DB[(Orders DB)]
|
|
192
|
+
end
|
|
193
|
+
UI --> API
|
|
194
|
+
UI --> Cache
|
|
195
|
+
API --> Auth
|
|
196
|
+
API --> Orders
|
|
197
|
+
Orders --> DB
|
|
198
|
+
Auth -. token .-> UI
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### The previous appearance
|
|
202
|
+
|
|
203
|
+
Both are only defaults, so anything you set yourself wins. Naming the previous theme and look
|
|
204
|
+
in a diagram's front matter draws it the way Mermaid did before:
|
|
205
|
+
|
|
206
|
+
```mermaid-example
|
|
207
|
+
---
|
|
208
|
+
config:
|
|
209
|
+
theme: default
|
|
210
|
+
look: classic
|
|
211
|
+
layout: dagre
|
|
212
|
+
---
|
|
213
|
+
flowchart LR
|
|
214
|
+
subgraph Client
|
|
215
|
+
UI[Web app]
|
|
216
|
+
Cache[(Local cache)]
|
|
217
|
+
end
|
|
218
|
+
subgraph Services
|
|
219
|
+
API[API gateway]
|
|
220
|
+
Auth[Auth service]
|
|
221
|
+
Orders[Order service]
|
|
222
|
+
end
|
|
223
|
+
subgraph Storage
|
|
224
|
+
DB[(Orders DB)]
|
|
225
|
+
end
|
|
226
|
+
UI --> API
|
|
227
|
+
UI --> Cache
|
|
228
|
+
API --> Auth
|
|
229
|
+
API --> Orders
|
|
230
|
+
Orders --> DB
|
|
231
|
+
Auth -. token .-> UI
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
```mermaid
|
|
235
|
+
---
|
|
236
|
+
config:
|
|
237
|
+
theme: default
|
|
238
|
+
look: classic
|
|
239
|
+
layout: dagre
|
|
240
|
+
---
|
|
241
|
+
flowchart LR
|
|
242
|
+
subgraph Client
|
|
243
|
+
UI[Web app]
|
|
244
|
+
Cache[(Local cache)]
|
|
245
|
+
end
|
|
246
|
+
subgraph Services
|
|
247
|
+
API[API gateway]
|
|
248
|
+
Auth[Auth service]
|
|
249
|
+
Orders[Order service]
|
|
250
|
+
end
|
|
251
|
+
subgraph Storage
|
|
252
|
+
DB[(Orders DB)]
|
|
253
|
+
end
|
|
254
|
+
UI --> API
|
|
255
|
+
UI --> Cache
|
|
256
|
+
API --> Auth
|
|
257
|
+
API --> Orders
|
|
258
|
+
Orders --> DB
|
|
259
|
+
Auth -. token .-> UI
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Passing the same three keys to `mermaid.initialize()` does it for every diagram on the page,
|
|
263
|
+
and scoping the theme and look to one diagram type — `mermaid.initialize({ layout: 'dagre', flowchart: { theme: 'default', look: 'classic' } })` —
|
|
264
|
+
does it for that type alone. `layout` is a top-level option, so it applies to every diagram.
|
|
265
|
+
|
|
147
266
|
## Node shapes
|
|
148
267
|
|
|
149
268
|
### A node with round edges
|
|
@@ -322,56 +441,61 @@ This syntax creates a node A as a rectangle. It renders in the same way as `A["A
|
|
|
322
441
|
|
|
323
442
|
Below is a comprehensive list of the newly introduced shapes and their corresponding semantic meanings, short names, and aliases:
|
|
324
443
|
|
|
325
|
-
| **Semantic Name** | **Shape Name**
|
|
326
|
-
| --------------------------------- |
|
|
327
|
-
| Bang | Bang
|
|
328
|
-
|
|
|
329
|
-
|
|
|
330
|
-
|
|
|
331
|
-
|
|
|
332
|
-
|
|
|
333
|
-
|
|
|
334
|
-
| Comment
|
|
335
|
-
|
|
|
336
|
-
|
|
|
337
|
-
|
|
|
338
|
-
|
|
|
339
|
-
|
|
|
340
|
-
|
|
|
341
|
-
|
|
|
342
|
-
|
|
|
343
|
-
|
|
|
344
|
-
|
|
|
345
|
-
|
|
|
346
|
-
|
|
|
347
|
-
|
|
|
348
|
-
|
|
|
349
|
-
|
|
|
350
|
-
|
|
|
351
|
-
|
|
|
352
|
-
|
|
|
353
|
-
|
|
|
354
|
-
|
|
|
355
|
-
|
|
|
356
|
-
|
|
|
357
|
-
|
|
|
358
|
-
|
|
|
359
|
-
|
|
|
360
|
-
|
|
|
361
|
-
|
|
|
362
|
-
|
|
|
363
|
-
|
|
|
364
|
-
|
|
|
365
|
-
|
|
|
366
|
-
|
|
|
367
|
-
|
|
|
368
|
-
|
|
|
369
|
-
|
|
|
370
|
-
|
|
|
371
|
-
|
|
|
372
|
-
|
|
|
373
|
-
|
|
|
374
|
-
|
|
|
444
|
+
| **Semantic Name** | **Shape Name** | **Short Name** | **Description** | **Alias Supported** |
|
|
445
|
+
| --------------------------------- | ------------------------- | -------------- | ------------------------------------------- | ---------------------------------------------------------------- |
|
|
446
|
+
| Bang | Bang | `bang` | Bang | `bang` |
|
|
447
|
+
| Browser | Browser | `browser` | Browser window | |
|
|
448
|
+
| Bucket | Bucket | `bucket` | Object storage bucket | |
|
|
449
|
+
| Card | Notched Rectangle | `notch-rect` | Represents a card | `card`, `notched-rectangle` |
|
|
450
|
+
| Cloud | Cloud | `cloud` | cloud | `cloud` |
|
|
451
|
+
| Collate | Hourglass | `hourglass` | Represents a collate operation | `collate`, `hourglass` |
|
|
452
|
+
| Com Link | Lightning Bolt | `bolt` | Communication link | `com-link`, `lightning-bolt` |
|
|
453
|
+
| Comment | Curly Brace | `brace` | Adds a comment | `brace-l`, `comment` |
|
|
454
|
+
| Comment Right | Curly Brace | `brace-r` | Adds a comment | |
|
|
455
|
+
| Comment with braces on both sides | Curly Braces | `braces` | Adds a comment | |
|
|
456
|
+
| Console | Console (terminal window) | `console` | Terminal or console window | |
|
|
457
|
+
| Data Input/Output | Lean Right | `lean-r` | Represents input or output | `in-out`, `lean-right` |
|
|
458
|
+
| Data Input/Output | Lean Left | `lean-l` | Represents output or input | `lean-left`, `out-in` |
|
|
459
|
+
| Data Store | Data Store | `datastore` | Data flow diagram data store | `data-store` |
|
|
460
|
+
| Database | Cylinder | `cyl` | Database storage | `cylinder`, `database`, `db` |
|
|
461
|
+
| Decision | Diamond | `diam` | Decision-making step | `decision`, `diamond`, `question` |
|
|
462
|
+
| Delay | Half-Rounded Rectangle | `delay` | Represents a delay | `half-rounded-rectangle` |
|
|
463
|
+
| Direct Access Storage | Horizontal Cylinder | `h-cyl` | Direct access storage | `das`, `horizontal-cylinder` |
|
|
464
|
+
| Disk Storage | Lined Cylinder | `lin-cyl` | Disk storage | `disk`, `lined-cylinder` |
|
|
465
|
+
| Display | Curved Trapezoid | `curv-trap` | Represents a display | `curved-trapezoid`, `display` |
|
|
466
|
+
| Divided Process | Divided Rectangle | `div-rect` | Divided process shape | `div-proc`, `divided-process`, `divided-rectangle` |
|
|
467
|
+
| Document | Document | `doc` | Represents a document | `doc`, `document` |
|
|
468
|
+
| Event | Rounded Rectangle | `rounded` | Represents an event | `event` |
|
|
469
|
+
| Extract | Triangle | `tri` | Extraction process | `extract`, `triangle` |
|
|
470
|
+
| Folder | Folder | `folder` | Folder or directory | `directory` |
|
|
471
|
+
| Fork/Join | Filled Rectangle | `fork` | Fork or join in process flow | `join` |
|
|
472
|
+
| Internal Storage | Window Pane | `win-pane` | Internal storage | `internal-storage`, `window-pane` |
|
|
473
|
+
| Junction | Filled Circle | `f-circ` | Junction point | `filled-circle`, `junction` |
|
|
474
|
+
| Lined Document | Lined Document | `lin-doc` | Lined document | `lined-document` |
|
|
475
|
+
| Lined/Shaded Process | Lined Rectangle | `lin-rect` | Lined process shape | `lin-proc`, `lined-process`, `lined-rectangle`, `shaded-process` |
|
|
476
|
+
| Loop Limit | Trapezoidal Pentagon | `notch-pent` | Loop limit step | `loop-limit`, `notched-pentagon` |
|
|
477
|
+
| Manual File | Flipped Triangle | `flip-tri` | Manual file operation | `flipped-triangle`, `manual-file` |
|
|
478
|
+
| Manual Input | Sloped Rectangle | `sl-rect` | Manual input step | `manual-input`, `sloped-rectangle` |
|
|
479
|
+
| Manual Operation | Trapezoid Base Top | `trap-t` | Represents a manual task | `inv-trapezoid`, `manual`, `trapezoid-top` |
|
|
480
|
+
| Multi-Document | Stacked Document | `docs` | Multiple documents | `documents`, `st-doc`, `stacked-document` |
|
|
481
|
+
| Multi-Process | Stacked Rectangle | `st-rect` | Multiple processes | `processes`, `procs`, `stacked-rectangle` |
|
|
482
|
+
| Odd | Odd | `odd` | Odd shape | |
|
|
483
|
+
| Paper Tape | Flag | `flag` | Paper tape | `paper-tape` |
|
|
484
|
+
| Person | Person | `person` | Person (circular head above a rounded body) | |
|
|
485
|
+
| Prepare Conditional | Hexagon | `hex` | Preparation or condition step | `hexagon`, `prepare` |
|
|
486
|
+
| Priority Action | Trapezoid Base Bottom | `trap-b` | Priority action | `priority`, `trapezoid`, `trapezoid-bottom` |
|
|
487
|
+
| Process | Rectangle | `rect` | Standard process shape | `proc`, `process`, `rectangle` |
|
|
488
|
+
| Start | Circle | `circle` | Starting point | `circ` |
|
|
489
|
+
| Start | Small Circle | `sm-circ` | Small starting point | `small-circle`, `start` |
|
|
490
|
+
| Stop | Double Circle | `dbl-circ` | Represents a stop point | `double-circle` |
|
|
491
|
+
| Stop | Framed Circle | `fr-circ` | Stop point | `framed-circle`, `stop` |
|
|
492
|
+
| Stored Data | Bow Tie Rectangle | `bow-rect` | Stored data | `bow-tie-rectangle`, `stored-data` |
|
|
493
|
+
| Subprocess | Framed Rectangle | `fr-rect` | Subprocess | `framed-rectangle`, `subproc`, `subprocess`, `subroutine` |
|
|
494
|
+
| Summary | Crossed Circle | `cross-circ` | Summary | `crossed-circle`, `summary` |
|
|
495
|
+
| Tagged Document | Tagged Document | `tag-doc` | Tagged document | `tag-doc`, `tagged-document` |
|
|
496
|
+
| Tagged Process | Tagged Rectangle | `tag-rect` | Tagged process | `tag-proc`, `tagged-process`, `tagged-rectangle` |
|
|
497
|
+
| Terminal Point | Stadium | `stadium` | Terminal point | `pill`, `terminal` |
|
|
498
|
+
| Text Block | Text Block | `text` | Text block | |
|
|
375
499
|
|
|
376
500
|
### Example Flowchart with New Shapes
|
|
377
501
|
|
|
@@ -1615,7 +1739,7 @@ flowchart LR
|
|
|
1615
1739
|
outside ---> top2
|
|
1616
1740
|
```
|
|
1617
1741
|
|
|
1618
|
-
### Collapsible subgraphs (
|
|
1742
|
+
### Collapsible subgraphs (v11.17.0+)
|
|
1619
1743
|
|
|
1620
1744
|
A subgraph can be collapsed into a single compact node by attaching the metadata
|
|
1621
1745
|
`@{ view: collapsed }` to its id. This is useful for hiding the internals of a
|
|
@@ -2128,21 +2252,25 @@ flowchart LR
|
|
|
2128
2252
|
|
|
2129
2253
|
### Renderer
|
|
2130
2254
|
|
|
2131
|
-
The layout of the diagram is done with the
|
|
2132
|
-
|
|
2133
|
-
|
|
2255
|
+
The layout of the diagram is done with the layout algorithm. The default is
|
|
2256
|
+
[ELK](https://www.eclipse.org/elk/), which handles larger and more complex
|
|
2257
|
+
diagrams well and is bundled with Mermaid.
|
|
2134
2258
|
|
|
2135
|
-
|
|
2136
|
-
You can change the renderer to elk by adding this directive:
|
|
2259
|
+
To use the classic Dagre layout instead:
|
|
2137
2260
|
|
|
2138
2261
|
```
|
|
2139
2262
|
config:
|
|
2140
|
-
|
|
2141
|
-
defaultRenderer: "elk"
|
|
2263
|
+
layout: dagre
|
|
2142
2264
|
```
|
|
2143
2265
|
|
|
2144
|
-
|
|
2145
|
-
|
|
2266
|
+
The `flowchart-elk` diagram type still works, but is no longer needed — it
|
|
2267
|
+
predates `layout` and selected what is now the default.
|
|
2268
|
+
|
|
2269
|
+
The `defaultRenderer` option of the `flowchart`, `class` and `state` config
|
|
2270
|
+
sections was removed in v12. It named a rendering engine at a time when there
|
|
2271
|
+
was more than one; all of its values had come to mean the same renderer, and
|
|
2272
|
+
its `elk` value only ever set `layout: elk` on your behalf. Use `layout`
|
|
2273
|
+
directly.
|
|
2146
2274
|
|
|
2147
2275
|
### Width
|
|
2148
2276
|
|
|
@@ -1130,14 +1130,20 @@ Mermaid supports a bunch of pre-defined themes which you can use to find the rig
|
|
|
1130
1130
|
|
|
1131
1131
|
The following are the different pre-defined theme options:
|
|
1132
1132
|
|
|
1133
|
-
- `
|
|
1134
|
-
- `
|
|
1135
|
-
- `
|
|
1133
|
+
- `redux-color` (the default)
|
|
1134
|
+
- `redux-dark-color`
|
|
1135
|
+
- `redux`
|
|
1136
|
+
- `redux-dark`
|
|
1136
1137
|
- `default`
|
|
1137
1138
|
- `neutral`
|
|
1139
|
+
- `dark`
|
|
1140
|
+
- `forest`
|
|
1141
|
+
- `neo`
|
|
1142
|
+
- `neo-dark`
|
|
1143
|
+
- `base`
|
|
1138
1144
|
|
|
1139
1145
|
**NOTE**: To change theme you can either use the `initialize` call or _directives_. Learn more about [directives](../config/directives.md)
|
|
1140
|
-
Let's put them to use, and see how our sample diagram looks in different themes:
|
|
1146
|
+
Let's put a few of them to use, and see how our sample diagram looks in different themes:
|
|
1141
1147
|
|
|
1142
1148
|
### Base Theme
|
|
1143
1149
|
|
|
@@ -1343,7 +1349,7 @@ config:
|
|
|
1343
1349
|
merge release
|
|
1344
1350
|
```
|
|
1345
1351
|
|
|
1346
|
-
###
|
|
1352
|
+
### The `default` Theme
|
|
1347
1353
|
|
|
1348
1354
|
```mermaid-example
|
|
1349
1355
|
---
|
|
@@ -1655,7 +1661,7 @@ Mermaid allows you to customize your diagram using theme variables which govern
|
|
|
1655
1661
|
|
|
1656
1662
|
For understanding let us take a sample diagram with theme `default`, the default values of the theme variables is picked automatically from the theme. Later on we will see how to override the default values of the theme variables.
|
|
1657
1663
|
|
|
1658
|
-
See how the default theme is used to set the colors for the branches:
|
|
1664
|
+
See how the `default` theme is used to set the colors for the branches:
|
|
1659
1665
|
|
|
1660
1666
|
```mermaid-example
|
|
1661
1667
|
---
|
|
@@ -1778,7 +1784,7 @@ See how the branch colors are changed to the values specified in the theme varia
|
|
|
1778
1784
|
|
|
1779
1785
|
You can customize the branch label colors using the `gitBranchLabel0` to `gitBranchLabel7` theme variables. Mermaid allows you to set the colors for up-to 8 branches, where `gitBranchLabel0` variable will drive the value of the first branch label, `gitBranchLabel1` will drive the value of the second branch label and so on.
|
|
1780
1786
|
|
|
1781
|
-
Lets see how the default theme is used to set the colors for the branch labels:
|
|
1787
|
+
Lets see how the `default` theme is used to set the colors for the branch labels:
|
|
1782
1788
|
|
|
1783
1789
|
Now let's override the default values for the `gitBranchLabel0` to `gitBranchLabel2` variables:
|
|
1784
1790
|
|
|
@@ -180,6 +180,115 @@ mindmap
|
|
|
180
180
|
|
|
181
181
|
More shapes will be added, beginning with the shapes available in flowcharts.
|
|
182
182
|
|
|
183
|
+
## Coloring by depth (v12.2.0+)
|
|
184
|
+
|
|
185
|
+
By default, mindmaps use a different color for each top-level branch. Descendants inherit their branch's color. Set `mindmap.colorBy` to `depth` to give all nodes at the same hierarchy level the same color, across every branch:
|
|
186
|
+
|
|
187
|
+
```mermaid-example
|
|
188
|
+
---
|
|
189
|
+
config:
|
|
190
|
+
mindmap:
|
|
191
|
+
colorBy: depth
|
|
192
|
+
---
|
|
193
|
+
mindmap
|
|
194
|
+
root((mindmap))
|
|
195
|
+
origins{{Origins}}
|
|
196
|
+
history[Long history]
|
|
197
|
+
Popularisation
|
|
198
|
+
British popular psychology author Tony Buzan
|
|
199
|
+
research{{Research}}
|
|
200
|
+
uses[Uses]
|
|
201
|
+
Creative techniques
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
```mermaid
|
|
205
|
+
---
|
|
206
|
+
config:
|
|
207
|
+
mindmap:
|
|
208
|
+
colorBy: depth
|
|
209
|
+
---
|
|
210
|
+
mindmap
|
|
211
|
+
root((mindmap))
|
|
212
|
+
origins{{Origins}}
|
|
213
|
+
history[Long history]
|
|
214
|
+
Popularisation
|
|
215
|
+
British popular psychology author Tony Buzan
|
|
216
|
+
research{{Research}}
|
|
217
|
+
uses[Uses]
|
|
218
|
+
Creative techniques
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Depth counts parent-child relationships, not spaces: the root has depth 0, its children have depth 1, and their children have depth 2. Uneven indentation does not change the color of nodes that share a depth.
|
|
222
|
+
|
|
223
|
+
With the classic look, the root uses `git0` for its background and `gitBranchLabel0` for its label (`redux` themes color HTML labels with `nodeBorder` instead). Depths 1 through 11 use `cScale1` through `cScale11` for backgrounds and `cScaleLabel1` through `cScaleLabel11` for labels. Deeper levels repeat those eleven colors. Each edge uses the `cScale` color of its child node.
|
|
224
|
+
|
|
225
|
+
To choose the color of each level, set those variables with the `base` theme and pick contrasting background and label colors. The `neo` look colors the root label with `cScaleLabel0`, so set it too. In the `neo` look, also set `useGradient: false`, because otherwise `base` paints every node with `mainBkg`:
|
|
226
|
+
|
|
227
|
+
```mermaid-example
|
|
228
|
+
---
|
|
229
|
+
config:
|
|
230
|
+
theme: base
|
|
231
|
+
mindmap:
|
|
232
|
+
colorBy: depth
|
|
233
|
+
themeVariables:
|
|
234
|
+
git0: '#374151'
|
|
235
|
+
gitBranchLabel0: '#ffffff'
|
|
236
|
+
cScaleLabel0: '#ffffff'
|
|
237
|
+
cScale1: '#bfdbfe'
|
|
238
|
+
cScaleLabel1: '#172554'
|
|
239
|
+
cScale2: '#bbf7d0'
|
|
240
|
+
cScaleLabel2: '#14532d'
|
|
241
|
+
cScale3: '#fde68a'
|
|
242
|
+
cScaleLabel3: '#451a03'
|
|
243
|
+
---
|
|
244
|
+
mindmap
|
|
245
|
+
root((mindmap))
|
|
246
|
+
origins{{Origins}}
|
|
247
|
+
history[Long history]
|
|
248
|
+
Popularisation
|
|
249
|
+
British popular psychology author Tony Buzan
|
|
250
|
+
research{{Research}}
|
|
251
|
+
uses[Uses]
|
|
252
|
+
Creative techniques
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
```mermaid
|
|
256
|
+
---
|
|
257
|
+
config:
|
|
258
|
+
theme: base
|
|
259
|
+
mindmap:
|
|
260
|
+
colorBy: depth
|
|
261
|
+
themeVariables:
|
|
262
|
+
git0: '#374151'
|
|
263
|
+
gitBranchLabel0: '#ffffff'
|
|
264
|
+
cScaleLabel0: '#ffffff'
|
|
265
|
+
cScale1: '#bfdbfe'
|
|
266
|
+
cScaleLabel1: '#172554'
|
|
267
|
+
cScale2: '#bbf7d0'
|
|
268
|
+
cScaleLabel2: '#14532d'
|
|
269
|
+
cScale3: '#fde68a'
|
|
270
|
+
cScaleLabel3: '#451a03'
|
|
271
|
+
---
|
|
272
|
+
mindmap
|
|
273
|
+
root((mindmap))
|
|
274
|
+
origins{{Origins}}
|
|
275
|
+
history[Long history]
|
|
276
|
+
Popularisation
|
|
277
|
+
British popular psychology author Tony Buzan
|
|
278
|
+
research{{Research}}
|
|
279
|
+
uses[Uses]
|
|
280
|
+
Creative techniques
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
Depth mode uses the same theme styles as branch coloring and only changes which nodes share a color. In the `neo` look, some themes use one background for every node in both modes:
|
|
284
|
+
|
|
285
|
+
- Themes with `useGradient` enabled paint every node, including the root, with `mainBkg`. It is on by default in `base`, `dark`, `forest`, `neo`, `neo-dark` and `neutral`. Set `themeVariables.useGradient: false` to show depth colors on node backgrounds.
|
|
286
|
+
- `neutral`, `redux` and `redux-dark` paint every node below the root with `mainBkg` even without the gradient, and use one label color for all of them.
|
|
287
|
+
|
|
288
|
+
In the `neo` look, the root label uses `cScaleLabel0` (`cScaleLabel1` in `neutral`, `nodeBorder` in `redux` themes). Edges keep their depth colors, except in `neo-dark` and the `redux` themes.
|
|
289
|
+
|
|
290
|
+
Set `mindmap.colorBy` to `branch` (the default) to restore branch coloring.
|
|
291
|
+
|
|
183
292
|
# Icons and classes
|
|
184
293
|
|
|
185
294
|
## Icons
|
|
@@ -304,7 +413,7 @@ From version 9.4.0 you can simplify this code to:
|
|
|
304
413
|
|
|
305
414
|
```html
|
|
306
415
|
<script type="module">
|
|
307
|
-
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@
|
|
416
|
+
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@12/dist/mermaid.esm.min.mjs';
|
|
308
417
|
</script>
|
|
309
418
|
```
|
|
310
419
|
|
|
@@ -110,6 +110,44 @@ title UDP Packet
|
|
|
110
110
|
- **Ranges**: Each line after the title represents a different field in the packet. The range (e.g., `0-15`) indicates the bit positions in the packet.
|
|
111
111
|
- **Field Description**: A brief description of what the field represents, enclosed in quotes.
|
|
112
112
|
|
|
113
|
+
### Bit Numbering Order (v12.0.0+)
|
|
114
|
+
|
|
115
|
+
Rows are numbered from their lowest bit on the left up to their highest bit on the right, which suits network packets. Hardware registers are conventionally drawn the other way round, with the most significant bit on the left and bit 0 on the right. Set `bitOrder: descending` to mirror every row:
|
|
116
|
+
|
|
117
|
+
```mermaid-example
|
|
118
|
+
---
|
|
119
|
+
config:
|
|
120
|
+
packet:
|
|
121
|
+
showBits: true
|
|
122
|
+
bitOrder: descending
|
|
123
|
+
bitsPerRow: 16
|
|
124
|
+
---
|
|
125
|
+
packet
|
|
126
|
+
0-7: "DATA"
|
|
127
|
+
8-11: "TYPE"
|
|
128
|
+
12: "EN"
|
|
129
|
+
13-15: "RESERVED"
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
```mermaid
|
|
133
|
+
---
|
|
134
|
+
config:
|
|
135
|
+
packet:
|
|
136
|
+
showBits: true
|
|
137
|
+
bitOrder: descending
|
|
138
|
+
bitsPerRow: 16
|
|
139
|
+
---
|
|
140
|
+
packet
|
|
141
|
+
0-7: "DATA"
|
|
142
|
+
8-11: "TYPE"
|
|
143
|
+
12: "EN"
|
|
144
|
+
13-15: "RESERVED"
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Only the drawing is mirrored. Fields are still declared lowest bit first (`0-7`, never `7-0`) and keep their width, so the same diagram can be switched between the two conventions by changing `bitOrder` alone.
|
|
148
|
+
|
|
149
|
+
Each row is mirrored on its own, so a packet wider than `bitsPerRow` reads as a stack of words that each run from their highest bit down to their lowest: with the default `bitsPerRow: 32`, the second row runs from bit 63 down to bit 32, not down to bit 0. A row that is not completely filled is padded on the left, keeping its lowest bit flush against the right edge.
|
|
150
|
+
|
|
113
151
|
## Configuration
|
|
114
152
|
|
|
115
153
|
Please refer to the [configuration](/config/schema-docs/config-defs-packet-diagram-config.html) guide for details.
|
|
@@ -44,6 +44,121 @@ Rendering requirements is straightforward.
|
|
|
44
44
|
test_entity - satisfies -> test_req
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
+
## Default theme, look and layout (v12.0.0+)
|
|
48
|
+
|
|
49
|
+
Requirement diagrams use the `redux-color` theme and the `neo` look by default, and are laid out by [ELK](https://www.eclipse.org/elk/) rather than Dagre. Not every diagram type
|
|
50
|
+
does — see [Per-diagram defaults](../config/theming.md#per-diagram-defaults) for the list and
|
|
51
|
+
for the order in which Mermaid decides.
|
|
52
|
+
|
|
53
|
+
The same diagram, drawn both ways:
|
|
54
|
+
|
|
55
|
+
### With the defaults
|
|
56
|
+
|
|
57
|
+
```mermaid-example
|
|
58
|
+
requirementDiagram
|
|
59
|
+
requirement checkout_req {
|
|
60
|
+
id: 1
|
|
61
|
+
text: Orders must be payable online.
|
|
62
|
+
risk: high
|
|
63
|
+
verifymethod: test
|
|
64
|
+
}
|
|
65
|
+
functionalRequirement payment_req {
|
|
66
|
+
id: 1.1
|
|
67
|
+
text: Card payments must be authorised.
|
|
68
|
+
risk: high
|
|
69
|
+
verifymethod: test
|
|
70
|
+
}
|
|
71
|
+
element checkout_service {
|
|
72
|
+
type: service
|
|
73
|
+
}
|
|
74
|
+
checkout_req - contains -> payment_req
|
|
75
|
+
checkout_service - satisfies -> payment_req
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
```mermaid
|
|
79
|
+
requirementDiagram
|
|
80
|
+
requirement checkout_req {
|
|
81
|
+
id: 1
|
|
82
|
+
text: Orders must be payable online.
|
|
83
|
+
risk: high
|
|
84
|
+
verifymethod: test
|
|
85
|
+
}
|
|
86
|
+
functionalRequirement payment_req {
|
|
87
|
+
id: 1.1
|
|
88
|
+
text: Card payments must be authorised.
|
|
89
|
+
risk: high
|
|
90
|
+
verifymethod: test
|
|
91
|
+
}
|
|
92
|
+
element checkout_service {
|
|
93
|
+
type: service
|
|
94
|
+
}
|
|
95
|
+
checkout_req - contains -> payment_req
|
|
96
|
+
checkout_service - satisfies -> payment_req
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### The previous appearance
|
|
100
|
+
|
|
101
|
+
Both are only defaults, so anything you set yourself wins. Naming the previous theme and look
|
|
102
|
+
in a diagram's front matter draws it the way Mermaid did before:
|
|
103
|
+
|
|
104
|
+
```mermaid-example
|
|
105
|
+
---
|
|
106
|
+
config:
|
|
107
|
+
theme: default
|
|
108
|
+
look: classic
|
|
109
|
+
layout: dagre
|
|
110
|
+
---
|
|
111
|
+
requirementDiagram
|
|
112
|
+
requirement checkout_req {
|
|
113
|
+
id: 1
|
|
114
|
+
text: Orders must be payable online.
|
|
115
|
+
risk: high
|
|
116
|
+
verifymethod: test
|
|
117
|
+
}
|
|
118
|
+
functionalRequirement payment_req {
|
|
119
|
+
id: 1.1
|
|
120
|
+
text: Card payments must be authorised.
|
|
121
|
+
risk: high
|
|
122
|
+
verifymethod: test
|
|
123
|
+
}
|
|
124
|
+
element checkout_service {
|
|
125
|
+
type: service
|
|
126
|
+
}
|
|
127
|
+
checkout_req - contains -> payment_req
|
|
128
|
+
checkout_service - satisfies -> payment_req
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
```mermaid
|
|
132
|
+
---
|
|
133
|
+
config:
|
|
134
|
+
theme: default
|
|
135
|
+
look: classic
|
|
136
|
+
layout: dagre
|
|
137
|
+
---
|
|
138
|
+
requirementDiagram
|
|
139
|
+
requirement checkout_req {
|
|
140
|
+
id: 1
|
|
141
|
+
text: Orders must be payable online.
|
|
142
|
+
risk: high
|
|
143
|
+
verifymethod: test
|
|
144
|
+
}
|
|
145
|
+
functionalRequirement payment_req {
|
|
146
|
+
id: 1.1
|
|
147
|
+
text: Card payments must be authorised.
|
|
148
|
+
risk: high
|
|
149
|
+
verifymethod: test
|
|
150
|
+
}
|
|
151
|
+
element checkout_service {
|
|
152
|
+
type: service
|
|
153
|
+
}
|
|
154
|
+
checkout_req - contains -> payment_req
|
|
155
|
+
checkout_service - satisfies -> payment_req
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Passing the same three keys to `mermaid.initialize()` does it for every diagram on the page,
|
|
159
|
+
and scoping the theme and look to one diagram type — `mermaid.initialize({ layout: 'dagre', requirement: { theme: 'default', look: 'classic' } })` —
|
|
160
|
+
does it for that type alone. `layout` is a top-level option, so it applies to every diagram.
|
|
161
|
+
|
|
47
162
|
## Syntax
|
|
48
163
|
|
|
49
164
|
There are three types of components to a requirement diagram: requirement, element, and relationship.
|