@diagrammo/dgmo 0.8.2 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +189 -194
- package/dist/index.cjs +450 -596
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -6
- package/dist/index.d.ts +7 -6
- package/dist/index.js +450 -596
- package/dist/index.js.map +1 -1
- package/docs/language-reference.md +821 -1060
- package/package.json +1 -1
- package/src/c4/parser.ts +19 -13
- package/src/chart.ts +69 -47
- package/src/class/parser.ts +46 -19
- package/src/class/renderer.ts +2 -2
- package/src/cli.ts +11 -16
- package/src/completion.ts +29 -25
- package/src/d3.ts +173 -174
- package/src/dgmo-router.ts +1 -1
- package/src/echarts.ts +42 -22
- package/src/er/parser.ts +9 -17
- package/src/gantt/parser.ts +108 -40
- package/src/graph/flowchart-parser.ts +7 -55
- package/src/graph/state-parser.ts +7 -10
- package/src/infra/parser.ts +6 -126
- package/src/infra/types.ts +0 -1
- package/src/initiative-status/parser.ts +7 -13
- package/src/kanban/parser.ts +4 -7
- package/src/org/parser.ts +5 -8
- package/src/org/resolver.ts +3 -3
- package/src/render.ts +1 -2
- package/src/sequence/parser.ts +22 -45
- package/src/sitemap/parser.ts +10 -17
- package/src/utils/parsing.ts +9 -43
- package/src/utils/tag-groups.ts +4 -41
- package/src/infra/serialize.ts +0 -67
package/src/completion.ts
CHANGED
|
@@ -43,7 +43,7 @@ export function registerExtractor(kind: ChartType, fn: ExtractFn): void {
|
|
|
43
43
|
* Returns null if the chart type is unknown or has no registered extractor.
|
|
44
44
|
*/
|
|
45
45
|
export function extractDiagramSymbols(docText: string): DiagramSymbols | null {
|
|
46
|
-
// Parse chartType from first line —
|
|
46
|
+
// Parse chartType from first line — bare type name.
|
|
47
47
|
let chartType: string | null = null;
|
|
48
48
|
for (const line of docText.split('\n')) {
|
|
49
49
|
const trimmed = line.trim();
|
|
@@ -98,42 +98,45 @@ export const COMPLETION_REGISTRY = new Map<string, DirectiveSpec>([
|
|
|
98
98
|
series: { description: 'Series name(s)' },
|
|
99
99
|
xlabel: { description: 'X-axis label' },
|
|
100
100
|
ylabel: { description: 'Y-axis label' },
|
|
101
|
-
orientation: { description: '
|
|
102
|
-
labels: { description: 'Label format', values: ['name', 'value', 'percent', 'full'] },
|
|
101
|
+
'orientation-horizontal': { description: 'Switch to horizontal bars' },
|
|
103
102
|
color: { description: 'Bar color override' },
|
|
104
103
|
})],
|
|
105
104
|
['line', withGlobals({
|
|
106
105
|
series: { description: 'Series name(s)' },
|
|
107
106
|
xlabel: { description: 'X-axis label' },
|
|
108
107
|
ylabel: { description: 'Y-axis label' },
|
|
109
|
-
labels: { description: 'Label format', values: ['name', 'value', 'percent', 'full'] },
|
|
110
108
|
})],
|
|
111
109
|
['pie', withGlobals({
|
|
112
|
-
|
|
110
|
+
'no-label-name': { description: 'Hide name from segment labels' },
|
|
111
|
+
'no-label-value': { description: 'Hide value from segment labels' },
|
|
112
|
+
'no-label-percent': { description: 'Hide percent from segment labels' },
|
|
113
113
|
})],
|
|
114
114
|
['doughnut', withGlobals({
|
|
115
|
-
|
|
115
|
+
'no-label-name': { description: 'Hide name from segment labels' },
|
|
116
|
+
'no-label-value': { description: 'Hide value from segment labels' },
|
|
117
|
+
'no-label-percent': { description: 'Hide percent from segment labels' },
|
|
116
118
|
})],
|
|
117
119
|
['area', withGlobals({
|
|
118
120
|
series: { description: 'Series name(s)' },
|
|
119
121
|
xlabel: { description: 'X-axis label' },
|
|
120
122
|
ylabel: { description: 'Y-axis label' },
|
|
121
|
-
labels: { description: 'Label format', values: ['name', 'value', 'percent', 'full'] },
|
|
122
123
|
})],
|
|
123
124
|
['polar-area', withGlobals({
|
|
124
|
-
|
|
125
|
+
'no-label-name': { description: 'Hide name from segment labels' },
|
|
126
|
+
'no-label-value': { description: 'Hide value from segment labels' },
|
|
127
|
+
'no-label-percent': { description: 'Hide percent from segment labels' },
|
|
125
128
|
})],
|
|
126
129
|
['radar', withGlobals()],
|
|
127
130
|
['bar-stacked', withGlobals({
|
|
128
131
|
series: { description: 'Series name(s) (required)' },
|
|
129
132
|
xlabel: { description: 'X-axis label' },
|
|
130
133
|
ylabel: { description: 'Y-axis label' },
|
|
131
|
-
orientation: { description: '
|
|
134
|
+
'orientation-horizontal': { description: 'Switch to horizontal bars' },
|
|
132
135
|
})],
|
|
133
136
|
|
|
134
137
|
// ── Extended charts ──────────────────────────────────────
|
|
135
138
|
['scatter', withGlobals({
|
|
136
|
-
labels: { description: '
|
|
139
|
+
'no-labels': { description: 'Hide point labels' },
|
|
137
140
|
xlabel: { description: 'X-axis label' },
|
|
138
141
|
ylabel: { description: 'Y-axis label' },
|
|
139
142
|
sizelabel: { description: 'Size axis label' },
|
|
@@ -148,11 +151,12 @@ export const COMPLETION_REGISTRY = new Map<string, DirectiveSpec>([
|
|
|
148
151
|
x: { description: 'X-axis range (start to end)' },
|
|
149
152
|
xlabel: { description: 'X-axis label' },
|
|
150
153
|
ylabel: { description: 'Y-axis label' },
|
|
154
|
+
shade: { description: 'Fill area below curves with translucent color' },
|
|
151
155
|
})],
|
|
152
156
|
|
|
153
157
|
// ── Visualizations ───────────────────────────────────────
|
|
154
158
|
['slope', withGlobals({
|
|
155
|
-
orientation: { description: '
|
|
159
|
+
'orientation-vertical': { description: 'Switch to vertical layout' },
|
|
156
160
|
})],
|
|
157
161
|
['wordcloud', withGlobals({
|
|
158
162
|
rotate: { description: 'Word rotation', values: ['none', 'mixed', 'angled'] },
|
|
@@ -161,13 +165,8 @@ export const COMPLETION_REGISTRY = new Map<string, DirectiveSpec>([
|
|
|
161
165
|
})],
|
|
162
166
|
['arc', withGlobals({
|
|
163
167
|
order: { description: 'Node ordering', values: ['appearance', 'name', 'group', 'degree'] },
|
|
164
|
-
orientation: { description: 'Layout direction' },
|
|
165
|
-
})],
|
|
166
|
-
['timeline', withGlobals({
|
|
167
|
-
scale: { description: 'Show time scale', values: ['on', 'off'] },
|
|
168
|
-
sort: { description: 'Sort order', values: ['time', 'group', 'tag'] },
|
|
169
|
-
swimlanes: { description: 'Show swimlanes', values: ['on', 'off'] },
|
|
170
168
|
})],
|
|
169
|
+
['timeline', withGlobals()],
|
|
171
170
|
['venn', withGlobals({
|
|
172
171
|
values: { description: 'Show values', values: ['on', 'off'] },
|
|
173
172
|
})],
|
|
@@ -182,25 +181,31 @@ export const COMPLETION_REGISTRY = new Map<string, DirectiveSpec>([
|
|
|
182
181
|
'collapse-notes': { description: 'Collapse note blocks', values: ['yes', 'no'] },
|
|
183
182
|
'active-tag': { description: 'Active tag group name' },
|
|
184
183
|
})],
|
|
185
|
-
['flowchart', withGlobals(
|
|
186
|
-
|
|
184
|
+
['flowchart', withGlobals({
|
|
185
|
+
'direction-tb': { description: 'Switch to top-to-bottom layout' },
|
|
186
|
+
})],
|
|
187
|
+
['class', withGlobals({
|
|
188
|
+
'no-auto-color': { description: 'Disable automatic modifier-based coloring' },
|
|
189
|
+
})],
|
|
187
190
|
['er', withGlobals()],
|
|
188
191
|
['org', withGlobals({
|
|
189
192
|
'sub-node-label': { description: 'Label for sub-nodes' },
|
|
190
193
|
'show-sub-node-count': { description: 'Show sub-node counts' },
|
|
191
194
|
})],
|
|
192
|
-
['kanban', withGlobals(
|
|
195
|
+
['kanban', withGlobals({
|
|
196
|
+
'no-auto-color': { description: 'Disable automatic card coloring' },
|
|
197
|
+
})],
|
|
193
198
|
['c4', withGlobals()],
|
|
194
199
|
['initiative-status', withGlobals()],
|
|
195
200
|
['state', withGlobals({
|
|
196
|
-
direction: { description: '
|
|
201
|
+
'direction-tb': { description: 'Switch to top-to-bottom layout' },
|
|
197
202
|
color: { description: 'Color mode', values: ['off'] },
|
|
198
203
|
})],
|
|
199
204
|
['sitemap', withGlobals({
|
|
200
|
-
direction: { description: '
|
|
205
|
+
'direction-tb': { description: 'Switch to top-to-bottom layout' },
|
|
201
206
|
})],
|
|
202
207
|
['infra', withGlobals({
|
|
203
|
-
direction: { description: '
|
|
208
|
+
'direction-tb': { description: 'Switch to top-to-bottom layout' },
|
|
204
209
|
'default-latency-ms': { description: 'Default latency for all nodes' },
|
|
205
210
|
'default-uptime': { description: 'Default uptime for all nodes' },
|
|
206
211
|
'default-rps': { description: 'Default RPS capacity for all nodes' },
|
|
@@ -275,11 +280,10 @@ export const CHART_TYPES: ReadonlyArray<{ name: string; description: string }> =
|
|
|
275
280
|
/**
|
|
276
281
|
* Entity types for `Name is a <type>` declarations, keyed by chart type.
|
|
277
282
|
* Values are sourced from parser constants (VALID_PARTICIPANT_TYPES,
|
|
278
|
-
*
|
|
283
|
+
* C4_IS_A_RE).
|
|
279
284
|
*/
|
|
280
285
|
export const ENTITY_TYPES = new Map<string, string[]>([
|
|
281
286
|
['sequence', ['service', 'database', 'actor', 'queue', 'cache', 'gateway', 'external', 'networking', 'frontend']],
|
|
282
|
-
['infra', ['database', 'cache', 'queue', 'service', 'gateway', 'storage', 'function', 'network']],
|
|
283
287
|
['c4', ['person', 'system', 'container', 'component', 'external', 'database']],
|
|
284
288
|
]);
|
|
285
289
|
|