@diagrammo/dgmo 0.8.23 → 0.8.25
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/.claude/commands/dgmo.md +60 -72
- package/dist/cli.cjs +119 -114
- package/dist/editor.cjs +0 -2
- package/dist/editor.cjs.map +1 -1
- package/dist/editor.js +0 -2
- package/dist/editor.js.map +1 -1
- package/dist/highlight.cjs +0 -2
- package/dist/highlight.cjs.map +1 -1
- package/dist/highlight.js +0 -2
- package/dist/highlight.js.map +1 -1
- package/dist/index.cjs +690 -278
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +105 -18
- package/dist/index.d.ts +105 -18
- package/dist/index.js +680 -277
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +348 -51
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +93 -5
- package/dist/internal.d.ts +93 -5
- package/dist/internal.js +334 -38
- package/dist/internal.js.map +1 -1
- package/docs/guide/chart-area.md +17 -17
- package/docs/guide/chart-bar-stacked.md +12 -12
- package/docs/guide/chart-doughnut.md +10 -10
- package/docs/guide/chart-funnel.md +9 -9
- package/docs/guide/chart-heatmap.md +10 -10
- package/docs/guide/chart-kanban.md +2 -0
- package/docs/guide/chart-line.md +19 -19
- package/docs/guide/chart-multi-line.md +16 -16
- package/docs/guide/chart-pie.md +11 -11
- package/docs/guide/chart-polar-area.md +10 -10
- package/docs/guide/chart-radar.md +9 -9
- package/docs/guide/chart-scatter.md +24 -27
- package/docs/guide/index.md +3 -3
- package/docs/language-reference.md +46 -25
- package/fonts/Inter-Bold.ttf +0 -0
- package/fonts/Inter-Regular.ttf +0 -0
- package/fonts/LICENSE-Inter.txt +92 -0
- package/gallery/fixtures/bar-stacked.dgmo +12 -6
- package/gallery/fixtures/heatmap.dgmo +12 -6
- package/gallery/fixtures/multi-line.dgmo +11 -7
- package/gallery/fixtures/quadrant.dgmo +8 -8
- package/gallery/fixtures/scatter.dgmo +12 -12
- package/package.json +4 -2
- package/src/boxes-and-lines/parser.ts +13 -2
- package/src/boxes-and-lines/renderer.ts +22 -13
- package/src/chart-type-scoring.ts +162 -0
- package/src/chart-types.ts +437 -0
- package/src/cli.ts +147 -66
- package/src/completion.ts +0 -4
- package/src/d3.ts +9 -2
- package/src/dgmo-router.ts +85 -130
- package/src/editor/keywords.ts +0 -2
- package/src/fonts.ts +3 -2
- package/src/gantt/parser.ts +5 -1
- package/src/index.ts +24 -1
- package/src/infra/parser.ts +1 -1
- package/src/internal.ts +6 -2
- package/src/journey-map/layout.ts +7 -3
- package/src/journey-map/parser.ts +5 -1
- package/src/kanban/parser.ts +5 -1
- package/src/org/collapse.ts +1 -4
- package/src/org/parser.ts +1 -1
- package/src/org/renderer.ts +26 -17
- package/src/sequence/parser.ts +2 -2
- package/src/sequence/participant-inference.ts +0 -1
- package/src/sequence/renderer.ts +95 -263
- package/src/sharing.ts +0 -1
- package/src/sitemap/parser.ts +1 -1
- package/src/utils/tag-groups.ts +35 -5
- package/src/wireframe/parser.ts +3 -1
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// Chart-type single source of truth
|
|
3
|
+
// ============================================================
|
|
4
|
+
//
|
|
5
|
+
// Ordering rule (specificity-based):
|
|
6
|
+
// chartTypes is iterated in source order, and scoring ties resolve to the
|
|
7
|
+
// earlier entry. List specialized types FIRST (journey-map, c4, er, …) so
|
|
8
|
+
// they win over generic catch-alls (flowchart, boxes-and-lines) whenever
|
|
9
|
+
// the prompt is ambiguous.
|
|
10
|
+
//
|
|
11
|
+
// Trigger rule (compound phrases):
|
|
12
|
+
// Triggers are lowercase, multi-word phrases. Bare common words are
|
|
13
|
+
// intentionally avoided — "flow", "chart", "diagram" alone cause too many
|
|
14
|
+
// false positives. Prefer "customer journey" over "journey", "bar chart"
|
|
15
|
+
// over "bar", etc. Scoring uses contiguous token matching, not substring.
|
|
16
|
+
//
|
|
17
|
+
// fallback?: true
|
|
18
|
+
// Flags general-purpose types returned when the prompt matches no strong
|
|
19
|
+
// trigger. The `suggest_chart_type` MCP tool reads this flag at runtime,
|
|
20
|
+
// so renaming a type does not silently break the fallback list.
|
|
21
|
+
|
|
22
|
+
export interface ChartTypeMeta {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly description: string;
|
|
25
|
+
readonly triggers: readonly string[];
|
|
26
|
+
readonly fallback?: true;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const chartTypes: readonly ChartTypeMeta[] = [
|
|
30
|
+
// ── Tier 1 — Narrative / architecture diagrams ────────────
|
|
31
|
+
{
|
|
32
|
+
id: 'journey-map',
|
|
33
|
+
description:
|
|
34
|
+
'User experience flow with emotion scores, phases, and annotations',
|
|
35
|
+
triggers: [
|
|
36
|
+
'user journey',
|
|
37
|
+
'customer journey',
|
|
38
|
+
'customer experience',
|
|
39
|
+
'customer goes through',
|
|
40
|
+
'user goes through',
|
|
41
|
+
'customer path',
|
|
42
|
+
'customer touchpoints',
|
|
43
|
+
'cx flow',
|
|
44
|
+
'ux journey',
|
|
45
|
+
'onboarding flow',
|
|
46
|
+
'persona journey',
|
|
47
|
+
'empathy map',
|
|
48
|
+
'service blueprint',
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: 'c4',
|
|
53
|
+
description:
|
|
54
|
+
'System architecture (context, container, component, deployment)',
|
|
55
|
+
triggers: [
|
|
56
|
+
'c4 diagram',
|
|
57
|
+
'system context',
|
|
58
|
+
'container diagram',
|
|
59
|
+
'component diagram',
|
|
60
|
+
'architecture overview',
|
|
61
|
+
'software architecture',
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: 'er',
|
|
66
|
+
description: 'Database schemas and relationships',
|
|
67
|
+
triggers: [
|
|
68
|
+
'database schema',
|
|
69
|
+
'er diagram',
|
|
70
|
+
'entity relationship',
|
|
71
|
+
'data model',
|
|
72
|
+
'tables and relationships',
|
|
73
|
+
'foreign keys',
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: 'class',
|
|
78
|
+
description: 'UML class hierarchies',
|
|
79
|
+
triggers: [
|
|
80
|
+
'uml class',
|
|
81
|
+
'class hierarchy',
|
|
82
|
+
'class diagram',
|
|
83
|
+
'inheritance tree',
|
|
84
|
+
'oop structure',
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: 'sequence',
|
|
89
|
+
description: 'Message / interaction flows',
|
|
90
|
+
triggers: [
|
|
91
|
+
'sequence diagram',
|
|
92
|
+
'message flow',
|
|
93
|
+
'api call flow',
|
|
94
|
+
'request lifecycle',
|
|
95
|
+
'interaction diagram',
|
|
96
|
+
'call sequence',
|
|
97
|
+
],
|
|
98
|
+
fallback: true,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: 'state',
|
|
102
|
+
description: 'State machine / lifecycle transitions',
|
|
103
|
+
triggers: [
|
|
104
|
+
'state diagram',
|
|
105
|
+
'state machine',
|
|
106
|
+
'state transitions',
|
|
107
|
+
'lifecycle diagram',
|
|
108
|
+
'status transitions',
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: 'infra',
|
|
113
|
+
description: 'Infrastructure traffic flow with RPS computation',
|
|
114
|
+
triggers: [
|
|
115
|
+
'infrastructure diagram',
|
|
116
|
+
'traffic flow',
|
|
117
|
+
'request path',
|
|
118
|
+
'rps',
|
|
119
|
+
'capacity planning',
|
|
120
|
+
'network topology',
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
id: 'gantt',
|
|
125
|
+
description: 'Project scheduling with task dependencies and milestones',
|
|
126
|
+
triggers: [
|
|
127
|
+
'gantt chart',
|
|
128
|
+
'project schedule',
|
|
129
|
+
'sprint plan',
|
|
130
|
+
'project timeline',
|
|
131
|
+
'task dependencies',
|
|
132
|
+
'project milestones',
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
// ── Tier 2 — Specialized structural diagrams ──────────────
|
|
137
|
+
{
|
|
138
|
+
id: 'timeline',
|
|
139
|
+
description: 'Events, eras, and date ranges',
|
|
140
|
+
triggers: [
|
|
141
|
+
'event timeline',
|
|
142
|
+
'historical timeline',
|
|
143
|
+
'era chart',
|
|
144
|
+
'period chart',
|
|
145
|
+
'project history',
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
id: 'org',
|
|
150
|
+
description: 'Reporting hierarchy',
|
|
151
|
+
triggers: [
|
|
152
|
+
'org chart',
|
|
153
|
+
'organization chart',
|
|
154
|
+
'reporting structure',
|
|
155
|
+
'hierarchy chart',
|
|
156
|
+
'team structure',
|
|
157
|
+
],
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
id: 'sitemap',
|
|
161
|
+
description: 'Site / app navigation structure',
|
|
162
|
+
triggers: [
|
|
163
|
+
'sitemap',
|
|
164
|
+
'site structure',
|
|
165
|
+
'page hierarchy',
|
|
166
|
+
'navigation structure',
|
|
167
|
+
'app navigation',
|
|
168
|
+
],
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
id: 'kanban',
|
|
172
|
+
description: 'Task board columns',
|
|
173
|
+
triggers: [
|
|
174
|
+
'kanban board',
|
|
175
|
+
'task board',
|
|
176
|
+
'workflow columns',
|
|
177
|
+
'todo doing done',
|
|
178
|
+
'agile board',
|
|
179
|
+
],
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
id: 'tech-radar',
|
|
183
|
+
description: 'Technology adoption quadrants (adopt/trial/assess/hold)',
|
|
184
|
+
triggers: [
|
|
185
|
+
'tech radar',
|
|
186
|
+
'technology radar',
|
|
187
|
+
'tech adoption',
|
|
188
|
+
'adopt trial assess hold',
|
|
189
|
+
'tech choices',
|
|
190
|
+
],
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
id: 'mindmap',
|
|
194
|
+
description: 'Radial hierarchy of ideas branching from a central topic',
|
|
195
|
+
triggers: [
|
|
196
|
+
'mind map',
|
|
197
|
+
'brainstorm diagram',
|
|
198
|
+
'concept map',
|
|
199
|
+
'idea tree',
|
|
200
|
+
'radial ideas',
|
|
201
|
+
],
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
id: 'wireframe',
|
|
205
|
+
description:
|
|
206
|
+
'Low-fidelity UI layout with panels, controls, and annotations',
|
|
207
|
+
triggers: [
|
|
208
|
+
'wireframe',
|
|
209
|
+
'ui mockup',
|
|
210
|
+
'screen layout',
|
|
211
|
+
'page layout',
|
|
212
|
+
'low-fidelity mockup',
|
|
213
|
+
],
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
id: 'cycle',
|
|
217
|
+
description: 'Cyclical process visualization (PDCA, OODA, DevOps loops)',
|
|
218
|
+
triggers: [
|
|
219
|
+
'pdca cycle',
|
|
220
|
+
'ooda loop',
|
|
221
|
+
'feedback loop',
|
|
222
|
+
'cyclical process',
|
|
223
|
+
'devops loop',
|
|
224
|
+
'continuous loop',
|
|
225
|
+
],
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
id: 'pyramid',
|
|
229
|
+
description: 'Stacked hierarchy of layers with descriptions (Maslow, DIKW)',
|
|
230
|
+
triggers: [
|
|
231
|
+
'pyramid diagram',
|
|
232
|
+
'layered hierarchy',
|
|
233
|
+
'maslow hierarchy',
|
|
234
|
+
'dikw pyramid',
|
|
235
|
+
'layered model',
|
|
236
|
+
],
|
|
237
|
+
},
|
|
238
|
+
|
|
239
|
+
// ── Tier 3 — Specialized analytical charts ────────────────
|
|
240
|
+
{
|
|
241
|
+
id: 'quadrant',
|
|
242
|
+
description: '2x2 positioning matrix',
|
|
243
|
+
triggers: [
|
|
244
|
+
'2x2 matrix',
|
|
245
|
+
'priority matrix',
|
|
246
|
+
'quadrant chart',
|
|
247
|
+
'impact effort matrix',
|
|
248
|
+
'positioning matrix',
|
|
249
|
+
],
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
id: 'venn',
|
|
253
|
+
description: 'Set overlaps',
|
|
254
|
+
triggers: [
|
|
255
|
+
'venn diagram',
|
|
256
|
+
'set overlap',
|
|
257
|
+
'intersection of',
|
|
258
|
+
'shared traits',
|
|
259
|
+
'overlapping circles',
|
|
260
|
+
],
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
id: 'funnel',
|
|
264
|
+
description: 'Conversion pipeline',
|
|
265
|
+
triggers: [
|
|
266
|
+
'conversion funnel',
|
|
267
|
+
'sales funnel',
|
|
268
|
+
'user funnel',
|
|
269
|
+
'pipeline stages',
|
|
270
|
+
'drop-off funnel',
|
|
271
|
+
],
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
id: 'slope',
|
|
275
|
+
description: 'Change between two periods',
|
|
276
|
+
triggers: [
|
|
277
|
+
'slope chart',
|
|
278
|
+
'before and after',
|
|
279
|
+
'two-period change',
|
|
280
|
+
'delta chart',
|
|
281
|
+
'shift comparison',
|
|
282
|
+
],
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
id: 'sankey',
|
|
286
|
+
description: 'Flow / allocation visualization',
|
|
287
|
+
triggers: [
|
|
288
|
+
'sankey diagram',
|
|
289
|
+
'flow allocation',
|
|
290
|
+
'budget flow',
|
|
291
|
+
'energy flow',
|
|
292
|
+
'traffic allocation',
|
|
293
|
+
],
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
id: 'chord',
|
|
297
|
+
description: 'Circular flow relationships',
|
|
298
|
+
triggers: [
|
|
299
|
+
'chord diagram',
|
|
300
|
+
'circular flow',
|
|
301
|
+
'relationship wheel',
|
|
302
|
+
'team connections',
|
|
303
|
+
],
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
id: 'arc',
|
|
307
|
+
description: 'Network relationships',
|
|
308
|
+
triggers: [
|
|
309
|
+
'arc diagram',
|
|
310
|
+
'relationship chart',
|
|
311
|
+
'connection arcs',
|
|
312
|
+
'network arcs',
|
|
313
|
+
],
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
id: 'wordcloud',
|
|
317
|
+
description: 'Term frequency visualization',
|
|
318
|
+
triggers: [
|
|
319
|
+
'word cloud',
|
|
320
|
+
'tag cloud',
|
|
321
|
+
'term frequency',
|
|
322
|
+
'keyword frequency',
|
|
323
|
+
],
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
id: 'heatmap',
|
|
327
|
+
description: 'Matrix intensity visualization',
|
|
328
|
+
triggers: [
|
|
329
|
+
'heatmap',
|
|
330
|
+
'intensity matrix',
|
|
331
|
+
'activity heatmap',
|
|
332
|
+
'correlation matrix',
|
|
333
|
+
],
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
id: 'function',
|
|
337
|
+
description: 'Mathematical expressions',
|
|
338
|
+
triggers: [
|
|
339
|
+
'function plot',
|
|
340
|
+
'mathematical plot',
|
|
341
|
+
'equation chart',
|
|
342
|
+
'graph y=f(x)',
|
|
343
|
+
],
|
|
344
|
+
},
|
|
345
|
+
|
|
346
|
+
// ── Tier 4 — General-purpose data charts ──────────────────
|
|
347
|
+
{
|
|
348
|
+
id: 'bar',
|
|
349
|
+
description: 'Categorical comparisons',
|
|
350
|
+
triggers: ['bar chart', 'categorical comparison', 'bar graph'],
|
|
351
|
+
fallback: true,
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
id: 'line',
|
|
355
|
+
description: 'Trends over time',
|
|
356
|
+
triggers: ['line chart', 'trend over time', 'time series'],
|
|
357
|
+
fallback: true,
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
id: 'multi-line',
|
|
361
|
+
description: 'Multiple series trends over time',
|
|
362
|
+
triggers: [
|
|
363
|
+
'multi-line chart',
|
|
364
|
+
'multiple trends',
|
|
365
|
+
'multiple series over time',
|
|
366
|
+
],
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
id: 'area',
|
|
370
|
+
description: 'Filled line chart',
|
|
371
|
+
triggers: ['area chart', 'filled line', 'cumulative trend'],
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
id: 'pie',
|
|
375
|
+
description: 'Part-to-whole proportions',
|
|
376
|
+
triggers: ['pie chart', 'part to whole', 'percentage breakdown'],
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
id: 'doughnut',
|
|
380
|
+
description: 'Ring-style pie chart',
|
|
381
|
+
triggers: ['doughnut chart', 'donut chart', 'ring chart'],
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
id: 'radar',
|
|
385
|
+
description: 'Multi-dimensional metrics',
|
|
386
|
+
triggers: ['radar chart', 'spider chart', 'multi-dimensional metrics'],
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
id: 'polar-area',
|
|
390
|
+
description: 'Radial bar chart',
|
|
391
|
+
triggers: ['polar area', 'radial bar chart'],
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
id: 'bar-stacked',
|
|
395
|
+
description: 'Multi-series categorical',
|
|
396
|
+
triggers: [
|
|
397
|
+
'stacked bar',
|
|
398
|
+
'stacked bar chart',
|
|
399
|
+
'multi-series bar',
|
|
400
|
+
'composite bar',
|
|
401
|
+
],
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
id: 'scatter',
|
|
405
|
+
description: '2D data points or bubble chart',
|
|
406
|
+
triggers: [
|
|
407
|
+
'scatter plot',
|
|
408
|
+
'correlation plot',
|
|
409
|
+
'bubble chart',
|
|
410
|
+
'2d data points',
|
|
411
|
+
],
|
|
412
|
+
},
|
|
413
|
+
|
|
414
|
+
// ── Tier 5 — Generic catch-alls (listed last on purpose) ──
|
|
415
|
+
{
|
|
416
|
+
id: 'flowchart',
|
|
417
|
+
description: 'Decision trees and process flows',
|
|
418
|
+
triggers: [
|
|
419
|
+
'flowchart',
|
|
420
|
+
'decision tree',
|
|
421
|
+
'if-then diagram',
|
|
422
|
+
'process flow with decisions',
|
|
423
|
+
],
|
|
424
|
+
fallback: true,
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
id: 'boxes-and-lines',
|
|
428
|
+
description: 'General-purpose node-edge diagrams with groups and tags',
|
|
429
|
+
triggers: [
|
|
430
|
+
'boxes and lines',
|
|
431
|
+
'nodes and edges',
|
|
432
|
+
'generic diagram',
|
|
433
|
+
'general-purpose network',
|
|
434
|
+
],
|
|
435
|
+
fallback: true,
|
|
436
|
+
},
|
|
437
|
+
] as const;
|