@diagrammo/dgmo 0.2.18 → 0.2.20
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 +33 -33
- package/dist/cli.cjs +148 -144
- package/dist/index.cjs +8773 -8072
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +55 -1
- package/dist/index.d.ts +55 -1
- package/dist/index.js +8727 -8028
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/chart.ts +40 -9
- package/src/class/parser.ts +37 -6
- package/src/class/renderer.ts +11 -8
- package/src/class/types.ts +4 -0
- package/src/cli.ts +38 -3
- package/src/d3.ts +115 -47
- package/src/dgmo-mermaid.ts +7 -1
- package/src/dgmo-router.ts +67 -4
- package/src/diagnostics.ts +77 -0
- package/src/echarts.ts +23 -14
- package/src/er/layout.ts +49 -7
- package/src/er/parser.ts +31 -4
- package/src/er/renderer.ts +2 -1
- package/src/er/types.ts +3 -0
- package/src/graph/flowchart-parser.ts +34 -4
- package/src/graph/flowchart-renderer.ts +35 -32
- package/src/graph/types.ts +4 -0
- package/src/index.ts +11 -0
- package/src/org/layout.ts +46 -21
- package/src/org/parser.ts +35 -14
- package/src/org/renderer.ts +25 -12
- package/src/org/resolver.ts +470 -0
- package/src/sequence/parser.ts +90 -33
- package/src/sequence/renderer.ts +6 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { EChartsOption } from 'echarts';
|
|
2
2
|
import * as d3Scale from 'd3-scale';
|
|
3
3
|
|
|
4
|
+
type DgmoSeverity = 'error' | 'warning';
|
|
5
|
+
interface DgmoError {
|
|
6
|
+
line: number;
|
|
7
|
+
column?: number;
|
|
8
|
+
message: string;
|
|
9
|
+
severity: DgmoSeverity;
|
|
10
|
+
}
|
|
11
|
+
declare function makeDgmoError(line: number, message: string, severity?: DgmoSeverity): DgmoError;
|
|
12
|
+
declare function formatDgmoError(err: DgmoError): string;
|
|
13
|
+
|
|
4
14
|
/**
|
|
5
15
|
* Render DGMO source to an SVG string.
|
|
6
16
|
*
|
|
@@ -50,6 +60,13 @@ declare function getDgmoFramework(chartType: string): DgmoFramework | null;
|
|
|
50
60
|
* (e.g. content containing `->` is inferred as `sequence`).
|
|
51
61
|
*/
|
|
52
62
|
declare function parseDgmoChartType(content: string): string | null;
|
|
63
|
+
/**
|
|
64
|
+
* Parse DGMO content and return diagnostics without rendering.
|
|
65
|
+
* Useful for the CLI and editor to surface all errors before attempting render.
|
|
66
|
+
*/
|
|
67
|
+
declare function parseDgmo(content: string): {
|
|
68
|
+
diagnostics: DgmoError[];
|
|
69
|
+
};
|
|
53
70
|
|
|
54
71
|
/**
|
|
55
72
|
* Color definitions for a single mode (light or dark).
|
|
@@ -195,6 +212,7 @@ interface ChartDataPoint {
|
|
|
195
212
|
color?: string;
|
|
196
213
|
lineNumber: number;
|
|
197
214
|
}
|
|
215
|
+
|
|
198
216
|
interface ParsedChart {
|
|
199
217
|
type: ChartType;
|
|
200
218
|
title?: string;
|
|
@@ -209,6 +227,7 @@ interface ParsedChart {
|
|
|
209
227
|
label?: string;
|
|
210
228
|
labels?: 'name' | 'value' | 'percent' | 'full';
|
|
211
229
|
data: ChartDataPoint[];
|
|
230
|
+
diagnostics: DgmoError[];
|
|
212
231
|
error?: string;
|
|
213
232
|
}
|
|
214
233
|
|
|
@@ -261,6 +280,7 @@ interface ParsedHeatmapRow {
|
|
|
261
280
|
values: number[];
|
|
262
281
|
lineNumber: number;
|
|
263
282
|
}
|
|
283
|
+
|
|
264
284
|
interface ParsedEChart {
|
|
265
285
|
type: EChartsChartType;
|
|
266
286
|
title?: string;
|
|
@@ -284,6 +304,7 @@ interface ParsedEChart {
|
|
|
284
304
|
sizelabel?: string;
|
|
285
305
|
showLabels?: boolean;
|
|
286
306
|
categoryColors?: Record<string, string>;
|
|
307
|
+
diagnostics: DgmoError[];
|
|
287
308
|
error?: string;
|
|
288
309
|
}
|
|
289
310
|
|
|
@@ -442,6 +463,7 @@ interface ParsedD3 {
|
|
|
442
463
|
quadrantYAxis: [string, string] | null;
|
|
443
464
|
quadrantYAxisLineNumber: number | null;
|
|
444
465
|
quadrantTitleLineNumber: number | null;
|
|
466
|
+
diagnostics: DgmoError[];
|
|
445
467
|
error: string | null;
|
|
446
468
|
}
|
|
447
469
|
|
|
@@ -611,6 +633,7 @@ interface ParsedSequenceDgmo {
|
|
|
611
633
|
groups: SequenceGroup[];
|
|
612
634
|
sections: SequenceSection[];
|
|
613
635
|
options: Record<string, string>;
|
|
636
|
+
diagnostics: DgmoError[];
|
|
614
637
|
error: string | null;
|
|
615
638
|
}
|
|
616
639
|
/**
|
|
@@ -657,6 +680,7 @@ interface ParsedQuadrant {
|
|
|
657
680
|
y: number;
|
|
658
681
|
lineNumber: number;
|
|
659
682
|
}[];
|
|
683
|
+
diagnostics: DgmoError[];
|
|
660
684
|
error: string | null;
|
|
661
685
|
}
|
|
662
686
|
/**
|
|
@@ -698,6 +722,7 @@ interface GraphGroup {
|
|
|
698
722
|
nodeIds: string[];
|
|
699
723
|
lineNumber: number;
|
|
700
724
|
}
|
|
725
|
+
|
|
701
726
|
interface ParsedGraph {
|
|
702
727
|
type: 'flowchart';
|
|
703
728
|
title?: string;
|
|
@@ -706,6 +731,8 @@ interface ParsedGraph {
|
|
|
706
731
|
nodes: GraphNode[];
|
|
707
732
|
edges: GraphEdge[];
|
|
708
733
|
groups?: GraphGroup[];
|
|
734
|
+
options: Record<string, string>;
|
|
735
|
+
diagnostics: DgmoError[];
|
|
709
736
|
error?: string;
|
|
710
737
|
}
|
|
711
738
|
|
|
@@ -744,12 +771,15 @@ interface ClassRelationship {
|
|
|
744
771
|
label?: string;
|
|
745
772
|
lineNumber: number;
|
|
746
773
|
}
|
|
774
|
+
|
|
747
775
|
interface ParsedClassDiagram {
|
|
748
776
|
type: 'class';
|
|
749
777
|
title?: string;
|
|
750
778
|
titleLineNumber?: number;
|
|
751
779
|
classes: ClassNode[];
|
|
752
780
|
relationships: ClassRelationship[];
|
|
781
|
+
options: Record<string, string>;
|
|
782
|
+
diagnostics: DgmoError[];
|
|
753
783
|
error?: string;
|
|
754
784
|
}
|
|
755
785
|
|
|
@@ -820,6 +850,7 @@ interface ERRelationship {
|
|
|
820
850
|
label?: string;
|
|
821
851
|
lineNumber: number;
|
|
822
852
|
}
|
|
853
|
+
|
|
823
854
|
interface ParsedERDiagram {
|
|
824
855
|
type: 'er';
|
|
825
856
|
title?: string;
|
|
@@ -827,6 +858,7 @@ interface ParsedERDiagram {
|
|
|
827
858
|
options: Record<string, string>;
|
|
828
859
|
tables: ERTable[];
|
|
829
860
|
relationships: ERRelationship[];
|
|
861
|
+
diagnostics: DgmoError[];
|
|
830
862
|
error?: string;
|
|
831
863
|
}
|
|
832
864
|
|
|
@@ -902,6 +934,7 @@ interface ParsedOrg {
|
|
|
902
934
|
roots: OrgNode[];
|
|
903
935
|
tagGroups: OrgTagGroup[];
|
|
904
936
|
options: Record<string, string>;
|
|
937
|
+
diagnostics: DgmoError[];
|
|
905
938
|
error: string | null;
|
|
906
939
|
}
|
|
907
940
|
declare function parseOrg(content: string, palette?: PaletteColors): ParsedOrg;
|
|
@@ -957,6 +990,8 @@ interface OrgLegendGroup {
|
|
|
957
990
|
y: number;
|
|
958
991
|
width: number;
|
|
959
992
|
height: number;
|
|
993
|
+
minifiedWidth: number;
|
|
994
|
+
minifiedHeight: number;
|
|
960
995
|
}
|
|
961
996
|
interface OrgLayoutResult {
|
|
962
997
|
nodes: OrgLayoutNode[];
|
|
@@ -982,6 +1017,25 @@ interface CollapsedOrgResult {
|
|
|
982
1017
|
}
|
|
983
1018
|
declare function collapseOrgTree(original: ParsedOrg, collapsedIds: Set<string>): CollapsedOrgResult;
|
|
984
1019
|
|
|
1020
|
+
/**
|
|
1021
|
+
* Async or sync file reader. Receives an absolute path, returns content.
|
|
1022
|
+
* Throwing means "file not found".
|
|
1023
|
+
*/
|
|
1024
|
+
type ReadFileFn = (path: string) => string | Promise<string>;
|
|
1025
|
+
interface ResolveImportsResult {
|
|
1026
|
+
content: string;
|
|
1027
|
+
diagnostics: DgmoError[];
|
|
1028
|
+
}
|
|
1029
|
+
/**
|
|
1030
|
+
* Pre-processes org chart content, resolving `tags:` and `import:` directives.
|
|
1031
|
+
*
|
|
1032
|
+
* @param content - Raw .dgmo file content
|
|
1033
|
+
* @param filePath - Absolute path of the file (for relative path resolution)
|
|
1034
|
+
* @param readFileFn - Function to read files (sync or async)
|
|
1035
|
+
* @returns Merged content with all imports resolved + diagnostics
|
|
1036
|
+
*/
|
|
1037
|
+
declare function resolveOrgImports(content: string, filePath: string, readFileFn: ReadFileFn): Promise<ResolveImportsResult>;
|
|
1038
|
+
|
|
985
1039
|
interface LayoutNode {
|
|
986
1040
|
id: string;
|
|
987
1041
|
label: string;
|
|
@@ -1167,4 +1221,4 @@ declare function decodeDiagramUrl(hash: string): DecodedDiagramUrl;
|
|
|
1167
1221
|
*/
|
|
1168
1222
|
declare function injectBranding(svgHtml: string, mutedColor: string): string;
|
|
1169
1223
|
|
|
1170
|
-
export { type Activation, type ArcLink, type ArcNodeGroup, type ChartDataPoint, type ChartType, type ClassLayoutEdge, type ClassLayoutNode, type ClassLayoutResult, type ClassMember, type ClassModifier, type ClassNode, type ClassRelationship, type CollapsedOrgResult, type D3ChartType, type D3ExportDimensions, DGMO_CHART_TYPE_MAP, type DecodedDiagramUrl, type DgmoFramework, type DiagramViewState, type EChartsChartType, type ERCardinality, type ERColumn, type ERConstraint, type ERLayoutEdge, type ERLayoutNode, type ERLayoutResult, type ERRelationship, type ERTable, type ElseIfBranch, type EncodeDiagramUrlOptions, type EncodeDiagramUrlResult, type GraphDirection, type GraphEdge, type GraphGroup, type GraphNode, type GraphShape, type LayoutEdge, type LayoutGroup, type LayoutNode, type LayoutResult, type MemberVisibility, type OrgContainerBounds, type OrgLayoutEdge, type OrgLayoutNode, type OrgLayoutResult, type OrgNode, type OrgTagEntry, type OrgTagGroup, type PaletteColors, type PaletteConfig, type ParsedChart, type ParsedClassDiagram, type ParsedD3, type ParsedEChart, type ParsedERDiagram, type ParsedGraph, type ParsedOrg, type ParsedQuadrant, type ParsedSequenceDgmo, type ParticipantType, RULE_COUNT, type RelationshipType, type RenderStep, type SectionMessageGroup, type SequenceBlock, type SequenceElement, type SequenceGroup, type SequenceMessage, type SequenceNote, type SequenceParticipant, type SequenceRenderOptions, type SequenceSection, addDurationToDate, applyGroupOrdering, applyPositionOverrides, boldPalette, buildEChartsOption, buildEChartsOptionFromChart, buildMermaidQuadrant, buildMermaidThemeVars, buildNoteMessageMap, buildRenderSequence, buildThemeCSS, catppuccinPalette, collapseOrgTree, colorNames, computeActivations, computeTimeTicks, contrastText, decodeDiagramUrl, encodeDiagramUrl, formatDateLabel, getAvailablePalettes, getDgmoFramework, getPalette, getSeriesColors, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, injectBranding, isSequenceBlock, isSequenceNote, isValidHex, layoutClassDiagram, layoutERDiagram, layoutGraph, layoutOrg, looksLikeClassDiagram, looksLikeERDiagram, looksLikeFlowchart, looksLikeSequence, mute, nord, nordPalette, oneDarkPalette, orderArcNodes, parseChart, parseClassDiagram, parseD3, parseDgmoChartType, parseEChart, parseERDiagram, parseFlowchart, parseOrg, parseQuadrant, parseSequenceDgmo, parseTimelineDate, registerPalette, render, renderArcDiagram, renderClassDiagram, renderClassDiagramForExport, renderD3ForExport, renderEChartsForExport, renderERDiagram, renderERDiagramForExport, renderFlowchart, renderFlowchartForExport, renderOrg, renderOrgForExport, renderQuadrant, renderSequenceDiagram, renderSlopeChart, renderTimeline, renderVenn, renderWordCloud, resolveColor, rosePinePalette, seriesColors, shade, solarizedPalette, tint, tokyoNightPalette };
|
|
1224
|
+
export { type Activation, type ArcLink, type ArcNodeGroup, type ChartDataPoint, type ChartType, type ClassLayoutEdge, type ClassLayoutNode, type ClassLayoutResult, type ClassMember, type ClassModifier, type ClassNode, type ClassRelationship, type CollapsedOrgResult, type D3ChartType, type D3ExportDimensions, DGMO_CHART_TYPE_MAP, type DecodedDiagramUrl, type DgmoError, type DgmoFramework, type DgmoSeverity, type DiagramViewState, type EChartsChartType, type ERCardinality, type ERColumn, type ERConstraint, type ERLayoutEdge, type ERLayoutNode, type ERLayoutResult, type ERRelationship, type ERTable, type ElseIfBranch, type EncodeDiagramUrlOptions, type EncodeDiagramUrlResult, type GraphDirection, type GraphEdge, type GraphGroup, type GraphNode, type GraphShape, type LayoutEdge, type LayoutGroup, type LayoutNode, type LayoutResult, type MemberVisibility, type OrgContainerBounds, type OrgLayoutEdge, type OrgLayoutNode, type OrgLayoutResult, type OrgNode, type OrgTagEntry, type OrgTagGroup, type PaletteColors, type PaletteConfig, type ParsedChart, type ParsedClassDiagram, type ParsedD3, type ParsedEChart, type ParsedERDiagram, type ParsedGraph, type ParsedOrg, type ParsedQuadrant, type ParsedSequenceDgmo, type ParticipantType, RULE_COUNT, type ReadFileFn, type RelationshipType, type RenderStep, type ResolveImportsResult, type SectionMessageGroup, type SequenceBlock, type SequenceElement, type SequenceGroup, type SequenceMessage, type SequenceNote, type SequenceParticipant, type SequenceRenderOptions, type SequenceSection, addDurationToDate, applyGroupOrdering, applyPositionOverrides, boldPalette, buildEChartsOption, buildEChartsOptionFromChart, buildMermaidQuadrant, buildMermaidThemeVars, buildNoteMessageMap, buildRenderSequence, buildThemeCSS, catppuccinPalette, collapseOrgTree, colorNames, computeActivations, computeTimeTicks, contrastText, decodeDiagramUrl, encodeDiagramUrl, formatDateLabel, formatDgmoError, getAvailablePalettes, getDgmoFramework, getPalette, getSeriesColors, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, injectBranding, isSequenceBlock, isSequenceNote, isValidHex, layoutClassDiagram, layoutERDiagram, layoutGraph, layoutOrg, looksLikeClassDiagram, looksLikeERDiagram, looksLikeFlowchart, looksLikeSequence, makeDgmoError, mute, nord, nordPalette, oneDarkPalette, orderArcNodes, parseChart, parseClassDiagram, parseD3, parseDgmo, parseDgmoChartType, parseEChart, parseERDiagram, parseFlowchart, parseOrg, parseQuadrant, parseSequenceDgmo, parseTimelineDate, registerPalette, render, renderArcDiagram, renderClassDiagram, renderClassDiagramForExport, renderD3ForExport, renderEChartsForExport, renderERDiagram, renderERDiagramForExport, renderFlowchart, renderFlowchartForExport, renderOrg, renderOrgForExport, renderQuadrant, renderSequenceDiagram, renderSlopeChart, renderTimeline, renderVenn, renderWordCloud, resolveColor, resolveOrgImports, rosePinePalette, seriesColors, shade, solarizedPalette, tint, tokyoNightPalette };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { EChartsOption } from 'echarts';
|
|
2
2
|
import * as d3Scale from 'd3-scale';
|
|
3
3
|
|
|
4
|
+
type DgmoSeverity = 'error' | 'warning';
|
|
5
|
+
interface DgmoError {
|
|
6
|
+
line: number;
|
|
7
|
+
column?: number;
|
|
8
|
+
message: string;
|
|
9
|
+
severity: DgmoSeverity;
|
|
10
|
+
}
|
|
11
|
+
declare function makeDgmoError(line: number, message: string, severity?: DgmoSeverity): DgmoError;
|
|
12
|
+
declare function formatDgmoError(err: DgmoError): string;
|
|
13
|
+
|
|
4
14
|
/**
|
|
5
15
|
* Render DGMO source to an SVG string.
|
|
6
16
|
*
|
|
@@ -50,6 +60,13 @@ declare function getDgmoFramework(chartType: string): DgmoFramework | null;
|
|
|
50
60
|
* (e.g. content containing `->` is inferred as `sequence`).
|
|
51
61
|
*/
|
|
52
62
|
declare function parseDgmoChartType(content: string): string | null;
|
|
63
|
+
/**
|
|
64
|
+
* Parse DGMO content and return diagnostics without rendering.
|
|
65
|
+
* Useful for the CLI and editor to surface all errors before attempting render.
|
|
66
|
+
*/
|
|
67
|
+
declare function parseDgmo(content: string): {
|
|
68
|
+
diagnostics: DgmoError[];
|
|
69
|
+
};
|
|
53
70
|
|
|
54
71
|
/**
|
|
55
72
|
* Color definitions for a single mode (light or dark).
|
|
@@ -195,6 +212,7 @@ interface ChartDataPoint {
|
|
|
195
212
|
color?: string;
|
|
196
213
|
lineNumber: number;
|
|
197
214
|
}
|
|
215
|
+
|
|
198
216
|
interface ParsedChart {
|
|
199
217
|
type: ChartType;
|
|
200
218
|
title?: string;
|
|
@@ -209,6 +227,7 @@ interface ParsedChart {
|
|
|
209
227
|
label?: string;
|
|
210
228
|
labels?: 'name' | 'value' | 'percent' | 'full';
|
|
211
229
|
data: ChartDataPoint[];
|
|
230
|
+
diagnostics: DgmoError[];
|
|
212
231
|
error?: string;
|
|
213
232
|
}
|
|
214
233
|
|
|
@@ -261,6 +280,7 @@ interface ParsedHeatmapRow {
|
|
|
261
280
|
values: number[];
|
|
262
281
|
lineNumber: number;
|
|
263
282
|
}
|
|
283
|
+
|
|
264
284
|
interface ParsedEChart {
|
|
265
285
|
type: EChartsChartType;
|
|
266
286
|
title?: string;
|
|
@@ -284,6 +304,7 @@ interface ParsedEChart {
|
|
|
284
304
|
sizelabel?: string;
|
|
285
305
|
showLabels?: boolean;
|
|
286
306
|
categoryColors?: Record<string, string>;
|
|
307
|
+
diagnostics: DgmoError[];
|
|
287
308
|
error?: string;
|
|
288
309
|
}
|
|
289
310
|
|
|
@@ -442,6 +463,7 @@ interface ParsedD3 {
|
|
|
442
463
|
quadrantYAxis: [string, string] | null;
|
|
443
464
|
quadrantYAxisLineNumber: number | null;
|
|
444
465
|
quadrantTitleLineNumber: number | null;
|
|
466
|
+
diagnostics: DgmoError[];
|
|
445
467
|
error: string | null;
|
|
446
468
|
}
|
|
447
469
|
|
|
@@ -611,6 +633,7 @@ interface ParsedSequenceDgmo {
|
|
|
611
633
|
groups: SequenceGroup[];
|
|
612
634
|
sections: SequenceSection[];
|
|
613
635
|
options: Record<string, string>;
|
|
636
|
+
diagnostics: DgmoError[];
|
|
614
637
|
error: string | null;
|
|
615
638
|
}
|
|
616
639
|
/**
|
|
@@ -657,6 +680,7 @@ interface ParsedQuadrant {
|
|
|
657
680
|
y: number;
|
|
658
681
|
lineNumber: number;
|
|
659
682
|
}[];
|
|
683
|
+
diagnostics: DgmoError[];
|
|
660
684
|
error: string | null;
|
|
661
685
|
}
|
|
662
686
|
/**
|
|
@@ -698,6 +722,7 @@ interface GraphGroup {
|
|
|
698
722
|
nodeIds: string[];
|
|
699
723
|
lineNumber: number;
|
|
700
724
|
}
|
|
725
|
+
|
|
701
726
|
interface ParsedGraph {
|
|
702
727
|
type: 'flowchart';
|
|
703
728
|
title?: string;
|
|
@@ -706,6 +731,8 @@ interface ParsedGraph {
|
|
|
706
731
|
nodes: GraphNode[];
|
|
707
732
|
edges: GraphEdge[];
|
|
708
733
|
groups?: GraphGroup[];
|
|
734
|
+
options: Record<string, string>;
|
|
735
|
+
diagnostics: DgmoError[];
|
|
709
736
|
error?: string;
|
|
710
737
|
}
|
|
711
738
|
|
|
@@ -744,12 +771,15 @@ interface ClassRelationship {
|
|
|
744
771
|
label?: string;
|
|
745
772
|
lineNumber: number;
|
|
746
773
|
}
|
|
774
|
+
|
|
747
775
|
interface ParsedClassDiagram {
|
|
748
776
|
type: 'class';
|
|
749
777
|
title?: string;
|
|
750
778
|
titleLineNumber?: number;
|
|
751
779
|
classes: ClassNode[];
|
|
752
780
|
relationships: ClassRelationship[];
|
|
781
|
+
options: Record<string, string>;
|
|
782
|
+
diagnostics: DgmoError[];
|
|
753
783
|
error?: string;
|
|
754
784
|
}
|
|
755
785
|
|
|
@@ -820,6 +850,7 @@ interface ERRelationship {
|
|
|
820
850
|
label?: string;
|
|
821
851
|
lineNumber: number;
|
|
822
852
|
}
|
|
853
|
+
|
|
823
854
|
interface ParsedERDiagram {
|
|
824
855
|
type: 'er';
|
|
825
856
|
title?: string;
|
|
@@ -827,6 +858,7 @@ interface ParsedERDiagram {
|
|
|
827
858
|
options: Record<string, string>;
|
|
828
859
|
tables: ERTable[];
|
|
829
860
|
relationships: ERRelationship[];
|
|
861
|
+
diagnostics: DgmoError[];
|
|
830
862
|
error?: string;
|
|
831
863
|
}
|
|
832
864
|
|
|
@@ -902,6 +934,7 @@ interface ParsedOrg {
|
|
|
902
934
|
roots: OrgNode[];
|
|
903
935
|
tagGroups: OrgTagGroup[];
|
|
904
936
|
options: Record<string, string>;
|
|
937
|
+
diagnostics: DgmoError[];
|
|
905
938
|
error: string | null;
|
|
906
939
|
}
|
|
907
940
|
declare function parseOrg(content: string, palette?: PaletteColors): ParsedOrg;
|
|
@@ -957,6 +990,8 @@ interface OrgLegendGroup {
|
|
|
957
990
|
y: number;
|
|
958
991
|
width: number;
|
|
959
992
|
height: number;
|
|
993
|
+
minifiedWidth: number;
|
|
994
|
+
minifiedHeight: number;
|
|
960
995
|
}
|
|
961
996
|
interface OrgLayoutResult {
|
|
962
997
|
nodes: OrgLayoutNode[];
|
|
@@ -982,6 +1017,25 @@ interface CollapsedOrgResult {
|
|
|
982
1017
|
}
|
|
983
1018
|
declare function collapseOrgTree(original: ParsedOrg, collapsedIds: Set<string>): CollapsedOrgResult;
|
|
984
1019
|
|
|
1020
|
+
/**
|
|
1021
|
+
* Async or sync file reader. Receives an absolute path, returns content.
|
|
1022
|
+
* Throwing means "file not found".
|
|
1023
|
+
*/
|
|
1024
|
+
type ReadFileFn = (path: string) => string | Promise<string>;
|
|
1025
|
+
interface ResolveImportsResult {
|
|
1026
|
+
content: string;
|
|
1027
|
+
diagnostics: DgmoError[];
|
|
1028
|
+
}
|
|
1029
|
+
/**
|
|
1030
|
+
* Pre-processes org chart content, resolving `tags:` and `import:` directives.
|
|
1031
|
+
*
|
|
1032
|
+
* @param content - Raw .dgmo file content
|
|
1033
|
+
* @param filePath - Absolute path of the file (for relative path resolution)
|
|
1034
|
+
* @param readFileFn - Function to read files (sync or async)
|
|
1035
|
+
* @returns Merged content with all imports resolved + diagnostics
|
|
1036
|
+
*/
|
|
1037
|
+
declare function resolveOrgImports(content: string, filePath: string, readFileFn: ReadFileFn): Promise<ResolveImportsResult>;
|
|
1038
|
+
|
|
985
1039
|
interface LayoutNode {
|
|
986
1040
|
id: string;
|
|
987
1041
|
label: string;
|
|
@@ -1167,4 +1221,4 @@ declare function decodeDiagramUrl(hash: string): DecodedDiagramUrl;
|
|
|
1167
1221
|
*/
|
|
1168
1222
|
declare function injectBranding(svgHtml: string, mutedColor: string): string;
|
|
1169
1223
|
|
|
1170
|
-
export { type Activation, type ArcLink, type ArcNodeGroup, type ChartDataPoint, type ChartType, type ClassLayoutEdge, type ClassLayoutNode, type ClassLayoutResult, type ClassMember, type ClassModifier, type ClassNode, type ClassRelationship, type CollapsedOrgResult, type D3ChartType, type D3ExportDimensions, DGMO_CHART_TYPE_MAP, type DecodedDiagramUrl, type DgmoFramework, type DiagramViewState, type EChartsChartType, type ERCardinality, type ERColumn, type ERConstraint, type ERLayoutEdge, type ERLayoutNode, type ERLayoutResult, type ERRelationship, type ERTable, type ElseIfBranch, type EncodeDiagramUrlOptions, type EncodeDiagramUrlResult, type GraphDirection, type GraphEdge, type GraphGroup, type GraphNode, type GraphShape, type LayoutEdge, type LayoutGroup, type LayoutNode, type LayoutResult, type MemberVisibility, type OrgContainerBounds, type OrgLayoutEdge, type OrgLayoutNode, type OrgLayoutResult, type OrgNode, type OrgTagEntry, type OrgTagGroup, type PaletteColors, type PaletteConfig, type ParsedChart, type ParsedClassDiagram, type ParsedD3, type ParsedEChart, type ParsedERDiagram, type ParsedGraph, type ParsedOrg, type ParsedQuadrant, type ParsedSequenceDgmo, type ParticipantType, RULE_COUNT, type RelationshipType, type RenderStep, type SectionMessageGroup, type SequenceBlock, type SequenceElement, type SequenceGroup, type SequenceMessage, type SequenceNote, type SequenceParticipant, type SequenceRenderOptions, type SequenceSection, addDurationToDate, applyGroupOrdering, applyPositionOverrides, boldPalette, buildEChartsOption, buildEChartsOptionFromChart, buildMermaidQuadrant, buildMermaidThemeVars, buildNoteMessageMap, buildRenderSequence, buildThemeCSS, catppuccinPalette, collapseOrgTree, colorNames, computeActivations, computeTimeTicks, contrastText, decodeDiagramUrl, encodeDiagramUrl, formatDateLabel, getAvailablePalettes, getDgmoFramework, getPalette, getSeriesColors, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, injectBranding, isSequenceBlock, isSequenceNote, isValidHex, layoutClassDiagram, layoutERDiagram, layoutGraph, layoutOrg, looksLikeClassDiagram, looksLikeERDiagram, looksLikeFlowchart, looksLikeSequence, mute, nord, nordPalette, oneDarkPalette, orderArcNodes, parseChart, parseClassDiagram, parseD3, parseDgmoChartType, parseEChart, parseERDiagram, parseFlowchart, parseOrg, parseQuadrant, parseSequenceDgmo, parseTimelineDate, registerPalette, render, renderArcDiagram, renderClassDiagram, renderClassDiagramForExport, renderD3ForExport, renderEChartsForExport, renderERDiagram, renderERDiagramForExport, renderFlowchart, renderFlowchartForExport, renderOrg, renderOrgForExport, renderQuadrant, renderSequenceDiagram, renderSlopeChart, renderTimeline, renderVenn, renderWordCloud, resolveColor, rosePinePalette, seriesColors, shade, solarizedPalette, tint, tokyoNightPalette };
|
|
1224
|
+
export { type Activation, type ArcLink, type ArcNodeGroup, type ChartDataPoint, type ChartType, type ClassLayoutEdge, type ClassLayoutNode, type ClassLayoutResult, type ClassMember, type ClassModifier, type ClassNode, type ClassRelationship, type CollapsedOrgResult, type D3ChartType, type D3ExportDimensions, DGMO_CHART_TYPE_MAP, type DecodedDiagramUrl, type DgmoError, type DgmoFramework, type DgmoSeverity, type DiagramViewState, type EChartsChartType, type ERCardinality, type ERColumn, type ERConstraint, type ERLayoutEdge, type ERLayoutNode, type ERLayoutResult, type ERRelationship, type ERTable, type ElseIfBranch, type EncodeDiagramUrlOptions, type EncodeDiagramUrlResult, type GraphDirection, type GraphEdge, type GraphGroup, type GraphNode, type GraphShape, type LayoutEdge, type LayoutGroup, type LayoutNode, type LayoutResult, type MemberVisibility, type OrgContainerBounds, type OrgLayoutEdge, type OrgLayoutNode, type OrgLayoutResult, type OrgNode, type OrgTagEntry, type OrgTagGroup, type PaletteColors, type PaletteConfig, type ParsedChart, type ParsedClassDiagram, type ParsedD3, type ParsedEChart, type ParsedERDiagram, type ParsedGraph, type ParsedOrg, type ParsedQuadrant, type ParsedSequenceDgmo, type ParticipantType, RULE_COUNT, type ReadFileFn, type RelationshipType, type RenderStep, type ResolveImportsResult, type SectionMessageGroup, type SequenceBlock, type SequenceElement, type SequenceGroup, type SequenceMessage, type SequenceNote, type SequenceParticipant, type SequenceRenderOptions, type SequenceSection, addDurationToDate, applyGroupOrdering, applyPositionOverrides, boldPalette, buildEChartsOption, buildEChartsOptionFromChart, buildMermaidQuadrant, buildMermaidThemeVars, buildNoteMessageMap, buildRenderSequence, buildThemeCSS, catppuccinPalette, collapseOrgTree, colorNames, computeActivations, computeTimeTicks, contrastText, decodeDiagramUrl, encodeDiagramUrl, formatDateLabel, formatDgmoError, getAvailablePalettes, getDgmoFramework, getPalette, getSeriesColors, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, injectBranding, isSequenceBlock, isSequenceNote, isValidHex, layoutClassDiagram, layoutERDiagram, layoutGraph, layoutOrg, looksLikeClassDiagram, looksLikeERDiagram, looksLikeFlowchart, looksLikeSequence, makeDgmoError, mute, nord, nordPalette, oneDarkPalette, orderArcNodes, parseChart, parseClassDiagram, parseD3, parseDgmo, parseDgmoChartType, parseEChart, parseERDiagram, parseFlowchart, parseOrg, parseQuadrant, parseSequenceDgmo, parseTimelineDate, registerPalette, render, renderArcDiagram, renderClassDiagram, renderClassDiagramForExport, renderD3ForExport, renderEChartsForExport, renderERDiagram, renderERDiagramForExport, renderFlowchart, renderFlowchartForExport, renderOrg, renderOrgForExport, renderQuadrant, renderSequenceDiagram, renderSlopeChart, renderTimeline, renderVenn, renderWordCloud, resolveColor, resolveOrgImports, rosePinePalette, seriesColors, shade, solarizedPalette, tint, tokyoNightPalette };
|