@diagrammo/dgmo 0.5.5 → 0.6.0

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.js CHANGED
@@ -3640,9 +3640,11 @@ var init_parser3 = __esm({
3640
3640
  // src/chart.ts
3641
3641
  function parseChart(content, palette) {
3642
3642
  const lines = content.split("\n");
3643
+ const parsedEras = [];
3643
3644
  const result = {
3644
3645
  type: "bar",
3645
3646
  data: [],
3647
+ eras: parsedEras,
3646
3648
  diagnostics: [],
3647
3649
  error: null
3648
3650
  };
@@ -3661,6 +3663,16 @@ function parseChart(content, palette) {
3661
3663
  continue;
3662
3664
  }
3663
3665
  if (trimmed.startsWith("//")) continue;
3666
+ const eraMatch = trimmed.match(/^era\s+(.+?)\s*->\s*(.+?)\s*:\s*(.+?)(?:\s*\(([^)]+)\))?\s*$/);
3667
+ if (eraMatch) {
3668
+ parsedEras.push({
3669
+ start: eraMatch[1].trim(),
3670
+ end: eraMatch[2].trim(),
3671
+ label: eraMatch[3].trim(),
3672
+ color: eraMatch[4] ? resolveColor(eraMatch[4].trim(), palette) : null
3673
+ });
3674
+ continue;
3675
+ }
3664
3676
  const colonIndex = trimmed.indexOf(":");
3665
3677
  if (colonIndex === -1) continue;
3666
3678
  const key = trimmed.substring(0, colonIndex).trim().toLowerCase();
@@ -3739,6 +3751,9 @@ function parseChart(content, palette) {
3739
3751
  });
3740
3752
  }
3741
3753
  }
3754
+ if (result.type !== "line" && result.type !== "area") {
3755
+ result.eras = void 0;
3756
+ }
3742
3757
  const setChartError = (line10, message) => {
3743
3758
  const diag = makeDgmoError(line10, message);
3744
3759
  result.diagnostics.push(diag);
@@ -3793,7 +3808,7 @@ var init_chart = __esm({
3793
3808
 
3794
3809
  // src/echarts.ts
3795
3810
  import * as echarts from "echarts";
3796
- function parseEChart(content, palette) {
3811
+ function parseExtendedChart(content, palette) {
3797
3812
  const lines = content.split("\n");
3798
3813
  const result = {
3799
3814
  type: "scatter",
@@ -4062,7 +4077,7 @@ function buildChartCommons(parsed, palette, isDark) {
4062
4077
  const tooltipTheme = { backgroundColor: palette.surface, borderColor: palette.border, textStyle: { color: palette.text } };
4063
4078
  return { textColor, axisLineColor, splitLineColor, gridOpacity, colors, titleConfig, tooltipTheme };
4064
4079
  }
4065
- function buildEChartsOption(parsed, palette, isDark) {
4080
+ function buildExtendedChartOption(parsed, palette, isDark) {
4066
4081
  if (parsed.error) {
4067
4082
  return {};
4068
4083
  }
@@ -4734,7 +4749,7 @@ function resolveAxisLabels(parsed) {
4734
4749
  yLabel: parsed.ylabel ?? (isHorizontal ? void 0 : parsed.label)
4735
4750
  };
4736
4751
  }
4737
- function makeGridAxis(type, textColor, axisLineColor, splitLineColor, gridOpacity, label, data, nameGapOverride, chartWidthHint) {
4752
+ function makeGridAxis(type, textColor, axisLineColor, splitLineColor, gridOpacity, label, data, nameGapOverride, chartWidthHint, intervalOverride) {
4738
4753
  const defaultGap = type === "value" ? 75 : 40;
4739
4754
  let catFontSize = 16;
4740
4755
  let catLabelExtras = {};
@@ -4761,7 +4776,7 @@ function makeGridAxis(type, textColor, axisLineColor, splitLineColor, gridOpacit
4761
4776
  fontSize: type === "category" && data ? catFontSize : 16,
4762
4777
  fontFamily: FONT_FAMILY,
4763
4778
  ...type === "category" && {
4764
- interval: 0,
4779
+ interval: intervalOverride ?? 0,
4765
4780
  formatter: (value) => value.replace(/([a-z])([A-Z])/g, "$1\n$2"),
4766
4781
  ...catLabelExtras
4767
4782
  }
@@ -4775,7 +4790,7 @@ function makeGridAxis(type, textColor, axisLineColor, splitLineColor, gridOpacit
4775
4790
  }
4776
4791
  };
4777
4792
  }
4778
- function buildEChartsOptionFromChart(parsed, palette, isDark, chartWidth) {
4793
+ function buildSimpleChartOption(parsed, palette, isDark, chartWidth) {
4779
4794
  if (parsed.error) return {};
4780
4795
  const { textColor, axisLineColor, splitLineColor, gridOpacity, colors, titleConfig, tooltipTheme } = buildChartCommons(parsed, palette, isDark);
4781
4796
  switch (parsed.type) {
@@ -4784,7 +4799,7 @@ function buildEChartsOptionFromChart(parsed, palette, isDark, chartWidth) {
4784
4799
  case "bar-stacked":
4785
4800
  return buildBarStackedOption(parsed, textColor, axisLineColor, splitLineColor, gridOpacity, colors, titleConfig, tooltipTheme, chartWidth);
4786
4801
  case "line":
4787
- return parsed.seriesNames ? buildMultiLineOption(parsed, textColor, axisLineColor, splitLineColor, gridOpacity, colors, titleConfig, tooltipTheme, chartWidth) : buildLineOption(parsed, palette, textColor, axisLineColor, splitLineColor, gridOpacity, titleConfig, tooltipTheme, chartWidth);
4802
+ return parsed.seriesNames ? buildMultiLineOption(parsed, palette, textColor, axisLineColor, splitLineColor, gridOpacity, colors, titleConfig, tooltipTheme, chartWidth) : buildLineOption(parsed, palette, textColor, axisLineColor, splitLineColor, gridOpacity, titleConfig, tooltipTheme, chartWidth);
4788
4803
  case "area":
4789
4804
  return buildAreaOption(parsed, palette, textColor, axisLineColor, splitLineColor, gridOpacity, titleConfig, tooltipTheme, chartWidth);
4790
4805
  case "pie":
@@ -4837,11 +4852,57 @@ function buildBarOption(parsed, textColor, axisLineColor, splitLineColor, gridOp
4837
4852
  ]
4838
4853
  };
4839
4854
  }
4855
+ function buildIntervalCallback(labels, eras) {
4856
+ const count = labels.length;
4857
+ if (count <= 8) return () => true;
4858
+ const snapSteps = [1, 2, 4, 5, 10, 20, 25, 50];
4859
+ const raw = Math.ceil(count / 8);
4860
+ const N = [...snapSteps].reverse().find((s) => s <= raw) ?? 1;
4861
+ const pinned = /* @__PURE__ */ new Set();
4862
+ for (let i = 0; i < count; i += N) pinned.add(i);
4863
+ for (const era of eras) {
4864
+ const si = labels.indexOf(era.start);
4865
+ const ei = labels.indexOf(era.end);
4866
+ if (si >= 0) pinned.add(si);
4867
+ if (ei >= 0) pinned.add(ei);
4868
+ }
4869
+ return (index) => pinned.has(index);
4870
+ }
4871
+ function buildMarkArea(eras, labels, textColor, defaultColor) {
4872
+ if (eras.length === 0) return void 0;
4873
+ return {
4874
+ silent: false,
4875
+ tooltip: { show: true },
4876
+ data: eras.map((era) => {
4877
+ const startIdx = labels.indexOf(era.start);
4878
+ const endIdx = labels.indexOf(era.end);
4879
+ const bandSlots = startIdx >= 0 && endIdx >= 0 ? endIdx - startIdx : Infinity;
4880
+ const color = era.color ?? defaultColor;
4881
+ return [
4882
+ {
4883
+ name: era.label,
4884
+ xAxis: era.start,
4885
+ itemStyle: { color, opacity: 0.15 },
4886
+ label: {
4887
+ show: bandSlots >= 3,
4888
+ position: "insideTop",
4889
+ fontSize: 11,
4890
+ color: textColor
4891
+ }
4892
+ },
4893
+ { xAxis: era.end }
4894
+ ];
4895
+ })
4896
+ };
4897
+ }
4840
4898
  function buildLineOption(parsed, palette, textColor, axisLineColor, splitLineColor, gridOpacity, titleConfig, tooltipTheme, chartWidth) {
4841
4899
  const { xLabel, yLabel } = resolveAxisLabels(parsed);
4842
4900
  const lineColor = parsed.color ?? parsed.seriesNameColors?.[0] ?? palette.primary;
4843
4901
  const labels = parsed.data.map((d) => d.label);
4844
4902
  const values = parsed.data.map((d) => d.value);
4903
+ const eras = parsed.eras ?? [];
4904
+ const interval = buildIntervalCallback(labels, eras);
4905
+ const markArea = buildMarkArea(eras, labels, textColor, palette.colors.blue);
4845
4906
  return {
4846
4907
  ...CHART_BASE,
4847
4908
  title: titleConfig,
@@ -4851,7 +4912,7 @@ function buildLineOption(parsed, palette, textColor, axisLineColor, splitLineCol
4851
4912
  axisPointer: { type: "line" }
4852
4913
  },
4853
4914
  grid: makeChartGrid({ xLabel, yLabel, hasTitle: !!parsed.title }),
4854
- xAxis: makeGridAxis("category", textColor, axisLineColor, splitLineColor, gridOpacity, xLabel, labels, void 0, chartWidth),
4915
+ xAxis: makeGridAxis("category", textColor, axisLineColor, splitLineColor, gridOpacity, xLabel, labels, void 0, chartWidth, interval),
4855
4916
  yAxis: makeGridAxis("value", textColor, axisLineColor, splitLineColor, gridOpacity, yLabel),
4856
4917
  series: [
4857
4918
  {
@@ -4861,15 +4922,19 @@ function buildLineOption(parsed, palette, textColor, axisLineColor, splitLineCol
4861
4922
  symbolSize: 8,
4862
4923
  lineStyle: { color: lineColor, width: 3 },
4863
4924
  itemStyle: { color: lineColor },
4864
- emphasis: EMPHASIS_SELF
4925
+ emphasis: EMPHASIS_SELF,
4926
+ ...markArea && { markArea }
4865
4927
  }
4866
4928
  ]
4867
4929
  };
4868
4930
  }
4869
- function buildMultiLineOption(parsed, textColor, axisLineColor, splitLineColor, gridOpacity, colors, titleConfig, tooltipTheme, chartWidth) {
4931
+ function buildMultiLineOption(parsed, palette, textColor, axisLineColor, splitLineColor, gridOpacity, colors, titleConfig, tooltipTheme, chartWidth) {
4870
4932
  const { xLabel, yLabel } = resolveAxisLabels(parsed);
4871
4933
  const seriesNames = parsed.seriesNames ?? [];
4872
4934
  const labels = parsed.data.map((d) => d.label);
4935
+ const eras = parsed.eras ?? [];
4936
+ const interval = buildIntervalCallback(labels, eras);
4937
+ const markArea = buildMarkArea(eras, labels, textColor, palette.colors.blue);
4873
4938
  const series = seriesNames.map((name, idx) => {
4874
4939
  const color = parsed.seriesNameColors?.[idx] ?? colors[idx % colors.length];
4875
4940
  const data = parsed.data.map(
@@ -4883,7 +4948,8 @@ function buildMultiLineOption(parsed, textColor, axisLineColor, splitLineColor,
4883
4948
  symbolSize: 8,
4884
4949
  lineStyle: { color, width: 3 },
4885
4950
  itemStyle: { color },
4886
- emphasis: EMPHASIS_SELF
4951
+ emphasis: EMPHASIS_SELF,
4952
+ ...idx === 0 && markArea && { markArea }
4887
4953
  };
4888
4954
  });
4889
4955
  return {
@@ -4900,7 +4966,7 @@ function buildMultiLineOption(parsed, textColor, axisLineColor, splitLineColor,
4900
4966
  textStyle: { color: textColor }
4901
4967
  },
4902
4968
  grid: makeChartGrid({ xLabel, yLabel, hasTitle: !!parsed.title, hasLegend: true }),
4903
- xAxis: makeGridAxis("category", textColor, axisLineColor, splitLineColor, gridOpacity, xLabel, labels, void 0, chartWidth),
4969
+ xAxis: makeGridAxis("category", textColor, axisLineColor, splitLineColor, gridOpacity, xLabel, labels, void 0, chartWidth, interval),
4904
4970
  yAxis: makeGridAxis("value", textColor, axisLineColor, splitLineColor, gridOpacity, yLabel),
4905
4971
  series
4906
4972
  };
@@ -4910,6 +4976,9 @@ function buildAreaOption(parsed, palette, textColor, axisLineColor, splitLineCol
4910
4976
  const lineColor = parsed.color ?? parsed.seriesNameColors?.[0] ?? palette.primary;
4911
4977
  const labels = parsed.data.map((d) => d.label);
4912
4978
  const values = parsed.data.map((d) => d.value);
4979
+ const eras = parsed.eras ?? [];
4980
+ const interval = buildIntervalCallback(labels, eras);
4981
+ const markArea = buildMarkArea(eras, labels, textColor, palette.colors.blue);
4913
4982
  return {
4914
4983
  ...CHART_BASE,
4915
4984
  title: titleConfig,
@@ -4919,7 +4988,7 @@ function buildAreaOption(parsed, palette, textColor, axisLineColor, splitLineCol
4919
4988
  axisPointer: { type: "line" }
4920
4989
  },
4921
4990
  grid: makeChartGrid({ xLabel, yLabel, hasTitle: !!parsed.title }),
4922
- xAxis: makeGridAxis("category", textColor, axisLineColor, splitLineColor, gridOpacity, xLabel, labels, void 0, chartWidth),
4991
+ xAxis: makeGridAxis("category", textColor, axisLineColor, splitLineColor, gridOpacity, xLabel, labels, void 0, chartWidth, interval),
4923
4992
  yAxis: makeGridAxis("value", textColor, axisLineColor, splitLineColor, gridOpacity, yLabel),
4924
4993
  series: [
4925
4994
  {
@@ -4930,7 +4999,8 @@ function buildAreaOption(parsed, palette, textColor, axisLineColor, splitLineCol
4930
4999
  lineStyle: { color: lineColor, width: 3 },
4931
5000
  itemStyle: { color: lineColor },
4932
5001
  areaStyle: { opacity: 0.25 },
4933
- emphasis: EMPHASIS_SELF
5002
+ emphasis: EMPHASIS_SELF,
5003
+ ...markArea && { markArea }
4934
5004
  }
4935
5005
  ]
4936
5006
  };
@@ -5115,7 +5185,7 @@ function buildBarStackedOption(parsed, textColor, axisLineColor, splitLineColor,
5115
5185
  series
5116
5186
  };
5117
5187
  }
5118
- async function renderEChartsForExport(content, theme, palette, options) {
5188
+ async function renderExtendedChartForExport(content, theme, palette, options) {
5119
5189
  const isDark = theme === "dark";
5120
5190
  const { getPalette: getPalette2 } = await Promise.resolve().then(() => (init_palettes(), palettes_exports));
5121
5191
  const effectivePalette = palette ?? (isDark ? getPalette2("nord").dark : getPalette2("nord").light);
@@ -5125,11 +5195,11 @@ async function renderEChartsForExport(content, theme, palette, options) {
5125
5195
  if (chartType && STANDARD_CHART_TYPES.has(chartType)) {
5126
5196
  const parsed = parseChart(content, effectivePalette);
5127
5197
  if (parsed.error) return "";
5128
- option = buildEChartsOptionFromChart(parsed, effectivePalette, isDark, ECHART_EXPORT_WIDTH);
5198
+ option = buildSimpleChartOption(parsed, effectivePalette, isDark, ECHART_EXPORT_WIDTH);
5129
5199
  } else {
5130
- const parsed = parseEChart(content, effectivePalette);
5200
+ const parsed = parseExtendedChart(content, effectivePalette);
5131
5201
  if (parsed.error) return "";
5132
- option = buildEChartsOption(parsed, effectivePalette, isDark);
5202
+ option = buildExtendedChartOption(parsed, effectivePalette, isDark);
5133
5203
  }
5134
5204
  if (!option || Object.keys(option).length === 0) return "";
5135
5205
  const chart = echarts.init(null, null, {
@@ -5156,7 +5226,7 @@ async function renderEChartsForExport(content, theme, palette, options) {
5156
5226
  chart.dispose();
5157
5227
  }
5158
5228
  }
5159
- var EMPHASIS_SELF, CHART_BASE, ECHART_EXPORT_WIDTH, ECHART_EXPORT_HEIGHT;
5229
+ var EMPHASIS_SELF, CHART_BASE, ECHART_EXPORT_WIDTH, ECHART_EXPORT_HEIGHT, STANDARD_CHART_TYPES;
5160
5230
  var init_echarts = __esm({
5161
5231
  "src/echarts.ts"() {
5162
5232
  "use strict";
@@ -5167,11 +5237,21 @@ var init_echarts = __esm({
5167
5237
  init_diagnostics();
5168
5238
  init_colors();
5169
5239
  init_parsing();
5170
- init_dgmo_router();
5171
5240
  EMPHASIS_SELF = { focus: "self", blurScope: "global" };
5172
5241
  CHART_BASE = { backgroundColor: "transparent", animation: false };
5173
5242
  ECHART_EXPORT_WIDTH = 1200;
5174
5243
  ECHART_EXPORT_HEIGHT = 800;
5244
+ STANDARD_CHART_TYPES = /* @__PURE__ */ new Set([
5245
+ "bar",
5246
+ "line",
5247
+ "multi-line",
5248
+ "area",
5249
+ "pie",
5250
+ "doughnut",
5251
+ "radar",
5252
+ "polar-area",
5253
+ "bar-stacked"
5254
+ ]);
5175
5255
  }
5176
5256
  });
5177
5257
 
@@ -7329,15 +7409,12 @@ var init_parser9 = __esm({
7329
7409
  // src/dgmo-router.ts
7330
7410
  var dgmo_router_exports = {};
7331
7411
  __export(dgmo_router_exports, {
7332
- DGMO_CHART_TYPE_MAP: () => DGMO_CHART_TYPE_MAP,
7333
- STANDARD_CHART_TYPES: () => STANDARD_CHART_TYPES,
7334
- getDgmoFramework: () => getDgmoFramework,
7412
+ getAllChartTypes: () => getAllChartTypes,
7413
+ getRenderCategory: () => getRenderCategory,
7414
+ isExtendedChartType: () => isExtendedChartType,
7335
7415
  parseDgmo: () => parseDgmo,
7336
7416
  parseDgmoChartType: () => parseDgmoChartType
7337
7417
  });
7338
- function getDgmoFramework(chartType) {
7339
- return DGMO_CHART_TYPE_MAP[chartType.toLowerCase()] ?? null;
7340
- }
7341
7418
  function parseDgmoChartType(content) {
7342
7419
  const lines = content.split("\n");
7343
7420
  for (const line10 of lines) {
@@ -7357,22 +7434,39 @@ function parseDgmoChartType(content) {
7357
7434
  if (looksLikeOrg(content)) return "org";
7358
7435
  return null;
7359
7436
  }
7437
+ function getRenderCategory(chartType) {
7438
+ const type = chartType.toLowerCase();
7439
+ if (DATA_CHART_TYPES.has(type)) return "data-chart";
7440
+ if (VISUALIZATION_TYPES.has(type)) return "visualization";
7441
+ if (DIAGRAM_TYPES.has(type)) return "diagram";
7442
+ return null;
7443
+ }
7444
+ function isExtendedChartType(chartType) {
7445
+ return EXTENDED_CHART_TYPES.has(chartType.toLowerCase());
7446
+ }
7447
+ function getAllChartTypes() {
7448
+ return [
7449
+ ...DATA_CHART_TYPES,
7450
+ ...VISUALIZATION_TYPES,
7451
+ ...DIAGRAM_TYPES
7452
+ ];
7453
+ }
7360
7454
  function parseDgmo(content) {
7361
7455
  const chartType = parseDgmoChartType(content);
7362
7456
  if (!chartType) {
7363
- return { diagnostics: parseD3(content).diagnostics };
7457
+ return { diagnostics: parseVisualization(content).diagnostics };
7364
7458
  }
7365
7459
  const directParser = PARSE_DISPATCH.get(chartType);
7366
7460
  if (directParser) return { diagnostics: directParser(content).diagnostics };
7367
- if (STANDARD_CHART_TYPES.has(chartType)) {
7461
+ if (STANDARD_CHART_TYPES2.has(chartType)) {
7368
7462
  return { diagnostics: parseChart(content).diagnostics };
7369
7463
  }
7370
7464
  if (ECHART_TYPES.has(chartType)) {
7371
- return { diagnostics: parseEChart(content).diagnostics };
7465
+ return { diagnostics: parseExtendedChart(content).diagnostics };
7372
7466
  }
7373
- return { diagnostics: parseD3(content).diagnostics };
7467
+ return { diagnostics: parseVisualization(content).diagnostics };
7374
7468
  }
7375
- var DGMO_CHART_TYPE_MAP, STANDARD_CHART_TYPES, ECHART_TYPES, PARSE_DISPATCH;
7469
+ var DATA_CHART_TYPES, VISUALIZATION_TYPES, DIAGRAM_TYPES, EXTENDED_CHART_TYPES, STANDARD_CHART_TYPES2, ECHART_TYPES, PARSE_DISPATCH;
7376
7470
  var init_dgmo_router = __esm({
7377
7471
  "src/dgmo-router.ts"() {
7378
7472
  "use strict";
@@ -7390,44 +7484,53 @@ var init_dgmo_router = __esm({
7390
7484
  init_parser7();
7391
7485
  init_parser8();
7392
7486
  init_parser9();
7393
- DGMO_CHART_TYPE_MAP = {
7394
- // Standard charts (via ECharts)
7395
- bar: "echart",
7396
- line: "echart",
7397
- "multi-line": "echart",
7398
- area: "echart",
7399
- pie: "echart",
7400
- doughnut: "echart",
7401
- radar: "echart",
7402
- "polar-area": "echart",
7403
- "bar-stacked": "echart",
7404
- // ECharts
7405
- scatter: "echart",
7406
- sankey: "echart",
7407
- chord: "echart",
7408
- function: "echart",
7409
- heatmap: "echart",
7410
- funnel: "echart",
7411
- // D3
7412
- slope: "d3",
7413
- wordcloud: "d3",
7414
- arc: "d3",
7415
- timeline: "d3",
7416
- venn: "d3",
7417
- quadrant: "d3",
7418
- sequence: "d3",
7419
- flowchart: "d3",
7420
- class: "d3",
7421
- er: "d3",
7422
- org: "d3",
7423
- kanban: "d3",
7424
- c4: "d3",
7425
- "initiative-status": "d3",
7426
- state: "d3",
7427
- sitemap: "d3",
7428
- infra: "d3"
7429
- };
7430
- STANDARD_CHART_TYPES = /* @__PURE__ */ new Set([
7487
+ DATA_CHART_TYPES = /* @__PURE__ */ new Set([
7488
+ "bar",
7489
+ "line",
7490
+ "pie",
7491
+ "doughnut",
7492
+ "area",
7493
+ "polar-area",
7494
+ "radar",
7495
+ "bar-stacked",
7496
+ "multi-line",
7497
+ "scatter",
7498
+ "sankey",
7499
+ "chord",
7500
+ "function",
7501
+ "heatmap",
7502
+ "funnel"
7503
+ ]);
7504
+ VISUALIZATION_TYPES = /* @__PURE__ */ new Set([
7505
+ "slope",
7506
+ "wordcloud",
7507
+ "arc",
7508
+ "timeline",
7509
+ "venn",
7510
+ "quadrant"
7511
+ ]);
7512
+ DIAGRAM_TYPES = /* @__PURE__ */ new Set([
7513
+ "sequence",
7514
+ "flowchart",
7515
+ "class",
7516
+ "er",
7517
+ "org",
7518
+ "kanban",
7519
+ "c4",
7520
+ "initiative-status",
7521
+ "state",
7522
+ "sitemap",
7523
+ "infra"
7524
+ ]);
7525
+ EXTENDED_CHART_TYPES = /* @__PURE__ */ new Set([
7526
+ "scatter",
7527
+ "sankey",
7528
+ "chord",
7529
+ "function",
7530
+ "heatmap",
7531
+ "funnel"
7532
+ ]);
7533
+ STANDARD_CHART_TYPES2 = /* @__PURE__ */ new Set([
7431
7534
  "bar",
7432
7535
  "line",
7433
7536
  "multi-line",
@@ -18505,7 +18608,7 @@ function addDurationToDate(startDate, amount, unit) {
18505
18608
  return `${endYear}-${endMonth}-${endDay}`;
18506
18609
  }
18507
18610
  }
18508
- function parseD3(content, palette) {
18611
+ function parseVisualization(content, palette) {
18509
18612
  const result = {
18510
18613
  type: null,
18511
18614
  title: null,
@@ -21459,7 +21562,7 @@ function finalizeSvgExport(container, theme, palette, options) {
21459
21562
  }
21460
21563
  return svgHtml;
21461
21564
  }
21462
- async function renderD3ForExport(content, theme, palette, orgExportState, options) {
21565
+ async function renderForExport(content, theme, palette, orgExportState, options) {
21463
21566
  const { parseDgmoChartType: parseDgmoChartType2 } = await Promise.resolve().then(() => (init_dgmo_router(), dgmo_router_exports));
21464
21567
  const detectedType = parseDgmoChartType2(content);
21465
21568
  if (detectedType === "org") {
@@ -21650,7 +21753,7 @@ async function renderD3ForExport(content, theme, palette, orgExportState, option
21650
21753
  renderState2(container2, stateParsed, layout, effectivePalette2, theme === "dark", void 0, { width: EXPORT_WIDTH, height: EXPORT_HEIGHT });
21651
21754
  return finalizeSvgExport(container2, theme, effectivePalette2, options);
21652
21755
  }
21653
- const parsed = parseD3(content, palette);
21756
+ const parsed = parseVisualization(content, palette);
21654
21757
  if (parsed.error && parsed.type !== "sequence") {
21655
21758
  const looksLikeSequence2 = /->|~>|<-/.test(content);
21656
21759
  if (!looksLikeSequence2) return "";
@@ -21877,12 +21980,12 @@ async function render(content, options) {
21877
21980
  const branding = options?.branding ?? true;
21878
21981
  const paletteColors = getPalette(paletteName)[theme === "dark" ? "dark" : "light"];
21879
21982
  const chartType = parseDgmoChartType(content);
21880
- const framework = chartType ? getDgmoFramework(chartType) : null;
21881
- if (framework === "echart") {
21882
- return renderEChartsForExport(content, theme, paletteColors, { branding });
21983
+ const category = chartType ? getRenderCategory(chartType) : null;
21984
+ if (category === "data-chart") {
21985
+ return renderExtendedChartForExport(content, theme, paletteColors, { branding });
21883
21986
  }
21884
21987
  await ensureDom();
21885
- return renderD3ForExport(content, theme, paletteColors, void 0, {
21988
+ return renderForExport(content, theme, paletteColors, void 0, {
21886
21989
  branding,
21887
21990
  c4Level: options?.c4Level,
21888
21991
  c4System: options?.c4System,
@@ -22663,20 +22766,18 @@ function decodeDiagramUrl(hash) {
22663
22766
  // src/index.ts
22664
22767
  init_branding();
22665
22768
  export {
22666
- DGMO_CHART_TYPE_MAP,
22667
22769
  INFRA_BEHAVIOR_KEYS,
22668
22770
  RULE_COUNT,
22669
- STANDARD_CHART_TYPES,
22670
22771
  addDurationToDate,
22671
22772
  applyGroupOrdering,
22672
22773
  applyPositionOverrides,
22673
22774
  boldPalette,
22674
- buildEChartsOption,
22675
- buildEChartsOptionFromChart,
22775
+ buildExtendedChartOption,
22676
22776
  buildMermaidQuadrant,
22677
22777
  buildMermaidThemeVars,
22678
22778
  buildNoteMessageMap,
22679
22779
  buildRenderSequence,
22780
+ buildSimpleChartOption,
22680
22781
  buildThemeCSS,
22681
22782
  catppuccinPalette,
22682
22783
  collapseInitiativeStatus,
@@ -22696,8 +22797,8 @@ export {
22696
22797
  formatDateLabel,
22697
22798
  formatDgmoError,
22698
22799
  getAvailablePalettes,
22699
- getDgmoFramework,
22700
22800
  getPalette,
22801
+ getRenderCategory,
22701
22802
  getSeriesColors,
22702
22803
  groupMessagesBySection,
22703
22804
  gruvboxPalette,
@@ -22708,6 +22809,7 @@ export {
22708
22809
  inferRoles,
22709
22810
  injectBranding,
22710
22811
  isArchiveColumn,
22812
+ isExtendedChartType,
22711
22813
  isSequenceBlock,
22712
22814
  isSequenceNote,
22713
22815
  isValidHex,
@@ -22739,11 +22841,10 @@ export {
22739
22841
  parseC4,
22740
22842
  parseChart,
22741
22843
  parseClassDiagram,
22742
- parseD3,
22743
22844
  parseDgmo,
22744
22845
  parseDgmoChartType,
22745
- parseEChart,
22746
22846
  parseERDiagram,
22847
+ parseExtendedChart,
22747
22848
  parseFlowchart,
22748
22849
  parseInfra,
22749
22850
  parseInitiativeStatus,
@@ -22755,6 +22856,7 @@ export {
22755
22856
  parseSitemap,
22756
22857
  parseState,
22757
22858
  parseTimelineDate,
22859
+ parseVisualization,
22758
22860
  registerPalette,
22759
22861
  render,
22760
22862
  renderArcDiagram,
@@ -22767,12 +22869,12 @@ export {
22767
22869
  renderC4DeploymentForExport,
22768
22870
  renderClassDiagram,
22769
22871
  renderClassDiagramForExport,
22770
- renderD3ForExport,
22771
- renderEChartsForExport,
22772
22872
  renderERDiagram,
22773
22873
  renderERDiagramForExport,
22874
+ renderExtendedChartForExport,
22774
22875
  renderFlowchart,
22775
22876
  renderFlowchartForExport,
22877
+ renderForExport,
22776
22878
  renderInfra,
22777
22879
  renderInitiativeStatus,
22778
22880
  renderInitiativeStatusForExport,