@diagrammo/dgmo 0.2.2 → 0.2.4
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/dist/cli.cjs +69 -69
- package/dist/index.cjs +214 -141
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -9
- package/dist/index.d.ts +15 -9
- package/dist/index.js +214 -141
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
- package/src/d3.ts +159 -130
- package/src/echarts.ts +103 -51
- package/src/index.ts +1 -1
- package/src/palettes/bold.ts +1 -1
- package/src/sequence/parser.ts +12 -1
- package/src/sequence/renderer.ts +9 -4
package/dist/index.d.cts
CHANGED
|
@@ -275,12 +275,12 @@ declare function parseEChart(content: string, palette?: PaletteColors): ParsedEC
|
|
|
275
275
|
/**
|
|
276
276
|
* Converts parsed echart data to ECharts option object.
|
|
277
277
|
*/
|
|
278
|
-
declare function buildEChartsOption(parsed: ParsedEChart, palette: PaletteColors,
|
|
278
|
+
declare function buildEChartsOption(parsed: ParsedEChart, palette: PaletteColors, isDark: boolean): EChartsOption;
|
|
279
279
|
/**
|
|
280
280
|
* Converts a ParsedChart into an EChartsOption.
|
|
281
281
|
* Renders standard chart types (bar, line, pie, etc.) with ECharts.
|
|
282
282
|
*/
|
|
283
|
-
declare function buildEChartsOptionFromChart(parsed: ParsedChart, palette: PaletteColors,
|
|
283
|
+
declare function buildEChartsOptionFromChart(parsed: ParsedChart, palette: PaletteColors, isDark: boolean): EChartsOption;
|
|
284
284
|
/**
|
|
285
285
|
* Renders an ECharts diagram to SVG using server-side rendering.
|
|
286
286
|
* Mirrors the `renderD3ForExport` API — returns an SVG string or empty string on failure.
|
|
@@ -376,6 +376,11 @@ interface QuadrantLabels {
|
|
|
376
376
|
bottomLeft: QuadrantLabel$1 | null;
|
|
377
377
|
bottomRight: QuadrantLabel$1 | null;
|
|
378
378
|
}
|
|
379
|
+
/** Optional explicit dimensions for CLI/export rendering (bypasses DOM layout). */
|
|
380
|
+
interface D3ExportDimensions {
|
|
381
|
+
width?: number;
|
|
382
|
+
height?: number;
|
|
383
|
+
}
|
|
379
384
|
interface ParsedD3 {
|
|
380
385
|
type: D3ChartType | null;
|
|
381
386
|
title: string | null;
|
|
@@ -425,7 +430,7 @@ declare function parseD3(content: string, palette?: PaletteColors): ParsedD3;
|
|
|
425
430
|
/**
|
|
426
431
|
* Renders a slope chart into the given container using D3.
|
|
427
432
|
*/
|
|
428
|
-
declare function renderSlopeChart(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, isDark: boolean, onClickItem?: (lineNumber: number) => void): void;
|
|
433
|
+
declare function renderSlopeChart(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, isDark: boolean, onClickItem?: (lineNumber: number) => void, exportDims?: D3ExportDimensions): void;
|
|
429
434
|
/**
|
|
430
435
|
* Orders arc diagram nodes based on the selected ordering strategy.
|
|
431
436
|
*/
|
|
@@ -433,7 +438,7 @@ declare function orderArcNodes(links: ArcLink[], order: ArcOrder, groups: ArcNod
|
|
|
433
438
|
/**
|
|
434
439
|
* Renders an arc diagram into the given container using D3.
|
|
435
440
|
*/
|
|
436
|
-
declare function renderArcDiagram(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, _isDark: boolean, onClickItem?: (lineNumber: number) => void): void;
|
|
441
|
+
declare function renderArcDiagram(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, _isDark: boolean, onClickItem?: (lineNumber: number) => void, exportDims?: D3ExportDimensions): void;
|
|
437
442
|
/**
|
|
438
443
|
* Converts a DSL date string (YYYY, YYYY-MM, YYYY-MM-DD) to a human-readable label.
|
|
439
444
|
* '1718' → '1718'
|
|
@@ -459,17 +464,17 @@ declare function computeTimeTicks(domainMin: number, domainMax: number, scale: d
|
|
|
459
464
|
* Renders a timeline chart into the given container using D3.
|
|
460
465
|
* Supports horizontal (default) and vertical orientation.
|
|
461
466
|
*/
|
|
462
|
-
declare function renderTimeline(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, isDark: boolean, onClickItem?: (lineNumber: number) => void): void;
|
|
467
|
+
declare function renderTimeline(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, isDark: boolean, onClickItem?: (lineNumber: number) => void, exportDims?: D3ExportDimensions): void;
|
|
463
468
|
/**
|
|
464
469
|
* Renders a word cloud into the given container using d3-cloud.
|
|
465
470
|
*/
|
|
466
|
-
declare function renderWordCloud(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, _isDark: boolean, onClickItem?: (lineNumber: number) => void): void;
|
|
467
|
-
declare function renderVenn(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, isDark: boolean, onClickItem?: (lineNumber: number) => void): void;
|
|
471
|
+
declare function renderWordCloud(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, _isDark: boolean, onClickItem?: (lineNumber: number) => void, exportDims?: D3ExportDimensions): void;
|
|
472
|
+
declare function renderVenn(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, isDark: boolean, onClickItem?: (lineNumber: number) => void, exportDims?: D3ExportDimensions): void;
|
|
468
473
|
/**
|
|
469
474
|
* Renders a quadrant chart using D3.
|
|
470
475
|
* Displays 4 colored quadrant regions, axis labels, quadrant labels, and data points.
|
|
471
476
|
*/
|
|
472
|
-
declare function renderQuadrant(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, isDark: boolean, onClickItem?: (lineNumber: number) => void): void;
|
|
477
|
+
declare function renderQuadrant(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, isDark: boolean, onClickItem?: (lineNumber: number) => void, exportDims?: D3ExportDimensions): void;
|
|
473
478
|
/**
|
|
474
479
|
* Renders a D3 chart to an SVG string for export.
|
|
475
480
|
* Creates a detached DOM element, renders into it, extracts the SVG, then cleans up.
|
|
@@ -618,6 +623,7 @@ interface SectionMessageGroup {
|
|
|
618
623
|
}
|
|
619
624
|
interface SequenceRenderOptions {
|
|
620
625
|
collapsedSections?: Set<number>;
|
|
626
|
+
exportWidth?: number;
|
|
621
627
|
}
|
|
622
628
|
/**
|
|
623
629
|
* Group messages by the top-level section that precedes them.
|
|
@@ -699,4 +705,4 @@ declare function resolveColor(color: string, palette?: {
|
|
|
699
705
|
/** @deprecated Use getSeriesColors(palette) from '@/lib/palettes' instead. */
|
|
700
706
|
declare const seriesColors: string[];
|
|
701
707
|
|
|
702
|
-
export { type Activation, type ArcLink, type ArcNodeGroup, type ChartDataPoint, type ChartType, type D3ChartType, DGMO_CHART_TYPE_MAP, type DgmoFramework, type EChartsChartType, type PaletteColors, type PaletteConfig, type ParsedChart, type ParsedD3, type ParsedEChart, type ParsedQuadrant, type ParsedSequenceDgmo, type ParticipantType, RULE_COUNT, type RenderStep, type SectionMessageGroup, type SequenceBlock, type SequenceElement, type SequenceGroup, type SequenceMessage, type SequenceParticipant, type SequenceRenderOptions, type SequenceSection, addDurationToDate, applyGroupOrdering, applyPositionOverrides, boldPalette, buildEChartsOption, buildEChartsOptionFromChart, buildMermaidQuadrant, buildMermaidThemeVars, buildRenderSequence, buildThemeCSS, catppuccinPalette, colorNames, computeActivations, computeTimeTicks, contrastText, formatDateLabel, getAvailablePalettes, getDgmoFramework, getPalette, getSeriesColors, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, isSequenceBlock, isValidHex, looksLikeSequence, mute, nord, nordPalette, oneDarkPalette, orderArcNodes, parseChart, parseD3, parseDgmoChartType, parseEChart, parseQuadrant, parseSequenceDgmo, parseTimelineDate, registerPalette, renderArcDiagram, renderD3ForExport, renderEChartsForExport, renderQuadrant, renderSequenceDiagram, renderSlopeChart, renderTimeline, renderVenn, renderWordCloud, resolveColor, rosePinePalette, seriesColors, shade, solarizedPalette, tint, tokyoNightPalette };
|
|
708
|
+
export { type Activation, type ArcLink, type ArcNodeGroup, type ChartDataPoint, type ChartType, type D3ChartType, type D3ExportDimensions, DGMO_CHART_TYPE_MAP, type DgmoFramework, type EChartsChartType, type PaletteColors, type PaletteConfig, type ParsedChart, type ParsedD3, type ParsedEChart, type ParsedQuadrant, type ParsedSequenceDgmo, type ParticipantType, RULE_COUNT, type RenderStep, type SectionMessageGroup, type SequenceBlock, type SequenceElement, type SequenceGroup, type SequenceMessage, type SequenceParticipant, type SequenceRenderOptions, type SequenceSection, addDurationToDate, applyGroupOrdering, applyPositionOverrides, boldPalette, buildEChartsOption, buildEChartsOptionFromChart, buildMermaidQuadrant, buildMermaidThemeVars, buildRenderSequence, buildThemeCSS, catppuccinPalette, colorNames, computeActivations, computeTimeTicks, contrastText, formatDateLabel, getAvailablePalettes, getDgmoFramework, getPalette, getSeriesColors, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, isSequenceBlock, isValidHex, looksLikeSequence, mute, nord, nordPalette, oneDarkPalette, orderArcNodes, parseChart, parseD3, parseDgmoChartType, parseEChart, parseQuadrant, parseSequenceDgmo, parseTimelineDate, registerPalette, renderArcDiagram, renderD3ForExport, renderEChartsForExport, renderQuadrant, renderSequenceDiagram, renderSlopeChart, renderTimeline, renderVenn, renderWordCloud, resolveColor, rosePinePalette, seriesColors, shade, solarizedPalette, tint, tokyoNightPalette };
|
package/dist/index.d.ts
CHANGED
|
@@ -275,12 +275,12 @@ declare function parseEChart(content: string, palette?: PaletteColors): ParsedEC
|
|
|
275
275
|
/**
|
|
276
276
|
* Converts parsed echart data to ECharts option object.
|
|
277
277
|
*/
|
|
278
|
-
declare function buildEChartsOption(parsed: ParsedEChart, palette: PaletteColors,
|
|
278
|
+
declare function buildEChartsOption(parsed: ParsedEChart, palette: PaletteColors, isDark: boolean): EChartsOption;
|
|
279
279
|
/**
|
|
280
280
|
* Converts a ParsedChart into an EChartsOption.
|
|
281
281
|
* Renders standard chart types (bar, line, pie, etc.) with ECharts.
|
|
282
282
|
*/
|
|
283
|
-
declare function buildEChartsOptionFromChart(parsed: ParsedChart, palette: PaletteColors,
|
|
283
|
+
declare function buildEChartsOptionFromChart(parsed: ParsedChart, palette: PaletteColors, isDark: boolean): EChartsOption;
|
|
284
284
|
/**
|
|
285
285
|
* Renders an ECharts diagram to SVG using server-side rendering.
|
|
286
286
|
* Mirrors the `renderD3ForExport` API — returns an SVG string or empty string on failure.
|
|
@@ -376,6 +376,11 @@ interface QuadrantLabels {
|
|
|
376
376
|
bottomLeft: QuadrantLabel$1 | null;
|
|
377
377
|
bottomRight: QuadrantLabel$1 | null;
|
|
378
378
|
}
|
|
379
|
+
/** Optional explicit dimensions for CLI/export rendering (bypasses DOM layout). */
|
|
380
|
+
interface D3ExportDimensions {
|
|
381
|
+
width?: number;
|
|
382
|
+
height?: number;
|
|
383
|
+
}
|
|
379
384
|
interface ParsedD3 {
|
|
380
385
|
type: D3ChartType | null;
|
|
381
386
|
title: string | null;
|
|
@@ -425,7 +430,7 @@ declare function parseD3(content: string, palette?: PaletteColors): ParsedD3;
|
|
|
425
430
|
/**
|
|
426
431
|
* Renders a slope chart into the given container using D3.
|
|
427
432
|
*/
|
|
428
|
-
declare function renderSlopeChart(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, isDark: boolean, onClickItem?: (lineNumber: number) => void): void;
|
|
433
|
+
declare function renderSlopeChart(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, isDark: boolean, onClickItem?: (lineNumber: number) => void, exportDims?: D3ExportDimensions): void;
|
|
429
434
|
/**
|
|
430
435
|
* Orders arc diagram nodes based on the selected ordering strategy.
|
|
431
436
|
*/
|
|
@@ -433,7 +438,7 @@ declare function orderArcNodes(links: ArcLink[], order: ArcOrder, groups: ArcNod
|
|
|
433
438
|
/**
|
|
434
439
|
* Renders an arc diagram into the given container using D3.
|
|
435
440
|
*/
|
|
436
|
-
declare function renderArcDiagram(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, _isDark: boolean, onClickItem?: (lineNumber: number) => void): void;
|
|
441
|
+
declare function renderArcDiagram(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, _isDark: boolean, onClickItem?: (lineNumber: number) => void, exportDims?: D3ExportDimensions): void;
|
|
437
442
|
/**
|
|
438
443
|
* Converts a DSL date string (YYYY, YYYY-MM, YYYY-MM-DD) to a human-readable label.
|
|
439
444
|
* '1718' → '1718'
|
|
@@ -459,17 +464,17 @@ declare function computeTimeTicks(domainMin: number, domainMax: number, scale: d
|
|
|
459
464
|
* Renders a timeline chart into the given container using D3.
|
|
460
465
|
* Supports horizontal (default) and vertical orientation.
|
|
461
466
|
*/
|
|
462
|
-
declare function renderTimeline(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, isDark: boolean, onClickItem?: (lineNumber: number) => void): void;
|
|
467
|
+
declare function renderTimeline(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, isDark: boolean, onClickItem?: (lineNumber: number) => void, exportDims?: D3ExportDimensions): void;
|
|
463
468
|
/**
|
|
464
469
|
* Renders a word cloud into the given container using d3-cloud.
|
|
465
470
|
*/
|
|
466
|
-
declare function renderWordCloud(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, _isDark: boolean, onClickItem?: (lineNumber: number) => void): void;
|
|
467
|
-
declare function renderVenn(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, isDark: boolean, onClickItem?: (lineNumber: number) => void): void;
|
|
471
|
+
declare function renderWordCloud(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, _isDark: boolean, onClickItem?: (lineNumber: number) => void, exportDims?: D3ExportDimensions): void;
|
|
472
|
+
declare function renderVenn(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, isDark: boolean, onClickItem?: (lineNumber: number) => void, exportDims?: D3ExportDimensions): void;
|
|
468
473
|
/**
|
|
469
474
|
* Renders a quadrant chart using D3.
|
|
470
475
|
* Displays 4 colored quadrant regions, axis labels, quadrant labels, and data points.
|
|
471
476
|
*/
|
|
472
|
-
declare function renderQuadrant(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, isDark: boolean, onClickItem?: (lineNumber: number) => void): void;
|
|
477
|
+
declare function renderQuadrant(container: HTMLDivElement, parsed: ParsedD3, palette: PaletteColors, isDark: boolean, onClickItem?: (lineNumber: number) => void, exportDims?: D3ExportDimensions): void;
|
|
473
478
|
/**
|
|
474
479
|
* Renders a D3 chart to an SVG string for export.
|
|
475
480
|
* Creates a detached DOM element, renders into it, extracts the SVG, then cleans up.
|
|
@@ -618,6 +623,7 @@ interface SectionMessageGroup {
|
|
|
618
623
|
}
|
|
619
624
|
interface SequenceRenderOptions {
|
|
620
625
|
collapsedSections?: Set<number>;
|
|
626
|
+
exportWidth?: number;
|
|
621
627
|
}
|
|
622
628
|
/**
|
|
623
629
|
* Group messages by the top-level section that precedes them.
|
|
@@ -699,4 +705,4 @@ declare function resolveColor(color: string, palette?: {
|
|
|
699
705
|
/** @deprecated Use getSeriesColors(palette) from '@/lib/palettes' instead. */
|
|
700
706
|
declare const seriesColors: string[];
|
|
701
707
|
|
|
702
|
-
export { type Activation, type ArcLink, type ArcNodeGroup, type ChartDataPoint, type ChartType, type D3ChartType, DGMO_CHART_TYPE_MAP, type DgmoFramework, type EChartsChartType, type PaletteColors, type PaletteConfig, type ParsedChart, type ParsedD3, type ParsedEChart, type ParsedQuadrant, type ParsedSequenceDgmo, type ParticipantType, RULE_COUNT, type RenderStep, type SectionMessageGroup, type SequenceBlock, type SequenceElement, type SequenceGroup, type SequenceMessage, type SequenceParticipant, type SequenceRenderOptions, type SequenceSection, addDurationToDate, applyGroupOrdering, applyPositionOverrides, boldPalette, buildEChartsOption, buildEChartsOptionFromChart, buildMermaidQuadrant, buildMermaidThemeVars, buildRenderSequence, buildThemeCSS, catppuccinPalette, colorNames, computeActivations, computeTimeTicks, contrastText, formatDateLabel, getAvailablePalettes, getDgmoFramework, getPalette, getSeriesColors, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, isSequenceBlock, isValidHex, looksLikeSequence, mute, nord, nordPalette, oneDarkPalette, orderArcNodes, parseChart, parseD3, parseDgmoChartType, parseEChart, parseQuadrant, parseSequenceDgmo, parseTimelineDate, registerPalette, renderArcDiagram, renderD3ForExport, renderEChartsForExport, renderQuadrant, renderSequenceDiagram, renderSlopeChart, renderTimeline, renderVenn, renderWordCloud, resolveColor, rosePinePalette, seriesColors, shade, solarizedPalette, tint, tokyoNightPalette };
|
|
708
|
+
export { type Activation, type ArcLink, type ArcNodeGroup, type ChartDataPoint, type ChartType, type D3ChartType, type D3ExportDimensions, DGMO_CHART_TYPE_MAP, type DgmoFramework, type EChartsChartType, type PaletteColors, type PaletteConfig, type ParsedChart, type ParsedD3, type ParsedEChart, type ParsedQuadrant, type ParsedSequenceDgmo, type ParticipantType, RULE_COUNT, type RenderStep, type SectionMessageGroup, type SequenceBlock, type SequenceElement, type SequenceGroup, type SequenceMessage, type SequenceParticipant, type SequenceRenderOptions, type SequenceSection, addDurationToDate, applyGroupOrdering, applyPositionOverrides, boldPalette, buildEChartsOption, buildEChartsOptionFromChart, buildMermaidQuadrant, buildMermaidThemeVars, buildRenderSequence, buildThemeCSS, catppuccinPalette, colorNames, computeActivations, computeTimeTicks, contrastText, formatDateLabel, getAvailablePalettes, getDgmoFramework, getPalette, getSeriesColors, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, isSequenceBlock, isValidHex, looksLikeSequence, mute, nord, nordPalette, oneDarkPalette, orderArcNodes, parseChart, parseD3, parseDgmoChartType, parseEChart, parseQuadrant, parseSequenceDgmo, parseTimelineDate, registerPalette, renderArcDiagram, renderD3ForExport, renderEChartsForExport, renderQuadrant, renderSequenceDiagram, renderSlopeChart, renderTimeline, renderVenn, renderWordCloud, resolveColor, rosePinePalette, seriesColors, shade, solarizedPalette, tint, tokyoNightPalette };
|