@diagrammo/dgmo 0.8.3 → 0.8.5

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 (122) hide show
  1. package/.claude/commands/dgmo-diagram-this.md +60 -0
  2. package/.claude/commands/dgmo-document-project.md +128 -0
  3. package/.claude/commands/dgmo.md +452 -50
  4. package/.cursorrules +32 -37
  5. package/.github/copilot-instructions.md +35 -44
  6. package/.windsurfrules +32 -37
  7. package/README.md +4 -4
  8. package/dist/cli.cjs +188 -185
  9. package/dist/editor.cjs +338 -0
  10. package/dist/editor.cjs.map +1 -0
  11. package/dist/editor.d.cts +27 -0
  12. package/dist/editor.d.ts +27 -0
  13. package/dist/editor.js +307 -0
  14. package/dist/editor.js.map +1 -0
  15. package/dist/highlight.cjs +560 -0
  16. package/dist/highlight.cjs.map +1 -0
  17. package/dist/highlight.d.cts +32 -0
  18. package/dist/highlight.d.ts +32 -0
  19. package/dist/highlight.js +530 -0
  20. package/dist/highlight.js.map +1 -0
  21. package/dist/index.cjs +3467 -1078
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.cts +22 -1
  24. package/dist/index.d.ts +22 -1
  25. package/dist/index.js +3466 -1078
  26. package/dist/index.js.map +1 -1
  27. package/docs/language-reference.md +46 -37
  28. package/gallery/fixtures/arc.dgmo +18 -0
  29. package/gallery/fixtures/area.dgmo +19 -0
  30. package/gallery/fixtures/bar-stacked.dgmo +10 -0
  31. package/gallery/fixtures/bar.dgmo +10 -0
  32. package/gallery/fixtures/c4-full.dgmo +52 -0
  33. package/gallery/fixtures/c4.dgmo +17 -0
  34. package/gallery/fixtures/chord.dgmo +12 -0
  35. package/gallery/fixtures/class-basic.dgmo +14 -0
  36. package/gallery/fixtures/class-full.dgmo +43 -0
  37. package/gallery/fixtures/doughnut.dgmo +8 -0
  38. package/gallery/fixtures/flowchart-basic.dgmo +3 -0
  39. package/gallery/fixtures/flowchart-colors.dgmo +5 -0
  40. package/gallery/fixtures/flowchart-complex.dgmo +17 -0
  41. package/gallery/fixtures/flowchart-decision.dgmo +5 -0
  42. package/gallery/fixtures/flowchart-full.dgmo +13 -0
  43. package/gallery/fixtures/flowchart-groups.dgmo +10 -0
  44. package/gallery/fixtures/flowchart-loop.dgmo +7 -0
  45. package/gallery/fixtures/flowchart-nested.dgmo +7 -0
  46. package/gallery/fixtures/flowchart-shapes.dgmo +5 -0
  47. package/gallery/fixtures/function.dgmo +8 -0
  48. package/gallery/fixtures/funnel.dgmo +7 -0
  49. package/gallery/fixtures/gantt-full.dgmo +49 -0
  50. package/gallery/fixtures/gantt.dgmo +42 -0
  51. package/gallery/fixtures/heatmap.dgmo +8 -0
  52. package/gallery/fixtures/infra-full.dgmo +78 -0
  53. package/gallery/fixtures/infra-overload.dgmo +25 -0
  54. package/gallery/fixtures/infra.dgmo +47 -0
  55. package/gallery/fixtures/initiative-status-full.dgmo +46 -0
  56. package/gallery/fixtures/initiative-status-phases.dgmo +29 -0
  57. package/gallery/fixtures/initiative-status.dgmo +9 -0
  58. package/gallery/fixtures/line.dgmo +19 -0
  59. package/gallery/fixtures/multi-line.dgmo +11 -0
  60. package/gallery/fixtures/org-basic.dgmo +16 -0
  61. package/gallery/fixtures/org-full.dgmo +69 -0
  62. package/gallery/fixtures/org-teams.dgmo +25 -0
  63. package/gallery/fixtures/pie.dgmo +9 -0
  64. package/gallery/fixtures/polar-area.dgmo +8 -0
  65. package/gallery/fixtures/quadrant.dgmo +18 -0
  66. package/gallery/fixtures/radar.dgmo +8 -0
  67. package/gallery/fixtures/sankey.dgmo +31 -0
  68. package/gallery/fixtures/scatter.dgmo +21 -0
  69. package/gallery/fixtures/sequence-tags-protocols.dgmo +45 -0
  70. package/gallery/fixtures/sequence-tags.dgmo +41 -0
  71. package/gallery/fixtures/sequence.dgmo +35 -0
  72. package/gallery/fixtures/sitemap-basic.dgmo +12 -0
  73. package/gallery/fixtures/sitemap-full.dgmo +156 -0
  74. package/gallery/fixtures/slope.dgmo +9 -0
  75. package/gallery/fixtures/spr-eras.dgmo +62 -0
  76. package/gallery/fixtures/state.dgmo +30 -0
  77. package/gallery/fixtures/timeline-intraday.dgmo +14 -0
  78. package/gallery/fixtures/timeline.dgmo +32 -0
  79. package/gallery/fixtures/venn.dgmo +10 -0
  80. package/gallery/fixtures/wordcloud.dgmo +24 -0
  81. package/package.json +71 -2
  82. package/src/c4/layout.ts +372 -90
  83. package/src/c4/parser.ts +100 -55
  84. package/src/chart.ts +91 -28
  85. package/src/class/parser.ts +41 -12
  86. package/src/cli.ts +211 -62
  87. package/src/completion.ts +378 -183
  88. package/src/d3.ts +1044 -303
  89. package/src/dgmo-mermaid.ts +16 -13
  90. package/src/dgmo-router.ts +69 -23
  91. package/src/echarts.ts +646 -153
  92. package/src/editor/dgmo.grammar +69 -0
  93. package/src/editor/dgmo.grammar.d.ts +2 -0
  94. package/src/editor/dgmo.grammar.js +18 -0
  95. package/src/editor/dgmo.grammar.terms.d.ts +5 -0
  96. package/src/editor/dgmo.grammar.terms.js +35 -0
  97. package/src/editor/highlight-api.ts +444 -0
  98. package/src/editor/highlight.ts +36 -0
  99. package/src/editor/index.ts +28 -0
  100. package/src/editor/keywords.ts +222 -0
  101. package/src/editor/tokens.ts +30 -0
  102. package/src/er/parser.ts +48 -14
  103. package/src/er/renderer.ts +112 -53
  104. package/src/gantt/calculator.ts +91 -29
  105. package/src/gantt/parser.ts +197 -71
  106. package/src/gantt/renderer.ts +1120 -350
  107. package/src/graph/flowchart-parser.ts +46 -25
  108. package/src/graph/state-parser.ts +47 -17
  109. package/src/index.ts +96 -31
  110. package/src/infra/parser.ts +157 -53
  111. package/src/infra/renderer.ts +723 -271
  112. package/src/initiative-status/parser.ts +138 -44
  113. package/src/kanban/parser.ts +25 -14
  114. package/src/org/layout.ts +111 -44
  115. package/src/org/parser.ts +69 -22
  116. package/src/palettes/index.ts +3 -2
  117. package/src/sequence/parser.ts +193 -61
  118. package/src/sitemap/parser.ts +65 -29
  119. package/src/utils/arrows.ts +2 -22
  120. package/src/utils/duration.ts +39 -21
  121. package/src/utils/legend-constants.ts +0 -2
  122. package/src/utils/parsing.ts +75 -31
@@ -28,6 +28,11 @@ Syntax changes introduced in the consistency cleanup. Old forms now produce erro
28
28
  | `show-sub-node-count: yes` | `show-sub-node-count` (flag) | Org |
29
29
  | `import: path` | `import path` | Org |
30
30
  | `tags: path` | `tags path` | Org |
31
+ | `xlabel` | `x-label` | Data charts, function |
32
+ | `ylabel` | `y-label` | Data charts, function |
33
+ | `sizelabel` | `size-label` | Scatter/bubble |
34
+ | `x-axis` | `x-label` | Quadrant |
35
+ | `y-axis` | `y-label` | Quadrant |
31
36
 
32
37
  ---
33
38
 
@@ -420,7 +425,7 @@ Bracket syntax only.
420
425
 
421
426
  ### 4.6 Options
422
427
 
423
- - `direction-tb` (boolean; default is LR)
428
+ - `direction-lr` (boolean; default is TB)
424
429
  - `orientation-vertical` (boolean; default is horizontal)
425
430
 
426
431
  ---
@@ -1018,8 +1023,8 @@ Commas between values are optional. Thousands commas are supported (`3,984,078.6
1018
1023
  **Options (space-separated, NO colon):**
1019
1024
  ```
1020
1025
  title My Chart
1021
- xlabel X Label
1022
- ylabel Y Label
1026
+ x-label X Label
1027
+ y-label Y Label
1023
1028
  orientation-horizontal
1024
1029
  stacked
1025
1030
  ```
@@ -1056,9 +1061,9 @@ Commas between values are optional. Thousands commas supported.
1056
1061
 
1057
1062
  **Options:**
1058
1063
  ```
1059
- xlabel Weight
1060
- ylabel Height
1061
- sizelabel Crew
1064
+ x-label Weight
1065
+ y-label Height
1066
+ size-label Crew
1062
1067
  no-labels
1063
1068
  ```
1064
1069
 
@@ -1084,8 +1089,8 @@ Commas between values are optional. Thousands commas supported.
1084
1089
 
1085
1090
  ```
1086
1091
  function Trajectories
1087
- xlabel Distance
1088
- ylabel Height
1092
+ x-label Distance
1093
+ y-label Height
1089
1094
  x 0 to 250
1090
1095
 
1091
1096
  15 degrees(blue): -0.001*x^2 + 0.27*x
@@ -1138,20 +1143,27 @@ Thousands commas supported.
1138
1143
 
1139
1144
  ## 16. Visualizations
1140
1145
 
1141
- ### 16.1 Slope Charts (Colon REQUIRED for data)
1146
+ ### 16.1 Slope Charts
1142
1147
 
1143
1148
  ```
1144
1149
  slope Fleet Strength
1145
1150
 
1146
- 1715 1725
1151
+ period 1715 1725
1147
1152
 
1148
- Blackbeard: 40 4
1149
- Roberts: 12 52
1153
+ Blackbeard 40 4
1154
+ Roberts 12 52
1150
1155
  ```
1151
1156
 
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
1157
+ - Period directive required: `period Label1 Label2` (one-line) or indented block for multi-token labels:
1158
+ ```
1159
+ period
1160
+ Before COVID
1161
+ After COVID
1162
+ ```
1163
+ - Data rows: `Label value1 value2` — space-separated, no colons, no commas between values
1164
+ - Thousands commas within values supported (e.g., `1,000`)
1165
+ - Color annotations: `Label (color) value1 value2`
1166
+ - Minimum 2 periods required
1155
1167
 
1156
1168
  ### 16.2 Wordcloud
1157
1169
 
@@ -1168,19 +1180,19 @@ navigation 88
1168
1180
  - Data: space-separated only (`word value`)
1169
1181
  - Options: `rotate none|mixed|angled`, `max N`, `size min max`
1170
1182
 
1171
- ### 16.3 Arc Diagrams (Colon Before Weight)
1183
+ ### 16.3 Arc Diagrams
1172
1184
 
1173
1185
  ```
1174
1186
  arc Pirate Alliances
1175
1187
 
1176
1188
  [Caribbean](red)
1177
- Blackbeard -> Bonnet: 8
1178
- Blackbeard -> Vane: 5
1189
+ Blackbeard -> Bonnet 8
1190
+ Blackbeard -> Vane 5
1179
1191
 
1180
1192
  order group
1181
1193
  ```
1182
1194
 
1183
- - Link: `Source -> Target: weight` — colon before optional weight
1195
+ - Link: `Source -> Target weight` — space before optional weight
1184
1196
  - Options: `order appearance|name|group|degree`
1185
1197
 
1186
1198
  ### 16.4 Venn Diagrams
@@ -1199,25 +1211,25 @@ sw + nav + lead Legendary Pirates
1199
1211
  - Set declaration: `Name(color) alias X`
1200
1212
  - Intersections: `Set1 + Set2 Label` — label follows the last set reference (no colon)
1201
1213
 
1202
- ### 16.5 Quadrant Diagrams (Colon REQUIRED)
1214
+ ### 16.5 Quadrant Diagrams
1203
1215
 
1204
1216
  ```
1205
1217
  quadrant Crew Assessment
1206
- x-axis: Low Skill, High Skill
1207
- y-axis: Low Loyalty, High Loyalty
1218
+ x-label Low Skill, High Skill
1219
+ y-label Low Loyalty, High Loyalty
1208
1220
 
1209
- top-right: Promote (green)
1210
- top-left: Train (yellow)
1211
- bottom-left: Maroon (red)
1212
- bottom-right: Watch Closely (purple)
1221
+ top-right Promote (green)
1222
+ top-left Train (yellow)
1223
+ bottom-left Maroon (red)
1224
+ bottom-right Watch Closely (purple)
1213
1225
 
1214
- Quartermaster: 0.9 0.95
1215
- Navigator: 0.85 0.8
1226
+ Quartermaster 0.9, 0.95
1227
+ Navigator 0.85, 0.8
1216
1228
  ```
1217
1229
 
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
1230
+ - Axis labels: `x-label Low, High` — space-separated
1231
+ - Position labels: `top-right Label` — space-separated
1232
+ - Data points: `Label x, y` — space-separated, comma between coordinates
1221
1233
  - Thousands commas supported in values
1222
1234
 
1223
1235
  ---
@@ -1234,11 +1246,6 @@ Navigator: 0.85 0.8
1234
1246
  | Class field types | class | `+ name: string` |
1235
1247
  | Class method returns | class | `+ sail(): void` |
1236
1248
  | 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
1249
  | Hide tag values | initiative-status | `hide phase:Planning` |
1243
1250
 
1244
1251
  ### Colons OPTIONAL
@@ -1264,13 +1271,15 @@ Navigator: 0.85 0.8
1264
1271
  | Section dividers | sequence | `== Phase ==` |
1265
1272
  | Comments | all | `// comment` |
1266
1273
  | Wordcloud data | wordcloud | `swordsmanship 95` |
1274
+ | Slope data rows | slope | `Blackbeard 40 4` |
1275
+ | Slope period directive | slope | `period 1715 1725` |
1267
1276
  | Venn intersections | venn | `sw + nav Sea Raiders` |
1268
1277
 
1269
1278
  ### The Rule
1270
1279
 
1271
1280
  **Colons appear in two contexts:**
1272
1281
  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)
1282
+ 2. **Type/expression separation** — where labels can contain spaces and a delimiter is needed (function expressions, class members)
1274
1283
 
1275
1284
  **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
1285
 
@@ -0,0 +1,18 @@
1
+ arc Microservice Dependencies
2
+ order group
3
+
4
+ [Frontend]
5
+ WebApp -> API Gateway 5
6
+ MobileApp -> API Gateway 3
7
+
8
+ [Core Services]
9
+ API Gateway -> AuthService 4
10
+ API Gateway -> UserService 5
11
+ API Gateway -> OrderService 3
12
+ UserService -> Database 4
13
+ OrderService -> Database 3
14
+ OrderService -> PaymentService 2
15
+
16
+ [External]
17
+ PaymentService -> Stripe 2
18
+ AuthService -> OAuth 3
@@ -0,0 +1,19 @@
1
+ area Memory Usage Over Time
2
+ x-label Hour
3
+ y-label GB
4
+
5
+ era 12am -> 9am Night (blue)
6
+ era 9am -> 6pm Day (green)
7
+ era 6pm -> 11pm Evening (purple)
8
+
9
+ 12am 2.1
10
+ 3am 1.8
11
+ 6am 2.4
12
+ 9am 5.7
13
+ 10am 6.3
14
+ 12pm 7.1
15
+ 2pm 6.8
16
+ 4pm 5.9
17
+ 6pm 4.2
18
+ 9pm 3.1
19
+ 11pm 2.5
@@ -0,0 +1,10 @@
1
+ bar-stacked Support Tickets by Priority
2
+ x-label Month
3
+ y-label Tickets
4
+
5
+ series Critical (red), High (orange), Medium (yellow), Low (green), Info (blue)
6
+ January 8, 24, 45, 62, 31
7
+ February 12, 19, 51, 58, 28
8
+ March 6, 22, 38, 71, 35
9
+ April 10, 28, 42, 65, 40
10
+ May 5, 15, 48, 70, 33
@@ -0,0 +1,10 @@
1
+ bar Monthly Revenue by Product Line
2
+ x-label Product
3
+ y-label Revenue ($K)
4
+
5
+ Enterprise 245
6
+ Professional 182
7
+ Starter 97
8
+ Free Trial 43
9
+ Add-ons 61
10
+ Consulting 128
@@ -0,0 +1,52 @@
1
+ c4 Online Bookstore — C4 Architecture
2
+
3
+ tag Technology alias tech
4
+ React(blue)
5
+ Node(green)
6
+ Python(orange)
7
+ PostgreSQL(purple)
8
+
9
+ tag Team alias t
10
+ Frontend(blue)
11
+ Backend(green)
12
+ Platform(teal)
13
+ Data(purple)
14
+
15
+ Customer is a person | t: Frontend
16
+ description: Browses and purchases books online
17
+
18
+ Admin is a person | t: Backend
19
+ description: Manages inventory and orders
20
+
21
+ Bookstore is a system | t: Backend
22
+ description: Core e-commerce platform for book sales
23
+ containers
24
+ WebApp is a container | tech: React, t: Frontend
25
+ description: Single-page storefront application
26
+ components
27
+ Catalog is a component
28
+ Cart is a component
29
+ Checkout is a component
30
+ API is a container | tech: Node, t: Backend
31
+ description: REST API gateway for all client requests
32
+ OrderSvc is a container | tech: Node, t: Backend
33
+ description: Order processing and fulfillment
34
+ SearchSvc is a container | tech: Python, t: Backend
35
+ description: Full-text search over book catalog
36
+ BookDB is a container is a database | tech: PostgreSQL, t: Data
37
+ description: Relational store — books, orders, users
38
+ CacheLayer is a container is a cache | tech: Redis, t: Platform
39
+ description: Session and query result cache
40
+ EventBus is a container | tech: Kafka, t: Platform
41
+ description: Async event backbone for order lifecycle
42
+
43
+ PaymentGW is a system | t: Platform
44
+ description: Stripe — external payment processing
45
+
46
+ EmailSvc is a system | t: Platform
47
+ description: SendGrid — transactional email delivery
48
+
49
+ Customer -Browses catalog-> Bookstore
50
+ Admin -Manages inventory-> Bookstore
51
+ Bookstore -Processes payments via-> PaymentGW | tech: REST
52
+ Bookstore ~Sends order confirmations~> EmailSvc | tech: SMTP
@@ -0,0 +1,17 @@
1
+ c4 Internet Banking System
2
+
3
+ Customer is a person
4
+ description: A customer of the bank
5
+
6
+ Banking is a system
7
+ description: Core internet banking system
8
+ containers
9
+ WebApp is a container | tech: React
10
+ API is a container | tech: Node.js
11
+ DB is a container is a database | tech: PostgreSQL
12
+
13
+ Email is a system
14
+ description: External email delivery service
15
+
16
+ Customer -Uses-> Banking
17
+ Banking -Sends emails via-> Email
@@ -0,0 +1,12 @@
1
+ chord Inter-Department Collaboration
2
+
3
+ Engineering -> Design 85
4
+ Engineering -> Product 72
5
+ Engineering -> QA 95
6
+ Design -> Product 68
7
+ Design -> Marketing 45
8
+ Product -> Marketing 58
9
+ Product -> Sales 42
10
+ Marketing -> Sales 65
11
+ QA -> Engineering 88
12
+ Sales -> Product 30
@@ -0,0 +1,14 @@
1
+ class Animal Hierarchy
2
+
3
+ Animal
4
+ name: string
5
+ age: number
6
+ speak(): void
7
+
8
+ Dog extends Animal
9
+ breed: string
10
+ fetch(): void
11
+
12
+ Cat extends Animal
13
+ indoor: boolean
14
+ purr(): void
@@ -0,0 +1,43 @@
1
+ class Design Patterns
2
+
3
+ Drawable [interface]
4
+ + draw(): void
5
+ + resize(w: number, h: number): void
6
+
7
+ Shape implements Drawable [abstract] (purple)
8
+ # x: number
9
+ # y: number
10
+ + area(): number
11
+ + move(dx: number, dy: number): void
12
+ - validate(): boolean
13
+
14
+ Circle extends Shape
15
+ - radius: number
16
+ + getRadius(): number
17
+
18
+ Rectangle extends Shape
19
+ - width: number
20
+ - height: number
21
+ + getDiagonal(): number
22
+
23
+ Color [enum] (yellow)
24
+ Red
25
+ Green
26
+ Blue
27
+
28
+ Canvas
29
+ - shapes: Shape[]
30
+ + render(): void
31
+ + addShape(s: Shape): void
32
+ + clear(): void
33
+ count: number {static}
34
+ *-- Shape : contains
35
+ ..> Logger : uses
36
+
37
+ Logger
38
+ - instance: Logger {static}
39
+ + log(msg: string): void
40
+ + getInstance(): Logger {static}
41
+
42
+ Circle
43
+ -> Color : has fill
@@ -0,0 +1,8 @@
1
+ doughnut Cloud Spending by Service
2
+
3
+ Compute (blue) 34
4
+ Storage (cyan) 22
5
+ Database (green) 18
6
+ Networking (orange) 12
7
+ AI/ML (purple) 8
8
+ Other (gray) 6
@@ -0,0 +1,3 @@
1
+ flowchart Basic Flow
2
+
3
+ (Start) -> [Step 1] -> [Step 2] -> [Step 3] -> (End)
@@ -0,0 +1,5 @@
1
+ flowchart Color Demo
2
+
3
+ (Start(green)) -> [Parse Input] -> <Valid?(blue)>
4
+ -yes(green)-> [Process(teal)] -> (Success(green))
5
+ -no(red)-> [Error Handler(red)] -> /Log Error(orange)/ -> (Failure(red))
@@ -0,0 +1,17 @@
1
+ flowchart CI/CD Pipeline
2
+
3
+ (Push to Repo) -> [[Run Linter]] -> <Lint Pass?>
4
+ -yes-> [[Run Tests]]
5
+ -no-> [Lint Report~] -> /Notify Dev/ -> (Fix & Retry)
6
+
7
+ [[Run Tests]] -> <Tests Pass?>
8
+ -yes-> [Build Artifact]
9
+ -no-> [Test Report~] -> /Notify Dev/ -> (Fix & Retry)
10
+
11
+ [Build Artifact] -> <Environment?>
12
+ -staging-> [[Deploy to Staging]] -> /Run Smoke Tests/ -> <Smoke OK?>
13
+ -yes-> /Await Approval/
14
+ -no-> /Notify Team/ -> (Rollback)
15
+ -production-> [[Deploy to Prod]] -> /Health Check/ -> <Healthy?>
16
+ -yes-> (Done)
17
+ -no-> (Rollback)
@@ -0,0 +1,5 @@
1
+ flowchart Decision Flow
2
+
3
+ (Start) -> /Get Input/ -> <Valid?>
4
+ -yes-> [Process Data] -> (Done)
5
+ -no-> [Show Error] -> /Get Input/
@@ -0,0 +1,13 @@
1
+ flowchart Order Processing Pipeline
2
+
3
+ (Receive Order) -> [Validate Input] -> <Valid?>
4
+ -yes-> [Check Inventory] -> <In Stock?>
5
+ -yes-> [[Process Payment]] -> <Payment OK?>
6
+ -yes-> [Ship Order] -> /Send Confirmation/ -> (Complete)
7
+ -no-> [Retry Payment] -> <Retries Left?>
8
+ -yes-> [[Process Payment]]
9
+ -no-> [Cancel Order] -> /Notify Customer/ -> (Failed)
10
+ -no-> /Notify Backorder/ -> <Accept Wait?>
11
+ -yes-> [Queue Order] -> [Check Inventory]
12
+ -no-> [Refund] -> (Cancelled)
13
+ -no-> [Log Validation Error~] -> /Show Error/ -> (Rejected)
@@ -0,0 +1,10 @@
1
+ flowchart Microservice Architecture
2
+
3
+ /Request/ -> [Auth Check] -> <Authorized?>
4
+
5
+ <Authorized?>
6
+ -yes-> [Create Order] -> [Validate Items]
7
+
8
+ [Validate Items] -> [[Send Confirmation]]
9
+ <Authorized?>
10
+ -no-> [[Send Rejection]]
@@ -0,0 +1,7 @@
1
+ flowchart Retry Logic
2
+
3
+ (Start) -> [Initialize] -> [Attempt Request] -> <Success?>
4
+ -yes-> [Process Response] -> (Done)
5
+ -no-> <Retries Left?>
6
+ -yes-> [Wait & Backoff] -> [Attempt Request]
7
+ -no-> [Log Failure] -> (Error)
@@ -0,0 +1,7 @@
1
+ flowchart Authentication Flow
2
+
3
+ (Start) -> <Authenticated?>
4
+ -yes-> <Authorized?>
5
+ -yes-> [Process Request] -> [Return 200] -> (End)
6
+ -no-> [Return 403] -> (End)
7
+ -no-> [Return 401] -> (End)
@@ -0,0 +1,5 @@
1
+ flowchart Pirate's Code
2
+ (Sail Ho!) -> <Friend or Foe?>
3
+ -friend-> [Check Logs~] -> /Trade Rum/ -> [Celebrate]
4
+ -foe-> [Fire Cannons] -> [[Claim Loot]] -> [Celebrate]
5
+ [Celebrate]->(Sail On)
@@ -0,0 +1,8 @@
1
+ function Mathematical Functions
2
+ x-label x
3
+ y-label f(x)
4
+
5
+ x -6 to 6
6
+ f(x) (blue) sin(x)
7
+ g(x) (red) x^2 / 10
8
+ h(x) (green) cos(x) * 2
@@ -0,0 +1,7 @@
1
+ funnel Sales Pipeline Conversion
2
+
3
+ Website Visitors 12000
4
+ Product Page Views 5400
5
+ Free Trial Signups 2100
6
+ Onboarding Complete 890
7
+ Paid Conversion 340
@@ -0,0 +1,49 @@
1
+ gantt Product Launch Plan — Full
2
+ start 2024-01-15
3
+ today-marker 2024-03-01
4
+ critical-path
5
+ dependencies
6
+
7
+ tag Team alias t
8
+ Engineering(blue)
9
+ Design(purple)
10
+ QA(orange)
11
+ Marketing(green)
12
+
13
+ tag Phase alias p
14
+ Foundation(green)
15
+ Growth(orange)
16
+ Launch(red)
17
+
18
+ era 2024-01-15 -> 2024-02-15 Investor Review
19
+ era 2024-03-10 -> 2024-03-14 GDC 2024 (purple)
20
+ marker 2024-02-26 Board Meeting
21
+ marker 2024-04-08 Trade Show Demo (orange)
22
+
23
+ // Independent task with offset — starts 8bd after project start
24
+ 10bd Brand Guidelines | t: Design, p: Foundation, offset: 8bd
25
+
26
+ parallel
27
+ [Backend] | t: Engineering
28
+ 30bd Database Layer | p: Foundation, 80%
29
+ 10bd? Auth Module | p: Foundation, 100%
30
+ -blocks-> Frontend.API Integration | offset: -5bd
31
+ parallel
32
+ 5bd Load Testing | t: QA, p: Growth
33
+ 5bd Security Audit | t: QA, p: Growth
34
+
35
+ [Frontend] | t: Design
36
+ 15bd Component Library | p: Foundation
37
+ 10bd API Integration | t: Engineering, p: Growth
38
+ 5bd Polish | p: Growth, 30%
39
+
40
+ [Marketing] | t: Marketing
41
+ 10bd Landing Page | p: Growth
42
+ 5bd Press Kit | p: Launch
43
+ -needs-> Landing Page
44
+
45
+ [Integration] | t: QA
46
+ 10bd E2E Testing | p: Launch
47
+ -depends on-> Backend.Auth Module
48
+ // Final validation before release
49
+ 0d Release Candidate | p: Launch
@@ -0,0 +1,42 @@
1
+ gantt Product Launch Plan
2
+ start 2024-01-15
3
+ today-marker 2024-03-01
4
+ critical-path
5
+ dependencies
6
+
7
+ tag Team alias t
8
+ Engineering(blue)
9
+ Design(purple)
10
+ QA(orange)
11
+
12
+ tag Phase alias p
13
+ Foundation(green)
14
+ Growth(orange)
15
+
16
+ era 2024-01-15 -> 2024-02-15 Investor Review
17
+ era 2024-03-10 -> 2024-03-14 GDC 2024 (purple)
18
+ marker 2024-02-26 Board Meeting
19
+ marker 2024-04-08 Trade Show Demo (orange)
20
+
21
+ // Independent task with offset — starts 8bd after project start
22
+ 10bd Brand Guidelines | t: Design, p: Foundation, offset: 8bd
23
+
24
+ parallel
25
+ [Backend] | t: Engineering
26
+ 30bd Database Layer | p: Foundation, 80%
27
+ 10bd? Auth Module | p: Foundation, 100%
28
+ // Start frontend integration 5bd before Auth finishes (overlap)
29
+ -> Frontend.API Integration | offset: -5bd
30
+ parallel
31
+ 5bd Load Testing | t: QA, p: Growth
32
+ 5bd Security Audit | t: QA, p: Growth
33
+
34
+ [Frontend] | t: Design
35
+ 15bd Component Library | p: Foundation
36
+ 10bd API Integration | t: Engineering, p: Growth
37
+ 5bd Polish | p: Growth, 30%
38
+
39
+ [Integration] | t: QA
40
+ 10bd E2E Testing
41
+ // Final validation before release
42
+ 0d Release Candidate
@@ -0,0 +1,8 @@
1
+ heatmap Deploy Frequency by Day and Hour
2
+
3
+ columns Mon, Tue, Wed, Thu, Fri
4
+ 6 AM 1, 2, 0, 1, 0
5
+ 9 AM 5, 8, 6, 7, 4
6
+ 12 PM 3, 4, 5, 3, 2
7
+ 3 PM 8, 12, 9, 10, 6
8
+ 6 PM 2, 3, 1, 2, 1
@@ -0,0 +1,78 @@
1
+ infra E-Commerce Platform — Full Infrastructure
2
+
3
+ tag Team alias t
4
+ Backend(blue)
5
+ Platform(teal)
6
+ Data(purple)
7
+
8
+ tag Tier alias r
9
+ Edge(green)
10
+ Core(blue)
11
+ Storage(orange)
12
+
13
+ edge
14
+ rps: 15000
15
+ -> CloudFront
16
+
17
+ CloudFront is a network | t: Platform, r: Edge
18
+ description: CDN — edge cache with 200+ PoPs
19
+ cache-hit: 85%
20
+ -> WAF
21
+
22
+ WAF is a gateway | t: Platform, r: Edge
23
+ description: Web Application Firewall — bot protection and rate limiting
24
+ firewall-block: 8%
25
+ -> ALB
26
+
27
+ ALB is a gateway | t: Platform, r: Core
28
+ -/api-> [API Tier] | split: 50%
29
+ -/shop-> [Commerce Tier] | split: 35%
30
+ -/static-> StaticBucket | split: 15%
31
+
32
+ [API Tier] | t: Backend, r: Core
33
+ APIServer is a service
34
+ description: Core REST API — auth, catalog, user profiles
35
+ instances: 4
36
+ max-rps: 800
37
+ latency-ms: 35
38
+ cb-error-threshold: 50%
39
+ -> Redis | fanout: 2
40
+ -> PostgreSQL
41
+ ~order.placed~> EventBus
42
+
43
+ [Commerce Tier] | t: Backend, r: Core
44
+ CheckoutSvc is a service
45
+ description: Checkout and payment orchestration
46
+ instances: 2-10
47
+ max-rps: 400
48
+ latency-ms: 100
49
+ -> PaymentGW
50
+ -> PostgreSQL
51
+ ~payment.confirmed~> EventBus
52
+ PaymentGW is a gateway
53
+ description: Stripe/Adyen payment gateway proxy
54
+ latency-ms: 250
55
+
56
+ Redis is a cache | t: Data, r: Storage
57
+ description: Session store and query cache
58
+ latency-ms: 2
59
+
60
+ PostgreSQL is a database | t: Data, r: Storage
61
+ description: Primary relational store — orders, users, catalog
62
+ latency-ms: 8
63
+
64
+ EventBus is a queue | t: Platform, r: Core
65
+ description: Async event backbone (Kafka)
66
+ ~analytics~> ClickHouse
67
+ ~notifications~> NotifySvc
68
+
69
+ ClickHouse is a database | t: Data, r: Storage
70
+ description: Analytics OLAP — real-time dashboards
71
+
72
+ NotifySvc is a service | t: Backend, r: Core
73
+ description: Email/SMS/push notification dispatcher
74
+ instances: 2
75
+
76
+ StaticBucket is a storage | t: Platform, r: Edge
77
+ description: S3 bucket — JS, CSS, images
78
+ latency-ms: 5