@diagrammo/dgmo 0.8.1 → 0.8.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.
@@ -31,1491 +31,1252 @@ Syntax changes introduced in the consistency cleanup. Old forms now produce erro
31
31
 
32
32
  ---
33
33
 
34
- ## Common Patterns
34
+ ## Table of Contents
35
+
36
+ 1. [Universal Constructs](#1-universal-constructs)
37
+ 2. [Sequence Diagrams](#2-sequence-diagrams)
38
+ 3. [Infrastructure Diagrams](#3-infrastructure-diagrams)
39
+ 4. [Flowchart Diagrams](#4-flowchart-diagrams)
40
+ 5. [State Diagrams](#5-state-diagrams)
41
+ 6. [Org Charts](#6-org-charts)
42
+ 7. [C4 Architecture Diagrams](#7-c4-architecture-diagrams)
43
+ 8. [Entity-Relationship Diagrams](#8-entity-relationship-diagrams)
44
+ 9. [Class Diagrams](#9-class-diagrams)
45
+ 10. [Kanban Boards](#10-kanban-boards)
46
+ 11. [Initiative-Status Diagrams](#11-initiative-status-diagrams)
47
+ 12. [Sitemap Diagrams](#12-sitemap-diagrams)
48
+ 13. [Gantt Charts](#13-gantt-charts)
49
+ 14. [Timeline Diagrams](#14-timeline-diagrams)
50
+ 15. [Data Charts](#15-data-charts)
51
+ 16. [Visualizations](#16-visualizations)
52
+ 17. [Colon Usage Summary](#17-colon-usage-summary)
35
53
 
36
- Every `.dgmo` file starts with a chart type keyword as the first line, optionally followed by a title. Directives follow on subsequent lines.
54
+ ---
37
55
 
38
- ### First Line
56
+ ## 1. Universal Constructs
39
57
 
40
- ```
41
- bar Revenue by Region
42
- ```
58
+ These patterns are shared across all or most diagram types.
43
59
 
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.
45
-
46
- ### Directives
60
+ ### 1.1 Chart Type Declaration (First Line)
47
61
 
48
62
  ```
49
- palette nord
50
- theme dark
51
- xlabel Category
52
- ylabel Count
63
+ <chart-type> [Title]
53
64
  ```
54
65
 
55
- Directives are `keyword value` (no colon). They appear after the first line, before data.
66
+ - Space-separated, NO colon
67
+ - Title is optional
68
+ - Examples: `bar Treasure Hauls`, `sequence Auth Flow`, `gantt Product Launch`
56
69
 
57
- ### Comments
70
+ ### 1.2 Comments
58
71
 
59
72
  ```
60
- // This is a comment (only // is supported)
73
+ // comment text
61
74
  ```
62
75
 
63
- ### Inline Colors
76
+ - Full-line only (no inline comments after code)
77
+ - `#` is NOT a comment character
64
78
 
65
- Append `(colorname)` to labels, nodes, or data points:
79
+ ### 1.3 Tag Declarations
66
80
 
67
81
  ```
68
- Port Royal(red) 850
69
- [Process(blue)]
82
+ tag GroupName [alias X]
83
+ Value1(color)
84
+ Value2(color) [default]
70
85
  ```
71
86
 
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.
87
+ - `tag` keyword, NO colon
88
+ - Alias: 1-4 lowercase letters
89
+ - Inline values also supported: `tag Priority p Low(green), High(red)`
90
+ - First entry is default unless another is marked `default`
91
+ - Must appear before diagram content
73
92
 
74
- ### Palettes and Themes
93
+ **Diagram types that support tags**: sequence, infra, org, c4, er, kanban, gantt, initiative-status, sitemap, timeline
75
94
 
76
- 8 palettes: `nord` (default), `solarized`, `catppuccin`, `rose-pine`, `gruvbox`, `tokyo-night`, `one-dark`, `bold`
95
+ ### 1.4 Pipe Metadata
77
96
 
78
- 3 themes per palette: `light`, `dark`, `transparent`
97
+ ```
98
+ EntityName | key: value, key2: value2
99
+ ```
79
100
 
80
- Set via CLI: `dgmo diagram.dgmo --palette catppuccin --theme dark`
101
+ - Colons ARE required within pipe segments (`key: value`)
102
+ - Items separated by commas
103
+ - Tag aliases resolve: `| c: Caching` resolves to `concern: Caching` (if `tag Concern alias c` is defined)
104
+ - One pipe per line only
81
105
 
82
- ### Inline Markdown
106
+ ### 1.5 Color Suffixes
83
107
 
84
- Text fields support: `*italic*`, `**bold**`, `` `code` ``, `[link text](url)`. Bare URLs are auto-linked.
108
+ ```
109
+ Label(colorName)
110
+ ```
85
111
 
86
- ### Multi-line Values
112
+ - Named palette colors only (no hex codes)
113
+ - Appears at end of labels, node names, tag values, series names
114
+ - Color is stripped from display text
87
115
 
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:
116
+ ### 1.6 Indentation
89
117
 
90
- ```
91
- // Single-line (still works)
92
- series Rum, Spices, Silk, Gold
118
+ - Spaces or tabs (1 tab = 4 spaces)
119
+ - Determines hierarchy and block scope
93
120
 
94
- // Multi-line equivalent
95
- series
96
- Rum
97
- Spices
98
- Silk
99
- Gold
100
- ```
101
-
102
- Multi-line blocks support blank lines and `//` comments within the block. Trailing commas on values are stripped for convenience.
121
+ ### 1.7 Groups / Containers
103
122
 
104
123
  ```
105
- series
106
- Rum (red)
107
- Spices (green)
108
- // gold last
109
- Gold (yellow)
124
+ [Group Name]
125
+ [Group Name](color)
126
+ [Group Name] | key: value
110
127
  ```
111
128
 
112
- Works with `columns` and `rows` in heatmaps:
129
+ - Bracket-enclosed name
130
+ - Optional color suffix
131
+ - Optional pipe metadata (outside brackets)
132
+ - Indented content below belongs to the group
133
+
134
+ ### 1.8 Boolean Options
113
135
 
114
136
  ```
115
- columns
116
- January
117
- February
118
- March
137
+ option-name // on
138
+ no-option-name // off
119
139
  ```
120
140
 
141
+ - Bare keyword = on; `no-` prefix = off
142
+ - Must appear before diagram content
143
+
121
144
  ---
122
145
 
123
- ## Chart Types
146
+ ## 2. Sequence Diagrams
124
147
 
125
- ### bar
148
+ ### 2.1 Participants
126
149
 
127
- **Syntax:** `bar [Title]`
150
+ ```
151
+ Name is a <type> [aka Alias] [position N]
152
+ Name | key: value
153
+ ```
128
154
 
129
- **Options:** `series`, `xlabel`, `ylabel`, `orientation` (`horizontal`/`vertical`), `labels` (`name`/`value`/`percent`/`full`), `color`
155
+ Types: `service`, `database`, `actor`, `queue`, `cache`, `gateway`, `external`, `networking`, `frontend`
130
156
 
131
- **Data format:** `Label value` one row per category
157
+ **Inference rules** — the parser infers the type (and shape) from the participant name. Only use `is a` when the name does not match or you want to override:
132
158
 
133
- **Example:**
159
+ | Inferred Type | Shape | Name Patterns (examples) |
160
+ |--------------|-------|--------------------------|
161
+ | actor | Stick figure | `User`, `Customer`, `Client`, `Admin`, `Agent`, `Person`, `Buyer`, `Seller`, `Guest`, `Visitor`, `Operator`, Alice, Bob, Charlie, `*User`, `*Actor`, `*Analyst`, `*Staff` |
162
+ | service | Rounded rectangle | `*Service`, `*Svc`, `*API`, Lambda, `*Function`, `*Fn`, `*Job`, Cron, Auth, SSO, OAuth, Stripe, Twilio, S3, Vercel, Docker, K8s, Vault, KMS, IAM, LLM, GPT, Claude, `*Pipeline`, `*Engine`, and many `-er`/`-or` suffixes (Scheduler, Handler, Processor, Worker, etc.) |
163
+ | database | Cylinder (vertical) | `*DB`, `Database`, `*Store`, `Storage`, `*Repo`, `SQL`, Postgres, MySQL, Mongo, Dynamo, Aurora, Spanner, Supabase, Firebase, BigQuery, Redshift, Snowflake, Cassandra, Neo4j, ClickHouse, Elastic, OpenSearch, Pinecone, Weaviate, `*Table` |
164
+ | cache | Dashed cylinder | `*Cache`, Redis, Memcache, KeyDB, Dragonfly, Hazelcast, Valkey |
165
+ | queue | Horizontal cylinder (pipe) | `*Queue`, `*MQ`, SQS, Kafka, RabbitMQ, `EventBus`, `*Bus`, `Topic`, `*Stream`, SNS, PubSub, NATS, Pulsar, Kinesis, EventBridge, Celery, Sidekiq, `*Channel`, `*Broker` |
166
+ | networking | Hexagon | `*Router`, `*Balancer`, `Gateway`, `Proxy`, `LB`, `CDN`, `Firewall`, `WAF`, `DNS`, `Ingress`, Nginx, Traefik, Envoy, Istio, Kong, Akamai, Cloudflare, `*Mesh` |
167
+ | frontend | Monitor (screen + stand) | `*App`, `Application`, `Mobile`, iOS, Android, `Web`, `Browser`, `Frontend`, `*UI`, `Dashboard`, `*CLI`, `Terminal`, React, Vue, Angular, Svelte, NextJS, Electron, Tauri, `*Widget`, `Portal`, `*Console`, SPA, PWA |
168
+ | gateway | Rectangle (same as default) | matched via `is a gateway` only |
169
+ | external | Dashed rectangle | `External`, `*Ext`, `ThirdParty`, `*3P`, `Vendor`, `Webhook`, `Upstream`, `Downstream`, `Callback`, AWS, GCP, Azure |
170
+ | default | Rectangle | Everything else (no `is a` needed) |
134
171
 
172
+ **Inference handles it (skip `is a`):**
173
+ ```
174
+ AuthService // service (matches *Service)
175
+ PostgresDB // database (matches *DB)
176
+ Redis // cache (exact match)
177
+ User // actor (exact match)
178
+ Kafka // queue (exact match)
179
+ API Gateway // networking (matches Gateway)
180
+ WebApp // frontend (matches *App)
181
+ Stripe // service (exact match)
135
182
  ```
136
- bar Revenue by Region
137
- series Revenue
138
183
 
139
- North 850
140
- South 620
141
- East 1100
142
- West 430
184
+ **Inference would miss (use `is a`):**
185
+ ```
186
+ Payments is a service // "Payments" matches no rule
187
+ Vault is a database // "Vault" infers as service, but you want database
188
+ Notifications is a queue // "Notifications" matches no rule
189
+ Analytics is a frontend // "Analytics" matches no rule
143
190
  ```
144
191
 
145
- Colors per item: `North(red) 850`
192
+ ### 2.2 Participant Groups
146
193
 
147
- ### line
194
+ ```
195
+ [Group Name]
196
+ Participant1
197
+ Participant2
198
+ ```
148
199
 
149
- **Syntax:** `line [Title]` or `multi-line [Title]`
200
+ - Pipe metadata goes outside brackets: `[Backend] | t: Eng`
201
+ - Invalid: `[Backend | t: Eng]` (pipe inside brackets)
150
202
 
151
- **Options:** `series`, `xlabel`, `ylabel`, `labels`
203
+ ### 2.3 Messages (Arrows)
152
204
 
153
- **Data format:** `Label value` (single series) or `Label v1, v2, v3` (multi-series matching `series` list)
205
+ | Type | Syntax | Example |
206
+ |------|--------|---------|
207
+ | Sync (labeled) | `A -label-> B` | `Client -login-> API` |
208
+ | Sync (bare) | `A -> B` | `Client -> API` |
209
+ | Async (labeled) | `A ~label~> B` | `API ~notify~> Queue` |
210
+ | Async (bare) | `A ~> B` | `API ~> Queue` |
154
211
 
155
- **Example:**
212
+ - Whitespace around arrows is optional: `A-label->B` works
213
+ - Labels can contain spaces, hyphens, special chars
214
+ - Labels cannot contain arrow chars (`->`, `~>`)
215
+ - Pipe metadata: `A -msg-> B | c: Caching`
156
216
 
157
- ```
158
- line Quarterly Performance
159
- series Sales(red), Costs(blue)
217
+ ### 2.4 Section Dividers
160
218
 
161
- Q1 100, 50
162
- Q2 120, 55
163
- Q3 110, 60
164
- Q4 130, 58
219
+ ```
220
+ == Label ==
221
+ == Label
165
222
  ```
166
223
 
167
- Multi-series: comma-separated values matching the `series` list. Single series omits `series` directive. Also works as `multi-line`.
224
+ Trailing `==` is optional.
168
225
 
169
- **Era bands** — annotate named time periods with background shading:
226
+ ### 2.5 Notes
170
227
 
171
228
  ```
172
- line U.S. Strategic Petroleum Reserve
173
- ylabel Million Barrels
229
+ note Text
230
+ note right Text
231
+ note left of ParticipantID Text
232
+ ```
174
233
 
175
- era '81 -> '89 Reagan (red)
176
- era '89 -> '93 Bush (red)
177
- era '93 -> '01 Clinton (blue)
234
+ **Multi-line notes** use an indented body below the `note` heading:
178
235
 
179
- '81 230
180
- '85 493
181
- '89 580
182
- '93 587
183
- '01 550
236
+ ```
237
+ note right of API
238
+ - First bullet point
239
+ - Second bullet point
240
+ **Bold text** and *italic text*
241
+ `inline code`
242
+ [link text](https://example.com)
243
+ https://example.com
184
244
  ```
185
245
 
186
- Syntax: `era <start> -> <end> <label> [(<color>)]`
187
-
188
- - `start` and `end` must exactly match category labels in the data
189
- - Color is optional; defaults to the palette's blue
190
- - Band label is hidden if the era spans fewer than 3 category slots
191
- - Works on `line`, `multi-line`, and `area` charts
192
- - Era boundary labels are always pinned visible on the x-axis even when auto-skip is active
246
+ Content formatting:
247
+ - `- ` prefix on indented lines = bullet points
248
+ - Inline markdown: `**bold**`, `*italic*`, `` `code` ``
249
+ - Links: `[text](url)` and bare URLs (auto-truncated in display)
193
250
 
194
- ### area
251
+ ### 2.6 Structural Blocks
195
252
 
196
- **Syntax:** `area [Title]`
253
+ ```
254
+ if condition
255
+ messages...
256
+ else if condition
257
+ messages...
258
+ else
259
+ messages...
197
260
 
198
- **Options:** same as `line`, including era bands
261
+ loop condition
262
+ messages...
199
263
 
200
- **Data format:** same as `line`
264
+ parallel label
265
+ messages...
266
+ ```
201
267
 
202
- Same syntax as `line`, including era bands. Renders as a filled area chart.
268
+ - `parallel` requires a label
269
+ - Blocks nest via indentation
203
270
 
204
- ### pie
271
+ ### 2.7 Sequence Options
205
272
 
206
- **Syntax:** `pie [Title]`
273
+ - `activations` / `no-activations`
274
+ - `collapse-notes` / `no-collapse-notes`
275
+ - `active-tag GroupName`
207
276
 
208
- **Options:** `labels` (`name`/`value`/`percent`/`full`)
277
+ ---
209
278
 
210
- **Data format:** `Label value`
279
+ ## 3. Infrastructure Diagrams
211
280
 
212
- **Example:**
281
+ ### 3.1 Declaration
213
282
 
214
283
  ```
215
- pie Market Share
216
- labels percent
217
-
218
- Company A 40
219
- Company B 35
220
- Company C 25
284
+ infra [Title]
221
285
  ```
222
286
 
223
- ### doughnut
224
-
225
- **Syntax:** `doughnut [Title]`
226
-
227
- **Options:** same as `pie`
228
-
229
- **Data format:** same as `pie`
287
+ ### 3.2 Nodes
230
288
 
231
- Same syntax as `pie`. Renders as a doughnut (ring) chart.
232
-
233
- ### polar-area
289
+ ```
290
+ NodeName
291
+ NodeName | key: value
292
+ ```
234
293
 
235
- **Syntax:** `polar-area [Title]`
294
+ Nodes are plain names. Capabilities come from properties (see 3.3), not type declarations.
236
295
 
237
- **Options:** same as `pie`
296
+ ### 3.3 Node Properties (Indented, Space-Separated, NO Colon)
238
297
 
239
- **Data format:** same as `pie`
298
+ ```
299
+ NodeName
300
+ latency-ms 50
301
+ max-rps 8000
302
+ uptime 99.99%
303
+ cache-hit 75%
304
+ description My API gateway
305
+ firewall-block 10%
306
+ instances 3
307
+ ```
240
308
 
241
- Same syntax as `pie`. Renders as a polar area (rose) chart.
309
+ Properties use a known schema with space-separated values:
242
310
 
243
- ### radar
311
+ | Property | Capability | Effect |
312
+ |----------|-----------|--------|
313
+ | `cache-hit` | Cache | % requests served from cache, reduces downstream RPS |
314
+ | `firewall-block` | Firewall/WAF | % requests blocked, reduces downstream RPS |
315
+ | `ratelimit-rps` | Rate limiter | Max RPS passed through |
316
+ | `latency-ms` | Latency | Adds to path latency |
317
+ | `uptime` | Availability | Multiplied along path for SLO |
318
+ | `instances` | Horizontal scaling | Multiplies capacity |
319
+ | `max-rps` | Capacity ceiling | Max RPS node handles |
320
+ | `cb-error-threshold` | Circuit breaker | Error rate trip threshold |
321
+ | `cb-latency-threshold-ms` | Circuit breaker | Latency trip threshold |
322
+ | `concurrency` | Concurrency limit | Max concurrent requests |
323
+ | `duration-ms` | Processing time | Time spent processing |
324
+ | `cold-start-ms` | Serverless | Cold start penalty |
325
+ | `buffer` | Queue | Buffer size |
326
+ | `drain-rate` | Queue | Consumption rate |
327
+ | `retention-hours` | Queue | Message retention |
328
+ | `partitions` | Queue | Partition count |
329
+ | `description` | Display | Description text |
244
330
 
245
- **Syntax:** `radar [Title]`
331
+ ### 3.4 Connections
246
332
 
247
- **Options:** (none)
333
+ | Type | Syntax |
334
+ |------|--------|
335
+ | Sync (bare) | `-> Target` |
336
+ | Sync (labeled) | `-/api-> Target` |
337
+ | Async (bare) | `~> Target` |
338
+ | Async (labeled) | `~event~> Target` |
248
339
 
249
- **Data format:** `Label value`
340
+ - Connection metadata: `| split: 50%, fanout: 3` (colons in pipe metadata)
341
+ - Indented under source node
250
342
 
251
- **Example:**
343
+ ### 3.5 Groups
252
344
 
253
345
  ```
254
- radar Team Skills
255
-
256
- Frontend 85
257
- Backend 70
258
- DevOps 60
259
- Design 90
260
- Testing 75
346
+ [Group Name]
347
+ [Group Name](color)
348
+ [Group Name] | key: value
261
349
  ```
262
350
 
263
- ### bar-stacked
264
-
265
- **Syntax:** `bar-stacked [Title]`
351
+ Bracket syntax only. Optional color and pipe metadata.
266
352
 
267
- **Options:** `series` (required), `xlabel`, `ylabel`, `orientation`
353
+ ### 3.6 Infra Options (Space-Separated, NO Colon)
268
354
 
269
- **Data format:** `Label v1, v2, v3` comma-separated values matching the `series` list
355
+ - `direction-tb` (boolean; default is LR)
356
+ - `default-latency-ms N`
357
+ - `default-rps N`
358
+ - `default-uptime DECIMAL`
359
+ - `slo-availability DECIMAL`
360
+ - `slo-p90-latency-ms N`
361
+ - `animate` / `no-animate`
270
362
 
271
- **Example:**
363
+ ### 3.7 Edge Nodes
272
364
 
273
365
  ```
274
- bar-stacked Budget Allocation
275
- series Engineering, Marketing, Sales
276
-
277
- Q1 100, 50, 30
278
- Q2 110, 55, 35
279
- Q3 105, 60, 40
366
+ edge
367
+ internet
280
368
  ```
281
369
 
282
- ### scatter
370
+ Special top-level entry points. `internet` only accepts `rps` property.
283
371
 
284
- **Syntax:** `scatter [Title]`
285
-
286
- **Options:** `labels` (`on`/`off`), `xlabel`, `ylabel`, `sizelabel`
372
+ ---
287
373
 
288
- **Data format:** `Label x, y` or `Label x, y, size` (bubble chart). Group with `[GroupName]` blocks.
374
+ ## 4. Flowchart Diagrams
289
375
 
290
- **Example:**
376
+ ### 4.1 Declaration
291
377
 
292
378
  ```
293
- scatter Performance Metrics
294
- labels on
295
- xlabel Experience (years)
296
- ylabel Output
297
-
298
- Alice 3, 85
299
- Bob 7, 92
300
- Carol 2, 70
379
+ flowchart [Title]
301
380
  ```
302
381
 
303
- Tag groups (`[GroupName](color)`) create colored clusters:
382
+ ### 4.2 Node Shapes
304
383
 
305
- ```
306
- scatter Startup Funding vs Revenue
307
- labels on
308
- xlabel Funding ($M)
309
- ylabel Annual Revenue ($M)
384
+ | Shape | Syntax | Example |
385
+ |-------|--------|---------|
386
+ | Terminal | `(Label)` | `(Start)` |
387
+ | Process | `[Label]` | `[Do Task]` |
388
+ | Decision | `<Label>` | `<Check?>` |
389
+ | I/O | `/Label/` | `/Read Input/` |
390
+ | Subroutine | `[[Label]]` | `[[Validate]]` |
391
+ | Document | `[Label~]` | `[Report~]` |
310
392
 
311
- [SaaS](blue)
312
- Acme Cloud 12, 8.5
313
- DataSync 5.2, 3.1
393
+ - Color suffix: `(Start(green))`
314
394
 
315
- [Fintech](green)
316
- PayFlow 45, 32
317
- LendTech 18, 12.5
318
- ```
395
+ ### 4.3 Arrows
319
396
 
320
- ### heatmap
397
+ | Type | Syntax |
398
+ |------|--------|
399
+ | Unlabeled | `->` |
400
+ | Labeled | `-label->` |
401
+ | Colored | `-(color)->` |
402
+ | Labeled + colored | `-label(color)->` |
321
403
 
322
- **Syntax:** `heatmap [Title]`
404
+ - Color inference: `yes/success/ok/true` infers green; `no/fail/error/false` infers red
323
405
 
324
- **Options:** `columns` (required)
325
-
326
- **Data format:** `Row Label v1, v2, v3` — comma-separated values matching the `columns` list
327
-
328
- **Example:**
406
+ ### 4.4 Groups
329
407
 
330
408
  ```
331
- heatmap Activity by Month
332
- columns Jan, Feb, Mar, Apr, May, Jun
333
-
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
409
+ [GroupName]
410
+ [Child nodes...]
337
411
  ```
338
412
 
339
- ### sankey
340
-
341
- **Syntax:** `sankey [Title]`
342
-
343
- **Options:** (none)
413
+ Bracket syntax only.
344
414
 
345
- **Data format:** Arrow syntax (`Source -> Target value`) or indentation syntax (`Target value` indented under parent)
346
-
347
- **Arrow syntax:**
415
+ ### 4.5 Inline Chains
348
416
 
349
417
  ```
350
- sankey Resource Flow
351
-
352
- Source A -> Processing 300
353
- Source B -> Processing 200
354
- Processing -> Output X 350
355
- Processing -> Output Y 150
418
+ (Start) -> [Step 1] -> [Step 2] -> (End)
356
419
  ```
357
420
 
358
- **Indentation syntax:**
421
+ ### 4.6 Options
359
422
 
360
- ```
361
- sankey Resource Flow
423
+ - `direction-tb` (boolean; default is LR)
424
+ - `orientation-vertical` (boolean; default is horizontal)
362
425
 
363
- Source A
364
- Processing 300
365
- Source B
366
- Processing 200
367
- Processing
368
- Output X 350
369
- Output Y 150
370
- ```
426
+ ---
371
427
 
372
- Both syntaxes can be mixed in the same diagram.
428
+ ## 5. State Diagrams
373
429
 
374
- **Node colors** — `(color)` after a node name:
430
+ ### 5.1 Declaration
375
431
 
376
432
  ```
377
- Revenue (green)
378
- Costs (red) 600
379
- Profit (blue) 400
380
-
381
- // or with arrows
382
- Revenue (green) -> Costs (red) 600
433
+ state [Title]
383
434
  ```
384
435
 
385
- **Link colors** — `(color)` after the value:
436
+ ### 5.2 States
386
437
 
387
438
  ```
388
- Revenue
389
- Costs 600 (orange)
390
-
391
- // or with arrows
392
- Revenue -> Costs 600 (orange)
439
+ StateName
440
+ StateName(color)
441
+ [*] // initial/final pseudostate
393
442
  ```
394
443
 
395
- ### chord
396
-
397
- **Syntax:** `chord [Title]`
398
-
399
- **Options:** (none)
444
+ ### 5.3 Transitions
400
445
 
401
- **Data format:** same as `sankey` (arrow syntax)
446
+ | Type | Syntax |
447
+ |------|--------|
448
+ | Unlabeled | `Idle -> Active` |
449
+ | Labeled | `Idle -submit-> Processing` |
450
+ | Colored | `Idle -(blue)-> Active` |
402
451
 
403
- Same syntax as `sankey`. Renders as a circular chord diagram.
404
-
405
- **Example:**
452
+ ### 5.4 Groups
406
453
 
407
454
  ```
408
- chord Inter-Department Collaboration
409
-
410
- Engineering -> Design 85
411
- Engineering -> Product 72
412
- Design -> Marketing 45
413
- Product -> Sales 42
455
+ [Group Name]
456
+ [Group Name](color)
414
457
  ```
415
458
 
416
- ### funnel
459
+ ### 5.5 Options
417
460
 
418
- **Syntax:** `funnel [Title]`
461
+ - `direction-tb` (boolean; default is LR)
419
462
 
420
- **Options:** (none)
463
+ ---
421
464
 
422
- **Data format:** `Label value`
465
+ ## 6. Org Charts
423
466
 
424
- **Example:**
467
+ ### 6.1 Declaration
425
468
 
426
469
  ```
427
- funnel Conversion Pipeline
428
-
429
- Visitors 1000
430
- Signups 500
431
- Trials 200
432
- Customers 100
470
+ org [Title]
433
471
  ```
434
472
 
435
- ### function
436
-
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:**
473
+ ### 6.2 Nodes (Indentation = Hierarchy)
444
474
 
445
475
  ```
446
- function Mathematical Functions
447
- xlabel x
448
- ylabel f(x)
449
-
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
476
+ CEO
477
+ CTO
478
+ Engineer1
479
+ Engineer2
480
+ CFO
454
481
  ```
455
482
 
456
- Expressions support: `+`, `-`, `*`, `/`, `^`, `sin`, `cos`, `sqrt`, `abs`, `log`, `exp`, `pi`, `e`.
457
-
458
- ### slope
459
-
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, ...`
483
+ - Color suffix: `Alice(blue)`
484
+ - Pipe metadata: `Alice | role: CEO, t: Exec`
465
485
 
466
- **Example:**
486
+ ### 6.3 Metadata (Indented, Colon REQUIRED)
467
487
 
468
488
  ```
469
- slope Programming Language Popularity
470
-
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
489
+ Alice
490
+ role: Senior Engineer
491
+ location: NYC
476
492
  ```
477
493
 
478
- ### wordcloud
479
-
480
- **Syntax:** `wordcloud [Title]`
481
-
482
- **Options:** `rotate` (`none`/`mixed`/`angled`), `max` (word limit), `size` (`min, max` font range)
494
+ This is key-value metadata assignment, consistent with pipe metadata syntax.
483
495
 
484
- **Data format:** `word weight` (higher = larger)
485
-
486
- **Example:**
496
+ ### 6.4 Containers
487
497
 
488
498
  ```
489
- wordcloud Top Terms
490
-
491
- kubernetes 95
492
- docker 80
493
- terraform 65
494
- ansible 50
499
+ [Team Name]
500
+ members...
495
501
  ```
496
502
 
497
- ### arc
503
+ ### 6.5 Options
498
504
 
499
- **Syntax:** `arc [Title]`
505
+ - `direction-tb` (boolean; default is LR)
506
+ - `sub-node-label Text`
507
+ - `show-sub-node-count`
508
+ - `hide`
500
509
 
501
- **Options:** `order:` (`appearance`/`name`/`group`/`degree`), `orientation`
510
+ ---
502
511
 
503
- **Data format:** `Source -> Target weight`. Group nodes with `[GroupName]` blocks.
512
+ ## 7. C4 Architecture Diagrams
504
513
 
505
- **Example:**
514
+ ### 7.1 Declaration
506
515
 
507
516
  ```
508
- arc Team Collaboration
509
- order: group
510
-
511
- [Frontend]
512
- WebApp -> API Gateway 5
513
- MobileApp -> API Gateway 3
514
-
515
- [Core Services]
516
- API Gateway -> AuthService 4
517
- API Gateway -> UserService 5
517
+ c4 [Title]
518
518
  ```
519
519
 
520
- ### venn
521
-
522
- **Syntax:** `venn [Title]`
523
-
524
- **Options:** `values` (`on`/`off`)
525
-
526
- **Data format:** Sets: `id(color) alias shortname`. Overlaps: `id1 + id2 Label`.
527
-
528
- **Example:**
520
+ ### 7.2 Elements
529
521
 
530
522
  ```
531
- venn Skill Overlap
532
-
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
523
+ Name is a <type>
524
+ Name is a container is a database // shape override
541
525
  ```
542
526
 
543
- ### quadrant
527
+ Types: `person`, `system`, `container`, `component`
528
+ Shape overrides: `database`, `cache`, `queue`, `cloud`, `external`
544
529
 
545
- **Syntax:** `quadrant [Title]`
546
-
547
- **Options:** `x-axis` (`low label, high label`), `y-axis` (`low label, high label`)
548
-
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:**
530
+ ### 7.3 Element Metadata (Indented, Colon REQUIRED)
552
531
 
553
532
  ```
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)
562
-
563
- Task A 0.9, 0.8
564
- Task B 0.2, 0.3
565
- Task C 0.7, 0.4
533
+ Web App is a container
534
+ description: SPA built with React
535
+ tech: React
566
536
  ```
567
537
 
568
- ### timeline
569
-
570
- **Syntax:** `timeline [Title]`
571
-
572
- **Options:** `scale` (`on`/`off`), `sort` (`time`/`group`/`tag`/`tag:GroupName`), `swimlanes` (`on`/`off`)
538
+ Indented metadata uses colon-separated `key: value`, consistent with org charts and pipe metadata.
573
539
 
574
- **Data format:** Ranges: `start->end Label | tag: Value`. Points: `date Label | tag: Value`.
575
-
576
- **Example:**
540
+ ### 7.4 Pipe Metadata (Colons in pipes)
577
541
 
578
542
  ```
579
- timeline Project History
580
-
581
- tag Team
582
- Team A(blue)
583
- Team B(green)
584
-
585
- era 2023->2024 Phase 1
586
- marker 2023-06 Launch(orange)
587
-
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
591
-
592
- 2023-03->2023-09 Research | Team: Team B
593
- 2023-09->2024-03? Implementation | Team: Team B
543
+ Web App is a container | description: SPA, tech: React
594
544
  ```
595
545
 
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?`).
546
+ ### 7.5 Relationships
597
547
 
598
- Elements: `era start->end Label(color)`, `marker date Label(color)`, `tag` groups for interactive coloring.
548
+ | Type | Syntax |
549
+ |------|--------|
550
+ | Sync labeled | `-Makes API calls-> API` |
551
+ | Sync with tech | `-Uses [HTTPS]-> API` |
552
+ | Async labeled | `~Sends emails~> Email` |
599
553
 
600
- Tag groups for interactive coloring and swimlanes:
554
+ ### 7.6 Sections
601
555
 
602
556
  ```
603
- timeline Sprint Plan
604
- sort tag:Team
605
-
606
- tag Team
607
- Engineering(blue)
608
- Design(green)
609
-
610
- 2024-01->2024-06 Build API | Team: Engineering
611
- 2024-03->2024-05 UX Review | Team: Design
557
+ containers
558
+ ...
559
+ components
560
+ ...
561
+ deployment
562
+ container Web App // reference existing container
612
563
  ```
613
564
 
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`).
615
-
616
- ---
617
-
618
- ## Diagram Types
565
+ ### 7.7 Options
619
566
 
620
- ### sequence
567
+ - `direction-tb` (boolean; default is LR)
621
568
 
622
- **Syntax:** `sequence [Title]`
623
-
624
- **Options:** `activations` (`on`/`off`), `collapse-notes` (`yes`/`no`), `active-tag GroupName`
569
+ ---
625
570
 
626
- **Data format:** Messages between participants with arrow syntax
571
+ ## 8. Entity-Relationship Diagrams
627
572
 
628
- Minimal example:
573
+ ### 8.1 Declaration
629
574
 
630
575
  ```
631
- User -login-> API
632
- API -findUser-> DB
633
- DB -user-> API
634
- API -token-> User
576
+ er [Title]
635
577
  ```
636
578
 
637
- Full example:
579
+ ### 8.2 Tables
638
580
 
639
581
  ```
640
- sequence Authentication Flow
641
-
642
- // participant declarations (optional)
643
- User is an actor
644
- API is a service
645
- DB is a database
646
- NotifyQueue is a queue aka Notifications
647
-
648
- User -Login request-> API
649
- API -Find user by email-> DB
650
- DB -user record-> API
651
- note on DB
652
- Indexed lookup on email column
653
-
654
- if credentials valid
655
- API -Create session-> DB
656
- DB -session token-> API
657
- API ~session.created~> NotifyQueue
658
- API -200 OK + token-> User
659
- else
660
- API -401 Unauthorized-> User
661
-
662
- == Logout ==
663
-
664
- User -Logout-> API
665
- API -Delete session-> DB
666
- API -200 OK-> User
582
+ users
583
+ users(blue)
584
+ users | domain: Core
667
585
  ```
668
586
 
669
- **Participants**: Auto-inferred from message names. Declare explicitly for type/positioning:
670
- - `Name is a [actor|service|database|queue|cache|gateway|external|networking|frontend]`
671
- - `Name aka Display Label` — alias for display
672
- - `Name at position 2` — manual left-to-right ordering (0-based; negative from right)
673
-
674
- **Messages**:
675
- - Sync call: `A -label-> B` or `A -> B` (unlabeled) — always left-to-right
676
- - Async call: `A ~label~> B` or `A ~> B` (unlabeled)
677
-
678
- **Blocks** (indentation-scoped):
679
- - `if condition` ... `else` ... (no explicit `end` needed — indentation closes blocks)
680
- - `loop label` ...
681
- - `parallel label` ...
682
-
683
- **Notes**:
684
- - `note text` — standalone
685
- - `note on Participant` followed by indented text — anchored
686
- - Multi-line: indent continuation lines under `note`
687
-
688
- **Sections**: `== Section Title ==`
689
-
690
- **Groups**: `[Group Name]` or `[Group Name | key: value]` — visual grouping box around participants
587
+ - Pipe metadata on declaration line only
588
+ - Indented lines are columns or relationships
691
589
 
692
- **Tag groups** define color-coded metadata dimensions for interactive recoloring:
590
+ ### 8.3 Columns (Indented, Space-Separated, NO Colon)
693
591
 
694
592
  ```
695
- tag Concern alias c
696
- Caching(blue)
697
- Auth(green)
698
- BusinessLogic(purple) default
593
+ users
594
+ id int pk
595
+ name varchar
596
+ email string unique
597
+ created_at timestamp nullable
699
598
  ```
700
599
 
701
- - `tag Name` declares a tag group; `alias x` adds a shorthand
702
- - Each entry: `Value(color)` named color for that value
703
- - `default` on an entry applies it to untagged elements when the group is active
600
+ Format: `name [type] [constraints...]`
601
+ Constraints: `pk`, `fk`, `unique`, `nullable`
704
602
 
705
- **Pipe metadata** attach tag values to participants, messages, and groups:
603
+ ### 8.4 Relationships (Indented Under Source Table)
706
604
 
707
605
  ```
708
- API is a service | concern: Caching, team: Platform
709
- User -login-> API | concern: Auth
710
- [Backend | concern: BusinessLogic]
711
- OrderAPI
712
- DB
606
+ ships
607
+ 1-aboard-* crew_members
608
+ ?-frequents-1 ports
713
609
  ```
714
610
 
715
- - `| key: value` after participant declarations, message lines, or group headers
716
- - Multiple tags: `| key1: val1, key2: val2`
717
- - Aliases work: `| c: Caching` (if `alias c` was declared)
718
-
719
- **Tag resolution priority** (when a tag group is active):
720
- 1. Explicit metadata on the participant
721
- 2. Group propagation (participant inherits from its group)
722
- 3. Receiver inheritance (all incoming tagged messages agree on same value)
723
- 4. `default` entry value
724
- 5. Neutral (no color)
725
-
726
- **Legend** — rendered automatically above participants when tag groups exist. The active group expands to show colored entry dots. Click a group pill to activate it (in the desktop app).
611
+ Cardinality symbols: `1` (one), `*` (many), `?` (optional)
727
612
 
728
- ### flowchart
613
+ ### 8.5 Options
729
614
 
730
- **Syntax:** `flowchart [Title]`
615
+ - `notation chen` / `notation crow`
731
616
 
732
- **Options:** (none beyond `palette`, `theme`)
617
+ ---
733
618
 
734
- **Data format:** Node chains with arrow connections
619
+ ## 9. Class Diagrams
735
620
 
736
- Minimal example:
621
+ ### 9.1 Declaration
737
622
 
738
623
  ```
739
- (Start) -> [Process] -> (End)
624
+ class [Title]
740
625
  ```
741
626
 
742
- Full example:
627
+ ### 9.2 Classes
743
628
 
744
629
  ```
745
- flowchart Decision Process
746
-
747
- (Start) -> <Valid Input?>
748
- -yes-> [Process Data] -> [[Run Subroutine]]
749
- -no-> /Get User Input/ -> <Valid Input?>
750
- [[Run Subroutine]] -> [Document~] -> (Done)
630
+ Ship
631
+ abstract Vessel
632
+ interface Serializable
633
+ Ship extends Vessel
634
+ Galleon implements Serializable
635
+ ShipType enum
751
636
  ```
752
637
 
753
- **Node shapes**:
754
- - `(Terminal)` — oval
755
- - `[Process]` — rectangle
756
- - `<Decision?>` — diamond
757
- - `/Input Output/` — parallelogram
758
- - `[[Subroutine]]` — double-bordered rectangle
759
- - `[Document~]` — document (wavy bottom)
760
-
761
- **Arrows**: `-label-> Target`, `-(color)-> Target`, `-label(color)-> Target`
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
-
771
- Colors on nodes: `[Process(blue)]`
772
-
773
- ### state
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
-
781
- Minimal example:
638
+ ### 9.3 Members (Indented, Colon for Types)
782
639
 
640
+ **Fields:**
783
641
  ```
784
- [*] -> Idle -> Active -> [*]
642
+ + name: string
643
+ - speed: number
644
+ # protectedField: int
785
645
  ```
786
646
 
787
- Full example:
788
-
647
+ **Methods:**
789
648
  ```
790
- state Order Lifecycle
791
- direction LR
792
-
793
- [Processing(blue)]
794
- Validating -valid-> Approved
795
- Validating -invalid-> Rejected(red)
796
-
797
- [*] -> Pending -submit-> Validating
798
- Approved -ship-> Shipped -> [*]
799
- Rejected -> [*]
800
- Shipped -return-> Pending
649
+ + sail(): void
650
+ - calculate(x: number): boolean
651
+ + getName() {static}: string
801
652
  ```
802
653
 
803
- **States**: bare text `Idle`, `Active`, `Processing`. Optional color suffix: `Active(green)`.
654
+ Visibility: `+` public, `-` private, `#` protected
804
655
 
805
- **Pseudostates**: `[*]` — rendered as a filled circle. Use for start and end points.
656
+ **Enum values:**
657
+ ```
658
+ ShipType enum
659
+ Galleon
660
+ Sloop
661
+ ```
806
662
 
807
- **Transitions**: `->`, `-label->`, `-(color)->`, `-label(color)->`.
663
+ ### 9.4 Relationships (Indented Under Source Class)
808
664
 
809
- **Chains**: `A -> B -> C` on a single line creates two transitions.
665
+ | Relationship | Arrow |
666
+ |-------------|-------|
667
+ | Inheritance | `--|>` |
668
+ | Implementation | `..\|>` |
669
+ | Composition | `*--` |
670
+ | Aggregation | `o--` |
671
+ | Dependency | `..>` |
672
+ | Association | `->` |
810
673
 
811
- **Indentation**: indented lines use the parent as implicit source:
674
+ Relationships are indented under the source class:
812
675
 
813
676
  ```
814
- Idle
815
- -start-> Running
816
- -configure-> Configuring
677
+ Ship
678
+ --|> Vessel
679
+ *-- Cannon
817
680
  ```
818
681
 
819
- is equivalent to `Idle -start-> Running` and `Idle -configure-> Configuring`.
682
+ Optional label: `--|> Vessel : extends` (colon optional before label)
820
683
 
821
- **Groups**: `[GroupName]` or `[GroupName(color)]` groups subsequent indented states visually.
684
+ `extends` and `implements` on class declarations still work as part of the declaration syntax.
822
685
 
823
- **Self-loops**: `Running -retry-> Running` — a state transitioning to itself.
686
+ ### 9.5 Options
824
687
 
825
- ### class
688
+ - `no-auto-color` (boolean; auto-coloring is on by default)
826
689
 
827
- **Syntax:** `class [Title]`
828
-
829
- **Options:** (none beyond `palette`, `theme`)
690
+ ---
830
691
 
831
- **Data format:** Class declarations with indented members
692
+ ## 10. Kanban Boards
832
693
 
833
- Minimal example:
694
+ ### 10.1 Declaration
834
695
 
835
696
  ```
836
- Animal
837
- + name: string
838
- + speak(): void
839
-
840
- Dog extends Animal
841
- + breed: string
842
-
843
- Cat extends Animal
844
- + indoor: boolean
697
+ kanban [Title]
845
698
  ```
846
699
 
847
- Full example:
700
+ ### 10.2 Columns
848
701
 
849
702
  ```
850
- class Type Hierarchy
851
-
852
- Printable [interface]
853
- + print(): void
854
-
855
- Shape implements Printable [abstract]
856
- # x: number
857
- # y: number
858
- + area(): number
859
- count: number {static}
860
-
861
- Circle extends Shape
862
- - radius: number
863
- + area(): number
864
-
865
- Rectangle extends Shape
866
- - width: number
867
- - height: number
868
-
869
- Shape *-- Circle : contains
703
+ [Column Name]
704
+ [Column Name](color) | wip: 3
870
705
  ```
871
706
 
872
- **Class modifiers**: `[abstract]`, `[interface]`, `[enum]`
707
+ ### 10.3 Cards (Indented Under Columns)
873
708
 
874
- **Inheritance**: `ClassName extends Parent` or `ClassName implements Interface` — declared inline in the class header. Members are indented below.
875
-
876
- **Member visibility**: `+` public, `#` protected, `-` private. Static: `{static}`.
877
-
878
- **Relationships** (arrow syntax):
879
- - Inheritance: `A --|> B`
880
- - Implementation: `A ..|> B`
881
- - Composition: `A *-- B`
882
- - Aggregation: `A o-- B`
883
- - Dependency: `A ..> B`
884
- - Association: `A -> B`
885
- - Optional label: `A *-- B : description`
709
+ ```
710
+ [To Do]
711
+ Card title | priority: High, c: Owner
712
+ Detail text (indented deeper)
713
+ ```
886
714
 
887
- ### er
715
+ ### 10.4 Options
888
716
 
889
- **Syntax:** `er [Title]`
717
+ - `no-auto-color` (boolean; auto-coloring is on by default)
718
+ - `hide`
890
719
 
891
- **Options:** (none beyond `palette`, `theme`)
720
+ ---
892
721
 
893
- **Data format:** Entity declarations with indented columns and relationships
722
+ ## 11. Initiative-Status Diagrams
894
723
 
895
- Minimal example:
724
+ ### 11.1 Declaration
896
725
 
897
726
  ```
898
- users
899
- id: int [pk]
900
- name: varchar
901
- 1-* posts
902
-
903
- posts
904
- id: int [pk]
905
- user_id: int [fk]
727
+ initiative-status [Title]
906
728
  ```
907
729
 
908
- Full example:
730
+ ### 11.2 Nodes
909
731
 
910
732
  ```
911
- er Blog Schema
912
-
913
- users
914
- id: int [pk]
915
- email: varchar [unique]
916
- name: varchar
917
- 1-writes-* posts
918
- ?-moderates-* categories
919
-
920
- posts
921
- id: int [pk]
922
- title: varchar
923
- body: text
924
- author_id: int [fk]
925
- category_id: int [fk, nullable]
926
-
927
- categories
928
- id: int [pk]
929
- name: varchar [unique]
930
- 1-* posts
733
+ NodeLabel | status, key: value
734
+ NodeLabel | done, t: Team1
931
735
  ```
932
736
 
933
- **Columns**: `name: type [constraints]`. Constraints: `pk`, `fk`, `unique`, `nullable`. Multiple: `[fk, nullable]`.
934
-
935
- **Relationships** — indented under the source table (preferred):
936
- - `1-* target` — one-to-many
937
- - `1-1 target` — one-to-one
938
- - `?-1 target` — zero-or-one to one
939
- - `?-* target` — zero-or-more
940
- - Labeled: `1-writes-* target` (label between dashes)
941
-
942
- Columns and relationships can be mixed under the same table. The parser distinguishes them by the leading cardinality character (`1`, `*`, `?`).
943
-
944
- **Flat relationships** — at indent 0 (also supported):
945
- - `table1 1--* table2` — one-to-many
946
- - `table1 1--* table2 : label` — with label
737
+ Status values and equivalences:
947
738
 
948
- ### c4
739
+ | User writes | Canonical | Display |
740
+ |------------|-----------|---------|
741
+ | `done` | `done` | Done |
742
+ | `doing` | `doing` | In Progress |
743
+ | `wip` | `doing` | In Progress |
744
+ | `blocked` | `blocked` | Blocked |
745
+ | `paused` | `blocked` | Blocked |
746
+ | `waiting` | `blocked` | Blocked |
747
+ | `todo` | `todo` | To Do |
748
+ | `na` | `na` | N/A |
749
+ | (omitted) | `na` | N/A |
949
750
 
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
-
956
- Minimal example:
751
+ ### 11.3 Edges
957
752
 
958
753
  ```
959
- c4
960
-
961
- User is a person
962
- MyApp is a system | description: The main application
963
- -Uses-> User
754
+ Source -> Target
755
+ Source -label-> Target
756
+ Source -> Target | status
964
757
  ```
965
758
 
966
- Auto-detection: C4 diagrams are auto-detected when `Name is a person/system/container/component` declarations are present — `c4` is optional.
967
-
968
- Full example:
969
-
759
+ Indented shorthand (source from preceding node):
760
+ ```
761
+ Captain | t: Bridge
762
+ -issueOrders-> CrewApp | na
970
763
  ```
971
- c4 Banking System
972
764
 
973
- tag Scope alias sc
974
- Internal(blue) default
975
- External(gray)
765
+ ### 11.4 Groups
976
766
 
977
- Customer is a person | description: A customer of the bank
767
+ ```
768
+ [Group Name]
769
+ indented nodes...
770
+ ```
978
771
 
979
- Internet Banking is a system | description: Online banking portal
980
- -Delivers content-> Customer | tech: HTTPS
981
- -Sends emails-> Email | tech: SMTP
772
+ ### 11.5 Options
982
773
 
983
- containers
984
- Web App is a container | description: SPA, tech: React
985
- -API calls-> API | tech: JSON/HTTPS
774
+ - `active-tag GroupName`
775
+ - `hide phase:Planning, phase:Review` (colon syntax for tag:value)
986
776
 
987
- API is a container | description: Backend, tech: Node.js
988
- -Reads/writes-> Database | tech: SQL
777
+ ---
989
778
 
990
- Database is a container | description: Data store, tech: PostgreSQL
779
+ ## 12. Sitemap Diagrams
991
780
 
992
- Email is a system | description: Email delivery, sc: External
993
- ~Sends emails~> Customer
781
+ ### 12.1 Declaration
994
782
 
995
- deployment
996
- Vercel is a cloud
997
- container Web App
998
- Railway
999
- container API
1000
- Neon is a database
1001
- container Database
783
+ ```
784
+ sitemap [Title]
1002
785
  ```
1003
786
 
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
787
+ ### 12.2 Pages (Indentation = Hierarchy)
1011
788
 
1012
- **Metadata** (pipe-delimited): `Name is a system | description: text, tech: stack, tagalias: value`
789
+ ```
790
+ Home
791
+ About
792
+ Pricing | Auth: Public
793
+ Enterprise
794
+ Blog
795
+ ```
1013
796
 
1014
- **Sections**: `containers` (inside system), `components` (inside container), `deployment`
797
+ ### 12.3 Arrows
1015
798
 
1016
- **Deployment nodes**: `NodeName is a [cloud|database|cache|queue|external]`
799
+ ```
800
+ Home
801
+ -pricing-> Pricing
802
+ -login-> Login
803
+ ```
1017
804
 
1018
- **Relationships**:
1019
- - Sync: `-> Target` or `-label-> Target`
1020
- - Async: `~> Target` or `~label~> Target`
1021
- - With technology metadata: `-label-> Target | tech: HTTPS`
805
+ ### 12.4 Containers
1022
806
 
1023
- **Tag groups**: See tag group syntax below.
807
+ ```
808
+ [Marketing]
809
+ Pricing | Auth: Public
810
+ ```
1024
811
 
1025
- ### org
812
+ ### 12.5 Options
1026
813
 
1027
- **Syntax:** `org [Title]`
814
+ - `direction-tb` (boolean; default is LR)
1028
815
 
1029
- **Options:** `sub-node-label`, `show-sub-node-count` (flag, no value needed)
816
+ ---
1030
817
 
1031
- **Data format:** Hierarchy via indentation
818
+ ## 13. Gantt Charts
1032
819
 
1033
- Minimal example:
820
+ ### 13.1 Declaration
1034
821
 
1035
822
  ```
1036
- org
1037
-
1038
- CEO
1039
- VP Engineering
1040
- Team Lead
1041
- VP Marketing
823
+ gantt [Title]
1042
824
  ```
1043
825
 
1044
- Full example:
826
+ ### 13.2 Options (Space-Separated, NO Colon)
1045
827
 
1046
828
  ```
1047
- org Engineering Org
1048
- sub-node-label Reports
1049
- show-sub-node-count
1050
-
1051
- tag Level alias lv
1052
- Director(red)
1053
- Manager(blue)
1054
- IC(green) default
1055
-
1056
- CTO | lv: Director
1057
- VP Engineering | lv: Director
1058
- [Platform]
1059
- Lead | lv: Manager
1060
- Dev 1
1061
- Dev 2
1062
- [Product]
1063
- Lead | lv: Manager
1064
- Dev 3
829
+ start 2026-03-15
830
+ today-marker
831
+ today-marker 2026-03-27
832
+ critical-path
833
+ no-dependencies
834
+ sort tag:Team
1065
835
  ```
1066
836
 
1067
- Hierarchy via indentation. `[Group Name]` creates collapsible sub-groups.
837
+ ### 13.3 Holidays
1068
838
 
1069
- **Metadata**: `Name | tagalias: value, tag2: value2`
1070
-
1071
- **Imports**: `import path/to/file.dgmo` (indented under a parent node), `tags path/to/tags.dgmo` (top-level).
839
+ ```
840
+ holiday
841
+ 2024-02-19 Presidents Day
842
+ 2024-05-27 -> 2024-05-29 Memorial Weekend
843
+ ```
1072
844
 
1073
- ### kanban
845
+ ### 13.4 Workweek
1074
846
 
1075
- **Syntax:** `kanban [Title]`
847
+ ```
848
+ workweek mon-fri
849
+ workweek sun-thu
850
+ ```
1076
851
 
1077
- **Options:** (none beyond `palette`, `theme`)
852
+ Top-level directive (not nested under `holiday`).
1078
853
 
1079
- **Data format:** `[Column]` headers with card items below
854
+ ### 13.5 Eras
1080
855
 
1081
- Minimal example:
856
+ **Flat form:**
857
+ ```
858
+ era 2026-04-06 -> 2026-04-10 Conference (purple)
859
+ ```
1082
860
 
861
+ **Block form:**
862
+ ```
863
+ era
864
+ 2026-04-06 -> 2026-04-10 Conference (purple)
865
+ 2026-06-01 -> 2026-06-05 Sprint Review (blue)
1083
866
  ```
1084
- kanban
1085
867
 
1086
- [To Do]
1087
- Task 1
1088
- Task 2
868
+ ### 13.6 Markers
1089
869
 
1090
- [Done]
1091
- Task 3
870
+ **Flat form:**
871
+ ```
872
+ marker 2026-03-27 Board Review
1092
873
  ```
1093
874
 
1094
- Full example:
1095
-
875
+ **Block form:**
876
+ ```
877
+ marker
878
+ 2026-03-27 Board Review
879
+ 2026-06-15 Release (green)
1096
880
  ```
1097
- kanban Sprint Board
1098
881
 
1099
- tag Priority
1100
- Critical(red)
1101
- High(orange)
1102
- Low(green) default
882
+ ### 13.7 Groups (Swimlanes)
1103
883
 
1104
- tag Owner alias o
1105
- Alice(blue)
1106
- Bob(green)
884
+ ```
885
+ [Backend] | t: Engineering
886
+ ```
1107
887
 
1108
- [Backlog(gray)]
1109
- Research API options | priority: High, o: Alice
888
+ Bracket syntax only.
1110
889
 
1111
- [In Progress(orange)] | wip: 3
1112
- Build auth module | priority: Critical, o: Bob
1113
- Integrate OAuth2
1114
- Add session management
890
+ ### 13.8 Tasks
1115
891
 
1116
- [Done(green)]
1117
- Setup CI pipeline | priority: High, o: Alice
892
+ ```
893
+ 20bd Database Schema | p: Foundation, 100%
894
+ 10bd API Integration | t: Engineering
895
+ 0d Launch Day
896
+ 2026-03-15 -> 30d Setup
1118
897
  ```
1119
898
 
1120
- **Columns**: `[Column Name]`, `[Column Name(color)]`, `[Column Name] | wip: N`
899
+ Duration units: `min`, `h`, `d`, `bd` (business days), `w`, `m`, `q`, `y`
900
+ Uncertain: `10bd?` (trailing `?`)
901
+ Progress: `| 80%` in pipe metadata
1121
902
 
1122
- **Cards**: `Card Title | tag: value`. Indented lines below become card details.
903
+ ### 13.9 Dependencies (Indented Under Tasks)
1123
904
 
1124
- **Group metadata cascading**: `[Column Name] | key: value` — pipe metadata on column headers cascades to all cards in the column.
905
+ ```
906
+ 10bd API Integration
907
+ -> E2E Testing
908
+ -> Launch Day | offset: 10bd
909
+ ```
1125
910
 
1126
- ### initiative-status
911
+ ### 13.10 Parallel Block
1127
912
 
1128
- **Syntax:** `initiative-status [Title]`
913
+ ```
914
+ parallel
915
+ [Backend]
916
+ 20bd Schema
917
+ [Frontend]
918
+ 10bd Wireframes
919
+ ```
1129
920
 
1130
- **Options:** (none beyond `palette`, `theme`)
921
+ ---
1131
922
 
1132
- **Data format:** Nodes with status, connected by dependency arrows
923
+ ## 14. Timeline Diagrams
1133
924
 
1134
- Minimal example:
925
+ ### 14.1 Declaration
1135
926
 
1136
927
  ```
1137
- initiative-status
1138
-
1139
- Auth | done
1140
- -> UserService | doing
1141
- -> NotifyService | todo
1142
- UserService | doing
1143
- NotifyService | todo
928
+ timeline [Title]
1144
929
  ```
1145
930
 
1146
- Full example:
931
+ ### 14.2 Events
1147
932
 
933
+ **Point event:**
1148
934
  ```
1149
- initiative-status Platform Roadmap
1150
-
1151
- Auth | done
1152
- -depends-> UserService | doing
1153
- -feeds-> Dashboard | todo
1154
- Dashboard | todo
1155
- UserService | doing
1156
- -calls-> DBLayer | done
1157
- DBLayer | done
1158
-
1159
- [External]
1160
- PaymentGW | na
1161
- EmailProvider | na
935
+ 1718-05 Blockades Charleston | p: Blackbeard
1162
936
  ```
1163
937
 
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.
1167
-
1168
- **Relationships**: `-label-> Target | status` or indented children.
1169
-
1170
- **Groups**: `[Group Name]` for visual grouping. `[Group Name] | key: value` — pipe metadata cascades to contained nodes.
1171
-
1172
- ### sitemap
938
+ **Range event:**
939
+ ```
940
+ 1716 -> 1717 Sails under Hornigold | p: Blackbeard
941
+ ```
1173
942
 
1174
- **Syntax:** `sitemap [Title]`
943
+ **Duration event:**
944
+ ```
945
+ 2026-03-20 -> 30d Sprint 1
946
+ ```
1175
947
 
1176
- **Options:** `direction` (`TB` or `LR`), `orientation` (alias for `direction`)
948
+ **Uncertain ending:**
949
+ ```
950
+ 1718 -> 1719? Rackham builds crew
951
+ ```
1177
952
 
1178
- **Data format:** Page labels with arrows and metadata
953
+ Date formats: `YYYY`, `YYYY-MM`, `YYYY-MM-DD`, `YYYY-MM-DD HH:MM`
954
+ Duration units: `min`, `h`, `d`, `w`, `m`, `y`
1179
955
 
1180
- Minimal example:
956
+ ### 14.3 Eras
1181
957
 
958
+ **Flat form:**
1182
959
  ```
1183
- sitemap
1184
-
1185
- Home
1186
- -about-> About
1187
- -blog-> Blog
1188
-
1189
- [Content]
1190
- About
1191
- Blog
1192
- -read-> Post
1193
- Post
960
+ era 1716 -> 1718 Nassau Republic
1194
961
  ```
1195
962
 
1196
- Full example:
1197
-
963
+ **Block form:**
964
+ ```
965
+ era
966
+ 1716 -> 1718 Nassau Republic
967
+ 1718 -> 1720 Woodes Rogers Era (orange)
1198
968
  ```
1199
- sitemap SaaS Platform
1200
- direction TB
1201
-
1202
- tag Auth
1203
- Public(green)
1204
- Required(blue)
1205
- Admin(red)
1206
969
 
1207
- tag Type
1208
- Landing(purple)
1209
- Form(orange)
1210
- Content(cyan)
970
+ ### 14.4 Markers
1211
971
 
1212
- Home
1213
- Auth: Public
1214
- Type: Landing
1215
- -pricing-> Pricing
1216
- -login-> Login
1217
- -docs-> Docs
972
+ **Flat form:**
973
+ ```
974
+ marker 1718-07 Woodes Rogers arrives (orange)
975
+ ```
1218
976
 
1219
- [Marketing]
1220
- Pricing
1221
- Auth: Public
1222
- Type: Content
1223
- -sign up-> Register
977
+ **Block form:**
978
+ ```
979
+ marker
980
+ 1718-07 Woodes Rogers arrives (orange)
981
+ 1720-01 End of Golden Age (red)
982
+ ```
1224
983
 
1225
- Docs
1226
- Auth: Public
1227
- Type: Content
984
+ ### 14.5 Groups
1228
985
 
1229
- [Auth]
1230
- Login
1231
- Auth: Public
1232
- Type: Form
1233
- -success-> Dashboard
1234
- -forgot-> Reset Password
986
+ ```
987
+ [Royal Navy]
988
+ 1718-07 Woodes Rogers arrives
989
+ ```
1235
990
 
1236
- Register
1237
- Auth: Public
1238
- Type: Form
1239
- -success-> Dashboard
991
+ ---
1240
992
 
1241
- Reset Password
1242
- Auth: Public
1243
- Type: Form
1244
- -submitted-> Login
993
+ ## 15. Data Charts
1245
994
 
1246
- [App]
1247
- Dashboard
1248
- Auth: Required
1249
- Type: Landing
1250
- -projects-> Projects
1251
- -settings-> Settings
995
+ ### 15.1 Simple Charts (bar, line, pie, doughnut, area, polar-area, radar, bar-stacked)
1252
996
 
1253
- Projects
1254
- Auth: Required
1255
- Type: Content
997
+ **Declaration:** `bar [Title]`, `line [Title]`, etc.
1256
998
 
1257
- Settings
1258
- Auth: Required
1259
- Type: Form
1260
- -saved-> Dashboard
999
+ **Series:**
1000
+ ```
1001
+ series Name1 Name2
1002
+ series
1003
+ Name1
1004
+ Name2(color)
1261
1005
  ```
1262
1006
 
1263
- **Pages**: Plain labels at any indent level become page nodes.
1264
-
1265
- **Groups**: `[Group Name]` wraps indented children in a container.
1266
-
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).
1007
+ Commas between series names are optional.
1268
1008
 
1269
- **Metadata**: `Key: Value` lines attach to the parent page (displayed as card rows).
1009
+ **Data rows (space-separated, NO colon):**
1010
+ ```
1011
+ Label 100
1012
+ Label 100 200 300
1013
+ Label(color) 100
1014
+ ```
1270
1015
 
1271
- **Tag groups**: `tag Name` with colored entries same syntax as org charts.
1016
+ Commas between values are optional. Thousands commas are supported (`3,984,078.65` is a valid number).
1272
1017
 
1273
- **Direction**: `direction TB` (top-to-bottom, default) or `direction LR` (left-to-right). `orientation` is accepted as an alias for `direction`.
1018
+ **Options (space-separated, NO colon):**
1019
+ ```
1020
+ title My Chart
1021
+ xlabel X Label
1022
+ ylabel Y Label
1023
+ orientation-horizontal
1024
+ stacked
1025
+ ```
1274
1026
 
1275
- **Group metadata cascading**: `[Group Name] | key: value` pipe metadata on group headers cascades to all pages in the group.
1027
+ - `orientation-horizontal` (boolean; default is vertical bars)
1028
+ - `stacked` (boolean; default is off)
1029
+ - Legend is always shown (no option needed)
1276
1030
 
1277
- **Collapsible groups**: Groups can be collapsed/expanded in the app arrows to hidden pages re-terminate at the group boundary.
1031
+ **Labels** default to showing all parts (name + value + percent for pie-family). Disable parts individually:
1032
+ - `no-label-name` — hide name
1033
+ - `no-label-value` — hide value
1034
+ - `no-label-percent` — hide percent
1278
1035
 
1279
- ### infra
1036
+ **Eras (line/area only):**
1037
+ ```
1038
+ era Day 1 -> Day 3 Rough Seas (red)
1039
+ ```
1280
1040
 
1281
- **Syntax:** `infra [Title]`
1041
+ ### 15.2 Scatter / Bubble Charts
1282
1042
 
1283
- **Options:** `direction` (`LR` or `TB`), `orientation` (alias for `direction`)
1043
+ **Data rows (space-separated, NO colon):**
1044
+ ```
1045
+ Name x y
1046
+ Name x y size
1047
+ ```
1284
1048
 
1285
- **Data format:** Component declarations with indented properties and connections
1049
+ Commas between values are optional. Thousands commas supported.
1286
1050
 
1287
- Minimal example:
1051
+ **Categories:**
1052
+ ```
1053
+ [Caribbean](red)
1054
+ Blackbeard 90 8500
1055
+ ```
1288
1056
 
1057
+ **Options:**
1058
+ ```
1059
+ xlabel Weight
1060
+ ylabel Height
1061
+ sizelabel Crew
1062
+ no-labels
1289
1063
  ```
1290
- infra
1291
1064
 
1292
- edge
1293
- rps: 1000
1294
- -> CDN
1065
+ Labels are on by default. Use `no-labels` to hide point names.
1295
1066
 
1296
- CDN
1297
- cache-hit: 80%
1298
- -> API
1067
+ ### 15.3 Heatmap
1299
1068
 
1300
- API
1301
- instances: 2
1302
- max-rps: 400
1303
- latency-ms: 30
1069
+ **Columns:**
1070
+ ```
1071
+ columns Jan Feb Mar
1304
1072
  ```
1305
1073
 
1306
- Full example:
1074
+ Commas between column names are optional.
1307
1075
 
1076
+ **Data rows (space-separated, NO colon):**
1077
+ ```
1078
+ RowLabel 5 4 3
1308
1079
  ```
1309
- infra Production Traffic Flow
1310
- direction LR
1311
1080
 
1312
- tag Team alias t
1313
- Backend(blue)
1314
- Platform(teal)
1081
+ Commas between values are optional. Thousands commas supported.
1315
1082
 
1316
- edge
1317
- rps: 10000
1318
- -> CloudFront
1083
+ ### 15.4 Function Charts (Colon REQUIRED)
1319
1084
 
1320
- CloudFront | t: Platform
1321
- cache-hit: 80%
1322
- -> CloudArmor
1085
+ ```
1086
+ function Trajectories
1087
+ xlabel Distance
1088
+ ylabel Height
1089
+ x 0 to 250
1323
1090
 
1324
- CloudArmor | t: Platform
1325
- firewall-block: 5%
1326
- -> ALB
1091
+ 15 degrees(blue): -0.001*x^2 + 0.27*x
1092
+ 45 degrees(red): -0.003*x^2 + 0.75*x
1093
+ ```
1327
1094
 
1328
- ALB | t: Platform
1329
- -/api-> [API Pods] | split: 60%
1330
- -/purchase-> [Commerce Pods] | split: 30%
1331
- -/static-> StaticServer | split: 10%
1095
+ The colon between name and expression is **required** — both sides can contain spaces, so colon is the unambiguous delimiter.
1332
1096
 
1333
- [API Pods]
1334
- APIServer | t: Backend
1335
- instances: 3
1336
- max-rps: 500
1337
- latency-ms: 45
1338
- cb-error-threshold: 50%
1097
+ **Options:**
1098
+ - `shade` (boolean; off by default, shades area below curves when enabled)
1339
1099
 
1340
- [Commerce Pods]
1341
- PurchaseMS
1342
- instances: 1-8
1343
- max-rps: 300
1344
- latency-ms: 120
1100
+ ### 15.5 Sankey Charts
1345
1101
 
1346
- StaticServer | t: Platform
1347
- latency-ms: 5
1102
+ **Tree structure (indented, space-separated):**
1103
+ ```
1104
+ Sugar Plantations(green)
1105
+ Tortuga Distillery(orange) 3000
1106
+ Nassau Distillery 2500
1348
1107
  ```
1349
1108
 
1350
- **Entry point**: The `edge` block declares the external traffic source with `rps:` (requests per second). All downstream rps are computed automatically.
1109
+ **Explicit links:**
1110
+ ```
1111
+ Source -> Target 3500
1112
+ Source -- Target 2000
1113
+ ```
1351
1114
 
1352
- **Components**: Bare labels at indent 0 define infrastructure components. Properties are indented below:
1353
- - `cache-hit: N%` — percentage of traffic served from cache (reduces downstream flow)
1354
- - `firewall-block: N%` — percentage of traffic blocked (reduces downstream flow)
1355
- - `ratelimit-rps: N` — maximum rps allowed through (excess dropped)
1356
- - `max-rps: N` — maximum rps capacity per instance
1357
- - `instances: N` or `instances: N-M` — fixed or auto-scaling instance count
1358
- - `latency-ms: N` — per-request latency in milliseconds
1359
- - `cb-error-threshold: N%` — circuit breaker opens when overload exceeds this ratio
1360
- - `cb-latency-threshold-ms: N` — circuit breaker opens when cumulative latency exceeds this
1115
+ `->` = directed, `--` = undirected. Thousands commas supported in values.
1361
1116
 
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`
1117
+ ### 15.6 Chord Charts
1365
1118
 
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`
1119
+ ```
1120
+ Blackbeard -- Bonnet 150 // undirected
1121
+ Roberts -> Rackham 20 // directed
1122
+ ```
1371
1123
 
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.
1124
+ Thousands commas supported in values.
1373
1125
 
1374
- **Branching**: Multiple outbound connections with `split: N%` metadata. Splits must sum to 100%. Undeclared splits are evenly distributed from the remaining percentage.
1126
+ ### 15.7 Funnel Charts
1375
1127
 
1376
- **Groups**: `[Group Name]` with indented children — rendered as dashed-border containers. Edges targeting a group route to all children.
1128
+ **Data rows (space-separated, NO colon):**
1129
+ ```
1130
+ Visits 1200
1131
+ Signups 800
1132
+ Purchases 200
1133
+ ```
1377
1134
 
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.
1135
+ Thousands commas supported.
1379
1136
 
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.
1137
+ ---
1381
1138
 
1382
- **Group metadata cascading**: `[Group Name] | key: value` — pipe metadata on group headers cascades to all children, providing default tag values for contained nodes.
1139
+ ## 16. Visualizations
1383
1140
 
1384
- **Tag groups**: Same syntax as org/kanban/sitemap `tag Name alias x` with colored entries.
1141
+ ### 16.1 Slope Charts (Colon REQUIRED for data)
1385
1142
 
1386
- ### gantt
1143
+ ```
1144
+ slope Fleet Strength
1387
1145
 
1388
- **Syntax:** `gantt [Title]`
1146
+ 1715 1725
1389
1147
 
1390
- **Options:** `start` (required, `YYYY-MM-DD`), `today-marker` (`on`/`off` or `YYYY-MM-DD`), `sort` (`time`/`group`/`tag`/`tag:GroupName`), `critical-path`, `dependencies`
1148
+ Blackbeard: 40 4
1149
+ Roberts: 12 52
1150
+ ```
1391
1151
 
1392
- **Data format:** `duration Task Name` tasks with optional dependency arrows
1152
+ - Period labels on their own line, commas optional
1153
+ - Data rows: `Label: value1 value2` — colon required, commas between values optional
1154
+ - Thousands commas supported in values
1393
1155
 
1394
- Minimal example:
1156
+ ### 16.2 Wordcloud
1395
1157
 
1396
1158
  ```
1397
- start 2024-01-01
1159
+ wordcloud Pirate Skills
1160
+ rotate none
1161
+ max 50
1162
+ size 14 80
1398
1163
 
1399
- 10bd Design
1400
- -> Implementation
1401
- 20bd Implementation
1402
- -> Testing
1403
- 5bd Testing
1164
+ swordsmanship 95
1165
+ navigation 88
1404
1166
  ```
1405
1167
 
1406
- Auto-detection: Gantt charts are auto-detected when duration patterns like `10bd Design` are present — `gantt` is optional.
1168
+ - Data: space-separated only (`word value`)
1169
+ - Options: `rotate none|mixed|angled`, `max N`, `size min max`
1407
1170
 
1408
- Full example:
1171
+ ### 16.3 Arc Diagrams (Colon Before Weight)
1409
1172
 
1410
1173
  ```
1411
- gantt Project Schedule
1412
- start 2024-01-01
1413
- today-marker on
1174
+ arc Pirate Alliances
1414
1175
 
1415
- tag Team alias t
1416
- Frontend(blue)
1417
- Backend(green)
1176
+ [Caribbean](red)
1177
+ Blackbeard -> Bonnet: 8
1178
+ Blackbeard -> Vane: 5
1418
1179
 
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
1180
+ order group
1436
1181
  ```
1437
1182
 
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).
1183
+ - Link: `Source -> Target: weight` — colon before optional weight
1184
+ - Options: `order appearance|name|group|degree`
1441
1185
 
1442
- **Explicit dates**: `YYYY-MM-DD Task Name` or `YYYY-MM-DD -> 30d Task Name` (date with duration).
1186
+ ### 16.4 Venn Diagrams
1443
1187
 
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.
1457
-
1458
- **Markers**: `marker YYYY-MM-DD Label(color)` — vertical milestone lines.
1459
-
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.
1461
-
1462
- **Tag groups**: Same syntax as other diagrams — `tag Name alias x` with colored entries.
1188
+ ```
1189
+ venn Skill Overlap
1463
1190
 
1464
- ---
1191
+ Swordsmanship(red) alias sw
1192
+ Navigation(blue) alias nav
1193
+ Leadership(green) alias lead
1465
1194
 
1466
- ## Tag Groups
1195
+ sw + nav Sea Raiders
1196
+ sw + nav + lead Legendary Pirates
1197
+ ```
1467
1198
 
1468
- Define reusable metadata categories for sequence, org, kanban, C4, sitemap, infra, gantt, initiative-status, and timeline diagrams:
1199
+ - Set declaration: `Name(color) alias X`
1200
+ - Intersections: `Set1 + Set2 Label` — label follows the last set reference (no colon)
1469
1201
 
1470
- ```
1471
- tag Priority
1472
- Critical(red)
1473
- High(orange)
1474
- Medium(yellow)
1475
- Low(green) default
1202
+ ### 16.5 Quadrant Diagrams (Colon REQUIRED)
1476
1203
 
1477
- tag Team alias t
1478
- Frontend(blue)
1479
- Backend(green)
1480
1204
  ```
1205
+ quadrant Crew Assessment
1206
+ x-axis: Low Skill, High Skill
1207
+ y-axis: Low Loyalty, High Loyalty
1481
1208
 
1482
- - `tag` keyword (case-insensitive)
1483
- - Optional `alias` for shorthand in metadata: `| t: Frontend`
1484
- - `default` keyword marks the fallback value
1485
- - Indented entries with `Value(color)`
1486
-
1487
- Assign to elements via pipe metadata: `Element Name | priority: High, t: Frontend`
1209
+ top-right: Promote (green)
1210
+ top-left: Train (yellow)
1211
+ bottom-left: Maroon (red)
1212
+ bottom-right: Watch Closely (purple)
1488
1213
 
1489
- ---
1214
+ Quartermaster: 0.9 0.95
1215
+ Navigator: 0.85 0.8
1216
+ ```
1490
1217
 
1491
- ## Anti-Patterns
1492
-
1493
- **Common mistakes to avoid:**
1494
-
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)
1498
- - `async A -> B: msg` — wrong. Use `A ~msg~> B`
1499
- - `parallel else` — not supported. Use separate `parallel` blocks
1500
- - Hex colors `#ff0000` — wrong. Use named colors only: `red`, `green`, `blue`, etc.
1501
- - `->` inside labeled arrows `A -routes to /api-> B` — ambiguous. Rephrase the label
1502
- - Missing chart type for ambiguous content — when auto-detection picks the wrong type, add an explicit chart type keyword
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
1218
+ - Axis labels: `x-axis: Low, High` — colon required
1219
+ - Position labels: `top-right: Label` — colon required
1220
+ - Data points: `Label: x y` — colon required, commas between values optional
1221
+ - Thousands commas supported in values
1510
1222
 
1511
1223
  ---
1512
1224
 
1513
- ## CLI Usage
1514
-
1515
- ```bash
1516
- dgmo diagram.dgmo # PNG output (default)
1517
- dgmo diagram.dgmo -o output.svg # SVG output
1518
- dgmo diagram.dgmo -o url # Shareable URL
1519
- dgmo diagram.dgmo --palette catppuccin --theme dark
1520
- dgmo diagram.dgmo -o output.png --palette bold
1521
- ```
1225
+ ## 17. Colon Usage Summary
1226
+
1227
+ ### Constructs Where Colons Are REQUIRED
1228
+
1229
+ | Construct | Diagram Type | Example |
1230
+ |-----------|-------------|---------|
1231
+ | Pipe metadata | all | `\| key: value, key2: value2` |
1232
+ | Org metadata (indented) | org | `role: Manager` |
1233
+ | C4 metadata (indented) | c4 | `description: SPA built with React` |
1234
+ | Class field types | class | `+ name: string` |
1235
+ | Class method returns | class | `+ sail(): void` |
1236
+ | Function expressions | function | `f(x): x^2 + 1` |
1237
+ | Slope data rows | slope | `Blackbeard: 40 4` |
1238
+ | Quadrant axes | quadrant | `x-axis: Low, High` |
1239
+ | Quadrant positions | quadrant | `top-right: Promote` |
1240
+ | Quadrant data points | quadrant | `Quartermaster: 0.9 0.8` |
1241
+ | Arc link weight | arc | `Source -> Target: 8` |
1242
+ | Hide tag values | initiative-status | `hide phase:Planning` |
1243
+
1244
+ ### Colons OPTIONAL
1245
+
1246
+ | Construct | Diagram Type | Example |
1247
+ |-----------|-------------|---------|
1248
+ | Class relationship label | class | `--|> Vessel : extends` or `--|> Vessel extends` |
1249
+
1250
+ ### Colons NOT USED
1251
+
1252
+ | Construct | Diagram Type | Example |
1253
+ |-----------|-------------|---------|
1254
+ | Chart type declaration | all | `bar Title` |
1255
+ | Tag declarations | all | `tag Name alias x` |
1256
+ | Boolean options | all | `activations`, `no-activations` |
1257
+ | Key-value options | all | `start 2026-03-15`, `active-tag Team` |
1258
+ | Series declarations | data charts | `series A B C` |
1259
+ | Data rows | bar/line/pie/etc | `Label 100` |
1260
+ | Infra node properties | infra | `latency-ms 50` |
1261
+ | ER columns | er | `id int pk` |
1262
+ | Sequence messages | sequence | `A -msg-> B` |
1263
+ | Groups/containers | all | `[Group Name]` |
1264
+ | Section dividers | sequence | `== Phase ==` |
1265
+ | Comments | all | `// comment` |
1266
+ | Wordcloud data | wordcloud | `swordsmanship 95` |
1267
+ | Venn intersections | venn | `sw + nav Sea Raiders` |
1268
+
1269
+ ### The Rule
1270
+
1271
+ **Colons appear in two contexts:**
1272
+ 1. **Value assignment** — `key: value` in pipe metadata, indented tag/metadata assignment (org, c4), and hide directives
1273
+ 2. **Type/expression separation** — where labels can contain spaces and a delimiter is needed (function expressions, slope data, quadrant data, arc weights, class members)
1274
+
1275
+ **Exception**: Known-schema properties (infra node properties, ER columns) remain space-separated even though they are indented. The colon rule applies to open-ended metadata, not fixed property schemas.
1276
+
1277
+ **Colons never appear in:**
1278
+ - Directives and options (space-separated)
1279
+ - Tag declarations
1280
+ - Chart type declarations
1281
+ - Data rows for simple charts (space or comma delimited)
1282
+ - Structural syntax (groups, sections, arrows, comments)