@diagrammo/dgmo 0.14.1 → 0.15.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.
- package/README.md +14 -1
- package/dist/advanced.cjs +53069 -0
- package/dist/advanced.d.cts +4691 -0
- package/dist/advanced.d.ts +4691 -0
- package/dist/advanced.js +52823 -0
- package/dist/auto.cjs +1557 -1295
- package/dist/auto.js +132 -713
- package/dist/auto.mjs +1553 -1291
- package/dist/cli.cjs +173 -150
- package/dist/editor.cjs +1 -0
- package/dist/editor.js +1 -0
- package/dist/highlight.cjs +1 -0
- package/dist/highlight.js +1 -0
- package/dist/index.cjs +2031 -4722
- package/dist/index.d.cts +96 -4464
- package/dist/index.d.ts +96 -4464
- package/dist/index.js +2024 -4475
- package/dist/internal.cjs +51930 -553
- package/dist/internal.d.cts +4526 -102
- package/dist/internal.d.ts +4526 -102
- package/dist/internal.js +51721 -548
- package/dist/pert.cjs +1 -1
- package/dist/pert.js +1 -1
- package/docs/language-reference.md +67 -17
- package/package.json +18 -3
- package/src/advanced.ts +731 -0
- package/src/auto/index.ts +14 -13
- package/src/boxes-and-lines/layout.ts +481 -445
- package/src/c4/parser.ts +7 -7
- package/src/chart-types.ts +0 -5
- package/src/class/parser.ts +1 -9
- package/src/cli.ts +9 -7
- package/src/completion-types.ts +28 -0
- package/src/completion.ts +15 -18
- package/src/cycle/layout.ts +2 -2
- package/src/d3.ts +1455 -1122
- package/src/echarts.ts +11 -11
- package/src/editor/keywords.ts +1 -0
- package/src/er/parser.ts +1 -9
- package/src/er/renderer.ts +1 -1
- package/src/gantt/calculator.ts +1 -11
- package/src/gantt/parser.ts +16 -16
- package/src/gantt/renderer.ts +2 -2
- package/src/graph/flowchart-parser.ts +1 -1
- package/src/graph/flowchart-renderer.ts +1 -1
- package/src/graph/state-renderer.ts +1 -1
- package/src/index.ts +213 -690
- package/src/infra/parser.ts +57 -25
- package/src/infra/renderer.ts +2 -2
- package/src/internal.ts +11 -17
- package/src/kanban/parser.ts +2 -2
- package/src/mindmap/layout.ts +1 -1
- package/src/mindmap/parser.ts +1 -1
- package/src/org/parser.ts +1 -1
- package/src/org/renderer.ts +1 -1
- package/src/palettes/index.ts +39 -0
- package/src/pert/layout.ts +1 -1
- package/src/pert/monte-carlo.ts +2 -2
- package/src/pert/parser.ts +3 -3
- package/src/raci/parser.ts +4 -4
- package/src/raci/renderer.ts +1 -1
- package/src/render.ts +17 -1
- package/src/sequence/renderer.ts +1 -4
- package/src/sitemap/parser.ts +1 -1
- package/src/tech-radar/interactive.ts +1 -1
- package/src/tech-radar/renderer.ts +1 -1
- package/src/themes.ts +22 -0
- package/src/utils/tag-groups.ts +11 -12
- package/src/wireframe/layout.ts +11 -7
- package/src/wireframe/parser.ts +2 -2
- package/src/wireframe/renderer.ts +5 -2
package/src/echarts.ts
CHANGED
|
@@ -1026,7 +1026,7 @@ function buildChordOption(
|
|
|
1026
1026
|
isDark: boolean,
|
|
1027
1027
|
textColor: string,
|
|
1028
1028
|
colors: string[],
|
|
1029
|
-
|
|
1029
|
+
_bg: string,
|
|
1030
1030
|
titleConfig: EChartsOption['title']
|
|
1031
1031
|
): EChartsOption {
|
|
1032
1032
|
// Extract unique nodes from links
|
|
@@ -1185,7 +1185,7 @@ function evaluateExpression(expr: string, x: number): number {
|
|
|
1185
1185
|
function buildFunctionOption(
|
|
1186
1186
|
parsed: ParsedExtendedChart,
|
|
1187
1187
|
palette: PaletteColors,
|
|
1188
|
-
|
|
1188
|
+
_isDark: boolean,
|
|
1189
1189
|
textColor: string,
|
|
1190
1190
|
axisLineColor: string,
|
|
1191
1191
|
gridOpacity: number,
|
|
@@ -2092,7 +2092,7 @@ function buildFunnelOption(
|
|
|
2092
2092
|
isDark: boolean,
|
|
2093
2093
|
textColor: string,
|
|
2094
2094
|
colors: string[],
|
|
2095
|
-
|
|
2095
|
+
_bg: string,
|
|
2096
2096
|
titleConfig: EChartsOption['title']
|
|
2097
2097
|
): EChartsOption {
|
|
2098
2098
|
// Sort data descending by value for funnel ordering
|
|
@@ -2464,7 +2464,7 @@ function buildBarOption(
|
|
|
2464
2464
|
splitLineColor: string,
|
|
2465
2465
|
gridOpacity: number,
|
|
2466
2466
|
colors: string[],
|
|
2467
|
-
|
|
2467
|
+
_bg: string,
|
|
2468
2468
|
titleConfig: EChartsOption['title'],
|
|
2469
2469
|
chartWidth?: number
|
|
2470
2470
|
): EChartsOption {
|
|
@@ -2893,7 +2893,7 @@ function buildPieOption(
|
|
|
2893
2893
|
isDark: boolean,
|
|
2894
2894
|
textColor: string,
|
|
2895
2895
|
colors: string[],
|
|
2896
|
-
|
|
2896
|
+
_bg: string,
|
|
2897
2897
|
titleConfig: EChartsOption['title'],
|
|
2898
2898
|
isDoughnut: boolean
|
|
2899
2899
|
): EChartsOption {
|
|
@@ -3021,7 +3021,7 @@ function buildPolarAreaOption(
|
|
|
3021
3021
|
isDark: boolean,
|
|
3022
3022
|
textColor: string,
|
|
3023
3023
|
colors: string[],
|
|
3024
|
-
|
|
3024
|
+
_bg: string,
|
|
3025
3025
|
titleConfig: EChartsOption['title']
|
|
3026
3026
|
): EChartsOption {
|
|
3027
3027
|
const data = parsed.data.map((d, i) => {
|
|
@@ -3079,7 +3079,7 @@ function buildBarStackedOption(
|
|
|
3079
3079
|
splitLineColor: string,
|
|
3080
3080
|
gridOpacity: number,
|
|
3081
3081
|
colors: string[],
|
|
3082
|
-
|
|
3082
|
+
_bg: string,
|
|
3083
3083
|
titleConfig: EChartsOption['title'],
|
|
3084
3084
|
chartWidth?: number
|
|
3085
3085
|
): EChartsOption {
|
|
@@ -3282,11 +3282,11 @@ export async function renderExtendedChartForExport(
|
|
|
3282
3282
|
// In static export, expand the first group so entries are visible
|
|
3283
3283
|
// Extract grid offsets for plot-area-centered legend
|
|
3284
3284
|
const grid = option.grid as Record<string, unknown> | undefined;
|
|
3285
|
-
const gridLeftPct = grid?.left
|
|
3286
|
-
? parseFloat(String(grid
|
|
3285
|
+
const gridLeftPct = grid?.['left']
|
|
3286
|
+
? parseFloat(String(grid['left']))
|
|
3287
3287
|
: undefined;
|
|
3288
|
-
const gridRightPct = grid?.right
|
|
3289
|
-
? parseFloat(String(grid
|
|
3288
|
+
const gridRightPct = grid?.['right']
|
|
3289
|
+
? parseFloat(String(grid['right']))
|
|
3290
3290
|
: undefined;
|
|
3291
3291
|
const { svg: legendSvgStr } = renderLegendSvg(legendGroups, {
|
|
3292
3292
|
palette: effectivePalette,
|
package/src/editor/keywords.ts
CHANGED
package/src/er/parser.ts
CHANGED
|
@@ -229,14 +229,6 @@ export function parseERDiagram(
|
|
|
229
229
|
error: null,
|
|
230
230
|
};
|
|
231
231
|
|
|
232
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
233
|
-
const _fail = (line: number, message: string): ParsedERDiagram => {
|
|
234
|
-
const diag = makeDgmoError(line, message);
|
|
235
|
-
result.diagnostics.push(diag);
|
|
236
|
-
result.error = formatDgmoError(diag);
|
|
237
|
-
return result;
|
|
238
|
-
};
|
|
239
|
-
|
|
240
232
|
const pushError = (line: number, message: string): void => {
|
|
241
233
|
const diag = makeDgmoError(line, message);
|
|
242
234
|
result.diagnostics.push(diag);
|
|
@@ -628,7 +620,7 @@ export function looksLikeERDiagram(content: string): boolean {
|
|
|
628
620
|
// Symbol extraction (for completion API)
|
|
629
621
|
// ============================================================
|
|
630
622
|
|
|
631
|
-
import type { DiagramSymbols } from '../completion';
|
|
623
|
+
import type { DiagramSymbols } from '../completion-types';
|
|
632
624
|
|
|
633
625
|
/**
|
|
634
626
|
* Extract table names (entities) and ER keywords from document text.
|
package/src/er/renderer.ts
CHANGED
|
@@ -340,7 +340,7 @@ export function renderERDiagram(
|
|
|
340
340
|
semanticRoles !== null && (semanticColorsActive ?? true);
|
|
341
341
|
|
|
342
342
|
// ── Edges (behind nodes) ──
|
|
343
|
-
const useLabels = parsed.options
|
|
343
|
+
const useLabels = parsed.options['notation'] === 'labels';
|
|
344
344
|
|
|
345
345
|
for (const edge of layout.edges) {
|
|
346
346
|
if (edge.points.length < 2) continue;
|
package/src/gantt/calculator.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// 3. Forward pass: resolve dates using universal max rule
|
|
10
10
|
// 4. (Optional) Critical path: backward pass to find zero-slack chain
|
|
11
11
|
|
|
12
|
-
import { makeDgmoError
|
|
12
|
+
import { makeDgmoError } from '../diagnostics';
|
|
13
13
|
import type { DgmoError } from '../diagnostics';
|
|
14
14
|
import type {
|
|
15
15
|
ParsedGantt,
|
|
@@ -67,14 +67,6 @@ export function calculateSchedule(parsed: ParsedGantt): ResolvedSchedule {
|
|
|
67
67
|
diagnostics.push(makeDgmoError(line, message, 'warning'));
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
71
|
-
const _fail = (line: number, message: string): ResolvedSchedule => {
|
|
72
|
-
const diag = makeDgmoError(line, message);
|
|
73
|
-
diagnostics.push(diag);
|
|
74
|
-
result.error = formatDgmoError(diag);
|
|
75
|
-
return result;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
70
|
// ── Build holiday set ───────────────────────────────────
|
|
79
71
|
|
|
80
72
|
const holidaySet = buildHolidaySet(parsed.holidays);
|
|
@@ -124,8 +116,6 @@ export function calculateSchedule(parsed: ParsedGantt): ResolvedSchedule {
|
|
|
124
116
|
// ── Resolve explicit -> dependencies ────────────────────
|
|
125
117
|
|
|
126
118
|
for (const task of allTasks) {
|
|
127
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
128
|
-
const _node = taskMap.get(task.id)!;
|
|
129
119
|
for (const dep of task.dependencies) {
|
|
130
120
|
const resolved = resolveTaskName(dep.targetName, allTasks);
|
|
131
121
|
if (isResolverError(resolved)) {
|
package/src/gantt/parser.ts
CHANGED
|
@@ -435,15 +435,15 @@ export function parseGantt(
|
|
|
435
435
|
metaAliasMap,
|
|
436
436
|
() => warn(lineNumber, MULTIPLE_PIPE_ERROR)
|
|
437
437
|
);
|
|
438
|
-
if (meta
|
|
439
|
-
const key = meta
|
|
438
|
+
if (meta['lag'] || meta['lead']) {
|
|
439
|
+
const key = meta['lag'] ? 'lag' : 'lead';
|
|
440
440
|
softError(
|
|
441
441
|
lineNumber,
|
|
442
442
|
`"${key}" is no longer supported — use "offset: ${meta[key]}" instead.${key === 'lead' ? ' Negate the value for lead behavior: "offset: -...".' : ''}`
|
|
443
443
|
);
|
|
444
444
|
}
|
|
445
|
-
if (meta
|
|
446
|
-
const raw = meta
|
|
445
|
+
if (meta['offset']) {
|
|
446
|
+
const raw = meta['offset'];
|
|
447
447
|
if (raw.trim().startsWith('+')) {
|
|
448
448
|
warn(
|
|
449
449
|
lineNumber,
|
|
@@ -903,15 +903,15 @@ export function parseGantt(
|
|
|
903
903
|
metaAliasMap,
|
|
904
904
|
() => warn(lineNumber, MULTIPLE_PIPE_ERROR)
|
|
905
905
|
);
|
|
906
|
-
if (meta
|
|
907
|
-
const key = meta
|
|
906
|
+
if (meta['lag'] || meta['lead']) {
|
|
907
|
+
const key = meta['lag'] ? 'lag' : 'lead';
|
|
908
908
|
softError(
|
|
909
909
|
lineNumber,
|
|
910
910
|
`"${key}" is no longer supported — use "offset: ${meta[key]}" instead.${key === 'lead' ? ' Negate the value for lead behavior: "offset: -...".' : ''}`
|
|
911
911
|
);
|
|
912
912
|
}
|
|
913
|
-
if (meta
|
|
914
|
-
const raw = meta
|
|
913
|
+
if (meta['offset']) {
|
|
914
|
+
const raw = meta['offset'];
|
|
915
915
|
if (raw.trim().startsWith('+')) {
|
|
916
916
|
warn(
|
|
917
917
|
lineNumber,
|
|
@@ -1023,9 +1023,9 @@ export function parseGantt(
|
|
|
1023
1023
|
|
|
1024
1024
|
// Extract progress from metadata or shorthand
|
|
1025
1025
|
let progress: number | null = null;
|
|
1026
|
-
if (metadata
|
|
1027
|
-
progress = parseFloat(metadata
|
|
1028
|
-
delete metadata
|
|
1026
|
+
if (metadata['progress']) {
|
|
1027
|
+
progress = parseFloat(metadata['progress']);
|
|
1028
|
+
delete metadata['progress'];
|
|
1029
1029
|
}
|
|
1030
1030
|
// Check for progress shorthand: `| 80%` or `| t:X, 80%`
|
|
1031
1031
|
for (const part of segments.slice(1).join(',').split(',')) {
|
|
@@ -1037,8 +1037,8 @@ export function parseGantt(
|
|
|
1037
1037
|
}
|
|
1038
1038
|
|
|
1039
1039
|
// Reject lag/lead — use offset instead
|
|
1040
|
-
if (metadata
|
|
1041
|
-
const key = metadata
|
|
1040
|
+
if (metadata['lag'] || metadata['lead']) {
|
|
1041
|
+
const key = metadata['lag'] ? 'lag' : 'lead';
|
|
1042
1042
|
softError(
|
|
1043
1043
|
ln,
|
|
1044
1044
|
`"${key}" is no longer supported — use "offset: ${metadata[key]}" instead.${key === 'lead' ? ' Negate the value for lead behavior: "offset: -...".' : ''}`
|
|
@@ -1047,8 +1047,8 @@ export function parseGantt(
|
|
|
1047
1047
|
|
|
1048
1048
|
// Extract task-level offset from metadata
|
|
1049
1049
|
let taskOffset: Offset | undefined;
|
|
1050
|
-
if (metadata
|
|
1051
|
-
const raw = metadata
|
|
1050
|
+
if (metadata['offset']) {
|
|
1051
|
+
const raw = metadata['offset'];
|
|
1052
1052
|
if (raw.trim().startsWith('+')) {
|
|
1053
1053
|
warn(
|
|
1054
1054
|
ln,
|
|
@@ -1063,7 +1063,7 @@ export function parseGantt(
|
|
|
1063
1063
|
);
|
|
1064
1064
|
}
|
|
1065
1065
|
}
|
|
1066
|
-
delete metadata
|
|
1066
|
+
delete metadata['offset'];
|
|
1067
1067
|
}
|
|
1068
1068
|
|
|
1069
1069
|
// Inherit metadata from parent groups (tag inheritance)
|
package/src/gantt/renderer.ts
CHANGED
|
@@ -1973,7 +1973,7 @@ function renderTagLegend(
|
|
|
1973
1973
|
isDark: boolean,
|
|
1974
1974
|
hasCriticalPath: boolean,
|
|
1975
1975
|
criticalPathActive: boolean,
|
|
1976
|
-
|
|
1976
|
+
_optionLineNumbers: Record<string, number>,
|
|
1977
1977
|
onToggle?: (groupName: string) => void,
|
|
1978
1978
|
onToggleControlsExpand?: () => void,
|
|
1979
1979
|
currentSwimlaneGroup?: string | null,
|
|
@@ -3633,7 +3633,7 @@ function resolveTaskColor(
|
|
|
3633
3633
|
function renderTimeScaleHorizontal(
|
|
3634
3634
|
g: d3Selection.Selection<SVGGElement, unknown, null, undefined>,
|
|
3635
3635
|
scale: d3Scale.ScaleLinear<number, number>,
|
|
3636
|
-
|
|
3636
|
+
_innerWidth: number,
|
|
3637
3637
|
innerHeight: number,
|
|
3638
3638
|
textColor: string
|
|
3639
3639
|
): void {
|
|
@@ -663,7 +663,7 @@ export function looksLikeFlowchart(content: string): boolean {
|
|
|
663
663
|
// Symbol extraction (for completion API)
|
|
664
664
|
// ============================================================
|
|
665
665
|
|
|
666
|
-
import type { DiagramSymbols } from '../completion';
|
|
666
|
+
import type { DiagramSymbols } from '../completion-types';
|
|
667
667
|
|
|
668
668
|
// Node ID: identifier at line start followed by a shape delimiter or space (arrow line)
|
|
669
669
|
const NODE_ID_RE = /^([a-zA-Z_][\w-]*)[\s([</{]/;
|
|
@@ -623,7 +623,7 @@ export function renderFlowchart(
|
|
|
623
623
|
}
|
|
624
624
|
|
|
625
625
|
// Render nodes (top layer)
|
|
626
|
-
const colorOff = graph.options?.color === 'off';
|
|
626
|
+
const colorOff = graph.options?.['color'] === 'off';
|
|
627
627
|
const solid = graph.options?.['solid-fill'] === 'on';
|
|
628
628
|
for (const node of layout.nodes) {
|
|
629
629
|
const nodeG = contentG
|
|
@@ -431,7 +431,7 @@ export function renderState(
|
|
|
431
431
|
}
|
|
432
432
|
|
|
433
433
|
// Render nodes (top layer)
|
|
434
|
-
const colorOff = graph.options?.color === 'off';
|
|
434
|
+
const colorOff = graph.options?.['color'] === 'off';
|
|
435
435
|
const solid = graph.options?.['solid-fill'] === 'on';
|
|
436
436
|
for (const node of layout.nodes) {
|
|
437
437
|
const isCollapsedGroup = collapsedGroupIds.has(node.id);
|