@achmadya-dev/mcp-diagram 0.3.0
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/LICENSE +191 -0
- package/README.md +172 -0
- package/dist/assets/shape-search/search-index.json +83954 -0
- package/dist/assets/shared/create-diagram-intro.md +52 -0
- package/dist/assets/shared/mermaid-reference.md +473 -0
- package/dist/assets/shared/xml-reference.md +479 -0
- package/dist/assets/vendor/app/libavoid/LICENSE +505 -0
- package/dist/assets/vendor/app/libavoid/libavoid.min.js +22 -0
- package/dist/assets/vendor/app/libavoid/libavoid.wasm +0 -0
- package/dist/drawio/drawio.d.ts +27 -0
- package/dist/drawio/drawio.d.ts.map +1 -0
- package/dist/drawio/drawio.js +77 -0
- package/dist/drawio/drawio.js.map +1 -0
- package/dist/drawio/utils.d.ts +29 -0
- package/dist/drawio/utils.d.ts.map +1 -0
- package/dist/drawio/utils.js +419 -0
- package/dist/drawio/utils.js.map +1 -0
- package/dist/drawio/viewer/html.d.ts +59 -0
- package/dist/drawio/viewer/html.d.ts.map +1 -0
- package/dist/drawio/viewer/html.js +6528 -0
- package/dist/drawio/viewer/html.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +94 -0
- package/dist/index.js.map +1 -0
- package/dist/scripts/copy-assets.d.ts +3 -0
- package/dist/scripts/copy-assets.d.ts.map +1 -0
- package/dist/scripts/copy-assets.js +28 -0
- package/dist/scripts/copy-assets.js.map +1 -0
- package/dist/scripts/generate-shape-index.d.ts +15 -0
- package/dist/scripts/generate-shape-index.d.ts.map +1 -0
- package/dist/scripts/generate-shape-index.js +347 -0
- package/dist/scripts/generate-shape-index.js.map +1 -0
- package/dist/tools/search_shapes.d.ts +2 -0
- package/dist/tools/search_shapes.d.ts.map +1 -0
- package/dist/tools/search_shapes.js +34 -0
- package/dist/tools/search_shapes.js.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
Creates and displays an interactive draw.io diagram. Accepts either draw.io XML or Mermaid.js syntax — provide exactly one.
|
|
2
|
+
|
|
3
|
+
**Format decision — this is the first thing to settle before you write anything:** if the diagram type appears on the Mermaid list below, use `mermaid`. Only use `xml` when the diagram type isn't on that list (UI mockups, floorplans, cloud/network/electrical architecture with stencils, hand-placed UML, etc.) or when the user has explicitly asked for draw.io XML.
|
|
4
|
+
|
|
5
|
+
**Use Mermaid** for the following diagram types (all rendered natively, no upstream mermaid runtime):
|
|
6
|
+
|
|
7
|
+
- flowchart / graph (TD, LR, …)
|
|
8
|
+
- sequenceDiagram
|
|
9
|
+
- classDiagram
|
|
10
|
+
- stateDiagram / stateDiagram-v2
|
|
11
|
+
- erDiagram
|
|
12
|
+
- gantt
|
|
13
|
+
- pie
|
|
14
|
+
- journey (user-journey)
|
|
15
|
+
- gitGraph
|
|
16
|
+
- mindmap
|
|
17
|
+
- timeline
|
|
18
|
+
- quadrantChart
|
|
19
|
+
- xychart-beta
|
|
20
|
+
- sankey-beta
|
|
21
|
+
- requirementDiagram
|
|
22
|
+
- C4Context / C4Container / C4Component
|
|
23
|
+
- block-beta
|
|
24
|
+
- architecture-beta
|
|
25
|
+
- packet-beta
|
|
26
|
+
- kanban
|
|
27
|
+
- radar-beta
|
|
28
|
+
- treemap-beta
|
|
29
|
+
- treeview-beta (draw.io-specific)
|
|
30
|
+
- venn (draw.io-specific) — syntax: `venn` then `set A ["Label"]` for each set, `union A,B` for declared overlaps (informational), and `text A` / `text A,B` followed by `["Region label"]` for text inside a region. Do NOT use `A AND B[...]` or `A["..."]` shorthand — those lines are ignored.
|
|
31
|
+
- ishikawa (draw.io-specific)
|
|
32
|
+
- zenuml
|
|
33
|
+
|
|
34
|
+
**Strong default: use Mermaid for every diagram type on that list above.** Mermaid is simpler, more reliable, and the native Mermaid layout handles positioning and routing for you. For a flowchart, state diagram, sequence, ER, class, gantt, gitGraph, mindmap, etc. — reach for the `mermaid` parameter, not `xml`. Do not default to XML for flowcharts.
|
|
35
|
+
|
|
36
|
+
**Use XML** when the diagram type isn't on the Mermaid list above OR when the user explicitly asks for XML / draw.io format. Typical cases where XML is the right choice:
|
|
37
|
+
|
|
38
|
+
- **UI mockups / wireframes / screen designs** — buttons, form fields, sidebars, modal dialogs (`shape=mxgraph.bootstrap.*`, `shape=mxgraph.ios.*`, `shape=mxgraph.android.*`)
|
|
39
|
+
- **Floor plans / seating charts / room layouts** — rooms, doors, furniture (`shape=mxgraph.floorplan.*`)
|
|
40
|
+
- **Cloud architecture** with AWS / Azure / GCP / Kubernetes icons (`shape=mxgraph.aws4.*`, `shape=mxgraph.azure.*`, `shape=mxgraph.gcp2.*`, `shape=mxgraph.kubernetes.*`)
|
|
41
|
+
- **Network topology** with Cisco / Rack / networking shapes (`shape=mxgraph.cisco*.*`, `shape=mxgraph.rack.*`, `shape=mxgraph.networking.*`)
|
|
42
|
+
- **P&ID / electrical / engineering schematics** (`shape=mxgraph.pid2.*`, `shape=mxgraph.electrical.*`, `shape=mxgraph.mscae.*`)
|
|
43
|
+
- **Swimlanes / pools** with custom colors and hand-placed contents
|
|
44
|
+
- **UML class / component / deployment diagrams** where positioning carries meaning
|
|
45
|
+
- **Venn diagrams, quadrant charts, concept maps** with custom regions — anything where hand-placed geometry is the point
|
|
46
|
+
- **Any diagram requiring specific colors, fonts, stencils, or layouts** that Mermaid can't control precisely
|
|
47
|
+
|
|
48
|
+
Call `search_shapes` first when you need industry icons (AWS / Azure / Cisco / P&ID / Kubernetes / floorplan / mockup / electrical) to find the correct `style` string for each shape.
|
|
49
|
+
|
|
50
|
+
**User preference override — XML only.** If the user expresses a preference for draw.io XML over Mermaid in any phrasing (examples: "no mermaid", "skip mermaid", "use xml", "I want drawio format", "stop using mermaid", "give me the xml", "native drawio only", etc.), from that point onward in the conversation you MUST use the `xml` parameter exclusively and MUST NOT use the `mermaid` parameter, even for diagram types where Mermaid would normally be preferable. This preference persists for the remainder of the conversation unless the user clearly reverses it (e.g. "mermaid is fine again"). When the preference is active, translate any diagram request — including flowcharts, sequence diagrams, ER diagrams, etc. — directly to well-formed mxGraphModel XML.
|
|
51
|
+
|
|
52
|
+
When using XML: IMPORTANT — the XML must be well-formed. Do NOT include ANY XML comments (`<!-- -->`) in the output.
|
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
# Mermaid Reference
|
|
2
|
+
|
|
3
|
+
Short hints for generating Mermaid diagrams that render correctly in draw.io. draw.io's Mermaid parser covers 28 diagram types — the header keyword on the first non-directive line selects the type.
|
|
4
|
+
|
|
5
|
+
_Canonical list & dialog/ELK docs: <https://github.com/jgraph/drawio/discussions/5643>._
|
|
6
|
+
|
|
7
|
+
## General rules
|
|
8
|
+
|
|
9
|
+
- **Pick the type keyword carefully.** `graph`/`flowchart`, `classDiagram`, `stateDiagram-v2`, `erDiagram`, `sequenceDiagram`, `gitGraph`, `journey`, `pie`, `gantt`, `mindmap`, `timeline`, `quadrantChart`, `requirementDiagram`, `sankey-beta`, `xychart-beta`, `block-beta`, `c4Context`/`C4Container`/`C4Component`, `architecture-beta`, `radar-beta`, `packet-beta`, `venn-beta`, `treemap-beta`, `treeView-beta`, `ishikawa-beta`, `kanban`, `zenuml`, `wardley-beta`, `eventmodeling`. Misspelling the header yields a blank diagram.
|
|
10
|
+
- **No trailing punctuation on node IDs.** IDs are identifiers (`myNode`, `node_1`, `A`) — spaces, hyphens (in some contexts), and reserved words (`end`, `class`, `subgraph`) break the parse. Put display text in brackets or quotes instead: `A["User's Account"]`.
|
|
11
|
+
- **One statement per line.** Separate statements with newlines; `;` works as a delimiter in flowchart but not everywhere.
|
|
12
|
+
- **Quote labels with special characters** (`:`, `-`, parentheses, non-ASCII). Use `"` not `'`.
|
|
13
|
+
- **HTML in labels:** only `<br>`, `<b>`, `<i>`, `<u>` are reliable across types. Use `#` for hex colors in styles, never `rgb()`.
|
|
14
|
+
- **Diagrams can take a title block** for some types:
|
|
15
|
+
```
|
|
16
|
+
---
|
|
17
|
+
title: My Diagram
|
|
18
|
+
---
|
|
19
|
+
flowchart TD
|
|
20
|
+
```
|
|
21
|
+
- **Match the language of labels to the user's language** — if the user writes in German, French, etc., the diagram labels should be in that language too.
|
|
22
|
+
|
|
23
|
+
## Flowchart (most common)
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
flowchart TD
|
|
27
|
+
A[Start] --> B{Decision?}
|
|
28
|
+
B -->|Yes| C[Do thing]
|
|
29
|
+
B -->|No| D[Skip]
|
|
30
|
+
C --> E((End))
|
|
31
|
+
D --> E
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
- **Direction:** `TD`/`TB` (top-down), `BT`, `LR`, `RL`.
|
|
35
|
+
- **Node shapes by bracket:** `[rect]`, `(rounded)`, `([stadium])`, `[[subroutine]]`, `[(cylinder)]`, `((circle))`, `{rhombus}`, `{{hexagon}}`, `[/parallelogram/]`, `[\parallelogram alt\]`, `[/trapezoid\]`, `>asymmetric]`.
|
|
36
|
+
- **Edges:** `-->` arrow, `---` no arrow, `-.->` dotted, `==>` thick, `<-->` bidirectional. Inline label: `A -- text --> B` or `A -->|text| B`.
|
|
37
|
+
- **Subgraphs:**
|
|
38
|
+
```
|
|
39
|
+
subgraph Frontend
|
|
40
|
+
A --> B
|
|
41
|
+
end
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Styling & colors
|
|
45
|
+
|
|
46
|
+
Three ways — pick one, don't mix for the same node:
|
|
47
|
+
|
|
48
|
+
**1. Inline per-node (`style`):**
|
|
49
|
+
```
|
|
50
|
+
flowchart LR
|
|
51
|
+
A[Start] --> B[End]
|
|
52
|
+
style A fill:#f9f,stroke:#333,stroke-width:2px,color:#fff
|
|
53
|
+
style B fill:#bbf,stroke:#f66,stroke-dasharray:5 5
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**2. Reusable classes (`classDef` + `:::`):**
|
|
57
|
+
```
|
|
58
|
+
flowchart LR
|
|
59
|
+
A:::happy --> B:::sad
|
|
60
|
+
classDef happy fill:#dfd,stroke:#0a0
|
|
61
|
+
classDef sad fill:#fdd,stroke:#a00
|
|
62
|
+
```
|
|
63
|
+
Or apply to many: `class A,B,C happy`.
|
|
64
|
+
|
|
65
|
+
**3. Link styling (edges):**
|
|
66
|
+
```
|
|
67
|
+
linkStyle 0 stroke:#f00,stroke-width:3px
|
|
68
|
+
linkStyle default stroke:#999
|
|
69
|
+
```
|
|
70
|
+
`0` = first edge in order defined; `default` targets unstyled edges.
|
|
71
|
+
|
|
72
|
+
Style properties that work: `fill`, `stroke`, `stroke-width`, `stroke-dasharray`, `color` (font color).
|
|
73
|
+
|
|
74
|
+
## Sequence diagram
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
sequenceDiagram
|
|
78
|
+
participant U as User
|
|
79
|
+
participant S as Server
|
|
80
|
+
U->>S: Request
|
|
81
|
+
S-->>U: Response
|
|
82
|
+
Note right of S: Logged
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
- **Arrows:** `->` (no head), `->>` (arrow), `-->>` (dashed), `-x` (X end), `--x` (dashed X).
|
|
86
|
+
- **Activate/deactivate:** `activate S` / `deactivate S` or `S->>+S2: call` / `S2-->>-S: return`.
|
|
87
|
+
- **Blocks:** `alt/else/end`, `opt/end`, `loop/end`, `par/and/end`, `critical/option/end`.
|
|
88
|
+
- **Notes:** `Note left of A`, `Note over A,B: text`.
|
|
89
|
+
- Optional `autonumber` after header numbers the messages.
|
|
90
|
+
|
|
91
|
+
## Class diagram
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
classDiagram
|
|
95
|
+
class Animal {
|
|
96
|
+
+String name
|
|
97
|
+
+int age
|
|
98
|
+
+eat() void
|
|
99
|
+
}
|
|
100
|
+
class Dog
|
|
101
|
+
Animal <|-- Dog : inherits
|
|
102
|
+
Dog "1" --> "*" Bone : has
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
- **Relations:** `<|--` inherit, `*--` composition, `o--` aggregation, `-->` association, `..>` dependency, `..|>` realize, `<-->` bidirectional.
|
|
106
|
+
- **Visibility:** `+` public, `-` private, `#` protected, `~` package.
|
|
107
|
+
- **Annotations:** `<<interface>>`, `<<abstract>>`, `<<enumeration>>` inside the class block or via `Animal <<interface>>`.
|
|
108
|
+
- **Cardinality:** quoted strings flanking the arrow (`"1"`, `"0..*"`, `"*"`).
|
|
109
|
+
|
|
110
|
+
## State diagram
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
stateDiagram-v2
|
|
114
|
+
[*] --> Idle
|
|
115
|
+
Idle --> Running : start
|
|
116
|
+
Running --> Idle : stop
|
|
117
|
+
Running --> [*]
|
|
118
|
+
state Running {
|
|
119
|
+
[*] --> Working
|
|
120
|
+
Working --> Waiting : block
|
|
121
|
+
Waiting --> Working : unblock
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
- Use `stateDiagram-v2`, not `stateDiagram` (v1 is legacy).
|
|
126
|
+
- `[*]` = start (source) or end (target) depending on direction.
|
|
127
|
+
- `state X { ... }` nests a compound state; `state fork1 <<fork>>`, `<<join>>`, `<<choice>>` mark junction nodes.
|
|
128
|
+
- Transition labels: `A --> B : event [guard] / action`.
|
|
129
|
+
|
|
130
|
+
## ER diagram
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
erDiagram
|
|
134
|
+
CUSTOMER ||--o{ ORDER : places
|
|
135
|
+
ORDER ||--|{ LINE-ITEM : contains
|
|
136
|
+
CUSTOMER {
|
|
137
|
+
string name
|
|
138
|
+
string email PK
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
- **Cardinality symbols:** `|o` zero-or-one, `||` exactly-one, `}o` zero-or-many, `}|` one-or-many. Mirror on both sides (e.g., `||--o{`).
|
|
143
|
+
- Attribute blocks list `type name [PK|FK|UK]` plus optional comment in quotes.
|
|
144
|
+
- Entity names are typically UPPERCASE by convention.
|
|
145
|
+
|
|
146
|
+
## Journey
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
journey
|
|
150
|
+
title Morning routine
|
|
151
|
+
section Wake up
|
|
152
|
+
Coffee: 5: Me
|
|
153
|
+
Read news: 3: Me
|
|
154
|
+
section Commute
|
|
155
|
+
Drive: 2: Me, Traffic
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Each task: `Name: score(1-5): Actor[, Actor...]`. Section headers group tasks.
|
|
159
|
+
|
|
160
|
+
## Pie
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
pie showData title Browser share
|
|
164
|
+
"Chrome" : 60
|
|
165
|
+
"Firefox" : 20
|
|
166
|
+
"Safari" : 20
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
`showData` is optional (renders the numbers). Quotes on labels, colon, numeric value.
|
|
170
|
+
|
|
171
|
+
## Gantt
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
gantt
|
|
175
|
+
title Project timeline
|
|
176
|
+
dateFormat YYYY-MM-DD
|
|
177
|
+
section Phase 1
|
|
178
|
+
Design : a1, 2025-01-01, 7d
|
|
179
|
+
Build : after a1, 14d
|
|
180
|
+
section Phase 2
|
|
181
|
+
Test : 2025-01-25, 5d
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
- `dateFormat` is mandatory.
|
|
185
|
+
- Task line: `Name : [id,] [after id | YYYY-MM-DD], duration[d/w]`.
|
|
186
|
+
- Status tags: `done`, `active`, `crit` before the id (`crit a1`).
|
|
187
|
+
|
|
188
|
+
## Gitgraph
|
|
189
|
+
|
|
190
|
+
```
|
|
191
|
+
gitGraph
|
|
192
|
+
commit
|
|
193
|
+
branch develop
|
|
194
|
+
checkout develop
|
|
195
|
+
commit
|
|
196
|
+
commit
|
|
197
|
+
checkout main
|
|
198
|
+
merge develop
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Commands: `commit [id: "x"] [tag: "v1"]`, `branch name`, `checkout name`, `merge name`, `cherry-pick id: "x"`.
|
|
202
|
+
|
|
203
|
+
## Mindmap
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
mindmap
|
|
207
|
+
root((Project))
|
|
208
|
+
Frontend
|
|
209
|
+
React
|
|
210
|
+
CSS
|
|
211
|
+
Backend
|
|
212
|
+
Node
|
|
213
|
+
DB
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
- Indentation (2-space increments) defines hierarchy.
|
|
217
|
+
- Root shape: `((circle))`, `[rect]`, `(rounded)`, `))cloud((`, `)hexagon(`, `{{hexagon}}`.
|
|
218
|
+
- No edges — they are implied by nesting.
|
|
219
|
+
|
|
220
|
+
## Timeline
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
timeline
|
|
224
|
+
title Company history
|
|
225
|
+
section 2020s
|
|
226
|
+
2021 : Founded
|
|
227
|
+
2022 : Series A
|
|
228
|
+
: Launched product
|
|
229
|
+
section 2030s
|
|
230
|
+
2030 : IPO
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Colon separates year/label; multiple `:` lines under one year add sub-events.
|
|
234
|
+
|
|
235
|
+
## Quadrant chart
|
|
236
|
+
|
|
237
|
+
```
|
|
238
|
+
quadrantChart
|
|
239
|
+
title Reach vs Engagement
|
|
240
|
+
x-axis Low --> High
|
|
241
|
+
y-axis Low --> High
|
|
242
|
+
quadrant-1 Stars
|
|
243
|
+
quadrant-2 Question Marks
|
|
244
|
+
quadrant-3 Dogs
|
|
245
|
+
quadrant-4 Cash Cows
|
|
246
|
+
Campaign A: [0.3, 0.6]
|
|
247
|
+
Campaign B: [0.75, 0.85]
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
Point coords are `[0..1, 0..1]`.
|
|
251
|
+
|
|
252
|
+
## Requirement diagram
|
|
253
|
+
|
|
254
|
+
```
|
|
255
|
+
requirementDiagram
|
|
256
|
+
requirement req1 {
|
|
257
|
+
id: "1"
|
|
258
|
+
text: "The system shall..."
|
|
259
|
+
risk: high
|
|
260
|
+
verifymethod: test
|
|
261
|
+
}
|
|
262
|
+
element user_story {
|
|
263
|
+
type: "story"
|
|
264
|
+
}
|
|
265
|
+
user_story - satisfies -> req1
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
Requirement types: `requirement`, `functionalRequirement`, `performanceRequirement`, `interfaceRequirement`, `physicalRequirement`, `designConstraint`. Relations: `contains`, `copies`, `derives`, `satisfies`, `verifies`, `refines`, `traces`.
|
|
269
|
+
|
|
270
|
+
## Sankey
|
|
271
|
+
|
|
272
|
+
```
|
|
273
|
+
sankey-beta
|
|
274
|
+
Source,Intermediate,10
|
|
275
|
+
Source,Direct,5
|
|
276
|
+
Intermediate,Sink,10
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
CSV-style: `source,target,value`. No header. No `title` (use frontmatter).
|
|
280
|
+
|
|
281
|
+
## XY chart
|
|
282
|
+
|
|
283
|
+
```
|
|
284
|
+
xychart-beta
|
|
285
|
+
title "Revenue"
|
|
286
|
+
x-axis [jan, feb, mar, apr]
|
|
287
|
+
y-axis "USD" 0 --> 10000
|
|
288
|
+
bar [2500, 5000, 7500, 9000]
|
|
289
|
+
line [3000, 4500, 6500, 8500]
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
`bar [...]` and `line [...]` can stack; order matters (later overlays earlier).
|
|
293
|
+
|
|
294
|
+
## Block
|
|
295
|
+
|
|
296
|
+
```
|
|
297
|
+
block-beta
|
|
298
|
+
columns 3
|
|
299
|
+
A B C
|
|
300
|
+
D["Wide"]:2 E
|
|
301
|
+
A --> D
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
`columns N` sets grid width. `Name:N` spans N columns. Edges use flowchart arrow syntax.
|
|
305
|
+
|
|
306
|
+
## C4
|
|
307
|
+
|
|
308
|
+
```
|
|
309
|
+
C4Context
|
|
310
|
+
Person(user, "User")
|
|
311
|
+
System(app, "App", "Does things")
|
|
312
|
+
Rel(user, app, "Uses")
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
- Variants: `C4Context`, `C4Container`, `C4Component`, `C4Dynamic`, `C4Deployment`.
|
|
316
|
+
- Element helpers: `Person`, `System`, `System_Ext`, `Container`, `ComponentDb`, `Boundary(id, "label", "type")`, etc. Arguments are positional: `(id, label, [type/tech], [description])`.
|
|
317
|
+
- `UpdateElementStyle(tag, $bgColor="#…")` and `AddElementTag` tweak appearance.
|
|
318
|
+
|
|
319
|
+
## Architecture
|
|
320
|
+
|
|
321
|
+
```
|
|
322
|
+
architecture-beta
|
|
323
|
+
group cloud(cloud)[Cloud]
|
|
324
|
+
service api(server)[API] in cloud
|
|
325
|
+
service db(database)[DB] in cloud
|
|
326
|
+
api:R --> L:db
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
- Built-in icons: `cloud`, `server`, `database`, `disk`, `internet`. Suffix edge ends with `:T`, `:B`, `:L`, `:R` to pick the side.
|
|
330
|
+
- `group id(icon)[Label]` then `in groupId` on services places nodes.
|
|
331
|
+
|
|
332
|
+
## Radar
|
|
333
|
+
|
|
334
|
+
```
|
|
335
|
+
radar-beta
|
|
336
|
+
title Skills
|
|
337
|
+
axis js["JS"], py["Python"], go["Go"]
|
|
338
|
+
curve alice["Alice"]{80, 60, 70}
|
|
339
|
+
curve bob["Bob"]{50, 90, 65}
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
Axes and curves are positionally aligned — list values in axis order, 0–100.
|
|
343
|
+
|
|
344
|
+
## Packet
|
|
345
|
+
|
|
346
|
+
```
|
|
347
|
+
packet-beta
|
|
348
|
+
0-15: "Source Port"
|
|
349
|
+
16-31: "Dest Port"
|
|
350
|
+
32-63: "Seq Number"
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
`start-end` (bit ranges) or single-bit `N`. Use a title frontmatter.
|
|
354
|
+
|
|
355
|
+
## Venn
|
|
356
|
+
|
|
357
|
+
```
|
|
358
|
+
venn-beta
|
|
359
|
+
set A ["Set A"]
|
|
360
|
+
set B ["Set B"]
|
|
361
|
+
union A,B
|
|
362
|
+
text A ["only A"]
|
|
363
|
+
text A,B ["shared"]
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
Define every `union` combination whose region you plan to label. `text A,B [...]` places text in intersections.
|
|
367
|
+
|
|
368
|
+
## Treemap
|
|
369
|
+
|
|
370
|
+
```
|
|
371
|
+
treemap-beta
|
|
372
|
+
"Category"
|
|
373
|
+
"Leaf 1": 40
|
|
374
|
+
"Leaf 2": 60
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
Numbers are values (area-weighted). Indent (2+ spaces) for hierarchy.
|
|
378
|
+
|
|
379
|
+
## Tree view
|
|
380
|
+
|
|
381
|
+
```
|
|
382
|
+
treeView-beta
|
|
383
|
+
"Root"
|
|
384
|
+
"Child 1"
|
|
385
|
+
"Grandchild"
|
|
386
|
+
"Child 2"
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
Pure indentation hierarchy, no numbers.
|
|
390
|
+
|
|
391
|
+
## Ishikawa (fishbone)
|
|
392
|
+
|
|
393
|
+
```
|
|
394
|
+
ishikawa-beta
|
|
395
|
+
Main Problem
|
|
396
|
+
Category
|
|
397
|
+
Cause
|
|
398
|
+
Sub-cause
|
|
399
|
+
Another Category
|
|
400
|
+
Cause
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
First line after header is the problem; top-level indents are categories (Materials, Methods, Machinery, etc. — use whatever makes sense).
|
|
404
|
+
|
|
405
|
+
## Kanban
|
|
406
|
+
|
|
407
|
+
```
|
|
408
|
+
kanban
|
|
409
|
+
todo[To Do]
|
|
410
|
+
task1[Write spec]@{ assigned: "Alice", priority: "High" }
|
|
411
|
+
doing[In progress]
|
|
412
|
+
task2[Build feature]
|
|
413
|
+
done[Done]
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
Columns are `id[Label]` at indent 0; cards are `id[Label]@{ metadata }` inside. Metadata keys: `assigned`, `priority` (`Very Low`/`Low`/`Medium`/`High`/`Very High`), `ticket`.
|
|
417
|
+
|
|
418
|
+
## ZenUML
|
|
419
|
+
|
|
420
|
+
```
|
|
421
|
+
zenuml
|
|
422
|
+
@Actor User
|
|
423
|
+
@Boundary Web
|
|
424
|
+
@Control Service
|
|
425
|
+
User -> Web: request
|
|
426
|
+
Web -> Service: process()
|
|
427
|
+
Service -> Web: result
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
Participant roles: `@Actor`, `@Boundary`, `@Control`, `@Entity`, `@Database`. Messages use `->` with a colon-separated label. Supports `if/else`, `while`, `par` blocks like sequence diagrams.
|
|
431
|
+
|
|
432
|
+
## Wardley map
|
|
433
|
+
|
|
434
|
+
```
|
|
435
|
+
wardley-beta
|
|
436
|
+
title Tea Shop
|
|
437
|
+
anchor Business [0.95, 0.63]
|
|
438
|
+
component Cup of Tea [0.79, 0.61]
|
|
439
|
+
component Kettle [0.43, 0.35] (inertia)
|
|
440
|
+
Business -> Cup of Tea
|
|
441
|
+
Cup of Tea -> Kettle
|
|
442
|
+
evolve Kettle 0.62
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
- Header `wardley` or `wardley-beta`; `title` optional.
|
|
446
|
+
- `anchor`/`component Name [visibility, evolution]` — coords are `[0..1, 0..1]` (y = value-chain visibility, x = evolution from Genesis to Commodity).
|
|
447
|
+
- Component evolution markers in parens: `(inertia)`, `(build)`, `(buy)`, `(outsource)`, `(market)`.
|
|
448
|
+
- Links: `A -> B` dependency, `A +> B` flow. `evolve Name <x>` adds an evolution target; `evolution Genesis -> Custom -> Product -> Commodity` relabels the x-axis stages.
|
|
449
|
+
- Extras: `note "text" [x,y]`, `annotation N,[x,y] "text"`, `accelerator`/`deaccelerator "text" [x,y]`.
|
|
450
|
+
|
|
451
|
+
## Event Modeling
|
|
452
|
+
|
|
453
|
+
```
|
|
454
|
+
eventmodeling
|
|
455
|
+
tf 01 ui CartUI
|
|
456
|
+
tf 02 cmd AddItem
|
|
457
|
+
tf 03 evt ItemAdded
|
|
458
|
+
tf 04 rmo Cart
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
- Each `tf <id> <type> <Name>` is a time-frame (column). Types: `ui` / `pcr` (processor), `cmd` / `command`, `rmo` / `readmodel`, `evt` / `event` — placed on the UI/Automation, Command/Read-Model, and Events swimlanes.
|
|
462
|
+
- Wire frames with `->>`: `tf 04 evt ItemChanged ->> 02 ->> 03` links frame 04 back to 02 and 03.
|
|
463
|
+
- `Namespace.Name` groups frames into slices (e.g. `Order.ChangeOrder`).
|
|
464
|
+
- `data <id> { ... }` blocks attach payloads, referenced inline with `[[id]]`: `tf 02 cmd AddItem [[AddItem01]]`.
|
|
465
|
+
|
|
466
|
+
## When to prefer XML over Mermaid
|
|
467
|
+
|
|
468
|
+
- Precise positions / custom coordinates.
|
|
469
|
+
- draw.io-native shapes (AWS, Azure, GCP, P&ID, Cisco, electrical).
|
|
470
|
+
- Mixed shape libraries or complex multi-layer diagrams.
|
|
471
|
+
- Anything that needs exact colors per element with many variations — Mermaid's styling works but at scale XML is easier to reason about.
|
|
472
|
+
|
|
473
|
+
Default to Mermaid for the standard types above; reach for XML only when Mermaid's syntax clearly can't express what's needed.
|