@diagrammo/dgmo 0.7.2 → 0.8.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.
Files changed (62) hide show
  1. package/AGENTS.md +15 -20
  2. package/README.md +56 -58
  3. package/dist/cli.cjs +188 -181
  4. package/dist/index.cjs +3529 -1061
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +196 -43
  7. package/dist/index.d.ts +196 -43
  8. package/dist/index.js +3516 -1061
  9. package/dist/index.js.map +1 -1
  10. package/docs/language-reference.md +629 -289
  11. package/package.json +1 -1
  12. package/src/c4/layout.ts +6 -9
  13. package/src/c4/parser.ts +189 -83
  14. package/src/c4/renderer.ts +8 -9
  15. package/src/chart.ts +296 -83
  16. package/src/class/parser.ts +54 -37
  17. package/src/class/renderer.ts +8 -8
  18. package/src/cli.ts +8 -8
  19. package/src/colors.ts +4 -1
  20. package/src/completion.ts +757 -10
  21. package/src/d3.ts +312 -73
  22. package/src/dgmo-router.ts +63 -8
  23. package/src/echarts.ts +726 -231
  24. package/src/er/parser.ts +94 -76
  25. package/src/er/renderer.ts +6 -5
  26. package/src/gantt/parser.ts +144 -69
  27. package/src/gantt/renderer.ts +50 -14
  28. package/src/gantt/types.ts +3 -3
  29. package/src/graph/flowchart-parser.ts +97 -37
  30. package/src/graph/flowchart-renderer.ts +4 -3
  31. package/src/graph/state-parser.ts +50 -31
  32. package/src/graph/state-renderer.ts +4 -3
  33. package/src/index.ts +14 -5
  34. package/src/infra/compute.ts +1 -0
  35. package/src/infra/layout.ts +3 -0
  36. package/src/infra/parser.ts +291 -92
  37. package/src/infra/renderer.ts +172 -30
  38. package/src/infra/types.ts +5 -0
  39. package/src/initiative-status/layout.ts +1 -1
  40. package/src/initiative-status/parser.ts +121 -47
  41. package/src/initiative-status/renderer.ts +82 -31
  42. package/src/initiative-status/types.ts +10 -2
  43. package/src/kanban/parser.ts +60 -37
  44. package/src/kanban/renderer.ts +2 -2
  45. package/src/kanban/types.ts +1 -0
  46. package/src/org/layout.ts +9 -9
  47. package/src/org/parser.ts +39 -40
  48. package/src/org/renderer.ts +5 -6
  49. package/src/org/resolver.ts +26 -19
  50. package/src/render.ts +1 -1
  51. package/src/sequence/parser.ts +304 -95
  52. package/src/sequence/renderer.ts +9 -9
  53. package/src/sitemap/layout.ts +3 -4
  54. package/src/sitemap/parser.ts +57 -49
  55. package/src/sitemap/renderer.ts +6 -7
  56. package/src/utils/arrows.ts +25 -6
  57. package/src/utils/duration.ts +43 -7
  58. package/src/utils/legend-constants.ts +26 -0
  59. package/src/utils/legend-svg.ts +167 -0
  60. package/src/utils/parsing.ts +247 -7
  61. package/src/utils/tag-groups.ts +160 -15
  62. package/src/utils/title-constants.ts +9 -0
@@ -2,18 +2,58 @@
2
2
 
3
3
  DGMO is a text-based diagram markup language. Files use the `.dgmo` extension. Render with the `dgmo` CLI, the Diagrammo desktop app, or the `@diagrammo/dgmo` npm library.
4
4
 
5
+ ## Migration Guide
6
+
7
+ Syntax changes introduced in the consistency cleanup. Old forms now produce errors.
8
+
9
+ | Old Syntax | New Syntax | Chart Types |
10
+ |---|---|---|
11
+ | `chart: TYPE` + `title: Text` | `TYPE Text` (single first line) | All |
12
+ | `chart: TYPE` (alone) | `TYPE` | All |
13
+ | `directive: value` | `directive value` (no colon) | All |
14
+ | `Label: value` (ECharts data) | `Label value` | bar, line, pie, etc. |
15
+ | `era YYYY->YYYY: Label` | `era YYYY->YYYY Label` | line, timeline, gantt |
16
+ | `marker YYYY: Label` | `marker YYYY Label` | timeline, gantt |
17
+ | `## Group` | `tag Group` | All |
18
+ | `== Column ==` | `[Column]` | Kanban |
19
+ | `person Name` | `Name is a person` | C4 |
20
+ | `-> Target : Desc [tech]` | `-Desc-> Target \| tech: val` | C4 |
21
+ | `A <-> B` | Two lines: `A -> B` + `B -> A` | C4 |
22
+ | `-> Target x5` | `-> Target \| fanout: 5` | Infra |
23
+ | `lag: 5d` / `lead: 3d` | `offset: 5d` / `offset: -3d` | Gantt |
24
+ | `Name(color)` | Use `tag` groups | Sequence |
25
+ | `scenario:` | (removed) | Infra |
26
+ | `wip` | `doing` (wip still accepted) | Init-status |
27
+ | `#ff0000` hex colors | Named colors only | All |
28
+ | `show-sub-node-count: yes` | `show-sub-node-count` (flag) | Org |
29
+ | `import: path` | `import path` | Org |
30
+ | `tags: path` | `tags path` | Org |
31
+
32
+ ---
33
+
5
34
  ## Common Patterns
6
35
 
7
- Every `.dgmo` file can start with optional directives, followed by content.
36
+ Every `.dgmo` file starts with a chart type keyword as the first line, optionally followed by a title. Directives follow on subsequent lines.
37
+
38
+ ### First Line
39
+
40
+ ```
41
+ bar Revenue by Region
42
+ ```
43
+
44
+ The chart type keyword (`bar`, `sequence`, `gantt`, etc.) is the first token. Everything after it on the same line becomes the title. If the content is unambiguous, the chart type is auto-detected and can be omitted.
8
45
 
9
46
  ### Directives
10
47
 
11
48
  ```
12
- chart: bar // explicit chart type (optional — auto-detected)
13
- title: My Diagram // diagram title
14
- palette: nord // color palette
49
+ palette nord
50
+ theme dark
51
+ xlabel Category
52
+ ylabel Count
15
53
  ```
16
54
 
55
+ Directives are `keyword value` (no colon). They appear after the first line, before data.
56
+
17
57
  ### Comments
18
58
 
19
59
  ```
@@ -25,12 +65,11 @@ palette: nord // color palette
25
65
  Append `(colorname)` to labels, nodes, or data points:
26
66
 
27
67
  ```
28
- Port Royal(red): 850
68
+ Port Royal(red) 850
29
69
  [Process(blue)]
30
- person Customer(green)
31
70
  ```
32
71
 
33
- Named colors: `red`, `orange`, `yellow`, `green`, `blue`, `purple`, `teal`, `cyan`, `gray`. Palette-specific colors also available.
72
+ Named colors only: `red`, `orange`, `yellow`, `green`, `blue`, `purple`, `teal`, `cyan`, `gray`. Palette-specific colors also available. Hex color codes (e.g. `#ff0000`) are **not** supported — use named colors instead.
34
73
 
35
74
  ### Palettes and Themes
36
75
 
@@ -46,14 +85,14 @@ Text fields support: `*italic*`, `**bold**`, `` `code` ``, `[link text](url)`. B
46
85
 
47
86
  ### Multi-line Values
48
87
 
49
- Properties that accept comma-separated lists (`series`, `columns`, `rows`, `x-axis`, `y-axis`) also accept an indented multi-line format. Leave the value after the colon empty and list each value on its own indented line:
88
+ Properties that accept comma-separated lists (`series`, `columns`, `rows`, `x-axis`, `y-axis`) also accept an indented multi-line format. Leave the value empty and list each value on its own indented line:
50
89
 
51
90
  ```
52
91
  // Single-line (still works)
53
- series: Rum, Spices, Silk, Gold
92
+ series Rum, Spices, Silk, Gold
54
93
 
55
94
  // Multi-line equivalent
56
- series:
95
+ series
57
96
  Rum
58
97
  Spices
59
98
  Silk
@@ -63,17 +102,17 @@ series:
63
102
  Multi-line blocks support blank lines and `//` comments within the block. Trailing commas on values are stripped for convenience.
64
103
 
65
104
  ```
66
- series:
105
+ series
67
106
  Rum (red)
68
107
  Spices (green)
69
108
  // gold last
70
109
  Gold (yellow)
71
110
  ```
72
111
 
73
- Works with `columns:` and `rows:` in heatmaps:
112
+ Works with `columns` and `rows` in heatmaps:
74
113
 
75
114
  ```
76
- columns:
115
+ columns
77
116
  January
78
117
  February
79
118
  March
@@ -85,56 +124,66 @@ columns:
85
124
 
86
125
  ### bar
87
126
 
88
- ```
89
- chart: bar
90
- title: Revenue by Region
91
- series: Revenue
127
+ **Syntax:** `bar [Title]`
128
+
129
+ **Options:** `series`, `xlabel`, `ylabel`, `orientation` (`horizontal`/`vertical`), `labels` (`name`/`value`/`percent`/`full`), `color`
130
+
131
+ **Data format:** `Label value` — one row per category
132
+
133
+ **Example:**
92
134
 
93
- North: 850
94
- South: 620
95
- East: 1100
96
- West: 430
97
135
  ```
136
+ bar Revenue by Region
137
+ series Revenue
98
138
 
99
- Options: `series`, `xlabel`, `ylabel`, `orientation` (`horizontal`/`vertical`), `labels` (`name`/`value`/`percent`/`full`), `color`.
139
+ North 850
140
+ South 620
141
+ East 1100
142
+ West 430
143
+ ```
100
144
 
101
- Colors per item: `North(red): 850`
145
+ Colors per item: `North(red) 850`
102
146
 
103
147
  ### line
104
148
 
105
- ```
106
- title: Quarterly Performance
107
- series: Sales(red), Costs(blue)
149
+ **Syntax:** `line [Title]` or `multi-line [Title]`
150
+
151
+ **Options:** `series`, `xlabel`, `ylabel`, `labels`
152
+
153
+ **Data format:** `Label value` (single series) or `Label v1, v2, v3` (multi-series matching `series` list)
154
+
155
+ **Example:**
108
156
 
109
- Q1: 100, 50
110
- Q2: 120, 55
111
- Q3: 110, 60
112
- Q4: 130, 58
113
157
  ```
158
+ line Quarterly Performance
159
+ series Sales(red), Costs(blue)
114
160
 
115
- Multi-series: comma-separated values matching the `series` list. Single series omits `series` directive. Also works as `chart: multi-line`.
161
+ Q1 100, 50
162
+ Q2 120, 55
163
+ Q3 110, 60
164
+ Q4 130, 58
165
+ ```
116
166
 
117
- Options: `series`, `xlabel`, `ylabel`, `labels`.
167
+ Multi-series: comma-separated values matching the `series` list. Single series omits `series` directive. Also works as `multi-line`.
118
168
 
119
169
  **Era bands** — annotate named time periods with background shading:
120
170
 
121
171
  ```
122
- chart: line
123
- title: U.S. Strategic Petroleum Reserve
124
- ylabel: Million Barrels
172
+ line U.S. Strategic Petroleum Reserve
173
+ ylabel Million Barrels
125
174
 
126
- era '81 -> '89: Reagan (red)
127
- era '89 -> '93: Bush (red)
128
- era '93 -> '01: Clinton (blue)
175
+ era '81 -> '89 Reagan (red)
176
+ era '89 -> '93 Bush (red)
177
+ era '93 -> '01 Clinton (blue)
129
178
 
130
- '81: 230
131
- '85: 493
132
- '89: 580
133
- '93: 587
134
- '01: 550
179
+ '81 230
180
+ '85 493
181
+ '89 580
182
+ '93 587
183
+ '01 550
135
184
  ```
136
185
 
137
- Syntax: `era <start> -> <end>: <label> [(<color>)]`
186
+ Syntax: `era <start> -> <end> <label> [(<color>)]`
138
187
 
139
188
  - `start` and `end` must exactly match category labels in the data
140
189
  - Color is optional; defaults to the palette's blue
@@ -144,116 +193,180 @@ Syntax: `era <start> -> <end>: <label> [(<color>)]`
144
193
 
145
194
  ### area
146
195
 
196
+ **Syntax:** `area [Title]`
197
+
198
+ **Options:** same as `line`, including era bands
199
+
200
+ **Data format:** same as `line`
201
+
147
202
  Same syntax as `line`, including era bands. Renders as a filled area chart.
148
203
 
149
204
  ### pie
150
205
 
151
- ```
152
- chart: pie
153
- title: Market Share
154
- labels: percent
206
+ **Syntax:** `pie [Title]`
207
+
208
+ **Options:** `labels` (`name`/`value`/`percent`/`full`)
209
+
210
+ **Data format:** `Label value`
211
+
212
+ **Example:**
155
213
 
156
- Company A: 40
157
- Company B: 35
158
- Company C: 25
159
214
  ```
215
+ pie Market Share
216
+ labels percent
160
217
 
161
- Options: `labels` (`name`/`value`/`percent`/`full`).
218
+ Company A 40
219
+ Company B 35
220
+ Company C 25
221
+ ```
162
222
 
163
223
  ### doughnut
164
224
 
225
+ **Syntax:** `doughnut [Title]`
226
+
227
+ **Options:** same as `pie`
228
+
229
+ **Data format:** same as `pie`
230
+
165
231
  Same syntax as `pie`. Renders as a doughnut (ring) chart.
166
232
 
167
233
  ### polar-area
168
234
 
235
+ **Syntax:** `polar-area [Title]`
236
+
237
+ **Options:** same as `pie`
238
+
239
+ **Data format:** same as `pie`
240
+
169
241
  Same syntax as `pie`. Renders as a polar area (rose) chart.
170
242
 
171
243
  ### radar
172
244
 
245
+ **Syntax:** `radar [Title]`
246
+
247
+ **Options:** (none)
248
+
249
+ **Data format:** `Label value`
250
+
251
+ **Example:**
252
+
173
253
  ```
174
- chart: radar
175
- title: Team Skills
254
+ radar Team Skills
176
255
 
177
- Frontend: 85
178
- Backend: 70
179
- DevOps: 60
180
- Design: 90
181
- Testing: 75
256
+ Frontend 85
257
+ Backend 70
258
+ DevOps 60
259
+ Design 90
260
+ Testing 75
182
261
  ```
183
262
 
184
263
  ### bar-stacked
185
264
 
186
- ```
187
- chart: bar-stacked
188
- title: Budget Allocation
189
- series: Engineering, Marketing, Sales
265
+ **Syntax:** `bar-stacked [Title]`
266
+
267
+ **Options:** `series` (required), `xlabel`, `ylabel`, `orientation`
268
+
269
+ **Data format:** `Label v1, v2, v3` — comma-separated values matching the `series` list
270
+
271
+ **Example:**
190
272
 
191
- Q1: 100, 50, 30
192
- Q2: 110, 55, 35
193
- Q3: 105, 60, 40
194
273
  ```
274
+ bar-stacked Budget Allocation
275
+ series Engineering, Marketing, Sales
195
276
 
196
- Options: `series` (required), `xlabel`, `ylabel`, `orientation`.
277
+ Q1 100, 50, 30
278
+ Q2 110, 55, 35
279
+ Q3 105, 60, 40
280
+ ```
197
281
 
198
282
  ### scatter
199
283
 
284
+ **Syntax:** `scatter [Title]`
285
+
286
+ **Options:** `labels` (`on`/`off`), `xlabel`, `ylabel`, `sizelabel`
287
+
288
+ **Data format:** `Label x, y` or `Label x, y, size` (bubble chart). Group with `[GroupName]` blocks.
289
+
290
+ **Example:**
291
+
200
292
  ```
201
- chart: scatter
202
- title: Performance Metrics
203
- labels: on
204
- xlabel: Experience (years)
205
- ylabel: Output
293
+ scatter Performance Metrics
294
+ labels on
295
+ xlabel Experience (years)
296
+ ylabel Output
206
297
 
207
- Alice: 3, 85
208
- Bob: 7, 92
209
- Carol: 2, 70
298
+ Alice 3, 85
299
+ Bob 7, 92
300
+ Carol 2, 70
210
301
  ```
211
302
 
212
- Data: `Label: x, y` or `Label: x, y, size` (bubble chart). Group with `## Category(color)` headers.
303
+ Tag groups (`[GroupName](color)`) create colored clusters:
213
304
 
214
- Options: `labels` (`on`/`off`), `xlabel`, `ylabel`, `sizelabel`.
305
+ ```
306
+ scatter Startup Funding vs Revenue
307
+ labels on
308
+ xlabel Funding ($M)
309
+ ylabel Annual Revenue ($M)
215
310
 
216
- ### heatmap
311
+ [SaaS](blue)
312
+ Acme Cloud 12, 8.5
313
+ DataSync 5.2, 3.1
217
314
 
315
+ [Fintech](green)
316
+ PayFlow 45, 32
317
+ LendTech 18, 12.5
218
318
  ```
219
- chart: heatmap
220
- title: Activity by Month
221
- columns: Jan, Feb, Mar, Apr, May, Jun
222
319
 
223
- Team A: 5, 4, 5, 3, 4, 5
224
- Team B: 2, 3, 2, 4, 3, 2
225
- Team C: 3, 2, 1, 2, 3, 4
320
+ ### heatmap
321
+
322
+ **Syntax:** `heatmap [Title]`
323
+
324
+ **Options:** `columns` (required)
325
+
326
+ **Data format:** `Row Label v1, v2, v3` — comma-separated values matching the `columns` list
327
+
328
+ **Example:**
329
+
226
330
  ```
331
+ heatmap Activity by Month
332
+ columns Jan, Feb, Mar, Apr, May, Jun
227
333
 
228
- Options: `columns` (required).
334
+ Team A 5, 4, 5, 3, 4, 5
335
+ Team B 2, 3, 2, 4, 3, 2
336
+ Team C 3, 2, 1, 2, 3, 4
337
+ ```
229
338
 
230
339
  ### sankey
231
340
 
341
+ **Syntax:** `sankey [Title]`
342
+
343
+ **Options:** (none)
344
+
345
+ **Data format:** Arrow syntax (`Source -> Target value`) or indentation syntax (`Target value` indented under parent)
346
+
232
347
  **Arrow syntax:**
233
348
 
234
349
  ```
235
- chart: sankey
236
- title: Resource Flow
350
+ sankey Resource Flow
237
351
 
238
- Source A -> Processing: 300
239
- Source B -> Processing: 200
240
- Processing -> Output X: 350
241
- Processing -> Output Y: 150
352
+ Source A -> Processing 300
353
+ Source B -> Processing 200
354
+ Processing -> Output X 350
355
+ Processing -> Output Y 150
242
356
  ```
243
357
 
244
358
  **Indentation syntax:**
245
359
 
246
360
  ```
247
- chart: sankey
248
- title: Resource Flow
361
+ sankey Resource Flow
249
362
 
250
363
  Source A
251
- Processing: 300
364
+ Processing 300
252
365
  Source B
253
- Processing: 200
366
+ Processing 200
254
367
  Processing
255
- Output X: 350
256
- Output Y: 150
368
+ Output X 350
369
+ Output Y 150
257
370
  ```
258
371
 
259
372
  Both syntaxes can be mixed in the same diagram.
@@ -262,181 +375,243 @@ Both syntaxes can be mixed in the same diagram.
262
375
 
263
376
  ```
264
377
  Revenue (green)
265
- Costs (red): 600
266
- Profit (blue): 400
378
+ Costs (red) 600
379
+ Profit (blue) 400
267
380
 
268
381
  // or with arrows
269
- Revenue (green) -> Costs (red): 600
382
+ Revenue (green) -> Costs (red) 600
270
383
  ```
271
384
 
272
385
  **Link colors** — `(color)` after the value:
273
386
 
274
387
  ```
275
388
  Revenue
276
- Costs: 600 (orange)
389
+ Costs 600 (orange)
277
390
 
278
391
  // or with arrows
279
- Revenue -> Costs: 600 (orange)
392
+ Revenue -> Costs 600 (orange)
280
393
  ```
281
394
 
282
395
  ### chord
283
396
 
397
+ **Syntax:** `chord [Title]`
398
+
399
+ **Options:** (none)
400
+
401
+ **Data format:** same as `sankey` (arrow syntax)
402
+
284
403
  Same syntax as `sankey`. Renders as a circular chord diagram.
285
404
 
405
+ **Example:**
406
+
407
+ ```
408
+ chord Inter-Department Collaboration
409
+
410
+ Engineering -> Design 85
411
+ Engineering -> Product 72
412
+ Design -> Marketing 45
413
+ Product -> Sales 42
414
+ ```
415
+
286
416
  ### funnel
287
417
 
418
+ **Syntax:** `funnel [Title]`
419
+
420
+ **Options:** (none)
421
+
422
+ **Data format:** `Label value`
423
+
424
+ **Example:**
425
+
288
426
  ```
289
- chart: funnel
290
- title: Conversion Pipeline
427
+ funnel Conversion Pipeline
291
428
 
292
- Visitors: 1000
293
- Signups: 500
294
- Trials: 200
295
- Customers: 100
429
+ Visitors 1000
430
+ Signups 500
431
+ Trials 200
432
+ Customers 100
296
433
  ```
297
434
 
298
435
  ### function
299
436
 
300
- ```
301
- chart: function
302
- title: Trajectories
303
- xlabel: Distance (m)
304
- ylabel: Height (m)
305
- x: 0 to 250
437
+ **Syntax:** `function [Title]`
438
+
439
+ **Options:** `x` (required, `start to end`), `xlabel`, `ylabel`
440
+
441
+ **Data format:** `Name (color) expression` — math expressions using `x`
442
+
443
+ **Example:**
306
444
 
307
- Low(blue): -0.001*x^2 + 0.27*x
308
- High(red): -0.003*x^2 + 0.75*x
309
445
  ```
446
+ function Mathematical Functions
447
+ xlabel x
448
+ ylabel f(x)
310
449
 
311
- Options: `x: start to end` (required), `xlabel`, `ylabel`.
450
+ x -6 to 6
451
+ f(x) (blue) sin(x)
452
+ g(x) (red) x^2 / 10
453
+ h(x) (green) cos(x) * 2
454
+ ```
312
455
 
313
456
  Expressions support: `+`, `-`, `*`, `/`, `^`, `sin`, `cos`, `sqrt`, `abs`, `log`, `exp`, `pi`, `e`.
314
457
 
315
458
  ### slope
316
459
 
317
- ```
318
- chart: slope
319
- title: Before vs After
460
+ **Syntax:** `slope [Title]`
461
+
462
+ **Options:** `orientation` (`horizontal`/`vertical`)
463
+
464
+ **Data format:** First data line defines period labels. Subsequent lines: `Item (color) v1, v2, ...`
320
465
 
321
- Period A, Period B
466
+ **Example:**
322
467
 
323
- Item 1: 40, 80
324
- Item 2: 30, 50
325
- Item 3: 60, 40
326
468
  ```
469
+ slope Programming Language Popularity
327
470
 
328
- First data line defines the two period labels. Options: `orientation` (`horizontal`/`vertical`).
471
+ 2020, 2022, 2025
472
+ Python (blue) 3, 1, 1
473
+ JavaScript (yellow) 1, 2, 2
474
+ TypeScript (cyan) 7, 4, 3
475
+ Rust (orange) 18, 12, 5
476
+ ```
329
477
 
330
478
  ### wordcloud
331
479
 
332
- ```
333
- chart: wordcloud
334
- title: Top Terms
480
+ **Syntax:** `wordcloud [Title]`
481
+
482
+ **Options:** `rotate` (`none`/`mixed`/`angled`), `max` (word limit), `size` (`min, max` font range)
483
+
484
+ **Data format:** `word weight` (higher = larger)
485
+
486
+ **Example:**
335
487
 
336
- kubernetes: 95
337
- docker: 80
338
- terraform: 65
339
- ansible: 50
340
488
  ```
489
+ wordcloud Top Terms
341
490
 
342
- Data: `word: weight` (higher = larger). Options: `rotate` (`none`/`mixed`/`angled`), `max` (word limit), `size: min, max` (font range).
491
+ kubernetes 95
492
+ docker 80
493
+ terraform 65
494
+ ansible 50
495
+ ```
343
496
 
344
497
  ### arc
345
498
 
346
- ```
347
- chart: arc
348
- title: Team Collaboration
499
+ **Syntax:** `arc [Title]`
500
+
501
+ **Options:** `order:` (`appearance`/`name`/`group`/`degree`), `orientation`
502
+
503
+ **Data format:** `Source -> Target weight`. Group nodes with `[GroupName]` blocks.
349
504
 
350
- ## Frontend(blue)
351
- Alice -> Bob: 8
352
- Alice -> Carol: 5
505
+ **Example:**
353
506
 
354
- ## Backend(green)
355
- Dave -> Carol: 10
356
507
  ```
508
+ arc Team Collaboration
509
+ order: group
357
510
 
358
- Data: `Source -> Target: weight`. Group nodes with `## Group(color)` headers.
511
+ [Frontend]
512
+ WebApp -> API Gateway 5
513
+ MobileApp -> API Gateway 3
359
514
 
360
- Options: `order` (`appearance`/`name`/`group`/`degree`), `orientation`.
515
+ [Core Services]
516
+ API Gateway -> AuthService 4
517
+ API Gateway -> UserService 5
518
+ ```
361
519
 
362
520
  ### venn
363
521
 
364
- ```
365
- chart: venn
366
- title: Skill Overlap
522
+ **Syntax:** `venn [Title]`
523
+
524
+ **Options:** `values` (`on`/`off`)
367
525
 
368
- dev(blue): 120 "Development"
369
- ops(green): 100 "Operations"
370
- sec(red): 80 "Security"
526
+ **Data format:** Sets: `id(color) alias shortname`. Overlaps: `id1 + id2 Label`.
527
+
528
+ **Example:**
371
529
 
372
- dev & ops: 35 "DevOps"
373
- ops & sec: 40 "SecOps"
374
- dev & sec: 30 "DevSec"
375
- dev & ops & sec: 10 "DevSecOps"
376
530
  ```
531
+ venn Skill Overlap
377
532
 
378
- Sets: `id(color): size "label"`. Overlaps: `id1 & id2: size "label"`. Options: `values` (`on`/`off`).
533
+ Frontend(blue) alias fe
534
+ Backend(green) alias be
535
+ DevOps(orange) alias de
536
+
537
+ fe + be Web Systems
538
+ be + de Platform Ops
539
+ fe + de Dev Tools
540
+ fe + be + de Full Stack
541
+ ```
379
542
 
380
543
  ### quadrant
381
544
 
382
- ```
383
- chart: quadrant
384
- title: Priority Matrix
385
- x-axis: Low Impact, High Impact
386
- y-axis: Low Effort, High Effort
545
+ **Syntax:** `quadrant [Title]`
546
+
547
+ **Options:** `x-axis` (`low label, high label`), `y-axis` (`low label, high label`)
387
548
 
388
- top-right: Quick Wins(green)
389
- top-left: Big Bets(yellow)
390
- bottom-left: Skip(red)
391
- bottom-right: Reconsider(gray)
549
+ **Data format:** Quadrant labels: `top-right Label`, `top-left Label`, etc. Data points: `Label (color) x, y` where x,y are 0-1.
550
+
551
+ **Example:**
392
552
 
393
- Task A: 0.9, 0.8
394
- Task B: 0.2, 0.3
395
- Task C: 0.7, 0.4
396
553
  ```
554
+ quadrant Priority Matrix
555
+ x-axis Low Impact, High Impact
556
+ y-axis Low Effort, High Effort
557
+
558
+ top-right Quick Wins(green)
559
+ top-left Big Bets(yellow)
560
+ bottom-left Skip(red)
561
+ bottom-right Reconsider(gray)
397
562
 
398
- Options: `x-axis: low, high`, `y-axis: low, high`. Quadrant labels: `top-right`, `top-left`, `bottom-left`, `bottom-right`. Data: `Label: x, y` where x,y are 0–1.
563
+ Task A 0.9, 0.8
564
+ Task B 0.2, 0.3
565
+ Task C 0.7, 0.4
566
+ ```
399
567
 
400
568
  ### timeline
401
569
 
570
+ **Syntax:** `timeline [Title]`
571
+
572
+ **Options:** `scale` (`on`/`off`), `sort` (`time`/`group`/`tag`/`tag:GroupName`), `swimlanes` (`on`/`off`)
573
+
574
+ **Data format:** Ranges: `start->end Label | tag: Value`. Points: `date Label | tag: Value`.
575
+
576
+ **Example:**
577
+
402
578
  ```
403
- chart: timeline
404
- title: Project History
579
+ timeline Project History
580
+
581
+ tag Team
582
+ Team A(blue)
583
+ Team B(green)
405
584
 
406
- era 2023->2024: Phase 1
407
- marker 2023-06: Launch(orange)
585
+ era 2023->2024 Phase 1
586
+ marker 2023-06 Launch(orange)
408
587
 
409
- ## Team A(blue)
410
- 2023-01->2023-06: Planning
411
- 2023-06->2024-01: Development
412
- 2024-02: Release
588
+ 2023-01->2023-06 Planning | Team: Team A
589
+ 2023-06->2024-01 Development | Team: Team A
590
+ 2024-02 Release | Team: Team A
413
591
 
414
- ## Team B(green)
415
- 2023-03->2023-09: Research
416
- 2023-09->2024-03?: Implementation
592
+ 2023-03->2023-09 Research | Team: Team B
593
+ 2023-09->2024-03? Implementation | Team: Team B
417
594
  ```
418
595
 
419
596
  Date formats: `YYYY`, `YYYY-MM`, `YYYY-MM-DD`. Ranges: `start->end`. Durations: `start->1y`, `start->6m`, `start->2w`, `start->30d`. Uncertain end: append `?` (e.g., `2024-03?`).
420
597
 
421
- Elements: `era start->end: Label(color)`, `marker date: Label(color)`, `## Group(color)` headers.
598
+ Elements: `era start->end Label(color)`, `marker date Label(color)`, `tag` groups for interactive coloring.
422
599
 
423
600
  Tag groups for interactive coloring and swimlanes:
424
601
 
425
602
  ```
426
- chart: timeline
427
- sort: tag:Team
603
+ timeline Sprint Plan
604
+ sort tag:Team
428
605
 
429
- tag: Team
606
+ tag Team
430
607
  Engineering(blue)
431
608
  Design(green)
432
609
 
433
- 2024-01->2024-06: Build API | Team: Engineering
434
- 2024-03->2024-05: UX Review | Team: Design
610
+ 2024-01->2024-06 Build API | Team: Engineering
611
+ 2024-03->2024-05 UX Review | Team: Design
435
612
  ```
436
613
 
437
- Options: `scale` (`on`/`off`), `sort` (`time`/`group`/`tag`/`tag:GroupName`), `swimlanes` (`on`/`off`).
438
-
439
- Tag groups add interactive color and swimlane controls. `sort: tag` uses the first tag group for swimlanes; `sort: tag:GroupName` specifies which group (aliases work: `sort: tag:p` resolves to `sort: tag:Pirate`).
614
+ Tag groups add interactive color and swimlane controls. `sort tag` uses the first tag group for swimlanes; `sort tag:GroupName` specifies which group (aliases work: `sort tag:p` resolves to `sort tag:Pirate`).
440
615
 
441
616
  ---
442
617
 
@@ -444,6 +619,12 @@ Tag groups add interactive color and swimlane controls. `sort: tag` uses the fir
444
619
 
445
620
  ### sequence
446
621
 
622
+ **Syntax:** `sequence [Title]`
623
+
624
+ **Options:** `activations` (`on`/`off`), `collapse-notes` (`yes`/`no`), `active-tag GroupName`
625
+
626
+ **Data format:** Messages between participants with arrow syntax
627
+
447
628
  Minimal example:
448
629
 
449
630
  ```
@@ -456,8 +637,7 @@ API -token-> User
456
637
  Full example:
457
638
 
458
639
  ```
459
- chart: sequence
460
- title: Authentication Flow
640
+ sequence Authentication Flow
461
641
 
462
642
  // participant declarations (optional)
463
643
  User is an actor
@@ -468,7 +648,7 @@ NotifyQueue is a queue aka Notifications
468
648
  User -Login request-> API
469
649
  API -Find user by email-> DB
470
650
  DB -user record-> API
471
- note on DB:
651
+ note on DB
472
652
  Indexed lookup on email column
473
653
 
474
654
  if credentials valid
@@ -501,26 +681,24 @@ API -200 OK-> User
501
681
  - `parallel label` ...
502
682
 
503
683
  **Notes**:
504
- - `note: text` — standalone
505
- - `note on Participant: text` — anchored
506
- - Multi-line: indent continuation lines under `note:`
684
+ - `note text` — standalone
685
+ - `note on Participant` followed by indented text — anchored
686
+ - Multi-line: indent continuation lines under `note`
507
687
 
508
688
  **Sections**: `== Section Title ==`
509
689
 
510
690
  **Groups**: `[Group Name]` or `[Group Name | key: value]` — visual grouping box around participants
511
691
 
512
- **Options**: `activations: off`, `collapse-notes: no`, `active-tag: GroupName`
513
-
514
692
  **Tag groups** — define color-coded metadata dimensions for interactive recoloring:
515
693
 
516
694
  ```
517
- tag: Concern alias c
695
+ tag Concern alias c
518
696
  Caching(blue)
519
697
  Auth(green)
520
698
  BusinessLogic(purple) default
521
699
  ```
522
700
 
523
- - `tag: Name` declares a tag group; `alias x` adds a shorthand
701
+ - `tag Name` declares a tag group; `alias x` adds a shorthand
524
702
  - Each entry: `Value(color)` — named color for that value
525
703
  - `default` on an entry applies it to untagged elements when the group is active
526
704
 
@@ -549,6 +727,12 @@ User -login-> API | concern: Auth
549
727
 
550
728
  ### flowchart
551
729
 
730
+ **Syntax:** `flowchart [Title]`
731
+
732
+ **Options:** (none beyond `palette`, `theme`)
733
+
734
+ **Data format:** Node chains with arrow connections
735
+
552
736
  Minimal example:
553
737
 
554
738
  ```
@@ -558,8 +742,7 @@ Minimal example:
558
742
  Full example:
559
743
 
560
744
  ```
561
- chart: flowchart
562
- title: Decision Process
745
+ flowchart Decision Process
563
746
 
564
747
  (Start) -> <Valid Input?>
565
748
  -yes-> [Process Data] -> [[Run Subroutine]]
@@ -577,10 +760,24 @@ title: Decision Process
577
760
 
578
761
  **Arrows**: `-label-> Target`, `-(color)-> Target`, `-label(color)-> Target`
579
762
 
763
+ **Inferred arrow colors** — when a label matches a well-known keyword, the arrow color is set automatically:
764
+
765
+ | Label | Inferred Color |
766
+ |---|---|
767
+ | yes, success, ok, true | green |
768
+ | no, fail, error, false | red |
769
+ | maybe, warning | orange |
770
+
580
771
  Colors on nodes: `[Process(blue)]`
581
772
 
582
773
  ### state
583
774
 
775
+ **Syntax:** `state [Title]`
776
+
777
+ **Options:** `direction` (`TB` or `LR`), `color` (`off` for monochrome)
778
+
779
+ **Data format:** States connected by transitions
780
+
584
781
  Minimal example:
585
782
 
586
783
  ```
@@ -590,11 +787,10 @@ Minimal example:
590
787
  Full example:
591
788
 
592
789
  ```
593
- chart: state
594
- title: Order Lifecycle
595
- direction: LR
790
+ state Order Lifecycle
791
+ direction LR
596
792
 
597
- ## Processing(blue)
793
+ [Processing(blue)]
598
794
  Validating -valid-> Approved
599
795
  Validating -invalid-> Rejected(red)
600
796
 
@@ -622,14 +818,18 @@ Idle
622
818
 
623
819
  is equivalent to `Idle -start-> Running` and `Idle -configure-> Configuring`.
624
820
 
625
- **Groups**: `## GroupName` or `## GroupName(color)` — groups subsequent indented states visually.
821
+ **Groups**: `[GroupName]` or `[GroupName(color)]` — groups subsequent indented states visually.
626
822
 
627
823
  **Self-loops**: `Running -retry-> Running` — a state transitioning to itself.
628
824
 
629
- **Options**: `direction` (`TB` or `LR`), `title`, `color: off` (monochrome mode).
630
-
631
825
  ### class
632
826
 
827
+ **Syntax:** `class [Title]`
828
+
829
+ **Options:** (none beyond `palette`, `theme`)
830
+
831
+ **Data format:** Class declarations with indented members
832
+
633
833
  Minimal example:
634
834
 
635
835
  ```
@@ -647,8 +847,7 @@ Cat extends Animal
647
847
  Full example:
648
848
 
649
849
  ```
650
- chart: class
651
- title: Type Hierarchy
850
+ class Type Hierarchy
652
851
 
653
852
  Printable [interface]
654
853
  + print(): void
@@ -687,6 +886,12 @@ Shape *-- Circle : contains
687
886
 
688
887
  ### er
689
888
 
889
+ **Syntax:** `er [Title]`
890
+
891
+ **Options:** (none beyond `palette`, `theme`)
892
+
893
+ **Data format:** Entity declarations with indented columns and relationships
894
+
690
895
  Minimal example:
691
896
 
692
897
  ```
@@ -703,8 +908,7 @@ posts
703
908
  Full example:
704
909
 
705
910
  ```
706
- chart: er
707
- title: Blog Schema
911
+ er Blog Schema
708
912
 
709
913
  users
710
914
  id: int [pk]
@@ -743,45 +947,52 @@ Columns and relationships can be mixed under the same table. The parser distingu
743
947
 
744
948
  ### c4
745
949
 
950
+ **Syntax:** `c4 [Title]`
951
+
952
+ **Options:** (none beyond `palette`, `theme`)
953
+
954
+ **Data format:** Element declarations with `Name is a type`, relationships with arrows
955
+
746
956
  Minimal example:
747
957
 
748
958
  ```
749
- chart: c4
959
+ c4
750
960
 
751
- person User
752
- system MyApp | description: The main application
961
+ User is a person
962
+ MyApp is a system | description: The main application
753
963
  -Uses-> User
754
964
  ```
755
965
 
966
+ Auto-detection: C4 diagrams are auto-detected when `Name is a person/system/container/component` declarations are present — `c4` is optional.
967
+
756
968
  Full example:
757
969
 
758
970
  ```
759
- chart: c4
760
- title: Banking System
971
+ c4 Banking System
761
972
 
762
- tag: Scope alias sc
973
+ tag Scope alias sc
763
974
  Internal(blue) default
764
975
  External(gray)
765
976
 
766
- person Customer | description: A customer of the bank
977
+ Customer is a person | description: A customer of the bank
767
978
 
768
- system Internet Banking | description: Online banking portal
769
- -Delivers content [HTTPS]-> Customer
770
- -Sends emails [SMTP]-> Email
979
+ Internet Banking is a system | description: Online banking portal
980
+ -Delivers content-> Customer | tech: HTTPS
981
+ -Sends emails-> Email | tech: SMTP
771
982
 
772
- containers:
773
- container Web App | description: SPA, tech: React
774
- -API calls [JSON/HTTPS]-> API
983
+ containers
984
+ Web App is a container | description: SPA, tech: React
985
+ -API calls-> API | tech: JSON/HTTPS
775
986
 
776
- container API | description: Backend, tech: Node.js
777
- -Reads/writes [SQL]-> Database
987
+ API is a container | description: Backend, tech: Node.js
988
+ -Reads/writes-> Database | tech: SQL
778
989
 
779
- container Database | description: Data store, tech: PostgreSQL
990
+ Database is a container | description: Data store, tech: PostgreSQL
780
991
 
781
- system Email | description: Email delivery, sc: External
992
+ Email is a system | description: Email delivery, sc: External
782
993
  ~Sends emails~> Customer
783
994
 
784
- deployment:
995
+ deployment
785
996
  Vercel is a cloud
786
997
  container Web App
787
998
  Railway
@@ -790,27 +1001,39 @@ deployment:
790
1001
  container Database
791
1002
  ```
792
1003
 
793
- **Element types**: `person`, `system`, `container`, `component`
1004
+ **Element types** declared with `Name is a <type>`:
1005
+ - `Name is a person` — human actor
1006
+ - `Name is a system` — software system
1007
+ - `Name is a container` — application/service within a system
1008
+ - `Name is a component` — component within a container
1009
+ - `Name is a external` — external system
1010
+ - `Name is a database` — database element
794
1011
 
795
- **Metadata** (pipe-delimited): `element Name | description: text, tech: stack, tagalias: value`
1012
+ **Metadata** (pipe-delimited): `Name is a system | description: text, tech: stack, tagalias: value`
796
1013
 
797
- **Sections**: `containers:` (inside system), `components:` (inside container), `deployment:`
1014
+ **Sections**: `containers` (inside system), `components` (inside container), `deployment`
798
1015
 
799
1016
  **Deployment nodes**: `NodeName is a [cloud|database|cache|queue|external]`
800
1017
 
801
1018
  **Relationships**:
802
- - Sync: `-> Target` or `-label [tech]-> Target`
803
- - Async: `~> Target` or `~label [tech]~> Target`
804
- - Bidirectional: `<-> Target`, `<~> Target`
1019
+ - Sync: `-> Target` or `-label-> Target`
1020
+ - Async: `~> Target` or `~label~> Target`
1021
+ - With technology metadata: `-label-> Target | tech: HTTPS`
805
1022
 
806
1023
  **Tag groups**: See tag group syntax below.
807
1024
 
808
1025
  ### org
809
1026
 
1027
+ **Syntax:** `org [Title]`
1028
+
1029
+ **Options:** `sub-node-label`, `show-sub-node-count` (flag, no value needed)
1030
+
1031
+ **Data format:** Hierarchy via indentation
1032
+
810
1033
  Minimal example:
811
1034
 
812
1035
  ```
813
- chart: org
1036
+ org
814
1037
 
815
1038
  CEO
816
1039
  VP Engineering
@@ -821,12 +1044,11 @@ CEO
821
1044
  Full example:
822
1045
 
823
1046
  ```
824
- chart: org
825
- title: Engineering Org
826
- sub-node-label: Reports
827
- show-sub-node-count: yes
1047
+ org Engineering Org
1048
+ sub-node-label Reports
1049
+ show-sub-node-count
828
1050
 
829
- tag: Level alias lv
1051
+ tag Level alias lv
830
1052
  Director(red)
831
1053
  Manager(blue)
832
1054
  IC(green) default
@@ -846,81 +1068,91 @@ Hierarchy via indentation. `[Group Name]` creates collapsible sub-groups.
846
1068
 
847
1069
  **Metadata**: `Name | tagalias: value, tag2: value2`
848
1070
 
849
- Options: `sub-node-label`, `show-sub-node-count` (`yes`/`no`).
850
-
851
- **Imports**: `import: path/to/file.dgmo` (indented under a parent node), `tags: path/to/tags.dgmo` (top-level).
1071
+ **Imports**: `import path/to/file.dgmo` (indented under a parent node), `tags path/to/tags.dgmo` (top-level).
852
1072
 
853
1073
  ### kanban
854
1074
 
1075
+ **Syntax:** `kanban [Title]`
1076
+
1077
+ **Options:** (none beyond `palette`, `theme`)
1078
+
1079
+ **Data format:** `[Column]` headers with card items below
1080
+
855
1081
  Minimal example:
856
1082
 
857
1083
  ```
858
- chart: kanban
1084
+ kanban
859
1085
 
860
- == To Do ==
1086
+ [To Do]
861
1087
  Task 1
862
1088
  Task 2
863
1089
 
864
- == Done ==
1090
+ [Done]
865
1091
  Task 3
866
1092
  ```
867
1093
 
868
1094
  Full example:
869
1095
 
870
1096
  ```
871
- chart: kanban
872
- title: Sprint Board
1097
+ kanban Sprint Board
873
1098
 
874
- tag: Priority
1099
+ tag Priority
875
1100
  Critical(red)
876
1101
  High(orange)
877
1102
  Low(green) default
878
1103
 
879
- tag: Owner alias o
1104
+ tag Owner alias o
880
1105
  Alice(blue)
881
1106
  Bob(green)
882
1107
 
883
- == Backlog(gray) ==
1108
+ [Backlog(gray)]
884
1109
  Research API options | priority: High, o: Alice
885
1110
 
886
- == In Progress [wip: 3](orange) ==
1111
+ [In Progress(orange)] | wip: 3
887
1112
  Build auth module | priority: Critical, o: Bob
888
1113
  Integrate OAuth2
889
1114
  Add session management
890
1115
 
891
- == Done(green) ==
1116
+ [Done(green)]
892
1117
  Setup CI pipeline | priority: High, o: Alice
893
1118
  ```
894
1119
 
895
- **Columns**: `== Column Name ==`, `== Column Name(color) ==`, `== Column Name [wip: N] ==`
1120
+ **Columns**: `[Column Name]`, `[Column Name(color)]`, `[Column Name] | wip: N`
896
1121
 
897
1122
  **Cards**: `Card Title | tag: value`. Indented lines below become card details.
898
1123
 
1124
+ **Group metadata cascading**: `[Column Name] | key: value` — pipe metadata on column headers cascades to all cards in the column.
1125
+
899
1126
  ### initiative-status
900
1127
 
1128
+ **Syntax:** `initiative-status [Title]`
1129
+
1130
+ **Options:** (none beyond `palette`, `theme`)
1131
+
1132
+ **Data format:** Nodes with status, connected by dependency arrows
1133
+
901
1134
  Minimal example:
902
1135
 
903
1136
  ```
904
- chart: initiative-status
1137
+ initiative-status
905
1138
 
906
1139
  Auth | done
907
- -> UserService | wip
1140
+ -> UserService | doing
908
1141
  -> NotifyService | todo
909
- UserService | wip
1142
+ UserService | doing
910
1143
  NotifyService | todo
911
1144
  ```
912
1145
 
913
1146
  Full example:
914
1147
 
915
1148
  ```
916
- chart: initiative-status
917
- title: Platform Roadmap
1149
+ initiative-status Platform Roadmap
918
1150
 
919
1151
  Auth | done
920
- -depends-> UserService | wip
1152
+ -depends-> UserService | doing
921
1153
  -feeds-> Dashboard | todo
922
1154
  Dashboard | todo
923
- UserService | wip
1155
+ UserService | doing
924
1156
  -calls-> DBLayer | done
925
1157
  DBLayer | done
926
1158
 
@@ -929,18 +1161,26 @@ DBLayer | done
929
1161
  EmailProvider | na
930
1162
  ```
931
1163
 
932
- **Status values**: `done`, `wip`, `todo`, `na`
1164
+ **Status values**: `done`, `doing`, `blocked`, `todo`, `na`
1165
+
1166
+ **Status aliases**: `wip` maps to `doing`; `paused` and `waiting` map to `blocked`. Aliases are accepted in input but the canonical values are preferred.
933
1167
 
934
1168
  **Relationships**: `-label-> Target | status` or indented children.
935
1169
 
936
- **Groups**: `[Group Name]` for visual grouping.
1170
+ **Groups**: `[Group Name]` for visual grouping. `[Group Name] | key: value` — pipe metadata cascades to contained nodes.
937
1171
 
938
1172
  ### sitemap
939
1173
 
1174
+ **Syntax:** `sitemap [Title]`
1175
+
1176
+ **Options:** `direction` (`TB` or `LR`), `orientation` (alias for `direction`)
1177
+
1178
+ **Data format:** Page labels with arrows and metadata
1179
+
940
1180
  Minimal example:
941
1181
 
942
1182
  ```
943
- chart: sitemap
1183
+ sitemap
944
1184
 
945
1185
  Home
946
1186
  -about-> About
@@ -956,16 +1196,15 @@ Home
956
1196
  Full example:
957
1197
 
958
1198
  ```
959
- chart: sitemap
960
- title: SaaS Platform
961
- direction: TB
1199
+ sitemap SaaS Platform
1200
+ direction TB
962
1201
 
963
- tag: Auth
1202
+ tag Auth
964
1203
  Public(green)
965
1204
  Required(blue)
966
1205
  Admin(red)
967
1206
 
968
- tag: Type
1207
+ tag Type
969
1208
  Landing(purple)
970
1209
  Form(orange)
971
1210
  Content(cyan)
@@ -1025,22 +1264,30 @@ Home
1025
1264
 
1026
1265
  **Groups**: `[Group Name]` wraps indented children in a container.
1027
1266
 
1028
- **Arrows**: `-label-> Target`, `-(color)-> Target`, `-label(color)-> Target` — cross-link between any pages.
1267
+ **Arrows**: `-label-> Target`, `-(color)-> Target`, `-label(color)-> Target` — cross-link between any pages. Arrow colors are inferred from well-known labels (see flowchart section).
1029
1268
 
1030
1269
  **Metadata**: `Key: Value` lines attach to the parent page (displayed as card rows).
1031
1270
 
1032
- **Tag groups**: `tag: Name` with colored entries — same syntax as org charts.
1271
+ **Tag groups**: `tag Name` with colored entries — same syntax as org charts.
1272
+
1273
+ **Direction**: `direction TB` (top-to-bottom, default) or `direction LR` (left-to-right). `orientation` is accepted as an alias for `direction`.
1033
1274
 
1034
- **Direction**: `direction: TB` (top-to-bottom, default) or `direction: LR` (left-to-right).
1275
+ **Group metadata cascading**: `[Group Name] | key: value` — pipe metadata on group headers cascades to all pages in the group.
1035
1276
 
1036
1277
  **Collapsible groups**: Groups can be collapsed/expanded in the app — arrows to hidden pages re-terminate at the group boundary.
1037
1278
 
1038
1279
  ### infra
1039
1280
 
1281
+ **Syntax:** `infra [Title]`
1282
+
1283
+ **Options:** `direction` (`LR` or `TB`), `orientation` (alias for `direction`)
1284
+
1285
+ **Data format:** Component declarations with indented properties and connections
1286
+
1040
1287
  Minimal example:
1041
1288
 
1042
1289
  ```
1043
- chart: infra
1290
+ infra
1044
1291
 
1045
1292
  edge
1046
1293
  rps: 1000
@@ -1059,11 +1306,10 @@ API
1059
1306
  Full example:
1060
1307
 
1061
1308
  ```
1062
- chart: infra
1063
- title: Production Traffic Flow
1064
- direction: LR
1309
+ infra Production Traffic Flow
1310
+ direction LR
1065
1311
 
1066
- tag: Team alias t
1312
+ tag Team alias t
1067
1313
  Backend(blue)
1068
1314
  Platform(teal)
1069
1315
 
@@ -1113,41 +1359,127 @@ StaticServer | t: Platform
1113
1359
  - `cb-error-threshold: N%` — circuit breaker opens when overload exceeds this ratio
1114
1360
  - `cb-latency-threshold-ms: N` — circuit breaker opens when cumulative latency exceeds this
1115
1361
 
1116
- **Connections**: `-> Target` (unlabeled), `-label-> Target` (labeled). Pipe metadata for splits: `-> Target | split: N%`. Fan-out multiplier: `-> Target x5` or `-> Target | split: 50% x5`.
1362
+ **Type declarations**: `NodeName is a <type>` declare a component's infrastructure role:
1363
+ - `database`, `cache`, `queue`, `service`, `gateway`, `storage`, `function`, `network`
1364
+ - Example: `Redis is a cache`, `SQS is a queue`
1365
+
1366
+ **Connections**:
1367
+ - Sync: `-> Target` (unlabeled), `-label-> Target` (labeled)
1368
+ - Async: `~> Target` (unlabeled), `~label~> Target` (labeled)
1369
+ - Pipe metadata for splits: `-> Target | split: N%`
1370
+ - Fan-out multiplier: `-> Target | fanout: 5` or `-> Target | split: 50%, fanout: 5`
1117
1371
 
1118
- **Fan-out**: Append `xN` to a connection to model request multiplication — one inbound request triggers N outbound calls to the target. The target receives `inbound × N` RPS. Fan-out is applied after split: `-> Shards | split: 60% x8` means the target receives `inbound × 0.60 × 8` RPS. Fan-out compounds naturally through multi-hop chains.
1372
+ **Fan-out**: Use `| fanout: N` metadata to model request multiplication — one inbound request triggers N outbound calls to the target. The target receives `inbound x N` RPS. Fan-out is applied after split: `-> Shards | split: 60%, fanout: 8` means the target receives `inbound x 0.60 x 8` RPS. Fan-out compounds naturally through multi-hop chains.
1119
1373
 
1120
1374
  **Branching**: Multiple outbound connections with `split: N%` metadata. Splits must sum to 100%. Undeclared splits are evenly distributed from the remaining percentage.
1121
1375
 
1122
1376
  **Groups**: `[Group Name]` with indented children — rendered as dashed-border containers. Edges targeting a group route to all children.
1123
1377
 
1124
- **Roles**: Inferred automatically from behavior properties no type declarations needed. Components with `cache-hit` get a Cache role, `firewall-block` gets Firewall, etc. Roles appear as colored dots on nodes and in the legend.
1378
+ **Roles**: Inferred automatically from behavior properties or `is a` type declarations. Components with `cache-hit` get a Cache role, `firewall-block` gets Firewall, etc. Explicit declarations (`Redis is a cache`) set the role directly. Roles appear as colored dots on nodes and in the legend.
1379
+
1380
+ **Overload**: When computed rps exceeds `max-rps x instances`, the node turns red. Dynamic scaling (`instances: 1-8`) auto-scales within the range before overloading.
1381
+
1382
+ **Group metadata cascading**: `[Group Name] | key: value` — pipe metadata on group headers cascades to all children, providing default tag values for contained nodes.
1383
+
1384
+ **Tag groups**: Same syntax as org/kanban/sitemap — `tag Name alias x` with colored entries.
1385
+
1386
+ ### gantt
1387
+
1388
+ **Syntax:** `gantt [Title]`
1389
+
1390
+ **Options:** `start` (required, `YYYY-MM-DD`), `today-marker` (`on`/`off` or `YYYY-MM-DD`), `sort` (`time`/`group`/`tag`/`tag:GroupName`), `critical-path`, `dependencies`
1391
+
1392
+ **Data format:** `duration Task Name` — tasks with optional dependency arrows
1393
+
1394
+ Minimal example:
1395
+
1396
+ ```
1397
+ start 2024-01-01
1398
+
1399
+ 10bd Design
1400
+ -> Implementation
1401
+ 20bd Implementation
1402
+ -> Testing
1403
+ 5bd Testing
1404
+ ```
1405
+
1406
+ Auto-detection: Gantt charts are auto-detected when duration patterns like `10bd Design` are present — `gantt` is optional.
1407
+
1408
+ Full example:
1409
+
1410
+ ```
1411
+ gantt Project Schedule
1412
+ start 2024-01-01
1413
+ today-marker on
1414
+
1415
+ tag Team alias t
1416
+ Frontend(blue)
1417
+ Backend(green)
1418
+
1419
+ holidays
1420
+ 2024-01-15: MLK Day
1421
+ 2024-02-19: Presidents Day
1422
+
1423
+ era 2024-01 -> 2024-03 Phase 1(blue)
1424
+ marker 2024-02-15 Sprint Review(orange)
1425
+
1426
+ [Design]
1427
+ 5bd UX Research | t: Frontend
1428
+ 10bd Wireframes | t: Frontend
1429
+ -informs-> API Design
1430
+
1431
+ [Engineering]
1432
+ 15bd API Design | t: Backend
1433
+ -> Frontend Build | offset: 2bd
1434
+ 20bd Frontend Build | t: Frontend
1435
+ 10bd Integration Testing
1436
+ ```
1437
+
1438
+ **Start date**: `start YYYY-MM-DD` (required) — project start date for computing all task dates.
1439
+
1440
+ **Tasks**: `<duration> <name>` — duration units: `bd` (business days), `d` (days), `w` (weeks), `m` (months), `q` (quarters), `y` (years), `h` (hours), `min` (minutes).
1441
+
1442
+ **Explicit dates**: `YYYY-MM-DD Task Name` or `YYYY-MM-DD -> 30d Task Name` (date with duration).
1443
+
1444
+ **Uncertain end**: Append `?` to duration (e.g., `10bd? Task`) — renders with a fading tail.
1445
+
1446
+ **Dependencies**: `-label-> Target` or `-> Target` — indented under the source task. The target task starts after the source completes.
1447
+
1448
+ **Dependency offsets**: `-> Target | offset: 2bd` — positive offset adds a gap; `-> Target | offset: -3d` — negative offset creates overlap (lead time).
1449
+
1450
+ **Labeled dependency arrows**: `-label-> Target` — the label text appears on the rendered arrow.
1451
+
1452
+ **Groups**: `[Group Name]` wraps indented tasks in a collapsible section.
1453
+
1454
+ **Group metadata cascading**: `[Group Name] | key: value` — pipe metadata cascades to all tasks in the group.
1455
+
1456
+ **Eras**: `era YYYY-MM -> YYYY-MM Label(color)` — background shading bands.
1125
1457
 
1126
- **Overload**: When computed rps exceeds `max-rps × instances`, the node turns red. Dynamic scaling (`instances: 1-8`) auto-scales within the range before overloading.
1458
+ **Markers**: `marker YYYY-MM-DD Label(color)` vertical milestone lines.
1127
1459
 
1128
- **Direction**: `direction: LR` (left-to-right, default) or `direction: TB` (top-to-bottom).
1460
+ **Holidays**: `holidays` block with `YYYY-MM-DD: Name` entries or `YYYY-MM-DD -> YYYY-MM-DD: Name` ranges. Holiday dates skip business-day counting.
1129
1461
 
1130
- **Tag groups**: Same syntax as org/kanban/sitemap — `tag: Name alias x` with colored entries.
1462
+ **Tag groups**: Same syntax as other diagrams — `tag Name alias x` with colored entries.
1131
1463
 
1132
1464
  ---
1133
1465
 
1134
1466
  ## Tag Groups
1135
1467
 
1136
- Define reusable metadata categories for org charts, kanban boards, C4 diagrams, sitemaps, and infra charts:
1468
+ Define reusable metadata categories for sequence, org, kanban, C4, sitemap, infra, gantt, initiative-status, and timeline diagrams:
1137
1469
 
1138
1470
  ```
1139
- tag: Priority
1471
+ tag Priority
1140
1472
  Critical(red)
1141
1473
  High(orange)
1142
1474
  Medium(yellow)
1143
1475
  Low(green) default
1144
1476
 
1145
- tag: Team alias t
1477
+ tag Team alias t
1146
1478
  Frontend(blue)
1147
1479
  Backend(green)
1148
1480
  ```
1149
1481
 
1150
- - `tag:` keyword (case-insensitive)
1482
+ - `tag` keyword (case-insensitive)
1151
1483
  - Optional `alias` for shorthand in metadata: `| t: Frontend`
1152
1484
  - `default` keyword marks the fallback value
1153
1485
  - Indented entries with `Value(color)`
@@ -1161,12 +1493,20 @@ Assign to elements via pipe metadata: `Element Name | priority: High, t: Fronten
1161
1493
  **Common mistakes to avoid:**
1162
1494
 
1163
1495
  - `# comment` — wrong. Use `// comment`
1496
+ - `chart: bar` + `title: Revenue` — wrong. Use `bar Revenue` (single first line)
1497
+ - `Label: value` in ECharts data — wrong. Use `Label value` (no colon)
1164
1498
  - `async A -> B: msg` — wrong. Use `A ~msg~> B`
1165
1499
  - `parallel else` — not supported. Use separate `parallel` blocks
1166
- - Hex colors in sections `== Foo(#ff0000) ==` — wrong. Use named colors: `== Foo(red) ==`
1500
+ - Hex colors `#ff0000` — wrong. Use named colors only: `red`, `green`, `blue`, etc.
1167
1501
  - `->` inside labeled arrows `A -routes to /api-> B` — ambiguous. Rephrase the label
1168
- - Missing `chart:` for ambiguous content — when auto-detection picks the wrong type, add an explicit `chart:` directive
1502
+ - Missing chart type for ambiguous content — when auto-detection picks the wrong type, add an explicit chart type keyword
1169
1503
  - `end` keyword in sequence blocks — not needed. Indentation closes blocks
1504
+ - `== Column ==` in kanban — removed. Use `[Column]`
1505
+ - `person Name` in C4 — removed. Use `Name is a person`
1506
+ - `A <-> B` bidirectional arrows — removed. Use two separate lines
1507
+ - `-> Target x5` fan-out — removed. Use `-> Target | fanout: 5`
1508
+ - `lag: 5d` / `lead: 3d` in gantt — removed. Use `offset: 5d` / `offset: -3d`
1509
+ - `Name(color)` in sequence participants — removed. Use `tag` groups for coloring
1170
1510
 
1171
1511
  ---
1172
1512