@diagrammo/dgmo 0.8.4 → 0.8.5

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/index.d.cts CHANGED
@@ -260,6 +260,27 @@ 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
+ }): {
281
+ label: string;
282
+ values: number[];
283
+ } | null;
263
284
 
264
285
  interface LegendGroupData {
265
286
  name: 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 CollapseResult, 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 ISEdge, type ISGroup, type ISLayoutEdge, type ISLayoutGroup, type ISLayoutNode, type ISLayoutResult, type ISNode, type ISRenderOptions, 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 InitiativeStatus, 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 ParsedC4, type ParsedChart, type ParsedClassDiagram, type ParsedERDiagram, type ParsedExtendedChart, type ParsedGantt, type ParsedGraph, type ParsedInfra, type ParsedInitiativeStatus, 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, collapseInitiativeStatus, collapseOrgTree, collapseSitemapTree, collectDiagramRoles, collectTasks, colorNames, computeActivations, computeCardArchive, computeCardMove, computeInfra, computeInfraLegendGroups, computeScatterLabelGraphics, computeTimeTicks, contrastText, decodeDiagramUrl, encodeDiagramUrl, extractDiagramSymbols, extractTagDeclarations, filterInitiativeStatusByTags, formatDateLabel, formatDgmoError, getAvailablePalettes, getExtendedChartLegendGroups, getPalette, getRenderCategory, getSeriesColors, getSimpleChartLegendGroups, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, inferRoles, injectBranding, isArchiveColumn, isExtendedChartType, isSequenceBlock, isSequenceNote, isValidHex, layoutC4Components, layoutC4Containers, layoutC4Context, layoutC4Deployment, layoutClassDiagram, layoutERDiagram, layoutGraph, layoutInfra, layoutInitiativeStatus, layoutOrg, layoutSitemap, looksLikeClassDiagram, looksLikeERDiagram, looksLikeFlowchart, looksLikeInitiativeStatus, looksLikeSequence, looksLikeSitemap, looksLikeState, makeDgmoError, mute, nord, nordPalette, oneDarkPalette, orderArcNodes, parseAndLayoutInfra, parseC4, parseChart, parseClassDiagram, parseDgmo, parseDgmoChartType, parseERDiagram, parseExtendedChart, parseFirstLine, parseFlowchart, parseGantt, parseInfra, parseInitiativeStatus, parseInlineMarkdown, parseKanban, parseOrg, parseQuadrant, parseSequenceDgmo, parseSitemap, parseState, parseTimelineDate, parseVisualization, registerExtractor, registerPalette, render, renderArcDiagram, renderC4ComponentsForExport, renderC4Containers, renderC4ContainersForExport, renderC4Context, renderC4ContextForExport, renderC4Deployment, renderC4DeploymentForExport, renderClassDiagram, renderClassDiagramForExport, renderERDiagram, renderERDiagramForExport, renderExtendedChartForExport, renderFlowchart, renderFlowchartForExport, renderForExport, renderGantt, renderInfra, renderInitiativeStatus, renderInitiativeStatusForExport, 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 };
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 CollapseResult, 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 ISEdge, type ISGroup, type ISLayoutEdge, type ISLayoutGroup, type ISLayoutNode, type ISLayoutResult, type ISNode, type ISRenderOptions, 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 InitiativeStatus, 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 ParsedC4, type ParsedChart, type ParsedClassDiagram, type ParsedERDiagram, type ParsedExtendedChart, type ParsedGantt, type ParsedGraph, type ParsedInfra, type ParsedInitiativeStatus, 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, collapseInitiativeStatus, collapseOrgTree, collapseSitemapTree, collectDiagramRoles, collectTasks, colorNames, computeActivations, computeCardArchive, computeCardMove, computeInfra, computeInfraLegendGroups, computeScatterLabelGraphics, computeTimeTicks, contrastText, decodeDiagramUrl, encodeDiagramUrl, extractDiagramSymbols, extractTagDeclarations, filterInitiativeStatusByTags, formatDateLabel, formatDgmoError, getAvailablePalettes, getExtendedChartLegendGroups, getPalette, getRenderCategory, getSeriesColors, getSimpleChartLegendGroups, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, inferRoles, injectBranding, isArchiveColumn, isExtendedChartType, isSequenceBlock, isSequenceNote, isValidHex, layoutC4Components, layoutC4Containers, layoutC4Context, layoutC4Deployment, layoutClassDiagram, layoutERDiagram, layoutGraph, layoutInfra, layoutInitiativeStatus, layoutOrg, layoutSitemap, looksLikeClassDiagram, looksLikeERDiagram, looksLikeFlowchart, looksLikeInitiativeStatus, looksLikeSequence, looksLikeSitemap, looksLikeState, makeDgmoError, mute, nord, nordPalette, oneDarkPalette, orderArcNodes, parseAndLayoutInfra, parseC4, parseChart, parseClassDiagram, parseDataRowValues, parseDgmo, parseDgmoChartType, parseERDiagram, parseExtendedChart, parseFirstLine, parseFlowchart, parseGantt, parseInfra, parseInitiativeStatus, parseInlineMarkdown, parseKanban, parseOrg, parseQuadrant, parseSequenceDgmo, parseSitemap, parseState, parseTimelineDate, parseVisualization, registerExtractor, registerPalette, render, renderArcDiagram, renderC4ComponentsForExport, renderC4Containers, renderC4ContainersForExport, renderC4Context, renderC4ContextForExport, renderC4Deployment, renderC4DeploymentForExport, renderClassDiagram, renderClassDiagramForExport, renderERDiagram, renderERDiagramForExport, renderExtendedChartForExport, renderFlowchart, renderFlowchartForExport, renderForExport, renderGantt, renderInfra, renderInitiativeStatus, renderInitiativeStatusForExport, 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,27 @@ 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
+ }): {
281
+ label: string;
282
+ values: number[];
283
+ } | null;
263
284
 
264
285
  interface LegendGroupData {
265
286
  name: 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 CollapseResult, 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 ISEdge, type ISGroup, type ISLayoutEdge, type ISLayoutGroup, type ISLayoutNode, type ISLayoutResult, type ISNode, type ISRenderOptions, 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 InitiativeStatus, 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 ParsedC4, type ParsedChart, type ParsedClassDiagram, type ParsedERDiagram, type ParsedExtendedChart, type ParsedGantt, type ParsedGraph, type ParsedInfra, type ParsedInitiativeStatus, 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, collapseInitiativeStatus, collapseOrgTree, collapseSitemapTree, collectDiagramRoles, collectTasks, colorNames, computeActivations, computeCardArchive, computeCardMove, computeInfra, computeInfraLegendGroups, computeScatterLabelGraphics, computeTimeTicks, contrastText, decodeDiagramUrl, encodeDiagramUrl, extractDiagramSymbols, extractTagDeclarations, filterInitiativeStatusByTags, formatDateLabel, formatDgmoError, getAvailablePalettes, getExtendedChartLegendGroups, getPalette, getRenderCategory, getSeriesColors, getSimpleChartLegendGroups, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, inferRoles, injectBranding, isArchiveColumn, isExtendedChartType, isSequenceBlock, isSequenceNote, isValidHex, layoutC4Components, layoutC4Containers, layoutC4Context, layoutC4Deployment, layoutClassDiagram, layoutERDiagram, layoutGraph, layoutInfra, layoutInitiativeStatus, layoutOrg, layoutSitemap, looksLikeClassDiagram, looksLikeERDiagram, looksLikeFlowchart, looksLikeInitiativeStatus, looksLikeSequence, looksLikeSitemap, looksLikeState, makeDgmoError, mute, nord, nordPalette, oneDarkPalette, orderArcNodes, parseAndLayoutInfra, parseC4, parseChart, parseClassDiagram, parseDgmo, parseDgmoChartType, parseERDiagram, parseExtendedChart, parseFirstLine, parseFlowchart, parseGantt, parseInfra, parseInitiativeStatus, parseInlineMarkdown, parseKanban, parseOrg, parseQuadrant, parseSequenceDgmo, parseSitemap, parseState, parseTimelineDate, parseVisualization, registerExtractor, registerPalette, render, renderArcDiagram, renderC4ComponentsForExport, renderC4Containers, renderC4ContainersForExport, renderC4Context, renderC4ContextForExport, renderC4Deployment, renderC4DeploymentForExport, renderClassDiagram, renderClassDiagramForExport, renderERDiagram, renderERDiagramForExport, renderExtendedChartForExport, renderFlowchart, renderFlowchartForExport, renderForExport, renderGantt, renderInfra, renderInitiativeStatus, renderInitiativeStatusForExport, 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 };
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 CollapseResult, 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 ISEdge, type ISGroup, type ISLayoutEdge, type ISLayoutGroup, type ISLayoutNode, type ISLayoutResult, type ISNode, type ISRenderOptions, 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 InitiativeStatus, 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 ParsedC4, type ParsedChart, type ParsedClassDiagram, type ParsedERDiagram, type ParsedExtendedChart, type ParsedGantt, type ParsedGraph, type ParsedInfra, type ParsedInitiativeStatus, 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, collapseInitiativeStatus, collapseOrgTree, collapseSitemapTree, collectDiagramRoles, collectTasks, colorNames, computeActivations, computeCardArchive, computeCardMove, computeInfra, computeInfraLegendGroups, computeScatterLabelGraphics, computeTimeTicks, contrastText, decodeDiagramUrl, encodeDiagramUrl, extractDiagramSymbols, extractTagDeclarations, filterInitiativeStatusByTags, formatDateLabel, formatDgmoError, getAvailablePalettes, getExtendedChartLegendGroups, getPalette, getRenderCategory, getSeriesColors, getSimpleChartLegendGroups, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, inferRoles, injectBranding, isArchiveColumn, isExtendedChartType, isSequenceBlock, isSequenceNote, isValidHex, layoutC4Components, layoutC4Containers, layoutC4Context, layoutC4Deployment, layoutClassDiagram, layoutERDiagram, layoutGraph, layoutInfra, layoutInitiativeStatus, layoutOrg, layoutSitemap, looksLikeClassDiagram, looksLikeERDiagram, looksLikeFlowchart, looksLikeInitiativeStatus, looksLikeSequence, looksLikeSitemap, looksLikeState, makeDgmoError, mute, nord, nordPalette, oneDarkPalette, orderArcNodes, parseAndLayoutInfra, parseC4, parseChart, parseClassDiagram, parseDataRowValues, parseDgmo, parseDgmoChartType, parseERDiagram, parseExtendedChart, parseFirstLine, parseFlowchart, parseGantt, parseInfra, parseInitiativeStatus, parseInlineMarkdown, parseKanban, parseOrg, parseQuadrant, parseSequenceDgmo, parseSitemap, parseState, parseTimelineDate, parseVisualization, registerExtractor, registerPalette, render, renderArcDiagram, renderC4ComponentsForExport, renderC4Containers, renderC4ContainersForExport, renderC4Context, renderC4ContextForExport, renderC4Deployment, renderC4DeploymentForExport, renderClassDiagram, renderClassDiagramForExport, renderERDiagram, renderERDiagramForExport, renderExtendedChartForExport, renderFlowchart, renderFlowchartForExport, renderForExport, renderGantt, renderInfra, renderInitiativeStatus, renderInitiativeStatusForExport, 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.js CHANGED
@@ -25857,6 +25857,7 @@ function parseVisualization(content, palette) {
25857
25857
  let timelineEraBlockIndent = 0;
25858
25858
  let inTimelineMarkerBlock = false;
25859
25859
  let timelineMarkerBlockIndent = 0;
25860
+ let inSlopePeriodBlock = false;
25860
25861
  const timelineAliasMap = /* @__PURE__ */ new Map();
25861
25862
  const VALID_D3_TYPES = /* @__PURE__ */ new Set([
25862
25863
  "slope",
@@ -26312,6 +26313,118 @@ function parseVisualization(content, palette) {
26312
26313
  continue;
26313
26314
  }
26314
26315
  }
26316
+ if (result.type === "slope") {
26317
+ if (inSlopePeriodBlock) {
26318
+ if (indent > 0) {
26319
+ result.periods.push(line10);
26320
+ continue;
26321
+ }
26322
+ inSlopePeriodBlock = false;
26323
+ }
26324
+ if (result.data.length === 0) {
26325
+ const periodMatch = line10.match(/^period\b(.*)$/i);
26326
+ if (periodMatch) {
26327
+ if (result.periods.length > 0 && !inSlopePeriodBlock) {
26328
+ warn(
26329
+ lineNumber,
26330
+ `Duplicate 'period' directive \u2014 periods are already defined`
26331
+ );
26332
+ }
26333
+ const rest = periodMatch[1].trim();
26334
+ if (rest) {
26335
+ const periodLabels = rest.split(/\s+/);
26336
+ result.periods.push(...periodLabels);
26337
+ } else {
26338
+ inSlopePeriodBlock = true;
26339
+ }
26340
+ continue;
26341
+ }
26342
+ }
26343
+ if (result.periods.length === 0 && line10.includes(",") && !line10.includes(":")) {
26344
+ const tokens = line10.split(",").map((t) => t.trim()).filter(Boolean);
26345
+ const looksLikePeriods = tokens.length >= 2 && tokens.every((t) => t.length <= 20);
26346
+ if (looksLikePeriods) {
26347
+ return fail(
26348
+ lineNumber,
26349
+ `Period lines require the 'period' keyword \u2014 use 'period ${tokens.join(" ")}'`
26350
+ );
26351
+ }
26352
+ }
26353
+ if (line10.includes(":")) {
26354
+ const colonPos = line10.indexOf(":");
26355
+ const afterColon = line10.substring(colonPos + 1).trim();
26356
+ const numericTokens = afterColon.split(/[,\s]+/).filter((v) => /^-?\d/.test(v));
26357
+ if (numericTokens.length >= 1) {
26358
+ const allTokens = afterColon.split(/[,\s]+/).filter(Boolean);
26359
+ if (numericTokens.length >= allTokens.length * 0.5) {
26360
+ const label = line10.substring(0, colonPos).trim();
26361
+ return fail(
26362
+ lineNumber,
26363
+ `Colons are no longer used in slope data rows \u2014 use '${label} ${numericTokens.join(" ")}'`
26364
+ );
26365
+ }
26366
+ }
26367
+ }
26368
+ if (result.periods.length >= 2) {
26369
+ const P = result.periods.length;
26370
+ const tokens = line10.split(/\s+/);
26371
+ const values = [];
26372
+ let rightIdx = tokens.length - 1;
26373
+ while (rightIdx >= 0 && values.length < P) {
26374
+ const raw = tokens[rightIdx].replace(/,/g, "");
26375
+ const num = parseFloat(raw);
26376
+ if (!isNaN(num) && /^-?\d/.test(raw)) {
26377
+ values.unshift(num);
26378
+ rightIdx--;
26379
+ } else {
26380
+ break;
26381
+ }
26382
+ }
26383
+ if (values.length < P) {
26384
+ warn(
26385
+ lineNumber,
26386
+ `Data row has ${values.length} numeric value(s) but ${P} period(s) are defined \u2014 expected ${P} values`
26387
+ );
26388
+ continue;
26389
+ }
26390
+ const labelTokens = tokens.slice(0, rightIdx + 1);
26391
+ const joinedLabel = labelTokens.join(" ");
26392
+ if (!joinedLabel) {
26393
+ warn(
26394
+ lineNumber,
26395
+ `Data row has no label \u2014 add a label before the numeric values`
26396
+ );
26397
+ continue;
26398
+ }
26399
+ const colorMatch = joinedLabel.match(/^(.+?)\(([^)]+)\)\s*$/);
26400
+ const labelPart = colorMatch ? colorMatch[1].trim() : joinedLabel;
26401
+ const colorPart = colorMatch ? resolveColor(colorMatch[2].trim(), palette) : null;
26402
+ if (!labelPart) {
26403
+ warn(
26404
+ lineNumber,
26405
+ `Data row has no label \u2014 add a label before the numeric values`
26406
+ );
26407
+ continue;
26408
+ }
26409
+ if (/^\d[\d,.]*$/.test(labelPart)) {
26410
+ warn(
26411
+ lineNumber,
26412
+ `Label '${labelPart}' looks numeric \u2014 this may indicate too many values or a missing label`
26413
+ );
26414
+ }
26415
+ result.data.push({
26416
+ label: labelPart,
26417
+ values,
26418
+ color: colorPart,
26419
+ lineNumber
26420
+ });
26421
+ continue;
26422
+ }
26423
+ if (firstLineParsed) {
26424
+ warn(lineNumber, `Unexpected line: '${line10}'.`);
26425
+ }
26426
+ continue;
26427
+ }
26315
26428
  const colonIndex = line10.indexOf(":");
26316
26429
  if (colonIndex !== -1) {
26317
26430
  const rawKey = line10.substring(0, colonIndex).trim();
@@ -26401,13 +26514,6 @@ function parseVisualization(content, palette) {
26401
26514
  }
26402
26515
  continue;
26403
26516
  }
26404
- if (result.periods.length === 0 && line10.includes(",") && !line10.includes(":")) {
26405
- const periods = line10.split(",").map((p) => p.trim()).filter(Boolean);
26406
- if (periods.length >= 2) {
26407
- result.periods = periods;
26408
- continue;
26409
- }
26410
- }
26411
26517
  if (firstLineParsed) {
26412
26518
  warn(lineNumber, `Unexpected line: '${line10}'.`);
26413
26519
  }
@@ -26545,13 +26651,13 @@ function parseVisualization(content, palette) {
26545
26651
  if (result.periods.length < 2) {
26546
26652
  return fail(
26547
26653
  1,
26548
- 'Missing or invalid periods line. Provide at least 2 comma-separated period labels (e.g., "2020, 2024")'
26654
+ "Missing 'period' directive. Add 'period 2020 2024' before data rows (minimum 2 periods required)"
26549
26655
  );
26550
26656
  }
26551
26657
  if (result.data.length === 0) {
26552
26658
  warn(
26553
26659
  1,
26554
- 'No data lines found. Add data as "Label: value1, value2" (e.g., "Apple: 25, 35")'
26660
+ "No data lines found. Add data as 'Label value1 value2' (e.g., 'Blackbeard 40 4')"
26555
26661
  );
26556
26662
  }
26557
26663
  for (const item of result.data) {
@@ -31402,6 +31508,7 @@ export {
31402
31508
  parseC4,
31403
31509
  parseChart,
31404
31510
  parseClassDiagram,
31511
+ parseDataRowValues,
31405
31512
  parseDgmo,
31406
31513
  parseDgmoChartType,
31407
31514
  parseERDiagram,