vue-data-ui 3.0.0-next.7 → 3.0.0-next.71

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 (137) hide show
  1. package/dist/{Arrow-Bl8urcli.js → Arrow-BZNpld6u.js} +1 -1
  2. package/dist/{BaseDraggableDialog-CyhpaZU5.js → BaseDraggableDialog-kg-eVvXZ.js} +2 -2
  3. package/dist/{BaseIcon-BCZfTCeM.js → BaseIcon-BdOEhJar.js} +1 -1
  4. package/dist/{ColorPicker-CSJf42vx.js → ColorPicker-CWvXlPxS.js} +2 -2
  5. package/dist/{DataTable-mQ6Wd-rR.js → DataTable-B3yakHEM.js} +2 -2
  6. package/dist/{Legend-B2hrDh4G.js → Legend-DiGLrlzP.js} +2 -2
  7. package/dist/{NonSvgPenAndPaper-DQ8KsK4W.js → NonSvgPenAndPaper-C-ZjpJQd.js} +3 -3
  8. package/dist/{PackageVersion-CeEYZfaH.js → PackageVersion-6s4eI8W7.js} +1 -1
  9. package/dist/{PenAndPaper-DhSxfUrQ.js → PenAndPaper-JoUN7Ink.js} +3 -3
  10. package/dist/{Shape-C2qH26wh.js → Shape-CWIa2nta.js} +43 -37
  11. package/dist/Slicer-DYuvPkEM.js +602 -0
  12. package/dist/{SparkTooltip-BcHgW6YX.js → SparkTooltip-C_fUmbP7.js} +1 -1
  13. package/dist/{Title-B7Xb3YuE.js → Title-VLWyIYrj.js} +1 -1
  14. package/dist/{Tooltip-BidRoM5E.js → Tooltip-BS5naLS2.js} +23 -19
  15. package/dist/{UserOptions-0tvMM8PF.js → UserOptions-BV_xM-sB.js} +2 -2
  16. package/dist/{dom-to-png-CTrlbKHr.js → dom-to-png-PUk0ukSG.js} +1 -1
  17. package/dist/{img-D72yZNUg.js → img-DD_2wgY3.js} +1 -1
  18. package/dist/{index-Cg-RjxqH.js → index-DKpp7RIH.js} +2236 -1505
  19. package/dist/{pdf-DgX01_wu.js → pdf-0TQQyXWM.js} +1 -1
  20. package/dist/style.css +1 -1
  21. package/dist/types/vue-data-ui.d.cts +610 -22
  22. package/dist/types/vue-data-ui.d.ts +610 -22
  23. package/dist/useAutoSizeLabelsInsideViewbox-Qhry5WvH.js +81 -0
  24. package/dist/useFitSvgText-2crs6Fv5.js +69 -0
  25. package/dist/useLoading-D7YHNtLX.js +29 -0
  26. package/dist/useNestedProp-D-8c0o4p.js +13 -0
  27. package/dist/usePanZoom-BVca3eMk.js +122 -0
  28. package/dist/{usePrinter-BUzmyQf9.js → usePrinter-NUeckmCX.js} +2 -2
  29. package/dist/useTimeLabelCollider-CIsgDrl9.js +78 -0
  30. package/dist/{useTimeLabels-Mrr0jrpL.js → useTimeLabels-DkzmKfZn.js} +211 -152
  31. package/dist/{vue-data-ui-DpO93ey5.js → vue-data-ui-BIXXEsFZ.js} +105 -100
  32. package/dist/vue-data-ui.js +23 -22
  33. package/dist/vue-ui-3d-bar-CVUfj12F.js +1323 -0
  34. package/dist/{vue-ui-accordion-CRomxzaL.js → vue-ui-accordion-Cpovz3RE.js} +3 -3
  35. package/dist/vue-ui-age-pyramid-CQWFaHLV.js +834 -0
  36. package/dist/{vue-ui-annotator-BAOxPiFx.js → vue-ui-annotator-C49Xw5Mh.js} +2 -2
  37. package/dist/vue-ui-bullet-DED2SuIa.js +571 -0
  38. package/dist/vue-ui-candlestick-DGgbevy6.js +999 -0
  39. package/dist/{vue-ui-carousel-table-DVGlPZIa.js → vue-ui-carousel-table-DKIgSB1T.js} +29 -29
  40. package/dist/{vue-ui-chestnut-P1v4ffD0.js → vue-ui-chestnut-D1bEM91d.js} +5 -5
  41. package/dist/vue-ui-chord-CBLSqtEP.js +1038 -0
  42. package/dist/{vue-ui-circle-pack-FXmemXgl.js → vue-ui-circle-pack-g2ts9NTG.js} +24 -24
  43. package/dist/{vue-ui-cursor-CdvMgIrP.js → vue-ui-cursor-DSxmPUD8.js} +2 -2
  44. package/dist/{vue-ui-dashboard-Vke0452J.js → vue-ui-dashboard-B6FfoNjQ.js} +62 -62
  45. package/dist/{vue-ui-digits-BVhyYqCs.js → vue-ui-digits-DKffQVgr.js} +2 -2
  46. package/dist/{vue-ui-donut-BpIivKcf.js → vue-ui-donut-CJrWc4-g.js} +320 -308
  47. package/dist/vue-ui-donut-evolution-Bys6cs-D.js +1075 -0
  48. package/dist/vue-ui-dumbbell-Cb_I__qC.js +1119 -0
  49. package/dist/vue-ui-flow-BzuT3ij5.js +841 -0
  50. package/dist/{vue-ui-funnel-BbFmbsft.js → vue-ui-funnel-Ctp7GDiN.js} +16 -16
  51. package/dist/vue-ui-galaxy-CRBy0aio.js +680 -0
  52. package/dist/vue-ui-gauge-NcQq5UFr.js +791 -0
  53. package/dist/vue-ui-gizmo-Cwfb8c-0.js +210 -0
  54. package/dist/vue-ui-heatmap-DElqpFVY.js +1078 -0
  55. package/dist/vue-ui-history-plot-De1Dvnhw.js +1073 -0
  56. package/dist/{vue-ui-kpi-jN_yMnLj.js → vue-ui-kpi-_bLScmgO.js} +26 -26
  57. package/dist/{vue-ui-mini-loader-rYr76x8g.js → vue-ui-mini-loader-PsHE_2Wy.js} +2 -2
  58. package/dist/{vue-ui-molecule-BWZHOQLi.js → vue-ui-molecule-CgiahnC6.js} +53 -51
  59. package/dist/vue-ui-mood-radar-dXVOOrhl.js +785 -0
  60. package/dist/vue-ui-nested-donuts-C0X6BetT.js +1286 -0
  61. package/dist/vue-ui-onion-C7sxQzk_.js +776 -0
  62. package/dist/vue-ui-parallel-coordinate-plot-jwtnNX59.js +915 -0
  63. package/dist/{vue-ui-quadrant-BFFzfDw3.js → vue-ui-quadrant-DguDE91h.js} +512 -459
  64. package/dist/vue-ui-quick-chart-BpEDS08U.js +1761 -0
  65. package/dist/vue-ui-radar-lFrqTRqo.js +796 -0
  66. package/dist/{vue-ui-rating-BAauyqTn.js → vue-ui-rating-BHghXziv.js} +2 -2
  67. package/dist/vue-ui-relation-circle-C5W6NFOb.js +598 -0
  68. package/dist/vue-ui-ridgeline-A2DuFEDS.js +1153 -0
  69. package/dist/vue-ui-rings-BgJAm9_b.js +728 -0
  70. package/dist/vue-ui-scatter-COfpLChz.js +1178 -0
  71. package/dist/{vue-ui-skeleton-CUOhCY4p.js → vue-ui-skeleton-DMLCBUtZ.js} +3 -3
  72. package/dist/{vue-ui-smiley-B6SqWMov.js → vue-ui-smiley-ZopESYc_.js} +26 -26
  73. package/dist/vue-ui-spark-trend-CuSQ03fQ.js +315 -0
  74. package/dist/vue-ui-sparkbar-BCsX9M4q.js +351 -0
  75. package/dist/vue-ui-sparkgauge-DdyZLA0T.js +232 -0
  76. package/dist/vue-ui-sparkhistogram-CUxFgIcE.js +380 -0
  77. package/dist/vue-ui-sparkline-DOkofsLL.js +489 -0
  78. package/dist/vue-ui-sparkstackbar-Bq9PZzmH.js +421 -0
  79. package/dist/vue-ui-stackbar-B7ceoT0V.js +1370 -0
  80. package/dist/vue-ui-strip-plot-DYh-NGQN.js +915 -0
  81. package/dist/{vue-ui-table-heatmap-DazTE3fa.js → vue-ui-table-heatmap-BVTb1xuA.js} +5 -5
  82. package/dist/{vue-ui-table-Dwjl3L0p.js → vue-ui-table-pESH5KAJ.js} +11 -11
  83. package/dist/{vue-ui-table-sparkline-BXMPUEpN.js → vue-ui-table-sparkline-Bw-6l9lA.js} +14 -14
  84. package/dist/vue-ui-thermometer-BqqfmS-B.js +541 -0
  85. package/dist/{vue-ui-timer-yLvNAZL_.js → vue-ui-timer-CVisMxLS.js} +5 -5
  86. package/dist/vue-ui-tiremarks-K1dcCdpj.js +406 -0
  87. package/dist/vue-ui-treemap-Bz3c68s4.js +1035 -0
  88. package/dist/{vue-ui-vertical-bar-BrYCoVym.js → vue-ui-vertical-bar-BvtXpCjw.js} +71 -69
  89. package/dist/vue-ui-waffle-CYO7bIf1.js +910 -0
  90. package/dist/vue-ui-wheel-De1spwLh.js +379 -0
  91. package/dist/vue-ui-word-cloud-BMmVrx_T.js +765 -0
  92. package/dist/{vue-ui-world-B4Dqrk4l.js → vue-ui-world-Ccpr00nJ.js} +11 -9
  93. package/dist/vue-ui-xy-D4jaRKe3.js +3771 -0
  94. package/dist/{vue-ui-xy-canvas-D7fL36kT.js → vue-ui-xy-canvas-DE-Uu5oq.js} +265 -264
  95. package/package.json +1 -1
  96. package/dist/Slicer-BD8Z8VCW.js +0 -577
  97. package/dist/useLoading-Bt5Doa8m.js +0 -28
  98. package/dist/useNestedProp-C_G5E08Y.js +0 -13
  99. package/dist/usePanZoom-BQMvRXEQ.js +0 -115
  100. package/dist/vue-ui-3d-bar-D8imUwEz.js +0 -1227
  101. package/dist/vue-ui-age-pyramid-CV7gtFOC.js +0 -746
  102. package/dist/vue-ui-bullet-BtuMMBF7.js +0 -513
  103. package/dist/vue-ui-candlestick-BsRtXKrv.js +0 -873
  104. package/dist/vue-ui-chord-CIuzYmpM.js +0 -949
  105. package/dist/vue-ui-donut-evolution-BRlsCA4U.js +0 -903
  106. package/dist/vue-ui-dumbbell-D87Dumjh.js +0 -753
  107. package/dist/vue-ui-flow-D_L_xssL.js +0 -765
  108. package/dist/vue-ui-galaxy-Cn6vHbaw.js +0 -617
  109. package/dist/vue-ui-gauge-Ds4terqY.js +0 -738
  110. package/dist/vue-ui-gizmo-BTncpI62.js +0 -192
  111. package/dist/vue-ui-heatmap-B6GpjeWC.js +0 -877
  112. package/dist/vue-ui-history-plot-DTDzEeGq.js +0 -924
  113. package/dist/vue-ui-mood-radar-CPfS6f1L.js +0 -670
  114. package/dist/vue-ui-nested-donuts-Bsd2kGoJ.js +0 -1177
  115. package/dist/vue-ui-onion-BQ4nISXW.js +0 -701
  116. package/dist/vue-ui-parallel-coordinate-plot-BoHgVgbn.js +0 -807
  117. package/dist/vue-ui-quick-chart-oNMTeOAL.js +0 -1612
  118. package/dist/vue-ui-radar-98mXFZe-.js +0 -741
  119. package/dist/vue-ui-relation-circle-6oDCSxkO.js +0 -542
  120. package/dist/vue-ui-ridgeline-CugMGjOU.js +0 -969
  121. package/dist/vue-ui-rings-bsGXaD2m.js +0 -685
  122. package/dist/vue-ui-scatter-7ssLliGg.js +0 -1045
  123. package/dist/vue-ui-spark-trend-jauInkkN.js +0 -291
  124. package/dist/vue-ui-sparkbar-DXByIxQH.js +0 -301
  125. package/dist/vue-ui-sparkgauge-BMrV2gDi.js +0 -201
  126. package/dist/vue-ui-sparkhistogram-CoNM4G7o.js +0 -313
  127. package/dist/vue-ui-sparkline-DrN3_wS0.js +0 -459
  128. package/dist/vue-ui-sparkstackbar-W1a0JQi9.js +0 -381
  129. package/dist/vue-ui-stackbar-D1-gbUgE.js +0 -1207
  130. package/dist/vue-ui-strip-plot-KhfvrVuN.js +0 -761
  131. package/dist/vue-ui-thermometer-Cn6lJRs3.js +0 -495
  132. package/dist/vue-ui-tiremarks-BYsWePfK.js +0 -358
  133. package/dist/vue-ui-treemap-Ce7RVFG3.js +0 -965
  134. package/dist/vue-ui-waffle-CCrR2T1G.js +0 -863
  135. package/dist/vue-ui-wheel-BuxjnrDN.js +0 -352
  136. package/dist/vue-ui-word-cloud-C6fawHJE.js +0 -659
  137. package/dist/vue-ui-xy-ubRnv9iJ.js +0 -2980
@@ -0,0 +1,489 @@
1
+ import { defineAsyncComponent as le, computed as h, ref as g, toRefs as $e, watch as ue, shallowRef as oe, onMounted as Ce, onBeforeUnmount as Me, createElementBlock as d, openBlock as r, normalizeStyle as V, renderSlot as M, createCommentVNode as y, createBlock as se, normalizeProps as ne, guardReactiveProps as re, createElementVNode as f, toDisplayString as z, unref as i, createVNode as Ie, Fragment as G, renderList as U, withCtx as Se, createTextVNode as Ve, nextTick as ze } from "vue";
2
+ import { u as De, c as We, t as Pe, b as Re, C as ie, a7 as j, o as ve, f as de, g as Te, x as D, a8 as Ee, a9 as Oe, X as Be, s as W, V as ce, U as Fe, aa as he, k as X, i as Y, ab as Ge } from "./index-DKpp7RIH.js";
3
+ import { u as ye } from "./useNestedProp-D-8c0o4p.js";
4
+ import { t as Ue, u as je } from "./useResponsive-DfdjqQps.js";
5
+ import { u as Xe } from "./useChartAccessibility-9icAAmYg.js";
6
+ import { u as Ye, B as qe } from "./useLoading-D7YHNtLX.js";
7
+ import { u as Ze } from "./useTimeLabels-DkzmKfZn.js";
8
+ import { _ as He } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
+ const Je = ["id"], Ke = ["xmlns", "viewBox"], Qe = ["width", "height"], et = ["id"], tt = ["stop-color"], at = ["stop-color"], lt = ["id"], ut = ["stop-color"], ot = ["stop-color"], st = ["id"], nt = ["stop-color"], rt = ["stop-color"], it = { key: 1 }, vt = ["d", "fill"], dt = ["d", "fill"], ct = ["d", "stroke", "stroke-width"], ht = ["d", "stroke", "stroke-width"], yt = ["x", "y", "width", "height", "fill", "rx"], ft = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], pt = ["x1", "x2", "y1", "y2", "stroke", "stroke-dasharray", "stroke-width"], gt = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], bt = ["x", "y", "font-size", "font-weight", "fill"], mt = ["x", "y", "height", "width", "onMouseenter", "onMouseleave", "onClick"], kt = {
10
+ __name: "vue-ui-sparkline",
11
+ props: {
12
+ config: {
13
+ type: Object,
14
+ default() {
15
+ return {};
16
+ }
17
+ },
18
+ dataset: {
19
+ type: Array,
20
+ default() {
21
+ return [];
22
+ }
23
+ },
24
+ showInfo: {
25
+ type: Boolean,
26
+ default: !0
27
+ },
28
+ selectedIndex: {
29
+ type: Number,
30
+ default: void 0
31
+ },
32
+ heightRatio: {
33
+ type: Number,
34
+ default: 1
35
+ },
36
+ forcedPadding: {
37
+ type: Number,
38
+ default: 30
39
+ }
40
+ },
41
+ emits: ["hoverIndex", "selectDatapoint"],
42
+ setup(_, { emit: fe }) {
43
+ const pe = le(() => import("./PackageVersion-6s4eI8W7.js")), ge = le(() => import("./SparkTooltip-C_fUmbP7.js")), { vue_ui_sparkline: be } = De(), n = _, q = h(() => Array.isArray(n.dataset) && n.dataset.length > 0), p = g(We()), P = g(null), Z = g(null), H = g(null), e = g(E());
44
+ function me(t) {
45
+ return Ge(t).map((a) => ({ period: "-", value: a }));
46
+ }
47
+ const { loading: R, FINAL_DATASET: I, manualLoading: T } = Ye({
48
+ ...$e(n),
49
+ FINAL_CONFIG: e,
50
+ prepareConfig: E,
51
+ callback: () => {
52
+ Promise.resolve().then(async () => {
53
+ await ze(), K();
54
+ });
55
+ },
56
+ skeletonDataset: me(12),
57
+ skeletonConfig: Pe({
58
+ defaultConfig: e.value,
59
+ userConfig: {
60
+ style: {
61
+ backgroundColor: "#99999930",
62
+ scaleMin: 0,
63
+ scaleMax: 89,
64
+ animation: { show: !1 },
65
+ line: { color: "#AAAAAA" },
66
+ bar: { color: "#AAAAAA" },
67
+ area: { color: "#CACACA" },
68
+ zeroLine: { color: "#6A6A6A" },
69
+ dataLabel: { show: !1 },
70
+ tooltip: { show: !1 }
71
+ }
72
+ }
73
+ })
74
+ }), { svgRef: J } = Xe({ config: e.value.style.title });
75
+ function E() {
76
+ const t = ye({
77
+ userConfig: n.config,
78
+ defaultConfig: be
79
+ });
80
+ let a = {};
81
+ return t.theme ? a = {
82
+ ...ye({
83
+ userConfig: Re.vue_ui_sparkline[t.theme] || n.config,
84
+ defaultConfig: t
85
+ })
86
+ } : a = t, n.config && ie(n.config, "style.scaleMin") ? a.style.scaleMin = n.config.style.scaleMin : a.style.scaleMin = null, n.config && ie(n.config, "style.scaleMax") ? a.style.scaleMax = n.config.style.scaleMax : a.style.scaleMax = null, a;
87
+ }
88
+ const k = h(() => j({
89
+ data: I.value,
90
+ threshold: e.value.downsample.threshold
91
+ }));
92
+ ue(() => n.config, (t) => {
93
+ R.value || (e.value = E()), ee(), u.value.chartWidth = e.value.style.chartWidth;
94
+ }, { deep: !0 }), ue(() => n.dataset, (t) => {
95
+ Array.isArray(t) && t.length > 0 && (T.value = !1), x.value = j({
96
+ data: I.value.map((a) => ({
97
+ ...a,
98
+ value: [void 0].includes(a.value) ? null : a.value
99
+ })),
100
+ threshold: e.value.downsample.threshold
101
+ });
102
+ }, { deep: !0 });
103
+ const x = g(ke());
104
+ function ke() {
105
+ return j({
106
+ data: I.value.map((t) => e.value.style.animation.show && I.value.length > 1 ? {
107
+ ...t,
108
+ value: null
109
+ } : {
110
+ ...t,
111
+ value: [void 0].includes(t.value) ? null : t.value
112
+ }),
113
+ threshold: e.value.downsample.threshold
114
+ });
115
+ }
116
+ const b = oe(null), L = oe(null);
117
+ function K() {
118
+ if (e.value.style.animation.show && n.dataset.length > 1 && !R.value) {
119
+ let l = function() {
120
+ a < k.value.length ? (x.value.push(k.value[a]), setTimeout(() => {
121
+ requestAnimationFrame(l);
122
+ }, t)) : x.value = k.value, a += 1;
123
+ };
124
+ x.value = [];
125
+ const t = e.value.style.animation.animationFrames / n.dataset.length;
126
+ let a = 0;
127
+ l();
128
+ }
129
+ }
130
+ Ce(() => {
131
+ ee(), K();
132
+ });
133
+ const Q = h(() => !!e.value.debug);
134
+ function ee() {
135
+ if (ve(n.dataset) ? (de({
136
+ componentName: "VueUiSparkline",
137
+ type: "dataset",
138
+ debug: Q.value
139
+ }), T.value = !0) : n.dataset.forEach((t, a) => {
140
+ Te({
141
+ datasetObject: t,
142
+ requiredAttributes: ["period", "value"]
143
+ }).forEach((l) => {
144
+ de({
145
+ componentName: "VueUiSparkline",
146
+ type: "datasetSerieAttribute",
147
+ property: l,
148
+ index: a,
149
+ debug: Q.value
150
+ });
151
+ });
152
+ }), ve(n.dataset) || (T.value = e.value.loading), e.value.responsive) {
153
+ const t = Ue(() => {
154
+ const { width: a, height: l } = je({
155
+ chart: P.value,
156
+ title: e.value.style.title.show && n.showInfo ? Z.value : null,
157
+ source: H.value
158
+ });
159
+ requestAnimationFrame(() => {
160
+ u.value.width = a, u.value.height = l, u.value.chartWidth = e.value.style.chartWidth / 500 * a, u.value.padding = n.forcedPadding / 500 * a;
161
+ });
162
+ });
163
+ b.value && (L.value && b.value.unobserve(L.value), b.value.disconnect()), b.value = new ResizeObserver(t), L.value = P.value.parentNode, b.value.observe(L.value);
164
+ }
165
+ }
166
+ Me(() => {
167
+ b.value && (L.value && b.value.unobserve(L.value), b.value.disconnect());
168
+ });
169
+ const u = g({
170
+ height: 80 * n.heightRatio,
171
+ width: 500,
172
+ chartWidth: e.value.style.chartWidth,
173
+ padding: n.forcedPadding
174
+ }), O = fe, o = h(() => {
175
+ const { top: t, right: a, bottom: l, left: s } = e.value.style.padding;
176
+ return {
177
+ top: t,
178
+ left: s,
179
+ right: u.value.width - a,
180
+ bottom: u.value.height - l,
181
+ start: n.showInfo && e.value.style.dataLabel.show && e.value.style.dataLabel.position === "left" ? u.value.width - u.value.chartWidth + s : u.value.padding + s,
182
+ width: n.showInfo && e.value.style.dataLabel.show ? u.value.chartWidth - s - a : u.value.width - u.value.padding - s - a,
183
+ height: u.value.height - t - l
184
+ };
185
+ }), B = h(() => [null, void 0].includes(e.value.style.scaleMin) ? Math.min(...x.value.map((t) => isNaN(t.value) || [void 0, null, "NaN", NaN, 1 / 0, -1 / 0].includes(t.value) ? 0 : t.value || 0)) : e.value.style.scaleMin), xe = h(() => [null, void 0].includes(e.value.style.scaleMax) ? Math.max(...x.value.map((t) => isNaN(t.value) || [void 0, null, "NaN", NaN, 1 / 0, -1 / 0].includes(t.value) ? 0 : t.value || 0)) : e.value.style.scaleMax), $ = h(() => {
186
+ const t = B.value >= 0 ? 0 : B.value;
187
+ return Math.abs(t);
188
+ }), te = h(() => xe.value + $.value), A = h(() => o.value.bottom - o.value.height * F($.value));
189
+ function F(t) {
190
+ return isNaN(t / te.value) ? 0 : t / te.value;
191
+ }
192
+ const w = h(() => k.value.length - 1), S = h(() => Ze({
193
+ values: k.value.map((t) => t.period),
194
+ maxDatapoints: k.value.length,
195
+ formatter: e.value.style.dataLabel.datetimeFormatter,
196
+ start: 0,
197
+ end: k.value.length
198
+ })), c = h(() => x.value.map((t, a) => {
199
+ const l = isNaN(t.value) || [void 0, null, "NaN", NaN, 1 / 0, -1 / 0].includes(t.value) ? 0 : t.value || 0, s = o.value.width / (w.value + 1) > u.padding ? u.padding : o.value.width / (w.value + 1);
200
+ return {
201
+ absoluteValue: l,
202
+ period: S.value && S.value[a] && S.value[a].text ? S.value[a].text : t.period,
203
+ plotValue: l + $.value,
204
+ toMax: F(l + $.value),
205
+ x: o.value.start + a * (s > o.value.width / 12 ? o.value.width / 12 : s),
206
+ y: o.value.bottom - o.value.height * F(l + $.value),
207
+ id: `plot_${p.value}_${a}`,
208
+ color: C.value ? e.value.style.bar.color : e.value.style.area.useGradient ? D(e.value.style.line.color, 0.05 * (1 - a / w.value)) : e.value.style.line.color,
209
+ width: s > o.value.width / 12 ? o.value.width / 12 : s
210
+ };
211
+ })), we = h(() => {
212
+ const t = { x: c.value[0].x || 0, y: (u.value.height || 0) - 6 }, a = { x: c.value[c.value.length - 1].x || 0, y: (u.value.height || 0) - 6 }, l = [];
213
+ return c.value.forEach((s) => {
214
+ l.push(`${s.x || 0},${s.y || 0} `);
215
+ }), [t.x, t.y, ...l, a.x, a.y].toString();
216
+ }), v = g(void 0), N = g(void 0);
217
+ function _e(t, a) {
218
+ e.value.events.datapointEnter && e.value.events.datapointEnter({ datapoint: t, seriesIndex: a }), v.value = t, N.value || (N.value = t), O("hoverIndex", { index: a });
219
+ }
220
+ function Le(t, a) {
221
+ e.value.events.datapointLeave && e.value.events.datapointLeave({ datapoint: t, seriesIndex: a }), N.value = v.value, v.value = void 0, O("hoverIndex", { index: void 0 });
222
+ }
223
+ const m = h(() => {
224
+ if (q.value) {
225
+ const t = c.value.map((l) => l.absoluteValue), a = t.reduce((l, s) => l + s, 0);
226
+ return {
227
+ latest: c.value[c.value.length - 1].absoluteValue,
228
+ sum: a,
229
+ average: a / c.value.length,
230
+ median: Oe(t),
231
+ trend: Ee(c.value.map(({ x: l, y: s, absoluteValue: Ne }) => ({
232
+ x: l,
233
+ y: s,
234
+ value: Ne
235
+ }))).trend
236
+ };
237
+ } else
238
+ return {
239
+ latest: null,
240
+ sum: null,
241
+ average: null,
242
+ median: null,
243
+ trend: null
244
+ };
245
+ }), ae = h(() => q.value ? e.value.style.dataLabel.valueType === "latest" ? m.value.latest : e.value.style.dataLabel.valueType === "sum" ? m.value.sum : e.value.style.dataLabel.valueType === "average" ? m.value.average : 0 : 0), C = h(() => e.value.type && e.value.type === "bar");
246
+ function Ae(t, a) {
247
+ e.value.events.datapointClick && e.value.events.datapointClick({ datapoint: t, seriesIndex: a }), O("selectDatapoint", { datapoint: t, index: a });
248
+ }
249
+ return (t, a) => (r(), d("div", {
250
+ ref_key: "sparklineChart",
251
+ ref: P,
252
+ class: "vue-ui-sparkline",
253
+ id: p.value,
254
+ style: V(`width:100%;font-family:${e.value.style.fontFamily};`)
255
+ }, [
256
+ M(t.$slots, "before", ne(re({
257
+ selected: v.value,
258
+ latest: m.value.latest,
259
+ sum: m.value.sum,
260
+ average: m.value.average,
261
+ median: m.value.median,
262
+ trend: m.value.trend
263
+ })), void 0, !0),
264
+ e.value.style.title.show && _.showInfo ? (r(), d("div", {
265
+ key: 0,
266
+ ref_key: "chartTitle",
267
+ ref: Z,
268
+ class: "vue-ui-sparkline-title",
269
+ style: V(`display:flex;align-items:center;width:100%;color:${e.value.style.title.color};background:${e.value.style.backgroundColor};justify-content:${e.value.style.title.textAlign === "left" ? "flex-start" : e.value.style.title.textAlign === "right" ? "flex-end" : "center"};height:${e.value.style.title.fontSize * 2}px;font-size:${e.value.style.title.fontSize}px;font-weight:${e.value.style.title.bold ? "bold" : "normal"};`)
270
+ }, [
271
+ f("span", {
272
+ style: V(`padding:${e.value.style.title.textAlign === "left" ? "0 0 0 12px" : e.value.style.title.textAlign === "right" ? "0 12px 0 0" : "0"}`)
273
+ }, z(v.value ? v.value.period : e.value.style.title.text), 5)
274
+ ], 4)) : y("", !0),
275
+ (r(), d("svg", {
276
+ ref_key: "svgRef",
277
+ ref: J,
278
+ xmlns: i(Be),
279
+ viewBox: `0 0 ${u.value.width} ${u.value.height}`,
280
+ style: V(`background:${e.value.style.backgroundColor};overflow:visible`),
281
+ onMouseleave: a[0] || (a[0] = (l) => N.value = void 0)
282
+ }, [
283
+ Ie(i(pe)),
284
+ t.$slots["chart-background"] ? (r(), d("foreignObject", {
285
+ key: 0,
286
+ x: 0,
287
+ y: 0,
288
+ width: u.value.width <= 0 ? 10 : u.value.width,
289
+ height: u.value.height <= 0 ? 10 : u.value.height,
290
+ style: {
291
+ pointerEvents: "none"
292
+ }
293
+ }, [
294
+ M(t.$slots, "chart-background", {}, void 0, !0)
295
+ ], 8, Qe)) : y("", !0),
296
+ f("defs", null, [
297
+ f("linearGradient", {
298
+ x1: "0%",
299
+ y1: "0%",
300
+ x2: "100%",
301
+ y2: "0%",
302
+ id: `sparkline_gradient_${p.value}`
303
+ }, [
304
+ f("stop", {
305
+ offset: "0%",
306
+ "stop-color": i(W)(i(D)(e.value.style.area.color, 0.05), e.value.style.area.opacity)
307
+ }, null, 8, tt),
308
+ f("stop", {
309
+ offset: "100%",
310
+ "stop-color": i(W)(e.value.style.area.color, e.value.style.area.opacity)
311
+ }, null, 8, at)
312
+ ], 8, et),
313
+ f("linearGradient", {
314
+ x2: "0%",
315
+ y2: "100%",
316
+ id: `sparkline_bar_gradient_pos_${p.value}`
317
+ }, [
318
+ f("stop", {
319
+ offset: "0%",
320
+ "stop-color": e.value.style.bar.color
321
+ }, null, 8, ut),
322
+ f("stop", {
323
+ offset: "100%",
324
+ "stop-color": i(D)(e.value.style.bar.color, 0.05)
325
+ }, null, 8, ot)
326
+ ], 8, lt),
327
+ f("linearGradient", {
328
+ x2: "0%",
329
+ y2: "100%",
330
+ id: `sparkline_bar_gradient_neg_${p.value}`
331
+ }, [
332
+ f("stop", {
333
+ offset: "0%",
334
+ "stop-color": i(D)(e.value.style.bar.color, 0.05)
335
+ }, null, 8, nt),
336
+ f("stop", {
337
+ offset: "100%",
338
+ "stop-color": e.value.style.bar.color
339
+ }, null, 8, rt)
340
+ ], 8, st)
341
+ ]),
342
+ e.value.style.area.show && !C.value && c.value[0] ? (r(), d("g", it, [
343
+ e.value.style.line.smooth ? (r(), d("path", {
344
+ key: 0,
345
+ d: `M ${c.value[0].x},${o.value.bottom} ${i(ce)(c.value)} L ${c.value.at(-1).x},${o.value.bottom} Z`,
346
+ fill: e.value.style.area.useGradient ? `url(#sparkline_gradient_${p.value})` : i(W)(e.value.style.area.color, e.value.style.area.opacity)
347
+ }, null, 8, vt)) : (r(), d("path", {
348
+ key: 1,
349
+ d: `M${we.value}Z`,
350
+ fill: e.value.style.area.useGradient ? `url(#sparkline_gradient_${p.value})` : i(W)(e.value.style.area.color, e.value.style.area.opacity)
351
+ }, null, 8, dt))
352
+ ])) : y("", !0),
353
+ e.value.style.line.smooth && !C.value ? (r(), d("path", {
354
+ key: 2,
355
+ d: `M ${i(ce)(c.value)}`,
356
+ stroke: e.value.style.line.color,
357
+ fill: "none",
358
+ "stroke-width": e.value.style.line.strokeWidth,
359
+ "stroke-linecap": "round"
360
+ }, null, 8, ct)) : y("", !0),
361
+ !e.value.style.line.smooth && !C.value ? (r(), d("path", {
362
+ key: 3,
363
+ d: `M ${i(Fe)(c.value)}`,
364
+ stroke: e.value.style.line.color,
365
+ fill: "none",
366
+ "stroke-width": e.value.style.line.strokeWidth,
367
+ "stroke-linecap": "round"
368
+ }, null, 8, ht)) : y("", !0),
369
+ (r(!0), d(G, null, U(c.value, (l, s) => (r(), d("g", null, [
370
+ C.value ? (r(), d("rect", {
371
+ key: 0,
372
+ x: l.x - l.width / 2,
373
+ y: isNaN(l.absoluteValue > 0 ? l.y : A.value) ? 0 : l.absoluteValue > 0 ? l.y : A.value,
374
+ width: l.width,
375
+ height: isNaN(Math.abs(l.y - A.value)) ? 0 : Math.abs(l.y - A.value),
376
+ fill: l.absoluteValue > 0 ? `url(#sparkline_bar_gradient_pos_${p.value})` : `url(#sparkline_bar_gradient_neg_${p.value})`,
377
+ rx: e.value.style.bar.borderRadius
378
+ }, null, 8, yt)) : y("", !0),
379
+ e.value.style.verticalIndicator.show && (v.value && l.id === v.value.id || _.selectedIndex === s) ? (r(), d("line", {
380
+ key: 1,
381
+ x1: l.x,
382
+ x2: l.x,
383
+ y1: o.value.top - 6,
384
+ y2: o.value.bottom,
385
+ stroke: e.value.style.verticalIndicator.color || l.color,
386
+ "stroke-width": e.value.style.verticalIndicator.strokeWidth,
387
+ "stroke-linecap": "round",
388
+ "stroke-dasharray": e.value.style.verticalIndicator.strokeDasharray || 0
389
+ }, null, 8, ft)) : y("", !0)
390
+ ]))), 256)),
391
+ B.value < 0 ? (r(), d("line", {
392
+ key: 4,
393
+ x1: o.value.start,
394
+ x2: o.value.start + o.value.width - 16,
395
+ y1: i(he)(A.value, o.value.bottom),
396
+ y2: i(he)(A.value, o.value.bottom),
397
+ stroke: e.value.style.zeroLine.color,
398
+ "stroke-dasharray": e.value.style.zeroLine.strokeWidth * 2,
399
+ "stroke-width": e.value.style.zeroLine.strokeWidth,
400
+ "stroke-linecap": "round"
401
+ }, null, 8, pt)) : y("", !0),
402
+ e.value.style.plot.show ? (r(!0), d(G, { key: 5 }, U(c.value, (l, s) => (r(), d("g", null, [
403
+ v.value && l.id === v.value.id || _.selectedIndex === s || _.dataset.length === 1 ? (r(), d("circle", {
404
+ key: 0,
405
+ cx: l.x,
406
+ cy: l.y,
407
+ r: e.value.style.plot.radius,
408
+ fill: l.color,
409
+ stroke: e.value.style.plot.stroke,
410
+ "stroke-width": e.value.style.plot.strokeWidth
411
+ }, null, 8, gt)) : y("", !0)
412
+ ]))), 256)) : y("", !0),
413
+ _.showInfo && e.value.style.dataLabel.show ? (r(), d("text", {
414
+ key: 6,
415
+ x: e.value.style.dataLabel.position === "left" ? 12 + e.value.style.dataLabel.offsetX : o.value.width + 12 + e.value.style.dataLabel.offsetX,
416
+ y: u.value.height / 2 + e.value.style.dataLabel.fontSize / 2.5 + e.value.style.dataLabel.offsetY,
417
+ "font-size": e.value.style.dataLabel.fontSize,
418
+ "font-weight": e.value.style.dataLabel.bold ? "bold" : "normal",
419
+ fill: e.value.style.dataLabel.color
420
+ }, z(v.value ? i(X)(
421
+ e.value.style.dataLabel.formatter,
422
+ v.value.absoluteValue,
423
+ i(Y)({ p: e.value.style.dataLabel.prefix, v: v.value.absoluteValue, s: e.value.style.dataLabel.suffix, r: e.value.style.dataLabel.roundingValue }),
424
+ { datapoint: v.value }
425
+ ) : i(X)(
426
+ e.value.style.dataLabel.formatter,
427
+ ae.value,
428
+ i(Y)({ p: e.value.style.dataLabel.prefix, v: ae.value, s: e.value.style.dataLabel.suffix, r: e.value.style.dataLabel.roundingValue })
429
+ )), 9, bt)) : y("", !0),
430
+ (r(!0), d(G, null, U(c.value, (l, s) => (r(), d("rect", {
431
+ x: l.x - (o.value.width / (w.value + 1) > u.value.padding ? u.value.padding : o.value.width / (w.value + 1)) / 2,
432
+ y: o.value.top - 6,
433
+ height: o.value.height + 6,
434
+ width: o.value.width / (w.value + 1) > u.value.padding ? u.value.padding : o.value.width / (w.value + 1),
435
+ fill: "transparent",
436
+ onMouseenter: () => _e(l, s),
437
+ onMouseleave: () => Le(l, s),
438
+ onClick: () => Ae(l, s)
439
+ }, null, 40, mt))), 256)),
440
+ M(t.$slots, "svg", { svg: u.value }, void 0, !0)
441
+ ], 44, Ke)),
442
+ v.value && e.value.style.tooltip.show ? (r(), se(i(ge), {
443
+ key: 1,
444
+ x: v.value.x,
445
+ y: v.value.y,
446
+ prevX: N.value.x,
447
+ prevY: N.value.y,
448
+ offsetY: e.value.style.plot.radius * 3 + e.value.style.tooltip.offsetY,
449
+ svgRef: i(J),
450
+ background: e.value.style.tooltip.backgroundColor,
451
+ color: e.value.style.tooltip.color,
452
+ fontSize: e.value.style.tooltip.fontSize,
453
+ borderWidth: e.value.style.tooltip.borderWidth,
454
+ borderColor: e.value.style.tooltip.borderColor,
455
+ borderRadius: e.value.style.tooltip.borderRadius,
456
+ backgroundOpacity: e.value.style.tooltip.backgroundOpacity
457
+ }, {
458
+ default: Se(() => [
459
+ M(t.$slots, "tooltip", ne(re({ ...v.value })), () => [
460
+ Ve(z(v.value.period) + ": " + z(i(X)(
461
+ e.value.style.dataLabel.formatter,
462
+ v.value.absoluteValue,
463
+ i(Y)({
464
+ p: e.value.style.dataLabel.prefix,
465
+ v: v.value.absoluteValue,
466
+ s: e.value.style.dataLabel.suffix,
467
+ r: e.value.style.dataLabel.roundingValue
468
+ }),
469
+ { datapoint: v.value }
470
+ )), 1)
471
+ ], !0)
472
+ ]),
473
+ _: 3
474
+ }, 8, ["x", "y", "prevX", "prevY", "offsetY", "svgRef", "background", "color", "fontSize", "borderWidth", "borderColor", "borderRadius", "backgroundOpacity"])) : y("", !0),
475
+ t.$slots.source ? (r(), d("div", {
476
+ key: 2,
477
+ ref_key: "source",
478
+ ref: H,
479
+ dir: "auto"
480
+ }, [
481
+ M(t.$slots, "source", {}, void 0, !0)
482
+ ], 512)) : y("", !0),
483
+ i(R) ? (r(), se(qe, { key: 3 })) : y("", !0)
484
+ ], 12, Je));
485
+ }
486
+ }, Mt = /* @__PURE__ */ He(kt, [["__scopeId", "data-v-251d35ec"]]);
487
+ export {
488
+ Mt as default
489
+ };