@diagrammo/dgmo 0.8.20 → 0.8.22
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/AGENTS.md +2 -1
- package/README.md +1 -0
- package/dist/cli.cjs +142 -90
- package/dist/editor.cjs +30 -4
- package/dist/editor.cjs.map +1 -1
- package/dist/editor.js +30 -4
- package/dist/editor.js.map +1 -1
- package/dist/highlight.cjs +25 -3
- package/dist/highlight.cjs.map +1 -1
- package/dist/highlight.js +25 -3
- package/dist/highlight.js.map +1 -1
- package/dist/index.cjs +21201 -12886
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +646 -89
- package/dist/index.d.ts +646 -89
- package/dist/index.js +21178 -12889
- package/dist/index.js.map +1 -1
- package/docs/guide/chart-mindmap.md +198 -0
- package/docs/guide/chart-sequence.md +23 -1
- package/docs/guide/chart-sitemap.md +18 -1
- package/docs/guide/chart-tech-radar.md +219 -0
- package/docs/guide/chart-wireframe.md +100 -0
- package/docs/guide/index.md +8 -0
- package/docs/guide/registry.json +1 -0
- package/docs/language-reference.md +249 -4
- package/gallery/fixtures/boxes-and-lines.dgmo +10 -3
- package/gallery/fixtures/c4-full.dgmo +2 -2
- package/gallery/fixtures/cycle/ooda-loop.dgmo +25 -0
- package/gallery/fixtures/cycle/pdca-circle-nodes.dgmo +12 -0
- package/gallery/fixtures/cycle/pdca-minimal.dgmo +6 -0
- package/gallery/fixtures/cycle/sprint-cycle-span.dgmo +17 -0
- package/gallery/fixtures/gantt-full.dgmo +2 -2
- package/gallery/fixtures/gantt.dgmo +2 -2
- package/gallery/fixtures/infra-full.dgmo +2 -2
- package/gallery/fixtures/infra.dgmo +1 -1
- package/gallery/fixtures/sequence-tags-protocols.dgmo +2 -2
- package/gallery/fixtures/sequence-tags.dgmo +2 -2
- package/gallery/fixtures/tech-radar-dense.dgmo +77 -0
- package/gallery/fixtures/tech-radar.dgmo +36 -0
- package/gallery/fixtures/timeline.dgmo +1 -1
- package/package.json +1 -1
- package/src/boxes-and-lines/collapse.ts +21 -3
- package/src/boxes-and-lines/layout.ts +360 -42
- package/src/boxes-and-lines/parser.ts +94 -11
- package/src/boxes-and-lines/renderer.ts +371 -114
- package/src/boxes-and-lines/types.ts +2 -1
- package/src/c4/layout.ts +8 -8
- package/src/c4/parser.ts +35 -2
- package/src/c4/renderer.ts +19 -3
- package/src/c4/types.ts +1 -0
- package/src/chart.ts +14 -7
- package/src/completion.ts +253 -0
- package/src/cycle/layout.ts +732 -0
- package/src/cycle/parser.ts +352 -0
- package/src/cycle/renderer.ts +539 -0
- package/src/cycle/types.ts +77 -0
- package/src/d3.ts +240 -40
- package/src/dgmo-router.ts +15 -0
- package/src/echarts.ts +7 -4
- package/src/editor/dgmo.grammar +5 -1
- package/src/editor/dgmo.grammar.js +1 -1
- package/src/editor/keywords.ts +26 -0
- package/src/gantt/parser.ts +2 -8
- package/src/graph/flowchart-parser.ts +15 -21
- package/src/graph/layout.ts +73 -9
- package/src/graph/state-collapse.ts +78 -0
- package/src/graph/state-parser.ts +5 -10
- package/src/graph/state-renderer.ts +139 -34
- package/src/index.ts +78 -0
- package/src/infra/layout.ts +218 -74
- package/src/infra/parser.ts +30 -6
- package/src/infra/renderer.ts +14 -8
- package/src/infra/types.ts +10 -3
- package/src/journey-map/layout.ts +386 -0
- package/src/journey-map/parser.ts +540 -0
- package/src/journey-map/renderer.ts +1456 -0
- package/src/journey-map/types.ts +47 -0
- package/src/kanban/parser.ts +3 -10
- package/src/kanban/renderer.ts +325 -63
- package/src/mindmap/collapse.ts +88 -0
- package/src/mindmap/layout.ts +605 -0
- package/src/mindmap/parser.ts +373 -0
- package/src/mindmap/renderer.ts +544 -0
- package/src/mindmap/text-wrap.ts +217 -0
- package/src/mindmap/types.ts +55 -0
- package/src/org/parser.ts +2 -6
- package/src/render.ts +18 -21
- package/src/sequence/renderer.ts +273 -56
- package/src/sharing.ts +3 -0
- package/src/sitemap/layout.ts +56 -18
- package/src/sitemap/parser.ts +26 -17
- package/src/sitemap/renderer.ts +34 -0
- package/src/sitemap/types.ts +1 -0
- package/src/tech-radar/index.ts +14 -0
- package/src/tech-radar/interactive.ts +1058 -0
- package/src/tech-radar/layout.ts +190 -0
- package/src/tech-radar/parser.ts +385 -0
- package/src/tech-radar/renderer.ts +1159 -0
- package/src/tech-radar/shared.ts +187 -0
- package/src/tech-radar/types.ts +81 -0
- package/src/utils/description-helpers.ts +33 -0
- package/src/utils/export-container.ts +3 -2
- package/src/utils/legend-d3.ts +1 -0
- package/src/utils/legend-layout.ts +5 -3
- package/src/utils/parsing.ts +48 -7
- package/src/utils/tag-groups.ts +46 -60
- package/src/wireframe/layout.ts +460 -0
- package/src/wireframe/parser.ts +956 -0
- package/src/wireframe/renderer.ts +1293 -0
- package/src/wireframe/types.ts +110 -0
package/src/sitemap/parser.ts
CHANGED
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
ALL_CHART_TYPES,
|
|
26
26
|
} from '../utils/parsing';
|
|
27
27
|
import type { SitemapNode, ParsedSitemap } from './types';
|
|
28
|
+
import { tryStripDescriptionKeyword } from '../utils/description-helpers';
|
|
28
29
|
|
|
29
30
|
// ============================================================
|
|
30
31
|
// Regexes
|
|
@@ -370,13 +371,7 @@ export function parseSitemap(
|
|
|
370
371
|
: trimmed.match(METADATA_RE);
|
|
371
372
|
|
|
372
373
|
if (containerMatch) {
|
|
373
|
-
const
|
|
374
|
-
const { label, color } = extractColor(
|
|
375
|
-
rawLabel,
|
|
376
|
-
palette,
|
|
377
|
-
result.diagnostics,
|
|
378
|
-
lineNumber
|
|
379
|
-
);
|
|
374
|
+
const label = containerMatch[1].trim();
|
|
380
375
|
|
|
381
376
|
// Parse optional pipe metadata on the container line
|
|
382
377
|
const pipeStr = containerMatch[2];
|
|
@@ -399,7 +394,6 @@ export function parseSitemap(
|
|
|
399
394
|
parentId: null,
|
|
400
395
|
isContainer: true,
|
|
401
396
|
lineNumber,
|
|
402
|
-
color,
|
|
403
397
|
};
|
|
404
398
|
|
|
405
399
|
attachNode(node, indent, indentStack, result);
|
|
@@ -435,6 +429,17 @@ export function parseSitemap(
|
|
|
435
429
|
pushError(lineNumber, 'Metadata has no parent node');
|
|
436
430
|
}
|
|
437
431
|
} else {
|
|
432
|
+
// Check if this is a description line for a parent node
|
|
433
|
+
const descResult = tryStripDescriptionKeyword(trimmed);
|
|
434
|
+
if (descResult.isKeyword && indentStack.length > 0) {
|
|
435
|
+
const parent = findParentNode(indent, indentStack);
|
|
436
|
+
if (parent) {
|
|
437
|
+
if (!parent.description) parent.description = [];
|
|
438
|
+
parent.description.push(descResult.text.trim());
|
|
439
|
+
continue;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
438
443
|
// Node label — possibly with pipe-delimited metadata
|
|
439
444
|
const node = parseNodeLabel(
|
|
440
445
|
trimmed,
|
|
@@ -531,31 +536,35 @@ function parseNodeLabel(
|
|
|
531
536
|
counter: number,
|
|
532
537
|
aliasMap: Map<string, string> = new Map(),
|
|
533
538
|
warnFn?: (line: number, msg: string) => void,
|
|
534
|
-
|
|
539
|
+
_diagnostics?: DgmoError[]
|
|
535
540
|
): SitemapNode {
|
|
536
541
|
const segments = trimmed.split('|').map((s) => s.trim());
|
|
537
|
-
const
|
|
538
|
-
const { label, color } = extractColor(
|
|
539
|
-
rawLabel,
|
|
540
|
-
palette,
|
|
541
|
-
diagnostics,
|
|
542
|
-
lineNumber
|
|
543
|
-
);
|
|
542
|
+
const label = segments[0];
|
|
544
543
|
const metadata = parsePipeMetadata(
|
|
545
544
|
segments,
|
|
546
545
|
aliasMap,
|
|
547
546
|
warnFn ? () => warnFn(lineNumber, MULTIPLE_PIPE_ERROR) : undefined
|
|
548
547
|
);
|
|
549
548
|
|
|
549
|
+
// Extract description from pipe metadata into dedicated field
|
|
550
|
+
let description: string[] | undefined;
|
|
551
|
+
if ('description' in metadata) {
|
|
552
|
+
const descVal = metadata['description'].trim();
|
|
553
|
+
if (descVal) {
|
|
554
|
+
description = [descVal];
|
|
555
|
+
}
|
|
556
|
+
delete metadata['description'];
|
|
557
|
+
}
|
|
558
|
+
|
|
550
559
|
return {
|
|
551
560
|
id: `node-${counter}`,
|
|
552
561
|
label,
|
|
553
562
|
metadata,
|
|
563
|
+
description,
|
|
554
564
|
children: [],
|
|
555
565
|
parentId: null,
|
|
556
566
|
isContainer: false,
|
|
557
567
|
lineNumber,
|
|
558
|
-
color,
|
|
559
568
|
};
|
|
560
569
|
}
|
|
561
570
|
|
package/src/sitemap/renderer.ts
CHANGED
|
@@ -9,6 +9,8 @@ import type { PaletteColors } from '../palettes';
|
|
|
9
9
|
import { mix } from '../palettes/color-utils';
|
|
10
10
|
import type { ParsedSitemap } from './types';
|
|
11
11
|
import type { SitemapLayoutResult, SitemapLegendGroup } from './layout';
|
|
12
|
+
import { renderInlineText } from '../utils/inline-markdown';
|
|
13
|
+
import { preprocessDescriptionLine } from '../utils/description-helpers';
|
|
12
14
|
import {
|
|
13
15
|
LEGEND_HEIGHT,
|
|
14
16
|
LEGEND_GROUP_GAP,
|
|
@@ -522,6 +524,38 @@ export function renderSitemap(
|
|
|
522
524
|
}
|
|
523
525
|
}
|
|
524
526
|
|
|
527
|
+
// Description lines (after metadata)
|
|
528
|
+
if (node.description && node.description.length > 0) {
|
|
529
|
+
const metaCount = Object.keys(node.metadata).length;
|
|
530
|
+
// Separator line before descriptions
|
|
531
|
+
const sepY =
|
|
532
|
+
metaCount > 0
|
|
533
|
+
? HEADER_HEIGHT + SEPARATOR_GAP + metaCount * META_LINE_HEIGHT
|
|
534
|
+
: HEADER_HEIGHT;
|
|
535
|
+
nodeG
|
|
536
|
+
.append('line')
|
|
537
|
+
.attr('x1', 0)
|
|
538
|
+
.attr('y1', sepY)
|
|
539
|
+
.attr('x2', node.width)
|
|
540
|
+
.attr('y2', sepY)
|
|
541
|
+
.attr('stroke', stroke)
|
|
542
|
+
.attr('stroke-opacity', 0.3);
|
|
543
|
+
|
|
544
|
+
const descStartY =
|
|
545
|
+
HEADER_HEIGHT + SEPARATOR_GAP + metaCount * META_LINE_HEIGHT;
|
|
546
|
+
for (let di = 0; di < node.description.length; di++) {
|
|
547
|
+
const processed = preprocessDescriptionLine(node.description[di]);
|
|
548
|
+
const rowY = descStartY + (di + 1) * META_LINE_HEIGHT - 4;
|
|
549
|
+
const textEl = nodeG
|
|
550
|
+
.append('text')
|
|
551
|
+
.attr('x', 10)
|
|
552
|
+
.attr('y', rowY)
|
|
553
|
+
.attr('fill', palette.textMuted)
|
|
554
|
+
.attr('font-size', META_FONT_SIZE);
|
|
555
|
+
renderInlineText(textEl, processed, palette, META_FONT_SIZE);
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
|
|
525
559
|
// Collapsed accent bar
|
|
526
560
|
if (!exportDims && node.hiddenCount && node.hiddenCount > 0) {
|
|
527
561
|
const clipId = `clip-${node.id}`;
|
package/src/sitemap/types.ts
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { parseTechRadar } from './parser';
|
|
2
|
+
export { computeRadarLayout, getRadarGeometry } from './layout';
|
|
3
|
+
export { renderTechRadar, renderTechRadarForExport } from './renderer';
|
|
4
|
+
export { renderQuadrantFocus } from './interactive';
|
|
5
|
+
export type {
|
|
6
|
+
ParsedTechRadar,
|
|
7
|
+
TechRadarRing,
|
|
8
|
+
TechRadarQuadrant,
|
|
9
|
+
TechRadarBlip,
|
|
10
|
+
TechRadarLayoutPoint,
|
|
11
|
+
QuadrantPosition,
|
|
12
|
+
BlipTrend,
|
|
13
|
+
TechRadarRenderOptions,
|
|
14
|
+
} from './types';
|