@flux-ui/statistics 3.0.0-next.68 → 3.0.0-next.69

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.
Files changed (119) hide show
  1. package/dist/component/FluxStatisticsLegendScope.vue.d.ts +13 -0
  2. package/dist/component/FluxStatisticsPercentageBar.vue.d.ts +8 -0
  3. package/dist/component/index.d.ts +2 -0
  4. package/dist/composable/index.d.ts +4 -2
  5. package/dist/composable/useChartBaseSetup.d.ts +8 -0
  6. package/dist/composable/{usePieSlicesSetup.d.ts → useChartSlicesSetup.d.ts} +2 -2
  7. package/dist/index.css +67 -32
  8. package/dist/index.js +913 -510
  9. package/dist/index.js.map +1 -1
  10. package/dist/util/index.d.ts +5 -6
  11. package/dist/util/options/buildBaseOptions.d.ts +2 -0
  12. package/dist/util/{baseOptions.d.ts → options/buildCartesianBaseOptions.d.ts} +4 -6
  13. package/dist/util/options/buildCircularBaseOptions.d.ts +2 -0
  14. package/dist/util/options/cartesian/buildAreaChartOptions.d.ts +17 -0
  15. package/dist/util/options/cartesian/buildBarChartOptions.d.ts +17 -0
  16. package/dist/util/options/cartesian/buildBoxPlotChartOptions.d.ts +16 -0
  17. package/dist/util/options/cartesian/buildBubbleChartOptions.d.ts +15 -0
  18. package/dist/util/options/cartesian/buildCandlestickChartOptions.d.ts +17 -0
  19. package/dist/util/options/cartesian/buildHeatmapChartOptions.d.ts +15 -0
  20. package/dist/util/options/cartesian/buildLineChartOptions.d.ts +17 -0
  21. package/dist/util/options/cartesian/buildMixedChartOptions.d.ts +17 -0
  22. package/dist/util/options/cartesian/buildScatterChartOptions.d.ts +15 -0
  23. package/dist/util/options/cartesian/index.d.ts +18 -0
  24. package/dist/util/options/circular/buildDonutChartOptions.d.ts +15 -0
  25. package/dist/util/options/circular/buildGaugeChartOptions.d.ts +14 -0
  26. package/dist/util/options/circular/buildPieChartOptions.d.ts +15 -0
  27. package/dist/util/options/circular/buildPolarAreaChartOptions.d.ts +15 -0
  28. package/dist/util/options/circular/buildRadarChartOptions.d.ts +13 -0
  29. package/dist/util/options/circular/buildTreemapChartOptions.d.ts +12 -0
  30. package/dist/util/options/circular/index.d.ts +12 -0
  31. package/dist/util/options/index.d.ts +6 -0
  32. package/dist/util/series/chartColors.d.ts +3 -0
  33. package/dist/util/{convert.d.ts → series/converters.d.ts} +1 -6
  34. package/dist/util/series/index.d.ts +4 -0
  35. package/dist/util/series/labels.d.ts +5 -0
  36. package/dist/util/tooltips/buildBoxPlotTooltip.d.ts +22 -0
  37. package/dist/util/tooltips/buildCartesianTooltip.d.ts +10 -0
  38. package/dist/util/tooltips/buildGaugeTooltip.d.ts +14 -0
  39. package/dist/util/tooltips/buildHeatmapTooltip.d.ts +17 -0
  40. package/dist/util/tooltips/buildRadarTooltip.d.ts +11 -0
  41. package/dist/util/tooltips/buildSharedItemTooltip.d.ts +10 -0
  42. package/dist/util/tooltips/buildTreemapTooltip.d.ts +12 -0
  43. package/dist/util/tooltips/index.d.ts +15 -0
  44. package/dist/util/tooltips/render.d.ts +4 -0
  45. package/dist/util/tooltips/types.d.ts +24 -0
  46. package/package.json +4 -4
  47. package/src/component/FluxStatisticsAreaChart.vue +15 -19
  48. package/src/component/FluxStatisticsBarChart.vue +15 -19
  49. package/src/component/FluxStatisticsBoxPlotChart.vue +14 -34
  50. package/src/component/FluxStatisticsBubbleChart.vue +13 -23
  51. package/src/component/FluxStatisticsCandlestickChart.vue +14 -45
  52. package/src/component/FluxStatisticsChart.vue +2 -2
  53. package/src/component/FluxStatisticsChartPane.vue +12 -13
  54. package/src/component/FluxStatisticsDonutChart.vue +15 -24
  55. package/src/component/FluxStatisticsHeatmapChart.vue +15 -48
  56. package/src/component/FluxStatisticsLegendScope.vue +16 -0
  57. package/src/component/FluxStatisticsLineChart.vue +15 -19
  58. package/src/component/FluxStatisticsMixedChart.vue +15 -18
  59. package/src/component/FluxStatisticsPercentageBar.vue +90 -0
  60. package/src/component/FluxStatisticsPieChart.vue +15 -24
  61. package/src/component/FluxStatisticsPolarAreaChart.vue +15 -24
  62. package/src/component/FluxStatisticsRadarChart.vue +11 -79
  63. package/src/component/FluxStatisticsRadialBar.vue +11 -20
  64. package/src/component/FluxStatisticsScatterChart.vue +13 -23
  65. package/src/component/FluxStatisticsTreemapChart.vue +11 -15
  66. package/src/component/index.ts +2 -0
  67. package/src/composable/index.ts +4 -2
  68. package/src/composable/useChartBaseSetup.ts +16 -0
  69. package/src/composable/{usePieSlicesSetup.ts → useChartSlicesSetup.ts} +3 -3
  70. package/src/css/Chart.module.scss +10 -15
  71. package/src/css/ChartPane.module.scss +3 -10
  72. package/src/css/Empty.module.scss +2 -2
  73. package/src/css/Legend.module.scss +16 -8
  74. package/src/css/Meter.module.scss +1 -0
  75. package/src/css/PercentageBar.module.scss +36 -0
  76. package/src/util/index.ts +5 -6
  77. package/src/util/options/buildBaseOptions.ts +31 -0
  78. package/src/util/{baseOptions.ts → options/buildCartesianBaseOptions.ts} +15 -22
  79. package/src/util/options/buildCircularBaseOptions.ts +10 -0
  80. package/src/util/options/cartesian/buildAreaChartOptions.ts +44 -0
  81. package/src/util/options/cartesian/buildBarChartOptions.ts +44 -0
  82. package/src/util/options/cartesian/buildBoxPlotChartOptions.ts +63 -0
  83. package/src/util/options/cartesian/buildBubbleChartOptions.ts +48 -0
  84. package/src/util/options/cartesian/buildCandlestickChartOptions.ts +77 -0
  85. package/src/util/options/cartesian/buildHeatmapChartOptions.ts +72 -0
  86. package/src/util/options/cartesian/buildLineChartOptions.ts +44 -0
  87. package/src/util/options/cartesian/buildMixedChartOptions.ts +44 -0
  88. package/src/util/options/cartesian/buildScatterChartOptions.ts +48 -0
  89. package/src/util/options/cartesian/index.ts +18 -0
  90. package/src/util/options/circular/buildDonutChartOptions.ts +31 -0
  91. package/src/util/options/circular/buildGaugeChartOptions.ts +45 -0
  92. package/src/util/options/circular/buildPieChartOptions.ts +31 -0
  93. package/src/util/options/circular/buildPolarAreaChartOptions.ts +31 -0
  94. package/src/util/options/circular/buildRadarChartOptions.ts +52 -0
  95. package/src/util/options/circular/buildTreemapChartOptions.ts +28 -0
  96. package/src/util/options/circular/index.ts +12 -0
  97. package/src/util/options/index.ts +6 -0
  98. package/src/util/series/chartColors.ts +20 -0
  99. package/src/util/{convert.ts → series/converters.ts} +2 -44
  100. package/src/util/series/index.ts +4 -0
  101. package/src/util/series/labels.ts +30 -0
  102. package/src/util/tooltips/buildBoxPlotTooltip.ts +66 -0
  103. package/src/util/tooltips/buildCartesianTooltip.ts +44 -0
  104. package/src/util/tooltips/buildGaugeTooltip.ts +49 -0
  105. package/src/util/tooltips/buildHeatmapTooltip.ts +57 -0
  106. package/src/util/tooltips/buildRadarTooltip.ts +53 -0
  107. package/src/util/tooltips/buildSharedItemTooltip.ts +38 -0
  108. package/src/util/tooltips/buildTreemapTooltip.ts +49 -0
  109. package/src/util/tooltips/index.ts +15 -0
  110. package/src/util/tooltips/render.ts +66 -0
  111. package/src/util/tooltips/types.ts +29 -0
  112. package/dist/util/defaultOptions.d.ts +0 -76
  113. package/src/util/defaultOptions.ts +0 -398
  114. /package/dist/util/{iconSvg.d.ts → icons.d.ts} +0 -0
  115. /package/dist/util/{seriesDefaults.d.ts → series/defaults.d.ts} +0 -0
  116. /package/dist/util/{sparklineOptions.d.ts → sparkline.d.ts} +0 -0
  117. /package/src/util/{iconSvg.ts → icons.ts} +0 -0
  118. /package/src/util/{seriesDefaults.ts → series/defaults.ts} +0 -0
  119. /package/src/util/{sparklineOptions.ts → sparkline.ts} +0 -0
package/dist/index.js CHANGED
@@ -1,11 +1,21 @@
1
1
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, customRef, defineComponent, inject, markRaw, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onScopeDispose, openBlock, provide, ref, renderList, renderSlot, toDisplayString, toValue, unref, useSlots, useTemplateRef, watch, watchEffect, withCtx } from "vue";
2
- import { merge } from "lodash-es";
3
2
  import { useI18n } from "vue-i18n";
4
3
  import { FluxIcon, FluxPane, FluxToolbar, FluxTooltip, iconRegistry } from "@flux-ui/components";
4
+ import { merge } from "lodash-es";
5
5
  import { init } from "echarts/core";
6
6
  //#region ../internals/dist/data/index.js
7
7
  var oe = `#ef4444`, _e$1 = `#f97316`, Oe = `#f59e0b`, ze = `#eab308`, Xe = `#84cc16`, st = `#22c55e`, vt = `#10b981`, kt = `#14b8a6`, Bt = `#06b6d4`, Zt = `#0ea5e9`, an = `#dbeafe`, sn = `#93c5fd`, ln = `#3b82f6`, dn = `#1d4ed8`, bn = `#6366f1`, jn = `#8b5cf6`, Hn = `#a855f7`, $n = `#d946ef`, ur = `#ec4899`, gr = `#fff1f2`;
8
8
  //#endregion
9
+ //#region src/composable/useChartBaseSetup.ts
10
+ function useChartBaseSetup() {
11
+ const { t } = useI18n({ useScope: "parent" });
12
+ const chartRef = useTemplateRef("chartRef");
13
+ return {
14
+ t,
15
+ chartInstance: computed(() => chartRef.value?.chartInstance ?? null)
16
+ };
17
+ }
18
+ //#endregion
9
19
  //#region src/composable/useChartLegend.ts
10
20
  var FluxStatisticsChartLegendInjectionKey = Symbol("flux-statistics-chart-legend");
11
21
  function createChartLegendContext() {
@@ -72,71 +82,6 @@ function useChartHoverSync(chartInstance, legendContext, options) {
72
82
  });
73
83
  }
74
84
  //#endregion
75
- //#region src/util/baseOptions.ts
76
- var FOREGROUND_LABEL = {
77
- show: true,
78
- color: "var(--foreground-secondary)"
79
- };
80
- var HIDDEN_AXIS = { show: false };
81
- var DASHED_SPLIT_LINE = {
82
- show: true,
83
- lineStyle: {
84
- type: "dashed",
85
- color: "var(--gray-200)"
86
- }
87
- };
88
- function buildCartesianGrid(xAxisLabels, yAxisLabels) {
89
- if (!xAxisLabels && !yAxisLabels) return {
90
- left: 0,
91
- right: 0,
92
- top: 0,
93
- bottom: 0,
94
- containLabel: false
95
- };
96
- return {
97
- left: yAxisLabels ? 9 : 0,
98
- right: 9,
99
- top: 9,
100
- bottom: xAxisLabels ? 9 : 0,
101
- containLabel: true
102
- };
103
- }
104
- function buildCartesianBaseOptions(config = {}) {
105
- const xAxisLabels = config.xAxisLabels ?? false;
106
- const yAxisLabels = config.yAxisLabels ?? false;
107
- const showSplitLines = config.splitLines ?? false;
108
- const xSplitLine = showSplitLines && config.xAxisType === "value" ? DASHED_SPLIT_LINE : HIDDEN_AXIS;
109
- const ySplitLine = showSplitLines && config.yAxisType !== "category" ? DASHED_SPLIT_LINE : HIDDEN_AXIS;
110
- return {
111
- grid: buildCartesianGrid(xAxisLabels, yAxisLabels),
112
- tooltip: { trigger: config.tooltipTrigger ?? "item" },
113
- xAxis: {
114
- type: config.xAxisType ?? "category",
115
- show: true,
116
- scale: config.scale && config.xAxisType === "value",
117
- splitLine: xSplitLine,
118
- axisLabel: xAxisLabels ? FOREGROUND_LABEL : HIDDEN_AXIS,
119
- axisLine: HIDDEN_AXIS,
120
- axisTick: HIDDEN_AXIS
121
- },
122
- yAxis: {
123
- type: config.yAxisType ?? "value",
124
- show: true,
125
- scale: config.scale && config.yAxisType !== "category",
126
- splitLine: ySplitLine,
127
- axisLabel: yAxisLabels ? FOREGROUND_LABEL : HIDDEN_AXIS,
128
- axisLine: HIDDEN_AXIS,
129
- axisTick: HIDDEN_AXIS
130
- }
131
- };
132
- }
133
- var POLAR_BASE_OPTIONS = {
134
- tooltip: { show: false },
135
- xAxis: { show: false },
136
- yAxis: { show: false },
137
- grid: { show: false }
138
- };
139
- //#endregion
140
85
  //#region src/util/colors.ts
141
86
  var CSS_VAR_PATTERN = /var\((--[^,)]+)(?:,\s*([^)]+))?\)/g;
142
87
  var themeVersion = ref(0);
@@ -185,7 +130,29 @@ function deepResolveCssVars(value, root) {
185
130
  return changed ? out : value;
186
131
  }
187
132
  //#endregion
188
- //#region src/util/seriesDefaults.ts
133
+ //#region src/util/icons.ts
134
+ function renderIconSvg(name, color, size = 14) {
135
+ if (!name) return "";
136
+ const icon = iconRegistry[name];
137
+ if (!icon) return "";
138
+ const [width, height, , , pathData] = icon;
139
+ return `<svg viewBox="0 0 ${width} ${height}" width="${size}" height="${size}" focusable="false" aria-hidden="true">${(Array.isArray(pathData) ? pathData : [pathData]).map((d) => `<path d="${d}" fill="${color}"/>`).join("")}</svg>`;
140
+ }
141
+ //#endregion
142
+ //#region src/util/series/chartColors.ts
143
+ var CHART_DEFAULT_COLORS = [
144
+ "var(--chart-1)",
145
+ "var(--chart-2)",
146
+ "var(--chart-3)",
147
+ "var(--chart-4)"
148
+ ];
149
+ function resolveChartColor(color) {
150
+ if (!color) return;
151
+ if (color.startsWith("#") || color.startsWith("var(")) return color;
152
+ return `var(--${color}-600)`;
153
+ }
154
+ //#endregion
155
+ //#region src/util/series/defaults.ts
189
156
  var SOFT_EMPHASIS = { focus: "none" };
190
157
  var PIE_EMPHASIS = {
191
158
  focus: "none",
@@ -386,23 +353,7 @@ var GAUGE_SERIES_DEFAULTS = {
386
353
  }
387
354
  };
388
355
  //#endregion
389
- //#region src/util/convert.ts
390
- function resolveChartColor(color) {
391
- if (!color) return;
392
- if (color.startsWith("#") || color.startsWith("var(")) return color;
393
- return `var(--${color}-600)`;
394
- }
395
- function extractLabels(series) {
396
- for (const s of series) {
397
- const labels = [];
398
- let hasAny = false;
399
- for (const point of s.data) if (typeof point === "object" && point !== null && typeof point.label === "string") {
400
- labels.push(point.label);
401
- hasAny = true;
402
- } else labels.push("");
403
- if (hasAny) return labels;
404
- }
405
- }
356
+ //#region src/util/series/converters.ts
406
357
  function extractValues(data) {
407
358
  return data.map((point) => typeof point === "number" ? point : point.value);
408
359
  }
@@ -633,6 +584,19 @@ function toGaugeSeries(s, fallbackColor, index, total) {
633
584
  }
634
585
  };
635
586
  }
587
+ //#endregion
588
+ //#region src/util/series/labels.ts
589
+ function extractLabels(series) {
590
+ for (const s of series) {
591
+ const labels = [];
592
+ let hasAny = false;
593
+ for (const point of s.data) if (typeof point === "object" && point !== null && typeof point.label === "string") {
594
+ labels.push(point.label);
595
+ hasAny = true;
596
+ } else labels.push("");
597
+ if (hasAny) return labels;
598
+ }
599
+ }
636
600
  function cartesianFallbackLabels(series) {
637
601
  const longest = series.reduce((max, s) => Math.max(max, s.data.length), 0);
638
602
  return Array.from({ length: longest }, (_, i) => String(i + 1));
@@ -6855,56 +6819,7 @@ function K(e, t, n) {
6855
6819
  Object.defineProperty(e, t, { value: n });
6856
6820
  }
6857
6821
  //#endregion
6858
- //#region src/util/iconSvg.ts
6859
- function renderIconSvg(name, color, size = 14) {
6860
- if (!name) return "";
6861
- const icon = iconRegistry[name];
6862
- if (!icon) return "";
6863
- const [width, height, , , pathData] = icon;
6864
- return `<svg viewBox="0 0 ${width} ${height}" width="${size}" height="${size}" focusable="false" aria-hidden="true">${(Array.isArray(pathData) ? pathData : [pathData]).map((d) => `<path d="${d}" fill="${color}"/>`).join("")}</svg>`;
6865
- }
6866
- //#endregion
6867
- //#region src/util/defaultOptions.ts
6868
- var CHART_DEFAULT_COLORS = [
6869
- "var(--chart-1)",
6870
- "var(--chart-2)",
6871
- "var(--chart-3)",
6872
- "var(--chart-4)"
6873
- ];
6874
- function buildTooltipFormatter(t, styles, getSeriesIcons, valueFormatter) {
6875
- return (params) => {
6876
- const items = Array.isArray(params) ? params : [params];
6877
- if (items.length === 0) return "";
6878
- const rawTitle = items[0].axisValueLabel ?? items[0].axisValue ?? items[0].name ?? "";
6879
- const title = rawTitle ? t(String(rawTitle)) : "";
6880
- const icons = getSeriesIcons?.();
6881
- return renderTooltip(t, styles, title, items.map((param) => ({
6882
- name: param.seriesName ?? "",
6883
- value: extractValue(param.value),
6884
- color: param.color,
6885
- icon: icons?.[param.seriesIndex],
6886
- seriesIndex: param.seriesIndex,
6887
- dataIndex: param.dataIndex
6888
- })), -1, valueFormatter);
6889
- };
6890
- }
6891
- function buildCartesianTooltipOptions(t, styles, getSeriesIcons, valueFormatter) {
6892
- return { tooltip: {
6893
- show: true,
6894
- trigger: "axis",
6895
- formatter: buildTooltipFormatter(t, styles, getSeriesIcons, valueFormatter)
6896
- } };
6897
- }
6898
- function buildSharedItemTooltipFormatter(t, styles, getItems, getTitle, valueFormatter) {
6899
- return (params) => {
6900
- const param = Array.isArray(params) ? params[0] : params;
6901
- if (!param) return "";
6902
- const items = getItems();
6903
- const activeIndex = param.dataIndex ?? -1;
6904
- const rawTitle = getTitle?.() ?? "";
6905
- return renderTooltip(t, styles, rawTitle ? t(String(rawTitle)) : "", items, activeIndex, valueFormatter);
6906
- };
6907
- }
6822
+ //#region src/util/tooltips/render.ts
6908
6823
  function renderTooltip(t, styles, title, items, activeIndex = -1, valueFormatter) {
6909
6824
  if (items.length === 0) return "";
6910
6825
  const titleHtml = title ? `<div class="${styles.statisticsChartTooltipTitle}">${title}</div>` : "";
@@ -6920,7 +6835,7 @@ function renderTooltip(t, styles, title, items, activeIndex = -1, valueFormatter
6920
6835
  <div class="${styles.statisticsChartTooltipSeriesValue}${activeClass}">${display}</div>
6921
6836
  `;
6922
6837
  }).join("");
6923
- return `${titleHtml}<div class="${styles.statisticsChartTooltipBody}">${body}</div>`;
6838
+ return `<div class="${styles.statisticsChartTooltip}">${titleHtml}<div class="${styles.statisticsChartTooltipBody}">${body}</div></div>`;
6924
6839
  }
6925
6840
  function extractValue(value) {
6926
6841
  if (Array.isArray(value)) {
@@ -6937,7 +6852,10 @@ function formatValue(value) {
6937
6852
  if (typeof value === "number") return Number.isInteger(value) ? p$2(value) : value.toString();
6938
6853
  return String(value ?? "");
6939
6854
  }
6940
- function buildBoxPlotTooltipOptions(t, styles, getSeries, getPalette) {
6855
+ //#endregion
6856
+ //#region src/util/tooltips/buildBoxPlotTooltip.ts
6857
+ function buildBoxPlotTooltip(input) {
6858
+ const { t, styles, getSeries, getPalette } = input;
6941
6859
  const formatter = (params) => {
6942
6860
  const param = Array.isArray(params) ? params[0] : params;
6943
6861
  if (!param) return "";
@@ -6983,7 +6901,61 @@ function buildBoxPlotTooltipOptions(t, styles, getSeries, getPalette) {
6983
6901
  formatter
6984
6902
  } };
6985
6903
  }
6986
- function buildHeatmapTooltipOptions(t, styles, getSeries) {
6904
+ //#endregion
6905
+ //#region src/util/tooltips/buildCartesianTooltip.ts
6906
+ function buildCartesianTooltip(input) {
6907
+ const { t, styles, getSeriesIcons, valueFormatter } = input;
6908
+ const formatter = (params) => {
6909
+ const items = Array.isArray(params) ? params : [params];
6910
+ if (items.length === 0) return "";
6911
+ const rawTitle = items[0].axisValueLabel ?? items[0].axisValue ?? items[0].name ?? "";
6912
+ const title = rawTitle ? t(String(rawTitle)) : "";
6913
+ const icons = getSeriesIcons();
6914
+ return renderTooltip(t, styles, title, items.map((param) => ({
6915
+ name: param.seriesName ?? "",
6916
+ value: extractValue(param.value),
6917
+ color: param.color,
6918
+ icon: icons[param.seriesIndex],
6919
+ seriesIndex: param.seriesIndex,
6920
+ dataIndex: param.dataIndex
6921
+ })), -1, valueFormatter);
6922
+ };
6923
+ return { tooltip: {
6924
+ show: true,
6925
+ trigger: "axis",
6926
+ formatter
6927
+ } };
6928
+ }
6929
+ //#endregion
6930
+ //#region src/util/tooltips/buildGaugeTooltip.ts
6931
+ function buildGaugeTooltip(input) {
6932
+ const { t, styles, getSeries, getPalette } = input;
6933
+ const formatter = (params) => {
6934
+ const param = Array.isArray(params) ? params[0] : params;
6935
+ if (!param) return "";
6936
+ const series = getSeries();
6937
+ const palette = getPalette();
6938
+ const seriesIndex = param.seriesIndex ?? 0;
6939
+ const s = series[seriesIndex];
6940
+ if (!s) return "";
6941
+ const color = palette[seriesIndex % palette.length];
6942
+ return renderTooltip(t, styles, s.name ? t(String(s.name)) : "", [{
6943
+ name: "",
6944
+ value: s.value,
6945
+ color,
6946
+ icon: s.icon
6947
+ }]);
6948
+ };
6949
+ return { tooltip: {
6950
+ show: true,
6951
+ trigger: "item",
6952
+ formatter
6953
+ } };
6954
+ }
6955
+ //#endregion
6956
+ //#region src/util/tooltips/buildHeatmapTooltip.ts
6957
+ function buildHeatmapTooltip(input) {
6958
+ const { t, styles, getSeries } = input;
6987
6959
  const formatter = (params) => {
6988
6960
  const param = Array.isArray(params) ? params[0] : params;
6989
6961
  if (!param) return "";
@@ -7005,18 +6977,25 @@ function buildHeatmapTooltipOptions(t, styles, getSeries) {
7005
6977
  formatter
7006
6978
  } };
7007
6979
  }
7008
- function buildTreemapTooltipOptions(t, styles) {
6980
+ //#endregion
6981
+ //#region src/util/tooltips/buildRadarTooltip.ts
6982
+ function buildRadarTooltip(input) {
6983
+ const { t, styles, getSeries, getIndicators, getPalette } = input;
7009
6984
  const formatter = (params) => {
7010
6985
  const param = Array.isArray(params) ? params[0] : params;
7011
6986
  if (!param) return "";
7012
- const data = param.data;
7013
- if (!data) return "";
7014
- const color = data.color ?? "var(--primary-600)";
7015
- return renderTooltip(t, styles, data.name ? t(String(data.name)) : "", [{
7016
- name: "",
7017
- value: data.value ?? "",
6987
+ const series = getSeries();
6988
+ const indicators = getIndicators();
6989
+ const palette = getPalette();
6990
+ const ringIndex = param.dataIndex ?? 0;
6991
+ const ring = series[ringIndex];
6992
+ if (!ring) return "";
6993
+ const color = palette[ringIndex % palette.length];
6994
+ return renderTooltip(t, styles, ring.name ? t(String(ring.name)) : "", indicators.map((indicator, idx) => ({
6995
+ name: indicator.name,
6996
+ value: ring.values[idx] ?? "",
7018
6997
  color
7019
- }]);
6998
+ })));
7020
6999
  };
7021
7000
  return { tooltip: {
7022
7001
  show: true,
@@ -7024,21 +7003,38 @@ function buildTreemapTooltipOptions(t, styles) {
7024
7003
  formatter
7025
7004
  } };
7026
7005
  }
7027
- function buildGaugeTooltipOptions(t, styles, getSeries, getPalette) {
7006
+ //#endregion
7007
+ //#region src/util/tooltips/buildSharedItemTooltip.ts
7008
+ function buildSharedItemTooltip(input) {
7009
+ const { t, styles, getItems, getTitle, valueFormatter } = input;
7028
7010
  const formatter = (params) => {
7029
7011
  const param = Array.isArray(params) ? params[0] : params;
7030
7012
  if (!param) return "";
7031
- const series = getSeries();
7032
- const palette = getPalette();
7033
- const seriesIndex = param.seriesIndex ?? 0;
7034
- const s = series[seriesIndex];
7035
- if (!s) return "";
7036
- const color = palette[seriesIndex % palette.length];
7037
- return renderTooltip(t, styles, s.name ? t(String(s.name)) : "", [{
7013
+ const items = getItems();
7014
+ const activeIndex = param.dataIndex ?? -1;
7015
+ const rawTitle = getTitle?.() ?? "";
7016
+ return renderTooltip(t, styles, rawTitle ? t(String(rawTitle)) : "", items, activeIndex, valueFormatter);
7017
+ };
7018
+ return { tooltip: {
7019
+ show: true,
7020
+ trigger: "item",
7021
+ formatter
7022
+ } };
7023
+ }
7024
+ //#endregion
7025
+ //#region src/util/tooltips/buildTreemapTooltip.ts
7026
+ function buildTreemapTooltip(input) {
7027
+ const { t, styles } = input;
7028
+ const formatter = (params) => {
7029
+ const param = Array.isArray(params) ? params[0] : params;
7030
+ if (!param) return "";
7031
+ const data = param.data;
7032
+ if (!data) return "";
7033
+ const color = data.color ?? "var(--primary-600)";
7034
+ return renderTooltip(t, styles, data.name ? t(String(data.name)) : "", [{
7038
7035
  name: "",
7039
- value: s.value,
7040
- color,
7041
- icon: s.icon
7036
+ value: data.value ?? "",
7037
+ color
7042
7038
  }]);
7043
7039
  };
7044
7040
  return { tooltip: {
@@ -7047,7 +7043,484 @@ function buildGaugeTooltipOptions(t, styles, getSeries, getPalette) {
7047
7043
  formatter
7048
7044
  } };
7049
7045
  }
7050
- function buildDefaultOptions() {
7046
+ //#endregion
7047
+ //#region src/util/options/buildCartesianBaseOptions.ts
7048
+ var FOREGROUND_LABEL = {
7049
+ show: true,
7050
+ color: "var(--foreground-secondary)"
7051
+ };
7052
+ var HIDDEN_AXIS = { show: false };
7053
+ var DASHED_SPLIT_LINE = {
7054
+ show: true,
7055
+ lineStyle: {
7056
+ type: "dashed",
7057
+ color: "var(--gray-200)"
7058
+ }
7059
+ };
7060
+ function buildCartesianGrid(xAxisLabels, yAxisLabels, minPadding = 0) {
7061
+ if (!xAxisLabels && !yAxisLabels) return {
7062
+ left: minPadding,
7063
+ right: minPadding,
7064
+ top: minPadding,
7065
+ bottom: minPadding,
7066
+ containLabel: false
7067
+ };
7068
+ return {
7069
+ left: yAxisLabels ? 21 : minPadding,
7070
+ right: 21,
7071
+ top: 21,
7072
+ bottom: xAxisLabels ? 21 : minPadding,
7073
+ containLabel: true
7074
+ };
7075
+ }
7076
+ function buildCartesianBaseOptions(config = {}) {
7077
+ const xAxisLabels = config.xAxisLabels ?? false;
7078
+ const yAxisLabels = config.yAxisLabels ?? false;
7079
+ const showSplitLines = config.splitLines ?? false;
7080
+ const minPadding = config.minPadding ?? 0;
7081
+ const xSplitLine = showSplitLines && config.xAxisType === "value" ? DASHED_SPLIT_LINE : HIDDEN_AXIS;
7082
+ const ySplitLine = showSplitLines && config.yAxisType !== "category" ? DASHED_SPLIT_LINE : HIDDEN_AXIS;
7083
+ return {
7084
+ grid: buildCartesianGrid(xAxisLabels, yAxisLabels, minPadding),
7085
+ tooltip: {
7086
+ appendTo: "body",
7087
+ snap: true,
7088
+ trigger: config.tooltipTrigger ?? "item"
7089
+ },
7090
+ xAxis: {
7091
+ type: config.xAxisType ?? "category",
7092
+ show: true,
7093
+ scale: config.scale && config.xAxisType === "value",
7094
+ splitLine: xSplitLine,
7095
+ axisLabel: xAxisLabels ? FOREGROUND_LABEL : HIDDEN_AXIS,
7096
+ axisLine: HIDDEN_AXIS,
7097
+ axisTick: HIDDEN_AXIS
7098
+ },
7099
+ yAxis: {
7100
+ type: config.yAxisType ?? "value",
7101
+ show: true,
7102
+ scale: config.scale && config.yAxisType !== "category",
7103
+ splitLine: ySplitLine,
7104
+ axisLabel: yAxisLabels ? FOREGROUND_LABEL : HIDDEN_AXIS,
7105
+ axisLine: HIDDEN_AXIS,
7106
+ axisTick: HIDDEN_AXIS
7107
+ }
7108
+ };
7109
+ }
7110
+ //#endregion
7111
+ //#region src/util/options/cartesian/buildAreaChartOptions.ts
7112
+ function buildAreaChartOptions(input) {
7113
+ const { series, labels, palette, t, styles, tooltip = false, tooltipValueFormatter, xAxisLabels = false, yAxisLabels = false, splitLines = false, advancedOptions = {} } = input;
7114
+ const xLabels = labels ?? extractLabels(series) ?? cartesianFallbackLabels(series);
7115
+ return merge({}, buildCartesianBaseOptions({
7116
+ xAxisLabels,
7117
+ yAxisLabels,
7118
+ splitLines
7119
+ }), { xAxis: {
7120
+ type: "category",
7121
+ data: xLabels,
7122
+ boundaryGap: false
7123
+ } }, tooltip ? buildCartesianTooltip({
7124
+ t,
7125
+ styles,
7126
+ getSeriesIcons: () => series.map((s) => s.icon),
7127
+ valueFormatter: tooltipValueFormatter
7128
+ }) : { tooltip: { show: false } }, advancedOptions, {
7129
+ series: series.map((s, i) => toAreaSeries({
7130
+ ...s,
7131
+ name: s.name ? t(String(s.name)) : void 0
7132
+ }, palette[i])),
7133
+ color: palette
7134
+ });
7135
+ }
7136
+ //#endregion
7137
+ //#region src/util/options/cartesian/buildBarChartOptions.ts
7138
+ function buildBarChartOptions(input) {
7139
+ const { series, labels, palette, t, styles, tooltip = false, tooltipValueFormatter, xAxisLabels = false, yAxisLabels = false, splitLines = false, advancedOptions = {} } = input;
7140
+ const xLabels = labels ?? extractLabels(series) ?? cartesianFallbackLabels(series);
7141
+ return merge({}, buildCartesianBaseOptions({
7142
+ xAxisLabels,
7143
+ yAxisLabels,
7144
+ splitLines,
7145
+ minPadding: 12
7146
+ }), { xAxis: {
7147
+ type: "category",
7148
+ data: xLabels
7149
+ } }, tooltip ? buildCartesianTooltip({
7150
+ t,
7151
+ styles,
7152
+ getSeriesIcons: () => series.map((s) => s.icon),
7153
+ valueFormatter: tooltipValueFormatter
7154
+ }) : { tooltip: { show: false } }, advancedOptions, {
7155
+ series: series.map((s, i) => toBarSeries({
7156
+ ...s,
7157
+ name: s.name ? t(String(s.name)) : void 0
7158
+ }, palette[i])),
7159
+ color: palette
7160
+ });
7161
+ }
7162
+ //#endregion
7163
+ //#region src/util/options/cartesian/buildBoxPlotChartOptions.ts
7164
+ function resolveBoxPlotLabels(series, labels) {
7165
+ if (labels) return labels;
7166
+ for (const s of series) if (s.data.map((p) => p.label ?? "").filter(Boolean).length > 0) return s.data.map((p) => p.label ?? "");
7167
+ }
7168
+ function buildBoxPlotChartOptions(input) {
7169
+ const { series, labels, palette, t, styles, tooltip = false, xAxisLabels = false, yAxisLabels = false, splitLines = false, advancedOptions = {} } = input;
7170
+ const xLabels = resolveBoxPlotLabels(series, labels);
7171
+ const base = buildCartesianBaseOptions({
7172
+ xAxisLabels,
7173
+ yAxisLabels,
7174
+ splitLines,
7175
+ minPadding: 12
7176
+ });
7177
+ const xAxisOverride = xLabels ? { xAxis: {
7178
+ type: "category",
7179
+ data: xLabels
7180
+ } } : void 0;
7181
+ const tooltipOptions = tooltip ? buildBoxPlotTooltip({
7182
+ t,
7183
+ styles,
7184
+ getSeries: () => series,
7185
+ getPalette: () => palette
7186
+ }) : { tooltip: { show: false } };
7187
+ const echartsSeries = series.map((s, i) => toBoxPlotSeries({
7188
+ ...s,
7189
+ name: s.name ? t(String(s.name)) : void 0
7190
+ }, palette[i]));
7191
+ return merge({}, base, xAxisOverride ?? {}, tooltipOptions, advancedOptions, {
7192
+ series: echartsSeries,
7193
+ color: palette
7194
+ });
7195
+ }
7196
+ //#endregion
7197
+ //#region src/util/options/cartesian/buildBubbleChartOptions.ts
7198
+ function buildBubbleChartOptions(input) {
7199
+ const { series, palette, t, styles, tooltip = false, xAxisLabels = false, yAxisLabels = false, splitLines = false, advancedOptions = {} } = input;
7200
+ return merge({}, buildCartesianBaseOptions({
7201
+ xAxisType: "value",
7202
+ yAxisType: "value",
7203
+ scale: true,
7204
+ xAxisLabels,
7205
+ yAxisLabels,
7206
+ splitLines,
7207
+ minPadding: 12
7208
+ }), tooltip ? buildCartesianTooltip({
7209
+ t,
7210
+ styles,
7211
+ getSeriesIcons: () => series.map((s) => s.icon)
7212
+ }) : { tooltip: { show: false } }, advancedOptions, {
7213
+ series: series.map((s, i) => toBubbleSeries({
7214
+ ...s,
7215
+ name: s.name ? t(String(s.name)) : void 0
7216
+ }, palette[i])),
7217
+ color: palette
7218
+ });
7219
+ }
7220
+ //#endregion
7221
+ //#region src/util/options/cartesian/buildCandlestickChartOptions.ts
7222
+ function resolveCandlestickLabels(series, labels) {
7223
+ if (labels) return labels;
7224
+ for (const s of series) if (s.data.map((p) => p.label ?? "").filter(Boolean).length > 0) return s.data.map((p) => p.label ?? "");
7225
+ }
7226
+ function candlestickLegendItemBuilder(s) {
7227
+ return [{
7228
+ color: resolveChartColor(s.positiveColor) ?? "var(--success-500)",
7229
+ icon: s.icon,
7230
+ label: "Up"
7231
+ }, {
7232
+ color: resolveChartColor(s.negativeColor) ?? "var(--danger-500)",
7233
+ label: "Down"
7234
+ }];
7235
+ }
7236
+ function buildCandlestickChartOptions(input) {
7237
+ const { series, labels, t, styles, tooltip = false, xAxisLabels = false, yAxisLabels = false, splitLines = false, advancedOptions = {} } = input;
7238
+ const xLabels = resolveCandlestickLabels(series, labels);
7239
+ const base = buildCartesianBaseOptions({
7240
+ scale: true,
7241
+ xAxisLabels,
7242
+ yAxisLabels,
7243
+ splitLines,
7244
+ minPadding: 12
7245
+ });
7246
+ const xAxisOverride = xLabels ? { xAxis: {
7247
+ type: "category",
7248
+ data: xLabels
7249
+ } } : void 0;
7250
+ const tooltipOptions = tooltip ? buildCartesianTooltip({
7251
+ t,
7252
+ styles,
7253
+ getSeriesIcons: () => series.map((s) => s.icon)
7254
+ }) : { tooltip: { show: false } };
7255
+ const echartsSeries = series.map((s) => toCandlestickSeries({
7256
+ ...s,
7257
+ name: s.name ? t(String(s.name)) : void 0
7258
+ }));
7259
+ return merge({}, base, xAxisOverride ?? {}, tooltipOptions, advancedOptions, { series: echartsSeries });
7260
+ }
7261
+ //#endregion
7262
+ //#region src/util/options/cartesian/buildHeatmapChartOptions.ts
7263
+ var HIDDEN = { show: false };
7264
+ var labelStyle = (show) => ({
7265
+ show,
7266
+ color: "var(--foreground-secondary)"
7267
+ });
7268
+ function buildHeatmapChartOptions(input) {
7269
+ const { series, xLabels, yLabels, t, styles, tooltip = false, xAxisLabels = false, yAxisLabels = false, advancedOptions = {} } = input;
7270
+ const translatedXLabels = xLabels.map((label) => t(String(label)));
7271
+ const translatedYLabels = yLabels.map((label) => t(String(label)));
7272
+ return merge({}, {
7273
+ grid: buildCartesianGrid(xAxisLabels, yAxisLabels, 12),
7274
+ color: [ln],
7275
+ visualMap: {
7276
+ show: false,
7277
+ min: 0,
7278
+ max: 100,
7279
+ inRange: { color: [
7280
+ an,
7281
+ sn,
7282
+ ln,
7283
+ dn
7284
+ ] }
7285
+ },
7286
+ xAxis: {
7287
+ type: "category",
7288
+ data: translatedXLabels,
7289
+ axisLabel: labelStyle(xAxisLabels),
7290
+ axisLine: HIDDEN,
7291
+ axisTick: HIDDEN,
7292
+ splitLine: HIDDEN
7293
+ },
7294
+ yAxis: {
7295
+ type: "category",
7296
+ data: translatedYLabels,
7297
+ axisLabel: labelStyle(yAxisLabels),
7298
+ axisLine: HIDDEN,
7299
+ axisTick: HIDDEN,
7300
+ splitLine: HIDDEN
7301
+ }
7302
+ }, tooltip ? buildHeatmapTooltip({
7303
+ t,
7304
+ styles,
7305
+ getSeries: () => series
7306
+ }) : { tooltip: { show: false } }, advancedOptions, { series: series.map((s) => toHeatmapSeries({
7307
+ ...s,
7308
+ name: s.name ? t(String(s.name)) : void 0
7309
+ }, xLabels, yLabels)) });
7310
+ }
7311
+ //#endregion
7312
+ //#region src/util/options/cartesian/buildLineChartOptions.ts
7313
+ function buildLineChartOptions(input) {
7314
+ const { series, labels, palette, t, styles, tooltip = false, tooltipValueFormatter, xAxisLabels = false, yAxisLabels = false, splitLines = false, advancedOptions = {} } = input;
7315
+ const xLabels = labels ?? extractLabels(series) ?? cartesianFallbackLabels(series);
7316
+ return merge({}, buildCartesianBaseOptions({
7317
+ xAxisLabels,
7318
+ yAxisLabels,
7319
+ splitLines
7320
+ }), { xAxis: {
7321
+ type: "category",
7322
+ data: xLabels,
7323
+ boundaryGap: false
7324
+ } }, tooltip ? buildCartesianTooltip({
7325
+ t,
7326
+ styles,
7327
+ getSeriesIcons: () => series.map((s) => s.icon),
7328
+ valueFormatter: tooltipValueFormatter
7329
+ }) : { tooltip: { show: false } }, advancedOptions, {
7330
+ series: series.map((s, i) => toLineSeries({
7331
+ ...s,
7332
+ name: s.name ? t(String(s.name)) : void 0
7333
+ }, palette[i])),
7334
+ color: palette
7335
+ });
7336
+ }
7337
+ //#endregion
7338
+ //#region src/util/options/cartesian/buildMixedChartOptions.ts
7339
+ function buildMixedChartOptions(input) {
7340
+ const { series, labels, palette, t, styles, tooltip = false, tooltipValueFormatter, xAxisLabels = false, yAxisLabels = false, splitLines = false, advancedOptions = {} } = input;
7341
+ const xLabels = labels ?? extractLabels(series) ?? cartesianFallbackLabels(series);
7342
+ return merge({}, buildCartesianBaseOptions({
7343
+ tooltipTrigger: "axis",
7344
+ xAxisLabels,
7345
+ yAxisLabels,
7346
+ splitLines,
7347
+ minPadding: 12
7348
+ }), { xAxis: {
7349
+ type: "category",
7350
+ data: xLabels
7351
+ } }, tooltip ? buildCartesianTooltip({
7352
+ t,
7353
+ styles,
7354
+ getSeriesIcons: () => series.map((s) => s.icon),
7355
+ valueFormatter: tooltipValueFormatter
7356
+ }) : { tooltip: { show: false } }, advancedOptions, {
7357
+ series: series.map((s, i) => toMixedSeries({
7358
+ ...s,
7359
+ name: s.name ? t(String(s.name)) : void 0
7360
+ }, palette[i])),
7361
+ color: palette
7362
+ });
7363
+ }
7364
+ //#endregion
7365
+ //#region src/util/options/cartesian/buildScatterChartOptions.ts
7366
+ function buildScatterChartOptions(input) {
7367
+ const { series, palette, t, styles, tooltip = false, xAxisLabels = false, yAxisLabels = false, splitLines = false, advancedOptions = {} } = input;
7368
+ return merge({}, buildCartesianBaseOptions({
7369
+ xAxisType: "value",
7370
+ yAxisType: "value",
7371
+ scale: true,
7372
+ xAxisLabels,
7373
+ yAxisLabels,
7374
+ splitLines,
7375
+ minPadding: 12
7376
+ }), tooltip ? buildCartesianTooltip({
7377
+ t,
7378
+ styles,
7379
+ getSeriesIcons: () => series.map((s) => s.icon)
7380
+ }) : { tooltip: { show: false } }, advancedOptions, {
7381
+ series: series.map((s, i) => toScatterSeries({
7382
+ ...s,
7383
+ name: s.name ? t(String(s.name)) : void 0
7384
+ }, palette[i])),
7385
+ color: palette
7386
+ });
7387
+ }
7388
+ //#endregion
7389
+ //#region src/util/options/buildCircularBaseOptions.ts
7390
+ function buildCircularBaseOptions() {
7391
+ return {
7392
+ tooltip: { show: false },
7393
+ xAxis: { show: false },
7394
+ yAxis: { show: false },
7395
+ grid: { show: false }
7396
+ };
7397
+ }
7398
+ //#endregion
7399
+ //#region src/util/options/circular/buildDonutChartOptions.ts
7400
+ function buildDonutChartOptions(input) {
7401
+ const { slices, palette, tooltipItems, title, t, styles, tooltip = false, tooltipValueFormatter, advancedOptions = {} } = input;
7402
+ const tooltipOptions = tooltip ? buildSharedItemTooltip({
7403
+ t,
7404
+ styles,
7405
+ getItems: () => tooltipItems,
7406
+ getTitle: () => title,
7407
+ valueFormatter: tooltipValueFormatter
7408
+ }) : { tooltip: { show: false } };
7409
+ const echartsSeries = [toDonutSeries(slices, palette)];
7410
+ return merge({}, buildCircularBaseOptions(), tooltipOptions, advancedOptions, {
7411
+ series: echartsSeries,
7412
+ color: palette
7413
+ });
7414
+ }
7415
+ //#endregion
7416
+ //#region src/util/options/circular/buildGaugeChartOptions.ts
7417
+ function gaugeLegendItemBuilder(s, color, _index, t) {
7418
+ return {
7419
+ color,
7420
+ icon: s.icon,
7421
+ label: s.name ? t(String(s.name)) : "",
7422
+ value: s.value
7423
+ };
7424
+ }
7425
+ function buildGaugeChartOptions(input) {
7426
+ const { series, palette, t, styles, tooltip = false, advancedOptions = {} } = input;
7427
+ const tooltipOptions = tooltip ? buildGaugeTooltip({
7428
+ t,
7429
+ styles,
7430
+ getSeries: () => series,
7431
+ getPalette: () => palette
7432
+ }) : { tooltip: { show: false } };
7433
+ const echartsSeries = series.map((s, i) => toGaugeSeries({
7434
+ ...s,
7435
+ name: s.name ? t(String(s.name)) : s.name
7436
+ }, palette[i], i, series.length));
7437
+ return merge({}, buildCircularBaseOptions(), tooltipOptions, advancedOptions, {
7438
+ series: echartsSeries,
7439
+ color: palette
7440
+ });
7441
+ }
7442
+ //#endregion
7443
+ //#region src/util/options/circular/buildPieChartOptions.ts
7444
+ function buildPieChartOptions(input) {
7445
+ const { slices, palette, tooltipItems, title, t, styles, tooltip = false, tooltipValueFormatter, advancedOptions = {} } = input;
7446
+ const tooltipOptions = tooltip ? buildSharedItemTooltip({
7447
+ t,
7448
+ styles,
7449
+ getItems: () => tooltipItems,
7450
+ getTitle: () => title,
7451
+ valueFormatter: tooltipValueFormatter
7452
+ }) : { tooltip: { show: false } };
7453
+ const echartsSeries = [toPieSeries(slices, palette)];
7454
+ return merge({}, buildCircularBaseOptions(), tooltipOptions, advancedOptions, {
7455
+ series: echartsSeries,
7456
+ color: palette
7457
+ });
7458
+ }
7459
+ //#endregion
7460
+ //#region src/util/options/circular/buildPolarAreaChartOptions.ts
7461
+ function buildPolarAreaChartOptions(input) {
7462
+ const { slices, palette, tooltipItems, title, t, styles, tooltip = false, tooltipValueFormatter, advancedOptions = {} } = input;
7463
+ const tooltipOptions = tooltip ? buildSharedItemTooltip({
7464
+ t,
7465
+ styles,
7466
+ getItems: () => tooltipItems,
7467
+ getTitle: () => title,
7468
+ valueFormatter: tooltipValueFormatter
7469
+ }) : { tooltip: { show: false } };
7470
+ const echartsSeries = [toPolarAreaSeries(slices, palette)];
7471
+ return merge({}, buildCircularBaseOptions(), tooltipOptions, advancedOptions, {
7472
+ series: echartsSeries,
7473
+ color: palette
7474
+ });
7475
+ }
7476
+ //#endregion
7477
+ //#region src/util/options/circular/buildRadarChartOptions.ts
7478
+ function buildRadarChartOptions(input) {
7479
+ const { series, indicators, palette, t, styles, tooltip = false, advancedOptions = {} } = input;
7480
+ const radarConfig = { radar: {
7481
+ indicator: indicators.map((i) => ({
7482
+ name: t(String(i.name)),
7483
+ max: i.max
7484
+ })),
7485
+ splitLine: { lineStyle: { color: "var(--gray-200)" } },
7486
+ splitArea: { show: false },
7487
+ axisLine: { lineStyle: { color: "var(--gray-200)" } },
7488
+ axisName: {
7489
+ color: "var(--foreground-secondary)",
7490
+ fontSize: 12,
7491
+ fontWeight: 500
7492
+ }
7493
+ } };
7494
+ const tooltipOptions = tooltip ? buildRadarTooltip({
7495
+ t,
7496
+ styles,
7497
+ getSeries: () => series,
7498
+ getIndicators: () => indicators,
7499
+ getPalette: () => palette
7500
+ }) : { tooltip: { show: false } };
7501
+ const echartsSeries = [toRadarSeries(series.map((s) => ({
7502
+ ...s,
7503
+ name: s.name ? t(String(s.name)) : void 0
7504
+ })), palette)];
7505
+ return merge({}, buildCircularBaseOptions(), radarConfig, tooltipOptions, advancedOptions, {
7506
+ series: echartsSeries,
7507
+ color: palette
7508
+ });
7509
+ }
7510
+ //#endregion
7511
+ //#region src/util/options/circular/buildTreemapChartOptions.ts
7512
+ function buildTreemapChartOptions(input) {
7513
+ const { nodes, palette = CHART_DEFAULT_COLORS, t, styles, tooltip = false, advancedOptions = {} } = input;
7514
+ const tooltipOptions = tooltip ? buildTreemapTooltip({
7515
+ t,
7516
+ styles
7517
+ }) : { tooltip: { show: false } };
7518
+ const echartsSeries = [toTreemapSeries(nodes, palette)];
7519
+ return merge({}, buildCircularBaseOptions(), tooltipOptions, advancedOptions, { series: echartsSeries });
7520
+ }
7521
+ //#endregion
7522
+ //#region src/util/options/buildBaseOptions.ts
7523
+ function buildBaseOptions() {
7051
7524
  return {
7052
7525
  color: [
7053
7526
  "var(--chart-1)",
@@ -7066,13 +7539,16 @@ function buildDefaultOptions() {
7066
7539
  borderWidth: 0,
7067
7540
  padding: 0,
7068
7541
  extraCssText: "box-shadow: none;",
7069
- className: "flux-statistics-tooltip"
7542
+ axisPointer: {
7543
+ appendTo: "body",
7544
+ snap: true
7545
+ }
7070
7546
  },
7071
7547
  legend: { show: false }
7072
7548
  };
7073
7549
  }
7074
7550
  //#endregion
7075
- //#region src/util/sparklineOptions.ts
7551
+ //#region src/util/sparkline.ts
7076
7552
  function buildSparklineOptions(variant, color, series) {
7077
7553
  const data = series[0]?.data ?? [];
7078
7554
  const base = {
@@ -7152,8 +7628,8 @@ function useChartSeriesSetup(seriesGetter, options = {}) {
7152
7628
  };
7153
7629
  }
7154
7630
  //#endregion
7155
- //#region src/composable/usePieSlicesSetup.ts
7156
- function usePieSlicesSetup(slicesGetter) {
7631
+ //#region src/composable/useChartSlicesSetup.ts
7632
+ function useChartSlicesSetup(slicesGetter) {
7157
7633
  const { t } = useI18n({ useScope: "parent" });
7158
7634
  const legendContext = inject(FluxStatisticsChartLegendInjectionKey, null);
7159
7635
  const chartRef = useTemplateRef("chartRef");
@@ -10267,7 +10743,7 @@ useMode(definition$2);
10267
10743
  useMode(definition$1);
10268
10744
  useMode(definition);
10269
10745
  //#endregion
10270
- //#region ../../node_modules/.bun/@basmilius+http-client@3.33.0+ceec7979b6f4ef20/node_modules/@basmilius/http-client/dist/index.mjs
10746
+ //#region ../../node_modules/.bun/@basmilius+http-client@3.33.0+644299353f754fd6/node_modules/@basmilius/http-client/dist/index.mjs
10271
10747
  function adapter_default(Parent) {
10272
10748
  return class extends Parent {
10273
10749
  constructor(...args) {
@@ -10828,6 +11304,7 @@ function useECharts(target, options) {
10828
11304
  var Chart_module_default = {
10829
11305
  pane: `pane`,
10830
11306
  statisticsChart: `statistics-chart`,
11307
+ statisticsChartTooltip: `statistics-chart-tooltip`,
10831
11308
  statisticsChartTooltipTitle: `statistics-chart-tooltip-title`,
10832
11309
  statisticsChartTooltipBody: `statistics-chart-tooltip-body`,
10833
11310
  statisticsChartTooltipSeriesColor: `statistics-chart-tooltip-series-color`,
@@ -10847,7 +11324,7 @@ var FluxStatisticsChart_default = /* @__PURE__ */ defineComponent({
10847
11324
  props: { options: { default: () => ({}) } },
10848
11325
  setup(__props, { expose: __expose }) {
10849
11326
  const chart = useTemplateRef("chart");
10850
- const defaults = buildDefaultOptions();
11327
+ const defaults = buildBaseOptions();
10851
11328
  const { chartInstance } = useECharts(chart, computed(() => {
10852
11329
  const merged = merge({}, defaults, __props.options);
10853
11330
  if (__props.options && __props.options.color !== void 0) merged.color = __props.options.color;
@@ -10869,7 +11346,7 @@ var FluxStatisticsChart_default = /* @__PURE__ */ defineComponent({
10869
11346
  var FluxStatisticsAreaChart_default = /* @__PURE__ */ defineComponent({
10870
11347
  __name: "FluxStatisticsAreaChart",
10871
11348
  props: {
10872
- advancedOptions: { default: () => ({}) },
11349
+ advancedOptions: {},
10873
11350
  labels: {},
10874
11351
  series: {},
10875
11352
  splitLines: {
@@ -10892,25 +11369,19 @@ var FluxStatisticsAreaChart_default = /* @__PURE__ */ defineComponent({
10892
11369
  },
10893
11370
  setup(__props) {
10894
11371
  const { t, palette } = useChartSeriesSetup(() => __props.series);
10895
- const xLabels = computed(() => __props.labels ?? extractLabels(__props.series) ?? cartesianFallbackLabels(__props.series));
10896
- const echartsSeries = computed(() => __props.series.map((s, i) => toAreaSeries({
10897
- ...s,
10898
- name: s.name ? t(String(s.name)) : void 0
10899
- }, palette.value[i])));
10900
- const mergedOptions = computed(() => {
10901
- return merge({}, buildCartesianBaseOptions({
10902
- xAxisLabels: __props.xAxisLabels,
10903
- yAxisLabels: __props.yAxisLabels,
10904
- splitLines: __props.splitLines
10905
- }), { xAxis: {
10906
- type: "category",
10907
- data: xLabels.value,
10908
- boundaryGap: false
10909
- } }, __props.tooltip ? buildCartesianTooltipOptions(t, Chart_module_default, () => __props.series.map((s) => s.icon), __props.tooltipValueFormatter) : { tooltip: { show: false } }, __props.advancedOptions, {
10910
- series: echartsSeries.value,
10911
- color: palette.value
10912
- });
10913
- });
11372
+ const mergedOptions = computed(() => buildAreaChartOptions({
11373
+ series: __props.series,
11374
+ labels: __props.labels,
11375
+ palette: palette.value,
11376
+ t,
11377
+ styles: Chart_module_default,
11378
+ tooltip: __props.tooltip,
11379
+ tooltipValueFormatter: __props.tooltipValueFormatter,
11380
+ xAxisLabels: __props.xAxisLabels,
11381
+ yAxisLabels: __props.yAxisLabels,
11382
+ splitLines: __props.splitLines,
11383
+ advancedOptions: __props.advancedOptions
11384
+ }));
10914
11385
  return (_ctx, _cache) => {
10915
11386
  return openBlock(), createBlock(FluxStatisticsChart_default, {
10916
11387
  ref: "chartRef",
@@ -10924,7 +11395,7 @@ var FluxStatisticsAreaChart_default = /* @__PURE__ */ defineComponent({
10924
11395
  var FluxStatisticsBarChart_default = /* @__PURE__ */ defineComponent({
10925
11396
  __name: "FluxStatisticsBarChart",
10926
11397
  props: {
10927
- advancedOptions: { default: () => ({}) },
11398
+ advancedOptions: {},
10928
11399
  labels: {},
10929
11400
  series: {},
10930
11401
  splitLines: {
@@ -10947,24 +11418,19 @@ var FluxStatisticsBarChart_default = /* @__PURE__ */ defineComponent({
10947
11418
  },
10948
11419
  setup(__props) {
10949
11420
  const { t, palette } = useChartSeriesSetup(() => __props.series);
10950
- const xLabels = computed(() => __props.labels ?? extractLabels(__props.series) ?? cartesianFallbackLabels(__props.series));
10951
- const echartsSeries = computed(() => __props.series.map((s, i) => toBarSeries({
10952
- ...s,
10953
- name: s.name ? t(String(s.name)) : void 0
10954
- }, palette.value[i])));
10955
- const mergedOptions = computed(() => {
10956
- return merge({}, buildCartesianBaseOptions({
10957
- xAxisLabels: __props.xAxisLabels,
10958
- yAxisLabels: __props.yAxisLabels,
10959
- splitLines: __props.splitLines
10960
- }), { xAxis: {
10961
- type: "category",
10962
- data: xLabels.value
10963
- } }, __props.tooltip ? buildCartesianTooltipOptions(t, Chart_module_default, () => __props.series.map((s) => s.icon), __props.tooltipValueFormatter) : { tooltip: { show: false } }, __props.advancedOptions, {
10964
- series: echartsSeries.value,
10965
- color: palette.value
10966
- });
10967
- });
11421
+ const mergedOptions = computed(() => buildBarChartOptions({
11422
+ series: __props.series,
11423
+ labels: __props.labels,
11424
+ palette: palette.value,
11425
+ t,
11426
+ styles: Chart_module_default,
11427
+ tooltip: __props.tooltip,
11428
+ tooltipValueFormatter: __props.tooltipValueFormatter,
11429
+ xAxisLabels: __props.xAxisLabels,
11430
+ yAxisLabels: __props.yAxisLabels,
11431
+ splitLines: __props.splitLines,
11432
+ advancedOptions: __props.advancedOptions
11433
+ }));
10968
11434
  return (_ctx, _cache) => {
10969
11435
  return openBlock(), createBlock(FluxStatisticsChart_default, {
10970
11436
  ref: "chartRef",
@@ -11034,7 +11500,7 @@ var FluxStatisticsBase_default = /* @__PURE__ */ defineComponent({
11034
11500
  var FluxStatisticsBoxPlotChart_default = /* @__PURE__ */ defineComponent({
11035
11501
  __name: "FluxStatisticsBoxPlotChart",
11036
11502
  props: {
11037
- advancedOptions: { default: () => ({}) },
11503
+ advancedOptions: {},
11038
11504
  labels: {},
11039
11505
  series: {},
11040
11506
  splitLines: {
@@ -11056,30 +11522,18 @@ var FluxStatisticsBoxPlotChart_default = /* @__PURE__ */ defineComponent({
11056
11522
  },
11057
11523
  setup(__props) {
11058
11524
  const { t, palette } = useChartSeriesSetup(() => __props.series);
11059
- const xLabels = computed(() => {
11060
- if (__props.labels) return __props.labels;
11061
- for (const s of __props.series) if (s.data.map((p) => p.label ?? "").filter(Boolean).length > 0) return s.data.map((p) => p.label ?? "");
11062
- });
11063
- const echartsSeries = computed(() => __props.series.map((s, i) => toBoxPlotSeries({
11064
- ...s,
11065
- name: s.name ? t(String(s.name)) : void 0
11066
- }, palette.value[i])));
11067
- const mergedOptions = computed(() => {
11068
- const base = buildCartesianBaseOptions({
11069
- xAxisLabels: __props.xAxisLabels,
11070
- yAxisLabels: __props.yAxisLabels,
11071
- splitLines: __props.splitLines
11072
- });
11073
- const xAxisOverride = xLabels.value ? { xAxis: {
11074
- type: "category",
11075
- data: xLabels.value
11076
- } } : void 0;
11077
- const tooltipOptions = __props.tooltip ? buildBoxPlotTooltipOptions(t, Chart_module_default, () => __props.series, () => palette.value) : { tooltip: { show: false } };
11078
- return merge({}, base, xAxisOverride ?? {}, tooltipOptions, __props.advancedOptions, {
11079
- series: echartsSeries.value,
11080
- color: palette.value
11081
- });
11082
- });
11525
+ const mergedOptions = computed(() => buildBoxPlotChartOptions({
11526
+ series: __props.series,
11527
+ labels: __props.labels,
11528
+ palette: palette.value,
11529
+ t,
11530
+ styles: Chart_module_default,
11531
+ tooltip: __props.tooltip,
11532
+ xAxisLabels: __props.xAxisLabels,
11533
+ yAxisLabels: __props.yAxisLabels,
11534
+ splitLines: __props.splitLines,
11535
+ advancedOptions: __props.advancedOptions
11536
+ }));
11083
11537
  return (_ctx, _cache) => {
11084
11538
  return openBlock(), createBlock(FluxStatisticsChart_default, {
11085
11539
  ref: "chartRef",
@@ -11093,7 +11547,7 @@ var FluxStatisticsBoxPlotChart_default = /* @__PURE__ */ defineComponent({
11093
11547
  var FluxStatisticsBubbleChart_default = /* @__PURE__ */ defineComponent({
11094
11548
  __name: "FluxStatisticsBubbleChart",
11095
11549
  props: {
11096
- advancedOptions: { default: () => ({}) },
11550
+ advancedOptions: {},
11097
11551
  series: {},
11098
11552
  splitLines: {
11099
11553
  type: Boolean,
@@ -11114,23 +11568,17 @@ var FluxStatisticsBubbleChart_default = /* @__PURE__ */ defineComponent({
11114
11568
  },
11115
11569
  setup(__props) {
11116
11570
  const { t, palette } = useChartSeriesSetup(() => __props.series);
11117
- const echartsSeries = computed(() => __props.series.map((s, i) => toBubbleSeries({
11118
- ...s,
11119
- name: s.name ? t(String(s.name)) : void 0
11120
- }, palette.value[i])));
11121
- const mergedOptions = computed(() => {
11122
- return merge({}, buildCartesianBaseOptions({
11123
- xAxisType: "value",
11124
- yAxisType: "value",
11125
- scale: true,
11126
- xAxisLabels: __props.xAxisLabels,
11127
- yAxisLabels: __props.yAxisLabels,
11128
- splitLines: __props.splitLines
11129
- }), __props.tooltip ? buildCartesianTooltipOptions(t, Chart_module_default, () => __props.series.map((s) => s.icon)) : { tooltip: { show: false } }, __props.advancedOptions, {
11130
- series: echartsSeries.value,
11131
- color: palette.value
11132
- });
11133
- });
11571
+ const mergedOptions = computed(() => buildBubbleChartOptions({
11572
+ series: __props.series,
11573
+ palette: palette.value,
11574
+ t,
11575
+ styles: Chart_module_default,
11576
+ tooltip: __props.tooltip,
11577
+ xAxisLabels: __props.xAxisLabels,
11578
+ yAxisLabels: __props.yAxisLabels,
11579
+ splitLines: __props.splitLines,
11580
+ advancedOptions: __props.advancedOptions
11581
+ }));
11134
11582
  return (_ctx, _cache) => {
11135
11583
  return openBlock(), createBlock(FluxStatisticsChart_default, {
11136
11584
  ref: "chartRef",
@@ -11144,7 +11592,7 @@ var FluxStatisticsBubbleChart_default = /* @__PURE__ */ defineComponent({
11144
11592
  var FluxStatisticsCandlestickChart_default = /* @__PURE__ */ defineComponent({
11145
11593
  __name: "FluxStatisticsCandlestickChart",
11146
11594
  props: {
11147
- advancedOptions: { default: () => ({}) },
11595
+ advancedOptions: {},
11148
11596
  labels: {},
11149
11597
  series: {},
11150
11598
  splitLines: {
@@ -11165,36 +11613,18 @@ var FluxStatisticsCandlestickChart_default = /* @__PURE__ */ defineComponent({
11165
11613
  }
11166
11614
  },
11167
11615
  setup(__props) {
11168
- const { t } = useChartSeriesSetup(() => __props.series, { getLegendItem: (s) => [{
11169
- color: resolveChartColor(s.positiveColor) ?? "var(--success-500)",
11170
- icon: s.icon,
11171
- label: "Up"
11172
- }, {
11173
- color: resolveChartColor(s.negativeColor) ?? "var(--danger-500)",
11174
- label: "Down"
11175
- }] });
11176
- const xLabels = computed(() => {
11177
- if (__props.labels) return __props.labels;
11178
- for (const s of __props.series) if (s.data.map((p) => p.label ?? "").filter(Boolean).length > 0) return s.data.map((p) => p.label ?? "");
11179
- });
11180
- const echartsSeries = computed(() => __props.series.map((s) => toCandlestickSeries({
11181
- ...s,
11182
- name: s.name ? t(String(s.name)) : void 0
11183
- })));
11184
- const mergedOptions = computed(() => {
11185
- const base = buildCartesianBaseOptions({
11186
- scale: true,
11187
- xAxisLabels: __props.xAxisLabels,
11188
- yAxisLabels: __props.yAxisLabels,
11189
- splitLines: __props.splitLines
11190
- });
11191
- const xAxisOverride = xLabels.value ? { xAxis: {
11192
- type: "category",
11193
- data: xLabels.value
11194
- } } : void 0;
11195
- const tooltipOptions = __props.tooltip ? buildCartesianTooltipOptions(t, Chart_module_default, () => __props.series.map((s) => s.icon)) : { tooltip: { show: false } };
11196
- return merge({}, base, xAxisOverride ?? {}, tooltipOptions, __props.advancedOptions, { series: echartsSeries.value });
11197
- });
11616
+ const { t } = useChartSeriesSetup(() => __props.series, { getLegendItem: candlestickLegendItemBuilder });
11617
+ const mergedOptions = computed(() => buildCandlestickChartOptions({
11618
+ series: __props.series,
11619
+ labels: __props.labels,
11620
+ t,
11621
+ styles: Chart_module_default,
11622
+ tooltip: __props.tooltip,
11623
+ xAxisLabels: __props.xAxisLabels,
11624
+ yAxisLabels: __props.yAxisLabels,
11625
+ splitLines: __props.splitLines,
11626
+ advancedOptions: __props.advancedOptions
11627
+ }));
11198
11628
  return (_ctx, _cache) => {
11199
11629
  return openBlock(), createBlock(FluxStatisticsChart_default, {
11200
11630
  ref: "chartRef",
@@ -11251,6 +11681,17 @@ var FluxStatisticsChange_default = /* @__PURE__ */ defineComponent({
11251
11681
  };
11252
11682
  }
11253
11683
  });
11684
+ //#endregion
11685
+ //#region src/component/FluxStatisticsLegendScope.vue
11686
+ var FluxStatisticsLegendScope_default = /* @__PURE__ */ defineComponent({
11687
+ __name: "FluxStatisticsLegendScope",
11688
+ setup(__props) {
11689
+ provide(FluxStatisticsChartLegendInjectionKey, createChartLegendContext());
11690
+ return (_ctx, _cache) => {
11691
+ return renderSlot(_ctx.$slots, "default");
11692
+ };
11693
+ }
11694
+ });
11254
11695
  var ChartPane_module_default = {
11255
11696
  statisticsChartPane: `statistics-chart-pane`,
11256
11697
  statisticsChartPaneBody: `statistics-chart-pane-body`,
@@ -11271,7 +11712,6 @@ var FluxStatisticsChartPane_default = /* @__PURE__ */ defineComponent({
11271
11712
  },
11272
11713
  setup(__props) {
11273
11714
  const slots = useSlots();
11274
- provide(FluxStatisticsChartLegendInjectionKey, createChartLegendContext());
11275
11715
  return (_ctx, _cache) => {
11276
11716
  return openBlock(), createBlock(FluxStatisticsBase_default, {
11277
11717
  class: normalizeClass(unref(ChartPane_module_default).statisticsChartPane),
@@ -11283,10 +11723,13 @@ var FluxStatisticsChartPane_default = /* @__PURE__ */ defineComponent({
11283
11723
  "--min-height": __props.minHeight && `${__props.minHeight}px`
11284
11724
  })
11285
11725
  }, createSlots({
11286
- content: withCtx(() => [createElementVNode("div", { class: normalizeClass(unref(ChartPane_module_default).statisticsChartPaneBody) }, [createElementVNode("div", { class: normalizeClass(unref(ChartPane_module_default).statisticsChartPaneContainer) }, [renderSlot(_ctx.$slots, "default")], 2), renderSlot(_ctx.$slots, "legend")], 2), slots.toolbar ? (openBlock(), createBlock(unref(FluxToolbar), { key: 0 }, {
11287
- default: withCtx(() => [renderSlot(_ctx.$slots, "toolbar")]),
11726
+ content: withCtx(() => [createVNode(FluxStatisticsLegendScope_default, null, {
11727
+ default: withCtx(() => [createElementVNode("div", { class: normalizeClass(unref(ChartPane_module_default).statisticsChartPaneBody) }, [createElementVNode("div", { class: normalizeClass(unref(ChartPane_module_default).statisticsChartPaneContainer) }, [renderSlot(_ctx.$slots, "default")], 2), renderSlot(_ctx.$slots, "legend")], 2), slots.toolbar ? (openBlock(), createBlock(unref(FluxToolbar), { key: 0 }, {
11728
+ default: withCtx(() => [renderSlot(_ctx.$slots, "toolbar")]),
11729
+ _: 3
11730
+ })) : createCommentVNode("", true)]),
11288
11731
  _: 3
11289
- })) : createCommentVNode("", true)]),
11732
+ })]),
11290
11733
  _: 2
11291
11734
  }, [slots.info ? {
11292
11735
  name: "info",
@@ -11423,7 +11866,7 @@ var FluxStatisticsDetailsTableRow_default = /* @__PURE__ */ defineComponent({
11423
11866
  var FluxStatisticsDonutChart_default = /* @__PURE__ */ defineComponent({
11424
11867
  __name: "FluxStatisticsDonutChart",
11425
11868
  props: {
11426
- advancedOptions: { default: () => ({}) },
11869
+ advancedOptions: {},
11427
11870
  slices: {},
11428
11871
  title: {},
11429
11872
  tooltip: {
@@ -11433,19 +11876,17 @@ var FluxStatisticsDonutChart_default = /* @__PURE__ */ defineComponent({
11433
11876
  tooltipValueFormatter: { type: Function }
11434
11877
  },
11435
11878
  setup(__props) {
11436
- const { t, palette, tooltipItems } = usePieSlicesSetup(() => __props.slices);
11437
- const echartsSeries = computed(() => [toDonutSeries(__props.slices, palette.value)]);
11438
- const tooltipOptions = computed(() => {
11439
- if (!__props.tooltip) return { tooltip: { show: false } };
11440
- return { tooltip: {
11441
- show: true,
11442
- trigger: "item",
11443
- formatter: buildSharedItemTooltipFormatter(t, Chart_module_default, () => tooltipItems.value, () => __props.title, __props.tooltipValueFormatter)
11444
- } };
11445
- });
11446
- const mergedOptions = computed(() => merge({}, POLAR_BASE_OPTIONS, tooltipOptions.value, __props.advancedOptions, {
11447
- series: echartsSeries.value,
11448
- color: palette.value
11879
+ const { t, palette, tooltipItems } = useChartSlicesSetup(() => __props.slices);
11880
+ const mergedOptions = computed(() => buildDonutChartOptions({
11881
+ slices: __props.slices,
11882
+ palette: palette.value,
11883
+ tooltipItems: tooltipItems.value,
11884
+ title: __props.title,
11885
+ t,
11886
+ styles: Chart_module_default,
11887
+ tooltip: __props.tooltip,
11888
+ tooltipValueFormatter: __props.tooltipValueFormatter,
11889
+ advancedOptions: __props.advancedOptions
11449
11890
  }));
11450
11891
  return (_ctx, _cache) => {
11451
11892
  return openBlock(), createBlock(FluxStatisticsChart_default, {
@@ -11533,7 +11974,7 @@ var FluxStatisticsGrid_default = /* @__PURE__ */ defineComponent({
11533
11974
  var FluxStatisticsHeatmapChart_default = /* @__PURE__ */ defineComponent({
11534
11975
  __name: "FluxStatisticsHeatmapChart",
11535
11976
  props: {
11536
- advancedOptions: { default: () => ({}) },
11977
+ advancedOptions: {},
11537
11978
  series: {},
11538
11979
  tooltip: {
11539
11980
  type: Boolean,
@@ -11551,56 +11992,18 @@ var FluxStatisticsHeatmapChart_default = /* @__PURE__ */ defineComponent({
11551
11992
  yLabels: { default: () => [] }
11552
11993
  },
11553
11994
  setup(__props) {
11554
- const { t } = useI18n({ useScope: "parent" });
11555
- const translatedXLabels = computed(() => __props.xLabels.map((label) => t(String(label))));
11556
- const translatedYLabels = computed(() => __props.yLabels.map((label) => t(String(label))));
11557
- const echartsSeries = computed(() => __props.series.map((s) => toHeatmapSeries({
11558
- ...s,
11559
- name: s.name ? t(String(s.name)) : void 0
11560
- }, __props.xLabels, __props.yLabels)));
11561
- const mergedOptions = computed(() => {
11562
- return merge({}, {
11563
- ...buildCartesianBaseOptions({
11564
- yAxisType: "category",
11565
- xAxisLabels: __props.xAxisLabels,
11566
- yAxisLabels: __props.yAxisLabels
11567
- }),
11568
- color: [ln],
11569
- visualMap: {
11570
- show: false,
11571
- min: 0,
11572
- max: 100,
11573
- inRange: { color: [
11574
- an,
11575
- sn,
11576
- ln,
11577
- dn
11578
- ] }
11579
- },
11580
- xAxis: {
11581
- type: "category",
11582
- data: translatedXLabels.value,
11583
- axisLabel: {
11584
- show: __props.xAxisLabels,
11585
- color: "var(--foreground-secondary)"
11586
- },
11587
- axisLine: { show: false },
11588
- axisTick: { show: false },
11589
- splitLine: { show: false }
11590
- },
11591
- yAxis: {
11592
- type: "category",
11593
- data: translatedYLabels.value,
11594
- axisLabel: {
11595
- show: __props.yAxisLabels,
11596
- color: "var(--foreground-secondary)"
11597
- },
11598
- axisLine: { show: false },
11599
- axisTick: { show: false },
11600
- splitLine: { show: false }
11601
- }
11602
- }, __props.tooltip ? buildHeatmapTooltipOptions(t, Chart_module_default, () => __props.series) : { tooltip: { show: false } }, __props.advancedOptions, { series: echartsSeries.value });
11603
- });
11995
+ const { t } = useChartBaseSetup();
11996
+ const mergedOptions = computed(() => buildHeatmapChartOptions({
11997
+ series: __props.series,
11998
+ xLabels: __props.xLabels,
11999
+ yLabels: __props.yLabels,
12000
+ t,
12001
+ styles: Chart_module_default,
12002
+ tooltip: __props.tooltip,
12003
+ xAxisLabels: __props.xAxisLabels,
12004
+ yAxisLabels: __props.yAxisLabels,
12005
+ advancedOptions: __props.advancedOptions
12006
+ }));
11604
12007
  return (_ctx, _cache) => {
11605
12008
  return openBlock(), createBlock(FluxStatisticsChart_default, { options: mergedOptions.value }, null, 8, ["options"]);
11606
12009
  };
@@ -11611,7 +12014,7 @@ var FluxStatisticsHeatmapChart_default = /* @__PURE__ */ defineComponent({
11611
12014
  var FluxStatisticsLineChart_default = /* @__PURE__ */ defineComponent({
11612
12015
  __name: "FluxStatisticsLineChart",
11613
12016
  props: {
11614
- advancedOptions: { default: () => ({}) },
12017
+ advancedOptions: {},
11615
12018
  labels: {},
11616
12019
  series: {},
11617
12020
  splitLines: {
@@ -11634,25 +12037,19 @@ var FluxStatisticsLineChart_default = /* @__PURE__ */ defineComponent({
11634
12037
  },
11635
12038
  setup(__props) {
11636
12039
  const { t, palette } = useChartSeriesSetup(() => __props.series);
11637
- const xLabels = computed(() => __props.labels ?? extractLabels(__props.series) ?? cartesianFallbackLabels(__props.series));
11638
- const echartsSeries = computed(() => __props.series.map((s, i) => toLineSeries({
11639
- ...s,
11640
- name: s.name ? t(String(s.name)) : void 0
11641
- }, palette.value[i])));
11642
- const mergedOptions = computed(() => {
11643
- return merge({}, buildCartesianBaseOptions({
11644
- xAxisLabels: __props.xAxisLabels,
11645
- yAxisLabels: __props.yAxisLabels,
11646
- splitLines: __props.splitLines
11647
- }), { xAxis: {
11648
- type: "category",
11649
- data: xLabels.value,
11650
- boundaryGap: false
11651
- } }, __props.tooltip ? buildCartesianTooltipOptions(t, Chart_module_default, () => __props.series.map((s) => s.icon), __props.tooltipValueFormatter) : { tooltip: { show: false } }, __props.advancedOptions, {
11652
- series: echartsSeries.value,
11653
- color: palette.value
11654
- });
11655
- });
12040
+ const mergedOptions = computed(() => buildLineChartOptions({
12041
+ series: __props.series,
12042
+ labels: __props.labels,
12043
+ palette: palette.value,
12044
+ t,
12045
+ styles: Chart_module_default,
12046
+ tooltip: __props.tooltip,
12047
+ tooltipValueFormatter: __props.tooltipValueFormatter,
12048
+ xAxisLabels: __props.xAxisLabels,
12049
+ yAxisLabels: __props.yAxisLabels,
12050
+ splitLines: __props.splitLines,
12051
+ advancedOptions: __props.advancedOptions
12052
+ }));
11656
12053
  return (_ctx, _cache) => {
11657
12054
  return openBlock(), createBlock(FluxStatisticsChart_default, {
11658
12055
  ref: "chartRef",
@@ -11708,6 +12105,7 @@ var FluxStatisticsKpi_default = /* @__PURE__ */ defineComponent({
11708
12105
  });
11709
12106
  var Legend_module_default = {
11710
12107
  statisticsLegend: `statistics-legend`,
12108
+ statisticsChartPaneBody: `statistics-chart-pane-body`,
11711
12109
  statisticsLegendItem: `statistics-legend-item`,
11712
12110
  isHovered: `is-hovered`,
11713
12111
  statisticsLegendItemColor: `statistics-legend-item-color`,
@@ -11951,7 +12349,7 @@ var FluxStatisticsMetric_default = /* @__PURE__ */ defineComponent({
11951
12349
  var FluxStatisticsMixedChart_default = /* @__PURE__ */ defineComponent({
11952
12350
  __name: "FluxStatisticsMixedChart",
11953
12351
  props: {
11954
- advancedOptions: { default: () => ({}) },
12352
+ advancedOptions: {},
11955
12353
  labels: {},
11956
12354
  series: {},
11957
12355
  splitLines: {
@@ -11974,25 +12372,19 @@ var FluxStatisticsMixedChart_default = /* @__PURE__ */ defineComponent({
11974
12372
  },
11975
12373
  setup(__props) {
11976
12374
  const { t, palette } = useChartSeriesSetup(() => __props.series);
11977
- const xLabels = computed(() => __props.labels ?? extractLabels(__props.series) ?? cartesianFallbackLabels(__props.series));
11978
- const echartsSeries = computed(() => __props.series.map((s, i) => toMixedSeries({
11979
- ...s,
11980
- name: s.name ? t(String(s.name)) : void 0
11981
- }, palette.value[i])));
11982
- const mergedOptions = computed(() => {
11983
- return merge({}, buildCartesianBaseOptions({
11984
- tooltipTrigger: "axis",
11985
- xAxisLabels: __props.xAxisLabels,
11986
- yAxisLabels: __props.yAxisLabels,
11987
- splitLines: __props.splitLines
11988
- }), { xAxis: {
11989
- type: "category",
11990
- data: xLabels.value
11991
- } }, __props.tooltip ? buildCartesianTooltipOptions(t, Chart_module_default, () => __props.series.map((s) => s.icon), __props.tooltipValueFormatter) : { tooltip: { show: false } }, __props.advancedOptions, {
11992
- series: echartsSeries.value,
11993
- color: palette.value
11994
- });
11995
- });
12375
+ const mergedOptions = computed(() => buildMixedChartOptions({
12376
+ series: __props.series,
12377
+ labels: __props.labels,
12378
+ palette: palette.value,
12379
+ t,
12380
+ styles: Chart_module_default,
12381
+ tooltip: __props.tooltip,
12382
+ tooltipValueFormatter: __props.tooltipValueFormatter,
12383
+ xAxisLabels: __props.xAxisLabels,
12384
+ yAxisLabels: __props.yAxisLabels,
12385
+ splitLines: __props.splitLines,
12386
+ advancedOptions: __props.advancedOptions
12387
+ }));
11996
12388
  return (_ctx, _cache) => {
11997
12389
  return openBlock(), createBlock(FluxStatisticsChart_default, {
11998
12390
  ref: "chartRef",
@@ -12001,12 +12393,83 @@ var FluxStatisticsMixedChart_default = /* @__PURE__ */ defineComponent({
12001
12393
  };
12002
12394
  }
12003
12395
  });
12396
+ var PercentageBar_module_default = {
12397
+ statisticsPercentageBar: `statistics-percentage-bar`,
12398
+ statisticsPercentageBarTrack: `statistics-percentage-bar-track`,
12399
+ statisticsPercentageBarSegment: `statistics-percentage-bar-segment`,
12400
+ isHovered: `is-hovered`,
12401
+ isHoverActive: `is-hover-active`,
12402
+ statisticsPercentageBarTooltip: `statistics-percentage-bar-tooltip`
12403
+ };
12404
+ //#endregion
12405
+ //#region src/component/FluxStatisticsPercentageBar.vue?vue&type=script&setup=true&lang.ts
12406
+ var _hoisted_1 = ["onMouseenter"];
12407
+ //#endregion
12408
+ //#region src/component/FluxStatisticsPercentageBar.vue
12409
+ var FluxStatisticsPercentageBar_default = /* @__PURE__ */ defineComponent({
12410
+ __name: "FluxStatisticsPercentageBar",
12411
+ props: { items: {} },
12412
+ setup(__props) {
12413
+ const SEMANTIC_COLORS = [
12414
+ "gray",
12415
+ "primary",
12416
+ "danger",
12417
+ "info",
12418
+ "success",
12419
+ "warning"
12420
+ ];
12421
+ const props = __props;
12422
+ const legendContext = inject(FluxStatisticsChartLegendInjectionKey, null);
12423
+ const legendItems = computed(() => props.items.map((item) => ({
12424
+ color: resolveColor(item.color),
12425
+ icon: item.icon,
12426
+ label: item.label,
12427
+ value: item.displayValue
12428
+ })));
12429
+ const hoveredIndex = computed(() => legendContext?.hoveredIndex.value ?? null);
12430
+ watchEffect(() => {
12431
+ if (legendContext) legendContext.items.value = legendItems.value;
12432
+ });
12433
+ function resolveColor(color) {
12434
+ if (!color) return;
12435
+ if (SEMANTIC_COLORS.includes(color)) return `var(--${color}-600)`;
12436
+ return color;
12437
+ }
12438
+ function onSegmentEnter(index) {
12439
+ if (legendContext) legendContext.hoveredIndex.value = index;
12440
+ }
12441
+ function onSegmentLeave() {
12442
+ if (legendContext) legendContext.hoveredIndex.value = null;
12443
+ }
12444
+ return (_ctx, _cache) => {
12445
+ return openBlock(), createElementBlock("div", { class: normalizeClass(unref(PercentageBar_module_default).statisticsPercentageBar) }, [createElementVNode("div", { class: normalizeClass(unref(clsx)(unref(PercentageBar_module_default).statisticsPercentageBarTrack, hoveredIndex.value !== null && unref(PercentageBar_module_default).isHoverActive)) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, index) => {
12446
+ return openBlock(), createBlock(unref(FluxTooltip), { key: index }, {
12447
+ content: withCtx(() => [createElementVNode("div", { class: normalizeClass(unref(PercentageBar_module_default).statisticsPercentageBarTooltip) }, [item.icon ? (openBlock(), createBlock(unref(FluxIcon), {
12448
+ key: 0,
12449
+ name: item.icon,
12450
+ size: 16
12451
+ }, null, 8, ["name"])) : createCommentVNode("", true), createElementVNode("span", null, toDisplayString(unref(m)(item.value)) + " " + toDisplayString(item.label), 1)], 2)]),
12452
+ default: withCtx(() => [createElementVNode("div", {
12453
+ class: normalizeClass(unref(clsx)(unref(PercentageBar_module_default).statisticsPercentageBarSegment, hoveredIndex.value === index && unref(PercentageBar_module_default).isHovered)),
12454
+ style: normalizeStyle({
12455
+ backgroundColor: resolveColor(item.color),
12456
+ flexGrow: item.value
12457
+ }),
12458
+ onMouseenter: ($event) => onSegmentEnter(index),
12459
+ onMouseleave: onSegmentLeave
12460
+ }, null, 46, _hoisted_1)]),
12461
+ _: 2
12462
+ }, 1024);
12463
+ }), 128))], 2)], 2);
12464
+ };
12465
+ }
12466
+ });
12004
12467
  //#endregion
12005
12468
  //#region src/component/FluxStatisticsPieChart.vue
12006
12469
  var FluxStatisticsPieChart_default = /* @__PURE__ */ defineComponent({
12007
12470
  __name: "FluxStatisticsPieChart",
12008
12471
  props: {
12009
- advancedOptions: { default: () => ({}) },
12472
+ advancedOptions: {},
12010
12473
  slices: {},
12011
12474
  title: {},
12012
12475
  tooltip: {
@@ -12016,19 +12479,17 @@ var FluxStatisticsPieChart_default = /* @__PURE__ */ defineComponent({
12016
12479
  tooltipValueFormatter: { type: Function }
12017
12480
  },
12018
12481
  setup(__props) {
12019
- const { t, palette, tooltipItems } = usePieSlicesSetup(() => __props.slices);
12020
- const echartsSeries = computed(() => [toPieSeries(__props.slices, palette.value)]);
12021
- const tooltipOptions = computed(() => {
12022
- if (!__props.tooltip) return { tooltip: { show: false } };
12023
- return { tooltip: {
12024
- show: true,
12025
- trigger: "item",
12026
- formatter: buildSharedItemTooltipFormatter(t, Chart_module_default, () => tooltipItems.value, () => __props.title, __props.tooltipValueFormatter)
12027
- } };
12028
- });
12029
- const mergedOptions = computed(() => merge({}, POLAR_BASE_OPTIONS, tooltipOptions.value, __props.advancedOptions, {
12030
- series: echartsSeries.value,
12031
- color: palette.value
12482
+ const { t, palette, tooltipItems } = useChartSlicesSetup(() => __props.slices);
12483
+ const mergedOptions = computed(() => buildPieChartOptions({
12484
+ slices: __props.slices,
12485
+ palette: palette.value,
12486
+ tooltipItems: tooltipItems.value,
12487
+ title: __props.title,
12488
+ t,
12489
+ styles: Chart_module_default,
12490
+ tooltip: __props.tooltip,
12491
+ tooltipValueFormatter: __props.tooltipValueFormatter,
12492
+ advancedOptions: __props.advancedOptions
12032
12493
  }));
12033
12494
  return (_ctx, _cache) => {
12034
12495
  return openBlock(), createBlock(FluxStatisticsChart_default, {
@@ -12043,7 +12504,7 @@ var FluxStatisticsPieChart_default = /* @__PURE__ */ defineComponent({
12043
12504
  var FluxStatisticsPolarAreaChart_default = /* @__PURE__ */ defineComponent({
12044
12505
  __name: "FluxStatisticsPolarAreaChart",
12045
12506
  props: {
12046
- advancedOptions: { default: () => ({}) },
12507
+ advancedOptions: {},
12047
12508
  slices: {},
12048
12509
  title: {},
12049
12510
  tooltip: {
@@ -12053,19 +12514,17 @@ var FluxStatisticsPolarAreaChart_default = /* @__PURE__ */ defineComponent({
12053
12514
  tooltipValueFormatter: { type: Function }
12054
12515
  },
12055
12516
  setup(__props) {
12056
- const { t, palette, tooltipItems } = usePieSlicesSetup(() => __props.slices);
12057
- const echartsSeries = computed(() => [toPolarAreaSeries(__props.slices, palette.value)]);
12058
- const tooltipOptions = computed(() => {
12059
- if (!__props.tooltip) return { tooltip: { show: false } };
12060
- return { tooltip: {
12061
- show: true,
12062
- trigger: "item",
12063
- formatter: buildSharedItemTooltipFormatter(t, Chart_module_default, () => tooltipItems.value, () => __props.title, __props.tooltipValueFormatter)
12064
- } };
12065
- });
12066
- const mergedOptions = computed(() => merge({}, POLAR_BASE_OPTIONS, tooltipOptions.value, __props.advancedOptions, {
12067
- series: echartsSeries.value,
12068
- color: palette.value
12517
+ const { t, palette, tooltipItems } = useChartSlicesSetup(() => __props.slices);
12518
+ const mergedOptions = computed(() => buildPolarAreaChartOptions({
12519
+ slices: __props.slices,
12520
+ palette: palette.value,
12521
+ tooltipItems: tooltipItems.value,
12522
+ title: __props.title,
12523
+ t,
12524
+ styles: Chart_module_default,
12525
+ tooltip: __props.tooltip,
12526
+ tooltipValueFormatter: __props.tooltipValueFormatter,
12527
+ advancedOptions: __props.advancedOptions
12069
12528
  }));
12070
12529
  return (_ctx, _cache) => {
12071
12530
  return openBlock(), createBlock(FluxStatisticsChart_default, {
@@ -12080,7 +12539,7 @@ var FluxStatisticsPolarAreaChart_default = /* @__PURE__ */ defineComponent({
12080
12539
  var FluxStatisticsRadarChart_default = /* @__PURE__ */ defineComponent({
12081
12540
  __name: "FluxStatisticsRadarChart",
12082
12541
  props: {
12083
- advancedOptions: { default: () => ({}) },
12542
+ advancedOptions: {},
12084
12543
  indicators: {},
12085
12544
  series: {},
12086
12545
  tooltip: {
@@ -12090,60 +12549,14 @@ var FluxStatisticsRadarChart_default = /* @__PURE__ */ defineComponent({
12090
12549
  },
12091
12550
  setup(__props) {
12092
12551
  const { t, palette } = useChartSeriesSetup(() => __props.series, { mode: "data" });
12093
- const echartsSeries = computed(() => [toRadarSeries(__props.series.map((s) => ({
12094
- ...s,
12095
- name: s.name ? t(String(s.name)) : void 0
12096
- })), palette.value)]);
12097
- const radarConfig = computed(() => ({ radar: {
12098
- indicator: __props.indicators.map((i) => ({
12099
- name: t(String(i.name)),
12100
- max: i.max
12101
- })),
12102
- splitLine: { lineStyle: { color: "var(--gray-200)" } },
12103
- splitArea: { show: false },
12104
- axisLine: { lineStyle: { color: "var(--gray-200)" } },
12105
- axisName: {
12106
- color: "var(--foreground-secondary)",
12107
- fontSize: 12,
12108
- fontWeight: 500
12109
- }
12110
- } }));
12111
- const tooltipFormatter = (params) => {
12112
- const param = Array.isArray(params) ? params[0] : params;
12113
- if (!param) return "";
12114
- const ringIndex = param.dataIndex ?? 0;
12115
- const ring = __props.series[ringIndex];
12116
- if (!ring) return "";
12117
- const styles = Chart_module_default;
12118
- const color = palette.value[ringIndex % palette.value.length];
12119
- const title = ring.name ? t(String(ring.name)) : "";
12120
- const tooltipItems = __props.indicators.map((indicator, idx) => ({
12121
- name: indicator.name,
12122
- value: ring.values[idx] ?? "",
12123
- color
12124
- }));
12125
- const titleHtml = title ? `<div class="${styles.statisticsChartTooltipTitle}">${title}</div>` : "";
12126
- const body = tooltipItems.map((item) => {
12127
- const translatedName = item.name ? t(String(item.name)) : "";
12128
- return `
12129
- <div class="${styles.statisticsChartTooltipSeriesColor} ${styles.isActive}" style="background: ${item.color}"></div>
12130
- <div class="${styles.statisticsChartTooltipSeriesName} ${styles.isActive}">${translatedName}</div>
12131
- <div class="${styles.statisticsChartTooltipSeriesValue} ${styles.isActive}">${item.value}</div>
12132
- `;
12133
- }).join("");
12134
- return `${titleHtml}<div class="${styles.statisticsChartTooltipBody}">${body}</div>`;
12135
- };
12136
- const tooltipOptions = computed(() => {
12137
- if (!__props.tooltip) return { tooltip: { show: false } };
12138
- return { tooltip: {
12139
- show: true,
12140
- trigger: "item",
12141
- formatter: tooltipFormatter
12142
- } };
12143
- });
12144
- const mergedOptions = computed(() => merge({}, POLAR_BASE_OPTIONS, radarConfig.value, tooltipOptions.value, __props.advancedOptions, {
12145
- series: echartsSeries.value,
12146
- color: palette.value
12552
+ const mergedOptions = computed(() => buildRadarChartOptions({
12553
+ series: __props.series,
12554
+ indicators: __props.indicators,
12555
+ palette: palette.value,
12556
+ t,
12557
+ styles: Chart_module_default,
12558
+ tooltip: __props.tooltip,
12559
+ advancedOptions: __props.advancedOptions
12147
12560
  }));
12148
12561
  return (_ctx, _cache) => {
12149
12562
  return openBlock(), createBlock(FluxStatisticsChart_default, {
@@ -12158,7 +12571,7 @@ var FluxStatisticsRadarChart_default = /* @__PURE__ */ defineComponent({
12158
12571
  var FluxStatisticsRadialBar_default = /* @__PURE__ */ defineComponent({
12159
12572
  __name: "FluxStatisticsRadialBar",
12160
12573
  props: {
12161
- advancedOptions: { default: () => ({}) },
12574
+ advancedOptions: {},
12162
12575
  series: {},
12163
12576
  tooltip: {
12164
12577
  type: Boolean,
@@ -12166,22 +12579,15 @@ var FluxStatisticsRadialBar_default = /* @__PURE__ */ defineComponent({
12166
12579
  }
12167
12580
  },
12168
12581
  setup(__props) {
12169
- const { t, palette } = useChartSeriesSetup(() => __props.series, { getLegendItem: (s, color, _, translate) => ({
12170
- color,
12171
- icon: s.icon,
12172
- label: s.name ? translate(String(s.name)) : "",
12173
- value: s.value
12174
- }) });
12175
- const echartsSeries = computed(() => __props.series.map((s, i) => toGaugeSeries({
12176
- ...s,
12177
- name: s.name ? t(String(s.name)) : s.name
12178
- }, palette.value[i], i, __props.series.length)));
12179
- const mergedOptions = computed(() => {
12180
- return merge({}, POLAR_BASE_OPTIONS, __props.tooltip ? buildGaugeTooltipOptions(t, Chart_module_default, () => __props.series, () => palette.value) : { tooltip: { show: false } }, __props.advancedOptions, {
12181
- series: echartsSeries.value,
12182
- color: palette.value
12183
- });
12184
- });
12582
+ const { t, palette } = useChartSeriesSetup(() => __props.series, { getLegendItem: gaugeLegendItemBuilder });
12583
+ const mergedOptions = computed(() => buildGaugeChartOptions({
12584
+ series: __props.series,
12585
+ palette: palette.value,
12586
+ t,
12587
+ styles: Chart_module_default,
12588
+ tooltip: __props.tooltip,
12589
+ advancedOptions: __props.advancedOptions
12590
+ }));
12185
12591
  return (_ctx, _cache) => {
12186
12592
  return openBlock(), createBlock(FluxStatisticsChart_default, {
12187
12593
  ref: "chartRef",
@@ -12195,7 +12601,7 @@ var FluxStatisticsRadialBar_default = /* @__PURE__ */ defineComponent({
12195
12601
  var FluxStatisticsScatterChart_default = /* @__PURE__ */ defineComponent({
12196
12602
  __name: "FluxStatisticsScatterChart",
12197
12603
  props: {
12198
- advancedOptions: { default: () => ({}) },
12604
+ advancedOptions: {},
12199
12605
  series: {},
12200
12606
  splitLines: {
12201
12607
  type: Boolean,
@@ -12216,23 +12622,17 @@ var FluxStatisticsScatterChart_default = /* @__PURE__ */ defineComponent({
12216
12622
  },
12217
12623
  setup(__props) {
12218
12624
  const { t, palette } = useChartSeriesSetup(() => __props.series);
12219
- const echartsSeries = computed(() => __props.series.map((s, i) => toScatterSeries({
12220
- ...s,
12221
- name: s.name ? t(String(s.name)) : void 0
12222
- }, palette.value[i])));
12223
- const mergedOptions = computed(() => {
12224
- return merge({}, buildCartesianBaseOptions({
12225
- xAxisType: "value",
12226
- yAxisType: "value",
12227
- scale: true,
12228
- xAxisLabels: __props.xAxisLabels,
12229
- yAxisLabels: __props.yAxisLabels,
12230
- splitLines: __props.splitLines
12231
- }), __props.tooltip ? buildCartesianTooltipOptions(t, Chart_module_default, () => __props.series.map((s) => s.icon)) : { tooltip: { show: false } }, __props.advancedOptions, {
12232
- series: echartsSeries.value,
12233
- color: palette.value
12234
- });
12235
- });
12625
+ const mergedOptions = computed(() => buildScatterChartOptions({
12626
+ series: __props.series,
12627
+ palette: palette.value,
12628
+ t,
12629
+ styles: Chart_module_default,
12630
+ tooltip: __props.tooltip,
12631
+ xAxisLabels: __props.xAxisLabels,
12632
+ yAxisLabels: __props.yAxisLabels,
12633
+ splitLines: __props.splitLines,
12634
+ advancedOptions: __props.advancedOptions
12635
+ }));
12236
12636
  return (_ctx, _cache) => {
12237
12637
  return openBlock(), createBlock(FluxStatisticsChart_default, {
12238
12638
  ref: "chartRef",
@@ -12293,7 +12693,7 @@ var FluxStatisticsSparkline_default = /* @__PURE__ */ defineComponent({
12293
12693
  var FluxStatisticsTreemapChart_default = /* @__PURE__ */ defineComponent({
12294
12694
  __name: "FluxStatisticsTreemapChart",
12295
12695
  props: {
12296
- advancedOptions: { default: () => ({}) },
12696
+ advancedOptions: {},
12297
12697
  nodes: {},
12298
12698
  tooltip: {
12299
12699
  type: Boolean,
@@ -12301,11 +12701,14 @@ var FluxStatisticsTreemapChart_default = /* @__PURE__ */ defineComponent({
12301
12701
  }
12302
12702
  },
12303
12703
  setup(__props) {
12304
- const { t } = useI18n({ useScope: "parent" });
12305
- const echartsSeries = computed(() => [toTreemapSeries(__props.nodes, CHART_DEFAULT_COLORS)]);
12306
- const mergedOptions = computed(() => {
12307
- return merge({}, POLAR_BASE_OPTIONS, __props.tooltip ? buildTreemapTooltipOptions(t, Chart_module_default) : { tooltip: { show: false } }, __props.advancedOptions, { series: echartsSeries.value });
12308
- });
12704
+ const { t } = useChartBaseSetup();
12705
+ const mergedOptions = computed(() => buildTreemapChartOptions({
12706
+ nodes: __props.nodes,
12707
+ t,
12708
+ styles: Chart_module_default,
12709
+ tooltip: __props.tooltip,
12710
+ advancedOptions: __props.advancedOptions
12711
+ }));
12309
12712
  return (_ctx, _cache) => {
12310
12713
  return openBlock(), createBlock(FluxStatisticsChart_default, { options: mergedOptions.value }, null, 8, ["options"]);
12311
12714
  };
@@ -12339,6 +12742,6 @@ var CHART_COLORFUL_COLORS = [
12339
12742
  gr
12340
12743
  ];
12341
12744
  //#endregion
12342
- export { CHART_COLORFUL_COLORS, CHART_COLORS, FluxStatisticsAreaChart_default as FluxStatisticsAreaChart, FluxStatisticsBarChart_default as FluxStatisticsBarChart, FluxStatisticsBase_default as FluxStatisticsBase, FluxStatisticsBoxPlotChart_default as FluxStatisticsBoxPlotChart, FluxStatisticsBubbleChart_default as FluxStatisticsBubbleChart, FluxStatisticsCandlestickChart_default as FluxStatisticsCandlestickChart, FluxStatisticsChange_default as FluxStatisticsChange, FluxStatisticsChart_default as FluxStatisticsChart, FluxStatisticsChartLegendInjectionKey, FluxStatisticsChartPane_default as FluxStatisticsChartPane, FluxStatisticsComparison_default as FluxStatisticsComparison, FluxStatisticsDetailsTable_default as FluxStatisticsDetailsTable, FluxStatisticsDetailsTableRow_default as FluxStatisticsDetailsTableRow, FluxStatisticsDonutChart_default as FluxStatisticsDonutChart, FluxStatisticsEmpty_default as FluxStatisticsEmpty, FluxStatisticsGrid_default as FluxStatisticsGrid, FluxStatisticsHeatmapChart_default as FluxStatisticsHeatmapChart, FluxStatisticsKpi_default as FluxStatisticsKpi, FluxStatisticsLegend_default as FluxStatisticsLegend, FluxStatisticsLegendItem_default as FluxStatisticsLegendItem, FluxStatisticsLineChart_default as FluxStatisticsLineChart, FluxStatisticsMeter_default as FluxStatisticsMeter, FluxStatisticsMetric_default as FluxStatisticsMetric, FluxStatisticsMixedChart_default as FluxStatisticsMixedChart, FluxStatisticsPieChart_default as FluxStatisticsPieChart, FluxStatisticsPolarAreaChart_default as FluxStatisticsPolarAreaChart, FluxStatisticsRadarChart_default as FluxStatisticsRadarChart, FluxStatisticsRadialBar_default as FluxStatisticsRadialBar, FluxStatisticsScatterChart_default as FluxStatisticsScatterChart, FluxStatisticsSparkline_default as FluxStatisticsSparkline, FluxStatisticsTreemapChart_default as FluxStatisticsTreemapChart, createChartLegendContext, useChartHoverSync, useChartSeriesSetup, useECharts, usePieSlicesSetup };
12745
+ export { CHART_COLORFUL_COLORS, CHART_COLORS, FluxStatisticsAreaChart_default as FluxStatisticsAreaChart, FluxStatisticsBarChart_default as FluxStatisticsBarChart, FluxStatisticsBase_default as FluxStatisticsBase, FluxStatisticsBoxPlotChart_default as FluxStatisticsBoxPlotChart, FluxStatisticsBubbleChart_default as FluxStatisticsBubbleChart, FluxStatisticsCandlestickChart_default as FluxStatisticsCandlestickChart, FluxStatisticsChange_default as FluxStatisticsChange, FluxStatisticsChart_default as FluxStatisticsChart, FluxStatisticsChartLegendInjectionKey, FluxStatisticsChartPane_default as FluxStatisticsChartPane, FluxStatisticsComparison_default as FluxStatisticsComparison, FluxStatisticsDetailsTable_default as FluxStatisticsDetailsTable, FluxStatisticsDetailsTableRow_default as FluxStatisticsDetailsTableRow, FluxStatisticsDonutChart_default as FluxStatisticsDonutChart, FluxStatisticsEmpty_default as FluxStatisticsEmpty, FluxStatisticsGrid_default as FluxStatisticsGrid, FluxStatisticsHeatmapChart_default as FluxStatisticsHeatmapChart, FluxStatisticsKpi_default as FluxStatisticsKpi, FluxStatisticsLegend_default as FluxStatisticsLegend, FluxStatisticsLegendItem_default as FluxStatisticsLegendItem, FluxStatisticsLegendScope_default as FluxStatisticsLegendScope, FluxStatisticsLineChart_default as FluxStatisticsLineChart, FluxStatisticsMeter_default as FluxStatisticsMeter, FluxStatisticsMetric_default as FluxStatisticsMetric, FluxStatisticsMixedChart_default as FluxStatisticsMixedChart, FluxStatisticsPercentageBar_default as FluxStatisticsPercentageBar, FluxStatisticsPieChart_default as FluxStatisticsPieChart, FluxStatisticsPolarAreaChart_default as FluxStatisticsPolarAreaChart, FluxStatisticsRadarChart_default as FluxStatisticsRadarChart, FluxStatisticsRadialBar_default as FluxStatisticsRadialBar, FluxStatisticsScatterChart_default as FluxStatisticsScatterChart, FluxStatisticsSparkline_default as FluxStatisticsSparkline, FluxStatisticsTreemapChart_default as FluxStatisticsTreemapChart, createChartLegendContext, useChartBaseSetup, useChartHoverSync, useChartSeriesSetup, useChartSlicesSetup, useECharts };
12343
12746
 
12344
12747
  //# sourceMappingURL=index.js.map