vue-data-ui 3.1.10 → 3.1.11

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 (89) hide show
  1. package/dist/{Arrow-D7ZF4yAC.js → Arrow-CFqqlnrM.js} +1 -1
  2. package/dist/{BaseDraggableDialog-D9yisoCl.js → BaseDraggableDialog-DaoUhyXv.js} +2 -2
  3. package/dist/{BaseIcon-DW7Viin8.js → BaseIcon-BNwyRcFi.js} +1 -1
  4. package/dist/{ColorPicker-VAhVa4rn.js → ColorPicker-CCDghcL_.js} +2 -2
  5. package/dist/{DataTable-DFJ-uXFk.js → DataTable-i6SuA55J.js} +2 -2
  6. package/dist/{Legend-A-Th-THr.js → Legend-SKqDy1gS.js} +2 -2
  7. package/dist/{NonSvgPenAndPaper-DHNAD3xm.js → NonSvgPenAndPaper-qyGnSyvC.js} +3 -3
  8. package/dist/{PackageVersion-BzOBYV_n.js → PackageVersion-ybAEJLG7.js} +1 -1
  9. package/dist/{PenAndPaper-DwI_W13k.js → PenAndPaper-DDBikbi2.js} +3 -3
  10. package/dist/{Shape-ZsEI7pYU.js → Shape-BjFZpeHY.js} +1 -1
  11. package/dist/{Slicer-DI7ooV9J.js → Slicer-BHmT0yAl.js} +2 -2
  12. package/dist/{SparkTooltip-BWytmziW.js → SparkTooltip-CDYMoiKx.js} +1 -1
  13. package/dist/{Title-q7KLw8M1.js → Title-Cuz9tE8Z.js} +1 -1
  14. package/dist/{Tooltip-Bv-2Sizc.js → Tooltip-CzMk3xqn.js} +1 -1
  15. package/dist/{UserOptions-BpcEmsVG.js → UserOptions-1SNweLDC.js} +2 -2
  16. package/dist/{dom-to-png-Bjv_BLOD.js → dom-to-png-B-oEiNKy.js} +1 -1
  17. package/dist/{img-BE2EQi1c.js → img-O4yv-68E.js} +1 -1
  18. package/dist/{index-BX36v2yo.js → index-CUHa1rnE.js} +1 -1
  19. package/dist/{pdf-18i9-ATg.js → pdf-ubyH-SWK.js} +1 -1
  20. package/dist/style.css +1 -1
  21. package/dist/{useAutoSizeLabelsInsideViewbox-DPRYkfRK.js → useAutoSizeLabelsInsideViewbox-dxhIPVQp.js} +1 -1
  22. package/dist/{useNestedProp-DPKscaRF.js → useNestedProp-BI65hZqY.js} +1 -1
  23. package/dist/{usePrinter-CkHAOpuo.js → usePrinter-C34C5HuI.js} +2 -2
  24. package/dist/{vue-data-ui-BOg8sJjs.js → vue-data-ui-B5GGY8uZ.js} +64 -64
  25. package/dist/vue-data-ui.js +1 -1
  26. package/dist/{vue-ui-3d-bar-D0wRvC7X.js → vue-ui-3d-bar-CXK2mPP1.js} +6 -6
  27. package/dist/{vue-ui-accordion-B3bW7xEF.js → vue-ui-accordion-DV3dB5Vt.js} +3 -3
  28. package/dist/{vue-ui-age-pyramid-BgNlDsdI.js → vue-ui-age-pyramid-BeLV24oy.js} +6 -6
  29. package/dist/{vue-ui-annotator-FnZfg_IR.js → vue-ui-annotator-DE8wmV9X.js} +2 -2
  30. package/dist/{vue-ui-bullet-DG65DMoC.js → vue-ui-bullet-B8MGNXu_.js} +7 -7
  31. package/dist/{vue-ui-candlestick-CWhq0sic.js → vue-ui-candlestick-Di-SVMyV.js} +7 -7
  32. package/dist/{vue-ui-carousel-table-D_4N_zyW.js → vue-ui-carousel-table-DfgC0-Nx.js} +4 -4
  33. package/dist/{vue-ui-chestnut-mU0wekHQ.js → vue-ui-chestnut-lBARfeQM.js} +5 -5
  34. package/dist/{vue-ui-chord-Bauthp8h.js → vue-ui-chord-D-bsMDsI.js} +8 -8
  35. package/dist/{vue-ui-circle-pack-BJo7Ah6C.js → vue-ui-circle-pack-DGkT5xMh.js} +6 -6
  36. package/dist/{vue-ui-cursor-DoS_k3gd.js → vue-ui-cursor-BVHNt_Ng.js} +2 -2
  37. package/dist/{vue-ui-dashboard-CMEY9fct.js → vue-ui-dashboard-DEBpYnDq.js} +67 -67
  38. package/dist/{vue-ui-digits-HWlddr2q.js → vue-ui-digits-U4sxi5jK.js} +2 -2
  39. package/dist/{vue-ui-donut-D0BmmhDm.js → vue-ui-donut-BE3-IWza.js} +8 -8
  40. package/dist/{vue-ui-donut-evolution-CF-bwSCu.js → vue-ui-donut-evolution-D7MQyuaS.js} +8 -8
  41. package/dist/{vue-ui-dumbbell-CL3bnAxl.js → vue-ui-dumbbell-BrzGWK7r.js} +7 -7
  42. package/dist/{vue-ui-flow-D09BoXGa.js → vue-ui-flow-BbD6gzpE.js} +7 -7
  43. package/dist/{vue-ui-funnel-5i1Ml16Q.js → vue-ui-funnel-Oytdvn2D.js} +6 -6
  44. package/dist/{vue-ui-galaxy-c34YNvy0.js → vue-ui-galaxy-CuMC-W8t.js} +7 -7
  45. package/dist/{vue-ui-gauge-7bYPGmPX.js → vue-ui-gauge-BeV6uj4d.js} +7 -7
  46. package/dist/{vue-ui-gizmo-DBPnLM19.js → vue-ui-gizmo-CVp0dL5m.js} +3 -3
  47. package/dist/{vue-ui-heatmap-CZB8kVCa.js → vue-ui-heatmap-CVfH03pI.js} +7 -7
  48. package/dist/{vue-ui-history-plot-CJrF-gJD.js → vue-ui-history-plot-O4eXAAVL.js} +7 -7
  49. package/dist/{vue-ui-kpi-Bf_iS73w.js → vue-ui-kpi-C-56W27h.js} +3 -3
  50. package/dist/{vue-ui-mini-loader-1yQmJhh4.js → vue-ui-mini-loader-C6EfeHr3.js} +2 -2
  51. package/dist/{vue-ui-molecule-CgrbhjyE.js → vue-ui-molecule-DkfKAmEy.js} +5 -5
  52. package/dist/{vue-ui-mood-radar-DVKE3IqF.js → vue-ui-mood-radar-qzf3YS1D.js} +7 -7
  53. package/dist/{vue-ui-nested-donuts-DfaFDyJU.js → vue-ui-nested-donuts-qRBde3ef.js} +7 -7
  54. package/dist/{vue-ui-onion-CP5dDv9d.js → vue-ui-onion-CDIwmczc.js} +8 -8
  55. package/dist/{vue-ui-parallel-coordinate-plot-nfI8pAYr.js → vue-ui-parallel-coordinate-plot-2qYx_7aY.js} +8 -8
  56. package/dist/{vue-ui-quadrant-CGQWSISU.js → vue-ui-quadrant-u_Utp2Fq.js} +8 -8
  57. package/dist/{vue-ui-quick-chart--x39nbnx.js → vue-ui-quick-chart-BzUo2RV6.js} +6 -6
  58. package/dist/{vue-ui-radar-D3oVbCHs.js → vue-ui-radar-D-B8r-nf.js} +8 -8
  59. package/dist/{vue-ui-rating-CCyAo_wm.js → vue-ui-rating-CEUsbt4_.js} +2 -2
  60. package/dist/{vue-ui-relation-circle-hvO7jb5w.js → vue-ui-relation-circle-B6sJBAzs.js} +7 -7
  61. package/dist/{vue-ui-ridgeline-qd61pVwF.js → vue-ui-ridgeline-BteCVeFC.js} +8 -8
  62. package/dist/{vue-ui-rings-CTqm8Wze.js → vue-ui-rings-CFh97maF.js} +8 -8
  63. package/dist/{vue-ui-scatter-DG2hHPgl.js → vue-ui-scatter-C6VU6SQk.js} +8 -8
  64. package/dist/{vue-ui-skeleton-CXEVl_P_.js → vue-ui-skeleton-h-gregQy.js} +3 -3
  65. package/dist/{vue-ui-smiley-CIcyYyaY.js → vue-ui-smiley-Coy_k4yC.js} +2 -2
  66. package/dist/{vue-ui-spark-trend-DXna0InO.js → vue-ui-spark-trend-njuc_Hat.js} +3 -3
  67. package/dist/{vue-ui-sparkbar-BmXSYSt2.js → vue-ui-sparkbar-DI3hhJ3x.js} +3 -3
  68. package/dist/{vue-ui-sparkgauge-ep4qAjJm.js → vue-ui-sparkgauge-D6hQixh0.js} +3 -3
  69. package/dist/{vue-ui-sparkhistogram-C_j3n3sQ.js → vue-ui-sparkhistogram-Dv8CiZia.js} +4 -4
  70. package/dist/{vue-ui-sparkline-5-MWpgzg.js → vue-ui-sparkline-BIUzJPmY.js} +3 -3
  71. package/dist/{vue-ui-sparkstackbar-CBazbGz6.js → vue-ui-sparkstackbar-Cdc5964Q.js} +3 -3
  72. package/dist/{vue-ui-stackbar-COJoXl24.js → vue-ui-stackbar-DvBTM4pm.js} +9 -9
  73. package/dist/{vue-ui-strip-plot-B_C57qzM.js → vue-ui-strip-plot-qxut93FA.js} +7 -7
  74. package/dist/{vue-ui-table-C7pJJO_J.js → vue-ui-table-CHrmN7Oo.js} +4 -4
  75. package/dist/{vue-ui-table-heatmap-B7am7f4J.js → vue-ui-table-heatmap-BG6ioJSC.js} +5 -5
  76. package/dist/{vue-ui-table-sparkline-B7dymruQ.js → vue-ui-table-sparkline-CSkOCGgA.js} +4 -4
  77. package/dist/{vue-ui-thermometer-QU8j9WyT.js → vue-ui-thermometer-ClKy8a8O.js} +7 -7
  78. package/dist/{vue-ui-timer-CDrQkfIG.js → vue-ui-timer-BpTShWjZ.js} +5 -5
  79. package/dist/{vue-ui-tiremarks-D_LL7f2n.js → vue-ui-tiremarks-CH48OzV3.js} +6 -6
  80. package/dist/{vue-ui-treemap-DvPYeEwO.js → vue-ui-treemap-DP9s7qNT.js} +8 -8
  81. package/dist/{vue-ui-vertical-bar-BJ4AGGrz.js → vue-ui-vertical-bar-CqjVuwTE.js} +9 -9
  82. package/dist/{vue-ui-waffle-CJAclMm9.js → vue-ui-waffle-Dm8IowIh.js} +8 -8
  83. package/dist/{vue-ui-wheel-91DucIre.js → vue-ui-wheel-CC9Rn0jk.js} +6 -6
  84. package/dist/{vue-ui-word-cloud-DcqD79Yc.js → vue-ui-word-cloud-jP8Uz38i.js} +6 -6
  85. package/dist/{vue-ui-world-CqYbOhHA.js → vue-ui-world-CbIdf6nN.js} +6 -6
  86. package/dist/vue-ui-xy-BWRFJFy2.js +4530 -0
  87. package/dist/{vue-ui-xy-canvas-B5zK58aG.js → vue-ui-xy-canvas-DjOXF2lr.js} +10 -10
  88. package/package.json +1 -1
  89. package/dist/vue-ui-xy-DGaw_TPE.js +0 -4507
@@ -1,4507 +0,0 @@
1
- import { useCssVars as Oo, computed as x, ref as y, onMounted as Sl, onBeforeUnmount as il, watch as mt, nextTick as ul, onUpdated as Bo, createElementBlock as i, openBlock as n, createElementVNode as w, createCommentVNode as g, renderSlot as Q, normalizeStyle as M, createVNode as nl, withDirectives as Ta, unref as v, Fragment as b, renderList as _, normalizeProps as zt, mergeProps as Ht, normalizeClass as Qe, withKeys as io, vModelText as uo, toDisplayString as ue, defineAsyncComponent as Ot, useSlots as Eo, getCurrentInstance as Ho, toRefs as Do, watchEffect as so, createBlock as at, createSlots as ro, withCtx as we, guardReactiveProps as Bt, Teleport as Wo, resolveDynamicComponent as Xo, vModelCheckbox as Yo, createTextVNode as co } from "vue";
2
- import { c as ca, y as va, X as Go, F as ht, $ as da, V as ha, a0 as ma, U as fa, u as Uo, f as Ca, t as qo, d as Zo, D as Xl, ae as al, e as vo, p as ho, af as ua, ab as J, a6 as Aa, ag as Ko, h as G, ah as Jo, ai as mo, aj as fo, k as Te, ak as Qo, z as jo, _ as go, R as yt, i as ot, x as ol, s as dt, a9 as ne, L as en, al as sa, I as tn, am as Et, C as Je, a as ln, b as an, o as xo, v as on, w as nn, E as wl } from "./index-BX36v2yo.js";
3
- import { t as Ia, d as un, u as sn } from "./useResponsive-DfdjqQps.js";
4
- import { u as rn } from "./usePrinter-CkHAOpuo.js";
5
- import { u as cn, B as vn } from "./BaseScanner-BgWxam9d.js";
6
- import { u as bo, a as dn, l as hn } from "./useTimeLabels-BGFjWgrv.js";
7
- import { u as za } from "./useNestedProp-DPKscaRF.js";
8
- import { u as mn } from "./useTimeLabelCollider-CIsgDrl9.js";
9
- import fn from "./img-BE2EQi1c.js";
10
- import gn from "./Title-q7KLw8M1.js";
11
- import { S as xn } from "./Slicer-DI7ooV9J.js";
12
- import { _ as ra } from "./Shape-ZsEI7pYU.js";
13
- import bn from "./BaseIcon-DW7Viin8.js";
14
- import { _ as yo } from "./_plugin-vue_export-helper-CHgC5LLL.js";
15
- import yn from "./vue-ui-accordion-B3bW7xEF.js";
16
- const pn = {
17
- class: "vue-data-ui-slicer-labels",
18
- style: { position: "relative", "z-index": "1", "pointer-events": "none" }
19
- }, kn = {
20
- key: 0,
21
- style: { width: "100%", position: "relative" }
22
- }, wn = {
23
- key: 0,
24
- class: "minimap",
25
- style: { width: "100%" }
26
- }, Sn = ["xmlns", "viewBox"], $n = ["id"], _n = ["stop-color"], Mn = ["width", "height", "stroke"], Ln = ["d", "stroke"], Cn = ["d", "fill"], An = ["x", "y", "width", "height", "fill"], zn = ["d", "stroke"], Tn = ["cx", "cy", "fill", "stroke"], In = ["x", "width", "height", "fill", "rx"], Nn = ["x", "width", "height", "rx", "fill"], Pn = ["x", "width", "height", "fill", "rx"], Fn = ["x2", "y1", "y2", "stroke"], Rn = { key: "merged-tree" }, Vn = ["d", "fill"], On = ["d", "stroke"], Bn = ["cx", "cy", "stroke", "fill"], En = ["cx", "cy", "stroke", "fill"], Hn = { key: "split-tree" }, Dn = ["x", "y", "width", "height", "fill"], Wn = ["d", "stroke"], Xn = ["x", "height", "fill", "stroke"], Yn = ["x", "height", "fill", "stroke"], Gn = { key: "merged-tree" }, Un = ["cx", "cy", "stroke", "fill"], qn = ["cx", "cy", "fill"], Zn = ["cx", "cy", "stroke", "fill"], Kn = ["cx", "cy", "fill"], Jn = { key: 11 }, Qn = ["d", "stroke"], jn = ["cx", "cy", "fill", "stroke"], ei = ["cx", "cy", "stroke", "fill"], ti = ["cx", "cy", "fill"], li = ["cx", "cy", "stroke", "fill"], ai = ["cx", "cy", "fill"], oi = ["x", "height", "width", "onMouseenter"], ni = ["min", "max"], ii = ["min", "max"], ui = 48, si = {
27
- __name: "SlicerPreview",
28
- props: {
29
- background: {
30
- type: String,
31
- default: "#FFFFFF"
32
- },
33
- borderColor: {
34
- type: String,
35
- default: "#FFFFFF"
36
- },
37
- fontSize: {
38
- type: Number,
39
- default: 14
40
- },
41
- labelLeft: {
42
- type: [String, Number],
43
- default: ""
44
- },
45
- labelRight: {
46
- type: [String, Number],
47
- default: ""
48
- },
49
- textColor: {
50
- type: String,
51
- default: "#1A1A1A"
52
- },
53
- inputColor: {
54
- type: String,
55
- default: "#1A1A1A"
56
- },
57
- max: {
58
- type: Number,
59
- default: 0
60
- },
61
- min: {
62
- type: Number,
63
- default: 0
64
- },
65
- selectColor: {
66
- type: String,
67
- default: "#4A4A4A"
68
- },
69
- useResetSlot: {
70
- type: Boolean,
71
- default: !1
72
- },
73
- valueStart: {
74
- type: [Number, String],
75
- default: 0
76
- },
77
- valueEnd: {
78
- type: [Number, String],
79
- default: 0
80
- },
81
- minimap: {
82
- type: Array,
83
- default: []
84
- },
85
- smoothMinimap: {
86
- type: Boolean,
87
- default: !1
88
- },
89
- minimapSelectedColor: {
90
- type: String,
91
- default: "#1f77b4"
92
- },
93
- minimapSelectionRadius: {
94
- type: Number,
95
- default: 12
96
- },
97
- minimapLineColor: {
98
- type: String,
99
- default: "#2D353C"
100
- },
101
- minimapSelectedColorOpacity: {
102
- type: Number,
103
- default: 0.2
104
- },
105
- minimapSelectedIndex: {
106
- type: Number,
107
- default: null
108
- },
109
- minimapIndicatorColor: {
110
- type: String,
111
- default: "#2D353C"
112
- },
113
- refreshStartPoint: {
114
- type: Number,
115
- default: 0
116
- },
117
- refreshEndPoint: {
118
- type: Number,
119
- default: null
120
- },
121
- enableRangeHandles: {
122
- type: Boolean,
123
- default: !1
124
- },
125
- enableSelectionDrag: {
126
- type: Boolean,
127
- default: !0
128
- },
129
- verticalHandles: {
130
- type: Boolean,
131
- default: !1
132
- },
133
- timeLabels: {
134
- type: Array
135
- },
136
- isPreview: {
137
- type: Boolean,
138
- default: !1
139
- },
140
- preciseLabels: {
141
- type: Array,
142
- default() {
143
- return [];
144
- }
145
- },
146
- usePreciseLabels: {
147
- type: Boolean,
148
- default: !1
149
- },
150
- selectedSeries: {
151
- type: Object
152
- },
153
- customFormat: {
154
- type: [Function, null]
155
- },
156
- minimapCompact: {
157
- type: Boolean,
158
- default: !1
159
- },
160
- allMinimaps: {
161
- type: Array,
162
- default() {
163
- return [];
164
- }
165
- },
166
- minimapMerged: {
167
- type: Boolean,
168
- default: !1
169
- },
170
- minimapFrameColor: {
171
- type: String,
172
- default: "#e1e5e8"
173
- },
174
- cutNullValues: {
175
- type: Boolean,
176
- default: !1
177
- }
178
- },
179
- emits: ["futureStart", "futureEnd", "update:start", "update:end", "reset", "trapMouse"],
180
- setup(S, { expose: ga, emit: xa }) {
181
- Oo((d) => ({
182
- "0b66ced0": Ll.value,
183
- db7bbde8: ae.value,
184
- d9fa9506: Cl.value,
185
- "7277623c": S.selectColor,
186
- "830f626c": Nt.value
187
- }));
188
- const m = S, nt = y(null), ge = y(m.min), Se = y(m.max), he = x(() => !!m.minimap.length), $l = y(ca()), sl = y(!1), Tt = x(() => he.value && m.minimapCompact), _l = y(0), It = x({
189
- get() {
190
- return ge.value;
191
- },
192
- set(d) {
193
- const f = Math.min(d, Se.value - 1);
194
- ge.value = f, Ne.value && (Ne.value.value = String(f)), Ge("futureStart", f);
195
- }
196
- }), Dt = x({
197
- get() {
198
- return Se.value;
199
- },
200
- set(d) {
201
- const f = Math.max(d, ge.value + 1);
202
- Se.value = f, Yt.value && (Yt.value.value = String(f)), Ge("futureEnd", f);
203
- }
204
- });
205
- Sl(() => {
206
- const d = () => {
207
- nt.value && (_l.value = nt.value.getBoundingClientRect().width);
208
- };
209
- d();
210
- const f = Ia(d, 50);
211
- window.addEventListener("resize", f), il(() => {
212
- window.removeEventListener("resize", f);
213
- });
214
- });
215
- let Yl = null;
216
- function Ye() {
217
- clearTimeout(Yl), Ge("update:start", Number(ge.value)), Ge("update:end", Number(Se.value)), sl.value = !1;
218
- }
219
- const je = x(() => m.refreshEndPoint === null ? m.max : m.refreshEndPoint), Ge = xa, Re = x(() => {
220
- if (Tt.value) {
221
- const f = Math.max(1, se.value - 1);
222
- return hl.value / f * 100;
223
- }
224
- const d = Math.max(1, m.max - m.min);
225
- return (ge.value - m.min) / d * 100;
226
- }), ft = x(() => {
227
- if (Tt.value) {
228
- const f = Math.max(1, se.value - 1);
229
- return Xt.value / f * 100;
230
- }
231
- const d = Math.max(1, m.max - m.min);
232
- return (Se.value - m.min) / d * 100;
233
- }), pt = x(() => (Re.value + ft.value) / 2), kt = x(() => {
234
- if (!nt.value) return !1;
235
- const d = Math.max(1, m.max - m.min);
236
- return nt.value.getBoundingClientRect().width * ((ge.value - m.min) / d) - Ce.value / 2 < 0;
237
- }), Ml = x(() => {
238
- if (!nt.value) return !1;
239
- const d = Math.max(1, m.max - m.min), f = nt.value.getBoundingClientRect().width;
240
- return f * ((Se.value - m.min) / d) + xl.value / 2 > f;
241
- }), Ve = x(() => {
242
- const d = Ml.value ? `calc(${pt.value}% - ${Kt.value.width}px - 2px)` : kt.value ? `calc(${pt.value}% - 8px)` : `calc(${pt.value}% - ${Kt.value.width / 2}px - 4px)`;
243
- return {
244
- left: `${Re.value}%`,
245
- width: `${Math.max(0, ft.value - Re.value)}%`,
246
- background: m.selectColor,
247
- tooltipLeft: `calc(${Re.value}% - ${kt.value ? 9 : Ce.value / 2 + 3.5}px)`,
248
- tooltipRight: `calc(${ft.value}% - ${Ml.value ? xl.value - 9 : xl.value / 2 - 3.5}px)`,
249
- tooltipCenter: d,
250
- arrowLeft: !kt.value,
251
- arrowRight: !Ml.value
252
- };
253
- }), Ll = x(() => m.inputColor), Nt = x(() => m.background), Cl = x(() => `${m.selectColor}33`), ae = x(() => m.borderColor), it = x(() => {
254
- let d = [];
255
- for (let f = 0; f < m.max; f += 1)
256
- d.push(f);
257
- return d;
258
- });
259
- function rl() {
260
- Ge("reset");
261
- }
262
- mt(
263
- () => m.min,
264
- (d) => {
265
- Number(ge.value) < Number(d) && (ge.value = Number(d)), Number(Se.value) < Number(d) && (Se.value = Number(d));
266
- }
267
- ), mt(
268
- () => m.max,
269
- (d) => {
270
- Number(ge.value) > Number(d) && (ge.value = Number(d)), Number(Se.value) > Number(d) && (Se.value = Number(d));
271
- }
272
- );
273
- const Pt = y(null), $ = y({
274
- width: 1,
275
- height: 1
276
- }), wt = y(null);
277
- Sl(() => {
278
- if (he.value) {
279
- const d = Ia(() => {
280
- const { width: f, height: h } = sn({
281
- chart: Pt.value
282
- });
283
- $.value.width = f, $.value.height = h - 47;
284
- });
285
- wt.value = new ResizeObserver(d), wt.value.observe(Pt.value);
286
- }
287
- }), il(() => {
288
- wt.value && wt.value.disconnect();
289
- });
290
- const se = x(() => Math.max(1, m.max - m.min));
291
- function re(d) {
292
- const f = Math.floor(d - m.min);
293
- return Math.min(Math.max(0, f), se.value);
294
- }
295
- function cl(d) {
296
- const f = Math.ceil(d - m.min);
297
- return Math.min(Math.max(0, f), se.value);
298
- }
299
- const St = x(() => re(ge.value)), et = x(() => cl(Se.value)), $t = x(() => Math.max(...m.allMinimaps.map((d) => d.series.length))), ee = x(() => {
300
- if (!m.minimap.length) return 0;
301
- const d = Math.max(1, $t.value - (m.minimapCompact ? 1 : 0));
302
- return $.value.width / d;
303
- }), Al = x(() => m.allMinimaps.length ? m.allMinimaps.filter((d) => d.type === "bar").length : 0), ut = x(() => ee.value / (Al.value || 1) * 0.8);
304
- function ce(d, f, h) {
305
- const z = ut.value, C = Math.max(1, Al.value), te = $t.value - 1;
306
- return h === 0 ? d + z / 2 * f : h === te ? d - z / 2 * (C - f) : d - C * z / 2 + f * z;
307
- }
308
- function U(d, f) {
309
- return [0, $t.value - 1].includes(f) ? ut.value / 2 : ut.value;
310
- }
311
- const zl = x(() => {
312
- const d = [];
313
- if (Array.isArray(m.minimap) && m.minimap.length && d.push(...m.minimap.filter(Number.isFinite)), Array.isArray(m.allMinimaps) && m.allMinimaps.length)
314
- for (const f of m.allMinimaps)
315
- f?.isVisible && Array.isArray(f?.series) && d.push(...f.series.filter(Number.isFinite));
316
- return d.length ? { min: Math.min(...d), max: Math.max(...d) } : { min: 0, max: 1 };
317
- }), _t = x(() => zl.value.min), Ft = x(() => zl.value.max), Wt = x(() => _t.value < 0 && Ft.value > 0 || Ft.value <= 0 ? _t.value : 0), Tl = x(() => Math.max(1e-9, Math.max(Math.abs(_t.value), Math.abs(Ft.value)))), H = x(() => _t.value < 0 && Ft.value > 0), Gl = (d) => {
318
- const f = Math.max(1, $.value.height);
319
- if (H.value) {
320
- const h = Tl.value;
321
- return (1 - (Math.max(-1, Math.min(1, d / h)) + 1) / 2) * f;
322
- } else {
323
- const h = Math.min(0, _t.value), z = Math.max(0, Ft.value);
324
- return f - (d - h) / Math.max(1e-9, z - h) * f;
325
- }
326
- }, vl = x(() => Gl(0));
327
- function dl(d, f, h) {
328
- const z = (te, qe, Qt) => Math.max(qe, Math.min(Qt, te));
329
- if (f <= 0) {
330
- const te = Math.max(1e-9, 0 - d);
331
- return (qe) => h - (qe - d) / te * h;
332
- } else if (d >= 0) {
333
- const te = Math.max(1e-9, f - 0);
334
- return (qe) => h - (qe - 0) / te * h;
335
- } else {
336
- const te = Math.max(1e-9, Math.max(Math.abs(d), Math.abs(f)));
337
- return (qe) => (1 - (z(qe / te, -1, 1) + 1) / 2) * h;
338
- }
339
- }
340
- function Me(d, f = !1) {
341
- if (!d || !d.length)
342
- return {
343
- fullSet: "",
344
- points: [],
345
- selectionSet: "",
346
- sliced: [],
347
- firstPlot: null,
348
- lastPlot: null,
349
- hasFull: !1,
350
- hasSelection: !1,
351
- fullMarkers: [],
352
- selectionMarkers: []
353
- };
354
- const h = Math.max(1, $.value.height), z = d.filter(Number.isFinite), C = z.length ? Math.min(...z) : 0, te = z.length ? Math.max(...z) : 0, qe = dl(C, te, h), Qt = d.length, bl = Math.min(Math.max(0, St.value), Math.max(0, Qt - 1)), jt = Math.min(Qt, Math.max(bl + 1, et.value)), Ae = d.map((be, Vl) => {
355
- const $e = m.cutNullValues ? be : be === null ? 0 : be, Ol = Number.isFinite($e), Lt = ee.value * Vl + (m.minimapCompact ? 0 : ee.value / 2), _e = (C < 0 && te > 0, qe(0));
356
- return {
357
- x: Lt,
358
- y: Ol ? qe($e) : NaN,
359
- v: $e,
360
- value: Ol ? $e : null,
361
- y0: _e,
362
- i: Vl
363
- };
364
- }), P = (be) => be >= 0 && be < Ae.length && Number.isFinite(Ae[be]?.value), Rl = Ae.filter((be) => Number.isFinite(be.value) && !P(be.i - 1) && !P(be.i + 1)), jl = Rl.filter((be) => be.i >= bl && be.i < jt), ct = Ae.slice(bl, jt), ka = Ae.length >= 2 ? m.smoothMinimap || f ? m.cutNullValues ? da(Ae) : ha(Ae) : m.cutNullValues ? ma(Ae) : fa(Ae) : "", wa = ct.length >= 2 ? m.smoothMinimap || f ? m.cutNullValues ? da(ct) : ha(ct) : m.cutNullValues ? ma(ct) : fa(ct) : "";
365
- return {
366
- fullSet: ka,
367
- points: Ae,
368
- selectionSet: wa,
369
- sliced: ct,
370
- firstPlot: Ae[bl] || null,
371
- lastPlot: Ae[Math.max(0, jt - 1)] || null,
372
- hasFull: Ae.length >= 2,
373
- hasSelection: ct.length >= 2,
374
- fullMarkers: Rl,
375
- selectionMarkers: jl
376
- };
377
- }
378
- const N = x(() => m.minimap.length ? Me(m.minimap) : []), gt = x(() => m.allMinimaps.length ? m.allMinimaps.map((d, f) => {
379
- const h = Me(d?.series || [], !!d.smooth), z = d?.id ?? d?.name ?? f;
380
- return {
381
- key: typeof z == "object" ? JSON.stringify(z) : String(z),
382
- color: d?.color,
383
- ...h,
384
- isVisible: d.isVisible,
385
- type: d.type || "line"
386
- };
387
- }) : []), Oe = x(() => {
388
- const d = St.value, f = Math.max(d + 1, et.value);
389
- return {
390
- x: ee.value * d + (m.minimapCompact ? 0 : ee.value / 2),
391
- width: ee.value * (f - d) - ee.value
392
- };
393
- }), Ie = y(m.minimapSelectedIndex), A = (d) => Math.round(m.min + d), hl = x({
394
- get() {
395
- return Tt.value ? St.value : It.value;
396
- },
397
- set(d) {
398
- Tt.value ? k(A(d)) : k(d);
399
- }
400
- }), Xt = x({
401
- get() {
402
- return Tt.value ? Math.max(St.value, et.value - 1) : Dt.value;
403
- },
404
- set(d) {
405
- Tt.value ? Mt(A(d + 1)) : Mt(d);
406
- }
407
- });
408
- function Il(d) {
409
- Ie.value = re(m.valueStart) + d;
410
- }
411
- const Ul = un(Il, 60);
412
- mt(() => m.minimapSelectedIndex, (d, f) => {
413
- if ([null, void 0].includes(d)) {
414
- Ie.value = null;
415
- return;
416
- }
417
- d !== f && Ul(d);
418
- }, { immediate: !0 });
419
- function L(d) {
420
- Ie.value = d;
421
- const f = St.value, h = et.value;
422
- d >= f && d < h && !He.value && Ge("trapMouse", d - f);
423
- }
424
- const Ne = y(null), Yt = y(null);
425
- function Gt(d) {
426
- if (typeof d == "object" && d && "target" in d) {
427
- const h = d.target, z = "valueAsNumber" in h ? h.valueAsNumber : +h.value;
428
- return Number.isFinite(z) ? z : NaN;
429
- }
430
- const f = +d;
431
- return Number.isFinite(f) ? f : NaN;
432
- }
433
- let t = 0;
434
- function k(d) {
435
- sl.value = !0;
436
- const f = Gt(d);
437
- Number.isFinite(f) && (cancelAnimationFrame(t), t = requestAnimationFrame(() => {
438
- It.value = f;
439
- }));
440
- }
441
- let Ut = 0;
442
- function Mt(d) {
443
- sl.value = !0;
444
- const f = Gt(d);
445
- Number.isFinite(f) && (cancelAnimationFrame(Ut), Ut = requestAnimationFrame(() => {
446
- Dt.value = f;
447
- }));
448
- }
449
- il(() => {
450
- cancelAnimationFrame(t), cancelAnimationFrame(Ut);
451
- });
452
- const me = x(() => m.valueEnd - m.valueStart), fe = y(!1);
453
- let ml = y(null);
454
- const ba = x(() => (_l.value - 48) / (m.max - m.min) * me.value), ya = x(() => Math.max(1, _l.value - ui - ba.value)), st = x(() => Math.max(1, m.max - m.min - me.value)), Be = x(() => st.value / ya.value), p = y(0), tt = y(0), ql = y(0), Nl = y(0);
455
- let Ue = null, xt = null, lt = null, rt = null;
456
- const Pl = (d) => {
457
- if (bt.value = !0, !m.enableSelectionDrag) return;
458
- const f = d.type === "touchstart";
459
- f || d.stopPropagation();
460
- const h = f && d.targetTouches && d.targetTouches[0] ? d.targetTouches[0] : null, z = f ? h ? h.target : null : d.target;
461
- if (!z || !(z instanceof Element) || z.classList && z.classList.contains("range-handle")) return;
462
- fe.value = !0;
463
- const C = f ? h ? h.clientX : 0 : d.clientX;
464
- ml.value = C, p.value = C, tt.value = ge.value, ql.value = Se.value, Nl.value = Be.value, Ue = f ? "touchmove" : "mousemove", xt = f ? "touchend" : "mouseup", lt = f ? pa : Zl, rt = f ? gl : fl, window.addEventListener(Ue, lt, { passive: !1 }), window.addEventListener(xt, rt);
465
- };
466
- function Zl(d) {
467
- fe.value && qt(d.clientX);
468
- }
469
- function pa(d) {
470
- if (!fe.value || !nt.value) return;
471
- const f = d.target;
472
- if (!(f instanceof Element) || !nt.value.contains(f) || f.classList && f.classList.contains("range-handle")) return;
473
- d.preventDefault();
474
- const h = d.targetTouches && d.targetTouches[0] ? d.targetTouches[0] : null;
475
- h && qt(h.clientX);
476
- }
477
- function qt(d) {
478
- if (!fe.value) return;
479
- const h = (d - p.value) * Nl.value;
480
- let z = Math.round(tt.value + h);
481
- z = Math.max(m.min, Math.min(z, m.max - me.value));
482
- const C = z + me.value;
483
- It.value = z, Dt.value = C;
484
- }
485
- function fl() {
486
- Ee();
487
- }
488
- function gl() {
489
- Ee();
490
- }
491
- function Ee() {
492
- fe.value = !1, Ue && lt && window.removeEventListener(Ue, lt), xt && rt && window.removeEventListener(xt, rt), Ue = xt = null, lt = rt = null, Ye();
493
- }
494
- const He = y(!1), Pe = y(null), Le = y(null), Ce = y(1), xl = y(1), bt = y(!1);
495
- function Kl() {
496
- Pe.value && (Ce.value = Pe.value.getBoundingClientRect().width);
497
- }
498
- function Fl() {
499
- Le.value && (xl.value = Le.value.getBoundingClientRect().width);
500
- }
501
- const Jl = y(0);
502
- function c(d) {
503
- Jl.value = d === "start" ? 1 : 0;
504
- }
505
- const Zt = y(!1), Kt = y({
506
- width: 0,
507
- left: 0
508
- });
509
- mt([ge, Se], async () => {
510
- if (await ul(), !Pe.value || !Le.value) {
511
- Zt.value = !1, Kt.value = { width: 0, left: 0 };
512
- return;
513
- }
514
- const d = Pe.value.getBoundingClientRect(), f = Le.value.getBoundingClientRect();
515
- Zt.value = d.x + d.width > f.x;
516
- const h = d.x + d.width / 2, z = f.x + f.width / 2, C = d.width + f.width, te = (h + z) / 2;
517
- Kt.value = {
518
- width: C,
519
- left: te - C / 2
520
- };
521
- }), Bo(() => {
522
- Kl(), Fl();
523
- }), mt(() => m.labelLeft, () => {
524
- ul(Kl);
525
- }, { deep: !0 }), mt(() => m.labelRight, () => {
526
- ul(Fl);
527
- }, { deep: !0 });
528
- const Jt = y(!1), xe = x(() => {
529
- let d = { text: "" }, f = { text: "" };
530
- if (Jt.value = !1, va(m.customFormat))
531
- try {
532
- const h = m.customFormat({
533
- absoluteIndex: ge.value,
534
- seriesIndex: ge.value,
535
- datapoint: m.selectedSeries
536
- }), z = m.customFormat({
537
- absoluteIndex: Se.value - 1,
538
- seriesIndex: -1,
539
- datapoint: m.selectedSeries
540
- });
541
- typeof h == "string" && typeof z == "string" && (d.text = h, f.text = z, Jt.value = !0);
542
- } catch {
543
- console.warn("Custom format cannot be applied on zoom labels."), Jt.value = !1;
544
- }
545
- return Jt.value || (d = m.usePreciseLabels ? m.preciseLabels.find((h) => h.absoluteIndex === ge.value) : m.timeLabels.find((h) => h.absoluteIndex === ge.value), f = m.usePreciseLabels ? m.preciseLabels.find((h) => h.absoluteIndex === Se.value - 1) : m.timeLabels.find((h) => h.absoluteIndex === Se.value - 1)), {
546
- left: d ? d.text : "",
547
- right: f ? f.text : ""
548
- };
549
- });
550
- il(() => {
551
- wt.value && wt.value.disconnect(), Ue && lt && window.removeEventListener(Ue, lt), xt && rt && window.removeEventListener(xt, rt), Ue = xt = null, lt = rt = null, clearTimeout(Yl);
552
- });
553
- const Ql = x(() => {
554
- if (!it.value.length) return null;
555
- if (Ie.value >= St.value && Ie.value < et.value) {
556
- const d = Ie.value;
557
- return {
558
- x1: ee.value * d + (m.minimapCompact ? 0 : ee.value / 2),
559
- x2: ee.value * d + (m.minimapCompact ? 0 : ee.value / 2),
560
- y1: 0,
561
- y2: Math.max($.value.height, 0),
562
- stroke: m.minimapIndicatorColor,
563
- "stroke-linecap": "round",
564
- "stroke-dasharray": 2,
565
- "stroke-width": 1
566
- };
567
- } else
568
- return null;
569
- });
570
- return ga({
571
- setStartValue: k,
572
- setEndValue: Mt
573
- }), (d, f) => (n(), i("div", {
574
- "data-dom-to-png-ignore": "",
575
- style: { padding: "0 24px" },
576
- class: "vue-data-ui-zoom",
577
- ref_key: "zoomWrapper",
578
- ref: nt,
579
- onMousedown: Pl,
580
- onTouchstart: Pl
581
- }, [
582
- w("div", pn, [
583
- S.valueStart !== S.refreshStartPoint || S.valueEnd !== je.value ? (n(), i("div", kn, [
584
- S.useResetSlot ? Q(d.$slots, "reset-action", {
585
- key: 1,
586
- reset: rl
587
- }, void 0, !0) : (n(), i("button", {
588
- key: 0,
589
- tabindex: "0",
590
- role: "button",
591
- class: "vue-data-ui-refresh-button",
592
- style: M({
593
- top: he.value ? "36px" : "-16px",
594
- pointerEvents: "all !important"
595
- }),
596
- onClick: rl
597
- }, [
598
- nl(bn, {
599
- name: "refresh",
600
- stroke: S.textColor
601
- }, null, 8, ["stroke"])
602
- ], 4))
603
- ])) : g("", !0)
604
- ]),
605
- w("div", {
606
- class: "double-range-slider",
607
- ref_key: "minimapWrapper",
608
- ref: Pt,
609
- style: { "z-index": "0" },
610
- onMouseenter: f[11] || (f[11] = (h) => bt.value = !0),
611
- onMouseleave: f[12] || (f[12] = (h) => bt.value = !1)
612
- }, [
613
- he.value ? (n(), i("div", wn, [
614
- (n(), i("svg", {
615
- key: `mm-${S.minimapMerged ? "merged" : "split"}-${S.minimapCompact ? "compact" : "normal"}`,
616
- xmlns: v(Go),
617
- viewBox: `0 0 ${Math.max(0, $.value.width)} ${Math.max(0, $.value.height)}`
618
- }, [
619
- w("defs", null, [
620
- w("linearGradient", {
621
- id: $l.value,
622
- x1: "0%",
623
- y1: "0%",
624
- x2: "0%",
625
- y2: "100%"
626
- }, [
627
- w("stop", {
628
- offset: "0%",
629
- "stop-color": `${S.minimapLineColor}50`
630
- }, null, 8, _n),
631
- f[13] || (f[13] = w("stop", {
632
- offset: "100%",
633
- "stop-color": "transparent"
634
- }, null, -1))
635
- ], 8, $n)
636
- ]),
637
- S.minimapCompact ? (n(), i("rect", {
638
- key: 0,
639
- class: "vue-ui-zoom-minimap-frame",
640
- x: 0,
641
- y: 0,
642
- width: $.value.width,
643
- height: $.value.height,
644
- fill: "none",
645
- stroke: S.minimapFrameColor,
646
- rx: 3
647
- }, null, 8, Mn)) : g("", !0),
648
- S.minimapMerged ? (n(), i("path", {
649
- key: 1,
650
- d: `M${N.value.fullSet}`,
651
- stroke: `${S.minimapLineColor}`,
652
- fill: "none",
653
- "stroke-width": "1",
654
- "stroke-linecap": "round",
655
- "stroke-linejoin": "round",
656
- style: { opacity: "0.6" }
657
- }, null, 8, Ln)) : g("", !0),
658
- S.minimapMerged && !S.minimapCompact ? (n(), i("path", {
659
- key: 2,
660
- d: `M${ee.value / 2},${Math.max($.value.height, 0)} ${N.value.fullSet} L${$.value.width - ee.value / 2},${Math.max($.value.height, 0)}Z`,
661
- fill: `url(#${$l.value})`,
662
- stroke: "none",
663
- style: { opacity: "0.6" }
664
- }, null, 8, Cn)) : S.minimapMerged ? g("", !0) : (n(), i(b, { key: 3 }, [
665
- (n(!0), i(b, null, _(gt.value.filter((h) => h.type === "bar"), (h, z) => (n(), i("g", null, [
666
- (n(!0), i(b, null, _(h.points, (C, te) => (n(), i(b, null, [
667
- h.isVisible && !isNaN(C.y) ? (n(), i("rect", {
668
- key: 0,
669
- x: ce(C.x, z, te),
670
- y: C.v >= 0 ? C.y : C.y0,
671
- width: U(z, te),
672
- height: C.v >= 0 ? C.y0 - C.y : C.y - C.y0,
673
- fill: h.color,
674
- style: { opacity: 0.6 }
675
- }, null, 8, An)) : g("", !0)
676
- ], 64))), 256))
677
- ]))), 256)),
678
- (n(!0), i(b, null, _(gt.value.filter((h) => h.type === "line"), (h) => (n(), i("g", null, [
679
- h.isVisible ? (n(), i("path", {
680
- key: 0,
681
- d: `M ${h.fullSet}`,
682
- fill: "none",
683
- stroke: h.color,
684
- style: { opacity: "0.6" }
685
- }, null, 8, zn)) : g("", !0),
686
- h.isVisible ? (n(!0), i(b, { key: 1 }, _(h.fullMarkers, (z) => (n(), i("circle", {
687
- key: `sel-dot-under-${h.key}-${z.i}`,
688
- cx: z.x,
689
- cy: z.y,
690
- r: "2",
691
- fill: h.color,
692
- stroke: ae.value,
693
- "stroke-width": "0.5",
694
- style: { opacity: "0.6" }
695
- }, null, 8, Tn))), 128)) : g("", !0)
696
- ]))), 256))
697
- ], 64)),
698
- w("rect", {
699
- x: Oe.value.x,
700
- y: 0,
701
- width: Math.max(0, Oe.value.width),
702
- height: Math.max($.value.height, 0),
703
- fill: ae.value,
704
- rx: S.minimapSelectionRadius,
705
- stroke: "none"
706
- }, null, 8, In),
707
- w("rect", {
708
- x: Oe.value.x,
709
- y: 0,
710
- width: Oe.value.width < 0 ? 0 : Oe.value.width,
711
- height: Math.max($.value.height, 0),
712
- rx: S.minimapSelectionRadius,
713
- fill: ae.value,
714
- style: M({ opacity: fe.value || sl.value ? 0 : 1 })
715
- }, null, 12, Nn),
716
- w("rect", {
717
- x: Oe.value.x,
718
- y: 0,
719
- width: Oe.value.width < 0 ? 0 : Oe.value.width,
720
- height: Math.max($.value.height, 0),
721
- fill: S.minimapSelectedColor,
722
- rx: S.minimapSelectionRadius,
723
- style: M({ opacity: S.minimapSelectedColorOpacity })
724
- }, null, 12, Pn),
725
- !S.minimapMerged && Wt.value < 0 ? (n(), i("line", {
726
- key: 4,
727
- class: "slicer-minimap-zero-line",
728
- x1: 0,
729
- x2: $.value.width,
730
- y1: vl.value,
731
- y2: vl.value,
732
- stroke: S.minimapFrameColor,
733
- "stroke-width": "0.5"
734
- }, null, 8, Fn)) : g("", !0),
735
- S.minimapMerged ? (n(), i("g", Rn, [
736
- N.value && N.value.sliced && N.value.sliced.length ? (n(), i(b, { key: 0 }, [
737
- N.value.selectionSet ? (n(), i("path", {
738
- key: 0,
739
- d: `M${N.value.sliced[0].x},${Math.max($.value.height, 0)} ${N.value.selectionSet} L${N.value.sliced[N.value.sliced.length - 1].x},${Math.max($.value.height, 0)}Z`,
740
- fill: `url(#${$l.value})`,
741
- stroke: "none",
742
- style: { opacity: "1" }
743
- }, null, 8, Vn)) : g("", !0),
744
- N.value.selectionSet ? (n(), i("path", {
745
- key: 1,
746
- d: `M ${N.value.selectionSet}`,
747
- stroke: `${S.minimapLineColor}`,
748
- fill: "transparent",
749
- "stroke-width": "2",
750
- "stroke-linecap": "round",
751
- "stroke-linejoin": "round"
752
- }, null, 8, On)) : g("", !0)
753
- ], 64)) : g("", !0),
754
- N.value && N.value.firstPlot ? (n(), i("circle", {
755
- key: 1,
756
- cx: N.value.firstPlot.x,
757
- cy: N.value.firstPlot.y,
758
- "stroke-width": "0.5",
759
- stroke: ae.value,
760
- r: "3",
761
- fill: S.minimapLineColor
762
- }, null, 8, Bn)) : g("", !0),
763
- N.value && N.value.lastPlot ? (n(), i("circle", {
764
- key: 2,
765
- cx: N.value.lastPlot.x,
766
- cy: N.value.lastPlot.y,
767
- "stroke-width": "0.5",
768
- stroke: ae.value,
769
- r: "3",
770
- fill: S.minimapLineColor
771
- }, null, 8, En)) : g("", !0)
772
- ])) : (n(), i("g", Hn, [
773
- (n(!0), i(b, null, _(gt.value.filter((h) => h.type === "bar"), (h, z) => (n(), i("g", null, [
774
- (n(!0), i(b, null, _(h.points, (C, te) => (n(), i(b, null, [
775
- h && h.hasSelection && h.selectionSet && h.isVisible && !isNaN(C.y) ? (n(), i("rect", {
776
- key: 0,
777
- x: ce(C.x, z, te),
778
- y: C.v >= 0 ? C.y : C.y0,
779
- width: U(z, te),
780
- height: C.v >= 0 ? C.y0 - C.y : C.y - C.y0,
781
- fill: h.color,
782
- style: M({ opacity: te >= It.value && te < Dt.value ? 1 : 0 })
783
- }, null, 12, Dn)) : g("", !0)
784
- ], 64))), 256))
785
- ]))), 256)),
786
- (n(!0), i(b, null, _(gt.value.filter((h) => h.type === "line"), (h) => (n(), i("g", {
787
- key: String(h.key)
788
- }, [
789
- h && h.hasSelection && h.selectionSet && h.isVisible ? (n(), i("path", {
790
- key: 0,
791
- d: `M ${h.selectionSet}`,
792
- stroke: h.color,
793
- fill: "transparent",
794
- "stroke-width": "2",
795
- "stroke-linecap": "round",
796
- "stroke-linejoin": "round"
797
- }, null, 8, Wn)) : g("", !0)
798
- ]))), 128))
799
- ])),
800
- he.value && S.minimapCompact ? (n(), i("rect", {
801
- key: 7,
802
- class: "vue-ui-zoom-compact-minimap-handle",
803
- x: Oe.value.x - 8,
804
- y: 0,
805
- width: 8,
806
- height: $.value.height,
807
- fill: ae.value,
808
- stroke: S.textColor,
809
- rx: 3
810
- }, null, 8, Xn)) : g("", !0),
811
- he.value && S.minimapCompact ? (n(), i("rect", {
812
- key: 8,
813
- class: "vue-ui-zoom-compact-minimap-handle",
814
- x: Oe.value.x + Oe.value.width,
815
- y: 0,
816
- width: 8,
817
- height: $.value.height,
818
- fill: ae.value,
819
- stroke: S.textColor,
820
- rx: 3
821
- }, null, 8, Yn)) : g("", !0),
822
- Ie.value !== null && !He.value ? (n(), i("line", zt(Ht({ key: 9 }, Ql.value)), null, 16)) : g("", !0),
823
- S.minimapMerged ? (n(), i("g", Gn, [
824
- N.value && N.value.firstPlot && N.value.firstPlot.value !== null ? (n(), i("circle", {
825
- key: 0,
826
- cx: N.value.firstPlot.x,
827
- cy: N.value.firstPlot.y,
828
- "stroke-width": "0.5",
829
- stroke: ae.value,
830
- r: "4",
831
- fill: S.minimapLineColor
832
- }, null, 8, Un)) : g("", !0),
833
- N.value && N.value.firstPlot && N.value.firstPlot.value !== null ? (n(), i("circle", {
834
- key: 1,
835
- cx: N.value.firstPlot.x,
836
- cy: N.value.firstPlot.y,
837
- r: 2,
838
- fill: ae.value
839
- }, null, 8, qn)) : g("", !0),
840
- N.value && N.value.lastPlot && N.value.lastPlot.value !== null ? (n(), i("circle", {
841
- key: 2,
842
- cx: N.value.lastPlot.x,
843
- cy: N.value.lastPlot.y,
844
- "stroke-width": "0.5",
845
- stroke: ae.value,
846
- r: "4",
847
- fill: S.minimapLineColor
848
- }, null, 8, Zn)) : g("", !0),
849
- N.value && N.value.lastPlot && N.value.lastPlot.value !== null ? (n(), i("circle", {
850
- key: 3,
851
- cx: N.value.lastPlot.x,
852
- cy: N.value.lastPlot.y,
853
- r: "2",
854
- fill: ae.value
855
- }, null, 8, Kn)) : g("", !0)
856
- ])) : (n(), i("g", Jn, [
857
- (n(!0), i(b, null, _(gt.value.filter((h) => h.type === "line"), (h) => (n(), i("g", {
858
- key: String(h.key)
859
- }, [
860
- h && h.hasSelection && h.selectionSet && h.isVisible ? (n(), i("path", {
861
- key: 0,
862
- d: `M ${h.selectionSet}`,
863
- stroke: h.color,
864
- fill: "transparent",
865
- "stroke-width": "2",
866
- "stroke-linecap": "round",
867
- "stroke-linejoin": "round"
868
- }, null, 8, Qn)) : g("", !0),
869
- h.isVisible ? (n(!0), i(b, { key: 1 }, _(h.selectionMarkers, (z) => (n(), i("circle", {
870
- key: `sel-dot-${h.key}-${z.i}`,
871
- cx: z.x,
872
- cy: z.y,
873
- r: "2.5",
874
- fill: h.color,
875
- stroke: ae.value,
876
- "stroke-width": "0.5"
877
- }, null, 8, jn))), 128)) : g("", !0),
878
- h && h.firstPlot && h.isVisible && h.firstPlot.value !== null ? (n(), i("circle", {
879
- key: 2,
880
- cx: h.firstPlot.x,
881
- cy: h.firstPlot.y,
882
- "stroke-width": "0.5",
883
- stroke: ae.value,
884
- r: "4",
885
- fill: h.color
886
- }, null, 8, ei)) : g("", !0),
887
- h && h.firstPlot && h.isVisible && h.firstPlot.value !== null ? (n(), i("circle", {
888
- key: 3,
889
- cx: h.firstPlot.x,
890
- cy: h.firstPlot.y,
891
- r: "2",
892
- fill: ae.value
893
- }, null, 8, ti)) : g("", !0),
894
- h && h.lastPlot && h.isVisible && h.lastPlot.value !== null ? (n(), i("circle", {
895
- key: 4,
896
- cx: h.lastPlot.x,
897
- cy: h.lastPlot.y,
898
- "stroke-width": "0.5",
899
- stroke: ae.value,
900
- r: "4",
901
- fill: h.color
902
- }, null, 8, li)) : g("", !0),
903
- h && h.lastPlot && h.isVisible && h.lastPlot.value !== null ? (n(), i("circle", {
904
- key: 5,
905
- cx: h.lastPlot.x,
906
- cy: h.lastPlot.y,
907
- r: "2",
908
- fill: ae.value
909
- }, null, 8, ai)) : g("", !0)
910
- ]))), 128))
911
- ])),
912
- (n(!0), i(b, null, _(it.value, (h, z) => (n(), i("rect", {
913
- x: ee.value * z - (S.minimapCompact ? ee.value / 2 : 0),
914
- y: 0,
915
- height: Math.max($.value.height, 0),
916
- width: ee.value < 0 ? 0 : ee.value,
917
- fill: "transparent",
918
- style: M([{ "pointer-events": "all !important" }, { cursor: h >= St.value && h < et.value && S.enableSelectionDrag ? He.value ? "grabbing" : "grab" : "default" }]),
919
- onMousedown: f[0] || (f[0] = (C) => He.value = !0),
920
- onMouseup: f[1] || (f[1] = (C) => He.value = !1),
921
- onMouseenter: (C) => L(h),
922
- onMouseleave: f[2] || (f[2] = (C) => {
923
- Ie.value = null, Ge("trapMouse", null);
924
- })
925
- }, null, 44, oi))), 256))
926
- ], 8, Sn))
927
- ])) : g("", !0),
928
- w("div", {
929
- class: "slider-track",
930
- style: M({ visibility: he.value && S.minimapCompact ? "hidden" : "visible" })
931
- }, null, 4),
932
- w("div", {
933
- class: Qe({ "range-highlight": !0, move: S.enableSelectionDrag }),
934
- onMousedown: f[3] || (f[3] = (h) => He.value = !0),
935
- onMouseup: f[4] || (f[4] = (h) => He.value = !1),
936
- style: M({
937
- ...Ve.value,
938
- cursor: He.value ? "grabbing" : "grab",
939
- visibility: he.value && S.minimapCompact ? "hidden" : "visible"
940
- })
941
- }, null, 38),
942
- S.enableRangeHandles ? Ta((n(), i("input", {
943
- key: 1,
944
- ref_key: "rangeStart",
945
- ref: Ne,
946
- type: "range",
947
- class: Qe({
948
- "range-left": !0,
949
- "range-handle": !0,
950
- "range-minimap": he.value && S.verticalHandles,
951
- "range-invisible": he.value && S.minimapCompact
952
- }),
953
- min: S.min,
954
- max: S.minimapCompact && he.value ? Math.max(0, se.value - 1) : S.max,
955
- "onUpdate:modelValue": f[5] || (f[5] = (h) => hl.value = h),
956
- onInput: f[6] || (f[6] = (h) => hl.value = h.target.valueAsNumber),
957
- onChange: Ye,
958
- onKeyup: io(Ye, ["enter"]),
959
- onBlur: Ye,
960
- onMouseenter: f[7] || (f[7] = (h) => c("start")),
961
- onPointerup: Ye
962
- }, null, 42, ni)), [
963
- [
964
- uo,
965
- hl.value,
966
- void 0,
967
- { number: !0 }
968
- ]
969
- ]) : g("", !0),
970
- S.enableRangeHandles ? Ta((n(), i("input", {
971
- key: 2,
972
- ref_key: "rangeEnd",
973
- ref: Yt,
974
- type: "range",
975
- class: Qe({
976
- "range-right": !0,
977
- "range-handle": !0,
978
- "range-minimap": he.value && S.verticalHandles,
979
- "range-invisible": he.value && S.minimapCompact
980
- }),
981
- min: S.min,
982
- max: S.minimapCompact && he.value ? Math.max(0, se.value - 1) : S.max,
983
- "onUpdate:modelValue": f[8] || (f[8] = (h) => Xt.value = h),
984
- onInput: f[9] || (f[9] = (h) => Xt.value = h.target.valueAsNumber),
985
- onChange: Ye,
986
- onKeyup: io(Ye, ["enter"]),
987
- onBlur: Ye,
988
- onMouseenter: f[10] || (f[10] = (h) => c("end")),
989
- onPointerup: Ye
990
- }, null, 42, ii)), [
991
- [
992
- uo,
993
- Xt.value,
994
- void 0,
995
- { number: !0 }
996
- ]
997
- ]) : g("", !0),
998
- xe.value.left ? (n(), i("div", {
999
- key: 3,
1000
- ref_key: "tooltipLeft",
1001
- ref: Pe,
1002
- class: Qe({
1003
- "range-tooltip": !0,
1004
- "range-tooltip-visible": bt.value,
1005
- "range-tooltip-arrow": Ve.value.arrowLeft && !S.verticalHandles,
1006
- "range-tooltip-arrow-left": !Ve.value.arrowLeft && !S.verticalHandles
1007
- }),
1008
- style: M({
1009
- left: Ve.value.tooltipLeft,
1010
- color: v(ht)(S.selectColor),
1011
- backgroundColor: S.selectColor,
1012
- border: `1px solid ${ae.value}`,
1013
- zIndex: `${Jl.value + 4}`,
1014
- visibility: Zt.value || xe.value.left === xe.value.right ? "hidden" : "visible",
1015
- top: he.value && S.minimapCompact ? "calc(-100% - 12px)" : "-100%"
1016
- })
1017
- }, ue(xe.value.left), 7)) : g("", !0),
1018
- (Zt.value || xe.value.left === xe.value.right) && (xe.value.left || xe.value.right) ? (n(), i("div", {
1019
- key: 4,
1020
- ref: "tooltipMerge",
1021
- class: Qe({
1022
- "range-tooltip": !0,
1023
- "range-tooltip-visible": bt.value,
1024
- "range-tooltip-arrow": !0,
1025
- "range-tooltip-arrow-left": !Ve.value.arrowLeft && !S.verticalHandles,
1026
- "range-tooltip-arrow-right": !Ve.value.arrowRight && !S.verticalHandles
1027
- }),
1028
- style: M({
1029
- left: Ve.value.tooltipCenter,
1030
- width: Kt.value.width + "px",
1031
- color: v(ht)(S.selectColor),
1032
- backgroundColor: S.selectColor,
1033
- border: `1px solid ${ae.value}`,
1034
- zIndex: "4",
1035
- top: he.value && S.minimapCompact ? "calc(-100% - 12px)" : "-100%"
1036
- })
1037
- }, ue(xe.value.left === xe.value.right ? xe.value.left : `${xe.value.left} - ${xe.value.right}`), 7)) : g("", !0),
1038
- xe.value.right ? (n(), i("div", {
1039
- key: 5,
1040
- ref_key: "tooltipRight",
1041
- ref: Le,
1042
- class: Qe({
1043
- "range-tooltip": !0,
1044
- "range-tooltip-visible": bt.value,
1045
- "range-tooltip-arrow": Ve.value.arrowRight && !S.verticalHandles,
1046
- "range-tooltip-arrow-right": !Ve.value.arrowRight && !S.verticalHandles
1047
- }),
1048
- style: M({
1049
- left: Ve.value.tooltipRight,
1050
- color: v(ht)(S.selectColor),
1051
- backgroundColor: S.selectColor,
1052
- border: `1px solid ${ae.value}`,
1053
- zIndex: "4",
1054
- visibility: Zt.value || xe.value.left === xe.value.right ? "hidden" : "visible",
1055
- top: he.value && S.minimapCompact ? "calc(-100% - 12px)" : "-100%"
1056
- })
1057
- }, ue(xe.value.right), 7)) : g("", !0)
1058
- ], 544)
1059
- ], 544));
1060
- }
1061
- }, ri = /* @__PURE__ */ yo(si, [["__scopeId", "data-v-f0a40d04"]]), ci = ["id"], vi = ["id"], di = ["viewBox", "aria-label"], hi = ["x", "y", "width", "height"], mi = { key: 1 }, fi = { class: "vue-ui-xy-grid" }, gi = ["stroke", "x1", "x2", "y1", "y2"], xi = ["stroke", "x1", "x2", "y1", "y2"], bi = { key: 1 }, yi = ["x1", "x2", "y1", "y2", "stroke"], pi = ["x1", "x2", "y1", "y2", "stroke"], ki = ["x1", "x2", "y1", "y2", "stroke"], wi = { key: 3 }, Si = ["d", "stroke"], $i = { key: 4 }, _i = ["d", "stroke"], Mi = ["id"], Li = ["stop-color"], Ci = ["stop-color"], Ai = ["stop-color"], zi = ["id"], Ti = ["stop-color"], Ii = ["stop-color"], Ni = ["stop-color"], Pi = ["id"], Fi = ["stop-color"], Ri = ["stop-color"], Vi = ["id"], Oi = ["stop-color"], Bi = ["stop-color"], Ei = ["id"], Hi = ["stop-color"], Di = ["stop-color"], Wi = ["x", "y", "height", "width", "fill"], Xi = ["x", "y", "width"], Yi = { key: 0 }, Gi = ["x", "y", "height", "width", "fill"], Ui = ["x", "y", "height", "width", "rx", "fill", "stroke", "stroke-width"], qi = ["x", "y", "height", "width", "rx", "fill", "stroke", "stroke-width"], Zi = ["width", "x", "y"], Ki = { key: 0 }, Ji = ["id"], Qi = ["fill"], ji = ["x1", "x2", "y1", "y2", "stroke", "marker-end"], eu = ["x", "y", "font-size", "fill"], tu = ["stroke", "x1", "x2", "y1", "y2"], lu = { key: 3 }, au = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], ou = ["x", "y", "width", "height", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin", "stroke-dasharray"], nu = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], iu = ["fill", "font-size", "transform"], uu = ["x1", "x2", "y1", "y2", "stroke"], su = ["x", "y", "font-size", "fill"], ru = ["x1", "x2", "y1", "y2", "stroke"], cu = ["x", "y", "font-size", "fill"], vu = ["width", "x", "y"], du = { style: { width: "100%" } }, hu = { key: 0 }, mu = ["id"], fu = ["fill"], gu = ["x1", "x2", "y1", "y2", "stroke", "marker-end"], xu = ["x", "y", "font-size", "fill"], bu = ["d", "stroke", "stroke-width", "stroke-dasharray"], yu = ["d", "stroke", "stroke-width", "stroke-dasharray"], pu = { key: 6 }, ku = { key: 7 }, wu = ["d", "fill", "fill-opacity"], Su = { key: 0 }, $u = ["d", "fill"], _u = ["d", "fill"], Mu = ["d", "fill"], Lu = ["d", "fill"], Cu = ["d", "stroke", "stroke-width", "stroke-dasharray"], Au = ["d", "stroke", "stroke-width", "stroke-dasharray"], zu = ["width", "x", "y"], Tu = { style: { width: "100%" } }, Iu = { key: 3 }, Nu = ["id"], Pu = ["fill"], Fu = ["x1", "x2", "y1", "y2", "stroke", "marker-end"], Ru = ["x", "y", "font-size", "fill"], Vu = { key: 8 }, Ou = ["x", "y", "font-size", "fill"], Bu = ["x", "y", "font-size", "fill", "font-weight"], Eu = { key: 9 }, Hu = ["x", "y", "font-size", "fill"], Du = { key: 10 }, Wu = ["x", "y"], Xu = ["innerHTML"], Yu = ["x", "y"], Gu = ["innerHTML"], Uu = ["x1", "x2", "y1", "y2", "stroke"], qu = { key: 11 }, Zu = ["x", "y", "font-size", "fill"], Ku = { key: 12 }, Ju = ["x", "y"], Qu = ["innerHTML"], ju = ["x", "y"], es = ["innerHTML"], ts = ["x1", "x2", "y1", "y2", "stroke"], ls = ["x", "y", "font-size", "fill", "innerHTML"], as = ["x", "y", "font-size", "fill", "innerHTML"], os = ["x", "y", "font-size", "fill", "innerHTML"], ns = ["x", "y", "font-size", "fill", "innerHTML"], is = ["id"], us = ["stop-color"], ss = ["stop-color"], rs = ["x", "y", "width", "height", "fill", "onMouseenter"], cs = ["font-size", "fill", "transform"], vs = ["x", "y", "font-size", "fill"], ds = ["text-anchor", "font-size", "fill", "transform", "onClick"], hs = ["text-anchor", "font-size", "fill", "transform", "innerHTML", "onClick"], ms = { key: 15 }, fs = ["x1", "y1", "x2", "y2", "stroke", "stroke-width", "stroke-dasharray"], gs = ["x1", "y1", "x2", "y2", "stroke", "stroke-width", "stroke-dasharray"], xs = ["y", "x", "width", "height", "fill"], bs = ["id", "x", "y", "font-size", "fill", "text-anchor"], ys = {
1062
- key: 16,
1063
- style: { "pointer-events": "none" }
1064
- }, ps = ["x", "y"], ks = ["innerHTML"], ws = ["cx", "cy", "r", "fill"], Ss = ["data-start", "data-end"], $s = {
1065
- key: 4,
1066
- class: "vue-data-ui-watermark"
1067
- }, _s = {
1068
- class: "vue-ui-xy-tag-arrow",
1069
- height: "20",
1070
- viewBox: "0 0 10 20",
1071
- style: { position: "absolute", right: "100%", top: "50%", transform: "translateY(-50%)" }
1072
- }, Ms = ["fill"], Ls = ["innerHTML"], Cs = {
1073
- class: "vue-ui-xy-tag-arrow",
1074
- height: "100%",
1075
- viewBox: "0 0 10 20",
1076
- style: { position: "absolute", left: "100%", top: "50%", transform: "translateY(-50%)" }
1077
- }, As = ["fill"], zs = ["innerHTML"], Ts = {
1078
- class: "vue-ui-xy-tag-arrow",
1079
- height: "20",
1080
- viewBox: "0 0 10 20",
1081
- style: { position: "absolute", right: "100%", top: "50%", transform: "translateY(-50%)" }
1082
- }, Is = ["fill"], Ns = ["innerHTML"], Ps = {
1083
- class: "vue-ui-xy-tag-arrow",
1084
- height: "100%",
1085
- viewBox: "0 0 10 20",
1086
- style: { position: "absolute", left: "100%", top: "50%", transform: "translateY(-50%)" }
1087
- }, Fs = ["fill"], Rs = ["innerHTML"], Vs = ["id"], Os = ["onClick"], Bs = {
1088
- key: 0,
1089
- viewBox: "0 0 20 12",
1090
- height: "1em",
1091
- width: "1.43em"
1092
- }, Es = ["stroke", "fill"], Hs = {
1093
- key: 1,
1094
- viewBox: "0 0 40 40",
1095
- height: "1em",
1096
- width: "1em"
1097
- }, Ds = ["fill"], Ws = ["fill"], Xs = {
1098
- key: 2,
1099
- viewBox: "0 0 12 12",
1100
- height: "1em",
1101
- width: "1em"
1102
- }, Ys = {
1103
- style: { display: "flex", "flex-direction": "row", gap: "6px", "align-items": "center", "padding-left": "6px" },
1104
- "data-dom-to-png-ignore": ""
1105
- }, Gs = ["innerHTML"], Us = {
1106
- __name: "vue-ui-xy",
1107
- props: {
1108
- config: {
1109
- type: Object,
1110
- default() {
1111
- return {};
1112
- }
1113
- },
1114
- dataset: {
1115
- type: Array,
1116
- default() {
1117
- return [];
1118
- }
1119
- },
1120
- selectedXIndex: {
1121
- type: Number,
1122
- default: void 0
1123
- }
1124
- },
1125
- emits: ["selectTimeLabel", "selectX", "selectLegend"],
1126
- setup(S, { expose: ga, emit: xa }) {
1127
- const m = S, nt = Ot(() => import("./DataTable-DFJ-uXFk.js")), ge = Ot(() => import("./Tooltip-Bv-2Sizc.js")), Se = Ot(() => import("./UserOptions-BpcEmsVG.js")), he = Ot(() => import("./BaseIcon-DW7Viin8.js")), $l = Ot(() => import("./vue-ui-table-sparkline-B7dymruQ.js")), sl = Ot(() => import("./PackageVersion-BzOBYV_n.js")), Tt = Ot(() => import("./PenAndPaper-DwI_W13k.js")), _l = Ot(() => import("./BaseDraggableDialog-D9yisoCl.js")), It = xa, Dt = Eo(), Yl = Ho(), { vue_ui_xy: Ye } = Uo(), je = y(null), Ge = y(null), Re = y(null), ft = y(null), pt = y(null), kt = y(null), Ml = y(null), Ve = y(null), Ll = y(null), Nt = y(null), Cl = y(null), ae = y(null), it = y(null), rl = y(null), Pt = y(0), $ = y(null), wt = y(!0), se = y(600), re = y(1e3), cl = y("0 0 1000 600"), St = y({ x: 0, y: 0 }), et = y({ line: "line", bar: "bar", plot: "plot" }), $t = y(!1), ee = y(!1), Al = y(!1), ut = y(null), ce = y([]), U = y(ca()), zl = y(0), _t = y(0), Ft = y(0), Wt = y(!0), Tl = y(0), H = y(null), Gl = y(!1), vl = y(!0), dl = y(!0), Me = y(null), N = y({}), gt = y(null), Oe = y(!1), Ie = y(null), A = y(null), hl = x(() => ({
1128
- height: se.value,
1129
- width: re.value
1130
- }));
1131
- function Xt(l) {
1132
- return Number.isFinite(l) ? Math.max(0, Math.floor(l)) : 0;
1133
- }
1134
- function Il(l, s, e = 0) {
1135
- return Number.isFinite(l) && Number.isFinite(s) && Math.abs(s) > 1e-9 ? l / s : e;
1136
- }
1137
- const Ul = y(!1), L = y({
1138
- xAxis: 18,
1139
- yAxis: 12,
1140
- dataLabels: 20,
1141
- plotLabels: 10
1142
- }), Ne = y({ plot: 3, line: 3 });
1143
- Sl(() => {
1144
- Oe.value = !0, m.dataset.length && m.dataset.forEach((l, s) => {
1145
- [null, void 0].includes(l.series) && Ca({
1146
- componentName: "VueUiXy",
1147
- type: "datasetSerieAttribute",
1148
- property: "series (number[])",
1149
- index: s,
1150
- debug: Mt.value
1151
- });
1152
- });
1153
- });
1154
- function Yt() {
1155
- if (!Object.keys(m.config || {}).length)
1156
- return Ye;
1157
- const l = za({
1158
- userConfig: m.config,
1159
- defaultConfig: Ye
1160
- });
1161
- return m.config && Je(m.config, "chart.highlightArea") && (Array.isArray(m.config.chart.highlightArea) ? l.chart.highlightArea = m.config.chart.highlightArea : l.chart.highlightArea = [m.config.chart.highlightArea]), m.config && Je(m.config, "chart.grid.labels.yAxis.scaleMin") ? l.chart.grid.labels.yAxis.scaleMin = m.config.chart.grid.labels.yAxis.scaleMin : l.chart.grid.labels.yAxis.scaleMin = null, m.config && Je(m.config, "chart.grid.labels.yAxis.scaleMax") ? l.chart.grid.labels.yAxis.scaleMax = m.config.chart.grid.labels.yAxis.scaleMax : l.chart.grid.labels.yAxis.scaleMax = null, m.config && Je(m.config, "chart.zoom.startIndex") ? l.chart.zoom.startIndex = m.config.chart.zoom.startIndex : l.chart.zoom.startIndex = null, m.config && Je(m.config, "chart.zoom.endIndex") ? l.chart.zoom.endIndex = m.config.chart.zoom.endIndex : l.chart.zoom.endIndex = null, m.config && Je(m.config, "chart.grid.labels.yAxis.groupColor") ? l.chart.grid.labels.yAxis.groupColor = m.config.chart.grid.labels.yAxis.groupColor : l.chart.grid.labels.yAxis.groupColor = null, m.config && Je(m.config, "chart.annotations") && Array.isArray(m.config.chart.annotations) && m.config.chart.annotations.length ? l.chart.annotations = m.config.chart.annotations.map((s) => za({
1162
- defaultConfig: Ye.chart.annotations[0],
1163
- userConfig: s
1164
- })) : l.chart.annotations = [], m.config && Je(m.config, "chart.grid.position") && m.config.chart.grid.position === "start" && m.dataset.length && m.dataset.some((s) => s.type === "bar") && (l.chart.grid.position = "middle", Je(m.config, "debug") && console.warn("Vue Data UI - VueUiXy - config.chart.grid.position was overriden to `middle` because your dataset contains a bar")), m.config && Je(m.config, "chart.grid.labels.yAxis.serieNameFormatter") ? l.chart.grid.labels.yAxis.serieNameFormatter = m.config.chart.grid.labels.yAxis.serieNameFormatter : l.chart.grid.labels.yAxis.serieNameFormatter = null, m.config && Je(m.config, "events.datapointEnter") ? l.events.datapointEnter = m.config.events.datapointEnter : l.events.datapointEnter = null, m.config && Je(m.config, "events.datapointLeave") ? l.events.datapointLeave = m.config.events.datapointLeave : l.events.datapointLeave = null, m.config && Je(m.config, "events.datapointClick") ? l.events.datapointClick = m.config.events.datapointClick : l.events.datapointClick = null, l.theme ? {
1165
- ...za({
1166
- userConfig: an.vue_ui_xy[l.theme] || m.config,
1167
- defaultConfig: l
1168
- }),
1169
- customPalette: ln[l.theme] || m.palette
1170
- } : l;
1171
- }
1172
- const Gt = x({
1173
- get() {
1174
- return !!m.dataset && m.dataset.length;
1175
- },
1176
- set(l) {
1177
- return l;
1178
- }
1179
- }), t = y(Yt()), k = y({
1180
- dataLabels: { show: !0 },
1181
- showTooltip: !0,
1182
- showTable: !1,
1183
- isStacked: !1,
1184
- useIndividualScale: !1
1185
- });
1186
- function Ut() {
1187
- Ul.value ? (k.value.isStacked = t.value.chart.grid.labels.yAxis.stacked, k.value.useIndividualScale == null && (k.value.useIndividualScale = t.value.chart.grid.labels.yAxis.useIndividualScale)) : (k.value = {
1188
- dataLabels: { show: !0 },
1189
- showTooltip: t.value.chart.tooltip.show === !0,
1190
- showTable: t.value.showTable === !0,
1191
- isStacked: t.value.chart.grid.labels.yAxis.stacked,
1192
- useIndividualScale: t.value.chart.grid.labels.yAxis.useIndividualScale
1193
- }, Ul.value = !0);
1194
- }
1195
- const Mt = x(() => !!t.value.debug), { loading: me, FINAL_DATASET: fe, manualLoading: ml } = cn({
1196
- ...Do(m),
1197
- FINAL_CONFIG: t,
1198
- prepareConfig: Yt,
1199
- callback: () => {
1200
- Promise.resolve().then(async () => {
1201
- await be(), k.value.showTable = t.value.showTable;
1202
- });
1203
- },
1204
- skeletonDataset: [
1205
- {
1206
- name: "",
1207
- series: [0, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 134],
1208
- type: "line",
1209
- smooth: !0,
1210
- color: "#BABABA"
1211
- },
1212
- {
1213
- name: "",
1214
- series: [0, 0.5, 1, 1.5, 2.5, 4, 6.5, 10.5, 17, 27.5, 44.5, 67],
1215
- type: "bar",
1216
- color: "#CACACA"
1217
- }
1218
- ],
1219
- skeletonConfig: qo({
1220
- defaultConfig: t.value,
1221
- userConfig: {
1222
- useCssAnimation: !1,
1223
- showTable: !1,
1224
- chart: {
1225
- annotations: [],
1226
- highlightArea: [],
1227
- backgroundColor: "#99999930",
1228
- grid: {
1229
- stroke: "#6A6A6A",
1230
- labels: {
1231
- show: !1,
1232
- axis: {
1233
- yLabel: "",
1234
- xLabel: ""
1235
- },
1236
- xAxisLabels: { show: !1 },
1237
- yAxis: {
1238
- commonScaleSteps: 10,
1239
- useNiceScale: !0,
1240
- scaleMin: 0,
1241
- scaleMax: 134
1242
- },
1243
- zeroLine: { show: !0 }
1244
- }
1245
- },
1246
- padding: {
1247
- top: 12,
1248
- bottom: 24,
1249
- left: 24,
1250
- right: 24
1251
- },
1252
- userOptions: { show: !1 },
1253
- zoom: {
1254
- show: !1,
1255
- startIndex: null,
1256
- endIndex: null
1257
- }
1258
- },
1259
- bar: {
1260
- serieName: { show: !1 },
1261
- labels: { show: !1 },
1262
- border: {
1263
- useSerieColor: !1,
1264
- stroke: "#999999"
1265
- }
1266
- },
1267
- line: {
1268
- dot: {
1269
- useSerieColor: !1,
1270
- fill: "#8A8A8A"
1271
- },
1272
- labels: { show: !1 }
1273
- }
1274
- }
1275
- })
1276
- });
1277
- function ba(l) {
1278
- const s = /* @__PURE__ */ new WeakMap();
1279
- return (e, ...u) => {
1280
- let a = s.get(e);
1281
- const r = JSON.stringify(u);
1282
- if (a && a.has(r)) return a.get(r);
1283
- const o = l(e, ...u);
1284
- return a || (a = /* @__PURE__ */ new Map(), s.set(e, a)), a.set(r, o), o;
1285
- };
1286
- }
1287
- const ya = ba((l, s) => Aa({ data: l, threshold: s })), st = (l) => ya(l, t.value.downsample.threshold), Be = x({
1288
- get: () => Math.max(...fe.value.map((l) => st(l.series).length)),
1289
- set: (l) => l
1290
- }), p = y({ start: 0, end: Be.value }), tt = y({ start: 0, end: Be.value }), ql = x(() => t.value.chart.zoom.preview.enable && (tt.value.start !== p.value.start || tt.value.end !== p.value.end));
1291
- function Nl(l, s) {
1292
- tt.value[l] = s;
1293
- }
1294
- function Ue() {
1295
- const l = Math.max(
1296
- 1,
1297
- ...fe.value.map((u) => st(u.series).length)
1298
- );
1299
- let s = Math.max(0, Math.min(p.value.start ?? 0, l - 1)), e = Math.max(s + 1, Math.min(p.value.end ?? l, l));
1300
- (!Number.isFinite(s) || !Number.isFinite(e) || e <= s) && (s = 0, e = l), p.value = { start: s, end: e }, tt.value.start = s, tt.value.end = e;
1301
- }
1302
- const xt = x(() => {
1303
- const { left: l, top: s, width: e, height: u } = c.value, a = p.value.start, o = p.value.end - a, R = e / o, E = tt.value.start - a, X = tt.value.end - a, T = Math.max(0, Math.min(o, E)), V = Math.max(0, Math.min(o, X));
1304
- return {
1305
- x: l + T * R,
1306
- y: s,
1307
- width: (V - T) * R,
1308
- height: u,
1309
- fill: t.value.chart.zoom.preview.fill,
1310
- stroke: t.value.chart.zoom.preview.stroke,
1311
- "stroke-width": t.value.chart.zoom.preview.strokeWidth,
1312
- "stroke-dasharray": t.value.chart.zoom.preview.strokeDasharray,
1313
- "stroke-linecap": "round",
1314
- "stroke-linejoin": "round",
1315
- style: {
1316
- pointerEvents: "none",
1317
- transition: "none !important",
1318
- animation: "none !important"
1319
- }
1320
- };
1321
- });
1322
- mt(() => m.selectedXIndex, (l) => {
1323
- if ([null, void 0].includes(m.selectedXIndex)) {
1324
- A.value = null;
1325
- return;
1326
- }
1327
- const s = l - p.value.start;
1328
- s < 0 || l >= p.value.end ? A.value = null : A.value = s ?? null;
1329
- }, { immediate: !0 });
1330
- const { isPrinting: lt, isImaging: rt, generatePdf: Pl, generateImage: Zl } = rn({
1331
- elementId: `vue-ui-xy_${U.value}`,
1332
- fileName: t.value.chart.title.text || "vue-ui-xy",
1333
- options: t.value.chart.userOptions.print
1334
- }), pa = y(!1), qt = x(() => Zo(t.value.customPalette)), fl = x(() => {
1335
- if (t.value.chart.grid.labels.yAxis.scaleMin !== null)
1336
- return t.value.chart.grid.labels.yAxis.scaleMin;
1337
- const l = Math.min(...Pe.value.filter((s) => !ce.value.includes(s.id)).map((s) => Math.min(...s.series)));
1338
- return l > 0 ? 0 : l;
1339
- }), gl = x(() => {
1340
- if (t.value.chart.grid.labels.yAxis.scaleMax)
1341
- return t.value.chart.grid.labels.yAxis.scaleMax;
1342
- const l = Math.max(...Pe.value.filter((s) => !ce.value.includes(s.id)).map((s) => Math.max(...s.series)));
1343
- return fl.value === l ? l + 1 : l;
1344
- }), Ee = x(() => t.value.chart.grid.labels.yAxis.useNiceScale ? Xl(fl.value, gl.value < 0 ? 0 : gl.value, t.value.chart.grid.labels.yAxis.commonScaleSteps) : al(fl.value, gl.value < 0 ? 0 : gl.value, t.value.chart.grid.labels.yAxis.commonScaleSteps)), He = x(() => [null, void 0].includes(t.value.chart.grid.labels.yAxis.scaleMin) ? Ee.value.min >= 0 ? 0 : Math.abs(Ee.value.min) : -Ee.value.min), Pe = x(() => wt.value ? fe.value.map((l, s) => {
1345
- const e = st(l.series), u = `uniqueId_${s}`;
1346
- return {
1347
- ...l,
1348
- slotAbsoluteIndex: s,
1349
- series: e.map((a) => ua(a) ? a : null).slice(p.value.start, p.value.end),
1350
- color: vo(l.color ? l.color : qt.value[s] ? qt.value[s] : ho[s]),
1351
- id: u,
1352
- scaleLabel: l.scaleLabel || u
1353
- };
1354
- }) : fe.value), Le = x(() => Pe.value.map((l, s) => ({
1355
- absoluteIndex: s,
1356
- ...l,
1357
- series: l.series.map((e) => e + He.value),
1358
- absoluteValues: l.series,
1359
- segregate: () => Va(l),
1360
- isSegregated: ce.value.includes(l.id)
1361
- }))), Ce = x(() => Pe.value.map((l, s) => ({
1362
- ...l,
1363
- series: l.series.map((e) => e + He.value),
1364
- absoluteValues: l.series
1365
- })).filter((l) => !ce.value.includes(l.id)));
1366
- function xl() {
1367
- let l = 0;
1368
- Cl.value && (l = Array.from(Cl.value.querySelectorAll("text")).reduce((a, r) => {
1369
- const o = r.getComputedTextLength();
1370
- return (o > a ? o : a) + t.value.chart.grid.labels.yAxis.scaleValueOffsetX;
1371
- }, 0));
1372
- const s = Ll.value ? Ll.value.getBoundingClientRect().width + t.value.chart.grid.labels.axis.yLabelOffsetX + L.value.yAxis : 0, e = t.value.chart.grid.labels.yAxis.crosshairSize;
1373
- return l + s + e;
1374
- }
1375
- const bt = y(0), Kl = Ia((l) => {
1376
- bt.value = l;
1377
- }, 100);
1378
- so((l) => {
1379
- const s = Nt.value;
1380
- if (!s) return;
1381
- const e = new ResizeObserver((u) => {
1382
- Kl(u[0].contentRect.height);
1383
- });
1384
- e.observe(s), l(() => e.disconnect());
1385
- }), il(() => {
1386
- bt.value = 0;
1387
- });
1388
- const Fl = x(() => {
1389
- let l = 0;
1390
- Ve.value && (l = Ve.value.getBBox().height);
1391
- let s = 0;
1392
- return Nt.value && (s = bt.value), l + s + L.value.xAxis;
1393
- }), Jl = x(() => fe.value.some((l) => l.useProgression)), c = x(() => {
1394
- let l = 0;
1395
- const s = 36;
1396
- t.value.chart.grid.labels.show && (k.value.useIndividualScale && !k.value.isStacked ? l = (fe.value.length - ce.value.length) * (t.value.chart.grid.labels.yAxis.labelWidth + s) : k.value.useIndividualScale && k.value.isStacked ? l = t.value.chart.grid.labels.yAxis.labelWidth + s : l = xl());
1397
- const e = t.value.chart.labels.fontSize * 1.1, u = Jl.value ? 24 : 6;
1398
- if (Nt.value) {
1399
- const o = Nt.value.getBBox().x;
1400
- o < 0 && (l += Math.abs(o));
1401
- }
1402
- const a = re.value - l - t.value.chart.grid.labels.yAxis.crosshairSize - u - t.value.chart.padding.left - t.value.chart.padding.right, r = t.value.chart.grid.position === "middle" ? 0 : a / P.value / 2;
1403
- return {
1404
- top: t.value.chart.padding.top + e,
1405
- right: re.value - u - t.value.chart.padding.right,
1406
- bottom: se.value - Fl.value - t.value.chart.padding.bottom - t.value.chart.grid.labels.axis.xLabelOffsetY,
1407
- left: l + t.value.chart.grid.labels.yAxis.crosshairSize - r + t.value.chart.padding.left,
1408
- height: se.value - Fl.value - t.value.chart.padding.top - t.value.chart.padding.bottom - e - t.value.chart.grid.labels.axis.xLabelOffsetY,
1409
- width: a,
1410
- scaleLabelX: l,
1411
- individualOffsetX: s
1412
- };
1413
- }), Zt = x(() => {
1414
- const l = t.value.chart.grid.position === "middle" ? 1 : 0, s = P.value + l, e = J(c.value.top), u = J(c.value.bottom);
1415
- return Array.from({ length: s }).map((a, r) => {
1416
- const o = c.value.width / P.value * r + c.value.left + oe.value;
1417
- return `M${o},${e} L${o},${u}`;
1418
- }).join(" ");
1419
- }), Kt = x(() => {
1420
- if (!t.value.chart.grid.labels.xAxis.showCrosshairs) return "";
1421
- const l = c.value.width / P.value, s = t.value.chart.grid.labels.xAxis.crosshairSize, e = t.value.chart.grid.labels.xAxis.crosshairsAlwaysAtZero;
1422
- return jt.value.map((u, a) => {
1423
- if (!u || !u.text) return null;
1424
- const r = c.value.left + l * a + l / 2, o = e ? _e.value - (_e.value === c.value.bottom ? 0 : s / 2) : c.value.bottom, R = e ? _e.value + s / (_e.value === c.value.bottom ? 1 : 2) : c.value.bottom + s;
1425
- return `M${r},${o} L${r},${R}`;
1426
- }).filter(Boolean).join(" ");
1427
- });
1428
- function Jt() {
1429
- return !!Yl?.vnode.props?.onSelectTimeLabel;
1430
- }
1431
- function xe(l, s, e) {
1432
- if (!gt.value) {
1433
- const u = document.createElement("canvas");
1434
- gt.value = u.getContext("2d");
1435
- }
1436
- return gt.value.font = `normal ${l}px sans-serif`, gt.value;
1437
- }
1438
- function Ql() {
1439
- const l = je.value.querySelectorAll(".vue-ui-xy-tag");
1440
- l.length && Array.from(l).forEach((s) => s.style.opacity = "0");
1441
- }
1442
- function d(l, s, e, u, a) {
1443
- e && (N.value[`${l}_${s}_${u}_${a}`] = e);
1444
- }
1445
- const f = y(!1);
1446
- async function h(l = !1) {
1447
- await ul(), f.value = l, Gl.value && (dl.value = l);
1448
- }
1449
- function z() {
1450
- $t.value = !$t.value;
1451
- }
1452
- const C = x(() => {
1453
- const l = Math.max(...fe.value.map((s) => Aa({ data: s.series, threshold: t.value.downsample.threshold }).length));
1454
- return bo({
1455
- values: t.value.chart.grid.labels.xAxisLabels.values,
1456
- maxDatapoints: l,
1457
- formatter: t.value.chart.grid.labels.xAxisLabels.datetimeFormatter,
1458
- start: p.value.start,
1459
- end: p.value.end
1460
- });
1461
- }), te = x(() => {
1462
- const l = Math.max(...fe.value.map((s) => Aa({ data: s.series, threshold: t.value.downsample.threshold }).length));
1463
- return bo({
1464
- values: t.value.chart.grid.labels.xAxisLabels.values,
1465
- maxDatapoints: l,
1466
- formatter: t.value.chart.grid.labels.xAxisLabels.datetimeFormatter,
1467
- start: 0,
1468
- end: Be.value
1469
- });
1470
- }), qe = x(() => {
1471
- const l = t.value.chart.grid.labels.xAxisLabels.modulo;
1472
- return C.value.length ? Math.min(l, [...new Set(C.value.map((s) => s.text))].length) : l;
1473
- });
1474
- function Qt(l) {
1475
- let s = null, e = null;
1476
- return (...u) => {
1477
- const a = JSON.stringify(u);
1478
- return a === s || (s = a, e = l(...u)), e;
1479
- };
1480
- }
1481
- const bl = Qt((l, s, e, u, a, r, o, R) => {
1482
- if (l)
1483
- return u.length <= 2 ? u.map((B, ie) => ({ text: B, absoluteIndex: ie })) : u.map((B, ie) => ({ text: ie === 0 || ie === u.length - 1 || o != null && ie === o ? B : "", absoluteIndex: ie }));
1484
- if (!s)
1485
- return u.map((D, B) => ({ text: D, absoluteIndex: B }));
1486
- const E = Math.max(1, e || 1);
1487
- if (R <= E)
1488
- return u.map((D, B) => ({ text: D, absoluteIndex: B }));
1489
- const X = [];
1490
- for (let D = 0; D < u.length; D += 1) {
1491
- const B = u[D] ?? "";
1492
- if (!B) continue;
1493
- const ie = r + D - 1 >= 0 ? a[r + D - 1] ?? "" : null;
1494
- B !== ie && X.push(D);
1495
- }
1496
- if (!X.length)
1497
- return u.map((D, B) => ({ text: "", absoluteIndex: B }));
1498
- const T = X.length, V = E, j = Math.max(2, Math.min(V - 3, T)), I = Math.min(T, V + 3);
1499
- let Y = Math.min(V, T), O = 1 / 0;
1500
- for (let D = j; D <= I; D += 1) {
1501
- const B = (T - 1) % (D - 1), ie = Math.abs(D - V), We = B * 10 + ie;
1502
- We < O && (O = We, Y = D);
1503
- }
1504
- const de = /* @__PURE__ */ new Set();
1505
- if (Y <= 1)
1506
- de.add(X[Math.round((T - 1) / 2)]);
1507
- else {
1508
- const D = (T - 1) / (Y - 1);
1509
- for (let B = 0; B < Y; B += 1)
1510
- de.add(X[Math.round(B * D)]);
1511
- }
1512
- return u.map((D, B) => ({
1513
- text: de.has(B) ? D : "",
1514
- absoluteIndex: B
1515
- }));
1516
- }), jt = x(() => {
1517
- const l = t.value.chart.grid.labels.xAxisLabels, s = C.value || [], e = te.value || [], u = p.value.start ?? 0, a = A.value, r = P.value, o = s.map((E) => E?.text ?? ""), R = e.map((E) => E?.text ?? "");
1518
- return bl(
1519
- !!l.showOnlyFirstAndLast,
1520
- !!l.showOnlyAtModulo,
1521
- Math.max(1, qe.value || 1),
1522
- o,
1523
- R,
1524
- u,
1525
- a,
1526
- r
1527
- );
1528
- });
1529
- function Ae(l, s) {
1530
- const e = Ce.value.map((u) => ({
1531
- shape: u.shape || null,
1532
- name: u.name,
1533
- color: u.color,
1534
- type: u.type,
1535
- value: u.absoluteValues.find((a, r) => r === s),
1536
- comments: u.comments || [],
1537
- prefix: u.prefix || t.value.chart.labels.prefix,
1538
- suffix: u.suffix || t.value.chart.labels.suffix
1539
- }));
1540
- It("selectTimeLabel", {
1541
- datapoint: e,
1542
- absoluteIndex: l.absoluteIndex,
1543
- label: l.text
1544
- });
1545
- }
1546
- const P = x(() => {
1547
- const l = Xt((p.value.end ?? 0) - (p.value.start ?? 0));
1548
- return Math.max(1, l);
1549
- });
1550
- function Rl(l) {
1551
- H.value = l;
1552
- }
1553
- function jl() {
1554
- k.value.isStacked = !k.value.isStacked, k.value.isStacked ? k.value.useIndividualScale = !0 : k.value.useIndividualScale = t.value.chart.grid.labels.yAxis.useIndividualScale;
1555
- }
1556
- function ct(l) {
1557
- Mt.value && l.autoScaling && (t.value.chart.grid.labels.yAxis.useIndividualScale || console.warn(`VueUiXy (datapoint: ${l.name}) : autoScaling only works when config.chart.grid.labels.yAxis.useIndividualScale is set to true`), t.value.chart.grid.labels.yAxis.stacked || console.warn(`VueUiXy (datapoint: ${l.name}) : autoScaling only works when config.chart.grid.labels.yAxis.stacked is set to true`));
1558
- }
1559
- function ka(l, s) {
1560
- const e = Xt(l), u = Array(e).fill(0);
1561
- for (let a = 0; a < s.length && a < e; a += 1) u[a] = s[a] ?? 0;
1562
- return u;
1563
- }
1564
- function wa(l) {
1565
- const s = Math.max(...fe.value.map((e) => st(e.series).length));
1566
- return l > s ? s : l < 0 || t.value.chart.zoom.startIndex !== null && l < t.value.chart.zoom.startIndex ? t.value.chart.zoom.startIndex !== null ? t.value.chart.zoom.startIndex + 1 : 1 : l;
1567
- }
1568
- async function be() {
1569
- await ul(), await ul();
1570
- const { startIndex: l, endIndex: s } = t.value.chart.zoom, e = Re.value, u = Math.max(...fe.value.map((a) => st(a.series).length));
1571
- p.value = { start: 0, end: u }, (l != null || s != null) && e ? (l != null ? (p.value.start = l, e.setStartValue(l)) : (p.value.start = 0, e.setStartValue(0)), s != null ? (p.value.end = s + 1, e.setEndValue(wa(s + 1))) : (p.value.end = u, e.setEndValue(u))) : (p.value = { start: 0, end: u }, Pt.value += 1), tt.value.start = p.value.start, tt.value.end = p.value.end, Ue();
1572
- }
1573
- async function Vl() {
1574
- await be();
1575
- }
1576
- function $e(l) {
1577
- return ![null, void 0, NaN, 1 / 0, -1 / 0].includes(l);
1578
- }
1579
- const Ol = x(() => Ee.value.max + He.value);
1580
- function Lt(l) {
1581
- return l / ($e(Ol.value) ? Ol.value : 1);
1582
- }
1583
- const _e = x(() => isNaN(Lt(He.value)) ? c.value.bottom : c.value.bottom - c.value.height * Lt(He.value));
1584
- function Na(l) {
1585
- const s = ![null, void 0].includes(t.value.chart.grid.labels.yAxis.scaleMin) && t.value.chart.grid.labels.yAxis.scaleMin > 0 && fl.value >= 0 ? c.value.bottom : _e.value;
1586
- return l.value >= 0 ? G(s - l.y <= 0 ? 1e-5 : s - l.y) : G(l.y - _e.value <= 0 ? 1e-5 : l.y - _e.value);
1587
- }
1588
- function Pa(l) {
1589
- return l.value >= 0 ? G(l.zeroPosition - l.y <= 0 ? 1e-5 : l.zeroPosition - l.y) : G(l.y - l.zeroPosition <= 0 ? 1e-5 : l.zeroPosition - l.y);
1590
- }
1591
- const ve = x(() => {
1592
- const l = Math.max(1, P.value), s = Math.max(1, c.value.width), e = Math.max(1, Pe.value.filter((u) => u.type === "bar" && !ce.value.includes(u.id)).length);
1593
- return {
1594
- bar: Il(s, l * e, 1),
1595
- plot: Il(s, l, 1),
1596
- line: Il(s, l, 1)
1597
- };
1598
- });
1599
- function yl() {
1600
- return k.value.useIndividualScale && k.value.isStacked ? ve.value.line - c.value.width / P.value * 0.1 : ve.value.bar;
1601
- }
1602
- function ea(l) {
1603
- return k.value.useIndividualScale && k.value.isStacked ? l.x + c.value.width / P.value * 0.05 : l.x + ve.value.bar / 2;
1604
- }
1605
- function Fa(l) {
1606
- return l.value >= 0 ? l.y : [null, void 0, NaN, 1 / 0, -1 / 0].includes(_e.value) ? c.bottom.value : _e.value;
1607
- }
1608
- function Ra(l) {
1609
- return l.value >= 0 ? l.y : [null, void 0, NaN, 1 / 0, -1 / 0].includes(l.zeroPosition) ? 0 : l.zeroPosition;
1610
- }
1611
- const Bl = y(null);
1612
- let el = 0;
1613
- function po(l, s, e) {
1614
- return l >= e.left && l <= e.right && s >= e.top && s <= e.bottom;
1615
- }
1616
- function ko(l) {
1617
- if ($t.value) return;
1618
- el && cancelAnimationFrame(el);
1619
- const s = Me.value?.getBoundingClientRect();
1620
- el = requestAnimationFrame(() => {
1621
- if (el = 0, !s || !po(l.clientX, l.clientY, s)) {
1622
- Sa();
1623
- return;
1624
- }
1625
- const u = Me.value.viewBox.baseVal.width / s.width, r = (l.clientX - s.left) * u - c.value.left, o = c.value.width / P.value, R = Math.floor(r / o);
1626
- R >= 0 && R < P.value ? Bl.value !== R && (Bl.value = R, Za(!0, R)) : Sa();
1627
- });
1628
- }
1629
- function Sa() {
1630
- el && (cancelAnimationFrame(el), el = 0), Bl.value = null, Za(!1, null);
1631
- }
1632
- function wo() {
1633
- Bl.value != null && So(Bl.value);
1634
- }
1635
- function So(l) {
1636
- const s = Ce.value.map((e) => ({
1637
- name: e.name,
1638
- value: [null, void 0, NaN].includes(e.absoluteValues[l]) ? null : e.absoluteValues[l],
1639
- color: e.color,
1640
- type: e.type
1641
- }));
1642
- It(
1643
- "selectX",
1644
- {
1645
- dataset: s,
1646
- index: l,
1647
- indexLabel: t.value.chart.grid.labels.xAxisLabels.values[l]
1648
- }
1649
- ), t.value.events.datapointClick && t.value.events.datapointClick({ datapoint: s, seriesIndex: l + p.value.start });
1650
- }
1651
- function $o() {
1652
- return Le.value.map((l) => ({
1653
- values: l.absoluteValues,
1654
- color: l.color,
1655
- name: l.name,
1656
- type: l.type
1657
- }));
1658
- }
1659
- async function _o({ scale: l = 2 } = {}) {
1660
- if (!je.value) return;
1661
- const { width: s, height: e } = je.value.getBoundingClientRect(), u = s / e, { imageUri: a, base64: r } = await fn({ domElement: je.value, base64: !0, img: !0, scale: l });
1662
- return {
1663
- imageUri: a,
1664
- base64: r,
1665
- title: t.value.chart.title.text,
1666
- width: s,
1667
- height: e,
1668
- aspectRatio: u
1669
- };
1670
- }
1671
- function Va(l) {
1672
- if (ce.value.includes(l.id))
1673
- ce.value = ce.value.filter((s) => s !== l.id);
1674
- else {
1675
- if (ce.value.length + 1 === Pe.value.length) return;
1676
- ce.value.push(l.id);
1677
- }
1678
- It("selectLegend", Ce.value.map((s) => ({
1679
- name: s.name,
1680
- values: s.absoluteValues,
1681
- color: s.color,
1682
- type: s.type
1683
- }))), Tl.value += 1;
1684
- }
1685
- const Mo = x(() => {
1686
- const l = t.value.chart.title.text || "Chart visualization", s = t.value.chart.title.subtitle.text || "";
1687
- return `${l}. ${s}`;
1688
- }), Oa = x(() => ({
1689
- linePlot: P.value > t.value.line.dot.hideAboveMaxSerieLength
1690
- })), Lo = x(() => t.value.chart.userOptions.show && (!t.value.chart.title.show || !t.value.chart.title.text)), Co = x(() => {
1691
- if (Array.isArray(t.value.chart.highlightArea))
1692
- return t.value.chart.highlightArea.map((s) => {
1693
- const e = Math.min(s.to, Be.value - 1);
1694
- return {
1695
- ...s,
1696
- span: s.from === e ? 1 : e < s.from ? 0 : e - s.from + 1
1697
- };
1698
- });
1699
- const l = {
1700
- ...t.value.chart.highlightArea,
1701
- to: Math.min(t.value.chart.highlightArea.to, Be.value - 1)
1702
- };
1703
- return [{ ...l, span: l.from === l.to ? 1 : l.to < l.from ? 0 : l.to - l.from + 1 }];
1704
- }), Ba = x(() => wt.value ? fe.value.map((l, s) => ({
1705
- ...l,
1706
- series: st(l.series),
1707
- id: `uniqueId_${s}`,
1708
- color: vo(l.color ? l.color : qt.value[s] ? qt.value[s] : ho[s])
1709
- })) : fe.value), Ao = x(() => Ce.value.map((l) => {
1710
- const s = l.absoluteValues.map((e) => [void 0, null].includes(e) ? 0 : e);
1711
- return {
1712
- id: l.id,
1713
- name: l.name,
1714
- color: l.color,
1715
- values: ka(P.value, s)
1716
- };
1717
- })), zo = x(() => ({
1718
- responsiveBreakpoint: t.value.table.responsiveBreakpoint,
1719
- roundingValues: t.value.table.rounding,
1720
- showAverage: !1,
1721
- showMedian: !1,
1722
- showTotal: !1,
1723
- fontFamily: t.value.chart.fontFamily,
1724
- prefix: t.value.chart.labels.prefix,
1725
- suffix: t.value.chart.labels.suffix,
1726
- colNames: C.value.map((l, s) => t.value.table.useDefaultTimeFormat ? l.text : pl.value(s + p.value.start, t.value.table.timeFormat)),
1727
- thead: {
1728
- backgroundColor: t.value.table.th.backgroundColor,
1729
- color: t.value.table.th.color,
1730
- outline: t.value.table.th.outline
1731
- },
1732
- tbody: {
1733
- backgroundColor: t.value.table.td.backgroundColor,
1734
- color: t.value.table.td.color,
1735
- outline: t.value.table.td.outline
1736
- },
1737
- userOptions: {
1738
- show: !1
1739
- },
1740
- sparkline: {
1741
- animation: { show: !1 }
1742
- }
1743
- })), oe = x(() => t.value.chart.grid.position === "middle" ? 0 : c.value.width / P.value / 2), tl = x(() => Ko(Le.value.filter((l) => !ce.value.includes(l.id)))), F = x(() => {
1744
- const l = Object.groupBy(tl.value, (e) => e.scaleLabel), s = {};
1745
- for (const [e, u] of Object.entries(l)) {
1746
- const a = u.flatMap((r) => r.absoluteValues);
1747
- s[e] = {
1748
- min: Math.min(...a) || 0,
1749
- max: Math.max(...a) || 1,
1750
- groupId: `scale_group_${ca()}`
1751
- };
1752
- }
1753
- return s;
1754
- }), To = x(() => {
1755
- const l = Pe.value.filter((s) => s.type === "bar").filter((s) => !ce.value.includes(s.id)).length;
1756
- return c.value.width / P.value / l - ta.value * l;
1757
- }), ta = x(() => ve.value.line * t.value.bar.periodGap), la = x(() => Math.max(1e-5, yl() - (k.value.useIndividualScale && k.value.isStacked ? 0 : ta.value))), aa = x(() => la.value * Math.min(Math.abs(t.value.bar.innerGap), 0.95)), Ea = x(() => {
1758
- if (!t.value.chart.zoom.minimap.show) return [];
1759
- const l = Ba.value.filter((a) => !ce.value.includes(a.id)), s = Math.max(...l.map((a) => a.series.length)), e = [];
1760
- for (let a = 0; a < s; a += 1)
1761
- e.push(l.map((r) => r.series[a] || 0).reduce((r, o) => (r || 0) + (o || 0), 0));
1762
- const u = Math.min(...e);
1763
- return e.map((a) => a + (u < 0 ? Math.abs(u) : 0));
1764
- }), Ha = x(() => t.value.chart.zoom.minimap.show ? Ba.value.map((s) => ({
1765
- ...s,
1766
- isVisible: !ce.value.includes(s.id)
1767
- })) : []), Ct = x(() => Ce.value.map((l) => ({
1768
- slotAbsoluteIndex: l.slotAbsoluteIndex,
1769
- shape: l.shape || null,
1770
- name: l.name,
1771
- color: l.color,
1772
- type: l.type,
1773
- value: l.absoluteValues.find((s, e) => e === A.value),
1774
- comments: l.comments || [],
1775
- prefix: l.prefix || t.value.chart.labels.prefix,
1776
- suffix: l.suffix || t.value.chart.labels.suffix
1777
- }))), Da = x(() => Ee.value.ticks.map((l) => ({
1778
- y: l >= 0 ? _e.value - c.value.height * Lt(l) : _e.value + c.value.height * Lt(Math.abs(l)),
1779
- value: l,
1780
- prefix: t.value.chart.labels.prefix,
1781
- suffix: t.value.chart.labels.suffix
1782
- }))), Wa = x(() => {
1783
- const l = t.value.chart.annotations;
1784
- if (!l || !Array.isArray(l) || l.every((T) => !T.show)) return [];
1785
- const s = l.filter(
1786
- (T) => T.show && (T.yAxis.yTop != null || T.yAxis.yBottom != null)
1787
- );
1788
- if (!s.length) return [];
1789
- const { left: e, right: u } = c.value, a = _e.value, r = c.value.height, o = Ee.value.min, E = Ee.value.max - o, X = (T) => {
1790
- const V = (T - 0) / E;
1791
- return a - V * r;
1792
- };
1793
- return s.map((T) => {
1794
- const { yAxis: { yTop: V, yBottom: j, label: I } } = T, Y = V != null && j != null && V !== j, O = V == null ? null : X(V), de = j == null ? null : X(j), D = xe(I.fontSize);
1795
- D.font = `${I.fontSize}px sans-serif`;
1796
- const B = D.measureText(I.text).width, ie = I.fontSize, We = (I.position === "start" ? e + I.padding.left : u - I.padding.right) + I.offsetX, Ze = (O != null && de != null ? Math.min(O, de) : O ?? de) - I.fontSize / 3 + I.offsetY - I.padding.top;
1797
- let Z;
1798
- I.textAnchor === "middle" ? Z = We - B / 2 - I.padding.left : I.textAnchor === "end" ? Z = We - B - I.padding.right : Z = We - I.padding.left;
1799
- const K = Ze - ie * 0.75 - I.padding.top;
1800
- return {
1801
- show: ![O, de, K].includes(NaN),
1802
- id: `annotation_y_${ca()}`,
1803
- hasArea: Y,
1804
- areaHeight: Y ? Math.abs(O - de) : 0,
1805
- yTop: O,
1806
- yBottom: de,
1807
- config: T.yAxis,
1808
- x1: e,
1809
- x2: u,
1810
- _text: { x: We, y: Ze },
1811
- _box: {
1812
- x: Z,
1813
- y: K,
1814
- width: B + I.padding.left + I.padding.right,
1815
- height: ie + I.padding.top + I.padding.bottom,
1816
- fill: I.backgroundColor,
1817
- stroke: I.border.stroke,
1818
- rx: I.border.rx,
1819
- ry: I.border.ry,
1820
- strokeWidth: I.border.strokeWidth
1821
- }
1822
- };
1823
- });
1824
- });
1825
- function Xa(l, s) {
1826
- const e = l[s - 1], u = l[s + 1];
1827
- let a = !!e && !!u && e.value == null && u.value == null || !e && !!u && u.value == null || !!e && !u && e.value == null;
1828
- return $e(l[s].value) && a && t.value.line.cutNullValues;
1829
- }
1830
- const At = x(() => {
1831
- const l = tl.value.filter((o) => ["bar", "line", "plot"].includes(o.type)), s = l.length, e = t.value.chart.grid.labels.yAxis.gap, u = k.value.isStacked, a = u ? e * (s - 1) : 0, r = c.value.height - a;
1832
- return l.filter((o) => o.type === "bar").map((o, R) => {
1833
- ct(o);
1834
- const E = F.value[o.scaleLabel].min, X = F.value[o.scaleLabel].max;
1835
- o.absoluteValues.filter((q) => ![null, void 0].includes(q)).map((q) => (q - E) / (X - E));
1836
- const T = {
1837
- valueMin: E,
1838
- valueMax: X < 0 ? 0 : X
1839
- }, V = {
1840
- max: o.scaleMax || Math.max(...o.absoluteValues) || 1,
1841
- min: o.scaleMin || Math.min(...o.absoluteValues.filter((q) => ![void 0, null].includes(q))) > 0 ? 0 : Math.min(...o.absoluteValues.filter((q) => ![null, void 0].includes(q)))
1842
- }, j = o.scaleSteps || t.value.chart.grid.labels.yAxis.commonScaleSteps, I = 1.0000001, Y = t.value.chart.grid.labels.yAxis.useNiceScale ? Xl(V.min, V.max === V.min ? V.max * I : V.max, j) : al(V.min, V.max === V.min ? V.max * I : V.max, j), O = t.value.chart.grid.labels.yAxis.useNiceScale ? Xl(T.valueMin, T.valueMax === T.valueMin ? T.valueMax * I : T.valueMax, j) : al(T.valueMin, T.valueMax === T.valueMin ? T.valueMax * I : T.valueMax, j), de = Y.min >= 0 ? 0 : Math.abs(Y.min), D = 0, B = Y.max + de, ie = O.max + Math.abs(D), We = o.stackIndex, kl = s - 1 - We, Ze = u ? 1 - o.cumulatedStackRatio : 0, Z = u ? r * Ze + e * kl : 0, K = u ? r * o.stackRatio : c.value.height, ye = c.value.bottom - Z - K * de / B, Ke = c.value.bottom - Z - K * D / ie, Fe = Le.value.filter((q) => q.type === "bar").filter((q) => !ce.value.includes(q.id)).length, Dl = o.series.map((q, ke) => {
1843
- const Vt = k.value.useIndividualScale ? (o.absoluteValues[ke] + de) / B : Lt(q), ll = k.value.useIndividualScale && k.value.isStacked ? c.value.left + c.value.width / P.value * ke : c.value.left + ve.value.bar * R + ve.value.bar * ke * Fe - To.value / 2 - R * ta.value;
1844
- return {
1845
- yOffset: G(Z),
1846
- individualHeight: G(K),
1847
- x: G(ll),
1848
- y: c.value.bottom - Z - K * Vt,
1849
- value: o.absoluteValues[ke],
1850
- zeroPosition: G(ye),
1851
- individualMax: G(B),
1852
- comment: o.comments && o.comments.slice(p.value.start, p.value.end)[ke] || ""
1853
- };
1854
- }), Xe = o.absoluteValues.map((q) => O.min >= 0 ? (q - Math.abs(O.min)) / (O.max - Math.abs(O.min)) : (q + Math.abs(O.min)) / (O.max + Math.abs(O.min))), Rt = o.series.map((q, ke) => {
1855
- const Vt = k.value.useIndividualScale && k.value.isStacked ? c.value.left + c.value.width / P.value * ke : c.value.left - ve.value.bar / 2 + ve.value.bar * R + ve.value.bar * ke * Le.value.filter((ll) => ll.type === "bar").filter((ll) => !ce.value.includes(ll.id)).length;
1856
- return {
1857
- yOffset: G(Z),
1858
- individualHeight: G(K),
1859
- x: G(Vt),
1860
- y: G(c.value.bottom - G(Z) - (G(K) * Xe[ke] || 0)),
1861
- value: o.absoluteValues[ke],
1862
- zeroPosition: G(ye),
1863
- individualMax: G(B),
1864
- comment: o.comments && o.comments.slice(p.value.start, p.value.end)[ke] || ""
1865
- };
1866
- }), le = Y.ticks.map((q) => ({
1867
- y: q >= 0 ? ye - K * (q / B) : ye + K * Math.abs(q) / B,
1868
- value: q,
1869
- prefix: o.prefix || t.value.chart.labels.prefix,
1870
- suffix: o.suffix || t.value.chart.labels.suffix,
1871
- datapoint: o
1872
- })), pe = O.ticks.map((q) => {
1873
- const ke = (q - O.min) / (O.max - O.min);
1874
- return {
1875
- y: q >= 0 ? Ke - K * ke : Ke + K * ke,
1876
- value: q,
1877
- prefix: o.prefix || t.value.chart.labels.prefix,
1878
- suffix: o.suffix || t.value.chart.labels.suffix,
1879
- datapoint: o
1880
- };
1881
- });
1882
- return F.value[o.scaleLabel].name = o.name, F.value[o.scaleLabel].groupName = o.scaleLabel, F.value[o.scaleLabel].groupColor = t.value.chart.grid.labels.yAxis.groupColor || o.color, F.value[o.scaleLabel].color = o.color, F.value[o.scaleLabel].scaleYLabels = o.autoScaling ? pe : le, F.value[o.scaleLabel].zeroPosition = o.autoScaling ? Ke : ye, F.value[o.scaleLabel].individualMax = o.autoScaling ? ie : B, F.value[o.scaleLabel].scaleLabel = o.scaleLabel, F.value[o.scaleLabel].id = o.id, F.value[o.scaleLabel].yOffset = Z, F.value[o.scaleLabel].individualHeight = K, F.value[o.scaleLabel].autoScaleYLabels = pe, F.value[o.scaleLabel].unique = tl.value.filter((q) => q.scaleLabel === o.scaleLabel).length === 1, {
1883
- ...o,
1884
- yOffset: Z,
1885
- autoScaleYLabels: pe,
1886
- individualHeight: K,
1887
- scaleYLabels: o.autoScaling ? pe : le,
1888
- individualScale: o.autoScaling ? O : Y,
1889
- individualMax: o.autoScaling ? ie : B,
1890
- zeroPosition: o.autoScaling ? Ke : ye,
1891
- plots: o.autoScaling ? Rt : Dl,
1892
- groupId: F.value[o.scaleLabel].groupId
1893
- };
1894
- });
1895
- }), De = x(() => {
1896
- const l = tl.value.filter((o) => ["bar", "line", "plot"].includes(o.type)), s = l.length, e = t.value.chart.grid.labels.yAxis.gap, u = k.value.isStacked, a = u ? e * (s - 1) : 0, r = c.value.height - a;
1897
- return l.filter((o) => o.type === "line").map((o, R) => {
1898
- ct(o);
1899
- const E = F.value[o.scaleLabel].min, X = F.value[o.scaleLabel].max;
1900
- o.absoluteValues.filter((W) => ![null, void 0].includes(W)).map((W) => (W - E) / (X - E));
1901
- const T = {
1902
- valueMin: E,
1903
- valueMax: X
1904
- }, V = {
1905
- max: o.scaleMax || Math.max(...o.absoluteValues) || 1,
1906
- min: o.scaleMin || (Math.min(...o.absoluteValues) > 0 ? 0 : Math.min(...o.absoluteValues))
1907
- }, j = o.scaleSteps || t.value.chart.grid.labels.yAxis.commonScaleSteps, I = 1.0000001, Y = t.value.chart.grid.labels.yAxis.useNiceScale ? Xl(V.min, V.max === V.min ? V.max * I : V.max, j) : al(V.min, V.max === V.min ? V.max * I : V.max, j), O = t.value.chart.grid.labels.yAxis.useNiceScale ? Xl(T.valueMin, T.valueMax === T.valueMin ? T.valueMax * I : T.valueMax, j) : al(T.valueMin, T.valueMax === T.valueMin ? T.valueMax * I : T.valueMax, j), de = Y.min >= 0 ? 0 : Math.abs(Y.min), D = 0, B = Y.max + Math.abs(de), ie = O.max + Math.abs(D), We = o.stackIndex, kl = s - 1 - We, Ze = u ? 1 - o.cumulatedStackRatio : 0, Z = u ? r * Ze + e * kl : 0, K = u ? r * o.stackRatio : c.value.height, ye = c.value.bottom - Z - K * de / B, Ke = c.value.bottom - Z - K * D / ie, Fe = o.series.map((W, ze) => {
1908
- const Vo = k.value.useIndividualScale ? (o.absoluteValues[ze] + Math.abs(de)) / B : Lt(W);
1909
- return {
1910
- x: G(c.value.left + ve.value.line / 2 + ve.value.line * ze),
1911
- y: G(c.value.bottom - Z - K * Vo),
1912
- value: o.absoluteValues[ze],
1913
- comment: o.comments && o.comments.slice(p.value.start, p.value.end)[ze] || ""
1914
- };
1915
- }), Dl = o.absoluteValues.map((W) => O.min >= 0 ? (W - Math.abs(O.min)) / (O.max - Math.abs(O.min)) : (W + Math.abs(O.min)) / (O.max + Math.abs(O.min))), Xe = o.series.map((W, ze) => [void 0, null].includes(o.absoluteValues[ze]) ? {
1916
- x: G(c.value.left + ve.value.line / 2 + ve.value.line * ze),
1917
- y: ye,
1918
- value: o.absoluteValues[ze],
1919
- comment: o.comments && o.comments.slice(p.value.start, p.value.end)[ze] || ""
1920
- } : {
1921
- x: G(c.value.left + ve.value.line / 2 + ve.value.line * ze),
1922
- y: G(c.value.bottom - Z - (K * Dl[ze] || 0)),
1923
- value: o.absoluteValues[ze],
1924
- comment: o.comments && o.comments.slice(p.value.start, p.value.end)[ze] || ""
1925
- }), Rt = t.value.line.cutNullValues ? da(Fe) : ha(Fe.filter((W) => W.value !== null)), le = t.value.line.cutNullValues ? da(Xe) : ha(Xe.filter((W) => W.value !== null)), pe = t.value.line.cutNullValues ? ma(Fe) : fa(Fe.filter((W) => W.value !== null)), q = t.value.line.cutNullValues ? ma(Xe) : fa(Xe.filter((W) => W.value !== null)), ke = Y.ticks.map((W) => ({
1926
- y: W >= 0 ? ye - K * (W / B) : ye + K * Math.abs(W) / B,
1927
- value: W,
1928
- prefix: o.prefix || t.value.chart.labels.prefix,
1929
- suffix: o.suffix || t.value.chart.labels.suffix,
1930
- datapoint: o
1931
- })), Vt = O.ticks.map((W) => {
1932
- const ze = (W - O.min) / (O.max - O.min);
1933
- return {
1934
- y: W >= 0 ? Ke - K * ze : Ke + K * ze,
1935
- value: W,
1936
- prefix: o.prefix || t.value.chart.labels.prefix,
1937
- suffix: o.suffix || t.value.chart.labels.suffix,
1938
- datapoint: o
1939
- };
1940
- });
1941
- F.value[o.scaleLabel].name = o.name, F.value[o.scaleLabel].groupName = o.scaleLabel, F.value[o.scaleLabel].groupColor = t.value.chart.grid.labels.yAxis.groupColor || o.color, F.value[o.scaleLabel].color = o.color, F.value[o.scaleLabel].scaleYLabels = o.autoScaling ? Vt : ke, F.value[o.scaleLabel].zeroPosition = o.autoScaling ? Ke : ye, F.value[o.scaleLabel].individualMax = o.autoScaling ? ie : B, F.value[o.scaleLabel].scaleLabel = o.scaleLabel, F.value[o.scaleLabel].id = o.id, F.value[o.scaleLabel].yOffset = Z, F.value[o.scaleLabel].individualHeight = K, F.value[o.scaleLabel].autoScaleYLabels = Vt, F.value[o.scaleLabel].unique = tl.value.filter((W) => W.scaleLabel === o.scaleLabel).length === 1;
1942
- const ll = k.value.useIndividualScale ? o.autoScaling ? Ke : ye : _e.value, Wl = Math.max(Math.max(o.autoScaling ? Ke : ke.at(-1) ? ke.at(-1).y : 0, c.value.top), ll);
1943
- return {
1944
- ...o,
1945
- yOffset: Z,
1946
- autoScaleYLabels: Vt,
1947
- individualHeight: K,
1948
- scaleYLabels: o.autoScaling ? Vt : ke,
1949
- individualScale: o.autoScaling ? O : Y,
1950
- individualMax: o.autoScaling ? ie : B,
1951
- zeroPosition: o.autoScaling ? Ke : ye,
1952
- curve: o.autoScaling ? le : Rt,
1953
- plots: o.autoScaling ? Xe : Fe,
1954
- area: o.useArea ? k.value.useIndividualScale ? t.value.line.cutNullValues ? mo(
1955
- o.autoScaling ? Xe : Fe,
1956
- Wl
1957
- ) : fo(
1958
- o.autoScaling ? Xe.filter((W) => W.value !== null) : Fe.filter((W) => W.value !== null),
1959
- Wl
1960
- ) : t.value.line.cutNullValues ? mo(Fe, Wl) : fo(Fe.filter((W) => W.value !== null), Wl) : "",
1961
- curveAreas: o.useArea ? Jo(
1962
- o.autoScaling ? t.value.line.cutNullValues ? Xe : Xe.filter((W) => W.value !== null) : t.value.line.cutNullValues ? Fe : Fe.filter((W) => W.value !== null),
1963
- Wl,
1964
- t.value.line.cutNullValues
1965
- ) : [],
1966
- straight: o.autoScaling ? q : pe,
1967
- groupId: F.value[o.scaleLabel].groupId
1968
- };
1969
- });
1970
- }), vt = x(() => {
1971
- const l = tl.value.filter((o) => ["bar", "line", "plot"].includes(o.type)), s = l.length, e = t.value.chart.grid.labels.yAxis.gap, u = k.value.isStacked, a = u ? e * (s - 1) : 0, r = c.value.height - a;
1972
- return l.filter((o) => o.type === "plot").map((o) => {
1973
- ct(o);
1974
- const R = F.value[o.scaleLabel].min, E = F.value[o.scaleLabel].max;
1975
- o.absoluteValues.filter((le) => ![null, void 0].includes(le)).map((le) => (le - R) / (E - R));
1976
- const X = {
1977
- valueMin: R,
1978
- valueMax: E
1979
- }, T = {
1980
- max: o.scaleMax || Math.max(...o.absoluteValues) || 1,
1981
- min: o.scaleMin || Math.min(...o.absoluteValues) > 0 ? 0 : Math.min(...o.absoluteValues)
1982
- }, V = o.scaleSteps || t.value.chart.grid.labels.yAxis.commonScaleSteps, j = 1.0000001, I = al(T.min, T.max === T.min ? T.max * j : T.max, V), Y = al(X.valueMin, X.valueMax === X.valueMin ? X.valueMax * j : X.valueMax, V), O = I.min >= 0 ? 0 : Math.abs(I.min), de = 0, D = I.max + O, B = Y.max + Math.abs(de), ie = o.stackIndex, We = s - 1 - ie, kl = u ? 1 - o.cumulatedStackRatio : 0, Ze = u ? r * kl + e * We : 0, Z = u ? r * o.stackRatio : c.value.height, K = c.value.bottom - Ze - Z * O / D, ye = c.value.bottom - Ze - Z * de / B, Ke = o.series.map((le, pe) => {
1983
- const q = k.value.useIndividualScale ? (o.absoluteValues[pe] + Math.abs(O)) / D : Lt(le);
1984
- return {
1985
- x: G(c.value.left + ve.value.plot / 2 + ve.value.plot * pe),
1986
- y: G(c.value.bottom - Ze - Z * q),
1987
- value: o.absoluteValues[pe],
1988
- comment: o.comments && o.comments.slice(p.value.start, p.value.end)[pe] || ""
1989
- };
1990
- }), Fe = o.absoluteValues.map((le) => Y.min >= 0 ? (le - Math.abs(Y.min)) / (Y.max - Math.abs(Y.min)) : (le + Math.abs(Y.min)) / (Y.max + Math.abs(Y.min))), Dl = o.series.map((le, pe) => ({
1991
- x: G(c.value.left + ve.value.plot / 2 + ve.value.plot * pe),
1992
- y: G(c.value.bottom - Ze - (Z * Fe[pe] || 0)),
1993
- value: o.absoluteValues[pe],
1994
- comment: o.comments && o.comments.slice(p.value.start, p.value.end)[pe] || ""
1995
- })), Xe = I.ticks.map((le) => ({
1996
- y: le >= 0 ? K - Z * (le / D) : K + Z * Math.abs(le) / D,
1997
- value: le,
1998
- prefix: o.prefix || t.value.chart.labels.prefix,
1999
- suffix: o.suffix || t.value.chart.labels.suffix,
2000
- datapoint: o
2001
- })), Rt = Y.ticks.map((le) => {
2002
- const pe = (le - Y.min) / (Y.max - Y.min);
2003
- return {
2004
- y: le >= 0 ? ye - Z * pe : ye + Z * pe,
2005
- value: le,
2006
- prefix: o.prefix || t.value.chart.labels.prefix,
2007
- suffix: o.suffix || t.value.chart.labels.suffix,
2008
- datapoint: o
2009
- };
2010
- });
2011
- return F.value[o.scaleLabel].name = o.name, F.value[o.scaleLabel].groupName = o.scaleLabel, F.value[o.scaleLabel].groupColor = t.value.chart.grid.labels.yAxis.groupColor || o.color, F.value[o.scaleLabel].color = o.color, F.value[o.scaleLabel].scaleYLabels = o.autoScaling ? Rt : Xe, F.value[o.scaleLabel].zeroPosition = o.autoScaling ? ye : K, F.value[o.scaleLabel].individualMax = o.autoScaling ? B : D, F.value[o.scaleLabel].scaleLabel = o.scaleLabel, F.value[o.scaleLabel].id = o.id, F.value[o.scaleLabel].yOffset = Ze, F.value[o.scaleLabel].individualHeight = Z, F.value[o.scaleLabel].autoScaleYLabels = Rt, F.value[o.scaleLabel].unique = tl.value.filter((le) => le.scaleLabel === o.scaleLabel).length === 1, {
2012
- ...o,
2013
- yOffset: Ze,
2014
- autoScaleYLabels: Rt,
2015
- individualHeight: Z,
2016
- scaleYLabels: o.autoScaling ? Rt : Xe,
2017
- individualScale: o.autoScaling ? Y : I,
2018
- individualMax: o.autoScaling ? B : D,
2019
- zeroPosition: o.autoScaling ? ye : K,
2020
- plots: o.autoScaling ? Dl : Ke,
2021
- groupId: F.value[o.scaleLabel].groupId
2022
- };
2023
- });
2024
- }), El = x(() => {
2025
- const l = De.value.map((r) => ({
2026
- name: r.name,
2027
- color: r.color,
2028
- scale: r.individualScale,
2029
- scaleYLabels: r.scaleYLabels,
2030
- zero: r.zeroPosition,
2031
- max: r.individualMax,
2032
- scaleLabel: r.scaleLabel || "",
2033
- id: r.id,
2034
- yOffset: r.yOffset || 0,
2035
- individualHeight: r.individualHeight || c.value.height,
2036
- autoScaleYLabels: r.autoScaleYLabels
2037
- })), s = At.value.map((r) => ({
2038
- name: r.name,
2039
- color: r.color,
2040
- scale: r.individualScale,
2041
- scaleYLabels: r.scaleYLabels,
2042
- zero: r.zeroPosition,
2043
- max: r.individualMax,
2044
- scaleLabel: r.scaleLabel || "",
2045
- id: r.id,
2046
- yOffset: r.yOffset || 0,
2047
- individualHeight: r.individualHeight || c.value.height
2048
- })), e = vt.value.map((r) => ({
2049
- name: r.name,
2050
- color: r.color,
2051
- scale: r.individualScale,
2052
- scaleYLabels: r.scaleYLabels,
2053
- // FIX
2054
- zero: r.zeroPosition,
2055
- max: r.individualMax,
2056
- scaleLabel: r.scaleLabel || "",
2057
- id: r.id,
2058
- yOffset: r.yOffset || 0,
2059
- individualHeight: r.individualHeight || c.value.height
2060
- })), u = k.value.useIndividualScale && !k.value.isStacked ? Object.values(F.value) : [...l, ...s, ...e], a = u.flatMap((r) => r).length;
2061
- return u.flatMap((r, o) => {
2062
- let R = 0;
2063
- R = k.value.isStacked ? c.value.left : c.value.left / a * (o + 1);
2064
- const E = k.value.useIndividualScale && !k.value.isStacked ? r.unique ? r.name : r.groupName : r.name;
2065
- return {
2066
- unique: r.unique,
2067
- id: r.id,
2068
- groupId: r.groupId,
2069
- scaleLabel: r.scaleLabel,
2070
- name: Te(
2071
- t.value.chart.grid.labels.yAxis.serieNameFormatter,
2072
- E,
2073
- E,
2074
- r
2075
- ),
2076
- color: k.value.useIndividualScale && !k.value.isStacked ? r.unique ? r.color : r.groupColor : r.color,
2077
- scale: r.scale,
2078
- yOffset: r.yOffset,
2079
- individualHeight: r.individualHeight,
2080
- x: R,
2081
- yLabels: r.scaleYLabels || r.scale.ticks.map((X) => ({
2082
- y: X >= 0 ? r.zero - r.individualHeight * (X / r.max) : r.zero + r.individualHeight * Math.abs(X) / r.max,
2083
- value: X
2084
- }))
2085
- };
2086
- });
2087
- }), Ya = x(() => {
2088
- const l = t.value.line.interLine || {}, s = l.pairs || [], e = l.colors || [];
2089
- if (!s.length) return [];
2090
- const u = [];
2091
- return s.forEach((a, r) => {
2092
- const [o, R] = Array.isArray(a) ? a : [a.a, a.b];
2093
- if (!o || !R) return;
2094
- const E = De.value.find((I) => I.name === o), X = De.value.find((I) => I.name === R);
2095
- if (!E || !X || E.type !== "line" || X.type !== "line") return;
2096
- const T = e?.[r]?.[0] ?? E.color, V = e?.[r]?.[1] ?? X.color;
2097
- Qo({
2098
- lineA: E.plots,
2099
- lineB: X.plots,
2100
- smoothA: !!E.smooth,
2101
- smoothB: !!X.smooth,
2102
- colorLineA: T,
2103
- colorLineB: V,
2104
- sampleStepPx: 2,
2105
- cutNullValues: t.value.line.cutNullValues
2106
- }).forEach((I, Y) => {
2107
- u.push({ ...I, key: `inter_${o}_${R}_${r}_${Y}` });
2108
- });
2109
- }), u;
2110
- }), Ga = x(() => ({
2111
- datapoint: Ct.value,
2112
- seriesIndex: A.value,
2113
- series: Le.value,
2114
- bars: At.value,
2115
- lines: De.value,
2116
- plots: vt.value,
2117
- config: t.value
2118
- })), pl = x(() => {
2119
- const l = t.value.chart.grid.labels.xAxisLabels.datetimeFormatter, s = dn({
2120
- useUTC: l.useUTC,
2121
- locale: hn[l.locale] || { months: [], shortMonths: [], days: [], shortDays: [] },
2122
- januaryAsYear: l.januaryAsYear
2123
- });
2124
- return (e, u) => {
2125
- const r = t.value.chart.grid.labels.xAxisLabels.values?.[e];
2126
- return r == null ? "" : s.formatDate(new Date(r), u);
2127
- };
2128
- }), $a = x(() => (t.value.chart.grid.labels.xAxisLabels.values || []).map((s, e) => ({
2129
- text: pl.value(e, t.value.chart.zoom.timeFormat),
2130
- absoluteIndex: e
2131
- }))), oa = y(!1), Ua = x(() => {
2132
- let l = "", s = "";
2133
- if (t.value.chart.zoom.preview.enable)
2134
- return { left: l, right: s };
2135
- oa.value = !1;
2136
- const e = t.value.chart.zoom.customFormat;
2137
- if (va(e))
2138
- try {
2139
- const u = e({
2140
- absoluteIndex: p.value.start,
2141
- seriesIndex: p.value.start,
2142
- datapoint: Ct.value
2143
- }), a = e({
2144
- absoluteIndex: p.value.end - 1,
2145
- seriesIndex: p.value.end - 1,
2146
- datapoint: Ct.value
2147
- });
2148
- typeof u == "string" && typeof a == "string" && (l = u, s = a, oa.value = !0);
2149
- } catch {
2150
- console.warn("Custom format cannot be applied on zoom labels."), oa.value = !1;
2151
- }
2152
- if (!oa.value) {
2153
- l = t.value.chart.grid.labels.xAxisLabels.datetimeFormatter.enable && !t.value.chart.zoom.useDefaultFormat ? $a.value[p.value.start]?.text || "" : C.value[0]?.text || "";
2154
- const u = Math.max(p.value.start, p.value.end - 1);
2155
- s = t.value.chart.grid.labels.xAxisLabels.datetimeFormatter.enable && !t.value.chart.zoom.useDefaultFormat ? $a.value[u]?.text || "" : C.value.at(-1)?.text || "";
2156
- }
2157
- return { left: l, right: s };
2158
- }), Io = x(() => {
2159
- let l = "", s = Ct.value.map((a) => a.value).filter((a) => ua(a) && a !== null).reduce((a, r) => Math.abs(a) + Math.abs(r), 0);
2160
- const e = C.value[A.value], u = t.value.chart.tooltip.customFormat;
2161
- if (va(u) && jo(() => u({
2162
- absoluteIndex: A.value + p.value.start,
2163
- seriesIndex: A.value,
2164
- datapoint: Ct.value,
2165
- series: Le.value,
2166
- bars: At.value,
2167
- lines: De.value,
2168
- plots: vt.value,
2169
- config: t.value
2170
- })))
2171
- return u({
2172
- absoluteIndex: A.value + p.value.start,
2173
- seriesIndex: A.value,
2174
- datapoint: Ct.value,
2175
- series: Le.value,
2176
- bars: At.value,
2177
- lines: De.value,
2178
- plots: vt.value,
2179
- config: t.value
2180
- });
2181
- if (e && e.text && t.value.chart.tooltip.showTimeLabel) {
2182
- const a = pl.value(A.value + p.value.start, t.value.chart.tooltip.timeFormat);
2183
- l += `<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${t.value.chart.tooltip.borderColor}; width:100%">${t.value.chart.grid.labels.xAxisLabels.datetimeFormatter.enable && !t.value.chart.tooltip.useDefaultTimeFormat ? a : e.text}</div>`;
2184
- }
2185
- return Ct.value.forEach((a) => {
2186
- if (ua(a.value)) {
2187
- let r = "", o = "";
2188
- switch (et.value[a.type]) {
2189
- case "bar":
2190
- r = `<svg viewBox="0 0 40 40" height="14" width="14">${Dt.pattern ? `<rect x="0" y="0" rx="1" stroke="none" height="40" width="40" fill="${a.color}" />` : ""}<rect x="0" y="0" rx="1" stroke="none" height="40" width="40" fill="${Dt.pattern ? `url(#pattern_${U.value}_${a.slotAbsoluteIndex}` : a.color}" /></svg>`;
2191
- break;
2192
- case "line":
2193
- !a.shape || !["star", "triangle", "square", "diamond", "pentagon", "hexagon"].includes(a.shape) ? o = `<circle cx="10" cy="8" r="4" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="0.5" fill="${a.color}" />` : a.shape === "triangle" ? o = `<path d="${yt({ plot: { x: 10, y: 8 }, radius: 4, sides: 3, rotation: 0.52 }).path}" fill="${a.color}" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="0.5" />` : a.shape === "square" ? o = `<path d="${yt({ plot: { x: 10, y: 8 }, radius: 4, sides: 4, rotation: 0.8 }).path}" fill="${a.color}" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="0.5" />` : a.shape === "diamond" ? o = `<path d="${yt({ plot: { x: 10, y: 8 }, radius: 4, sides: 4, rotation: 0 }).path}" fill="${a.color}" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="0.5" />` : a.shape === "pentagon" ? o = `<path d="${yt({ plot: { x: 10, y: 8 }, radius: 4, sides: 5, rotation: 0.95 }).path}" fill="${a.color}" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="0.5" />` : a.shape === "hexagon" ? o = `<path d="${yt({ plot: { x: 10, y: 8 }, radius: 4, sides: 6, rotation: 0 }).path}" fill="${a.color}" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="0.5" />` : a.shape === "star" && (o = `<polygon stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="0.5" fill="${a.color}" points="${go({ plot: { x: 10, y: 8 }, radius: 4 })}" />`), r = `<svg viewBox="0 0 20 12" height="14" width="20"><rect rx="1.5" x="0" y="6.5" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="0.5" height="3" width="20" fill="${a.color}" />${o}</svg>`;
2194
- break;
2195
- case "plot":
2196
- if (!a.shape || !["star", "triangle", "square", "diamond", "pentagon", "hexagon"].includes(a.shape)) {
2197
- r = `<svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="1" fill="${a.color}" /></svg>`;
2198
- break;
2199
- }
2200
- if (a.shape === "star") {
2201
- r = `<svg viewBox="0 0 12 12" height="14" width="14"><polygon stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="1" fill="${a.color}" points="${go({ plot: { x: 6, y: 6 }, radius: 5 })}" /></svg>`;
2202
- break;
2203
- }
2204
- if (a.shape === "triangle") {
2205
- r = `<svg viewBox="0 0 12 12" height="14" width="14"><path d="${yt({ plot: { x: 6, y: 6 }, radius: 6, sides: 3, rotation: 0.52 }).path}" fill="${a.color}" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;
2206
- break;
2207
- }
2208
- if (a.shape === "square") {
2209
- r = `<svg viewBox="0 0 12 12" height="14" width="14"><path d="${yt({ plot: { x: 6, y: 6 }, radius: 6, sides: 4, rotation: 0.8 }).path}" fill="${a.color}" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;
2210
- break;
2211
- }
2212
- if (a.shape === "diamond") {
2213
- r = `<svg viewBox="0 0 12 12" height="14" width="14"><path d="${yt({ plot: { x: 6, y: 6 }, radius: 5, sides: 4, rotation: 0 }).path}" fill="${a.color}" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;
2214
- break;
2215
- }
2216
- if (a.shape === "pentagon") {
2217
- r = `<svg viewBox="0 0 12 12" height="14" width="14"><path d="${yt({ plot: { x: 6, y: 6 }, radius: 5, sides: 5, rotation: 0.95 }).path}" fill="${a.color}" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;
2218
- break;
2219
- }
2220
- if (a.shape === "hexagon") {
2221
- r = `<svg viewBox="0 0 12 12" height="14" width="14"><path d="${yt({ plot: { x: 6, y: 6 }, radius: 5, sides: 6, rotation: 0 }).path}" fill="${a.color}" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;
2222
- break;
2223
- }
2224
- }
2225
- l += `<div style="display:flex;flex-direction:row; align-items:center;gap:3px;"><div style="width:20px">${r}</div> ${a.name}: <b>${t.value.chart.tooltip.showValue ? Te(
2226
- a.type === "line" ? t.value.line.labels.formatter : a.type === "bar" ? t.value.bar.labels.formatter : t.value.plot.labels.formatter,
2227
- a.value,
2228
- ot({
2229
- p: a.prefix,
2230
- v: a.value,
2231
- s: a.suffix,
2232
- r: t.value.chart.tooltip.roundingValue
2233
- }),
2234
- { datapoint: a }
2235
- ) : ""}</b> ${t.value.chart.tooltip.showPercentage ? `(${ot({
2236
- v: G(Math.abs(a.value) / s * 100),
2237
- s: "%",
2238
- r: t.value.chart.tooltip.roundingPercentage
2239
- })})` : ""}</div>`, t.value.chart.comments.showInTooltip && a.comments.length && a.comments.slice(p.value.start, p.value.end)[A.value] && (l += `<div class="vue-data-ui-tooltip-comment" style="background:${a.color}20; padding: 6px; margin-bottom: 6px; border-left: 1px solid ${a.color}">${a.comments.slice(p.value.start, p.value.end)[A.value]}</div>`);
2240
- }
2241
- }), `<div style="border-radius:4px;padding:12px;font-variant-numeric: tabular-nums;color:${t.value.chart.tooltip.color}">${l}</div>`;
2242
- }), qa = x(() => {
2243
- if (Pe.value.length === 0) return { head: [], body: [], config: {}, columnNames: [] };
2244
- const l = Ce.value.map((e) => ({
2245
- label: e.name,
2246
- color: e.color,
2247
- type: e.type
2248
- })), s = [];
2249
- return C.value.forEach((e, u) => {
2250
- const a = t.value.table.useDefaultTimeFormat ? [e.text] : [pl.value(u + p.value.start, t.value.table.timeFormat)];
2251
- Ce.value.forEach((r) => {
2252
- a.push($e(r.absoluteValues[u]) ? Number(r.absoluteValues[u].toFixed(t.value.table.rounding)) : "");
2253
- }), s.push(a);
2254
- }), { head: l, body: s };
2255
- }), na = x(() => {
2256
- const l = t.value.table.showSum;
2257
- let s = [""].concat(Ce.value.map((r) => r.name));
2258
- l && (s = s.concat(' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>'));
2259
- let e = [];
2260
- for (let r = 0; r < P.value; r += 1) {
2261
- const o = Ce.value.map((R) => R.absoluteValues[r] ?? 0).reduce((R, E) => R + E, 0);
2262
- e.push(
2263
- [
2264
- t.value.table.useDefaultTimeFormat ? C.value[r].text ?? "-" : pl.value(r + p.value.start, t.value.table.timeFormat)
2265
- ].concat(Ce.value.map(
2266
- (R) => Te(
2267
- R.type === "line" ? t.value.line.labels.formatter : R.type === "bar" ? t.value.bar.labels.formatter : t.value.plot.labels.formatter,
2268
- R.absoluteValues[r] ?? 0,
2269
- ot({
2270
- p: R.prefix || t.value.chart.labels.prefix,
2271
- v: R.absoluteValues[r] ?? 0,
2272
- s: R.suffix || t.value.chart.labels.suffix,
2273
- r: t.value.table.rounding
2274
- })
2275
- )
2276
- )).concat(l ? (o ?? 0).toFixed(t.value.table.rounding) : [])
2277
- );
2278
- }
2279
- const u = {
2280
- th: {
2281
- backgroundColor: t.value.table.th.backgroundColor,
2282
- color: t.value.table.th.color,
2283
- outline: t.value.table.th.outline
2284
- },
2285
- td: {
2286
- backgroundColor: t.value.table.td.backgroundColor,
2287
- color: t.value.table.td.color,
2288
- outline: t.value.table.td.outline
2289
- },
2290
- breakpoint: t.value.table.responsiveBreakpoint
2291
- }, a = [t.value.table.columnNames.period].concat(Ce.value.map((r) => r.name)).concat(t.value.table.columnNames.total);
2292
- return { head: s, body: e, config: u, colNames: a };
2293
- });
2294
- function _a(l = null) {
2295
- const s = [[t.value.chart.title.text], [t.value.chart.title.subtitle.text], [""]], e = ["", ...qa.value.head.map((o) => o.label)], u = qa.value.body, a = s.concat([e]).concat(u), r = on(a);
2296
- l ? l(r) : nn({ csvContent: r, title: t.value.chart.title.text || "vue-ui-xy" });
2297
- }
2298
- function Za(l, s = null) {
2299
- Al.value = l;
2300
- const e = Ce.value.map((u) => ({
2301
- name: u.name,
2302
- value: [null, void 0, NaN].includes(u.absoluteValues[s]) ? null : u.absoluteValues[s],
2303
- color: u.color,
2304
- type: u.type
2305
- }));
2306
- l ? (A.value = s, t.value.events.datapointEnter && t.value.events.datapointEnter({ datapoint: e, seriesIndex: s + p.value.start })) : (A.value = null, t.value.events.datapointLeave && t.value.events.datapointLeave({ datapoint: e, seriesIndex: s + p.value.start }));
2307
- }
2308
- function Ka() {
2309
- k.value.showTable = !k.value.showTable;
2310
- }
2311
- function Ja() {
2312
- k.value.dataLabels.show = !k.value.dataLabels.show;
2313
- }
2314
- function Qa() {
2315
- k.value.showTooltip = !k.value.showTooltip;
2316
- }
2317
- function ja(l) {
2318
- ee.value = l, zl.value += 1;
2319
- }
2320
- function eo() {
2321
- if (!t.value.responsiveProportionalSizing) {
2322
- L.value.dataLabels = t.value.chart.grid.labels.fontSize, L.value.yAxis = t.value.chart.grid.labels.axis.fontSize, L.value.xAxis = t.value.chart.grid.labels.xAxisLabels.fontSize, L.value.plotLabels = t.value.chart.labels.fontSize, Ne.value.plot = t.value.plot.radius, Ne.value.line = t.value.line.radius;
2323
- return;
2324
- }
2325
- L.value.dataLabels = wl({
2326
- relator: se.value,
2327
- adjuster: 400,
2328
- source: t.value.chart.grid.labels.fontSize,
2329
- threshold: 10,
2330
- fallback: 10
2331
- }), L.value.yAxis = wl({
2332
- relator: re.value,
2333
- adjuster: 1e3,
2334
- source: t.value.chart.grid.labels.axis.fontSize,
2335
- threshold: 10,
2336
- fallback: 10
2337
- }), L.value.xAxis = wl({
2338
- relator: re.value,
2339
- adjuster: 1e3,
2340
- source: t.value.chart.grid.labels.xAxisLabels.fontSize,
2341
- threshold: 10,
2342
- fallback: 10
2343
- }), L.value.plotLabels = wl({
2344
- relator: re.value,
2345
- adjuster: 800,
2346
- source: t.value.chart.labels.fontSize,
2347
- threshold: 10,
2348
- fallback: 10
2349
- }), Ne.value.plot = wl({
2350
- relator: re.value,
2351
- adjuster: 800,
2352
- source: t.value.plot.radius,
2353
- threshold: 1,
2354
- fallback: 1
2355
- }), Ne.value.line = wl({
2356
- relator: re.value,
2357
- adjuster: 800,
2358
- source: t.value.line.radius,
2359
- threshold: 1,
2360
- fallback: 1
2361
- });
2362
- }
2363
- function Ma() {
2364
- xo(m.dataset) ? (Ca({
2365
- componentName: "VueUiXy",
2366
- type: "dataset",
2367
- debug: Mt.value
2368
- }), ml.value = !0) : m.dataset.forEach((s, e) => {
2369
- [null, void 0].includes(s.name) && (Ca({
2370
- componentName: "VueUiXy",
2371
- type: "datasetSerieAttribute",
2372
- property: "name (string)",
2373
- index: e,
2374
- debug: Mt.value
2375
- }), ml.value = !0);
2376
- }), Mt.value && m.dataset.forEach((s) => {
2377
- s.series.forEach((e, u) => {
2378
- ua(e) || console.warn(`VueUiXy has detected an unsafe value in your dataset:
2379
- -----> The serie '${s.name}' contains the value '${e}' at index ${u}.
2380
- '${e}' was converted to null to allow the chart to display.`);
2381
- });
2382
- }), xo(m.dataset) || (ml.value = t.value.loading), Gl.value = t.value.chart.userOptions.showOnChartHover, vl.value = t.value.chart.userOptions.keepStateOnChartLeave, dl.value = !t.value.chart.userOptions.showOnChartHover, Ut();
2383
- const l = 12;
2384
- if (t.value.responsive) {
2385
- const e = je.value.parentNode;
2386
- it.value && (it.value.unobserve(rl.value), it.value.disconnect());
2387
- const { height: u, width: a } = e.getBoundingClientRect();
2388
- let r = null, o = 0;
2389
- t.value.chart.title.show && Ge.value && (r = Ge.value, o = r.getBoundingClientRect().height);
2390
- let R = null, E = 0;
2391
- t.value.chart.zoom.show && Be.value > 6 && Gt.value && Re.value && Re.value.$el && (R = Re.value.$el, E = R.getBoundingClientRect().height);
2392
- let X = null, T = 0;
2393
- t.value.chart.legend.show && ft.value && (X = ft.value, T = X.getBoundingClientRect().height);
2394
- let V = 0;
2395
- pt.value && (V = pt.value.getBoundingClientRect().height);
2396
- let j = 0;
2397
- kt.value && (j = kt.value.getBoundingClientRect().height), se.value = u - o - T - E - V - j - l, re.value = a, cl.value = `0 0 ${re.value < 0 ? 10 : re.value} ${se.value < 0 ? 10 : se.value}`, eo();
2398
- const I = new ResizeObserver((Y) => {
2399
- for (const O of Y)
2400
- t.value.chart.title.show && Ge.value ? o = Ge.value.getBoundingClientRect().height : o = 0, Re.value && Re.value.$el ? E = Re.value.$el.getBoundingClientRect().height : E = 0, ft.value ? T = ft.value.getBoundingClientRect().height : T = 0, pt.value ? V = pt.value.getBoundingClientRect().height : V = 0, kt.value ? j = kt.value.getBoundingClientRect().height : j = 0, requestAnimationFrame(() => {
2401
- se.value = O.contentRect.height - o - T - E - V - j - l, re.value = O.contentBoxSize[0].inlineSize, cl.value = `0 0 ${re.value < 0 ? 10 : re.value} ${se.value < 0 ? 10 : se.value}`, eo();
2402
- });
2403
- });
2404
- it.value = I, rl.value = e, I.observe(e);
2405
- } else
2406
- se.value = t.value.chart.height, re.value = t.value.chart.width, L.value.dataLabels = t.value.chart.grid.labels.fontSize, L.value.yAxis = t.value.chart.grid.labels.axis.fontSize, L.value.xAxis = t.value.chart.grid.labels.xAxisLabels.fontSize, L.value.plotLabels = t.value.chart.labels.fontSize, Ne.value.plot = t.value.plot.radius, Ne.value.line = t.value.line.radius, cl.value = `0 0 ${re.value} ${se.value}`;
2407
- }
2408
- function to(l) {
2409
- St.value = {
2410
- x: l.clientX,
2411
- y: l.clientY
2412
- };
2413
- }
2414
- Sl(() => {
2415
- Ma(), be(), document.addEventListener("mousemove", to, { passive: !0 }), document.addEventListener("scroll", Ql, { passive: !0 });
2416
- }), il(() => {
2417
- document.removeEventListener("scroll", Ql, { passive: !0 }), document.removeEventListener("mousemove", to, { passive: !0 }), it.value && (it.value.unobserve(rl.value), it.value.disconnect(), it.value = null);
2418
- }), mn({
2419
- timeLabelsEls: Nt,
2420
- timeLabels: C,
2421
- slicer: p,
2422
- configRef: t,
2423
- rotationPath: ["chart", "grid", "labels", "xAxisLabels", "rotation"],
2424
- autoRotatePath: ["chart", "grid", "labels", "xAxisLabels", "autoRotate", "enable"],
2425
- isAutoSize: pa,
2426
- height: se,
2427
- width: re,
2428
- rotation: t.value.chart.grid.labels.xAxisLabels.autoRotate.angle
2429
- });
2430
- const ia = y(!1), lo = y(null), ao = y(200), No = x(
2431
- () => A.value ?? H.value ?? 0
2432
- );
2433
- function Po() {
2434
- const l = Math.ceil(ao.value || 200);
2435
- return Math.min(Math.max(l, 1), 200);
2436
- }
2437
- function Fo() {
2438
- const l = Po(), s = 200, e = Math.max(1, P.value), u = c.value.width / e, r = c.value.left + No.value * u + u / 2 - l / 2 - (s - l) / 2, o = c.value.left - (s - l) / 2, R = c.value.right - (s + l) / 2, E = Math.max(o, Math.min(r, R));
2439
- return G(E);
2440
- }
2441
- Sl(() => {
2442
- let l = null, s = null;
2443
- const e = (r) => {
2444
- cancelAnimationFrame(s), s = requestAnimationFrame(() => {
2445
- ao.value = Math.min(Math.max(Math.ceil(r || 0), 1), 200);
2446
- });
2447
- }, u = new ResizeObserver((r) => {
2448
- let o = r.find((R) => R.target === l) || r[0];
2449
- o && e(o.contentRect.width || 200);
2450
- }), a = so((r) => {
2451
- const o = lo.value;
2452
- l && l !== o && (u.unobserve(l), l = null), o && o !== l && (ul(() => {
2453
- o.offsetParent !== null && e(o.offsetWidth || o.getBoundingClientRect().width || 200);
2454
- }), u.observe(o), l = o), r(() => {
2455
- l && (u.unobserve(l), l = null);
2456
- });
2457
- });
2458
- il(() => {
2459
- try {
2460
- l && u.unobserve(l), u.disconnect(), a();
2461
- } catch {
2462
- }
2463
- });
2464
- });
2465
- const Ro = x(() => {
2466
- if ([null, void 0].includes(A.value) && [null, void 0].includes(H.value)) return "";
2467
- const l = (A.value != null ? A.value : 0) || (H.value != null ? H.value : 0), s = t.value.chart.timeTag.customFormat;
2468
- if (ia.value = !1, va(s))
2469
- try {
2470
- const e = s({
2471
- absoluteIndex: l + p.value.start,
2472
- seriesIndex: l,
2473
- datapoint: Ct.value,
2474
- bars: At.value,
2475
- lines: De.value,
2476
- plots: vt.value,
2477
- config: t.value
2478
- });
2479
- if (typeof e == "string")
2480
- return ia.value = !0, e;
2481
- } catch {
2482
- console.warn("Custom format cannot be applied on timeTag."), ia.value = !1;
2483
- }
2484
- if (!ia.value)
2485
- return [null, void 0].includes(C.value[l]) ? "" : t.value.chart.grid.labels.xAxisLabels.datetimeFormatter.enable && !t.value.chart.timeTag.useDefaultFormat ? pl.value(l + p.value.start, t.value.chart.timeTag.timeFormat) : C.value[l].text;
2486
- });
2487
- mt(() => m.dataset, (l) => {
2488
- Array.isArray(l) && l.length > 0 && (ml.value = !1), Be.value = Math.max(...fe.value.map((s) => st(s.series).length)), p.value = {
2489
- start: 0,
2490
- end: Be.value
2491
- }, Pt.value += 1, Tl.value += 1, Ue();
2492
- }, { deep: !0 }), mt(() => m.config, (l) => {
2493
- me.value || (t.value = Yt()), Ma(), Ft.value += 1, _t.value += 1, Ut(), Ue();
2494
- }, { deep: !0 });
2495
- const La = y(!1);
2496
- function oo() {
2497
- const l = je.value?.parentNode;
2498
- if (!l) {
2499
- La.value = !1;
2500
- return;
2501
- }
2502
- const s = l.getBoundingClientRect();
2503
- La.value = s.width > 2 && s.height > 2;
2504
- }
2505
- Sl(() => {
2506
- oo();
2507
- const l = new ResizeObserver(() => {
2508
- oo(), La.value && (Ma(), Ue(), be());
2509
- });
2510
- je.value?.parentNode && l.observe(je.value.parentNode);
2511
- }), mt(t, () => {
2512
- Ut();
2513
- }, { immediate: !0 });
2514
- const Hl = x(() => {
2515
- const l = t.value.table.useDialog && !t.value.showTable, s = k.value.showTable;
2516
- return {
2517
- component: l ? _l : yn,
2518
- title: `${t.value.chart.title.text}${t.value.chart.title.subtitle.text ? `: ${t.value.chart.title.subtitle.text}` : ""}`,
2519
- props: l ? {
2520
- backgroundColor: t.value.table.th.backgroundColor,
2521
- color: t.value.table.th.color,
2522
- headerColor: t.value.table.th.color,
2523
- headerBg: t.value.table.th.backgroundColor,
2524
- isFullscreen: ee.value,
2525
- fullscreenParent: je.value,
2526
- forcedWidth: Math.min(800, window.innerWidth * 0.8)
2527
- } : {
2528
- hideDetails: !0,
2529
- config: {
2530
- open: s,
2531
- maxHeight: 1e4,
2532
- body: {
2533
- backgroundColor: t.value.chart.backgroundColor,
2534
- color: t.value.chart.color
2535
- },
2536
- head: {
2537
- backgroundColor: t.value.chart.backgroundColor,
2538
- color: t.value.chart.color
2539
- }
2540
- }
2541
- }
2542
- };
2543
- });
2544
- mt(() => k.value.showTable, (l) => {
2545
- t.value.showTable || (l && t.value.table.useDialog && Ie.value ? Ie.value.open() : Ie.value && Ie.value.close && Ie.value.close());
2546
- });
2547
- function no() {
2548
- k.value.showTable = !1, ae.value && ae.value.setTableIconState(!1);
2549
- }
2550
- return ga({
2551
- getData: $o,
2552
- getImage: _o,
2553
- generatePdf: Pl,
2554
- generateImage: Zl,
2555
- generateCsv: _a,
2556
- toggleStack: jl,
2557
- toggleTable: Ka,
2558
- toggleLabels: Ja,
2559
- toggleTooltip: Qa,
2560
- toggleAnnotator: z,
2561
- toggleFullscreen: ja
2562
- }), (l, s) => (n(), i("div", {
2563
- id: `vue-ui-xy_${U.value}`,
2564
- class: Qe(`vue-ui-xy ${ee.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${t.value.useCssAnimation ? "" : "vue-ui-dna"}`),
2565
- ref_key: "chart",
2566
- ref: je,
2567
- style: M(`background:${t.value.chart.backgroundColor}; color:${t.value.chart.color};width:100%;font-family:${t.value.chart.fontFamily};${t.value.responsive ? "height: 100%" : ""}`),
2568
- onMouseenter: s[10] || (s[10] = () => h(!0)),
2569
- onMouseleave: s[11] || (s[11] = () => h(!1))
2570
- }, [
2571
- t.value.chart.userOptions.buttons.annotator && Me.value ? (n(), at(v(Tt), {
2572
- key: 0,
2573
- svgRef: Me.value,
2574
- backgroundColor: t.value.chart.backgroundColor,
2575
- color: t.value.chart.color,
2576
- active: $t.value,
2577
- onClose: z
2578
- }, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : g("", !0),
2579
- Lo.value ? (n(), i("div", {
2580
- key: 1,
2581
- ref_key: "noTitle",
2582
- ref: kt,
2583
- class: "vue-data-ui-no-title-space",
2584
- style: "height:36px; width: 100%; background:transparent"
2585
- }, null, 512)) : g("", !0),
2586
- t.value.chart.title.show ? (n(), i("div", {
2587
- key: 2,
2588
- ref_key: "chartTitle",
2589
- ref: Ge,
2590
- class: "vue-ui-xy-title",
2591
- style: M(`font-family:${t.value.chart.fontFamily}`)
2592
- }, [
2593
- (n(), at(gn, {
2594
- key: `title_${Ft.value}`,
2595
- config: {
2596
- title: {
2597
- cy: "xy-div-title",
2598
- ...t.value.chart.title
2599
- },
2600
- subtitle: {
2601
- cy: "xy-div-subtitle",
2602
- ...t.value.chart.title.subtitle
2603
- }
2604
- }
2605
- }, null, 8, ["config"]))
2606
- ], 4)) : g("", !0),
2607
- w("div", {
2608
- id: `legend-top-${U.value}`
2609
- }, null, 8, vi),
2610
- t.value.chart.userOptions.show && (vl.value || dl.value) ? (n(), at(v(Se), {
2611
- ref_key: "userOptionsRef",
2612
- ref: ae,
2613
- key: `user_options_${zl.value}`,
2614
- backgroundColor: t.value.chart.backgroundColor,
2615
- color: t.value.chart.color,
2616
- isPrinting: v(lt),
2617
- isImaging: v(rt),
2618
- uid: U.value,
2619
- hasTooltip: t.value.chart.userOptions.buttons.tooltip && t.value.chart.tooltip.show,
2620
- hasPdf: t.value.chart.userOptions.buttons.pdf,
2621
- hasXls: t.value.chart.userOptions.buttons.csv,
2622
- hasImg: t.value.chart.userOptions.buttons.img,
2623
- hasLabel: t.value.chart.userOptions.buttons.labels,
2624
- hasTable: t.value.chart.userOptions.buttons.table,
2625
- hasStack: S.dataset.length > 1 && t.value.chart.userOptions.buttons.stack,
2626
- hasFullscreen: t.value.chart.userOptions.buttons.fullscreen,
2627
- isStacked: k.value.isStacked,
2628
- isFullscreen: ee.value,
2629
- chartElement: l.$refs.chart,
2630
- position: t.value.chart.userOptions.position,
2631
- isTooltip: k.value.showTooltip,
2632
- titles: { ...t.value.chart.userOptions.buttonTitles },
2633
- hasAnnotator: t.value.chart.userOptions.buttons.annotator,
2634
- isAnnotation: $t.value,
2635
- callbacks: t.value.chart.userOptions.callbacks,
2636
- tableDialog: t.value.table.useDialog,
2637
- printScale: t.value.chart.userOptions.print.scale,
2638
- onToggleFullscreen: ja,
2639
- onGeneratePdf: v(Pl),
2640
- onGenerateCsv: _a,
2641
- onGenerateImage: v(Zl),
2642
- onToggleTable: Ka,
2643
- onToggleLabels: Ja,
2644
- onToggleStack: jl,
2645
- onToggleTooltip: Qa,
2646
- onToggleAnnotator: z,
2647
- style: M({
2648
- visibility: vl.value ? dl.value ? "visible" : "hidden" : "visible"
2649
- })
2650
- }, ro({ _: 2 }, [
2651
- l.$slots.menuIcon ? {
2652
- name: "menuIcon",
2653
- fn: we(({ isOpen: e, color: u }) => [
2654
- Q(l.$slots, "menuIcon", zt(Bt({ isOpen: e, color: u })), void 0, !0)
2655
- ]),
2656
- key: "0"
2657
- } : void 0,
2658
- l.$slots.optionTooltip ? {
2659
- name: "optionTooltip",
2660
- fn: we(() => [
2661
- Q(l.$slots, "optionTooltip", {}, void 0, !0)
2662
- ]),
2663
- key: "1"
2664
- } : void 0,
2665
- l.$slots.optionPdf ? {
2666
- name: "optionPdf",
2667
- fn: we(() => [
2668
- Q(l.$slots, "optionPdf", {}, void 0, !0)
2669
- ]),
2670
- key: "2"
2671
- } : void 0,
2672
- l.$slots.optionCsv ? {
2673
- name: "optionCsv",
2674
- fn: we(() => [
2675
- Q(l.$slots, "optionCsv", {}, void 0, !0)
2676
- ]),
2677
- key: "3"
2678
- } : void 0,
2679
- l.$slots.optionImg ? {
2680
- name: "optionImg",
2681
- fn: we(() => [
2682
- Q(l.$slots, "optionImg", {}, void 0, !0)
2683
- ]),
2684
- key: "4"
2685
- } : void 0,
2686
- l.$slots.optionTable ? {
2687
- name: "optionTable",
2688
- fn: we(() => [
2689
- Q(l.$slots, "optionTable", {}, void 0, !0)
2690
- ]),
2691
- key: "5"
2692
- } : void 0,
2693
- l.$slots.optionLabels ? {
2694
- name: "optionLabels",
2695
- fn: we(() => [
2696
- Q(l.$slots, "optionLabels", {}, void 0, !0)
2697
- ]),
2698
- key: "6"
2699
- } : void 0,
2700
- l.$slots.optionStack ? {
2701
- name: "optionStack",
2702
- fn: we(() => [
2703
- Q(l.$slots, "optionStack", {}, void 0, !0)
2704
- ]),
2705
- key: "7"
2706
- } : void 0,
2707
- l.$slots.optionFullscreen ? {
2708
- name: "optionFullscreen",
2709
- fn: we(({ toggleFullscreen: e, isFullscreen: u }) => [
2710
- Q(l.$slots, "optionFullscreen", zt(Bt({ toggleFullscreen: e, isFullscreen: u })), void 0, !0)
2711
- ]),
2712
- key: "8"
2713
- } : void 0,
2714
- l.$slots.optionAnnotator ? {
2715
- name: "optionAnnotator",
2716
- fn: we(({ toggleAnnotator: e, isAnnotator: u }) => [
2717
- Q(l.$slots, "optionAnnotator", zt(Bt({ toggleAnnotator: e, isAnnotator: u })), void 0, !0)
2718
- ]),
2719
- key: "9"
2720
- } : void 0
2721
- ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasXls", "hasImg", "hasLabel", "hasTable", "hasStack", "hasFullscreen", "isStacked", "isFullscreen", "chartElement", "position", "isTooltip", "titles", "hasAnnotator", "isAnnotation", "callbacks", "tableDialog", "printScale", "onGeneratePdf", "onGenerateImage", "style"])) : g("", !0),
2722
- (n(), i("svg", {
2723
- ref_key: "svgRef",
2724
- ref: Me,
2725
- xmlns: "http://www.w3.org/2000/svg",
2726
- class: Qe([{ "vue-data-ui-fullscreen--on": ee.value, "vue-data-ui-fulscreen--off": !ee.value }, "vue-ui-xy-svg vue-data-ui-svg"]),
2727
- width: "100%",
2728
- viewBox: cl.value,
2729
- style: M({
2730
- background: "transparent",
2731
- color: t.value.chart.color,
2732
- fontFamily: t.value.chart.fontFamily
2733
- }),
2734
- "aria-label": Mo.value,
2735
- role: "img",
2736
- "aria-live": "polite",
2737
- preserveAspectRatio: "xMidYMid",
2738
- onMousemove: ko,
2739
- onMouseleave: Sa,
2740
- onClick: wo
2741
- }, [
2742
- w("g", {
2743
- ref_key: "G",
2744
- ref: Ml,
2745
- class: "vue-data-ui-g"
2746
- }, [
2747
- nl(v(sl)),
2748
- l.$slots["chart-background"] ? (n(), i("foreignObject", {
2749
- key: 0,
2750
- x: c.value.left + oe.value < 0 ? 0 : c.value.left + oe.value,
2751
- y: c.value.top,
2752
- width: c.value.width - (t.value.chart.grid.position === "middle" ? 0 : c.value.width / P.value) < 0 ? 0 : c.value.width - (t.value.chart.grid.position === "middle" ? 0 : c.value.width / P.value),
2753
- height: c.value.height < 0 ? 0 : c.value.height,
2754
- style: {
2755
- pointerEvents: "none"
2756
- }
2757
- }, [
2758
- Q(l.$slots, "chart-background", {}, void 0, !0)
2759
- ], 8, hi)) : g("", !0),
2760
- P.value > 0 ? (n(), i("g", mi, [
2761
- w("g", fi, [
2762
- t.value.chart.grid.labels.xAxis.showBaseline ? (n(), i("line", {
2763
- key: 0,
2764
- stroke: t.value.chart.grid.stroke,
2765
- "stroke-width": "1",
2766
- x1: c.value.left + oe.value,
2767
- x2: c.value.right - oe.value,
2768
- y1: v(J)(c.value.bottom),
2769
- y2: v(J)(c.value.bottom),
2770
- "stroke-linecap": "round",
2771
- style: { animation: "none !important" }
2772
- }, null, 8, gi)) : g("", !0),
2773
- k.value.useIndividualScale ? t.value.chart.grid.showHorizontalLines ? (n(!0), i(b, { key: 2 }, _(El.value, (e) => (n(), i("g", null, [
2774
- e.id === $.value && e.yLabels.length ? (n(!0), i(b, { key: 0 }, _(e.yLabels, (u) => (n(), i("line", {
2775
- x1: c.value.left + oe.value,
2776
- x2: c.value.right - oe.value,
2777
- y1: v(J)(u.y),
2778
- y2: v(J)(u.y),
2779
- stroke: e.color,
2780
- "stroke-width": 0.5,
2781
- "stroke-linecap": "round",
2782
- style: { animation: "none !important" }
2783
- }, null, 8, pi))), 256)) : e.yLabels.length ? (n(!0), i(b, { key: 1 }, _(e.yLabels, (u) => (n(), i("line", {
2784
- x1: c.value.left + oe.value,
2785
- x2: c.value.right - oe.value,
2786
- y1: v(J)(u.y),
2787
- y2: v(J)(u.y),
2788
- stroke: t.value.chart.grid.stroke,
2789
- "stroke-width": 0.5,
2790
- "stroke-linecap": "round",
2791
- style: { animation: "none !important" }
2792
- }, null, 8, ki))), 256)) : g("", !0)
2793
- ]))), 256)) : g("", !0) : (n(), i(b, { key: 1 }, [
2794
- t.value.chart.grid.labels.yAxis.showBaseline ? (n(), i("line", {
2795
- key: 0,
2796
- stroke: t.value.chart.grid.stroke,
2797
- "stroke-width": "1",
2798
- x1: c.value.left + oe.value,
2799
- x2: c.value.left + oe.value,
2800
- y1: v(J)(c.value.top),
2801
- y2: v(J)(c.value.bottom),
2802
- "stroke-linecap": "round",
2803
- style: { animation: "none !important" }
2804
- }, null, 8, xi)) : g("", !0),
2805
- t.value.chart.grid.showHorizontalLines ? (n(), i("g", bi, [
2806
- (n(!0), i(b, null, _(Da.value, (e) => (n(), i("line", {
2807
- x1: c.value.left + oe.value,
2808
- x2: c.value.right,
2809
- y1: v(J)(e.y),
2810
- y2: v(J)(e.y),
2811
- stroke: t.value.chart.grid.stroke,
2812
- "stroke-width": 0.5,
2813
- "stroke-linecap": "round",
2814
- style: { animation: "none !important" }
2815
- }, null, 8, yi))), 256))
2816
- ])) : g("", !0)
2817
- ], 64)),
2818
- t.value.chart.grid.showVerticalLines ? (n(), i("g", wi, [
2819
- w("path", {
2820
- d: Zt.value,
2821
- "stroke-width": 0.5,
2822
- stroke: t.value.chart.grid.stroke,
2823
- "stroke-linecap": "round",
2824
- style: { animation: "none !important" }
2825
- }, null, 8, Si)
2826
- ])) : g("", !0),
2827
- t.value.chart.grid.labels.xAxisLabels.show ? (n(), i("g", $i, [
2828
- w("path", {
2829
- d: Kt.value,
2830
- stroke: t.value.chart.grid.stroke,
2831
- "stroke-width": 1,
2832
- "stroke-linecap": "round",
2833
- style: { animation: "none !important" }
2834
- }, null, 8, _i)
2835
- ])) : g("", !0)
2836
- ]),
2837
- (n(!0), i(b, null, _(At.value, (e, u) => (n(), i("defs", {
2838
- key: `def_rect_${u}`
2839
- }, [
2840
- l.$slots["bar-gradient"] ? Q(l.$slots, "bar-gradient", Ht({
2841
- key: 0,
2842
- ref_for: !0
2843
- }, { series: e, positiveId: `rectGradient_pos_${u}_${U.value}`, negativeId: `rectGradient_neg_${u}_${U.value}` }), void 0, !0) : (n(), i(b, { key: 1 }, [
2844
- w("linearGradient", {
2845
- id: `rectGradient_pos_${u}_${U.value}`,
2846
- x2: "0%",
2847
- y2: "100%"
2848
- }, [
2849
- w("stop", {
2850
- offset: "0%",
2851
- "stop-color": e.color
2852
- }, null, 8, Li),
2853
- w("stop", {
2854
- offset: "62%",
2855
- "stop-color": `${v(ol)(e.color, 0.02)}`
2856
- }, null, 8, Ci),
2857
- w("stop", {
2858
- offset: "100%",
2859
- "stop-color": `${v(ol)(e.color, 0.05)}`
2860
- }, null, 8, Ai)
2861
- ], 8, Mi),
2862
- w("linearGradient", {
2863
- id: `rectGradient_neg_${u}_${U.value}`,
2864
- x2: "0%",
2865
- y2: "100%"
2866
- }, [
2867
- w("stop", {
2868
- offset: "0%",
2869
- "stop-color": `${v(ol)(e.color, 0.05)}`
2870
- }, null, 8, Ti),
2871
- w("stop", {
2872
- offset: "38%",
2873
- "stop-color": `${v(ol)(e.color, 0.02)}`
2874
- }, null, 8, Ii),
2875
- w("stop", {
2876
- offset: "100%",
2877
- "stop-color": e.color
2878
- }, null, 8, Ni)
2879
- ], 8, zi)
2880
- ], 64))
2881
- ]))), 128)),
2882
- (n(!0), i(b, null, _(vt.value, (e, u) => (n(), i("defs", {
2883
- key: `def_plot_${u}`
2884
- }, [
2885
- w("radialGradient", {
2886
- id: `plotGradient_${u}_${U.value}`,
2887
- cx: "50%",
2888
- cy: "50%",
2889
- r: "50%",
2890
- fx: "50%",
2891
- fy: "50%"
2892
- }, [
2893
- w("stop", {
2894
- offset: "0%",
2895
- "stop-color": `${v(ol)(e.color, 0.05)}`
2896
- }, null, 8, Fi),
2897
- w("stop", {
2898
- offset: "100%",
2899
- "stop-color": e.color
2900
- }, null, 8, Ri)
2901
- ], 8, Pi)
2902
- ]))), 128)),
2903
- (n(!0), i(b, null, _(De.value, (e, u) => (n(), i("defs", {
2904
- key: `def_line_${e.id}`
2905
- }, [
2906
- w("radialGradient", {
2907
- id: `lineGradient_${u}_${U.value}`,
2908
- cx: "50%",
2909
- cy: "50%",
2910
- r: "50%",
2911
- fx: "50%",
2912
- fy: "50%"
2913
- }, [
2914
- w("stop", {
2915
- offset: "0%",
2916
- "stop-color": `${v(ol)(e.color, 0.05)}`
2917
- }, null, 8, Oi),
2918
- w("stop", {
2919
- offset: "100%",
2920
- "stop-color": e.color
2921
- }, null, 8, Bi)
2922
- ], 8, Vi),
2923
- l.$slots["area-gradient"] ? Q(l.$slots, "area-gradient", Ht({
2924
- key: 0,
2925
- ref_for: !0
2926
- }, { series: e, id: `areaGradient_${u}_${U.value}` }), void 0, !0) : (n(), i("linearGradient", {
2927
- key: 1,
2928
- id: `areaGradient_${u}_${U.value}`,
2929
- x1: "0%",
2930
- x2: "100%",
2931
- y1: "0%",
2932
- y2: "0%"
2933
- }, [
2934
- w("stop", {
2935
- offset: "0%",
2936
- "stop-color": `${v(dt)(v(ol)(e.color, 0.03), t.value.line.area.opacity)}`
2937
- }, null, 8, Hi),
2938
- w("stop", {
2939
- offset: "100%",
2940
- "stop-color": `${v(dt)(e.color, t.value.line.area.opacity)}`
2941
- }, null, 8, Di)
2942
- ], 8, Ei))
2943
- ]))), 128)),
2944
- (n(!0), i(b, null, _(Co.value, (e) => (n(), i("g", null, [
2945
- e.show ? (n(), i(b, { key: 0 }, [
2946
- (n(!0), i(b, null, _(e.span, (u, a) => (n(), i("g", null, [
2947
- w("rect", {
2948
- style: M({
2949
- transition: "none",
2950
- opacity: e.from + a >= p.value.start && e.from + a <= p.value.end - 1 ? 1 : 0
2951
- }),
2952
- x: c.value.left + c.value.width / P.value * (e.from + a - p.value.start),
2953
- y: c.value.top,
2954
- height: c.value.height < 0 ? 10 : c.value.height,
2955
- width: c.value.width / P.value < 0 ? 1e-5 : c.value.width / P.value,
2956
- fill: v(dt)(e.color, e.opacity)
2957
- }, null, 12, Wi)
2958
- ]))), 256)),
2959
- (n(!0), i(b, null, _(e.span, (u, a) => (n(), i("g", null, [
2960
- e.caption.text && a === 0 ? (n(), i("foreignObject", {
2961
- key: 0,
2962
- x: c.value.left + c.value.width / P.value * (e.from + a - p.value.start) - (e.caption.width === "auto" ? 0 : e.caption.width / 2 - c.value.width / P.value * e.span / 2),
2963
- y: c.value.top + e.caption.offsetY,
2964
- style: M({
2965
- overflow: "visible",
2966
- opacity: e.to >= p.value.start && e.from < p.value.end ? 1 : 0
2967
- }),
2968
- height: "1",
2969
- width: e.caption.width === "auto" ? c.value.width / P.value * e.span : e.caption.width
2970
- }, [
2971
- w("div", {
2972
- style: M(`padding:${e.caption.padding}px;text-align:${e.caption.textAlign};font-size:${e.caption.fontSize}px;color:${e.caption.color};font-weight:${e.caption.bold ? "bold" : "normal"}`)
2973
- }, ue(e.caption.text), 5)
2974
- ], 12, Xi)) : g("", !0)
2975
- ]))), 256))
2976
- ], 64)) : g("", !0)
2977
- ]))), 256)),
2978
- f.value ? (n(), i("g", Yi, [
2979
- (n(!0), i(b, null, _(P.value, (e, u) => (n(), i("g", {
2980
- key: `tooltip_trap_highlighter_${u}`
2981
- }, [
2982
- w("rect", {
2983
- x: c.value.left + c.value.width / P.value * u,
2984
- y: c.value.top,
2985
- height: c.value.height < 0 ? 10 : c.value.height,
2986
- width: c.value.width / P.value < 0 ? 1e-5 : c.value.width / P.value,
2987
- fill: [H.value, A.value, ut.value].includes(u) ? v(dt)(t.value.chart.highlighter.color, t.value.chart.highlighter.opacity) : "transparent",
2988
- style: { transition: "none !important", animation: "none !important" }
2989
- }, null, 8, Gi)
2990
- ]))), 128))
2991
- ])) : g("", !0),
2992
- At.value.length ? (n(!0), i(b, { key: 1 }, _(At.value, (e, u) => (n(), i("g", {
2993
- key: `serie_bar_${e.id}`,
2994
- class: Qe(`serie_bar_${u}`),
2995
- style: M(`opacity:${$.value ? $.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
2996
- }, [
2997
- (n(!0), i(b, null, _(e.plots, (a, r) => (n(), i("g", {
2998
- key: `bar_plot_${u}_${r}`
2999
- }, [
3000
- $e(a.value) ? (n(), i("rect", {
3001
- key: 0,
3002
- x: ea(a) + aa.value / 2,
3003
- y: k.value.useIndividualScale ? Ra(a) : Fa(a),
3004
- height: k.value.useIndividualScale ? Math.abs(Pa(a)) : Math.abs(Na(a)),
3005
- width: la.value - aa.value,
3006
- rx: t.value.bar.borderRadius,
3007
- fill: t.value.bar.useGradient ? a.value >= 0 ? `url(#rectGradient_pos_${u}_${U.value})` : `url(#rectGradient_neg_${u}_${U.value})` : e.color,
3008
- stroke: t.value.bar.border.useSerieColor ? e.color : t.value.bar.border.stroke,
3009
- "stroke-width": t.value.bar.border.strokeWidth,
3010
- style: M({
3011
- transition: v(me) || !t.value.bar.showTransition ? void 0 : `all ${t.value.bar.transitionDurationMs}ms ease-in-out`
3012
- })
3013
- }, null, 12, Ui)) : g("", !0),
3014
- $e(a.value) && l.$slots.pattern ? (n(), i("rect", {
3015
- key: 1,
3016
- x: ea(a) - aa.value / 2,
3017
- y: k.value.useIndividualScale ? Ra(a) : Fa(a),
3018
- height: k.value.useIndividualScale ? Math.abs(Pa(a)) : Math.abs(Na(a)),
3019
- width: la.value - aa.value,
3020
- rx: t.value.bar.borderRadius,
3021
- fill: `url(#pattern_${U.value}_${e.slotAbsoluteIndex})`,
3022
- stroke: t.value.bar.border.useSerieColor ? e.color : t.value.bar.border.stroke,
3023
- "stroke-width": t.value.bar.border.strokeWidth,
3024
- style: M({ transition: v(me) || !t.value.bar.showTransition ? void 0 : `all ${t.value.bar.transitionDurationMs}ms ease-in-out` })
3025
- }, null, 12, qi)) : g("", !0),
3026
- a.comment && t.value.chart.comments.show ? (n(), i("foreignObject", {
3027
- key: 2,
3028
- style: { overflow: "visible" },
3029
- height: "12",
3030
- width: la.value / 2 + t.value.chart.comments.width,
3031
- x: ea(a) - t.value.chart.comments.width / 2 + t.value.chart.comments.offsetX,
3032
- y: v(G)(a.y) + t.value.chart.comments.offsetY + 6
3033
- }, [
3034
- Q(l.$slots, "plot-comment", {
3035
- plot: { ...a, color: e.color, seriesIndex: u, datapointIndex: r }
3036
- }, void 0, !0)
3037
- ], 8, Zi)) : g("", !0)
3038
- ]))), 128)),
3039
- Object.hasOwn(e, "useProgression") && e.useProgression === !0 && !isNaN(v(ne)(e.plots).trend) ? (n(), i("g", Ki, [
3040
- w("defs", null, [
3041
- w("marker", {
3042
- id: `bar_arrow_${u}`,
3043
- markerWidth: 7,
3044
- markerHeight: 7,
3045
- refX: "0",
3046
- refY: 7 / 2,
3047
- orient: "auto"
3048
- }, [
3049
- w("polygon", {
3050
- points: `0 0, 7 ${7 / 2}, 0 7`,
3051
- fill: e.color
3052
- }, null, 8, Qi)
3053
- ], 8, Ji)
3054
- ]),
3055
- e.plots.length > 1 ? (n(), i("line", {
3056
- key: 0,
3057
- x1: v(ne)(e.plots).x1 + yl(),
3058
- x2: v(ne)(e.plots).x2 + yl(),
3059
- y1: v(J)(v(ne)(e.plots).y1),
3060
- y2: v(J)(v(ne)(e.plots).y2),
3061
- "stroke-width": 1,
3062
- stroke: e.color,
3063
- "stroke-dasharray": 2,
3064
- "marker-end": `url(#bar_arrow_${u})`
3065
- }, null, 8, ji)) : g("", !0),
3066
- e.plots.length > 1 ? (n(), i("text", {
3067
- key: 1,
3068
- "text-anchor": "middle",
3069
- x: v(ne)(e.plots).x2 + yl(),
3070
- y: v(ne)(e.plots).y2 - 6,
3071
- "font-size": L.value.plotLabels,
3072
- fill: e.color
3073
- }, ue(v(ot)({
3074
- v: v(ne)(e.plots).trend * 100,
3075
- s: "%",
3076
- r: 2
3077
- })), 9, eu)) : g("", !0)
3078
- ])) : g("", !0)
3079
- ], 6))), 128)) : g("", !0),
3080
- !k.value.useIndividualScale && t.value.chart.grid.labels.zeroLine.show ? (n(), i("line", {
3081
- key: 2,
3082
- stroke: t.value.chart.grid.stroke,
3083
- "stroke-width": "1",
3084
- x1: c.value.left + oe.value,
3085
- x2: c.value.right,
3086
- y1: v(J)(_e.value),
3087
- y2: v(J)(_e.value),
3088
- "stroke-linecap": "round",
3089
- style: { animation: "none !important" }
3090
- }, null, 8, tu)) : g("", !0),
3091
- t.value.chart.highlighter.useLine && (![null, void 0].includes(A.value) || ![null, void 0].includes(H.value)) ? (n(), i("g", lu, [
3092
- w("line", {
3093
- x1: c.value.left + c.value.width / P.value * ((A.value !== null ? A.value : 0) || (H.value !== null ? H.value : 0)) + c.value.width / P.value / 2,
3094
- x2: c.value.left + c.value.width / P.value * ((A.value !== null ? A.value : 0) || (H.value !== null ? H.value : 0)) + c.value.width / P.value / 2,
3095
- y1: v(J)(c.value.top),
3096
- y2: v(J)(c.value.bottom),
3097
- stroke: t.value.chart.highlighter.color,
3098
- "stroke-width": t.value.chart.highlighter.lineWidth,
3099
- "stroke-dasharray": t.value.chart.highlighter.lineDasharray,
3100
- "stroke-linecap": "round",
3101
- style: { transition: "none !important", animation: "none !important", "pointer-events": "none" }
3102
- }, null, 8, au)
3103
- ])) : g("", !0),
3104
- t.value.chart.grid.frame.show ? (n(), i("rect", {
3105
- key: 4,
3106
- style: { pointerEvents: "none", transition: "none", animation: "none !important" },
3107
- x: c.value.left + oe.value < 0 ? 0 : c.value.left + oe.value,
3108
- y: c.value.top,
3109
- width: c.value.width - (t.value.chart.grid.position === "middle" ? 0 : c.value.width / P.value) < 0 ? 0 : c.value.width - (t.value.chart.grid.position === "middle" ? 0 : c.value.width / P.value),
3110
- height: c.value.height < 0 ? 0 : c.value.height,
3111
- fill: "transparent",
3112
- stroke: t.value.chart.grid.frame.stroke,
3113
- "stroke-width": t.value.chart.grid.frame.strokeWidth,
3114
- "stroke-linecap": t.value.chart.grid.frame.strokeLinecap,
3115
- "stroke-linejoin": t.value.chart.grid.frame.strokeLinejoin,
3116
- "stroke-dasharray": t.value.chart.grid.frame.strokeDasharray
3117
- }, null, 8, ou)) : g("", !0),
3118
- t.value.chart.grid.labels.show ? (n(), i("g", {
3119
- key: 5,
3120
- ref_key: "scaleLabels",
3121
- ref: Cl
3122
- }, [
3123
- k.value.useIndividualScale ? (n(), i(b, { key: 0 }, [
3124
- (n(!0), i(b, null, _(El.value, (e) => (n(), i("g", null, [
3125
- w("line", {
3126
- x1: e.x + oe.value - c.value.individualOffsetX,
3127
- x2: e.x + oe.value - c.value.individualOffsetX,
3128
- y1: k.value.isStacked ? v(J)(c.value.bottom - e.yOffset - e.individualHeight) : v(J)(c.value.top),
3129
- y2: k.value.isStacked ? v(J)(c.value.bottom - e.yOffset) : v(J)(c.value.bottom),
3130
- stroke: e.color,
3131
- "stroke-width": t.value.chart.grid.stroke,
3132
- "stroke-linecap": "round",
3133
- style: M(`opacity:${$.value ? $.value === e.groupId ? 1 : 0.3 : 1};transition:opacity 0.2s ease-in-out; animation: none !important`)
3134
- }, null, 12, nu)
3135
- ]))), 256)),
3136
- (n(!0), i(b, null, _(El.value, (e) => (n(), i("g", {
3137
- style: M(`opacity:${$.value ? $.value === e.groupId ? 1 : 0.3 : 1};transition:opacity 0.2s ease-in-out`)
3138
- }, [
3139
- w("text", {
3140
- fill: e.color,
3141
- "font-size": L.value.dataLabels * 0.8,
3142
- "text-anchor": "middle",
3143
- transform: `translate(${e.x - L.value.dataLabels * 0.8 / 2 + oe.value}, ${k.value.isStacked ? c.value.bottom - e.yOffset - e.individualHeight / 2 : c.value.top + c.value.height / 2}) rotate(-90)`
3144
- }, ue(e.name) + " " + ue(e.scaleLabel && e.unique && e.scaleLabel !== e.id ? `-
3145
- ${e.scaleLabel}` : ""), 9, iu),
3146
- (n(!0), i(b, null, _(e.yLabels, (u, a) => (n(), i(b, null, [
3147
- t.value.chart.grid.labels.yAxis.showCrosshairs ? (n(), i("line", {
3148
- key: 0,
3149
- x1: e.x + 3 + oe.value - t.value.chart.grid.labels.yAxis.crosshairSize - c.value.individualOffsetX,
3150
- x2: e.x + oe.value - c.value.individualOffsetX,
3151
- y1: v(J)(u.y),
3152
- y2: v(J)(u.y),
3153
- stroke: e.color,
3154
- "stroke-width": 1,
3155
- "stroke-linecap": "round",
3156
- style: { animation: "none !important" }
3157
- }, null, 8, uu)) : g("", !0)
3158
- ], 64))), 256)),
3159
- (n(!0), i(b, null, _(e.yLabels, (u, a) => (n(), i("text", {
3160
- x: e.x - 5 + oe.value - c.value.individualOffsetX,
3161
- y: v(J)(u.y) + L.value.dataLabels / 3,
3162
- "font-size": L.value.dataLabels,
3163
- "text-anchor": "end",
3164
- fill: e.color
3165
- }, ue(v(Te)(
3166
- t.value.chart.grid.labels.yAxis.formatter,
3167
- u.value,
3168
- v(ot)({
3169
- p: u.prefix,
3170
- v: u.value,
3171
- s: u.suffix,
3172
- r: t.value.chart.grid.labels.yAxis.rounding
3173
- }),
3174
- { datapoint: u.datapoint, seriesIndex: a }
3175
- )), 9, su))), 256))
3176
- ], 4))), 256))
3177
- ], 64)) : (n(!0), i(b, { key: 1 }, _(Da.value, (e, u) => (n(), i("g", {
3178
- key: `yLabel_${u}`
3179
- }, [
3180
- $e(e) && e.value >= Ee.value.min && e.value <= Ee.value.max && t.value.chart.grid.labels.yAxis.showCrosshairs ? (n(), i("line", {
3181
- key: 0,
3182
- x1: c.value.left + oe.value,
3183
- x2: c.value.left + oe.value - t.value.chart.grid.labels.yAxis.crosshairSize,
3184
- y1: v(J)(e.y),
3185
- y2: v(J)(e.y),
3186
- stroke: t.value.chart.grid.stroke,
3187
- "stroke-width": "1",
3188
- "stroke-linecap": "round",
3189
- style: { animation: "none !important" }
3190
- }, null, 8, ru)) : g("", !0),
3191
- e.value >= Ee.value.min && e.value <= Ee.value.max ? (n(), i("text", {
3192
- key: 1,
3193
- x: c.value.scaleLabelX - t.value.chart.grid.labels.yAxis.crosshairSize,
3194
- y: v(G)(e.y + L.value.dataLabels / 3),
3195
- "font-size": L.value.dataLabels,
3196
- "text-anchor": "end",
3197
- fill: t.value.chart.grid.labels.color
3198
- }, ue($e(e.value) ? v(Te)(
3199
- t.value.chart.grid.labels.yAxis.formatter,
3200
- e.value,
3201
- v(ot)({
3202
- p: e.prefix,
3203
- v: e.value,
3204
- s: e.suffix,
3205
- r: t.value.chart.grid.labels.yAxis.rounding
3206
- })
3207
- ) : ""), 9, cu)) : g("", !0)
3208
- ]))), 128))
3209
- ], 512)) : g("", !0),
3210
- (n(!0), i(b, null, _(vt.value, (e, u) => (n(), i("g", {
3211
- key: `serie_plot_${e.id}`,
3212
- class: Qe(`serie_plot_${u}`),
3213
- style: M(`opacity:${$.value ? $.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3214
- }, [
3215
- (n(!0), i(b, null, _(e.plots, (a, r) => (n(), i("g", {
3216
- key: `circle_plot_${u}_${r}`
3217
- }, [
3218
- a && $e(a.value) ? (n(), at(ra, {
3219
- key: 0,
3220
- shape: ["triangle", "square", "diamond", "pentagon", "hexagon", "star"].includes(e.shape) ? e.shape : "circle",
3221
- color: t.value.plot.useGradient ? `url(#plotGradient_${u}_${U.value})` : t.value.plot.dot.useSerieColor ? e.color : t.value.plot.dot.fill,
3222
- plot: { x: v(G)(a.x), y: v(G)(a.y) },
3223
- radius: A.value !== null && A.value === r || H.value !== null && H.value === r ? (Ne.value.plot || 6) * 1.5 : Ne.value.plot || 6,
3224
- stroke: t.value.plot.dot.useSerieColor ? t.value.chart.backgroundColor : e.color,
3225
- strokeWidth: t.value.plot.dot.strokeWidth,
3226
- transition: v(me) || !t.value.plot.showTransition || A.value !== null && A.value === r || H.value !== null && H.value === r ? void 0 : `all ${t.value.plot.transitionDurationMs}ms ease-in-out`
3227
- }, null, 8, ["shape", "color", "plot", "radius", "stroke", "strokeWidth", "transition"])) : g("", !0),
3228
- a.comment && t.value.chart.comments.show ? (n(), i("foreignObject", {
3229
- key: 1,
3230
- style: { overflow: "visible" },
3231
- height: "12",
3232
- width: t.value.chart.comments.width,
3233
- x: a.x - t.value.chart.comments.width / 2 + t.value.chart.comments.offsetX,
3234
- y: a.y + t.value.chart.comments.offsetY + 6
3235
- }, [
3236
- w("div", du, [
3237
- Q(l.$slots, "plot-comment", {
3238
- plot: { ...a, color: e.color, seriesIndex: u, datapointIndex: r }
3239
- }, void 0, !0)
3240
- ])
3241
- ], 8, vu)) : g("", !0)
3242
- ]))), 128)),
3243
- Object.hasOwn(e, "useProgression") && e.useProgression === !0 && !isNaN(v(ne)(e.plots).trend) ? (n(), i("g", hu, [
3244
- w("defs", null, [
3245
- w("marker", {
3246
- id: `plot_arrow_${u}`,
3247
- markerWidth: 7,
3248
- markerHeight: 7,
3249
- refX: "0",
3250
- refY: 7 / 2,
3251
- orient: "auto"
3252
- }, [
3253
- w("polygon", {
3254
- points: `0 0, 7 ${7 / 2}, 0 7`,
3255
- fill: e.color
3256
- }, null, 8, fu)
3257
- ], 8, mu)
3258
- ]),
3259
- e.plots.length > 1 ? (n(), i("line", {
3260
- key: 0,
3261
- x1: v(ne)(e.plots).x1,
3262
- x2: v(ne)(e.plots).x2,
3263
- y1: v(J)(v(ne)(e.plots).y1),
3264
- y2: v(J)(v(ne)(e.plots).y2),
3265
- "stroke-width": 1,
3266
- stroke: e.color,
3267
- "stroke-dasharray": 2,
3268
- "marker-end": `url(#plot_arrow_${u})`
3269
- }, null, 8, gu)) : g("", !0),
3270
- e.plots.length > 1 ? (n(), i("text", {
3271
- key: 1,
3272
- "text-anchor": "middle",
3273
- x: v(ne)(e.plots).x2,
3274
- y: v(ne)(e.plots).y2 - 6,
3275
- "font-size": L.value.plotLabels,
3276
- fill: e.color
3277
- }, ue(v(ot)({
3278
- v: v(ne)(e.plots).trend * 100,
3279
- s: "%",
3280
- r: 2
3281
- })), 9, xu)) : g("", !0)
3282
- ])) : g("", !0)
3283
- ], 6))), 128)),
3284
- (n(!0), i(b, null, _(De.value, (e, u) => (n(), i("g", {
3285
- key: `serie_line_${e.id}`,
3286
- class: Qe(`serie_line_${u}`),
3287
- style: M(`opacity:${$.value ? $.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3288
- }, [
3289
- e.smooth && e.plots.length > 1 && e.curve ? (n(), i("path", {
3290
- key: 0,
3291
- d: `M${e.curve}`,
3292
- stroke: t.value.chart.backgroundColor,
3293
- "stroke-width": t.value.line.strokeWidth + 1,
3294
- "stroke-dasharray": e.dashed ? t.value.line.strokeWidth * 2 : 0,
3295
- fill: "none",
3296
- style: M({ transition: v(me) || !t.value.line.showTransition ? void 0 : `all ${t.value.line.transitionDurationMs}ms ease-in-out` })
3297
- }, null, 12, bu)) : e.plots.length > 1 && e.straight ? (n(), i("path", {
3298
- key: 1,
3299
- d: `M${e.straight}`,
3300
- stroke: t.value.chart.backgroundColor,
3301
- "stroke-width": t.value.line.strokeWidth + 1,
3302
- "stroke-dasharray": e.dashed ? t.value.line.strokeWidth * 2 : 0,
3303
- fill: "none",
3304
- "stroke-linecap": "round",
3305
- "stroke-linejoin": "round",
3306
- style: M({ transition: v(me) || !t.value.line.showTransition ? void 0 : `all ${t.value.line.transitionDurationMs}ms ease-in-out` })
3307
- }, null, 12, yu)) : g("", !0)
3308
- ], 6))), 128)),
3309
- l.$slots.pattern ? (n(), i("defs", pu, [
3310
- (n(!0), i(b, null, _(Pe.value, (e, u) => Q(l.$slots, "pattern", Ht({
3311
- key: `serie_pattern_slot_${e.id}`
3312
- }, { ref_for: !0 }, { ...e, seriesIndex: e.slotAbsoluteIndex, patternId: `pattern_${U.value}_${u}` }), void 0, !0)), 128))
3313
- ])) : g("", !0),
3314
- Ya.value.length && !k.value.isStacked ? (n(), i("g", ku, [
3315
- (n(!0), i(b, null, _(Ya.value, (e) => (n(), i("path", {
3316
- key: e.key,
3317
- d: e.d,
3318
- fill: e.color,
3319
- "fill-opacity": t.value.line.interLine.fillOpacity,
3320
- stroke: "none",
3321
- "pointer-events": "none",
3322
- style: M({ transition: v(me) || !t.value.line.showTransition ? void 0 : `all ${t.value.line.transitionDurationMs}ms ease-in-out` })
3323
- }, null, 12, wu))), 128))
3324
- ])) : g("", !0),
3325
- (n(!0), i(b, null, _(De.value, (e, u) => (n(), i("g", {
3326
- key: `serie_line_above_${e.id}`,
3327
- class: Qe(`serie_line_${u}`),
3328
- style: M(`opacity:${$.value ? $.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3329
- }, [
3330
- e.useArea && e.plots.length > 1 ? (n(), i("g", Su, [
3331
- e.smooth ? (n(!0), i(b, { key: 0 }, _(e.curveAreas, (a, r) => (n(), i(b, { key: r }, [
3332
- a ? (n(), i("path", {
3333
- key: 0,
3334
- d: a,
3335
- fill: t.value.line.area.useGradient ? `url(#areaGradient_${u}_${U.value})` : v(dt)(e.color, t.value.line.area.opacity),
3336
- style: M({ transition: v(me) || !t.value.line.showTransition ? void 0 : `all ${t.value.line.transitionDurationMs}ms ease-in-out` })
3337
- }, null, 12, $u)) : g("", !0),
3338
- l.$slots.pattern && a ? (n(), i("path", {
3339
- key: 1,
3340
- d: a,
3341
- fill: `url(#pattern_${U.value}_${e.slotAbsoluteIndex})`,
3342
- style: M({ transition: v(me) || !t.value.line.showTransition ? void 0 : `all ${t.value.line.transitionDurationMs}ms ease-in-out` })
3343
- }, null, 12, _u)) : g("", !0)
3344
- ], 64))), 128)) : (n(!0), i(b, { key: 1 }, _(e.area.split(";"), (a, r) => (n(), i(b, { key: r }, [
3345
- a ? (n(), i("path", {
3346
- key: 0,
3347
- d: `M${a}Z`,
3348
- fill: t.value.line.area.useGradient ? `url(#areaGradient_${u}_${U.value})` : v(dt)(e.color, t.value.line.area.opacity),
3349
- style: M({ transition: v(me) || !t.value.line.showTransition ? void 0 : `all ${t.value.line.transitionDurationMs}ms ease-in-out` })
3350
- }, null, 12, Mu)) : g("", !0),
3351
- l.$slots.pattern && a ? (n(), i("path", {
3352
- key: 1,
3353
- d: `M${a}Z`,
3354
- fill: `url(#pattern_${U.value}_${e.slotAbsoluteIndex})`,
3355
- style: M({ transition: v(me) || !t.value.line.showTransition ? void 0 : `all ${t.value.line.transitionDurationMs}ms ease-in-out` })
3356
- }, null, 12, Lu)) : g("", !0)
3357
- ], 64))), 128))
3358
- ])) : g("", !0),
3359
- e.smooth && e.plots.length > 1 && e.curve ? (n(), i("path", {
3360
- key: 1,
3361
- d: `M${e.curve}`,
3362
- stroke: e.color,
3363
- "stroke-width": t.value.line.strokeWidth,
3364
- "stroke-dasharray": e.dashed ? t.value.line.strokeWidth * 2 : 0,
3365
- fill: "none",
3366
- "stroke-linecap": "round",
3367
- style: M({ transition: v(me) || !t.value.line.showTransition ? void 0 : `all ${t.value.line.transitionDurationMs}ms ease-in-out` })
3368
- }, null, 12, Cu)) : e.plots.length > 1 && e.straight ? (n(), i("path", {
3369
- key: 2,
3370
- d: `M${e.straight}`,
3371
- stroke: e.color,
3372
- "stroke-width": t.value.line.strokeWidth,
3373
- "stroke-dasharray": e.dashed ? t.value.line.strokeWidth * 2 : 0,
3374
- fill: "none",
3375
- "stroke-linecap": "round",
3376
- "stroke-linejoin": "round",
3377
- style: M({ transition: v(me) || !t.value.line.showTransition ? void 0 : `all ${t.value.line.transitionDurationMs}ms ease-in-out` })
3378
- }, null, 12, Au)) : g("", !0),
3379
- (n(!0), i(b, null, _(e.plots, (a, r) => (n(), i(b, {
3380
- key: `circle_line_${u}_${r}`
3381
- }, [
3382
- !Oa.value.linePlot && a && $e(a.value) || Oa.value.linePlot && a && $e(a.value) && (A.value !== null && A.value === r || H.value !== null && H.value === r) || Xa(e.plots, r) ? (n(), at(ra, {
3383
- key: 0,
3384
- shape: ["triangle", "square", "diamond", "pentagon", "hexagon", "star"].includes(e.shape) ? e.shape : "circle",
3385
- color: t.value.line.useGradient ? `url(#lineGradient_${u}_${U.value})` : t.value.line.dot.useSerieColor ? e.color : t.value.line.dot.fill,
3386
- plot: { x: v(G)(a.x), y: v(G)(a.y) },
3387
- radius: A.value !== null && A.value === r || H.value !== null && H.value === r ? (Ne.value.line || 6) * 1.5 : (Xa(e.plots, r), Ne.value.line || 6),
3388
- stroke: t.value.line.dot.useSerieColor ? t.value.chart.backgroundColor : e.color,
3389
- strokeWidth: t.value.line.dot.strokeWidth,
3390
- transition: v(me) || !t.value.line.showTransition || A.value !== null && A.value === r || H.value !== null && H.value === r ? void 0 : `all ${t.value.line.transitionDurationMs}ms ease-in-out`
3391
- }, null, 8, ["shape", "color", "plot", "radius", "stroke", "strokeWidth", "transition"])) : g("", !0),
3392
- a.comment && t.value.chart.comments.show ? (n(), i("foreignObject", {
3393
- key: 1,
3394
- style: { overflow: "visible" },
3395
- height: "12",
3396
- width: t.value.chart.comments.width,
3397
- x: a.x - t.value.chart.comments.width / 2 + t.value.chart.comments.offsetX,
3398
- y: a.y + t.value.chart.comments.offsetY + 6
3399
- }, [
3400
- w("div", Tu, [
3401
- Q(l.$slots, "plot-comment", {
3402
- plot: { ...a, color: e.color, seriesIndex: u, datapointIndex: r }
3403
- }, void 0, !0)
3404
- ])
3405
- ], 8, zu)) : g("", !0)
3406
- ], 64))), 128)),
3407
- Object.hasOwn(e, "useProgression") && e.useProgression === !0 && !isNaN(v(ne)(e.plots).trend) ? (n(), i("g", Iu, [
3408
- w("defs", null, [
3409
- w("marker", {
3410
- id: `line_arrow_${u}`,
3411
- markerWidth: 7,
3412
- markerHeight: 7,
3413
- refX: "0",
3414
- refY: 7 / 2,
3415
- orient: "auto"
3416
- }, [
3417
- w("polygon", {
3418
- points: `0 0, 7 ${7 / 2}, 0 7`,
3419
- fill: e.color
3420
- }, null, 8, Pu)
3421
- ], 8, Nu)
3422
- ]),
3423
- e.plots.length > 1 ? (n(), i("line", {
3424
- key: 0,
3425
- x1: v(ne)(e.plots).x1,
3426
- x2: v(ne)(e.plots).x2,
3427
- y1: v(J)(v(ne)(e.plots).y1),
3428
- y2: v(J)(v(ne)(e.plots).y2),
3429
- "stroke-width": 1,
3430
- stroke: e.color,
3431
- "stroke-dasharray": 2,
3432
- "marker-end": `url(#line_arrow_${u})`
3433
- }, null, 8, Fu)) : g("", !0),
3434
- e.plots.length > 1 ? (n(), i("text", {
3435
- key: 1,
3436
- "text-anchor": "middle",
3437
- x: v(ne)(e.plots).x2,
3438
- y: v(ne)(e.plots).y2 - 6,
3439
- "font-size": L.value.plotLabels,
3440
- fill: e.color
3441
- }, ue(v(ot)({
3442
- v: v(ne)(e.plots).trend * 100,
3443
- s: "%",
3444
- r: 2
3445
- })), 9, Ru)) : g("", !0)
3446
- ])) : g("", !0)
3447
- ], 6))), 128)),
3448
- (t.value.bar.labels.show || t.value.bar.serieName.show) && k.value.dataLabels.show ? (n(), i("g", Vu, [
3449
- (n(!0), i(b, null, _(At.value, (e, u) => (n(), i(b, {
3450
- key: `xLabel_bar_${e.id}`
3451
- }, [
3452
- (n(!0), i(b, null, _(e.plots, (a, r) => (n(), i(b, {
3453
- key: `xLabel_bar_${u}_${r}`
3454
- }, [
3455
- a && (!Object.hasOwn(e, "dataLabels") || e.dataLabels === !0 || A.value !== null && A.value === r || H.value !== null && H.value === r) && t.value.bar.labels.show ? (n(), i("text", {
3456
- key: 0,
3457
- x: k.value.useIndividualScale && k.value.isStacked ? a.x + ve.value.line / 2 : ea(a) + yl() / 2 - ta.value / 2,
3458
- y: v(G)(a.y) + (a.value >= 0 ? t.value.bar.labels.offsetY : -t.value.bar.labels.offsetY * 3),
3459
- "text-anchor": "middle",
3460
- "font-size": L.value.plotLabels,
3461
- fill: t.value.bar.labels.color,
3462
- style: M(`opacity:${$.value ? $.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3463
- }, ue($e(a.value) ? v(Te)(
3464
- t.value.bar.labels.formatter,
3465
- a.value,
3466
- v(ot)({
3467
- p: e.prefix || t.value.chart.labels.prefix,
3468
- v: a.value,
3469
- s: e.suffix || t.value.chart.labels.suffix,
3470
- r: t.value.bar.labels.rounding
3471
- }),
3472
- {
3473
- datapoint: a,
3474
- serie: e
3475
- }
3476
- ) : ""), 13, Ou)) : g("", !0),
3477
- a && t.value.bar.serieName.show ? (n(), i("text", {
3478
- key: 1,
3479
- x: k.value.useIndividualScale && k.value.isStacked ? a.x + ve.value.line / 2 : a.x + yl() * 1.1,
3480
- y: a.y + (a.value > 0 ? t.value.bar.serieName.offsetY : -t.value.bar.serieName.offsetY * 3),
3481
- "text-anchor": "middle",
3482
- "font-size": L.value.plotLabels,
3483
- fill: t.value.bar.serieName.useSerieColor ? e.color : t.value.bar.serieName.color,
3484
- "font-weight": t.value.bar.serieName.bold ? "bold" : "normal",
3485
- style: M(`opacity:${$.value ? $.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3486
- }, ue(t.value.bar.serieName.useAbbreviation ? v(en)({
3487
- source: e.name,
3488
- length: t.value.bar.serieName.abbreviationSize
3489
- }) : e.name), 13, Bu)) : g("", !0)
3490
- ], 64))), 128))
3491
- ], 64))), 128))
3492
- ])) : g("", !0),
3493
- t.value.plot.labels.show && k.value.dataLabels.show ? (n(), i("g", Eu, [
3494
- (n(!0), i(b, null, _(vt.value, (e, u) => (n(), i(b, {
3495
- key: `xLabel_plot_${e.id}`
3496
- }, [
3497
- (n(!0), i(b, null, _(e.plots, (a, r) => (n(), i(b, {
3498
- key: `xLabel_plot_${u}_${r}`
3499
- }, [
3500
- a && !Object.hasOwn(e, "dataLabels") || e.dataLabels === !0 || A.value !== null && A.value === r || H.value !== null && H.value === r ? (n(), i("text", {
3501
- key: 0,
3502
- x: a.x,
3503
- y: a.y + t.value.plot.labels.offsetY,
3504
- "text-anchor": "middle",
3505
- "font-size": L.value.plotLabels,
3506
- fill: t.value.plot.labels.color,
3507
- style: M(`opacity:${$.value ? $.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3508
- }, ue($e(a.value) ? v(Te)(
3509
- t.value.plot.labels.formatter,
3510
- a.value,
3511
- v(ot)({
3512
- p: e.prefix || t.value.chart.labels.prefix,
3513
- v: a.value,
3514
- s: e.suffix || t.value.chart.labels.suffix,
3515
- r: t.value.plot.labels.rounding
3516
- }),
3517
- {
3518
- datapoint: a,
3519
- serie: e
3520
- }
3521
- ) : ""), 13, Hu)) : g("", !0)
3522
- ], 64))), 128))
3523
- ], 64))), 128))
3524
- ])) : (n(), i("g", Du, [
3525
- (n(!0), i(b, null, _(vt.value, (e, u) => (n(), i(b, {
3526
- key: `xLabel_plot_${e.id}`
3527
- }, [
3528
- (n(!0), i(b, null, _(e.plots, (a, r) => (n(), i(b, {
3529
- key: `xLabel_plot_${u}_${r}`
3530
- }, [
3531
- t.value.plot.tag.followValue ? (n(), i(b, { key: 1 }, [
3532
- [H.value, A.value, ut.value].includes(r) && e.useTag ? (n(), i("line", {
3533
- key: 0,
3534
- class: "vue-ui-xy-tag-plot",
3535
- x1: c.value.left,
3536
- x2: c.value.right,
3537
- y1: a.y,
3538
- y2: a.y,
3539
- "stroke-width": 1,
3540
- "stroke-linecap": "round",
3541
- "stroke-dasharray": "2",
3542
- stroke: e.color
3543
- }, null, 8, Uu)) : g("", !0)
3544
- ], 64)) : (n(), i(b, { key: 0 }, [
3545
- a && r === 0 && e.useTag && e.useTag === "start" ? (n(), i("foreignObject", {
3546
- key: 0,
3547
- x: a.x,
3548
- y: a.y - 20,
3549
- height: 24,
3550
- width: "150",
3551
- style: M(`overflow: visible; opacity:${$.value ? $.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3552
- }, [
3553
- w("div", {
3554
- style: M(`padding: 3px; background:${v(dt)(e.color, 80)};color:${v(ht)(e.color)};width:fit-content;font-size:${L.value.plotLabels}px;border-radius: 2px;`),
3555
- innerHTML: v(Te)(
3556
- t.value.plot.tag.formatter,
3557
- a.value,
3558
- e.name,
3559
- {
3560
- datapoint: a,
3561
- seriesIndex: r,
3562
- serieName: e.name
3563
- }
3564
- )
3565
- }, null, 12, Xu)
3566
- ], 12, Wu)) : g("", !0),
3567
- a && r === e.plots.length - 1 && e.useTag && e.useTag === "end" ? (n(), i("foreignObject", {
3568
- key: 1,
3569
- x: a.x - e.name.length * (L.value.plotLabels / 2),
3570
- y: a.y - 20,
3571
- height: 24,
3572
- width: "150",
3573
- style: M(`overflow: visible; opacity:${$.value ? $.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3574
- }, [
3575
- w("div", {
3576
- style: M(`padding: 3px; background:${v(dt)(e.color, 80)};color:${v(ht)(e.color)};width:fit-content;font-size:${L.value.plotLabels}px;border-radius: 2px;`),
3577
- innerHTML: v(Te)(
3578
- t.value.plot.tag.formatter,
3579
- a.value,
3580
- e.name,
3581
- {
3582
- datapoint: a,
3583
- seriesIndex: r,
3584
- serieName: e.name
3585
- }
3586
- )
3587
- }, null, 12, Gu)
3588
- ], 12, Yu)) : g("", !0)
3589
- ], 64))
3590
- ], 64))), 128))
3591
- ], 64))), 128))
3592
- ])),
3593
- t.value.line.labels.show && k.value.dataLabels.show ? (n(), i("g", qu, [
3594
- (n(!0), i(b, null, _(De.value, (e, u) => (n(), i(b, {
3595
- key: `xLabel_line_${e.id}`
3596
- }, [
3597
- (n(!0), i(b, null, _(e.plots, (a, r) => (n(), i(b, {
3598
- key: `xLabel_line_${u}_${r}`
3599
- }, [
3600
- a && !Object.hasOwn(e, "dataLabels") || e.dataLabels === !0 || A.value !== null && A.value === r || H.value !== null && H.value === r ? (n(), i("text", {
3601
- key: 0,
3602
- x: a.x,
3603
- y: a.y + (a.value >= 0 ? t.value.line.labels.offsetY : -t.value.line.labels.offsetY * 3),
3604
- "text-anchor": "middle",
3605
- "font-size": L.value.plotLabels,
3606
- fill: t.value.line.labels.color,
3607
- style: M(`opacity:${$.value ? $.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3608
- }, ue($e(a.value) ? v(Te)(
3609
- t.value.line.labels.formatter,
3610
- a.value,
3611
- v(ot)({
3612
- p: e.prefix || t.value.chart.labels.prefix,
3613
- v: a.value,
3614
- s: e.suffix || t.value.chart.labels.suffix,
3615
- r: t.value.line.labels.rounding
3616
- }),
3617
- {
3618
- datapoint: a,
3619
- serie: e
3620
- }
3621
- ) : ""), 13, Zu)) : g("", !0)
3622
- ], 64))), 128))
3623
- ], 64))), 128))
3624
- ])) : (n(), i("g", Ku, [
3625
- (n(!0), i(b, null, _(De.value, (e, u) => (n(), i(b, {
3626
- key: `xLabel_line_${e.id}`
3627
- }, [
3628
- (n(!0), i(b, null, _(e.plots, (a, r) => (n(), i(b, {
3629
- key: `xLabel_line_${u}_${r}`
3630
- }, [
3631
- t.value.line.tag.followValue ? (n(), i(b, { key: 1 }, [
3632
- [H.value, A.value, ut.value].includes(r) && e.useTag ? (n(), i("line", {
3633
- key: 0,
3634
- class: "vue-ui-xy-tag-line",
3635
- x1: c.value.left,
3636
- x2: c.value.right,
3637
- y1: a.y,
3638
- y2: a.y,
3639
- "stroke-width": 1,
3640
- "stroke-linecap": "round",
3641
- "stroke-dasharray": "2",
3642
- stroke: e.color
3643
- }, null, 8, ts)) : g("", !0)
3644
- ], 64)) : (n(), i(b, { key: 0 }, [
3645
- a && r === 0 && e.useTag && e.useTag === "start" ? (n(), i("foreignObject", {
3646
- key: 0,
3647
- x: a.x,
3648
- y: a.y - 20,
3649
- height: 24,
3650
- width: "150",
3651
- style: M(`overflow: visible; opacity:${$.value ? $.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3652
- }, [
3653
- w("div", {
3654
- style: M(`padding: 3px; background:${v(dt)(e.color, 80)};color:${v(ht)(e.color)};width:fit-content;font-size:${L.value.plotLabels}px;border-radius: 2px;`),
3655
- innerHTML: v(Te)(
3656
- t.value.line.tag.formatter,
3657
- a.value,
3658
- e.name,
3659
- {
3660
- datapoint: a,
3661
- seriesIndex: r,
3662
- serieName: e.name
3663
- }
3664
- )
3665
- }, null, 12, Qu)
3666
- ], 12, Ju)) : g("", !0),
3667
- a && r === e.plots.length - 1 && e.useTag && e.useTag === "end" ? (n(), i("foreignObject", {
3668
- key: 1,
3669
- x: a.x,
3670
- y: a.y - 20,
3671
- height: 24,
3672
- width: "150",
3673
- style: M(`overflow: visible; opacity:${$.value ? $.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3674
- }, [
3675
- w("div", {
3676
- style: M(`padding: 3px; background:${v(dt)(e.color, 80)};color:${v(ht)(e.color)};width:fit-content;font-size:${L.value.plotLabels}px;border-radius: 2px;`),
3677
- innerHTML: v(Te)(
3678
- t.value.line.tag.formatter,
3679
- a.value,
3680
- e.name,
3681
- {
3682
- datapoint: a,
3683
- seriesIndex: r,
3684
- serieName: e.name
3685
- }
3686
- )
3687
- }, null, 12, es)
3688
- ], 12, ju)) : g("", !0)
3689
- ], 64))
3690
- ], 64))), 128))
3691
- ], 64))), 128))
3692
- ])),
3693
- (n(!0), i(b, null, _(De.value, (e, u) => (n(), i(b, {
3694
- key: `xLabel_line_${e.id}`
3695
- }, [
3696
- (n(!0), i(b, null, _(e.plots, (a, r) => (n(), i(b, {
3697
- key: `xLabel_line_${u}_${r}`
3698
- }, [
3699
- a && r === 0 && e.showSerieName && e.showSerieName === "start" ? (n(), i("text", {
3700
- key: 0,
3701
- x: a.x - L.value.plotLabels,
3702
- y: a.y,
3703
- "font-size": L.value.plotLabels,
3704
- "text-anchor": "end",
3705
- fill: e.color,
3706
- innerHTML: v(sa)({
3707
- content: e.name,
3708
- fontSize: L.value.plotLabels,
3709
- fill: e.color,
3710
- x: a.x - L.value.plotLabels,
3711
- y: a.y,
3712
- maxWords: 2
3713
- }),
3714
- style: M(`opacity:${$.value ? $.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3715
- }, null, 12, ls)) : g("", !0),
3716
- a && r === e.plots.length - 1 && e.showSerieName && e.showSerieName === "end" ? (n(), i("text", {
3717
- key: 1,
3718
- x: a.x + L.value.plotLabels,
3719
- y: a.y,
3720
- "font-size": L.value.plotLabels,
3721
- "text-anchor": "start",
3722
- fill: e.color,
3723
- innerHTML: v(sa)({
3724
- content: e.name,
3725
- fontSize: L.value.plotLabels,
3726
- fill: e.color,
3727
- x: a.x + L.value.plotLabels,
3728
- y: a.y,
3729
- maxWords: 2
3730
- }),
3731
- style: M(`opacity:${$.value ? $.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3732
- }, null, 12, as)) : g("", !0)
3733
- ], 64))), 128))
3734
- ], 64))), 128)),
3735
- (n(!0), i(b, null, _(vt.value, (e, u) => (n(), i(b, {
3736
- key: `xLabel_plot_${e.id}`
3737
- }, [
3738
- (n(!0), i(b, null, _(e.plots, (a, r) => (n(), i(b, {
3739
- key: `xLabel_plot_${u}_${r}`
3740
- }, [
3741
- a && r === 0 && e.showSerieName && e.showSerieName === "start" ? (n(), i("text", {
3742
- key: 0,
3743
- x: a.x - L.value.plotLabels,
3744
- y: a.y,
3745
- "font-size": L.value.plotLabels,
3746
- "text-anchor": "end",
3747
- fill: e.color,
3748
- innerHTML: v(sa)({
3749
- content: e.name,
3750
- fontSize: L.value.plotLabels,
3751
- fill: e.color,
3752
- x: a.x - L.value.plotLabels,
3753
- y: a.y,
3754
- maxWords: 2
3755
- }),
3756
- style: M(`opacity:${$.value ? $.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3757
- }, null, 12, os)) : g("", !0),
3758
- a && r === e.plots.length - 1 && e.showSerieName && e.showSerieName === "end" ? (n(), i("text", {
3759
- key: 1,
3760
- x: a.x + L.value.plotLabels,
3761
- y: a.y,
3762
- "font-size": L.value.plotLabels,
3763
- "text-anchor": "start",
3764
- fill: e.color,
3765
- innerHTML: v(sa)({
3766
- content: e.name,
3767
- fontSize: L.value.plotLabels,
3768
- fill: e.color,
3769
- x: a.x + L.value.plotLabels,
3770
- y: a.y,
3771
- maxWords: 2
3772
- }),
3773
- style: M(`opacity:${$.value ? $.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3774
- }, null, 12, ns)) : g("", !0)
3775
- ], 64))), 128))
3776
- ], 64))), 128)),
3777
- k.value.useIndividualScale && !k.value.isStacked ? (n(), i(b, { key: 13 }, [
3778
- w("defs", null, [
3779
- (n(!0), i(b, null, _(El.value, (e, u) => (n(), i("linearGradient", {
3780
- id: `individual_scale_gradient_${U.value}_${u}`,
3781
- x1: "0%",
3782
- x2: "100%",
3783
- y1: "0%",
3784
- y2: "0%"
3785
- }, [
3786
- w("stop", {
3787
- offset: "0%",
3788
- "stop-color": t.value.chart.backgroundColor,
3789
- "stop-opacity": "0"
3790
- }, null, 8, us),
3791
- w("stop", {
3792
- offset: "100%",
3793
- "stop-color": e.color,
3794
- "stop-opacity": "0.2"
3795
- }, null, 8, ss)
3796
- ], 8, is))), 256))
3797
- ]),
3798
- (n(!0), i(b, null, _(El.value, (e, u) => (n(), i("rect", {
3799
- x: e.x - t.value.chart.grid.labels.yAxis.labelWidth + oe.value - c.value.individualOffsetX,
3800
- y: c.value.top,
3801
- width: t.value.chart.grid.labels.yAxis.labelWidth + c.value.individualOffsetX,
3802
- height: c.value.height < 0 ? 10 : c.value.height,
3803
- fill: $.value === e.groupId ? `url(#individual_scale_gradient_${U.value}_${u})` : "transparent",
3804
- onMouseenter: (a) => $.value = e.groupId,
3805
- onMouseleave: s[0] || (s[0] = (a) => $.value = null)
3806
- }, null, 40, rs))), 256))
3807
- ], 64)) : g("", !0),
3808
- w("g", null, [
3809
- t.value.chart.grid.labels.axis.yLabel && !k.value.useIndividualScale ? (n(), i("text", {
3810
- key: 0,
3811
- ref_key: "yAxisLabel",
3812
- ref: Ll,
3813
- "font-size": L.value.yAxis,
3814
- fill: t.value.chart.grid.labels.color,
3815
- transform: `translate(${t.value.chart.grid.labels.axis.fontSize}, ${c.value.top + c.value.height / 2}) rotate(-90)`,
3816
- "text-anchor": "middle",
3817
- style: { transition: "none" }
3818
- }, ue(t.value.chart.grid.labels.axis.yLabel), 9, cs)) : g("", !0),
3819
- t.value.chart.grid.labels.axis.xLabel ? (n(), i("text", {
3820
- key: 1,
3821
- ref_key: "xAxisLabel",
3822
- ref: Ve,
3823
- "text-anchor": "middle",
3824
- x: re.value / 2,
3825
- y: se.value - 3,
3826
- "font-size": L.value.yAxis,
3827
- fill: t.value.chart.grid.labels.color
3828
- }, ue(t.value.chart.grid.labels.axis.xLabel), 9, vs)) : g("", !0)
3829
- ]),
3830
- t.value.chart.grid.labels.xAxisLabels.show ? (n(), i("g", {
3831
- key: 14,
3832
- ref_key: "timeLabelsEls",
3833
- ref: Nt
3834
- }, [
3835
- l.$slots["time-label"] ? (n(!0), i(b, { key: 0 }, _(jt.value, (e, u) => Q(l.$slots, "time-label", Ht({
3836
- key: `time_label_${e.id}`,
3837
- ref_for: !0
3838
- }, {
3839
- x: c.value.left + c.value.width / P.value * u + c.value.width / P.value / 2,
3840
- y: c.value.bottom,
3841
- fontSize: L.value.xAxis,
3842
- fill: t.value.chart.grid.labels.xAxisLabels.color,
3843
- transform: `translate(${c.value.left + c.value.width / P.value * u + c.value.width / P.value / 2}, ${c.value.bottom + L.value.xAxis * 1.3 + t.value.chart.grid.labels.xAxisLabels.yOffset}), rotate(${t.value.chart.grid.labels.xAxisLabels.rotation})`,
3844
- absoluteIndex: e.absoluteIndex,
3845
- content: e.text,
3846
- textAnchor: t.value.chart.grid.labels.xAxisLabels.rotation > 0 ? "start" : t.value.chart.grid.labels.xAxisLabels.rotation < 0 ? "end" : "middle",
3847
- show: e && e.text
3848
- }), void 0, !0)), 128)) : (n(!0), i(b, { key: 1 }, _(jt.value, (e, u) => (n(), i("g", {
3849
- key: `time_label_${u}`
3850
- }, [
3851
- e && e.text ? (n(), i(b, { key: 0 }, [
3852
- String(e.text).includes(`
3853
- `) ? (n(), i("text", {
3854
- key: 1,
3855
- class: "vue-data-ui-time-label",
3856
- "text-anchor": t.value.chart.grid.labels.xAxisLabels.rotation > 0 ? "start" : t.value.chart.grid.labels.xAxisLabels.rotation < 0 ? "end" : "middle",
3857
- "font-size": L.value.xAxis,
3858
- fill: t.value.chart.grid.labels.xAxisLabels.color,
3859
- transform: `translate(${c.value.left + c.value.width / P.value * u + c.value.width / P.value / 2}, ${c.value.bottom + L.value.xAxis * 1.5}), rotate(${t.value.chart.grid.labels.xAxisLabels.rotation})`,
3860
- style: M({
3861
- cursor: Jt() ? "pointer" : "default"
3862
- }),
3863
- innerHTML: v(tn)({
3864
- content: String(e.text),
3865
- fontSize: L.value.xAxis,
3866
- fill: t.value.chart.grid.labels.xAxisLabels.color,
3867
- x: 0,
3868
- y: 0
3869
- }),
3870
- onClick: () => Ae(e, u)
3871
- }, null, 12, hs)) : (n(), i("text", {
3872
- key: 0,
3873
- class: "vue-data-ui-time-label",
3874
- "text-anchor": t.value.chart.grid.labels.xAxisLabels.rotation > 0 ? "start" : t.value.chart.grid.labels.xAxisLabels.rotation < 0 ? "end" : "middle",
3875
- "font-size": L.value.xAxis,
3876
- fill: t.value.chart.grid.labels.xAxisLabels.color,
3877
- transform: `translate(${c.value.left + c.value.width / P.value * u + c.value.width / P.value / 2}, ${c.value.bottom + L.value.xAxis * 1.5}), rotate(${t.value.chart.grid.labels.xAxisLabels.rotation})`,
3878
- style: M({
3879
- cursor: Jt() ? "pointer" : "default"
3880
- }),
3881
- onClick: () => Ae(e, u)
3882
- }, ue(e.text || ""), 13, ds))
3883
- ], 64)) : g("", !0)
3884
- ]))), 128))
3885
- ], 512)) : g("", !0),
3886
- Wa.value.length && !k.value.isStacked ? (n(), i("g", ms, [
3887
- (n(!0), i(b, null, _(Wa.value, (e) => (n(), i("g", {
3888
- key: e.uid
3889
- }, [
3890
- e.yTop && e.show && isFinite(e.yTop) ? (n(), i("line", {
3891
- key: 0,
3892
- x1: e.x1,
3893
- y1: e.yTop,
3894
- x2: e.x2,
3895
- y2: e.yTop,
3896
- stroke: e.config.line.stroke,
3897
- "stroke-width": e.config.line.strokeWidth,
3898
- "stroke-dasharray": e.config.line.strokeDasharray,
3899
- "stroke-linecap": "round",
3900
- style: { animation: "none !important" }
3901
- }, null, 8, fs)) : g("", !0),
3902
- e.yBottom && e.show && isFinite(e.yBottom) ? (n(), i("line", {
3903
- key: 1,
3904
- x1: e.x1,
3905
- y1: e.yBottom,
3906
- x2: e.x2,
3907
- y2: e.yBottom,
3908
- stroke: e.config.line.stroke,
3909
- "stroke-width": e.config.line.strokeWidth,
3910
- "stroke-dasharray": e.config.line.strokeDasharray,
3911
- "stroke-linecap": "round",
3912
- style: { animation: "none !important" }
3913
- }, null, 8, gs)) : g("", !0),
3914
- e.hasArea && e.show && isFinite(e.yTop) && isFinite(e.yBottom) ? (n(), i("rect", {
3915
- key: 2,
3916
- y: Math.min(e.yTop, e.yBottom),
3917
- x: e.x1,
3918
- width: c.value.width,
3919
- height: v(G)(e.areaHeight, 0),
3920
- fill: v(dt)(e.config.area.fill, e.config.area.opacity),
3921
- style: { animation: "none !important" }
3922
- }, null, 8, xs)) : g("", !0),
3923
- e.config.label.text && e.show && isFinite(e._box.y) ? (n(), i("rect", Ht({
3924
- key: 3,
3925
- class: "vue-ui-xy-annotation-label-box"
3926
- }, { ref_for: !0 }, e._box, { style: { animation: "none !important", transition: "none !important" } }), null, 16)) : g("", !0),
3927
- e.config.label.text && e.show && isFinite(e._text.y) ? (n(), i("text", {
3928
- key: 4,
3929
- id: e.id,
3930
- class: "vue-ui-xy-annotation-label",
3931
- x: e._text.x,
3932
- y: e._text.y,
3933
- "font-size": e.config.label.fontSize,
3934
- fill: e.config.label.color,
3935
- "text-anchor": e.config.label.textAnchor
3936
- }, ue(e.config.label.text), 9, bs)) : g("", !0)
3937
- ]))), 128))
3938
- ])) : g("", !0),
3939
- t.value.chart.timeTag.show && (![null, void 0].includes(A.value) || ![null, void 0].includes(H.value)) ? (n(), i("g", ys, [
3940
- (n(), i("foreignObject", {
3941
- x: Fo(),
3942
- y: c.value.bottom,
3943
- width: "200",
3944
- height: "40",
3945
- style: { overflow: "visible !important" }
3946
- }, [
3947
- w("div", {
3948
- ref_key: "timeTagEl",
3949
- ref: lo,
3950
- class: "vue-ui-xy-time-tag",
3951
- style: M(`width: fit-content;margin: 0 auto;text-align:center;padding:3px 12px;background:${t.value.chart.timeTag.backgroundColor};color:${t.value.chart.timeTag.color};font-size:${t.value.chart.timeTag.fontSize}px`),
3952
- innerHTML: Ro.value
3953
- }, null, 12, ks)
3954
- ], 8, ps)),
3955
- w("circle", {
3956
- cx: c.value.left + c.value.width / P.value * ((A.value !== null ? A.value : 0) || (H.value !== null ? H.value : 0)) + c.value.width / P.value / 2,
3957
- cy: c.value.bottom,
3958
- r: t.value.chart.timeTag.circleMarker.radius,
3959
- fill: t.value.chart.timeTag.circleMarker.color
3960
- }, null, 8, ws)
3961
- ])) : g("", !0)
3962
- ])) : g("", !0),
3963
- ql.value ? (n(), i("rect", Ht({ key: 2 }, xt.value, {
3964
- "data-start": p.value.start,
3965
- "data-end": p.value.end
3966
- }), null, 16, Ss)) : g("", !0),
3967
- Q(l.$slots, "svg", { svg: hl.value }, void 0, !0)
3968
- ], 512)
3969
- ], 46, di)),
3970
- l.$slots.watermark ? (n(), i("div", $s, [
3971
- Q(l.$slots, "watermark", zt(Bt({ isPrinting: v(lt) || v(rt) })), void 0, !0)
3972
- ])) : g("", !0),
3973
- (n(!0), i(b, null, _(De.value, (e, u) => (n(), i(b, {
3974
- key: `tag_line_${e.id}`
3975
- }, [
3976
- (n(!0), i(b, null, _(e.plots, (a, r) => (n(), i(b, {
3977
- key: `tag_line_${u}_${r}`
3978
- }, [
3979
- [H.value, A.value, ut.value].includes(r) && e.useTag && e.useTag === "end" && t.value.line.tag.followValue ? (n(), i("div", {
3980
- key: 0,
3981
- ref_for: !0,
3982
- ref: (o) => d(u, r, o, "right", "line"),
3983
- class: "vue-ui-xy-tag",
3984
- "data-tag": "right",
3985
- style: M({
3986
- position: "fixed",
3987
- top: v(Et)({
3988
- svgElement: Me.value,
3989
- x: c.value.right + t.value.line.tag.fontSize / 1.5,
3990
- y: a.y,
3991
- element: N.value[`${u}_${r}_right_line`],
3992
- position: "right"
3993
- }).top + "px",
3994
- left: v(Et)({
3995
- svgElement: Me.value,
3996
- x: c.value.right + t.value.line.tag.fontSize / 1.5,
3997
- y: a.y,
3998
- element: N.value[`${u}_${r}_right_line`],
3999
- position: "right"
4000
- }).left + "px",
4001
- height: "fit-content",
4002
- width: "fit-content",
4003
- background: e.color,
4004
- color: v(ht)(e.color),
4005
- padding: "0 6px",
4006
- fontSize: t.value.line.tag.fontSize + "px",
4007
- opacity: 1
4008
- })
4009
- }, [
4010
- (n(), i("svg", _s, [
4011
- w("path", {
4012
- d: "M 0,10 10,0 10,20 Z",
4013
- fill: e.color,
4014
- stroke: "none"
4015
- }, null, 8, Ms)
4016
- ])),
4017
- w("div", {
4018
- class: "vue-ui-xy-tag-content",
4019
- innerHTML: v(Te)(
4020
- t.value.line.tag.formatter,
4021
- a.value,
4022
- e.name,
4023
- {
4024
- datapoint: a,
4025
- seriesIndex: r,
4026
- serieName: e.name
4027
- }
4028
- )
4029
- }, null, 8, Ls)
4030
- ], 4)) : g("", !0),
4031
- [H.value, A.value, ut.value].includes(r) && e.useTag && e.useTag === "start" && t.value.line.tag.followValue ? (n(), i("div", {
4032
- key: 1,
4033
- ref_for: !0,
4034
- ref: (o) => d(u, r, o, "left", "line"),
4035
- class: "vue-ui-xy-tag",
4036
- "data-tag": "left",
4037
- style: M({
4038
- position: "fixed",
4039
- top: v(Et)({
4040
- svgElement: Me.value,
4041
- x: c.value.left - t.value.line.tag.fontSize / 1.5,
4042
- y: a.y,
4043
- element: N.value[`${u}_${r}_left_line`],
4044
- position: "left"
4045
- }).top + "px",
4046
- left: v(Et)({
4047
- svgElement: Me.value,
4048
- x: c.value.left - t.value.line.tag.fontSize / 1.5,
4049
- y: a.y,
4050
- element: N.value[`${u}_${r}_left_line`],
4051
- position: "left"
4052
- }).left + "px",
4053
- height: "fit-content",
4054
- width: "fit-content",
4055
- background: e.color,
4056
- color: v(ht)(e.color),
4057
- padding: "0 6px",
4058
- fontSize: t.value.line.tag.fontSize + "px",
4059
- opacity: 1
4060
- })
4061
- }, [
4062
- (n(), i("svg", Cs, [
4063
- w("path", {
4064
- d: "M 0,0 10,10 0,20 Z",
4065
- fill: e.color,
4066
- stroke: "none"
4067
- }, null, 8, As)
4068
- ])),
4069
- w("div", {
4070
- class: "vue-ui-xy-tag-content",
4071
- innerHTML: v(Te)(
4072
- t.value.line.tag.formatter,
4073
- a.value,
4074
- e.name,
4075
- {
4076
- datapoint: a,
4077
- seriesIndex: r,
4078
- serieName: e.name
4079
- }
4080
- )
4081
- }, null, 8, zs)
4082
- ], 4)) : g("", !0)
4083
- ], 64))), 128))
4084
- ], 64))), 128)),
4085
- (n(!0), i(b, null, _(vt.value, (e, u) => (n(), i(b, {
4086
- key: `tag_plot_${e.id}`
4087
- }, [
4088
- (n(!0), i(b, null, _(e.plots, (a, r) => (n(), i(b, {
4089
- key: `tag_plot_${u}_${r}`
4090
- }, [
4091
- [H.value, A.value, ut.value].includes(r) && e.useTag && e.useTag === "end" && t.value.plot.tag.followValue ? (n(), i("div", {
4092
- key: 0,
4093
- ref_for: !0,
4094
- ref: (o) => d(u, r, o, "right", "plot"),
4095
- class: "vue-ui-xy-tag",
4096
- "data-tag": "right",
4097
- style: M({
4098
- position: "fixed",
4099
- top: v(Et)({
4100
- svgElement: Me.value,
4101
- x: c.value.right + t.value.plot.tag.fontSize / 1.5,
4102
- y: a.y,
4103
- element: N.value[`${u}_${r}_right_plot`],
4104
- position: "right"
4105
- }).top + "px",
4106
- left: v(Et)({
4107
- svgElement: Me.value,
4108
- x: c.value.right + t.value.plot.tag.fontSize / 1.5,
4109
- y: a.y,
4110
- element: N.value[`${u}_${r}_right_plot`],
4111
- position: "right"
4112
- }).left + "px",
4113
- height: "fit-content",
4114
- width: "fit-content",
4115
- background: e.color,
4116
- color: v(ht)(e.color),
4117
- padding: "0 6px",
4118
- fontSize: t.value.plot.tag.fontSize + "px",
4119
- opacity: 1
4120
- })
4121
- }, [
4122
- (n(), i("svg", Ts, [
4123
- w("path", {
4124
- d: "M 0,10 10,0 10,20 Z",
4125
- fill: e.color,
4126
- stroke: "none"
4127
- }, null, 8, Is)
4128
- ])),
4129
- w("div", {
4130
- class: "vue-ui-xy-tag-content",
4131
- innerHTML: v(Te)(
4132
- t.value.plot.tag.formatter,
4133
- a.value,
4134
- e.name,
4135
- {
4136
- datapoint: a,
4137
- seriesIndex: r,
4138
- serieName: e.name
4139
- }
4140
- )
4141
- }, null, 8, Ns)
4142
- ], 4)) : g("", !0),
4143
- [H.value, A.value, ut.value].includes(r) && e.useTag && e.useTag === "start" && t.value.plot.tag.followValue ? (n(), i("div", {
4144
- key: 1,
4145
- ref_for: !0,
4146
- ref: (o) => d(u, r, o, "left", "plot"),
4147
- class: "vue-ui-xy-tag",
4148
- "data-tag": "left",
4149
- style: M({
4150
- position: "fixed",
4151
- top: v(Et)({
4152
- svgElement: Me.value,
4153
- x: c.value.left - t.value.plot.tag.fontSize / 1.5,
4154
- y: a.y,
4155
- element: N.value[`${u}_${r}_left_plot`],
4156
- position: "left"
4157
- }).top + "px",
4158
- left: v(Et)({
4159
- svgElement: Me.value,
4160
- x: c.value.left - t.value.plot.tag.fontSize / 1.5,
4161
- y: a.y,
4162
- element: N.value[`${u}_${r}_left_plot`],
4163
- position: "left"
4164
- }).left + "px",
4165
- height: "fit-content",
4166
- width: "fit-content",
4167
- background: e.color,
4168
- color: v(ht)(e.color),
4169
- padding: "0 6px",
4170
- fontSize: t.value.plot.tag.fontSize + "px",
4171
- opacity: 1
4172
- })
4173
- }, [
4174
- (n(), i("svg", Ps, [
4175
- w("path", {
4176
- d: "M 0,0 10,10 0,20 Z",
4177
- fill: e.color,
4178
- stroke: "none"
4179
- }, null, 8, Fs)
4180
- ])),
4181
- w("div", {
4182
- class: "vue-ui-xy-tag-content",
4183
- innerHTML: v(Te)(
4184
- t.value.plot.tag.formatter,
4185
- a.value,
4186
- e.name,
4187
- {
4188
- datapoint: a,
4189
- seriesIndex: r,
4190
- serieName: e.name
4191
- }
4192
- )
4193
- }, null, 8, Rs)
4194
- ], 4)) : g("", !0)
4195
- ], 64))), 128))
4196
- ], 64))), 128)),
4197
- t.value.chart.zoom.preview.enable ? (n(), i(b, { key: 5 }, [
4198
- t.value.chart.zoom.show && Be.value > 6 && Gt.value ? (n(), at(ri, {
4199
- ref_key: "chartSlicer",
4200
- ref: Re,
4201
- key: `slicer_${Pt.value}`,
4202
- max: Be.value,
4203
- min: 0,
4204
- valueStart: p.value.start,
4205
- valueEnd: p.value.end,
4206
- start: p.value.start,
4207
- "onUpdate:start": s[1] || (s[1] = (e) => p.value.start = e),
4208
- end: p.value.end,
4209
- "onUpdate:end": s[2] || (s[2] = (e) => p.value.end = e),
4210
- selectedSeries: Ct.value,
4211
- customFormat: t.value.chart.zoom.customFormat,
4212
- background: t.value.chart.zoom.color,
4213
- fontSize: t.value.chart.zoom.fontSize,
4214
- useResetSlot: t.value.chart.zoom.useResetSlot,
4215
- labelLeft: C.value[0] ? C.value[0].text : "",
4216
- labelRight: C.value.at(-1) ? C.value.at(-1).text : "",
4217
- textColor: t.value.chart.color,
4218
- usePreciseLabels: t.value.chart.grid.labels.xAxisLabels.datetimeFormatter.enable && !t.value.chart.zoom.useDefaultFormat,
4219
- preciseLabels: $a.value,
4220
- inputColor: t.value.chart.zoom.color,
4221
- selectColor: t.value.chart.zoom.highlightColor,
4222
- borderColor: t.value.chart.backgroundColor,
4223
- minimap: Ea.value,
4224
- smoothMinimap: t.value.chart.zoom.minimap.smooth,
4225
- minimapSelectedColor: t.value.chart.zoom.minimap.selectedColor,
4226
- minimapSelectionRadius: t.value.chart.zoom.minimap.selectionRadius,
4227
- minimapLineColor: t.value.chart.zoom.minimap.lineColor,
4228
- minimapSelectedColorOpacity: t.value.chart.zoom.minimap.selectedColorOpacity,
4229
- minimapSelectedIndex: A.value,
4230
- minimapIndicatorColor: t.value.chart.zoom.minimap.indicatorColor,
4231
- verticalHandles: t.value.chart.zoom.minimap.verticalHandles,
4232
- refreshStartPoint: t.value.chart.zoom.startIndex !== null ? t.value.chart.zoom.startIndex : 0,
4233
- refreshEndPoint: t.value.chart.zoom.endIndex !== null ? t.value.chart.zoom.endIndex + 1 : Math.max(...S.dataset.map((e) => st(e.series).length)),
4234
- enableRangeHandles: t.value.chart.zoom.enableRangeHandles,
4235
- enableSelectionDrag: t.value.chart.zoom.enableSelectionDrag,
4236
- minimapCompact: t.value.chart.zoom.minimap.compact,
4237
- allMinimaps: Ha.value,
4238
- minimapMerged: t.value.chart.zoom.minimap.merged,
4239
- minimapFrameColor: t.value.chart.zoom.minimap.frameColor,
4240
- cutNullValues: t.value.line.cutNullValues,
4241
- onReset: Vl,
4242
- onTrapMouse: Rl,
4243
- onFutureStart: s[3] || (s[3] = (e) => Nl("start", e)),
4244
- onFutureEnd: s[4] || (s[4] = (e) => Nl("end", e)),
4245
- timeLabels: te.value,
4246
- isPreview: ql.value
4247
- }, {
4248
- "reset-action": we(({ reset: e }) => [
4249
- Q(l.$slots, "reset-action", zt(Bt({ reset: e })), void 0, !0)
4250
- ]),
4251
- _: 3
4252
- }, 8, ["max", "valueStart", "valueEnd", "start", "end", "selectedSeries", "customFormat", "background", "fontSize", "useResetSlot", "labelLeft", "labelRight", "textColor", "usePreciseLabels", "preciseLabels", "inputColor", "selectColor", "borderColor", "minimap", "smoothMinimap", "minimapSelectedColor", "minimapSelectionRadius", "minimapLineColor", "minimapSelectedColorOpacity", "minimapSelectedIndex", "minimapIndicatorColor", "verticalHandles", "refreshStartPoint", "refreshEndPoint", "enableRangeHandles", "enableSelectionDrag", "minimapCompact", "allMinimaps", "minimapMerged", "minimapFrameColor", "cutNullValues", "timeLabels", "isPreview"])) : g("", !0)
4253
- ], 64)) : (n(), i(b, { key: 6 }, [
4254
- t.value.chart.zoom.show && Be.value > 6 && Gt.value ? (n(), at(xn, {
4255
- ref_key: "chartSlicer",
4256
- ref: Re,
4257
- key: `slicer_${Pt.value}`,
4258
- max: Be.value,
4259
- min: 0,
4260
- valueStart: p.value.start,
4261
- valueEnd: p.value.end,
4262
- start: p.value.start,
4263
- "onUpdate:start": s[5] || (s[5] = (e) => p.value.start = e),
4264
- end: p.value.end,
4265
- "onUpdate:end": s[6] || (s[6] = (e) => p.value.end = e),
4266
- background: t.value.chart.zoom.color,
4267
- fontSize: t.value.chart.zoom.fontSize,
4268
- useResetSlot: t.value.chart.zoom.useResetSlot,
4269
- labelLeft: Ua.value.left,
4270
- labelRight: Ua.value.right,
4271
- textColor: t.value.chart.color,
4272
- inputColor: t.value.chart.zoom.color,
4273
- selectColor: t.value.chart.zoom.highlightColor,
4274
- borderColor: t.value.chart.backgroundColor,
4275
- minimap: Ea.value,
4276
- smoothMinimap: t.value.chart.zoom.minimap.smooth,
4277
- minimapSelectedColor: t.value.chart.zoom.minimap.selectedColor,
4278
- minimapSelectionRadius: t.value.chart.zoom.minimap.selectionRadius,
4279
- minimapLineColor: t.value.chart.zoom.minimap.lineColor,
4280
- minimapSelectedColorOpacity: t.value.chart.zoom.minimap.selectedColorOpacity,
4281
- minimapSelectedIndex: A.value,
4282
- minimapIndicatorColor: t.value.chart.zoom.minimap.indicatorColor,
4283
- verticalHandles: t.value.chart.zoom.minimap.verticalHandles,
4284
- refreshStartPoint: t.value.chart.zoom.startIndex !== null ? t.value.chart.zoom.startIndex : 0,
4285
- refreshEndPoint: t.value.chart.zoom.endIndex !== null ? t.value.chart.zoom.endIndex + 1 : Math.max(...S.dataset.map((e) => st(e.series).length)),
4286
- enableRangeHandles: t.value.chart.zoom.enableRangeHandles,
4287
- enableSelectionDrag: t.value.chart.zoom.enableSelectionDrag,
4288
- minimapCompact: t.value.chart.zoom.minimap.compact,
4289
- allMinimaps: Ha.value,
4290
- minimapMerged: t.value.chart.zoom.minimap.merged,
4291
- minimapFrameColor: t.value.chart.zoom.minimap.frameColor,
4292
- cutNullValues: t.value.line.cutNullValues,
4293
- onReset: Vl,
4294
- onTrapMouse: Rl
4295
- }, {
4296
- "reset-action": we(({ reset: e }) => [
4297
- Q(l.$slots, "reset-action", zt(Bt({ reset: e })), void 0, !0)
4298
- ]),
4299
- _: 3
4300
- }, 8, ["max", "valueStart", "valueEnd", "start", "end", "background", "fontSize", "useResetSlot", "labelLeft", "labelRight", "textColor", "inputColor", "selectColor", "borderColor", "minimap", "smoothMinimap", "minimapSelectedColor", "minimapSelectionRadius", "minimapLineColor", "minimapSelectedColorOpacity", "minimapSelectedIndex", "minimapIndicatorColor", "verticalHandles", "refreshStartPoint", "refreshEndPoint", "enableRangeHandles", "enableSelectionDrag", "minimapCompact", "allMinimaps", "minimapMerged", "minimapFrameColor", "cutNullValues"])) : g("", !0)
4301
- ], 64)),
4302
- w("div", {
4303
- id: `legend-bottom-${U.value}`
4304
- }, null, 8, Vs),
4305
- Oe.value ? (n(), at(Wo, {
4306
- key: 7,
4307
- to: t.value.chart.legend.position === "top" ? `#legend-top-${U.value}` : `#legend-bottom-${U.value}`
4308
- }, [
4309
- t.value.chart.legend.show ? (n(), i("div", {
4310
- key: 0,
4311
- ref_key: "chartLegend",
4312
- ref: ft,
4313
- class: "vue-ui-xy-legend",
4314
- style: M({
4315
- fontSize: `var(--legend-font-size, ${t.value.chart.legend.fontSize ?? 14}px)`
4316
- })
4317
- }, [
4318
- (n(!0), i(b, null, _(Le.value, (e, u) => (n(), i("div", {
4319
- key: `div_legend_item_${u}`,
4320
- onClick: (a) => Va(e),
4321
- class: Qe({ "vue-ui-xy-legend-item-alone": Le.value.length === 1, "vue-ui-xy-legend-item": !0, "vue-ui-xy-legend-item-segregated": ce.value.includes(e.id) })
4322
- }, [
4323
- et.value[e.type] === "line" ? (n(), i("svg", Bs, [
4324
- w("rect", {
4325
- x: "0",
4326
- y: "7.5",
4327
- rx: "1.5",
4328
- stroke: t.value.chart.backgroundColor,
4329
- "stroke-width": 0.5,
4330
- height: "3",
4331
- width: "20",
4332
- fill: e.color
4333
- }, null, 8, Es),
4334
- nl(ra, {
4335
- plot: { x: 10, y: 9 },
4336
- radius: 4,
4337
- color: e.color,
4338
- shape: ["triangle", "square", "diamond", "pentagon", "hexagon", "star"].includes(e.shape) ? e.shape : "circle",
4339
- stroke: t.value.chart.backgroundColor,
4340
- strokeWidth: 0.5
4341
- }, null, 8, ["color", "shape", "stroke"])
4342
- ])) : et.value[e.type] === "bar" ? (n(), i("svg", Hs, [
4343
- et.value[e.type] === "bar" && l.$slots.pattern ? (n(), i("rect", {
4344
- key: 0,
4345
- x: "4",
4346
- y: "4",
4347
- rx: "1",
4348
- height: "32",
4349
- width: "32",
4350
- stroke: "none",
4351
- fill: e.color
4352
- }, null, 8, Ds)) : g("", !0),
4353
- et.value[e.type] === "bar" ? (n(), i("rect", {
4354
- key: 1,
4355
- x: "4",
4356
- y: "4",
4357
- rx: "1",
4358
- height: "32",
4359
- width: "32",
4360
- stroke: "none",
4361
- fill: l.$slots.pattern ? `url(#pattern_${U.value}_${e.slotAbsoluteIndex})` : e.color
4362
- }, null, 8, Ws)) : g("", !0)
4363
- ])) : (n(), i("svg", Xs, [
4364
- nl(ra, {
4365
- plot: { x: 6, y: 6 },
4366
- radius: 5,
4367
- color: e.color,
4368
- shape: ["triangle", "square", "diamond", "pentagon", "hexagon", "star"].includes(e.shape) ? e.shape : "circle"
4369
- }, null, 8, ["color", "shape"])
4370
- ])),
4371
- w("span", {
4372
- style: M(`color:${t.value.chart.legend.color}`)
4373
- }, ue(e.name), 5)
4374
- ], 10, Os))), 128))
4375
- ], 4)) : (n(), i("div", {
4376
- key: 1,
4377
- ref_key: "chartLegend",
4378
- ref: ft
4379
- }, [
4380
- Q(l.$slots, "legend", { legend: Le.value }, void 0, !0)
4381
- ], 512))
4382
- ], 8, ["to"])) : g("", !0),
4383
- l.$slots.source ? (n(), i("div", {
4384
- key: 8,
4385
- ref_key: "source",
4386
- ref: pt,
4387
- dir: "auto"
4388
- }, [
4389
- Q(l.$slots, "source", {}, void 0, !0)
4390
- ], 512)) : g("", !0),
4391
- nl(v(ge), {
4392
- show: k.value.showTooltip && Al.value,
4393
- backgroundColor: t.value.chart.tooltip.backgroundColor,
4394
- color: t.value.chart.tooltip.color,
4395
- fontSize: t.value.chart.tooltip.fontSize,
4396
- borderRadius: t.value.chart.tooltip.borderRadius,
4397
- borderColor: t.value.chart.tooltip.borderColor,
4398
- borderWidth: t.value.chart.tooltip.borderWidth,
4399
- backgroundOpacity: t.value.chart.tooltip.backgroundOpacity,
4400
- position: t.value.chart.tooltip.position,
4401
- offsetY: t.value.chart.tooltip.offsetY,
4402
- parent: l.$refs.chart,
4403
- content: Io.value,
4404
- isFullscreen: ee.value,
4405
- isCustom: t.value.chart.tooltip.customFormat && typeof t.value.chart.tooltip.customFormat == "function",
4406
- smooth: t.value.chart.tooltip.smooth,
4407
- backdropFilter: t.value.chart.tooltip.backdropFilter,
4408
- smoothForce: t.value.chart.tooltip.smoothForce,
4409
- smoothSnapThreshold: t.value.chart.tooltip.smoothSnapThreshold
4410
- }, {
4411
- "tooltip-before": we(() => [
4412
- Q(l.$slots, "tooltip-before", zt(Bt({ ...Ga.value })), void 0, !0)
4413
- ]),
4414
- "tooltip-after": we(() => [
4415
- Q(l.$slots, "tooltip-after", zt(Bt({ ...Ga.value })), void 0, !0)
4416
- ]),
4417
- _: 3
4418
- }, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom", "smooth", "backdropFilter", "smoothForce", "smoothSnapThreshold"]),
4419
- Gt.value && t.value.chart.userOptions.buttons.table ? (n(), at(Xo(Hl.value.component), Ht({ key: 9 }, Hl.value.props, {
4420
- ref_key: "tableUnit",
4421
- ref: Ie,
4422
- onClose: no
4423
- }), ro({
4424
- content: we(() => [
4425
- w("div", {
4426
- style: M(`${v(lt) || t.value.table.useDialog ? "" : "max-height:400px"};${t.value.table.useDialog ? "height: fit-content; " : ""};overflow:auto;width:100%;${t.value.table.useDialog ? "" : "margin-top:48px"}`)
4427
- }, [
4428
- w("div", Ys, [
4429
- Ta(w("input", {
4430
- type: "checkbox",
4431
- "onUpdate:modelValue": s[8] || (s[8] = (e) => Wt.value = e)
4432
- }, null, 512), [
4433
- [Yo, Wt.value]
4434
- ]),
4435
- w("div", {
4436
- onClick: s[9] || (s[9] = (e) => Wt.value = !Wt.value),
4437
- style: { cursor: "pointer" }
4438
- }, [
4439
- nl(v(he), {
4440
- name: "chartLine",
4441
- size: 20,
4442
- stroke: t.value.chart.color
4443
- }, null, 8, ["stroke"])
4444
- ])
4445
- ]),
4446
- Wt.value ? (n(), at(v($l), {
4447
- key: `sparkline_${Tl.value}`,
4448
- dataset: Ao.value,
4449
- config: zo.value
4450
- }, null, 8, ["dataset", "config"])) : (n(), at(v(nt), {
4451
- key: `table_${_t.value}`,
4452
- colNames: na.value.colNames,
4453
- head: na.value.head,
4454
- body: na.value.body,
4455
- config: na.value.config,
4456
- title: t.value.table.useDialog ? "" : Hl.value.title,
4457
- withCloseButton: !t.value.table.useDialog,
4458
- onClose: no
4459
- }, {
4460
- th: we(({ th: e }) => [
4461
- w("div", { innerHTML: e }, null, 8, Gs)
4462
- ]),
4463
- td: we(({ td: e }) => [
4464
- co(ue(isNaN(Number(e)) ? e : v(ot)({
4465
- p: t.value.chart.labels.prefix,
4466
- v: e,
4467
- s: t.value.chart.labels.suffix,
4468
- r: t.value.table.rounding
4469
- })), 1)
4470
- ]),
4471
- _: 1
4472
- }, 8, ["colNames", "head", "body", "config", "title", "withCloseButton"]))
4473
- ], 4)
4474
- ]),
4475
- _: 2
4476
- }, [
4477
- t.value.table.useDialog ? {
4478
- name: "title",
4479
- fn: we(() => [
4480
- co(ue(Hl.value.title), 1)
4481
- ]),
4482
- key: "0"
4483
- } : void 0,
4484
- t.value.table.useDialog ? {
4485
- name: "actions",
4486
- fn: we(() => [
4487
- w("button", {
4488
- tabindex: "0",
4489
- class: "vue-ui-user-options-button",
4490
- onClick: s[7] || (s[7] = (e) => _a(t.value.chart.userOptions.callbacks.csv))
4491
- }, [
4492
- nl(v(he), {
4493
- name: "excel",
4494
- stroke: Hl.value.props.color
4495
- }, null, 8, ["stroke"])
4496
- ])
4497
- ]),
4498
- key: "1"
4499
- } : void 0
4500
- ]), 1040)) : g("", !0),
4501
- v(me) ? (n(), at(vn, { key: 10 })) : g("", !0)
4502
- ], 46, ci));
4503
- }
4504
- }, rr = /* @__PURE__ */ yo(Us, [["__scopeId", "data-v-30cdfb98"]]);
4505
- export {
4506
- rr as default
4507
- };