@diagrammo/dgmo 0.8.5 → 0.8.6
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 +33 -0
- package/.cursorrules +20 -2
- package/.github/copilot-instructions.md +20 -2
- package/.windsurfrules +20 -2
- package/AGENTS.md +23 -3
- package/dist/cli.cjs +189 -190
- package/dist/editor.cjs +3 -18
- package/dist/editor.cjs.map +1 -1
- package/dist/editor.js +3 -18
- package/dist/editor.js.map +1 -1
- package/dist/highlight.cjs +4 -21
- package/dist/highlight.cjs.map +1 -1
- package/dist/highlight.js +4 -21
- package/dist/highlight.js.map +1 -1
- package/dist/index.cjs +2785 -2996
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +56 -56
- package/dist/index.d.ts +56 -56
- package/dist/index.js +2780 -2989
- package/dist/index.js.map +1 -1
- package/docs/ai-integration.md +1 -1
- package/docs/language-reference.md +97 -25
- package/gallery/fixtures/boxes-and-lines.dgmo +64 -0
- package/package.json +1 -1
- package/src/boxes-and-lines/collapse.ts +78 -0
- package/src/boxes-and-lines/layout.ts +319 -0
- package/src/boxes-and-lines/parser.ts +694 -0
- package/src/boxes-and-lines/renderer.ts +848 -0
- package/src/boxes-and-lines/types.ts +40 -0
- package/src/c4/parser.ts +10 -5
- package/src/c4/renderer.ts +232 -56
- package/src/chart.ts +9 -4
- package/src/cli.ts +6 -5
- package/src/completion.ts +25 -33
- package/src/d3.ts +26 -27
- package/src/dgmo-router.ts +3 -7
- package/src/echarts.ts +38 -2
- package/src/editor/keywords.ts +4 -19
- package/src/er/parser.ts +10 -4
- package/src/gantt/parser.ts +7 -4
- package/src/gantt/renderer.ts +3 -5
- package/src/index.ts +17 -26
- package/src/infra/parser.ts +7 -5
- package/src/infra/renderer.ts +2 -2
- package/src/kanban/parser.ts +7 -5
- package/src/kanban/renderer.ts +43 -18
- package/src/org/parser.ts +7 -4
- package/src/org/renderer.ts +40 -29
- package/src/sequence/parser.ts +11 -5
- package/src/sequence/renderer.ts +114 -45
- package/src/sitemap/parser.ts +8 -4
- package/src/sitemap/renderer.ts +137 -57
- package/src/utils/legend-svg.ts +44 -20
- package/src/utils/parsing.ts +1 -1
- package/src/utils/tag-groups.ts +21 -1
- package/gallery/fixtures/initiative-status-full.dgmo +0 -46
- package/gallery/fixtures/initiative-status-phases.dgmo +0 -29
- package/gallery/fixtures/initiative-status.dgmo +0 -9
- package/src/initiative-status/collapse.ts +0 -76
- package/src/initiative-status/filter.ts +0 -63
- package/src/initiative-status/layout.ts +0 -650
- package/src/initiative-status/parser.ts +0 -629
- package/src/initiative-status/renderer.ts +0 -1199
- package/src/initiative-status/types.ts +0 -57
package/dist/index.d.cts
CHANGED
|
@@ -277,6 +277,7 @@ declare function parseChart(content: string, palette?: PaletteColors): ParsedCha
|
|
|
277
277
|
*/
|
|
278
278
|
declare function parseDataRowValues(line: string, options?: {
|
|
279
279
|
multiValue?: boolean;
|
|
280
|
+
expectedValues?: number;
|
|
280
281
|
}): {
|
|
281
282
|
label: string;
|
|
282
283
|
values: number[];
|
|
@@ -455,7 +456,7 @@ interface TagGroup {
|
|
|
455
456
|
name: string;
|
|
456
457
|
alias?: string;
|
|
457
458
|
entries: TagEntry[];
|
|
458
|
-
/**
|
|
459
|
+
/** Default value for nodes without explicit metadata. First entry unless another is marked `default`. */
|
|
459
460
|
defaultValue?: string;
|
|
460
461
|
lineNumber: number;
|
|
461
462
|
}
|
|
@@ -1508,122 +1509,121 @@ declare function renderC4Deployment(container: HTMLDivElement, parsed: ParsedC4,
|
|
|
1508
1509
|
*/
|
|
1509
1510
|
declare function renderC4DeploymentForExport(content: string, theme: 'light' | 'dark' | 'transparent', palette: PaletteColors): string;
|
|
1510
1511
|
|
|
1511
|
-
|
|
1512
|
-
interface ISNode {
|
|
1512
|
+
interface BLNode {
|
|
1513
1513
|
label: string;
|
|
1514
|
-
status: InitiativeStatus;
|
|
1515
|
-
shape: ParticipantType;
|
|
1516
1514
|
lineNumber: number;
|
|
1517
1515
|
metadata: Record<string, string>;
|
|
1516
|
+
description?: string;
|
|
1518
1517
|
}
|
|
1519
|
-
interface
|
|
1518
|
+
interface BLEdge {
|
|
1520
1519
|
source: string;
|
|
1521
1520
|
target: string;
|
|
1522
1521
|
label?: string;
|
|
1523
|
-
|
|
1522
|
+
bidirectional: boolean;
|
|
1524
1523
|
lineNumber: number;
|
|
1525
1524
|
metadata: Record<string, string>;
|
|
1526
1525
|
}
|
|
1527
|
-
interface
|
|
1526
|
+
interface BLGroup {
|
|
1528
1527
|
label: string;
|
|
1529
|
-
|
|
1528
|
+
children: string[];
|
|
1530
1529
|
lineNumber: number;
|
|
1531
|
-
metadata
|
|
1530
|
+
metadata: Record<string, string>;
|
|
1532
1531
|
}
|
|
1533
|
-
interface
|
|
1534
|
-
type: '
|
|
1532
|
+
interface ParsedBoxesAndLines {
|
|
1533
|
+
type: 'boxes-and-lines';
|
|
1535
1534
|
title: string | null;
|
|
1536
1535
|
titleLineNumber: number | null;
|
|
1537
|
-
nodes:
|
|
1538
|
-
edges:
|
|
1539
|
-
groups:
|
|
1536
|
+
nodes: BLNode[];
|
|
1537
|
+
edges: BLEdge[];
|
|
1538
|
+
groups: BLGroup[];
|
|
1540
1539
|
tagGroups: TagGroup[];
|
|
1541
1540
|
options: Record<string, string>;
|
|
1542
|
-
/** Initial hidden tag values from `hide:` DSL directive. Map<groupKey, Set<values>> */
|
|
1543
1541
|
initialHiddenTagValues: Map<string, Set<string>>;
|
|
1542
|
+
direction: 'LR' | 'TB';
|
|
1544
1543
|
diagnostics: DgmoError[];
|
|
1545
1544
|
error: string | null;
|
|
1546
1545
|
}
|
|
1547
1546
|
|
|
1548
|
-
|
|
1549
|
-
* Returns true if the content looks like an initiative-status diagram.
|
|
1550
|
-
* Detects `->` arrows combined with `| done/wip/todo/na` status markers.
|
|
1551
|
-
*/
|
|
1552
|
-
declare function looksLikeInitiativeStatus(content: string): boolean;
|
|
1553
|
-
declare function parseInitiativeStatus(content: string): ParsedInitiativeStatus;
|
|
1554
|
-
|
|
1555
|
-
interface CollapseResult {
|
|
1556
|
-
parsed: ParsedInitiativeStatus;
|
|
1557
|
-
collapsedGroupStatuses: Map<string, InitiativeStatus>;
|
|
1558
|
-
originalGroups: ISGroup[];
|
|
1559
|
-
}
|
|
1560
|
-
declare function collapseInitiativeStatus(parsed: ParsedInitiativeStatus, collapsedGroups: Set<string>): CollapseResult;
|
|
1547
|
+
declare function parseBoxesAndLines(content: string): ParsedBoxesAndLines;
|
|
1561
1548
|
|
|
1562
|
-
interface
|
|
1549
|
+
interface BLLayoutNode {
|
|
1563
1550
|
label: string;
|
|
1564
|
-
status: InitiativeStatus;
|
|
1565
|
-
shape: ParticipantType;
|
|
1566
|
-
lineNumber: number;
|
|
1567
1551
|
x: number;
|
|
1568
1552
|
y: number;
|
|
1569
1553
|
width: number;
|
|
1570
1554
|
height: number;
|
|
1571
|
-
metadata: Record<string, string>;
|
|
1572
1555
|
}
|
|
1573
|
-
interface
|
|
1556
|
+
interface BLLayoutEdge {
|
|
1574
1557
|
source: string;
|
|
1575
1558
|
target: string;
|
|
1576
1559
|
label?: string;
|
|
1577
|
-
|
|
1560
|
+
bidirectional: boolean;
|
|
1578
1561
|
lineNumber: number;
|
|
1579
1562
|
points: {
|
|
1580
1563
|
x: number;
|
|
1581
1564
|
y: number;
|
|
1582
1565
|
}[];
|
|
1566
|
+
labelX?: number;
|
|
1567
|
+
labelY?: number;
|
|
1568
|
+
yOffset: number;
|
|
1583
1569
|
parallelCount: number;
|
|
1570
|
+
metadata: Record<string, string>;
|
|
1584
1571
|
}
|
|
1585
|
-
interface
|
|
1572
|
+
interface BLLayoutGroup {
|
|
1586
1573
|
label: string;
|
|
1587
|
-
|
|
1574
|
+
lineNumber: number;
|
|
1588
1575
|
x: number;
|
|
1589
1576
|
y: number;
|
|
1590
1577
|
width: number;
|
|
1591
1578
|
height: number;
|
|
1592
|
-
lineNumber: number;
|
|
1593
1579
|
collapsed: boolean;
|
|
1580
|
+
childCount?: number;
|
|
1594
1581
|
}
|
|
1595
|
-
interface
|
|
1596
|
-
nodes:
|
|
1597
|
-
edges:
|
|
1598
|
-
groups:
|
|
1582
|
+
interface BLLayoutResult {
|
|
1583
|
+
nodes: BLLayoutNode[];
|
|
1584
|
+
edges: BLLayoutEdge[];
|
|
1585
|
+
groups: BLLayoutGroup[];
|
|
1599
1586
|
width: number;
|
|
1600
1587
|
height: number;
|
|
1601
1588
|
}
|
|
1602
|
-
declare function
|
|
1589
|
+
declare function layoutBoxesAndLines(parsed: ParsedBoxesAndLines, collapseInfo?: {
|
|
1590
|
+
collapsedChildCounts: Map<string, number>;
|
|
1591
|
+
originalGroups: BLGroup[];
|
|
1592
|
+
}): BLLayoutResult;
|
|
1603
1593
|
|
|
1604
|
-
interface
|
|
1594
|
+
interface BLRenderOptions {
|
|
1605
1595
|
onClickItem?: (lineNumber: number) => void;
|
|
1606
1596
|
exportDims?: {
|
|
1607
1597
|
width?: number;
|
|
1608
1598
|
height?: number;
|
|
1609
1599
|
};
|
|
1610
|
-
legendActive?: boolean | null;
|
|
1611
1600
|
activeTagGroup?: string | null;
|
|
1612
1601
|
hiddenTagValues?: Map<string, Set<string>>;
|
|
1613
|
-
tagGroups?: TagGroup[];
|
|
1614
1602
|
}
|
|
1615
|
-
declare function
|
|
1616
|
-
declare function
|
|
1603
|
+
declare function renderBoxesAndLines(container: HTMLDivElement, parsed: ParsedBoxesAndLines, layout: BLLayoutResult, palette: PaletteColors, isDark: boolean, options?: BLRenderOptions): void;
|
|
1604
|
+
declare function renderBoxesAndLinesForExport(container: HTMLDivElement, parsed: ParsedBoxesAndLines, layout: BLLayoutResult, palette: PaletteColors, isDark: boolean, options?: {
|
|
1605
|
+
exportDims?: {
|
|
1606
|
+
width: number;
|
|
1607
|
+
height: number;
|
|
1608
|
+
};
|
|
1609
|
+
}): void;
|
|
1617
1610
|
|
|
1611
|
+
interface BLCollapseResult {
|
|
1612
|
+
parsed: ParsedBoxesAndLines;
|
|
1613
|
+
collapsedChildCounts: Map<string, number>;
|
|
1614
|
+
originalGroups: BLGroup[];
|
|
1615
|
+
}
|
|
1618
1616
|
/**
|
|
1619
|
-
*
|
|
1620
|
-
*
|
|
1617
|
+
* Pure transform: returns a new ParsedBoxesAndLines with collapsed groups
|
|
1618
|
+
* removed from the diagram content.
|
|
1621
1619
|
*
|
|
1622
|
-
*
|
|
1623
|
-
*
|
|
1624
|
-
*
|
|
1620
|
+
* - Children of collapsed groups removed from nodes
|
|
1621
|
+
* - Edges redirected: endpoints in collapsed groups → group ID
|
|
1622
|
+
* - Internal edges (both in same collapsed group) dropped
|
|
1623
|
+
* - Duplicate edges (same source, target, label) deduplicated
|
|
1624
|
+
* - Collapsed groups removed from groups[] (layout handles as nodes)
|
|
1625
1625
|
*/
|
|
1626
|
-
declare function
|
|
1626
|
+
declare function collapseBoxesAndLines(parsed: ParsedBoxesAndLines, collapsedGroups: Set<string>): BLCollapseResult;
|
|
1627
1627
|
|
|
1628
1628
|
interface SitemapNode {
|
|
1629
1629
|
id: string;
|
|
@@ -2446,4 +2446,4 @@ declare function parseFirstLine(line: string): {
|
|
|
2446
2446
|
*/
|
|
2447
2447
|
declare function injectBranding(svgHtml: string, mutedColor: string): string;
|
|
2448
2448
|
|
|
2449
|
-
export { ALL_CHART_TYPES, type Activation, type ArcLink, type ArcNodeGroup, type C4ArrowType, type C4DeploymentNode, type C4Element, type C4ElementType, type C4Group, type C4LayoutBoundary, type C4LayoutEdge, type C4LayoutNode, type C4LayoutResult, type C4LegendEntry, type C4LegendGroup, type C4Relationship, type C4Shape, type C4TagEntry, type C4TagGroup, CHART_TYPES, COMPLETION_REGISTRY, type ChartDataPoint, type ChartEra, type ChartType$1 as ChartType, type ClassLayoutEdge, type ClassLayoutNode, type ClassLayoutResult, type ClassMember, type ClassModifier, type ClassNode, type ClassRelationship, type
|
|
2449
|
+
export { ALL_CHART_TYPES, type Activation, type ArcLink, type ArcNodeGroup, type BLCollapseResult, type BLEdge, type BLGroup, type BLLayoutEdge, type BLLayoutGroup, type BLLayoutNode, type BLLayoutResult, type BLNode, type C4ArrowType, type C4DeploymentNode, type C4Element, type C4ElementType, type C4Group, type C4LayoutBoundary, type C4LayoutEdge, type C4LayoutNode, type C4LayoutResult, type C4LegendEntry, type C4LegendGroup, type C4Relationship, type C4Shape, type C4TagEntry, type C4TagGroup, CHART_TYPES, COMPLETION_REGISTRY, type ChartDataPoint, type ChartEra, type ChartType$1 as ChartType, type ClassLayoutEdge, type ClassLayoutNode, type ClassLayoutResult, type ClassMember, type ClassModifier, type ClassNode, type ClassRelationship, type CollapsedOrgResult, type CollapsedSitemapResult, type ComputedInfraEdge, type ComputedInfraModel, type ComputedInfraNode, type ContextRelationship, type D3ExportDimensions, type DecodedDiagramUrl, type DgmoError, type DgmoSeverity, type DiagramSymbols, type DiagramViewState, type DirectiveSpec, type DirectiveValueSpec, type Duration, type DurationUnit, ENTITY_TYPES, type ERCardinality, type ERColumn, type ERConstraint, type ERLayoutEdge, type ERLayoutNode, type ERLayoutResult, type ERRelationship, type ERTable, type ElseIfBranch, type EncodeDiagramUrlOptions, type EncodeDiagramUrlResult, type ExtendedChartType, type ExtractFn, type GanttDependency, type GanttEra, type GanttGroup, type GroupRow as GanttGroupRow, type GanttHolidays, type GanttInteractiveOptions, type LaneHeaderRow as GanttLaneHeaderRow, type GanttMarker, type GanttNode, type GanttOptions, type GanttParallelBlock, type Row as GanttRow, type GanttTask, type TaskRow as GanttTaskRow, type GraphDirection, type GraphEdge, type GraphGroup, type GraphNode, type GraphShape, INFRA_BEHAVIOR_KEYS, type ImportSource, type InfraAvailabilityPercentiles, type InfraBehaviorKey, type InfraCbState, type InfraComputeParams, type InfraDiagnostic, type InfraEdge, type InfraGroup, type InfraLatencyPercentiles, type InfraLayoutEdge, type InfraLayoutGroup, type InfraLayoutNode, type InfraLayoutResult, type InfraLegendGroup, type InfraNode, type InfraPlaybackState, type InfraProperty, type InfraRole, type InfraTagGroup, type InlineSpan, type KanbanCard, type KanbanColumn, type KanbanTagEntry, type KanbanTagGroup, LEGEND_HEIGHT, type LayoutEdge, type LayoutGroup, type LayoutNode, type LayoutResult, type LegendGroupData, METADATA_KEY_SET, type MemberVisibility, type OrgContainerBounds, type OrgLayoutEdge, type OrgLayoutNode, type OrgLayoutResult, type OrgNode, PIPE_METADATA, type PaletteColors, type PaletteConfig, type ParsedBoxesAndLines, type ParsedC4, type ParsedChart, type ParsedClassDiagram, type ParsedERDiagram, type ParsedExtendedChart, type ParsedGantt, type ParsedGraph, type ParsedInfra, type ParsedKanban, type ParsedOrg, type ParsedQuadrant, type ParsedSequenceDgmo, type ParsedSitemap, type ParsedVisualization, type ParticipantType, type PipeKeySpec, RULE_COUNT, type ReadFileFn, type RelationshipType, type RenderCategory, type RenderStep, type ResolveImportsResult, type ResolvedGroup, type ResolvedSchedule, type ResolvedTask, type ScatterLabelPoint, type SectionMessageGroup, type SequenceBlock, type SequenceElement, type SequenceGroup, type SequenceMessage, type SequenceNote, type SequenceParticipant, type SequenceRenderOptions, type SequenceSection, type SitemapContainerBounds, type SitemapDirection, type SitemapEdge, type SitemapLayoutEdge, type SitemapLayoutNode, type SitemapLayoutResult, type SitemapLegendEntry, type SitemapLegendGroup, type SitemapNode, type TagEntry, type TagGroup, type VisualizationType, addDurationToDate, applyGroupOrdering, applyPositionOverrides, boldPalette, buildExtendedChartOption, buildMermaidQuadrant, buildMermaidThemeVars, buildNoteMessageMap, buildRenderSequence, buildSimpleChartOption, buildTagLaneRowList, buildThemeCSS, calculateSchedule, catppuccinPalette, collapseBoxesAndLines, collapseOrgTree, collapseSitemapTree, collectDiagramRoles, collectTasks, colorNames, computeActivations, computeCardArchive, computeCardMove, computeInfra, computeInfraLegendGroups, computeScatterLabelGraphics, computeTimeTicks, contrastText, decodeDiagramUrl, encodeDiagramUrl, extractDiagramSymbols, extractTagDeclarations, formatDateLabel, formatDgmoError, getAvailablePalettes, getExtendedChartLegendGroups, getPalette, getRenderCategory, getSeriesColors, getSimpleChartLegendGroups, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, inferRoles, injectBranding, isArchiveColumn, isExtendedChartType, isSequenceBlock, isSequenceNote, isValidHex, layoutBoxesAndLines, layoutC4Components, layoutC4Containers, layoutC4Context, layoutC4Deployment, layoutClassDiagram, layoutERDiagram, layoutGraph, layoutInfra, layoutOrg, layoutSitemap, looksLikeClassDiagram, looksLikeERDiagram, looksLikeFlowchart, looksLikeSequence, looksLikeSitemap, looksLikeState, makeDgmoError, mute, nord, nordPalette, oneDarkPalette, orderArcNodes, parseAndLayoutInfra, parseBoxesAndLines, parseC4, parseChart, parseClassDiagram, parseDataRowValues, parseDgmo, parseDgmoChartType, parseERDiagram, parseExtendedChart, parseFirstLine, parseFlowchart, parseGantt, parseInfra, parseInlineMarkdown, parseKanban, parseOrg, parseQuadrant, parseSequenceDgmo, parseSitemap, parseState, parseTimelineDate, parseVisualization, registerExtractor, registerPalette, render, renderArcDiagram, renderBoxesAndLines, renderBoxesAndLinesForExport, renderC4ComponentsForExport, renderC4Containers, renderC4ContainersForExport, renderC4Context, renderC4ContextForExport, renderC4Deployment, renderC4DeploymentForExport, renderClassDiagram, renderClassDiagramForExport, renderERDiagram, renderERDiagramForExport, renderExtendedChartForExport, renderFlowchart, renderFlowchartForExport, renderForExport, renderGantt, renderInfra, renderKanban, renderKanbanForExport, renderLegendSvg, renderOrg, renderOrgForExport, renderQuadrant, renderSequenceDiagram, renderSitemap, renderSitemapForExport, renderSlopeChart, renderState, renderStateForExport, renderTimeline, renderVenn, renderWordCloud, resolveColor, resolveOrgImports, resolveTaskName, rollUpContextRelationships, rosePinePalette, seriesColors, shade, solarizedPalette, tint, tokyoNightPalette, truncateBareUrl, validateComputed, validateInfra };
|
package/dist/index.d.ts
CHANGED
|
@@ -277,6 +277,7 @@ declare function parseChart(content: string, palette?: PaletteColors): ParsedCha
|
|
|
277
277
|
*/
|
|
278
278
|
declare function parseDataRowValues(line: string, options?: {
|
|
279
279
|
multiValue?: boolean;
|
|
280
|
+
expectedValues?: number;
|
|
280
281
|
}): {
|
|
281
282
|
label: string;
|
|
282
283
|
values: number[];
|
|
@@ -455,7 +456,7 @@ interface TagGroup {
|
|
|
455
456
|
name: string;
|
|
456
457
|
alias?: string;
|
|
457
458
|
entries: TagEntry[];
|
|
458
|
-
/**
|
|
459
|
+
/** Default value for nodes without explicit metadata. First entry unless another is marked `default`. */
|
|
459
460
|
defaultValue?: string;
|
|
460
461
|
lineNumber: number;
|
|
461
462
|
}
|
|
@@ -1508,122 +1509,121 @@ declare function renderC4Deployment(container: HTMLDivElement, parsed: ParsedC4,
|
|
|
1508
1509
|
*/
|
|
1509
1510
|
declare function renderC4DeploymentForExport(content: string, theme: 'light' | 'dark' | 'transparent', palette: PaletteColors): string;
|
|
1510
1511
|
|
|
1511
|
-
|
|
1512
|
-
interface ISNode {
|
|
1512
|
+
interface BLNode {
|
|
1513
1513
|
label: string;
|
|
1514
|
-
status: InitiativeStatus;
|
|
1515
|
-
shape: ParticipantType;
|
|
1516
1514
|
lineNumber: number;
|
|
1517
1515
|
metadata: Record<string, string>;
|
|
1516
|
+
description?: string;
|
|
1518
1517
|
}
|
|
1519
|
-
interface
|
|
1518
|
+
interface BLEdge {
|
|
1520
1519
|
source: string;
|
|
1521
1520
|
target: string;
|
|
1522
1521
|
label?: string;
|
|
1523
|
-
|
|
1522
|
+
bidirectional: boolean;
|
|
1524
1523
|
lineNumber: number;
|
|
1525
1524
|
metadata: Record<string, string>;
|
|
1526
1525
|
}
|
|
1527
|
-
interface
|
|
1526
|
+
interface BLGroup {
|
|
1528
1527
|
label: string;
|
|
1529
|
-
|
|
1528
|
+
children: string[];
|
|
1530
1529
|
lineNumber: number;
|
|
1531
|
-
metadata
|
|
1530
|
+
metadata: Record<string, string>;
|
|
1532
1531
|
}
|
|
1533
|
-
interface
|
|
1534
|
-
type: '
|
|
1532
|
+
interface ParsedBoxesAndLines {
|
|
1533
|
+
type: 'boxes-and-lines';
|
|
1535
1534
|
title: string | null;
|
|
1536
1535
|
titleLineNumber: number | null;
|
|
1537
|
-
nodes:
|
|
1538
|
-
edges:
|
|
1539
|
-
groups:
|
|
1536
|
+
nodes: BLNode[];
|
|
1537
|
+
edges: BLEdge[];
|
|
1538
|
+
groups: BLGroup[];
|
|
1540
1539
|
tagGroups: TagGroup[];
|
|
1541
1540
|
options: Record<string, string>;
|
|
1542
|
-
/** Initial hidden tag values from `hide:` DSL directive. Map<groupKey, Set<values>> */
|
|
1543
1541
|
initialHiddenTagValues: Map<string, Set<string>>;
|
|
1542
|
+
direction: 'LR' | 'TB';
|
|
1544
1543
|
diagnostics: DgmoError[];
|
|
1545
1544
|
error: string | null;
|
|
1546
1545
|
}
|
|
1547
1546
|
|
|
1548
|
-
|
|
1549
|
-
* Returns true if the content looks like an initiative-status diagram.
|
|
1550
|
-
* Detects `->` arrows combined with `| done/wip/todo/na` status markers.
|
|
1551
|
-
*/
|
|
1552
|
-
declare function looksLikeInitiativeStatus(content: string): boolean;
|
|
1553
|
-
declare function parseInitiativeStatus(content: string): ParsedInitiativeStatus;
|
|
1554
|
-
|
|
1555
|
-
interface CollapseResult {
|
|
1556
|
-
parsed: ParsedInitiativeStatus;
|
|
1557
|
-
collapsedGroupStatuses: Map<string, InitiativeStatus>;
|
|
1558
|
-
originalGroups: ISGroup[];
|
|
1559
|
-
}
|
|
1560
|
-
declare function collapseInitiativeStatus(parsed: ParsedInitiativeStatus, collapsedGroups: Set<string>): CollapseResult;
|
|
1547
|
+
declare function parseBoxesAndLines(content: string): ParsedBoxesAndLines;
|
|
1561
1548
|
|
|
1562
|
-
interface
|
|
1549
|
+
interface BLLayoutNode {
|
|
1563
1550
|
label: string;
|
|
1564
|
-
status: InitiativeStatus;
|
|
1565
|
-
shape: ParticipantType;
|
|
1566
|
-
lineNumber: number;
|
|
1567
1551
|
x: number;
|
|
1568
1552
|
y: number;
|
|
1569
1553
|
width: number;
|
|
1570
1554
|
height: number;
|
|
1571
|
-
metadata: Record<string, string>;
|
|
1572
1555
|
}
|
|
1573
|
-
interface
|
|
1556
|
+
interface BLLayoutEdge {
|
|
1574
1557
|
source: string;
|
|
1575
1558
|
target: string;
|
|
1576
1559
|
label?: string;
|
|
1577
|
-
|
|
1560
|
+
bidirectional: boolean;
|
|
1578
1561
|
lineNumber: number;
|
|
1579
1562
|
points: {
|
|
1580
1563
|
x: number;
|
|
1581
1564
|
y: number;
|
|
1582
1565
|
}[];
|
|
1566
|
+
labelX?: number;
|
|
1567
|
+
labelY?: number;
|
|
1568
|
+
yOffset: number;
|
|
1583
1569
|
parallelCount: number;
|
|
1570
|
+
metadata: Record<string, string>;
|
|
1584
1571
|
}
|
|
1585
|
-
interface
|
|
1572
|
+
interface BLLayoutGroup {
|
|
1586
1573
|
label: string;
|
|
1587
|
-
|
|
1574
|
+
lineNumber: number;
|
|
1588
1575
|
x: number;
|
|
1589
1576
|
y: number;
|
|
1590
1577
|
width: number;
|
|
1591
1578
|
height: number;
|
|
1592
|
-
lineNumber: number;
|
|
1593
1579
|
collapsed: boolean;
|
|
1580
|
+
childCount?: number;
|
|
1594
1581
|
}
|
|
1595
|
-
interface
|
|
1596
|
-
nodes:
|
|
1597
|
-
edges:
|
|
1598
|
-
groups:
|
|
1582
|
+
interface BLLayoutResult {
|
|
1583
|
+
nodes: BLLayoutNode[];
|
|
1584
|
+
edges: BLLayoutEdge[];
|
|
1585
|
+
groups: BLLayoutGroup[];
|
|
1599
1586
|
width: number;
|
|
1600
1587
|
height: number;
|
|
1601
1588
|
}
|
|
1602
|
-
declare function
|
|
1589
|
+
declare function layoutBoxesAndLines(parsed: ParsedBoxesAndLines, collapseInfo?: {
|
|
1590
|
+
collapsedChildCounts: Map<string, number>;
|
|
1591
|
+
originalGroups: BLGroup[];
|
|
1592
|
+
}): BLLayoutResult;
|
|
1603
1593
|
|
|
1604
|
-
interface
|
|
1594
|
+
interface BLRenderOptions {
|
|
1605
1595
|
onClickItem?: (lineNumber: number) => void;
|
|
1606
1596
|
exportDims?: {
|
|
1607
1597
|
width?: number;
|
|
1608
1598
|
height?: number;
|
|
1609
1599
|
};
|
|
1610
|
-
legendActive?: boolean | null;
|
|
1611
1600
|
activeTagGroup?: string | null;
|
|
1612
1601
|
hiddenTagValues?: Map<string, Set<string>>;
|
|
1613
|
-
tagGroups?: TagGroup[];
|
|
1614
1602
|
}
|
|
1615
|
-
declare function
|
|
1616
|
-
declare function
|
|
1603
|
+
declare function renderBoxesAndLines(container: HTMLDivElement, parsed: ParsedBoxesAndLines, layout: BLLayoutResult, palette: PaletteColors, isDark: boolean, options?: BLRenderOptions): void;
|
|
1604
|
+
declare function renderBoxesAndLinesForExport(container: HTMLDivElement, parsed: ParsedBoxesAndLines, layout: BLLayoutResult, palette: PaletteColors, isDark: boolean, options?: {
|
|
1605
|
+
exportDims?: {
|
|
1606
|
+
width: number;
|
|
1607
|
+
height: number;
|
|
1608
|
+
};
|
|
1609
|
+
}): void;
|
|
1617
1610
|
|
|
1611
|
+
interface BLCollapseResult {
|
|
1612
|
+
parsed: ParsedBoxesAndLines;
|
|
1613
|
+
collapsedChildCounts: Map<string, number>;
|
|
1614
|
+
originalGroups: BLGroup[];
|
|
1615
|
+
}
|
|
1618
1616
|
/**
|
|
1619
|
-
*
|
|
1620
|
-
*
|
|
1617
|
+
* Pure transform: returns a new ParsedBoxesAndLines with collapsed groups
|
|
1618
|
+
* removed from the diagram content.
|
|
1621
1619
|
*
|
|
1622
|
-
*
|
|
1623
|
-
*
|
|
1624
|
-
*
|
|
1620
|
+
* - Children of collapsed groups removed from nodes
|
|
1621
|
+
* - Edges redirected: endpoints in collapsed groups → group ID
|
|
1622
|
+
* - Internal edges (both in same collapsed group) dropped
|
|
1623
|
+
* - Duplicate edges (same source, target, label) deduplicated
|
|
1624
|
+
* - Collapsed groups removed from groups[] (layout handles as nodes)
|
|
1625
1625
|
*/
|
|
1626
|
-
declare function
|
|
1626
|
+
declare function collapseBoxesAndLines(parsed: ParsedBoxesAndLines, collapsedGroups: Set<string>): BLCollapseResult;
|
|
1627
1627
|
|
|
1628
1628
|
interface SitemapNode {
|
|
1629
1629
|
id: string;
|
|
@@ -2446,4 +2446,4 @@ declare function parseFirstLine(line: string): {
|
|
|
2446
2446
|
*/
|
|
2447
2447
|
declare function injectBranding(svgHtml: string, mutedColor: string): string;
|
|
2448
2448
|
|
|
2449
|
-
export { ALL_CHART_TYPES, type Activation, type ArcLink, type ArcNodeGroup, type C4ArrowType, type C4DeploymentNode, type C4Element, type C4ElementType, type C4Group, type C4LayoutBoundary, type C4LayoutEdge, type C4LayoutNode, type C4LayoutResult, type C4LegendEntry, type C4LegendGroup, type C4Relationship, type C4Shape, type C4TagEntry, type C4TagGroup, CHART_TYPES, COMPLETION_REGISTRY, type ChartDataPoint, type ChartEra, type ChartType$1 as ChartType, type ClassLayoutEdge, type ClassLayoutNode, type ClassLayoutResult, type ClassMember, type ClassModifier, type ClassNode, type ClassRelationship, type
|
|
2449
|
+
export { ALL_CHART_TYPES, type Activation, type ArcLink, type ArcNodeGroup, type BLCollapseResult, type BLEdge, type BLGroup, type BLLayoutEdge, type BLLayoutGroup, type BLLayoutNode, type BLLayoutResult, type BLNode, type C4ArrowType, type C4DeploymentNode, type C4Element, type C4ElementType, type C4Group, type C4LayoutBoundary, type C4LayoutEdge, type C4LayoutNode, type C4LayoutResult, type C4LegendEntry, type C4LegendGroup, type C4Relationship, type C4Shape, type C4TagEntry, type C4TagGroup, CHART_TYPES, COMPLETION_REGISTRY, type ChartDataPoint, type ChartEra, type ChartType$1 as ChartType, type ClassLayoutEdge, type ClassLayoutNode, type ClassLayoutResult, type ClassMember, type ClassModifier, type ClassNode, type ClassRelationship, type CollapsedOrgResult, type CollapsedSitemapResult, type ComputedInfraEdge, type ComputedInfraModel, type ComputedInfraNode, type ContextRelationship, type D3ExportDimensions, type DecodedDiagramUrl, type DgmoError, type DgmoSeverity, type DiagramSymbols, type DiagramViewState, type DirectiveSpec, type DirectiveValueSpec, type Duration, type DurationUnit, ENTITY_TYPES, type ERCardinality, type ERColumn, type ERConstraint, type ERLayoutEdge, type ERLayoutNode, type ERLayoutResult, type ERRelationship, type ERTable, type ElseIfBranch, type EncodeDiagramUrlOptions, type EncodeDiagramUrlResult, type ExtendedChartType, type ExtractFn, type GanttDependency, type GanttEra, type GanttGroup, type GroupRow as GanttGroupRow, type GanttHolidays, type GanttInteractiveOptions, type LaneHeaderRow as GanttLaneHeaderRow, type GanttMarker, type GanttNode, type GanttOptions, type GanttParallelBlock, type Row as GanttRow, type GanttTask, type TaskRow as GanttTaskRow, type GraphDirection, type GraphEdge, type GraphGroup, type GraphNode, type GraphShape, INFRA_BEHAVIOR_KEYS, type ImportSource, type InfraAvailabilityPercentiles, type InfraBehaviorKey, type InfraCbState, type InfraComputeParams, type InfraDiagnostic, type InfraEdge, type InfraGroup, type InfraLatencyPercentiles, type InfraLayoutEdge, type InfraLayoutGroup, type InfraLayoutNode, type InfraLayoutResult, type InfraLegendGroup, type InfraNode, type InfraPlaybackState, type InfraProperty, type InfraRole, type InfraTagGroup, type InlineSpan, type KanbanCard, type KanbanColumn, type KanbanTagEntry, type KanbanTagGroup, LEGEND_HEIGHT, type LayoutEdge, type LayoutGroup, type LayoutNode, type LayoutResult, type LegendGroupData, METADATA_KEY_SET, type MemberVisibility, type OrgContainerBounds, type OrgLayoutEdge, type OrgLayoutNode, type OrgLayoutResult, type OrgNode, PIPE_METADATA, type PaletteColors, type PaletteConfig, type ParsedBoxesAndLines, type ParsedC4, type ParsedChart, type ParsedClassDiagram, type ParsedERDiagram, type ParsedExtendedChart, type ParsedGantt, type ParsedGraph, type ParsedInfra, type ParsedKanban, type ParsedOrg, type ParsedQuadrant, type ParsedSequenceDgmo, type ParsedSitemap, type ParsedVisualization, type ParticipantType, type PipeKeySpec, RULE_COUNT, type ReadFileFn, type RelationshipType, type RenderCategory, type RenderStep, type ResolveImportsResult, type ResolvedGroup, type ResolvedSchedule, type ResolvedTask, type ScatterLabelPoint, type SectionMessageGroup, type SequenceBlock, type SequenceElement, type SequenceGroup, type SequenceMessage, type SequenceNote, type SequenceParticipant, type SequenceRenderOptions, type SequenceSection, type SitemapContainerBounds, type SitemapDirection, type SitemapEdge, type SitemapLayoutEdge, type SitemapLayoutNode, type SitemapLayoutResult, type SitemapLegendEntry, type SitemapLegendGroup, type SitemapNode, type TagEntry, type TagGroup, type VisualizationType, addDurationToDate, applyGroupOrdering, applyPositionOverrides, boldPalette, buildExtendedChartOption, buildMermaidQuadrant, buildMermaidThemeVars, buildNoteMessageMap, buildRenderSequence, buildSimpleChartOption, buildTagLaneRowList, buildThemeCSS, calculateSchedule, catppuccinPalette, collapseBoxesAndLines, collapseOrgTree, collapseSitemapTree, collectDiagramRoles, collectTasks, colorNames, computeActivations, computeCardArchive, computeCardMove, computeInfra, computeInfraLegendGroups, computeScatterLabelGraphics, computeTimeTicks, contrastText, decodeDiagramUrl, encodeDiagramUrl, extractDiagramSymbols, extractTagDeclarations, formatDateLabel, formatDgmoError, getAvailablePalettes, getExtendedChartLegendGroups, getPalette, getRenderCategory, getSeriesColors, getSimpleChartLegendGroups, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, inferRoles, injectBranding, isArchiveColumn, isExtendedChartType, isSequenceBlock, isSequenceNote, isValidHex, layoutBoxesAndLines, layoutC4Components, layoutC4Containers, layoutC4Context, layoutC4Deployment, layoutClassDiagram, layoutERDiagram, layoutGraph, layoutInfra, layoutOrg, layoutSitemap, looksLikeClassDiagram, looksLikeERDiagram, looksLikeFlowchart, looksLikeSequence, looksLikeSitemap, looksLikeState, makeDgmoError, mute, nord, nordPalette, oneDarkPalette, orderArcNodes, parseAndLayoutInfra, parseBoxesAndLines, parseC4, parseChart, parseClassDiagram, parseDataRowValues, parseDgmo, parseDgmoChartType, parseERDiagram, parseExtendedChart, parseFirstLine, parseFlowchart, parseGantt, parseInfra, parseInlineMarkdown, parseKanban, parseOrg, parseQuadrant, parseSequenceDgmo, parseSitemap, parseState, parseTimelineDate, parseVisualization, registerExtractor, registerPalette, render, renderArcDiagram, renderBoxesAndLines, renderBoxesAndLinesForExport, renderC4ComponentsForExport, renderC4Containers, renderC4ContainersForExport, renderC4Context, renderC4ContextForExport, renderC4Deployment, renderC4DeploymentForExport, renderClassDiagram, renderClassDiagramForExport, renderERDiagram, renderERDiagramForExport, renderExtendedChartForExport, renderFlowchart, renderFlowchartForExport, renderForExport, renderGantt, renderInfra, renderKanban, renderKanbanForExport, renderLegendSvg, renderOrg, renderOrgForExport, renderQuadrant, renderSequenceDiagram, renderSitemap, renderSitemapForExport, renderSlopeChart, renderState, renderStateForExport, renderTimeline, renderVenn, renderWordCloud, resolveColor, resolveOrgImports, resolveTaskName, rollUpContextRelationships, rosePinePalette, seriesColors, shade, solarizedPalette, tint, tokyoNightPalette, truncateBareUrl, validateComputed, validateInfra };
|