@diagrammo/dgmo 0.8.11 → 0.8.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +115 -719
- package/dist/index.cjs +196 -53
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +194 -54
- package/dist/index.js.map +1 -1
- package/docs/guide/chart-arc.md +71 -0
- package/docs/guide/chart-area.md +73 -0
- package/docs/guide/chart-bar-stacked.md +61 -0
- package/docs/guide/chart-bar.md +62 -0
- package/docs/guide/chart-boxes-and-lines.md +243 -0
- package/docs/guide/chart-c4.md +300 -0
- package/docs/guide/chart-chord.md +43 -0
- package/docs/guide/chart-class.md +204 -0
- package/docs/guide/chart-doughnut.md +38 -0
- package/docs/guide/chart-er.md +218 -0
- package/docs/guide/chart-flowchart.md +102 -0
- package/docs/guide/chart-function.md +56 -0
- package/docs/guide/chart-funnel.md +38 -0
- package/docs/guide/chart-gantt.md +368 -0
- package/docs/guide/chart-heatmap.md +41 -0
- package/docs/guide/chart-infra.md +694 -0
- package/docs/guide/chart-kanban.md +156 -0
- package/docs/guide/chart-line.md +79 -0
- package/docs/guide/chart-multi-line.md +84 -0
- package/docs/guide/chart-org.md +209 -0
- package/docs/guide/chart-pie.md +39 -0
- package/docs/guide/chart-polar-area.md +38 -0
- package/docs/guide/chart-quadrant.md +69 -0
- package/docs/guide/chart-radar.md +38 -0
- package/docs/guide/chart-sankey.md +103 -0
- package/docs/guide/chart-scatter.md +94 -0
- package/docs/guide/chart-sequence.md +332 -0
- package/docs/guide/chart-sitemap.md +248 -0
- package/docs/guide/chart-slope.md +56 -0
- package/docs/guide/chart-state.md +171 -0
- package/docs/guide/chart-timeline.md +229 -0
- package/docs/guide/chart-venn.md +81 -0
- package/docs/guide/chart-wordcloud.md +66 -0
- package/docs/guide/colors.md +283 -0
- package/docs/guide/index.md +55 -0
- package/docs/guide/keyboard-shortcuts.md +49 -0
- package/docs/guide/registry.json +51 -0
- package/gallery/fixtures/boxes-and-lines.dgmo +4 -6
- package/gallery/fixtures/er.dgmo +36 -0
- package/gallery/fixtures/kanban.dgmo +27 -0
- package/package.json +1 -1
- package/src/boxes-and-lines/parser.ts +2 -0
- package/src/boxes-and-lines/renderer.ts +12 -4
- package/src/c4/parser.ts +5 -1
- package/src/completion.ts +17 -2
- package/src/d3.ts +140 -71
- package/src/echarts.ts +1 -1
- package/src/er/parser.ts +5 -1
- package/src/gantt/parser.ts +8 -0
- package/src/gantt/renderer.ts +6 -7
- package/src/gantt/types.ts +1 -0
- package/src/infra/parser.ts +4 -0
- package/src/kanban/parser.ts +4 -1
- package/src/kanban/renderer.ts +1 -1
- package/src/org/parser.ts +3 -0
- package/src/sequence/parser.ts +2 -0
- package/src/sequence/renderer.ts +8 -6
- package/src/sharing.ts +18 -9
- package/src/sitemap/parser.ts +2 -0
- package/src/utils/legend-layout.ts +7 -3
- package/src/utils/tag-groups.ts +64 -0
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
# Gantt Chart
|
|
2
|
+
|
|
3
|
+
```dgmo
|
|
4
|
+
gantt Product Launch 2024
|
|
5
|
+
start 2026-03-15
|
|
6
|
+
today-marker
|
|
7
|
+
critical-path
|
|
8
|
+
dependencies
|
|
9
|
+
|
|
10
|
+
holiday
|
|
11
|
+
2024-02-19 Presidents Day
|
|
12
|
+
2024-05-27 Memorial Day
|
|
13
|
+
|
|
14
|
+
tag Team alias t
|
|
15
|
+
Engineering(blue)
|
|
16
|
+
Design(purple)
|
|
17
|
+
QA(orange)
|
|
18
|
+
Marketing(green)
|
|
19
|
+
|
|
20
|
+
tag Phase alias p
|
|
21
|
+
Foundation(teal)
|
|
22
|
+
Build(blue)
|
|
23
|
+
Launch(red)
|
|
24
|
+
|
|
25
|
+
era 2026-04-06 -> 2026-04-10 RSA Conference (purple)
|
|
26
|
+
marker 2026-03-27 Board Review
|
|
27
|
+
marker 2026-05-12 Trade Show Demo (orange)
|
|
28
|
+
|
|
29
|
+
parallel
|
|
30
|
+
[Backend] | t: Engineering
|
|
31
|
+
20bd Database Schema | p: Foundation, 100%
|
|
32
|
+
15bd? Core API Endpoints | p: Foundation, 80%
|
|
33
|
+
-> Frontend.API Integration
|
|
34
|
+
10bd Auth & Permissions | p: Build, 40%
|
|
35
|
+
-> E2E Testing
|
|
36
|
+
parallel
|
|
37
|
+
5bd Load Testing | t: QA, p: Build
|
|
38
|
+
5bd Security Audit | t: QA, p: Build
|
|
39
|
+
|
|
40
|
+
[Frontend] | t: Design
|
|
41
|
+
10bd Wireframes & Prototypes | p: Foundation, 100%
|
|
42
|
+
15bd Component Library | p: Build, 60%
|
|
43
|
+
10bd API Integration | t: Engineering, p: Build
|
|
44
|
+
// Blocked until Core API is stable
|
|
45
|
+
5bd Polish & Animations | p: Launch, 10%
|
|
46
|
+
|
|
47
|
+
[Marketing] | t: Marketing
|
|
48
|
+
10bd? Brand Guidelines | p: Foundation, 100%
|
|
49
|
+
15bd Landing Page | p: Build, 50%
|
|
50
|
+
5bd? Launch Campaign Prep | p: Launch
|
|
51
|
+
-> Launch Day
|
|
52
|
+
|
|
53
|
+
[Integration] | t: QA
|
|
54
|
+
10bd E2E Testing | p: Launch, offset: 10bd
|
|
55
|
+
3bd Staging Deploy | p: Launch
|
|
56
|
+
0d Launch Day
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Overview
|
|
60
|
+
|
|
61
|
+
Gantt charts visualize project schedules as horizontal bars on a time axis. Tasks have durations, can be grouped, run in parallel, and linked with dependencies. The renderer automatically calculates dates from durations and shows critical path highlighting.
|
|
62
|
+
|
|
63
|
+
## Syntax
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
gantt Project Name
|
|
67
|
+
start 2024-01-15
|
|
68
|
+
|
|
69
|
+
[Group Name]
|
|
70
|
+
30d Task label
|
|
71
|
+
10bd Another task | tag: Value
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Settings
|
|
75
|
+
|
|
76
|
+
| Key | Description | Default |
|
|
77
|
+
| --------------- | ------------------------------------------------------- | --------- |
|
|
78
|
+
| `chart` | Must be `gantt` | — |
|
|
79
|
+
| `title` | Chart title | None |
|
|
80
|
+
| `start` | Project start date (`YYYY-MM-DD`) | Today |
|
|
81
|
+
| `today-marker` | Show today marker (bare keyword or a `YYYY-MM-DD` date) | off |
|
|
82
|
+
| `critical-path` | Highlight the critical path | off |
|
|
83
|
+
| `dependencies` | Show dependency arrows | off |
|
|
84
|
+
| `sort` | Task sorting: `default` or `tag` (swimlane by tag) | `default` |
|
|
85
|
+
|
|
86
|
+
## Tasks
|
|
87
|
+
|
|
88
|
+
Tasks are defined with a duration followed by a space and label:
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
30d Database Layer
|
|
92
|
+
10bd Auth Module
|
|
93
|
+
5w Long Research Phase
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Duration Units
|
|
97
|
+
|
|
98
|
+
| Unit | Meaning |
|
|
99
|
+
| ---- | ------------- |
|
|
100
|
+
| `d` | Calendar days |
|
|
101
|
+
| `bd` | Business days |
|
|
102
|
+
| `w` | Weeks |
|
|
103
|
+
| `m` | Months |
|
|
104
|
+
| `q` | Quarters |
|
|
105
|
+
| `y` | Years |
|
|
106
|
+
|
|
107
|
+
### Explicit Start Dates
|
|
108
|
+
|
|
109
|
+
Pin a task to a specific start date:
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
2024-03-01 -> 15bd Task starting March 1st
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Milestones
|
|
116
|
+
|
|
117
|
+
Use `0d` for zero-duration milestones:
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
0d Release Candidate
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Uncertain Duration
|
|
124
|
+
|
|
125
|
+
Add `?` after the unit to indicate an uncertain end date. The bar fades out over the last 20%:
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
30bd? Estimated research phase
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Progress
|
|
132
|
+
|
|
133
|
+
Add a percentage to show task completion:
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
30bd Database Layer | 80%
|
|
137
|
+
10bd Auth Module | 100%
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Groups
|
|
141
|
+
|
|
142
|
+
Groups organize tasks into labeled sections using bracket syntax:
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
[Backend]
|
|
146
|
+
30bd Database Layer
|
|
147
|
+
10bd Auth Module
|
|
148
|
+
|
|
149
|
+
[Frontend]
|
|
150
|
+
15bd Component Library
|
|
151
|
+
10bd API Integration
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Groups can be nested:
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
[Backend]
|
|
158
|
+
[API]
|
|
159
|
+
10bd REST endpoints
|
|
160
|
+
5bd GraphQL layer
|
|
161
|
+
[Data]
|
|
162
|
+
15bd Schema design
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Group Colors
|
|
166
|
+
|
|
167
|
+
Add a color suffix or use pipe metadata:
|
|
168
|
+
|
|
169
|
+
```
|
|
170
|
+
[Backend](blue)
|
|
171
|
+
[Frontend] | t: Engineering
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Parallel Blocks
|
|
175
|
+
|
|
176
|
+
Use `parallel` to run groups or tasks concurrently instead of sequentially:
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
parallel
|
|
180
|
+
[Backend]
|
|
181
|
+
30bd Database Layer
|
|
182
|
+
10bd Auth Module
|
|
183
|
+
|
|
184
|
+
[Frontend]
|
|
185
|
+
15bd Component Library
|
|
186
|
+
10bd API Integration
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Tasks inside a `parallel` block start at the same time. Without `parallel`, groups run sequentially.
|
|
190
|
+
|
|
191
|
+
## Dependencies
|
|
192
|
+
|
|
193
|
+
Use `-> TargetName` indented under a task to create a dependency. The target task won't start until the source finishes:
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
[Backend]
|
|
197
|
+
10bd Auth Module
|
|
198
|
+
-> Frontend.API Integration
|
|
199
|
+
|
|
200
|
+
[Frontend]
|
|
201
|
+
15bd Component Library
|
|
202
|
+
10bd API Integration
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Cross-group references use dot notation: `GroupName.TaskName`.
|
|
206
|
+
|
|
207
|
+
Dependencies require `dependencies` in the chart options to render arrows.
|
|
208
|
+
|
|
209
|
+
### Dependency Offset
|
|
210
|
+
|
|
211
|
+
Add an **offset** to delay (or advance) the start of a dependent task relative to its predecessor. Use `| offset:` on a dependency line:
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
[Backend]
|
|
215
|
+
10bd Auth Module
|
|
216
|
+
-> Frontend.API Integration | offset: 3bd
|
|
217
|
+
|
|
218
|
+
[Frontend]
|
|
219
|
+
15bd Component Library
|
|
220
|
+
10bd API Integration
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Here, "API Integration" starts **3 business days after** "Auth Module" finishes, instead of immediately.
|
|
224
|
+
|
|
225
|
+
Use a negative value for **lead time** (overlap with predecessor):
|
|
226
|
+
|
|
227
|
+
```
|
|
228
|
+
5bd Design Review
|
|
229
|
+
-> Implementation | offset: -2d
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Offset accepts any duration unit (`d`, `bd`, `w`, `m`, `q`, `y`).
|
|
233
|
+
|
|
234
|
+
### Task-Level Offset
|
|
235
|
+
|
|
236
|
+
Tasks can also have an `offset:` to shift their start date relative to where they'd normally begin (after the preceding task in their group):
|
|
237
|
+
|
|
238
|
+
```
|
|
239
|
+
[Backend]
|
|
240
|
+
10bd API Layer
|
|
241
|
+
5bd Auth Module | offset: 3bd
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
Here, "Auth Module" starts 3 business days after "API Layer" finishes instead of immediately.
|
|
245
|
+
|
|
246
|
+
## Holidays
|
|
247
|
+
|
|
248
|
+
Define non-working days inside a `holidays` block:
|
|
249
|
+
|
|
250
|
+
```
|
|
251
|
+
holiday
|
|
252
|
+
2024-12-25 Christmas
|
|
253
|
+
2024-12-31 -> 2025-01-01 New Year
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Business day durations (`bd`) automatically skip holidays and non-workdays.
|
|
257
|
+
|
|
258
|
+
### Custom Workweek
|
|
259
|
+
|
|
260
|
+
Override the default Mon–Fri workweek:
|
|
261
|
+
|
|
262
|
+
```
|
|
263
|
+
workweek sun-thu
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
## Eras
|
|
267
|
+
|
|
268
|
+
Background shaded regions spanning a time range:
|
|
269
|
+
|
|
270
|
+
```
|
|
271
|
+
era 2024-01 -> 2024-06 Phase 1
|
|
272
|
+
era 2024-07 -> 2024-12 Phase 2 (green)
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
## Markers
|
|
276
|
+
|
|
277
|
+
Vertical date markers for key milestones:
|
|
278
|
+
|
|
279
|
+
```
|
|
280
|
+
marker 2024-03-01 Kickoff
|
|
281
|
+
marker 2024-06-30 Demo Day (red)
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
## Tag Groups
|
|
285
|
+
|
|
286
|
+
Tag groups categorize tasks with color-coded values:
|
|
287
|
+
|
|
288
|
+
```
|
|
289
|
+
tag Team alias t
|
|
290
|
+
Engineering(blue)
|
|
291
|
+
Design(purple)
|
|
292
|
+
QA(orange)
|
|
293
|
+
|
|
294
|
+
tag Phase alias p
|
|
295
|
+
Foundation(green)
|
|
296
|
+
Growth(orange)
|
|
297
|
+
|
|
298
|
+
[Backend] | t: Engineering
|
|
299
|
+
30bd Database Layer | p: Foundation
|
|
300
|
+
10bd Auth Module | p: Foundation
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
## Swimlane Mode
|
|
304
|
+
|
|
305
|
+
Use `sort: tag` (or `sort: tag:GroupName`) to organize tasks into horizontal swimlanes grouped by tag value. Each tag value gets its own collapsible lane:
|
|
306
|
+
|
|
307
|
+
```
|
|
308
|
+
sort tag:Team
|
|
309
|
+
|
|
310
|
+
tag Team alias t
|
|
311
|
+
Frontend(blue)
|
|
312
|
+
Backend(green)
|
|
313
|
+
QA(orange)
|
|
314
|
+
|
|
315
|
+
[Sprint 1]
|
|
316
|
+
10bd API endpoints | t: Backend
|
|
317
|
+
15bd UI components | t: Frontend
|
|
318
|
+
5bd Integration tests | t: QA
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
In the app, click the swimlane icon on a tag pill to switch between swimlane groups.
|
|
322
|
+
|
|
323
|
+
## Comments
|
|
324
|
+
|
|
325
|
+
Lines starting with `//` are comments and are ignored:
|
|
326
|
+
|
|
327
|
+
```
|
|
328
|
+
[Backend]
|
|
329
|
+
30bd Database Layer
|
|
330
|
+
// This depends on schema finalization
|
|
331
|
+
10bd Auth Module
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
## Complete Example
|
|
335
|
+
|
|
336
|
+
```dgmo
|
|
337
|
+
gantt Product Launch Plan
|
|
338
|
+
start 2024-01-15
|
|
339
|
+
today-marker 2024-03-01
|
|
340
|
+
critical-path
|
|
341
|
+
dependencies
|
|
342
|
+
|
|
343
|
+
tag Team alias t
|
|
344
|
+
Engineering(blue)
|
|
345
|
+
Design(purple)
|
|
346
|
+
QA(orange)
|
|
347
|
+
|
|
348
|
+
era 2024-01 -> 2024-06 Phase 1
|
|
349
|
+
marker 2024-03-01 Kickoff
|
|
350
|
+
|
|
351
|
+
parallel
|
|
352
|
+
[Backend] | t: Engineering
|
|
353
|
+
30bd Database Layer | 80%
|
|
354
|
+
10bd? Auth Module | 100%
|
|
355
|
+
-> Frontend.API Integration | offset: 2bd
|
|
356
|
+
parallel
|
|
357
|
+
5bd Load Testing | t: QA
|
|
358
|
+
5bd Security Audit | t: QA
|
|
359
|
+
|
|
360
|
+
[Frontend] | t: Design
|
|
361
|
+
15bd Component Library
|
|
362
|
+
10bd API Integration | t: Engineering
|
|
363
|
+
5bd Polish | 30%
|
|
364
|
+
|
|
365
|
+
[Integration] | t: QA
|
|
366
|
+
10bd E2E Testing
|
|
367
|
+
0d Release Candidate
|
|
368
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Heatmap
|
|
2
|
+
|
|
3
|
+
```dgmo
|
|
4
|
+
heatmap Pirate Activity by Sea Region
|
|
5
|
+
columns Jan, Feb, Mar, Apr, May, Jun
|
|
6
|
+
|
|
7
|
+
Caribbean: 5, 4, 5, 3, 4, 5
|
|
8
|
+
Atlantic: 2, 3, 2, 4, 3, 2
|
|
9
|
+
Mediterranean: 3, 2, 1, 2, 3, 4
|
|
10
|
+
Indian Ocean: 4, 5, 4, 5, 4, 3
|
|
11
|
+
South China Sea: 1, 2, 3, 2, 1, 2
|
|
12
|
+
West Africa: 3, 3, 4, 3, 5, 4
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Syntax
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
heatmap Chart Title
|
|
19
|
+
columns Col1, Col2, Col3
|
|
20
|
+
|
|
21
|
+
Row Label: value1, value2, value3
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Metadata Keys
|
|
25
|
+
|
|
26
|
+
| Key | Description | Required |
|
|
27
|
+
| --------- | ------------------------------------- | -------- |
|
|
28
|
+
| `chart` | Must be `heatmap` | Yes |
|
|
29
|
+
| `title` | Chart title displayed above the chart | No |
|
|
30
|
+
| `columns` | Comma-separated column header labels | Yes |
|
|
31
|
+
|
|
32
|
+
## Data Format
|
|
33
|
+
|
|
34
|
+
Each data line defines a row with comma-separated values matching the column count:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
Caribbean: 5, 4, 5, 3, 4, 5
|
|
38
|
+
Atlantic: 2, 3, 2, 4, 3, 2
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The row label becomes the Y axis label. Cell colors are scaled automatically based on value range.
|