@diagrammo/dgmo 0.31.0 → 0.32.1

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 (72) hide show
  1. package/.cursorrules +4 -1
  2. package/.github/copilot-instructions.md +4 -1
  3. package/.windsurfrules +4 -1
  4. package/SKILL.md +4 -1
  5. package/dist/advanced.cjs +1297 -358
  6. package/dist/advanced.d.cts +117 -15
  7. package/dist/advanced.d.ts +117 -15
  8. package/dist/advanced.js +1291 -358
  9. package/dist/auto.cjs +1087 -316
  10. package/dist/auto.js +98 -98
  11. package/dist/auto.mjs +1087 -316
  12. package/dist/cli.cjs +140 -140
  13. package/dist/index.cjs +1090 -397
  14. package/dist/index.js +1090 -397
  15. package/docs/ai-integration.md +4 -1
  16. package/docs/language-reference.md +282 -27
  17. package/gallery/fixtures/boxes-and-lines.dgmo +2 -2
  18. package/gallery/fixtures/c4-full.dgmo +4 -5
  19. package/gallery/fixtures/c4.dgmo +2 -3
  20. package/package.json +7 -1
  21. package/src/advanced.ts +7 -0
  22. package/src/boxes-and-lines/focus.ts +257 -0
  23. package/src/boxes-and-lines/layout-search.ts +131 -65
  24. package/src/boxes-and-lines/layout.ts +7 -1
  25. package/src/boxes-and-lines/parser.ts +19 -4
  26. package/src/boxes-and-lines/renderer.ts +54 -3
  27. package/src/c4/parser.ts +8 -7
  28. package/src/chart-type-registry.ts +129 -4
  29. package/src/chart-types.ts +4 -4
  30. package/src/chart.ts +18 -1
  31. package/src/colors.ts +225 -2
  32. package/src/cycle/parser.ts +2 -7
  33. package/src/d3.ts +67 -54
  34. package/src/diagnostics.ts +17 -0
  35. package/src/dimensions.ts +9 -13
  36. package/src/echarts.ts +42 -14
  37. package/src/er/parser.ts +6 -1
  38. package/src/gantt/parser.ts +44 -7
  39. package/src/graph/flowchart-parser.ts +77 -3
  40. package/src/graph/state-renderer.ts +2 -2
  41. package/src/infra/parser.ts +80 -0
  42. package/src/journey-map/parser.ts +8 -7
  43. package/src/kanban/parser.ts +8 -7
  44. package/src/map/context-labels.ts +134 -27
  45. package/src/map/geo.ts +10 -2
  46. package/src/map/layout.ts +259 -4
  47. package/src/map/parser.ts +2 -0
  48. package/src/map/renderer.ts +22 -11
  49. package/src/map/resolver.ts +68 -19
  50. package/src/mindmap/parser.ts +15 -7
  51. package/src/mindmap/renderer.ts +50 -12
  52. package/src/org/parser.ts +8 -7
  53. package/src/org/renderer.ts +22 -7
  54. package/src/palettes/color-utils.ts +12 -2
  55. package/src/palettes/index.ts +1 -0
  56. package/src/pert/renderer.ts +2 -2
  57. package/src/pyramid/parser.ts +2 -7
  58. package/src/quadrant/renderer.ts +2 -2
  59. package/src/raci/parser.ts +2 -7
  60. package/src/raci/renderer.ts +4 -4
  61. package/src/ring/parser.ts +2 -7
  62. package/src/sequence/parser.ts +18 -7
  63. package/src/sequence/renderer.ts +4 -4
  64. package/src/sitemap/parser.ts +8 -7
  65. package/src/sitemap/renderer.ts +2 -2
  66. package/src/tech-radar/parser.ts +2 -7
  67. package/src/timeline/renderer.ts +15 -5
  68. package/src/utils/parsing.ts +13 -1
  69. package/src/utils/scaling.ts +38 -81
  70. package/src/utils/tag-groups.ts +38 -0
  71. package/src/visualizations/parse.ts +6 -1
  72. package/src/wireframe/parser.ts +6 -1
@@ -51,9 +51,12 @@ LLMs default to Mermaid / PlantUML habits; DGMO differs. These rules prevent the
51
51
 
52
52
  - **No colons in declarations, directives, tags, or data rows.** `bar Revenue` (not `bar: Revenue`); `series Cloud blue, Legacy red` (not `series: ...`); `North 850` (not `North: 850`); `tag Team as t` (not `tag: Team`). A colon binds a value only in metadata (`key: value`), class/function type separators, and a few scoped spots — see §26.
53
53
  - **No Mermaid arrow-labels.** Put the label *between* the dashes: `A -Login-> B`, never `A -> B: Login`. Sequence: `->` sync, `~>` async; left-to-right only — no `<-` / `<~`.
54
+ - **No indented edges on a map.** Every map connection is ONE full line — `JFK ~daily~> LAX`; for a hub repeat the origin per spoke (`JFK ~daily~> LHR`, …). A bare source with indented `-> dest` legs errors as `Malformed edge`; indented legs are valid ONLY inside a `route` block (an ordered stop→stop voyage). Edge endpoints auto-create their POIs — don't add separate `poi` lines for places already in an edge.
54
55
  - **No `|` metadata delimiter** (removed 0.18.0 → `E_PIPE_OPERATOR_REMOVED`). Use same-line `Name key: value, k2: v2` or indented `key: value`. (`|` survives only in wireframe `{A | B}` dropdowns, in-arrow label text, and quoted names.)
55
56
  - **No removed participant keywords.** Do not write `X is a service` / `external` / `frontend` / `networking` / `gateway` — these were removed and error. A bare name renders the default shape; for a typed glyph use `is a person` / `is a database` / `is a queue`.
56
- - **No hex colors.** Named palette colors only: `red, orange, yellow, green, blue, purple, teal, cyan, gray, black, white`. Trailing token (`Done green`) or parenthesized suffix (`North(red) 850`).
57
+ <!-- COLORS start -->
58
+ - **Colors are a closed set of EXACTLY these 11 — nothing else is a color.** Valid colors, the complete list: `red`, `orange`, `yellow`, `green`, `blue`, `purple`, `teal`, `cyan`, `gray`, `black`, `white`. That is the entire universe of DGMO colors — there are no others. Do NOT use hex (`#1f77b4`), `rgb(...)`, `hsl(...)`, or ANY CSS color name: `crimson`, `royalblue`, `navy`, `pink`, `lime`, `magenta`, `indigo`, `gold`, `salmon`, `turquoise`, `violet`, etc. are ALL invalid — they are rejected and the element falls back to an auto-assigned color. When you want a color outside the 11, map it to the nearest one: crimson/scarlet→`red`, royalblue/navy/cobalt→`blue`, pink/magenta/violet/indigo→`purple`, lime/olive→`green`, gold/amber→`yellow`, turquoise→`teal`. Apply a color as a trailing token (`Done green`) or after a category/group bracket (`[North America] red`). Named colors are mandatory because they re-resolve per active palette + light/dark theme; a hardcoded value never would.
59
+ <!-- COLORS end -->
57
60
  - **Show-everything is the default.** Every label / value / percent renders by default. Emit `no-name` / `no-value` / `no-percent` / `no-*` ONLY when the user explicitly asks to hide something — never defensively.
58
61
  - **`//` comments only** (never `#`). **Indentation closes blocks** — never `end`.
59
62
  - **Declare before reference.** An edge target must be declared on a prior line; put metadata and edges on/under one declaration to avoid `Duplicate node` warnings.
@@ -498,6 +501,10 @@ rarely benefit. Aliases should aid comprehension, not obscure it.
498
501
 
499
502
  <!-- TYPE:sequence -->
500
503
 
504
+ <!-- TIPS start -->
505
+ **Styling tips:** stay terse — participants are created by the messages that name them, so a plain flow needs only the arrow lines (no participant declarations). Skip `is a TYPE`: the glyph is inferred from the name (`User`→actor, `*DB`→database, `Redis`→cache, `Kafka`→queue); add a declaration, a `[Group]`, or `position: N` only when it genuinely aids reading order or grouping, never as boilerplate. Give each participant a short role name; group related exchanges under `== Section ==` dividers rather than a wall of arrows; label a return arrow only when its value matters (unlabeled returns are auto-pruned). Drop a `note` where something subtle happens. When participants fall into trust or role categories, color the participants (not the messages) by category with a tag group using the named palette colors, so the boundary reads at a glance.
506
+ <!-- TIPS end -->
507
+
501
508
  ### 2.1 Participants
502
509
 
503
510
  ```
@@ -548,6 +555,21 @@ Names that previously inferred to a removed type — `AuthService`, `WebApp`, `C
548
555
  ```
549
556
 
550
557
  - Metadata goes outside brackets: `[Backend] t: Eng`
558
+ - **Color participants by category with a tag group** (§1.3). Declare the group with named palette colors, then assign each participant `<alias>: <Value>` — the tag is on the participant, not the group line or a message:
559
+
560
+ ```
561
+ tag Security as sec
562
+ public blue
563
+ trusted yellow
564
+
565
+ [Client Side]
566
+ User sec: public
567
+ Browser sec: public
568
+
569
+ [Provider]
570
+ AuthServer sec: trusted
571
+ API sec: trusted
572
+ ```
551
573
 
552
574
  ### 2.3 Messages (Arrows)
553
575
 
@@ -597,6 +619,7 @@ Content formatting:
597
619
  - `- ` prefix on indented lines = bullet points
598
620
  - Inline markdown: `**bold**`, `*italic*`, `` `code` ``
599
621
  - Links: `[text](url)` and bare URLs (auto-truncated in display)
622
+ - The note ends where the indentation does — there is **no `end` terminator** (a bare `end` line is rejected).
600
623
 
601
624
  ### 2.6 Structural Blocks
602
625
 
@@ -617,6 +640,8 @@ parallel label
617
640
 
618
641
  - `parallel` requires a label
619
642
  - Blocks nest via indentation
643
+ - **No `end`/terminator keyword** — a block closes by dedenting (like multi-line notes). `end`, `activate`/`deactivate`, and `autonumber` are not dgmo syntax (a bare `end` line is rejected); activation is controlled by the `activations` option (§2.7), not per-message keywords.
644
+ - **Tags apply to participants, not messages** — there is no per-message tag/color. Color a participant by category with `<Participant> <tagAlias>: <Value>` after declaring a `tag <Name> as <alias>` group (§1.3). Message text is just the arrow label.
620
645
 
621
646
  ### 2.7 Sequence Options
622
647
 
@@ -630,6 +655,10 @@ parallel label
630
655
 
631
656
  <!-- TYPE:infra -->
632
657
 
658
+ <!-- TIPS start -->
659
+ **Styling tips:** an infra diagram traces request traffic flowing inward from an `internet` or `edge` entry — that flow IS the diagram. **Every node MUST be reachable from an `internet`/`edge` entry by following the connections.** A node with no path back to an entry receives no traffic: it is dead, serves no purpose, and must be omitted entirely — not declared, not drawn, not even left as an island. There are no standalone nodes on an infra diagram. Before you add any node, ask "which request reaches this?" — if nothing routes to it, leave it out. Build strictly outward from the entry, one hop at a time along the request path, so the graph is connected by construction. Then: keep capabilities in properties (`latency-ms`, `max-rps`, `cache-hit`), not the node name; color by tier with a tag group so the layers read at a glance; reserve async edges (`~>`) for genuine fire-and-forget like queues or pub/sub.
660
+ <!-- TIPS end -->
661
+
633
662
  ### 4.1 Declaration
634
663
 
635
664
  ```
@@ -724,7 +753,16 @@ SearchAPI
724
753
  [Group Name] key: value
725
754
  ```
726
755
 
727
- - Bracket syntax only. Group coloring via tags.
756
+ - Bracket syntax only. Group coloring via tags. Declare a `tag <Name> as <alias>` group (§1.3), then assign a node `<alias>: <Value>` same-line:
757
+
758
+ ```
759
+ tag Team as t
760
+ Backend blue
761
+ Data green
762
+ [API]
763
+ APIServer t: Backend
764
+ BookDB t: Data
765
+ ```
728
766
  - Optional `as <alias>` postfix and same-line metadata.
729
767
  - **No nesting.** A group cannot contain another `[...]` group; only indented components.
730
768
  - Group properties (indented under the bracket line):
@@ -754,6 +792,8 @@ internet
754
792
 
755
793
  Special top-level entry points. Either name works; `internet` only accepts `rps` and the `description` is silently ignored on entry-point nodes.
756
794
 
795
+ **Reachability:** every node must have a directed path back to an `internet`/`edge` entry — that inbound traffic is the whole point of the diagram. The parser emits a `warning` for any node with no such path (`W_INFRA_UNREACHABLE`), or a single `warning` when the diagram has no entry node at all (`W_INFRA_NO_ENTRY`). These don't block rendering, but a flagged node carries no traffic and should be connected downstream of an entry or removed.
796
+
757
797
  ### 4.9 Node Descriptions
758
798
 
759
799
  ```
@@ -777,7 +817,7 @@ API Gateway
777
817
  <!-- TYPE:flowchart -->
778
818
 
779
819
  <!-- TIPS start -->
780
- **Styling tips:** label the edges out of a decision node (`-yes->`, `-no->`) so branches read unambiguously; color outcomes by category with a tag group (e.g. a `Status` group with `Approved green`, `Rejected red`) rather than coloring nodes individually; keep each node to a short action phrase.
820
+ **Styling tips:** write every connection as `Source -> Target` (or a single-line chain like `(Start) -> [Collect info] -> <Eligible?>`); write each connection on its own line. Every decision `<Question?>` MUST have at least two outgoing branches usually `-yes->`/`-no->`, but use specific labels when the choices are not binary (e.g. `-retirement->`, `-disability->`, `-survivor->`); a decision with only one branch is invalid. Begin at exactly one start terminal `(Start)` and make every path terminate at a terminal node (`(Approved)`, `(Denied)`, `(End)`). Every node MUST connect to the rest of the graph: if a node cannot be traced from the start forward to a terminal, it is invalid — remove it, never leave it floating. Flowcharts have NO tag groups, node metadata, or manual node colors — do NOT write `tag … as …`, a `s: value` suffix, or a trailing color word; node colors are assigned automatically by shape (start terminal green, end terminals red, processes blue, decisions yellow). Just pick the right shape and let color follow. Label every decision edge so branches read unambiguously; keep each node to a short action phrase and phrase every decision as a question.
781
821
  <!-- TIPS end -->
782
822
 
783
823
  ### 4.1 Declaration
@@ -797,7 +837,15 @@ flowchart [Title]
797
837
  | Subroutine | `[[Label]]` | `[[Validate]]` |
798
838
  | Document | `[Label~]` | `[Report~]` |
799
839
 
800
- - Node coloring: use tags (§1.3) — flowchart nodes have no color suffix
840
+ - Node coloring: use tags (§1.3) — flowchart nodes have no color suffix. Declare a `tag <Name> as <alias>` group, then assign a node `<alias>: <Value>` (same-line after the node):
841
+
842
+ ```
843
+ tag Status as s
844
+ Approved green
845
+ Rejected red
846
+ [Review] -yes-> [Done] s: Approved
847
+ [Review] -no-> [Reject] s: Rejected
848
+ ```
801
849
 
802
850
  ### 4.3 Arrows
803
851
 
@@ -861,6 +909,10 @@ collides with the indented-body grammar.
861
909
 
862
910
  <!-- TYPE:state -->
863
911
 
912
+ <!-- TIPS start -->
913
+ **Styling tips:** name states as nouns (`Idle`, `Loading`) and label transitions with the triggering event (`-submit->`); mark the initial and final states; color by state category with a tag group; keep transition labels to the event, not a sentence.
914
+ <!-- TIPS end -->
915
+
864
916
  ### 5.1 Declaration
865
917
 
866
918
  ```
@@ -899,6 +951,17 @@ references, and the `no-notes` opt-out (see §4.7).
899
951
 
900
952
  - `direction-tb` (boolean; default is LR)
901
953
  - `no-color` (boolean; default off — when on, all states resolve to the muted neutral fill instead of their default intent color)
954
+
955
+ **Color by state category** — declare a `tag <Name> as <alias>` group (§1.3), then assign each state `<alias>: <Value>` same-line (declare the assignments before the transitions):
956
+
957
+ ```
958
+ tag Phase as p
959
+ Active blue
960
+ Done green
961
+ Pending p: Active
962
+ Shipped p: Done
963
+ Pending -ship-> Shipped
964
+ ```
902
965
  - `solid-fill` (boolean; default off — render states with their full intent color instead of the canonical 25% tint; collapsed groups are also rendered at full saturation)
903
966
  - `no-notes` (boolean; default off — suppress all note boxes, see §4.7)
904
967
 
@@ -910,6 +973,10 @@ references, and the `no-notes` opt-out (see §4.7).
910
973
 
911
974
  <!-- TYPE:org -->
912
975
 
976
+ <!-- TIPS start -->
977
+ **Styling tips:** label each node with the name and role on separate lines, not a paragraph; let the layout build the hierarchy — don't hand-draw edges; color by department or team with a tag group; keep titles consistent (all roles, or all names).
978
+ <!-- TIPS end -->
979
+
913
980
  ### 6.1 Declaration
914
981
 
915
982
  ```
@@ -929,6 +996,23 @@ CEO
929
996
  - Node coloring: per-node indented metadata `\n color: blue` (deferred to a follow-up spec; tag groups inside org also work)
930
997
  - Same-line metadata: `Alice role: CEO, t: Exec`
931
998
 
999
+ **Color by team / department** — declare a `tag <Name> as <alias>` group (§1.3) with palette colors, then assign each person the tag as metadata (`<alias>: <Value>`, indented under the node or same-line). There is **no `#team` or roster syntax** — a `#` line is not a grouping operator and renders as a stray node:
1000
+
1001
+ ```
1002
+ tag Team as t
1003
+ Platform blue
1004
+ Product green
1005
+
1006
+ Dana Ruiz
1007
+ title: VP Engineering
1008
+ Sam Okafor
1009
+ title: Dir. Platform
1010
+ t: Platform
1011
+ Priya Nair
1012
+ title: Dir. Product Eng
1013
+ t: Product
1014
+ ```
1015
+
932
1016
  ### 6.3 Metadata (Indented, Colon REQUIRED)
933
1017
 
934
1018
  ```
@@ -959,6 +1043,10 @@ This is key-value metadata assignment, consistent with same-line metadata syntax
959
1043
 
960
1044
  <!-- TYPE:c4 -->
961
1045
 
1046
+ <!-- TIPS start -->
1047
+ **Styling tips:** name each element by its responsibility, not its technology — put the tech in the `tech` field; color by system boundary with a tag group; keep one level of abstraction per diagram (context OR container, not both); keep relationship labels to the verb of the interaction. Write relationships INDENTED under their source element (` -uses-> Other`), never as a top-level `A -uses-> B` line. Static renders (CLI, MCP) show the context level — containers/components appear only in the interactive drill-down, so author context-level diagrams for static output.
1048
+ <!-- TIPS end -->
1049
+
962
1050
  ### 7.1 Declaration
963
1051
 
964
1052
  ```
@@ -975,6 +1063,19 @@ Name is a container is a database // shape override
975
1063
  Types: `person`, `system`, `container`, `component`
976
1064
  Shape overrides: `database`, `cache`, `queue`, `cloud`, `external`
977
1065
 
1066
+ **Color by team / boundary** — declare a `tag <Name> as <alias>` group (§1.3), then assign each element `<alias>: <Value>` same-line (alongside `tech:`):
1067
+
1068
+ ```
1069
+ tag Team as t
1070
+ Frontend blue
1071
+ Backend green
1072
+ Customer is a person t: Frontend
1073
+ Shop is a system t: Backend
1074
+ containers
1075
+ WebApp is a container tech: React, t: Frontend
1076
+ API is a container tech: Node, t: Backend
1077
+ ```
1078
+
978
1079
  ### 7.3 Element Metadata (Indented, Colon REQUIRED)
979
1080
 
980
1081
  ```
@@ -1041,6 +1142,10 @@ Database is a container description: PostgreSQL with read replicas
1041
1142
 
1042
1143
  <!-- TYPE:er -->
1043
1144
 
1145
+ <!-- TIPS start -->
1146
+ **Styling tips:** name entities in the singular (`Customer`, not `Customers`); mark keys (`pk`, `fk`) and show only the columns that carry the relationship story; let the crow's-feet express cardinality instead of restating it in text; group related entities by color.
1147
+ <!-- TIPS end -->
1148
+
1044
1149
  ### 8.1 Declaration
1045
1150
 
1046
1151
  ```
@@ -1091,6 +1196,10 @@ Cardinality symbols: `1` (one), `*` (many), `?` (optional)
1091
1196
 
1092
1197
  <!-- TYPE:class -->
1093
1198
 
1199
+ <!-- TIPS start -->
1200
+ **Styling tips:** show only the members that serve the diagram's point, not every field; mark visibility (`+`/`-`); express connections with relationships (inheritance, composition) rather than restating them in notes; group related classes by color.
1201
+ <!-- TIPS end -->
1202
+
1094
1203
  ### 9.1 Declaration
1095
1204
 
1096
1205
  ```
@@ -1169,6 +1278,10 @@ Optional label: `--|> Vessel : extends` (colon optional before label)
1169
1278
 
1170
1279
  <!-- TYPE:kanban -->
1171
1280
 
1281
+ <!-- TIPS start -->
1282
+ **Styling tips:** name columns for workflow stages (`Todo`, `Doing`, `Done`); keep card titles to a short task phrase; color cards by owner or priority with a tag group; let column length convey WIP instead of annotating counts. If you use a tag group, tag EVERY card — an untagged card currently inherits the first tag value (mislabeling it), so omit the tag group entirely for an uncolored board.
1283
+ <!-- TIPS end -->
1284
+
1172
1285
  ### 10.1 Declaration
1173
1286
 
1174
1287
  ```
@@ -1179,6 +1292,17 @@ kanban [Title]
1179
1292
 
1180
1293
  Columns represent workflow stages and must flow left-to-right from least-done to most-done (e.g., Backlog → In Progress → Done). Every column should be a stage that cards pass through. Don't create columns for non-workflow concepts like gates, criteria, or definitions of done — use a tag instead (e.g., `type: Gate`).
1181
1294
 
1295
+ **Color cards by owner / priority** — declare a `tag <Name> as <alias>` group (§1.3), then assign each card `<alias>: <Value>` in its same-line metadata:
1296
+
1297
+ ```
1298
+ tag Crew as c
1299
+ Alice blue
1300
+ Bob green
1301
+ [Todo]
1302
+ Task one c: Alice
1303
+ Task two c: Bob
1304
+ ```
1305
+
1182
1306
  ```
1183
1307
  [Column Name]
1184
1308
  [Column Name] color wip: 3
@@ -1203,6 +1327,10 @@ Columns represent workflow stages and must flow left-to-right from least-done to
1203
1327
 
1204
1328
  <!-- TYPE:sitemap -->
1205
1329
 
1330
+ <!-- TIPS start -->
1331
+ **Styling tips:** Mirror the real navigation: group child pages under their section and keep the tree shallow (2–3 levels), ordering siblings by prominence. Connect pages with indented `-> Target` lines under each parent (a top-level `Home -> Products` renders as one box) and declare every target as its own page.
1332
+ <!-- TIPS end -->
1333
+
1206
1334
  ### 11.1 Declaration
1207
1335
 
1208
1336
  ```
@@ -1279,6 +1407,10 @@ Blog
1279
1407
 
1280
1408
  <!-- TYPE:gantt -->
1281
1409
 
1410
+ <!-- TIPS start -->
1411
+ **Styling tips:** group tasks under labeled phases; mark milestones as zero-duration; color by workstream or status with a tag group; keep task names to a short verb phrase; draw dependencies only where they actually drive the schedule.
1412
+ <!-- TIPS end -->
1413
+
1282
1414
  ### 12.1 Declaration
1283
1415
 
1284
1416
  ```
@@ -1296,6 +1428,17 @@ no-dependencies
1296
1428
  sort tag:Team
1297
1429
  ```
1298
1430
 
1431
+ **Color by workstream / status** — declare a `tag <Name> as <alias>` group (§1.3), then assign each task `<alias>: <Value>` in its same-line metadata:
1432
+
1433
+ ```
1434
+ tag Phase as p
1435
+ Build blue
1436
+ Test green
1437
+ [Tasks]
1438
+ Design 5d p: Build
1439
+ QA 3d p: Test
1440
+ ```
1441
+
1299
1442
  ### 12.3 Holidays
1300
1443
 
1301
1444
  ```
@@ -1397,6 +1540,10 @@ want; anything left un-chained starts together at the parent's start.
1397
1540
 
1398
1541
  <!-- TYPE:pert -->
1399
1542
 
1543
+ <!-- TIPS start -->
1544
+ **Styling tips:** Name each task as a short action and wire the real finish-to-start dependencies — branch and merge them so the critical path and per-task slack become meaningful. Give one most-likely estimate per task (the engine derives optimistic/pessimistic), or explicit O/M/P when you know them.
1545
+ <!-- TIPS end -->
1546
+
1400
1547
  PERT diagrams visualize project networks with three-point duration estimates, surfacing critical path, slack, and project μ/σ. Each activity renders as a node card (rectangle, or diamond for milestones); dependencies are arrows between them. Monte Carlo simulation runs automatically whenever any activity carries duration data.
1401
1548
 
1402
1549
  ```
@@ -1559,6 +1706,10 @@ See spec §13A for full date-anchoring semantics, S-curve axes, and diagnostic c
1559
1706
 
1560
1707
  <!-- TYPE:boxes-and-lines -->
1561
1708
 
1709
+ <!-- TIPS start -->
1710
+ **Styling tips:** Show one clear direction of flow; group related boxes with a `[Group]` bracket and label each edge with the relationship rather than a bare arrow. Keep every box a short noun phrase.
1711
+ <!-- TIPS end -->
1712
+
1562
1713
  ### 13.1 Declaration
1563
1714
 
1564
1715
  ```
@@ -1698,45 +1849,65 @@ Flagship -> Sloop
1698
1849
 
1699
1850
  <!-- TYPE:timeline -->
1700
1851
 
1852
+ <!-- TIPS start -->
1853
+ **Styling tips:** label each event with a date and a terse headline; keep entries in chronological order; color by era or category with a tag group; merge minor events rather than crowding the axis.
1854
+ <!-- TIPS end -->
1855
+
1701
1856
  ### 14.1 Declaration
1702
1857
 
1703
1858
  ```
1704
1859
  timeline [Title]
1705
1860
  ```
1706
1861
 
1862
+ **Color by era / category** — declare a `tag <Name> as <alias>` group (§1.3), then assign each event `<alias>: <Value>` same-line:
1863
+
1864
+ ```
1865
+ tag Era as t
1866
+ Ancient blue
1867
+ Modern green
1868
+ 1500 Founding t: Ancient
1869
+ 2000 Boom t: Modern
1870
+ ```
1871
+
1707
1872
  ### 14.2 Events
1708
1873
 
1709
- Events use **name-first syntax** with `start:`, `end:`, and `duration:` as reserved metadata keys.
1874
+ Events use **date-first syntax** the date (or date range) leads, then the event name, with optional trailing same-line metadata (§1.4).
1710
1875
 
1711
- **Point event** (`start:` only):
1876
+ **Point event** (single date):
1712
1877
 
1713
1878
  ```
1714
- Blockades Charleston start: 1718-05, p: Blackbeard
1879
+ 1718-05 Blockades Charleston p: Blackbeard
1715
1880
  ```
1716
1881
 
1717
- **Range event** (`start:` + `end:`):
1882
+ **Range event** (`->` between dates, spaces optional):
1718
1883
 
1719
1884
  ```
1720
- Sails under Hornigold start: 1716, end: 1717, p: Blackbeard
1885
+ 1716 -> 1717 Sails under Hornigold p: Blackbeard
1721
1886
  ```
1722
1887
 
1723
- **Duration event** (`start:` + `duration:`):
1888
+ **Duration event** (date + name + `duration:` metadata):
1724
1889
 
1725
1890
  ```
1726
- Sprint 1 start: 2026-03-20, duration: 30d
1891
+ 2026-03-20 Sprint 1 duration: 30d
1727
1892
  ```
1728
1893
 
1729
- **Uncertain ending** (`?` suffix on `end:` or `duration:`):
1894
+ **Datetime** (date with `HH:MM` time component):
1730
1895
 
1731
1896
  ```
1732
- Rackham builds crew start: 1718, end: 1719?
1897
+ 2026-03-20 14:30 Standup Meeting
1733
1898
  ```
1734
1899
 
1735
- Event type is determined by key presence:
1900
+ **Uncertain ending** (`?` suffix on end date or duration value):
1901
+
1902
+ ```
1903
+ 1718 -> 1719? Rackham builds crew
1904
+ ```
1736
1905
 
1737
- - `start:` only point event
1738
- - `start:` + `end:` → range event
1739
- - `start:` + `duration:` duration event
1906
+ Event type is determined by positional structure:
1907
+
1908
+ - single datepoint event
1909
+ - `date -> date` → range event
1910
+ - single date + `duration:` → duration event
1740
1911
 
1741
1912
  Date formats: `YYYY`, `YYYY-MM`, `YYYY-MM-DD`, `YYYY-MM-DD HH:MM`
1742
1913
  Duration units: `min`, `h`, `d`, `w`, `m`, `y`
@@ -1777,7 +1948,7 @@ marker
1777
1948
 
1778
1949
  ```
1779
1950
  [Royal Navy]
1780
- Woodes Rogers arrives start: 1718-07
1951
+ 1718-07 Woodes Rogers arrives
1781
1952
  ```
1782
1953
 
1783
1954
  ---
@@ -1786,6 +1957,10 @@ marker
1786
1957
 
1787
1958
  <!-- TYPE:bar -->
1788
1959
 
1960
+ <!-- TIPS start -->
1961
+ **Styling tips:** pick the form from the question — `bar` to compare categories, `line` for a trend over time, `pie`/`doughnut` only for parts of one whole (≤6 slices); sort bars by value unless the category order is inherent (time, size); give one highlighted series a distinct color and keep the rest neutral; always label units.
1962
+ <!-- TIPS end -->
1963
+
1789
1964
  ### Conventions shared across all data charts
1790
1965
 
1791
1966
  Every section under §15 follows the same two rules.
@@ -1876,6 +2051,10 @@ era Day 1 -> Day 3 Rough Seas red
1876
2051
 
1877
2052
  <!-- TYPE:scatter -->
1878
2053
 
2054
+ <!-- TIPS start -->
2055
+ **Styling tips:** label both axes with units; group points into categories with `[Category] color` brackets (points indented under each) so clusters read at a glance — scatter colors by bracketed category, not by a tag group; reach for a second category only when the comparison is the point; keep marker labels off unless a few outliers need calling out.
2056
+ <!-- TIPS end -->
2057
+
1879
2058
  **Data rows** — follows §15 Rule A (space-separated):
1880
2059
 
1881
2060
  ```
@@ -1905,6 +2084,10 @@ Point names render by default. Use `no-name` to hide them.
1905
2084
 
1906
2085
  <!-- TYPE:heatmap -->
1907
2086
 
2087
+ <!-- TIPS start -->
2088
+ **Styling tips:** Sort rows and columns by their totals (not alphabetically) so the strongest cells gather in one corner and the high-to-low pattern reads at a glance; keep every cell on the same numeric scale so the colors stay comparable.
2089
+ <!-- TIPS end -->
2090
+
1908
2091
  **Columns** — follows §15 Rule B (prefer the indented block for multiple columns):
1909
2092
 
1910
2093
  ```
@@ -1926,6 +2109,10 @@ RowLabel 5 4 3
1926
2109
 
1927
2110
  <!-- TYPE:function -->
1928
2111
 
2112
+ <!-- TIPS start -->
2113
+ **Styling tips:** Pick a domain (`x <min> to <max>`) that frames the interesting behavior and keep to a few curves for legibility. Give each curve a short readable name before the colon (`Sine: sin(x)`), not the expression repeated.
2114
+ <!-- TIPS end -->
2115
+
1929
2116
  ```
1930
2117
  function Trajectories
1931
2118
  x-label Distance
@@ -1946,6 +2133,10 @@ The colon between name and expression is **required** — both sides can contain
1946
2133
 
1947
2134
  <!-- TYPE:sankey -->
1948
2135
 
2136
+ <!-- TIPS start -->
2137
+ **Styling tips:** Feed flows in process order (left to right) and let each connection’s value set its band width — the layout already orders nodes to reduce crossings. Fold flows into one "Other" band only when many are individually negligible; never rename a single meaningful node.
2138
+ <!-- TIPS end -->
2139
+
1949
2140
  **Tree structure (indented, space-separated):**
1950
2141
 
1951
2142
  ```
@@ -1967,6 +2158,10 @@ Source -- Target 2000
1967
2158
 
1968
2159
  <!-- TYPE:chord -->
1969
2160
 
2161
+ <!-- TIPS start -->
2162
+ **Styling tips:** Chord shines for genuinely reciprocal, many-to-many relationships; if your flows are mostly one-directional or hub-and-spoke, a sankey reads clearer. List heavily-connected nodes consecutively — arcs follow first-appearance order, so this keeps the thickest ribbons short.
2163
+ <!-- TIPS end -->
2164
+
1970
2165
  ```
1971
2166
  Blackbeard -- Bonnet 150 // undirected
1972
2167
  Roberts -> Rackham 20 // directed
@@ -1978,6 +2173,10 @@ Values follow §15 Rule A.
1978
2173
 
1979
2174
  <!-- TYPE:funnel -->
1980
2175
 
2176
+ <!-- TIPS start -->
2177
+ **Styling tips:** order stages largest→smallest, top to bottom; keep each stage name to a noun phrase; let the stages auto-color (each gets a distinct hue — no tag group needed); cap it at ~6 stages and merge minor drop-offs rather than crowding.
2178
+ <!-- TIPS end -->
2179
+
1981
2180
  **Data rows** — follows §15 Rule A (space-separated):
1982
2181
 
1983
2182
  ```
@@ -1994,6 +2193,10 @@ Purchases 200
1994
2193
 
1995
2194
  <!-- TYPE:slope -->
1996
2195
 
2196
+ <!-- TIPS start -->
2197
+ **Styling tips:** Slope auto-labels both endpoints and colors each line — recolor only when one line is the story, then color just that mover and leave the rest to the default palette. It compares exactly two periods; use a line chart for more.
2198
+ <!-- TIPS end -->
2199
+
1997
2200
  ```
1998
2201
  slope Fleet Strength
1999
2202
 
@@ -2018,6 +2221,10 @@ Roberts 12 52
2018
2221
 
2019
2222
  <!-- TYPE:wordcloud -->
2020
2223
 
2224
+ <!-- TIPS start -->
2225
+ **Styling tips:** Make the largest and smallest terms differ enough in size to read at a glance — set an explicit `size <min> <max>` when raw weights are bunched together. Keep to the signal terms: cap the list (~30–40) and drop filler words.
2226
+ <!-- TIPS end -->
2227
+
2021
2228
  ```
2022
2229
  wordcloud Pirate Skills
2023
2230
  rotate none
@@ -2035,6 +2242,10 @@ navigation 88
2035
2242
 
2036
2243
  <!-- TYPE:arc -->
2037
2244
 
2245
+ <!-- TIPS start -->
2246
+ **Styling tips:** Set `order appearance` and list links so the busiest pairs sit next to each other — heavy connections then read as short arcs hugging the axis instead of long sweeps (otherwise placement is automatic and row order is ignored).
2247
+ <!-- TIPS end -->
2248
+
2038
2249
  ```
2039
2250
  arc Pirate Alliances
2040
2251
 
@@ -2052,6 +2263,10 @@ order group
2052
2263
 
2053
2264
  <!-- TYPE:venn -->
2054
2265
 
2266
+ <!-- TIPS start -->
2267
+ **Styling tips:** Use 2–3 sets and write the count of each meaningful overlap directly on its intersection; circle area is NOT proportional, so the numbers — not the sizes — carry the comparison.
2268
+ <!-- TIPS end -->
2269
+
2055
2270
  ```
2056
2271
  venn Skill Overlap
2057
2272
 
@@ -2071,6 +2286,10 @@ sw + nav + lead Legendary Pirates
2071
2286
 
2072
2287
  <!-- TYPE:quadrant -->
2073
2288
 
2289
+ <!-- TIPS start -->
2290
+ **Styling tips:** Name the four quadrants as meaningful categories (not just positions) and call out the outliers; normalize values to 0–1 so the points spread across the whole space.
2291
+ <!-- TIPS end -->
2292
+
2074
2293
  ```
2075
2294
  quadrant Crew Assessment
2076
2295
  x-label Low Skill, High Skill
@@ -2095,6 +2314,10 @@ Navigator 0.85 0.8
2095
2314
 
2096
2315
  <!-- TYPE:mindmap -->
2097
2316
 
2317
+ <!-- TIPS start -->
2318
+ **Styling tips:** keep each node to 1–3 words; let depth carry the structure — don't echo a parent's word in its child; color the top-level branches distinctly with a tag group; favor breadth over long single chains.
2319
+ <!-- TIPS end -->
2320
+
2098
2321
  A radial hierarchy of ideas branching out from a central root. Hierarchy is established by indentation, nodes accept descriptions and tag-driven coloring, and any subtree can be collapsed by default.
2099
2322
 
2100
2323
  ```
@@ -2223,6 +2446,10 @@ Universal options (`palette`, `theme`) apply as elsewhere.
2223
2446
 
2224
2447
  <!-- TYPE:wireframe -->
2225
2448
 
2449
+ <!-- TIPS start -->
2450
+ **Styling tips:** Keep it low-fidelity — boxes, labels, and one primary action `(Sign in) primary` per screen, grouped by region. Links are bare text (`Forgot password?`); `[brackets]` is an input field.
2451
+ <!-- TIPS end -->
2452
+
2226
2453
  Wireframe diagrams use **visual-mnemonic syntax** where bracket characters communicate element type.
2227
2454
 
2228
2455
  ### Declaration
@@ -2357,6 +2584,10 @@ wireframe Login Page
2357
2584
 
2358
2585
  <!-- TYPE:tech-radar -->
2359
2586
 
2587
+ <!-- TIPS start -->
2588
+ **Styling tips:** Group blips into the four domain quadrants and let the rings carry adoption stage (Adopt→Hold); annotate movement with a `trend`. When the source is a numeric score, bucket it into a ring and keep the number in the description.
2589
+ <!-- TIPS end -->
2590
+
2360
2591
  ```
2361
2592
  tech-radar Title
2362
2593
 
@@ -2425,6 +2656,10 @@ Blips receive sequential global numbers. Order: quadrants clockwise (top-left
2425
2656
 
2426
2657
  <!-- TYPE:cycle -->
2427
2658
 
2659
+ <!-- TIPS start -->
2660
+ **Styling tips:** Aim for 3–6 stages so the loop stays legible; name each as a short step and let the closed ring imply repetition (no wrap-around edge needed). An indented line adds a description.
2661
+ <!-- TIPS end -->
2662
+
2428
2663
  Circular process flows where nodes sit on a ring and directed edges connect each to the next, wrapping from last back to first. Common use: OODA loops, PDCA, product lifecycles, continuous improvement.
2429
2664
 
2430
2665
  ### Declaration
@@ -2558,6 +2793,10 @@ Act red
2558
2793
 
2559
2794
  <!-- TYPE:journey-map -->
2560
2795
 
2796
+ <!-- TIPS start -->
2797
+ **Styling tips:** Label a single-word `emotion:` on each step so the highs and lows are named, not just shaped; give one concrete action per stage and name the persona. Mark the trough with `pain:` and the peak with `opportunity:` so the arc’s meaning lands.
2798
+ <!-- TIPS end -->
2799
+
2561
2800
  Persona-centric mood landscapes. Steps carry a 1–5 score and optional emotion label; the renderer draws an emotion curve over phase-grouped step cards. **Declaration is required** — the `journey-map` keyword must appear on the first line (no inference, to avoid colliding with kanban's `[Column]` + indented items shape).
2562
2801
 
2563
2802
  ### Declaration
@@ -2683,6 +2922,10 @@ Got resolution score: 5, emotion: Relieved
2683
2922
 
2684
2923
  <!-- TYPE:pyramid -->
2685
2924
 
2925
+ <!-- TIPS start -->
2926
+ **Styling tips:** Keep to a few tiers (3–5), widest at the base, and label each tier with its value — bands are uniform height, so the number carries the magnitude. For a funnel-shaped dataset, list the smallest stage first.
2927
+ <!-- TIPS end -->
2928
+
2686
2929
  Hierarchical pyramid visualization with stacked layers, descriptions, and optional per-layer color. Source order reads apex-first (top of file = top of pyramid).
2687
2930
 
2688
2931
  ### Declaration
@@ -2746,6 +2989,10 @@ When descriptions don't fit a layer's band the renderer wraps at the column edge
2746
2989
 
2747
2990
  <!-- TYPE:ring -->
2748
2991
 
2992
+ <!-- TIPS start -->
2993
+ **Styling tips:** Order rings core→outward by hierarchy, not by size — band thickness is uniform and carries no proportional meaning (use pie/funnel for part-of-whole). Keep any value you want read at a glance in the ring’s own label.
2994
+ <!-- TIPS end -->
2995
+
2749
2996
  Concentric-ring visualization for nested or hierarchical categories. Source order reads core-out: top of file = innermost element (rendered as a filled disc), last line = outermost ring. Min 2 layers, max 15.
2750
2997
 
2751
2998
  ### Declaration
@@ -2815,6 +3062,10 @@ When ring band thickness would force the in-band label below the readable floor
2815
3062
 
2816
3063
  <!-- TYPE:raci -->
2817
3064
 
3065
+ <!-- TIPS start -->
3066
+ **Styling tips:** Put each task at indent-0 with its `Role: A/R/C/I` cells indented one level under it — never nest tasks inside the `roles` block (it swallows them). Give every task exactly one Accountable (ideally one Responsible) and keep roles small (≤~6) so the matrix stays scannable.
3067
+ <!-- TIPS end -->
3068
+
2818
3069
  A tasks × roles responsibility matrix with author-time linting. **One chart type — `raci` — covers all three variants.** Variant is inferred from the markers used; an optional `variant-*` directive locks it explicitly.
2819
3070
 
2820
3071
  | Variant | Marker alphabet | Constraint |
@@ -2869,13 +3120,15 @@ roles
2869
3120
  raci Choose the next port
2870
3121
  roles Cap, Nav, QM, Bos
2871
3122
 
2872
- Pick destination
2873
- Cap: D
2874
- Nav: A
2875
- QM: C
2876
- Bos: I
3123
+ Pick destination
3124
+ Cap: D
3125
+ Nav: A
3126
+ QM: C
3127
+ Bos: I
2877
3128
  ```
2878
3129
 
3130
+ > Without a `[Phase]` header, put each task at **indent-0** and its role cells one level in (as above). Only nest tasks under a phase when a `[Phase]` header is present — otherwise the indented `roles` block greedily swallows the following lines.
3131
+
2879
3132
  ### Directives
2880
3133
 
2881
3134
  | Directive | Effect |
@@ -2906,7 +3159,7 @@ Markers in cells are always **rendered in canonical alphabet order** (`R A C I`,
2906
3159
  <!-- TYPE:map -->
2907
3160
 
2908
3161
  <!-- TIPS start -->
2909
- **Styling tips:** the zero-config map already looks good — name places and stop. When POIs fall into categories, tag them so each category gets its own color; keep place labels to the place name; leave region colorize and coastlines on unless the user asks to hide them.
3162
+ **Styling tips:** the zero-config map already looks good — name places and stop. When POIs fall into categories, tag them so each category gets its own color; keep place labels to the place name; leave region colorize and coastlines on unless the user asks to hide them. **For routes/flows from a hub** (e.g. an airport's daily flights, a distribution center's shipments), write ONE edge per line and repeat the origin — `JFK ~daily~> LAX`, `JFK ~daily~> LHR`, … — never indented edges (those error). Use **arcs** (`~>`) for flights and long-haul links so the spokes separate; the connector label carries the relationship (`~daily~>`, `~2x daily~>`). Endpoints auto-create POIs, so don't add separate `poi` lines for places that already appear in an edge. Reach for a `route` block only when the trip is an **ordered voyage** that continues stop→stop (a cruise itinerary), not a set of independent routes from one origin.
2910
3163
  <!-- TIPS end -->
2911
3164
 
2912
3165
  Geographic concept maps: highlight/shade political subdivisions, drop points of interest (POIs), and connect them with routes or edges. For "share a concept" business maps, not cartography. Renders at a fixed, auto-fit position — no pan/zoom. Basemap and viewport are **inferred from the content you reference** — most maps need no directives. v1 boundaries: world countries + US states.
@@ -3005,11 +3258,13 @@ A -> B # one-off, directed
3005
3258
  A -ferry- B value: 12 # undirected line; value = line thickness
3006
3259
  A ~cable~ B # undirected arc with a label
3007
3260
  A -> B -> C # inline chain
3008
- dcw # hub/star indented edges share the source
3009
- -> office-east
3010
- -- office-west # hub legs accept any connector token
3261
+ JFK ~daily~> LAX # hub/star: ONE edge per line, repeat the origin
3262
+ JFK ~daily~> LHR # (NOT indented — indented legs are only valid
3263
+ JFK ~2x daily~> SFO # inside a `route` block, which is an ordered voyage)
3011
3264
  ```
3012
3265
 
3266
+ Each native edge is ONE full line — `<origin> <connector> <destination>`. There is no indented-edge / shared-source hub form for native edges (it errors as "Malformed edge"); to fan out from a hub, repeat the origin on each line as above. Endpoints auto-create their POIs, so a connected map needs no separate `poi` lines.
3267
+
3013
3268
  There is no geographic path-finding and no `surface:` — legs are plain straight or arced geometry (`style: arc` to bow one) and may cross land.
3014
3269
 
3015
3270
  **Tagging the line.** A tag value on any connector or route leg colours the **line itself** (the universal tag model applied to edges) — the "trip-leg type" idiom. Edge-only tag groups show in the legend as a line-colour key; hovering a legend entry dims the lines that don't match. To categorise a **stop** instead, tag its own `poi` line. An edge-only tag group never tints regions or suppresses the colorize dress.