@diagrammo/dgmo 0.8.4 → 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 +300 -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 +191 -189
- package/dist/editor.cjs +5 -18
- package/dist/editor.cjs.map +1 -1
- package/dist/editor.js +5 -18
- package/dist/editor.js.map +1 -1
- package/dist/highlight.cjs +543 -0
- package/dist/highlight.cjs.map +1 -0
- package/dist/highlight.d.cts +32 -0
- package/dist/highlight.d.ts +32 -0
- package/dist/highlight.js +513 -0
- package/dist/highlight.js.map +1 -0
- package/dist/index.cjs +3253 -3356
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +77 -56
- package/dist/index.d.ts +77 -56
- package/dist/index.js +3247 -3349
- package/dist/index.js.map +1 -1
- package/docs/ai-integration.md +1 -1
- package/docs/language-reference.md +113 -33
- package/gallery/fixtures/boxes-and-lines.dgmo +64 -0
- package/gallery/fixtures/slope.dgmo +7 -6
- package/package.json +26 -6
- 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 +49 -6
- package/src/completion.ts +25 -33
- package/src/d3.ts +187 -46
- package/src/dgmo-router.ts +3 -7
- package/src/echarts.ts +38 -2
- package/src/editor/highlight-api.ts +444 -0
- package/src/editor/keywords.ts +6 -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 +106 -50
- 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
|
@@ -260,6 +260,28 @@ interface ParsedChart {
|
|
|
260
260
|
* ```
|
|
261
261
|
*/
|
|
262
262
|
declare function parseChart(content: string, palette?: PaletteColors): ParsedChart;
|
|
263
|
+
/**
|
|
264
|
+
* Parse a data row line: everything before the last numeric token(s) is the label,
|
|
265
|
+
* numeric tokens at the end are the values. Supports comma-separated multi-values,
|
|
266
|
+
* space-separated multi-values, and comma-grouped numbers (e.g., "1,087").
|
|
267
|
+
*
|
|
268
|
+
* Examples:
|
|
269
|
+
* "Jan 120" → { label: "Jan", values: [120] }
|
|
270
|
+
* "North America 250" → { label: "North America", values: [250] }
|
|
271
|
+
* "Q1 10, 20, 30" → { label: "Q1", values: [10, 20, 30] }
|
|
272
|
+
* "Q1 10 20 30" → { label: "Q1", values: [10, 20, 30] }
|
|
273
|
+
* "Revenue 1,200" → { label: "Revenue", values: [1200] }
|
|
274
|
+
* "Revenue 3,984,078.65"→ { label: "Revenue", values: [3984078.65] }
|
|
275
|
+
*
|
|
276
|
+
* Returns null if the line has no numeric value at the end.
|
|
277
|
+
*/
|
|
278
|
+
declare function parseDataRowValues(line: string, options?: {
|
|
279
|
+
multiValue?: boolean;
|
|
280
|
+
expectedValues?: number;
|
|
281
|
+
}): {
|
|
282
|
+
label: string;
|
|
283
|
+
values: number[];
|
|
284
|
+
} | null;
|
|
263
285
|
|
|
264
286
|
interface LegendGroupData {
|
|
265
287
|
name: string;
|
|
@@ -434,7 +456,7 @@ interface TagGroup {
|
|
|
434
456
|
name: string;
|
|
435
457
|
alias?: string;
|
|
436
458
|
entries: TagEntry[];
|
|
437
|
-
/**
|
|
459
|
+
/** Default value for nodes without explicit metadata. First entry unless another is marked `default`. */
|
|
438
460
|
defaultValue?: string;
|
|
439
461
|
lineNumber: number;
|
|
440
462
|
}
|
|
@@ -1487,122 +1509,121 @@ declare function renderC4Deployment(container: HTMLDivElement, parsed: ParsedC4,
|
|
|
1487
1509
|
*/
|
|
1488
1510
|
declare function renderC4DeploymentForExport(content: string, theme: 'light' | 'dark' | 'transparent', palette: PaletteColors): string;
|
|
1489
1511
|
|
|
1490
|
-
|
|
1491
|
-
interface ISNode {
|
|
1512
|
+
interface BLNode {
|
|
1492
1513
|
label: string;
|
|
1493
|
-
status: InitiativeStatus;
|
|
1494
|
-
shape: ParticipantType;
|
|
1495
1514
|
lineNumber: number;
|
|
1496
1515
|
metadata: Record<string, string>;
|
|
1516
|
+
description?: string;
|
|
1497
1517
|
}
|
|
1498
|
-
interface
|
|
1518
|
+
interface BLEdge {
|
|
1499
1519
|
source: string;
|
|
1500
1520
|
target: string;
|
|
1501
1521
|
label?: string;
|
|
1502
|
-
|
|
1522
|
+
bidirectional: boolean;
|
|
1503
1523
|
lineNumber: number;
|
|
1504
1524
|
metadata: Record<string, string>;
|
|
1505
1525
|
}
|
|
1506
|
-
interface
|
|
1526
|
+
interface BLGroup {
|
|
1507
1527
|
label: string;
|
|
1508
|
-
|
|
1528
|
+
children: string[];
|
|
1509
1529
|
lineNumber: number;
|
|
1510
|
-
metadata
|
|
1530
|
+
metadata: Record<string, string>;
|
|
1511
1531
|
}
|
|
1512
|
-
interface
|
|
1513
|
-
type: '
|
|
1532
|
+
interface ParsedBoxesAndLines {
|
|
1533
|
+
type: 'boxes-and-lines';
|
|
1514
1534
|
title: string | null;
|
|
1515
1535
|
titleLineNumber: number | null;
|
|
1516
|
-
nodes:
|
|
1517
|
-
edges:
|
|
1518
|
-
groups:
|
|
1536
|
+
nodes: BLNode[];
|
|
1537
|
+
edges: BLEdge[];
|
|
1538
|
+
groups: BLGroup[];
|
|
1519
1539
|
tagGroups: TagGroup[];
|
|
1520
1540
|
options: Record<string, string>;
|
|
1521
|
-
/** Initial hidden tag values from `hide:` DSL directive. Map<groupKey, Set<values>> */
|
|
1522
1541
|
initialHiddenTagValues: Map<string, Set<string>>;
|
|
1542
|
+
direction: 'LR' | 'TB';
|
|
1523
1543
|
diagnostics: DgmoError[];
|
|
1524
1544
|
error: string | null;
|
|
1525
1545
|
}
|
|
1526
1546
|
|
|
1527
|
-
|
|
1528
|
-
* Returns true if the content looks like an initiative-status diagram.
|
|
1529
|
-
* Detects `->` arrows combined with `| done/wip/todo/na` status markers.
|
|
1530
|
-
*/
|
|
1531
|
-
declare function looksLikeInitiativeStatus(content: string): boolean;
|
|
1532
|
-
declare function parseInitiativeStatus(content: string): ParsedInitiativeStatus;
|
|
1533
|
-
|
|
1534
|
-
interface CollapseResult {
|
|
1535
|
-
parsed: ParsedInitiativeStatus;
|
|
1536
|
-
collapsedGroupStatuses: Map<string, InitiativeStatus>;
|
|
1537
|
-
originalGroups: ISGroup[];
|
|
1538
|
-
}
|
|
1539
|
-
declare function collapseInitiativeStatus(parsed: ParsedInitiativeStatus, collapsedGroups: Set<string>): CollapseResult;
|
|
1547
|
+
declare function parseBoxesAndLines(content: string): ParsedBoxesAndLines;
|
|
1540
1548
|
|
|
1541
|
-
interface
|
|
1549
|
+
interface BLLayoutNode {
|
|
1542
1550
|
label: string;
|
|
1543
|
-
status: InitiativeStatus;
|
|
1544
|
-
shape: ParticipantType;
|
|
1545
|
-
lineNumber: number;
|
|
1546
1551
|
x: number;
|
|
1547
1552
|
y: number;
|
|
1548
1553
|
width: number;
|
|
1549
1554
|
height: number;
|
|
1550
|
-
metadata: Record<string, string>;
|
|
1551
1555
|
}
|
|
1552
|
-
interface
|
|
1556
|
+
interface BLLayoutEdge {
|
|
1553
1557
|
source: string;
|
|
1554
1558
|
target: string;
|
|
1555
1559
|
label?: string;
|
|
1556
|
-
|
|
1560
|
+
bidirectional: boolean;
|
|
1557
1561
|
lineNumber: number;
|
|
1558
1562
|
points: {
|
|
1559
1563
|
x: number;
|
|
1560
1564
|
y: number;
|
|
1561
1565
|
}[];
|
|
1566
|
+
labelX?: number;
|
|
1567
|
+
labelY?: number;
|
|
1568
|
+
yOffset: number;
|
|
1562
1569
|
parallelCount: number;
|
|
1570
|
+
metadata: Record<string, string>;
|
|
1563
1571
|
}
|
|
1564
|
-
interface
|
|
1572
|
+
interface BLLayoutGroup {
|
|
1565
1573
|
label: string;
|
|
1566
|
-
|
|
1574
|
+
lineNumber: number;
|
|
1567
1575
|
x: number;
|
|
1568
1576
|
y: number;
|
|
1569
1577
|
width: number;
|
|
1570
1578
|
height: number;
|
|
1571
|
-
lineNumber: number;
|
|
1572
1579
|
collapsed: boolean;
|
|
1580
|
+
childCount?: number;
|
|
1573
1581
|
}
|
|
1574
|
-
interface
|
|
1575
|
-
nodes:
|
|
1576
|
-
edges:
|
|
1577
|
-
groups:
|
|
1582
|
+
interface BLLayoutResult {
|
|
1583
|
+
nodes: BLLayoutNode[];
|
|
1584
|
+
edges: BLLayoutEdge[];
|
|
1585
|
+
groups: BLLayoutGroup[];
|
|
1578
1586
|
width: number;
|
|
1579
1587
|
height: number;
|
|
1580
1588
|
}
|
|
1581
|
-
declare function
|
|
1589
|
+
declare function layoutBoxesAndLines(parsed: ParsedBoxesAndLines, collapseInfo?: {
|
|
1590
|
+
collapsedChildCounts: Map<string, number>;
|
|
1591
|
+
originalGroups: BLGroup[];
|
|
1592
|
+
}): BLLayoutResult;
|
|
1582
1593
|
|
|
1583
|
-
interface
|
|
1594
|
+
interface BLRenderOptions {
|
|
1584
1595
|
onClickItem?: (lineNumber: number) => void;
|
|
1585
1596
|
exportDims?: {
|
|
1586
1597
|
width?: number;
|
|
1587
1598
|
height?: number;
|
|
1588
1599
|
};
|
|
1589
|
-
legendActive?: boolean | null;
|
|
1590
1600
|
activeTagGroup?: string | null;
|
|
1591
1601
|
hiddenTagValues?: Map<string, Set<string>>;
|
|
1592
|
-
tagGroups?: TagGroup[];
|
|
1593
1602
|
}
|
|
1594
|
-
declare function
|
|
1595
|
-
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;
|
|
1596
1610
|
|
|
1611
|
+
interface BLCollapseResult {
|
|
1612
|
+
parsed: ParsedBoxesAndLines;
|
|
1613
|
+
collapsedChildCounts: Map<string, number>;
|
|
1614
|
+
originalGroups: BLGroup[];
|
|
1615
|
+
}
|
|
1597
1616
|
/**
|
|
1598
|
-
*
|
|
1599
|
-
*
|
|
1617
|
+
* Pure transform: returns a new ParsedBoxesAndLines with collapsed groups
|
|
1618
|
+
* removed from the diagram content.
|
|
1600
1619
|
*
|
|
1601
|
-
*
|
|
1602
|
-
*
|
|
1603
|
-
*
|
|
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)
|
|
1604
1625
|
*/
|
|
1605
|
-
declare function
|
|
1626
|
+
declare function collapseBoxesAndLines(parsed: ParsedBoxesAndLines, collapsedGroups: Set<string>): BLCollapseResult;
|
|
1606
1627
|
|
|
1607
1628
|
interface SitemapNode {
|
|
1608
1629
|
id: string;
|
|
@@ -2425,4 +2446,4 @@ declare function parseFirstLine(line: string): {
|
|
|
2425
2446
|
*/
|
|
2426
2447
|
declare function injectBranding(svgHtml: string, mutedColor: string): string;
|
|
2427
2448
|
|
|
2428
|
-
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
|
@@ -260,6 +260,28 @@ interface ParsedChart {
|
|
|
260
260
|
* ```
|
|
261
261
|
*/
|
|
262
262
|
declare function parseChart(content: string, palette?: PaletteColors): ParsedChart;
|
|
263
|
+
/**
|
|
264
|
+
* Parse a data row line: everything before the last numeric token(s) is the label,
|
|
265
|
+
* numeric tokens at the end are the values. Supports comma-separated multi-values,
|
|
266
|
+
* space-separated multi-values, and comma-grouped numbers (e.g., "1,087").
|
|
267
|
+
*
|
|
268
|
+
* Examples:
|
|
269
|
+
* "Jan 120" → { label: "Jan", values: [120] }
|
|
270
|
+
* "North America 250" → { label: "North America", values: [250] }
|
|
271
|
+
* "Q1 10, 20, 30" → { label: "Q1", values: [10, 20, 30] }
|
|
272
|
+
* "Q1 10 20 30" → { label: "Q1", values: [10, 20, 30] }
|
|
273
|
+
* "Revenue 1,200" → { label: "Revenue", values: [1200] }
|
|
274
|
+
* "Revenue 3,984,078.65"→ { label: "Revenue", values: [3984078.65] }
|
|
275
|
+
*
|
|
276
|
+
* Returns null if the line has no numeric value at the end.
|
|
277
|
+
*/
|
|
278
|
+
declare function parseDataRowValues(line: string, options?: {
|
|
279
|
+
multiValue?: boolean;
|
|
280
|
+
expectedValues?: number;
|
|
281
|
+
}): {
|
|
282
|
+
label: string;
|
|
283
|
+
values: number[];
|
|
284
|
+
} | null;
|
|
263
285
|
|
|
264
286
|
interface LegendGroupData {
|
|
265
287
|
name: string;
|
|
@@ -434,7 +456,7 @@ interface TagGroup {
|
|
|
434
456
|
name: string;
|
|
435
457
|
alias?: string;
|
|
436
458
|
entries: TagEntry[];
|
|
437
|
-
/**
|
|
459
|
+
/** Default value for nodes without explicit metadata. First entry unless another is marked `default`. */
|
|
438
460
|
defaultValue?: string;
|
|
439
461
|
lineNumber: number;
|
|
440
462
|
}
|
|
@@ -1487,122 +1509,121 @@ declare function renderC4Deployment(container: HTMLDivElement, parsed: ParsedC4,
|
|
|
1487
1509
|
*/
|
|
1488
1510
|
declare function renderC4DeploymentForExport(content: string, theme: 'light' | 'dark' | 'transparent', palette: PaletteColors): string;
|
|
1489
1511
|
|
|
1490
|
-
|
|
1491
|
-
interface ISNode {
|
|
1512
|
+
interface BLNode {
|
|
1492
1513
|
label: string;
|
|
1493
|
-
status: InitiativeStatus;
|
|
1494
|
-
shape: ParticipantType;
|
|
1495
1514
|
lineNumber: number;
|
|
1496
1515
|
metadata: Record<string, string>;
|
|
1516
|
+
description?: string;
|
|
1497
1517
|
}
|
|
1498
|
-
interface
|
|
1518
|
+
interface BLEdge {
|
|
1499
1519
|
source: string;
|
|
1500
1520
|
target: string;
|
|
1501
1521
|
label?: string;
|
|
1502
|
-
|
|
1522
|
+
bidirectional: boolean;
|
|
1503
1523
|
lineNumber: number;
|
|
1504
1524
|
metadata: Record<string, string>;
|
|
1505
1525
|
}
|
|
1506
|
-
interface
|
|
1526
|
+
interface BLGroup {
|
|
1507
1527
|
label: string;
|
|
1508
|
-
|
|
1528
|
+
children: string[];
|
|
1509
1529
|
lineNumber: number;
|
|
1510
|
-
metadata
|
|
1530
|
+
metadata: Record<string, string>;
|
|
1511
1531
|
}
|
|
1512
|
-
interface
|
|
1513
|
-
type: '
|
|
1532
|
+
interface ParsedBoxesAndLines {
|
|
1533
|
+
type: 'boxes-and-lines';
|
|
1514
1534
|
title: string | null;
|
|
1515
1535
|
titleLineNumber: number | null;
|
|
1516
|
-
nodes:
|
|
1517
|
-
edges:
|
|
1518
|
-
groups:
|
|
1536
|
+
nodes: BLNode[];
|
|
1537
|
+
edges: BLEdge[];
|
|
1538
|
+
groups: BLGroup[];
|
|
1519
1539
|
tagGroups: TagGroup[];
|
|
1520
1540
|
options: Record<string, string>;
|
|
1521
|
-
/** Initial hidden tag values from `hide:` DSL directive. Map<groupKey, Set<values>> */
|
|
1522
1541
|
initialHiddenTagValues: Map<string, Set<string>>;
|
|
1542
|
+
direction: 'LR' | 'TB';
|
|
1523
1543
|
diagnostics: DgmoError[];
|
|
1524
1544
|
error: string | null;
|
|
1525
1545
|
}
|
|
1526
1546
|
|
|
1527
|
-
|
|
1528
|
-
* Returns true if the content looks like an initiative-status diagram.
|
|
1529
|
-
* Detects `->` arrows combined with `| done/wip/todo/na` status markers.
|
|
1530
|
-
*/
|
|
1531
|
-
declare function looksLikeInitiativeStatus(content: string): boolean;
|
|
1532
|
-
declare function parseInitiativeStatus(content: string): ParsedInitiativeStatus;
|
|
1533
|
-
|
|
1534
|
-
interface CollapseResult {
|
|
1535
|
-
parsed: ParsedInitiativeStatus;
|
|
1536
|
-
collapsedGroupStatuses: Map<string, InitiativeStatus>;
|
|
1537
|
-
originalGroups: ISGroup[];
|
|
1538
|
-
}
|
|
1539
|
-
declare function collapseInitiativeStatus(parsed: ParsedInitiativeStatus, collapsedGroups: Set<string>): CollapseResult;
|
|
1547
|
+
declare function parseBoxesAndLines(content: string): ParsedBoxesAndLines;
|
|
1540
1548
|
|
|
1541
|
-
interface
|
|
1549
|
+
interface BLLayoutNode {
|
|
1542
1550
|
label: string;
|
|
1543
|
-
status: InitiativeStatus;
|
|
1544
|
-
shape: ParticipantType;
|
|
1545
|
-
lineNumber: number;
|
|
1546
1551
|
x: number;
|
|
1547
1552
|
y: number;
|
|
1548
1553
|
width: number;
|
|
1549
1554
|
height: number;
|
|
1550
|
-
metadata: Record<string, string>;
|
|
1551
1555
|
}
|
|
1552
|
-
interface
|
|
1556
|
+
interface BLLayoutEdge {
|
|
1553
1557
|
source: string;
|
|
1554
1558
|
target: string;
|
|
1555
1559
|
label?: string;
|
|
1556
|
-
|
|
1560
|
+
bidirectional: boolean;
|
|
1557
1561
|
lineNumber: number;
|
|
1558
1562
|
points: {
|
|
1559
1563
|
x: number;
|
|
1560
1564
|
y: number;
|
|
1561
1565
|
}[];
|
|
1566
|
+
labelX?: number;
|
|
1567
|
+
labelY?: number;
|
|
1568
|
+
yOffset: number;
|
|
1562
1569
|
parallelCount: number;
|
|
1570
|
+
metadata: Record<string, string>;
|
|
1563
1571
|
}
|
|
1564
|
-
interface
|
|
1572
|
+
interface BLLayoutGroup {
|
|
1565
1573
|
label: string;
|
|
1566
|
-
|
|
1574
|
+
lineNumber: number;
|
|
1567
1575
|
x: number;
|
|
1568
1576
|
y: number;
|
|
1569
1577
|
width: number;
|
|
1570
1578
|
height: number;
|
|
1571
|
-
lineNumber: number;
|
|
1572
1579
|
collapsed: boolean;
|
|
1580
|
+
childCount?: number;
|
|
1573
1581
|
}
|
|
1574
|
-
interface
|
|
1575
|
-
nodes:
|
|
1576
|
-
edges:
|
|
1577
|
-
groups:
|
|
1582
|
+
interface BLLayoutResult {
|
|
1583
|
+
nodes: BLLayoutNode[];
|
|
1584
|
+
edges: BLLayoutEdge[];
|
|
1585
|
+
groups: BLLayoutGroup[];
|
|
1578
1586
|
width: number;
|
|
1579
1587
|
height: number;
|
|
1580
1588
|
}
|
|
1581
|
-
declare function
|
|
1589
|
+
declare function layoutBoxesAndLines(parsed: ParsedBoxesAndLines, collapseInfo?: {
|
|
1590
|
+
collapsedChildCounts: Map<string, number>;
|
|
1591
|
+
originalGroups: BLGroup[];
|
|
1592
|
+
}): BLLayoutResult;
|
|
1582
1593
|
|
|
1583
|
-
interface
|
|
1594
|
+
interface BLRenderOptions {
|
|
1584
1595
|
onClickItem?: (lineNumber: number) => void;
|
|
1585
1596
|
exportDims?: {
|
|
1586
1597
|
width?: number;
|
|
1587
1598
|
height?: number;
|
|
1588
1599
|
};
|
|
1589
|
-
legendActive?: boolean | null;
|
|
1590
1600
|
activeTagGroup?: string | null;
|
|
1591
1601
|
hiddenTagValues?: Map<string, Set<string>>;
|
|
1592
|
-
tagGroups?: TagGroup[];
|
|
1593
1602
|
}
|
|
1594
|
-
declare function
|
|
1595
|
-
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;
|
|
1596
1610
|
|
|
1611
|
+
interface BLCollapseResult {
|
|
1612
|
+
parsed: ParsedBoxesAndLines;
|
|
1613
|
+
collapsedChildCounts: Map<string, number>;
|
|
1614
|
+
originalGroups: BLGroup[];
|
|
1615
|
+
}
|
|
1597
1616
|
/**
|
|
1598
|
-
*
|
|
1599
|
-
*
|
|
1617
|
+
* Pure transform: returns a new ParsedBoxesAndLines with collapsed groups
|
|
1618
|
+
* removed from the diagram content.
|
|
1600
1619
|
*
|
|
1601
|
-
*
|
|
1602
|
-
*
|
|
1603
|
-
*
|
|
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)
|
|
1604
1625
|
*/
|
|
1605
|
-
declare function
|
|
1626
|
+
declare function collapseBoxesAndLines(parsed: ParsedBoxesAndLines, collapsedGroups: Set<string>): BLCollapseResult;
|
|
1606
1627
|
|
|
1607
1628
|
interface SitemapNode {
|
|
1608
1629
|
id: string;
|
|
@@ -2425,4 +2446,4 @@ declare function parseFirstLine(line: string): {
|
|
|
2425
2446
|
*/
|
|
2426
2447
|
declare function injectBranding(svgHtml: string, mutedColor: string): string;
|
|
2427
2448
|
|
|
2428
|
-
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 };
|