vue-data-ui 3.21.0 → 3.21.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/PackageVersion-Djj1DmIU.js +12 -0
- package/dist/components/vue-ui-3d-bar.js +1 -1
- package/dist/components/vue-ui-age-pyramid.js +1 -1
- package/dist/components/vue-ui-bullet.js +1 -1
- package/dist/components/vue-ui-bump.js +1 -1
- package/dist/components/vue-ui-candlestick.js +1 -1
- package/dist/components/vue-ui-carousel-table.js +1 -1
- package/dist/components/vue-ui-chestnut.js +1 -1
- package/dist/components/vue-ui-chord.js +1 -1
- package/dist/components/vue-ui-circle-pack.js +1 -1
- package/dist/components/vue-ui-cursor.js +1 -1
- package/dist/components/vue-ui-dag.js +1 -1
- package/dist/components/vue-ui-dashboard.js +1 -1
- package/dist/components/vue-ui-digits.js +1 -1
- package/dist/components/vue-ui-donut-evolution.js +1 -1
- package/dist/components/vue-ui-donut.js +1 -1
- package/dist/components/vue-ui-dumbbell.js +1 -1
- package/dist/components/vue-ui-flow.js +1 -1
- package/dist/components/vue-ui-funnel.js +1 -1
- package/dist/components/vue-ui-galaxy.js +1 -1
- package/dist/components/vue-ui-gauge.js +1 -1
- package/dist/components/vue-ui-geo.js +1 -1
- package/dist/components/vue-ui-gizmo.js +1 -1
- package/dist/components/vue-ui-heatmap.js +1 -1
- package/dist/components/vue-ui-history-plot.js +1 -1
- package/dist/components/vue-ui-horizontal-bar.js +1 -1
- package/dist/components/vue-ui-kpi.js +1 -1
- package/dist/components/vue-ui-molecule.js +1 -1
- package/dist/components/vue-ui-mood-radar.js +1 -1
- package/dist/components/vue-ui-nested-donuts.js +1 -1
- package/dist/components/vue-ui-onion.js +1 -1
- package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
- package/dist/components/vue-ui-quadrant.js +1 -1
- package/dist/components/vue-ui-quick-chart.js +1 -1
- package/dist/components/vue-ui-radar.js +1 -1
- package/dist/components/vue-ui-relation-circle.js +1 -1
- package/dist/components/vue-ui-ridgeline.js +1 -1
- package/dist/components/vue-ui-rings.js +1 -1
- package/dist/components/vue-ui-scatter.js +1 -1
- package/dist/components/vue-ui-skeleton.js +1 -1
- package/dist/components/vue-ui-spark-trend.js +1 -1
- package/dist/components/vue-ui-sparkbar.js +1 -1
- package/dist/components/vue-ui-sparkgauge.js +1 -1
- package/dist/components/vue-ui-sparkhistogram.js +1 -1
- package/dist/components/vue-ui-sparkline.js +1 -1
- package/dist/components/vue-ui-sparkstackbar.js +1 -1
- package/dist/components/vue-ui-stackbar.js +1 -1
- package/dist/components/vue-ui-stackline.js +1 -1
- package/dist/components/vue-ui-strip-plot.js +1 -1
- package/dist/components/vue-ui-table-sparkline.js +1 -1
- package/dist/components/vue-ui-table.js +1 -1
- package/dist/components/vue-ui-thermometer.js +1 -1
- package/dist/components/vue-ui-timer.js +1 -1
- package/dist/components/vue-ui-tiremarks.js +1 -1
- package/dist/components/vue-ui-treemap.js +1 -1
- package/dist/components/vue-ui-vertical-bar.js +1 -1
- package/dist/components/vue-ui-waffle.js +1 -1
- package/dist/components/vue-ui-wheel.js +1 -1
- package/dist/components/vue-ui-word-cloud.js +1 -1
- package/dist/components/vue-ui-world.js +1 -1
- package/dist/components/vue-ui-xy.js +1 -1
- package/dist/package-DwtrIvz-.js +4 -0
- package/dist/render-common-aVBx5bwm.js +152 -0
- package/dist/ssr/vue-ui-donut.js +2 -0
- package/dist/ssr/vue-ui-xy.js +2 -0
- package/dist/ssr.js +3 -1366
- package/dist/types/ssr.d.ts +56 -2
- package/dist/{vue-data-ui-D2dM3IQZ.js → vue-data-ui-DxLmhpko.js} +60 -60
- package/dist/vue-data-ui.js +60 -60
- package/dist/{vue-ui-3d-bar-0C_yshya.js → vue-ui-3d-bar-Dzdo_8qY.js} +1 -1
- package/dist/{vue-ui-age-pyramid-DFNELwbT.js → vue-ui-age-pyramid-CIwN3HVR.js} +1 -1
- package/dist/{vue-ui-bullet-ChQq42AN.js → vue-ui-bullet-Dosih8Hb.js} +1 -1
- package/dist/{vue-ui-bump-BVCYywuS.js → vue-ui-bump--giMQaXE.js} +1 -1
- package/dist/{vue-ui-candlestick-CQ0nfkmL.js → vue-ui-candlestick-D_lfz0FX.js} +1 -1
- package/dist/{vue-ui-carousel-table-Cvi1gsKR.js → vue-ui-carousel-table-DEgFnasE.js} +1 -1
- package/dist/{vue-ui-chestnut-DeWbKqze.js → vue-ui-chestnut-i2Y-uK8C.js} +1 -1
- package/dist/{vue-ui-chord-bRXYWpGT.js → vue-ui-chord-DYwKe8vr.js} +1 -1
- package/dist/{vue-ui-circle-pack-DWO8x9gf.js → vue-ui-circle-pack-Cf0oDwlO.js} +1 -1
- package/dist/{vue-ui-cursor-BKGUvOWO.js → vue-ui-cursor-B7yLqYNS.js} +1 -1
- package/dist/{vue-ui-dag-lL0juBzN.js → vue-ui-dag-BDVRFz-1.js} +1 -1
- package/dist/{vue-ui-dashboard-CEk2z8v9.js → vue-ui-dashboard-AUHJopaF.js} +57 -57
- package/dist/{vue-ui-digits-BAjr0eIJ.js → vue-ui-digits-BEFXCA9O.js} +1 -1
- package/dist/{vue-ui-donut-BsSpIinL.js → vue-ui-donut-B3IYq0vZ.js} +1 -1
- package/dist/vue-ui-donut-BJyXzn6B.js +973 -0
- package/dist/{vue-ui-donut-evolution-1UhFKEgG.js → vue-ui-donut-evolution-BSV2Crlx.js} +1 -1
- package/dist/{vue-ui-dumbbell-ChqJicg9.js → vue-ui-dumbbell-7DAk8eNI.js} +1 -1
- package/dist/{vue-ui-flow-BXfzMTXx.js → vue-ui-flow-DUk1CDgi.js} +1 -1
- package/dist/{vue-ui-funnel-BpnC82m0.js → vue-ui-funnel-Bf9GDDV6.js} +1 -1
- package/dist/{vue-ui-galaxy-FNzwDOH1.js → vue-ui-galaxy-Z5Ev4iYr.js} +1 -1
- package/dist/{vue-ui-gauge-D6I78FZr.js → vue-ui-gauge-Cq_EA0Bj.js} +1 -1
- package/dist/{vue-ui-geo-Z1xuH8r6.js → vue-ui-geo-C7k7pTTU.js} +1 -1
- package/dist/{vue-ui-gizmo-ZlmJIh0_.js → vue-ui-gizmo-D_xYaP3o.js} +1 -1
- package/dist/{vue-ui-heatmap-BWN0UBKE.js → vue-ui-heatmap-DgmK3aY4.js} +1 -1
- package/dist/{vue-ui-history-plot-2E6KrNhv.js → vue-ui-history-plot-Cq9UBQYd.js} +1 -1
- package/dist/{vue-ui-horizontal-bar-BzP7k_3J.js → vue-ui-horizontal-bar-BcLFr3-H.js} +1 -1
- package/dist/{vue-ui-kpi-B9bdicir.js → vue-ui-kpi-CjiJWVnq.js} +1 -1
- package/dist/{vue-ui-molecule-B-69fE_1.js → vue-ui-molecule-CVu51gtg.js} +1 -1
- package/dist/{vue-ui-mood-radar-D3kF7iHz.js → vue-ui-mood-radar-bZC-Dg-1.js} +1 -1
- package/dist/{vue-ui-nested-donuts-CTmomXj1.js → vue-ui-nested-donuts-BYK8yR9-.js} +1 -1
- package/dist/{vue-ui-onion-3fJB4mfC.js → vue-ui-onion-DVQBUIfH.js} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-CKKkbBlu.js → vue-ui-parallel-coordinate-plot-BxhGmOXk.js} +1 -1
- package/dist/{vue-ui-quadrant-DGLnjwva.js → vue-ui-quadrant-vnDlJEWL.js} +1 -1
- package/dist/{vue-ui-quick-chart-DJnhlEXi.js → vue-ui-quick-chart-CBauII4k.js} +1 -1
- package/dist/{vue-ui-radar-AIBX0QYs.js → vue-ui-radar-BYHLMJ0O.js} +1 -1
- package/dist/{vue-ui-relation-circle-BQVR8L9Y.js → vue-ui-relation-circle-WyHCmUGv.js} +1 -1
- package/dist/{vue-ui-ridgeline-CYq3APPQ.js → vue-ui-ridgeline-Dt2bsq8i.js} +1 -1
- package/dist/{vue-ui-rings-BgFO7NYF.js → vue-ui-rings-B97-rYT2.js} +1 -1
- package/dist/{vue-ui-scatter-BPu5DwaJ.js → vue-ui-scatter-DXOLVV7d.js} +1 -1
- package/dist/{vue-ui-skeleton-qpdvvWtx.js → vue-ui-skeleton-BFoHaAzE.js} +1 -1
- package/dist/{vue-ui-spark-trend-CQ9ZN5sL.js → vue-ui-spark-trend-BwSLGFz4.js} +1 -1
- package/dist/{vue-ui-sparkbar-d6ctWlLA.js → vue-ui-sparkbar-BQlbLbj_.js} +1 -1
- package/dist/{vue-ui-sparkgauge-HX_rqLxX.js → vue-ui-sparkgauge-gMtvy-s9.js} +1 -1
- package/dist/{vue-ui-sparkhistogram-B_zxKMHv.js → vue-ui-sparkhistogram-C5Elj_Rp.js} +1 -1
- package/dist/{vue-ui-sparkline-BSdOdtKu.js → vue-ui-sparkline-DJM-Ez8d.js} +1 -1
- package/dist/{vue-ui-sparkstackbar-B2sqpW-w.js → vue-ui-sparkstackbar-DrcKqBm_.js} +1 -1
- package/dist/{vue-ui-stackbar-DH75CCpy.js → vue-ui-stackbar-D2T1OrVG.js} +1 -1
- package/dist/{vue-ui-stackline-CXodezD1.js → vue-ui-stackline-ByefOdDI.js} +1 -1
- package/dist/{vue-ui-strip-plot-C1un5Mku.js → vue-ui-strip-plot-BVvVrhEq.js} +1 -1
- package/dist/{vue-ui-table-R-aXpHvF.js → vue-ui-table-C9o1vxEo.js} +2 -2
- package/dist/{vue-ui-table-sparkline-Dy-6i82F.js → vue-ui-table-sparkline-DbMBlaJr.js} +1 -1
- package/dist/{vue-ui-thermometer-CIse_lcE.js → vue-ui-thermometer-BGoNUm0Q.js} +1 -1
- package/dist/{vue-ui-timer-AlYvthQ6.js → vue-ui-timer-DrqEZJ9e.js} +1 -1
- package/dist/{vue-ui-tiremarks-CP_bw6by.js → vue-ui-tiremarks-h-OTdz5K.js} +1 -1
- package/dist/{vue-ui-treemap-BXrV5VAp.js → vue-ui-treemap-CVVSxQPH.js} +1 -1
- package/dist/{vue-ui-waffle-uoqEnQ30.js → vue-ui-waffle-nvE6zzca.js} +1 -1
- package/dist/{vue-ui-wheel-DLgw_xfe.js → vue-ui-wheel-CYu92PTs.js} +1 -1
- package/dist/{vue-ui-word-cloud-Bgu-qbcp.js → vue-ui-word-cloud-CRuXBu1K.js} +1 -1
- package/dist/{vue-ui-world-B93iq1ZM.js → vue-ui-world-Dn5KG6i-.js} +1 -1
- package/dist/vue-ui-xy-DjB1eAEf.js +1264 -0
- package/dist/{vue-ui-xy-DzuOBbPL.js → vue-ui-xy-Dzk3ILJy.js} +1 -1
- package/package.json +2 -2
- package/dist/PackageVersion-DYLo3MRd.js +0 -11
package/dist/ssr.js
CHANGED
|
@@ -1,1366 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t
|
|
3
|
-
|
|
4
|
-
import { t as A } from "./vue_ui_xy-BA3-_LCx.js";
|
|
5
|
-
//#region src/svg/vue-ui-xy/create.js
|
|
6
|
-
var { vue_ui_xy: j } = k();
|
|
7
|
-
function ne({ config: e = {}, dataset: t = [] } = {}) {
|
|
8
|
-
let r = e ?? {}, i = s({
|
|
9
|
-
userConfig: r,
|
|
10
|
-
defaultConfig: j
|
|
11
|
-
});
|
|
12
|
-
w(r, "chart.highlightArea") && (Array.isArray(r.chart.highlightArea) ? i.chart.highlightArea = r.chart.highlightArea.map((e) => s({
|
|
13
|
-
defaultConfig: j.chart.highlightArea,
|
|
14
|
-
userConfig: e
|
|
15
|
-
})) : i.chart.highlightArea = [s({
|
|
16
|
-
defaultConfig: j.chart.highlightArea,
|
|
17
|
-
userConfig: r.chart.highlightArea
|
|
18
|
-
})]), w(r, "chart.annotations") && Array.isArray(r.chart.annotations) && r.chart.annotations.length ? i.chart.annotations = r.chart.annotations.map((e) => s({
|
|
19
|
-
defaultConfig: j.chart.annotations[0],
|
|
20
|
-
userConfig: e
|
|
21
|
-
})) : i.chart.annotations = [], w(r, "chart.grid.position") && r.chart.grid.position === "start" && t.some((e) => e.type === "bar") && (i.chart.grid.position = "middle");
|
|
22
|
-
let a = i.theme;
|
|
23
|
-
if (!a) return {
|
|
24
|
-
...i,
|
|
25
|
-
customPalette: i.customPalette?.length ? i.customPalette : p
|
|
26
|
-
};
|
|
27
|
-
let o = s({
|
|
28
|
-
userConfig: r,
|
|
29
|
-
defaultConfig: s({
|
|
30
|
-
userConfig: A[a] || {},
|
|
31
|
-
defaultConfig: i
|
|
32
|
-
})
|
|
33
|
-
});
|
|
34
|
-
return {
|
|
35
|
-
...o,
|
|
36
|
-
customPalette: o.customPalette?.length ? o.customPalette : n[a] || p
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
function M({ dataset: e = [], config: t = {}, width: n = 1e3, height: r = 600, selectedXIndex: i, additionalSvgContent: a = "", svgTitle: o = "" } = {}) {
|
|
40
|
-
let s = ne({
|
|
41
|
-
config: t,
|
|
42
|
-
dataset: e
|
|
43
|
-
}), c = {
|
|
44
|
-
top: s.chart.padding.top,
|
|
45
|
-
left: s.chart.padding.left,
|
|
46
|
-
right: n - s.chart.padding.right,
|
|
47
|
-
bottom: r - s.chart.padding.bottom
|
|
48
|
-
};
|
|
49
|
-
c.width = c.right - c.left, c.height = c.bottom - c.top;
|
|
50
|
-
let l = e.flatMap((e) => Array.isArray(e.series) ? e.series.map((e) => Number(typeof e == "object" && e ? e.y : e)) : []).filter(Number.isFinite), u = x(Math.min(0, ...l), Math.max(1, ...l), 6), d = Math.max(0, ...e.map((e) => e.series?.length || 0)), f = (e) => d <= 1 ? c.left + c.width / 2 : c.left + e / (d - 1) * c.width, m = (e) => {
|
|
51
|
-
let t = (Number(e) - u.min) / (u.max - u.min || 1);
|
|
52
|
-
return c.bottom - t * c.height;
|
|
53
|
-
}, h = Array.isArray(s.customPalette) ? s.customPalette : [], g = h.length ? h : p;
|
|
54
|
-
return {
|
|
55
|
-
width: n,
|
|
56
|
-
height: r,
|
|
57
|
-
selectedXIndex: i,
|
|
58
|
-
dataset: e,
|
|
59
|
-
config: s,
|
|
60
|
-
drawingArea: c,
|
|
61
|
-
scale: u,
|
|
62
|
-
series: e.map((e, t) => {
|
|
63
|
-
let n = (e.color ? D(e.color) : "") || g[t % g.length], r = (e.series || []).map((e, t) => {
|
|
64
|
-
let n = e == null ? null : typeof e == "object" ? e.y ?? null : Number(e);
|
|
65
|
-
return {
|
|
66
|
-
x: f(t),
|
|
67
|
-
y: n === null || !Number.isFinite(Number(n)) ? null : m(n),
|
|
68
|
-
value: n,
|
|
69
|
-
index: t,
|
|
70
|
-
label: e?.name ?? e?.x ?? String(t)
|
|
71
|
-
};
|
|
72
|
-
});
|
|
73
|
-
return {
|
|
74
|
-
...e,
|
|
75
|
-
color: n,
|
|
76
|
-
type: e.type || "line",
|
|
77
|
-
plots: r
|
|
78
|
-
};
|
|
79
|
-
}),
|
|
80
|
-
additionalSvgContent: a,
|
|
81
|
-
svgTitle: o
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
//#endregion
|
|
85
|
-
//#region src/svg/utils/index.js
|
|
86
|
-
function N(e, t = 0) {
|
|
87
|
-
let n = Number(e);
|
|
88
|
-
return Number.isFinite(n) ? n : t;
|
|
89
|
-
}
|
|
90
|
-
function P(e) {
|
|
91
|
-
return Array.isArray(e) ? e : [];
|
|
92
|
-
}
|
|
93
|
-
function F(e) {
|
|
94
|
-
return Number.isFinite(Number(e));
|
|
95
|
-
}
|
|
96
|
-
function I(t, n = {}, r = "") {
|
|
97
|
-
let i = Object.entries(n).filter(([, e]) => e != null && e !== !1).map(([t, n]) => `${t}="${e(n)}"`).join(" ");
|
|
98
|
-
return `<${t}${i ? ` ${i}` : ""}>${r}</${t}>`;
|
|
99
|
-
}
|
|
100
|
-
function L(t, n = {}) {
|
|
101
|
-
let r = Object.entries(n).filter(([, e]) => e != null && e !== !1).map(([t, n]) => `${t}="${e(n)}"`).join(" ");
|
|
102
|
-
return `<${t}${r ? ` ${r}` : ""}/>`;
|
|
103
|
-
}
|
|
104
|
-
function R(e, t = {}) {
|
|
105
|
-
return I("text", t, g(e ?? ""));
|
|
106
|
-
}
|
|
107
|
-
function re(e) {
|
|
108
|
-
return [
|
|
109
|
-
"triangle",
|
|
110
|
-
"square",
|
|
111
|
-
"diamond",
|
|
112
|
-
"pentagon",
|
|
113
|
-
"hexagon",
|
|
114
|
-
"star"
|
|
115
|
-
].includes(e) ? e : "circle";
|
|
116
|
-
}
|
|
117
|
-
function ie({ dataCy: e, shape: t, plot: n, radius: i, fill: a, stroke: o, strokeWidth: s }) {
|
|
118
|
-
let c = re(t), l = N(n.x, 0), u = N(n.y, 0), d = N(i, 4);
|
|
119
|
-
if (c === "circle") return L("circle", {
|
|
120
|
-
"data-cy": e,
|
|
121
|
-
cx: l,
|
|
122
|
-
cy: u,
|
|
123
|
-
r: d,
|
|
124
|
-
fill: a,
|
|
125
|
-
stroke: o,
|
|
126
|
-
"stroke-width": s
|
|
127
|
-
});
|
|
128
|
-
if (c === "star") return L("polygon", {
|
|
129
|
-
"data-cy": e,
|
|
130
|
-
points: m({
|
|
131
|
-
plot: {
|
|
132
|
-
x: l,
|
|
133
|
-
y: u
|
|
134
|
-
},
|
|
135
|
-
radius: d
|
|
136
|
-
}),
|
|
137
|
-
fill: a,
|
|
138
|
-
stroke: o,
|
|
139
|
-
"stroke-width": s
|
|
140
|
-
});
|
|
141
|
-
let f = {
|
|
142
|
-
triangle: {
|
|
143
|
-
sides: 3,
|
|
144
|
-
rotation: .52
|
|
145
|
-
},
|
|
146
|
-
square: {
|
|
147
|
-
sides: 4,
|
|
148
|
-
rotation: .8
|
|
149
|
-
},
|
|
150
|
-
diamond: {
|
|
151
|
-
sides: 4,
|
|
152
|
-
rotation: 0
|
|
153
|
-
},
|
|
154
|
-
pentagon: {
|
|
155
|
-
sides: 5,
|
|
156
|
-
rotation: .95
|
|
157
|
-
},
|
|
158
|
-
hexagon: {
|
|
159
|
-
sides: 6,
|
|
160
|
-
rotation: 0
|
|
161
|
-
}
|
|
162
|
-
}[c];
|
|
163
|
-
return L("path", {
|
|
164
|
-
"data-cy": e,
|
|
165
|
-
d: r({
|
|
166
|
-
plot: {
|
|
167
|
-
x: l,
|
|
168
|
-
y: u
|
|
169
|
-
},
|
|
170
|
-
radius: d,
|
|
171
|
-
sides: f.sides,
|
|
172
|
-
rotation: f.rotation
|
|
173
|
-
}).path,
|
|
174
|
-
fill: a,
|
|
175
|
-
stroke: o,
|
|
176
|
-
"stroke-width": s
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
function z(e, t, n) {
|
|
180
|
-
let r = e;
|
|
181
|
-
for (let e of t.split(".")) {
|
|
182
|
-
if (!r || typeof r != "object" || !(e in r)) return n;
|
|
183
|
-
r = r[e];
|
|
184
|
-
}
|
|
185
|
-
return r ?? n;
|
|
186
|
-
}
|
|
187
|
-
function ae(e, t) {
|
|
188
|
-
return String(e ?? "").length * t * .58;
|
|
189
|
-
}
|
|
190
|
-
//#endregion
|
|
191
|
-
//#region src/svg/vue-ui-xy/render.js
|
|
192
|
-
function B(e) {
|
|
193
|
-
return !!z(e, "chart.grid.labels.yAxis.useIndividualScale", !1);
|
|
194
|
-
}
|
|
195
|
-
function V(e) {
|
|
196
|
-
return String(e.scaleLabel ?? e.id ?? e.name ?? "");
|
|
197
|
-
}
|
|
198
|
-
function H(e) {
|
|
199
|
-
return N(z(e, "chart.grid.labels.yAxis.labelWidth", 40), 40) + 36;
|
|
200
|
-
}
|
|
201
|
-
function oe(e) {
|
|
202
|
-
return P(e).flatMap((e) => P(e.plots)).map((e) => e?.value === null || e?.value === void 0 ? null : Number(e.value)).filter(Number.isFinite);
|
|
203
|
-
}
|
|
204
|
-
function se(e, t, n) {
|
|
205
|
-
let r = oe(n), i = z(e, "chart.grid.labels.yAxis.scaleMin", null), a = z(e, "chart.grid.labels.yAxis.scaleMax", null), o = Z(i) ? Number(i) : Math.min(0, ...r), s = Z(a) ? Number(a) : Math.max(1, ...r), c = N(z(e, "chart.grid.labels.yAxis.commonScaleSteps", 6), 6);
|
|
206
|
-
return !r.length && !Z(i) && !Z(a) ? t : Se(e, o, s === o ? o + 1 : s, c);
|
|
207
|
-
}
|
|
208
|
-
function ce(e, t) {
|
|
209
|
-
let { drawingArea: n } = e, r = N(t.__yOffset, 0), i = N(t.__individualHeight, n.height);
|
|
210
|
-
return {
|
|
211
|
-
top: n.bottom - r - i,
|
|
212
|
-
bottom: n.bottom - r
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
function le(e, t, n, r) {
|
|
216
|
-
let i = ce(e, t), a = Math.min(n.y, r), o = Math.max(n.y, r), s = Math.max(i.top, a), c = Math.min(i.bottom, o);
|
|
217
|
-
return {
|
|
218
|
-
y: s,
|
|
219
|
-
height: Math.max(1e-5, c - s)
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
function U(e, t) {
|
|
223
|
-
let n = {};
|
|
224
|
-
return P(t).forEach((t, r) => {
|
|
225
|
-
let i = V(t) || `serie_${r}`, a = P(t.plots).map((e) => Number(e.value)).filter(Number.isFinite);
|
|
226
|
-
n[i] || (n[i] = {
|
|
227
|
-
scaleLabel: i,
|
|
228
|
-
name: t.name ?? i,
|
|
229
|
-
color: z(e, "chart.grid.labels.yAxis.groupColor", null) || t.color,
|
|
230
|
-
series: [],
|
|
231
|
-
values: []
|
|
232
|
-
}), n[i].series.push(t), n[i].values.push(...a);
|
|
233
|
-
}), Object.values(n).forEach((t) => {
|
|
234
|
-
t.scale = Ce(e, {
|
|
235
|
-
...t.series[0],
|
|
236
|
-
plots: t.series.flatMap((e) => P(e.plots))
|
|
237
|
-
});
|
|
238
|
-
}), n;
|
|
239
|
-
}
|
|
240
|
-
function ue(e, t, n, r, i, a) {
|
|
241
|
-
return !i && !a ? r : n[V(t)]?.scale ?? Ce(e, t);
|
|
242
|
-
}
|
|
243
|
-
function de(e) {
|
|
244
|
-
return e === "bar" || e === "line" || e === "plot" ? e : "line";
|
|
245
|
-
}
|
|
246
|
-
function fe(e) {
|
|
247
|
-
return P(e.series).map((e) => ({
|
|
248
|
-
...e,
|
|
249
|
-
type: de(e.type),
|
|
250
|
-
plots: P(e.plots).filter((e) => e && F(e.x))
|
|
251
|
-
}));
|
|
252
|
-
}
|
|
253
|
-
function W(e) {
|
|
254
|
-
let { drawingArea: t, scale: n } = e, r = (0 - n.min) / (n.max - n.min || 1);
|
|
255
|
-
return t.bottom - r * t.height;
|
|
256
|
-
}
|
|
257
|
-
function G(e) {
|
|
258
|
-
return e.uniqueId ?? "ssr";
|
|
259
|
-
}
|
|
260
|
-
function K(e, t, n) {
|
|
261
|
-
return `rectGradient_${n}_${t}_${G(e)}`;
|
|
262
|
-
}
|
|
263
|
-
function pe(e, t) {
|
|
264
|
-
return `lineGradient_${t}_${G(e)}`;
|
|
265
|
-
}
|
|
266
|
-
function me(e, t) {
|
|
267
|
-
return `temperature_grad_line_${t}_${G(e)}`;
|
|
268
|
-
}
|
|
269
|
-
function he(e, t, n) {
|
|
270
|
-
return t.temperatureColors && !t.isFlatTemperatureLine ? `url(#${me(e, n)})` : t.color;
|
|
271
|
-
}
|
|
272
|
-
function ge(e, t) {
|
|
273
|
-
return `plotGradient_${t}_${G(e)}`;
|
|
274
|
-
}
|
|
275
|
-
function _e(e, t, n) {
|
|
276
|
-
let { config: r } = e;
|
|
277
|
-
return z(r, "line.useGradient", !1) ? `url(#${pe(e, n)})` : z(r, "line.dot.useSerieColor", !0) ? t.color : z(r, "line.dot.fill", "#FFFFFF");
|
|
278
|
-
}
|
|
279
|
-
function ve(e, t, n) {
|
|
280
|
-
let { config: r } = e;
|
|
281
|
-
return z(r, "line.area.useGradient", !1) ? `url(#${Je(e, n)})` : h(t.color, N(z(r, "line.area.opacity", 30), 30));
|
|
282
|
-
}
|
|
283
|
-
function ye(e, t, n, r) {
|
|
284
|
-
return z(e.config, "bar.useGradient", !1) ? r >= 0 ? `url(#${K(e, n, "pos")})` : `url(#${K(e, n, "neg")})` : t.color;
|
|
285
|
-
}
|
|
286
|
-
function be(e, t) {
|
|
287
|
-
let { config: n } = e, r = [];
|
|
288
|
-
return z(n, "bar.useGradient", !1) && t.filter((e) => e.type === "bar").forEach((t, n) => {
|
|
289
|
-
r.push(I("linearGradient", {
|
|
290
|
-
id: K(e, n, "pos"),
|
|
291
|
-
x2: "0%",
|
|
292
|
-
y2: "100%"
|
|
293
|
-
}, [
|
|
294
|
-
L("stop", {
|
|
295
|
-
offset: "0%",
|
|
296
|
-
"stop-color": D(t.color)
|
|
297
|
-
}),
|
|
298
|
-
L("stop", {
|
|
299
|
-
offset: "62%",
|
|
300
|
-
"stop-color": a(D(t.color), .02)
|
|
301
|
-
}),
|
|
302
|
-
L("stop", {
|
|
303
|
-
offset: "100%",
|
|
304
|
-
"stop-color": a(D(t.color), .05)
|
|
305
|
-
})
|
|
306
|
-
].join(""))), r.push(I("linearGradient", {
|
|
307
|
-
id: K(e, n, "neg"),
|
|
308
|
-
x2: "0%",
|
|
309
|
-
y2: "100%"
|
|
310
|
-
}, [
|
|
311
|
-
L("stop", {
|
|
312
|
-
offset: "0%",
|
|
313
|
-
"stop-color": a(D(t.color), .05)
|
|
314
|
-
}),
|
|
315
|
-
L("stop", {
|
|
316
|
-
offset: "38%",
|
|
317
|
-
"stop-color": a(D(t.color), .02)
|
|
318
|
-
}),
|
|
319
|
-
L("stop", {
|
|
320
|
-
offset: "100%",
|
|
321
|
-
"stop-color": D(t.color)
|
|
322
|
-
})
|
|
323
|
-
].join("")));
|
|
324
|
-
}), t.filter((e) => e.type === "line").forEach((t, i) => {
|
|
325
|
-
z(n, "line.useGradient", !1) && r.push(I("radialGradient", {
|
|
326
|
-
id: pe(e, i),
|
|
327
|
-
cx: "50%",
|
|
328
|
-
cy: "50%",
|
|
329
|
-
r: "50%",
|
|
330
|
-
fx: "50%",
|
|
331
|
-
fy: "50%"
|
|
332
|
-
}, [L("stop", {
|
|
333
|
-
offset: "0%",
|
|
334
|
-
"stop-color": a(D(t.color), .05)
|
|
335
|
-
}), L("stop", {
|
|
336
|
-
offset: "100%",
|
|
337
|
-
"stop-color": D(t.color)
|
|
338
|
-
})].join(""))), t.temperatureColors && !t.isFlatTemperatureLine && r.push(I("linearGradient", {
|
|
339
|
-
id: me(e, i),
|
|
340
|
-
gradientTransform: "rotate(90)"
|
|
341
|
-
}, t.temperatureColors.map((e, n) => L("stop", {
|
|
342
|
-
offset: d(n, t.temperatureColors.length),
|
|
343
|
-
"stop-color": D(e)
|
|
344
|
-
})).join("")));
|
|
345
|
-
}), t.filter((e) => e.type === "plot").forEach((t, i) => {
|
|
346
|
-
z(n, "plot.useGradient", !1) && r.push(I("radialGradient", {
|
|
347
|
-
id: ge(e, i),
|
|
348
|
-
cx: "50%",
|
|
349
|
-
cy: "50%",
|
|
350
|
-
r: "50%",
|
|
351
|
-
fx: "50%",
|
|
352
|
-
fy: "50%"
|
|
353
|
-
}, [L("stop", {
|
|
354
|
-
offset: "0%",
|
|
355
|
-
"stop-color": a(D(t.color), .05)
|
|
356
|
-
}), L("stop", {
|
|
357
|
-
offset: "100%",
|
|
358
|
-
"stop-color": D(t.color)
|
|
359
|
-
})].join("")));
|
|
360
|
-
}), r.length ? I("defs", { "data-layer": "gradients" }, r.join("")) : "";
|
|
361
|
-
}
|
|
362
|
-
function xe(e) {
|
|
363
|
-
let t = z(e.config, "chart.backgroundColor", "#FFFFFF");
|
|
364
|
-
return L("rect", {
|
|
365
|
-
width: e.width,
|
|
366
|
-
height: e.height,
|
|
367
|
-
fill: t
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
function q(e) {
|
|
371
|
-
return {
|
|
372
|
-
dataLabels: N(z(e, "chart.grid.labels.fontSize", 12), 12),
|
|
373
|
-
xAxis: N(z(e, "chart.grid.labels.xAxisLabels.fontSize", 12), 12),
|
|
374
|
-
yAxis: N(z(e, "chart.grid.labels.axis.fontSize", 12), 12)
|
|
375
|
-
};
|
|
376
|
-
}
|
|
377
|
-
function J(e) {
|
|
378
|
-
return z(e, "chart.grid.labels.yAxis.position", "left") === "right";
|
|
379
|
-
}
|
|
380
|
-
function Y(e, t) {
|
|
381
|
-
let n = o({
|
|
382
|
-
p: z(t, "chart.labels.prefix", ""),
|
|
383
|
-
v: e,
|
|
384
|
-
s: z(t, "chart.labels.suffix", ""),
|
|
385
|
-
r: z(t, "chart.grid.labels.yAxis.rounding", 0)
|
|
386
|
-
});
|
|
387
|
-
return S(z(t, "chart.grid.labels.yAxis.formatter", null), e, n, t);
|
|
388
|
-
}
|
|
389
|
-
function X(e) {
|
|
390
|
-
return !!z(e, "chart.grid.labels.yAxis.stacked", !1);
|
|
391
|
-
}
|
|
392
|
-
function Z(e) {
|
|
393
|
-
return e != null && Number.isFinite(Number(e));
|
|
394
|
-
}
|
|
395
|
-
function Se(e, t, n, r) {
|
|
396
|
-
return z(e, "chart.grid.labels.yAxis.useNiceScale", !0) ? x(t, n, r) : ee(t, n, r);
|
|
397
|
-
}
|
|
398
|
-
function Ce(e, t) {
|
|
399
|
-
let n = P(t.plots).map((e) => Number(e.value)).filter(Number.isFinite), r = z(e, "chart.grid.labels.yAxis.scaleMin", null), i = z(e, "chart.grid.labels.yAxis.scaleMax", null), a = Z(r) ? Number(r) : Z(t.scaleMin) ? Number(t.scaleMin) : Math.min(0, ...n), o = Z(i) ? Number(i) : Z(t.scaleMax) ? Number(t.scaleMax) : Math.max(1, ...n);
|
|
400
|
-
return Se(e, a, o === a ? a + 1 : o, N(t.scaleSteps ?? z(e, "chart.grid.labels.yAxis.commonScaleSteps", 6), 6));
|
|
401
|
-
}
|
|
402
|
-
function we(e, t, n = []) {
|
|
403
|
-
let r = q(e), i = X(e), a = B(e), o = H(e);
|
|
404
|
-
if (a && !i) {
|
|
405
|
-
let t = Object.keys(U(e, n)).length;
|
|
406
|
-
return {
|
|
407
|
-
left: J(e) ? 0 : t * o,
|
|
408
|
-
right: J(e) ? t * o : 0,
|
|
409
|
-
scaleLabelsOffset: t * o,
|
|
410
|
-
yAxisLabelWidth: 0
|
|
411
|
-
};
|
|
412
|
-
}
|
|
413
|
-
if (a && i) return {
|
|
414
|
-
left: J(e) ? 0 : o,
|
|
415
|
-
right: J(e) ? o : 0,
|
|
416
|
-
scaleLabelsOffset: o,
|
|
417
|
-
yAxisLabelWidth: 0
|
|
418
|
-
};
|
|
419
|
-
let s = (i ? n.flatMap((t) => Ce(e, t).ticks) : P(t.ticks)).reduce((t, n) => Math.max(t, ae(Y(n, e), r.dataLabels)), 0), c = z(e, "chart.grid.labels.axis.yLabel", "") ? r.yAxis * 2 + 24 + N(z(e, "chart.grid.labels.axis.yLabelOffsetX", 0), 0) + r.yAxis : 0, l = s + N(z(e, "chart.grid.labels.yAxis.scaleValueOffsetX", 0), 0) + N(z(e, "chart.grid.labels.yAxis.crosshairSize", 0), 0);
|
|
420
|
-
return {
|
|
421
|
-
left: J(e) ? 0 : l + c,
|
|
422
|
-
right: J(e) ? l + c : 0,
|
|
423
|
-
scaleLabelsOffset: l,
|
|
424
|
-
yAxisLabelWidth: c
|
|
425
|
-
};
|
|
426
|
-
}
|
|
427
|
-
function Te(e, t) {
|
|
428
|
-
let { config: n, scale: r, width: i, height: a } = e, o = q(n), s = e.drawingArea, c = we(n, r, t), l = z(n, "chart.legend.position", "bottom"), u = z(n, "chart.legend.show", !0), d = u ? Ke({
|
|
429
|
-
...e,
|
|
430
|
-
width: i,
|
|
431
|
-
height: a
|
|
432
|
-
}, t) : { height: 0 }, f = u && l === "top" ? d.height : 0, p = u && l !== "top" ? d.height : 0, m = z(n, "chart.grid.labels.axis.xLabel", ""), h = z(n, "chart.grid.labels.xAxisLabels.show", !0) ? o.xAxis * 2 : 0, g = (m ? o.yAxis * 1.5 : 0) + h + o.xAxis, _ = ct(n) + N(z(n, "chart.labels.fontSize", 12), 12) * 1.1, v = N(z(n, "chart.padding.top", 12), 12), b = N(z(n, "chart.padding.right", 12), 12), ee = N(z(n, "chart.padding.bottom", 12), 12), x = N(z(n, "chart.padding.left", 12), 12), S = N(z(n, "chart.grid.labels.axis.xLabelOffsetY", 0), 0), te = N(z(n, "chart.grid.labels.yAxis.crosshairSize", 0), 0), C = c.left, w = c.right, T = i - C - w - 6 - x - b, E = {
|
|
433
|
-
top: v + _ + f,
|
|
434
|
-
right: C + (J(n) ? 0 : te) + x + T,
|
|
435
|
-
bottom: a - g - ee - S - p,
|
|
436
|
-
left: C + (J(n) ? 0 : te) + x,
|
|
437
|
-
width: Math.max(1, T),
|
|
438
|
-
height: 1,
|
|
439
|
-
scaleLabelX: C,
|
|
440
|
-
rightScaleLabelX: w,
|
|
441
|
-
scaleLabelsOffset: c.scaleLabelsOffset,
|
|
442
|
-
yAxisLabelWidth: c.yAxisLabelWidth,
|
|
443
|
-
individualOffsetX: 36
|
|
444
|
-
};
|
|
445
|
-
E.height = Math.max(1, E.bottom - E.top);
|
|
446
|
-
function D(e) {
|
|
447
|
-
let t = (e - s.left) / (s.width || 1);
|
|
448
|
-
return E.left + t * E.width;
|
|
449
|
-
}
|
|
450
|
-
let O = X(n), k = O ? y(t) : t, A = Math.max(1, k.length), j = O ? N(z(n, "chart.grid.labels.yAxis.gap", 12), 12) : 0, ne = j * Math.max(0, A - 1), M = Math.max(1, E.height - ne), F = B(n), I = U(n, t), L = Math.max(1, ...t.map((e) => P(e.plots).length));
|
|
451
|
-
function R(t, n) {
|
|
452
|
-
return Q(e) ? D(t.x) : $({
|
|
453
|
-
...e,
|
|
454
|
-
drawingArea: E
|
|
455
|
-
}, t.index ?? n, L);
|
|
456
|
-
}
|
|
457
|
-
let re = t.map((e, t) => {
|
|
458
|
-
let i = e.id !== void 0 && e.id !== null ? k.find((t) => t.id === e.id) ?? k[t] ?? e : k[t] ?? e, a = ue(n, e, I, r, F, O), o = N(i.stackIndex, t), s = N(i.stackRatio, 1 / A), c = N(i.cumulatedStackRatio, s * (o + 1)), l = A - 1 - o, u = O ? 1 - c : 0, d = O ? M * u + j * l : 0, f = O ? M * s : E.height;
|
|
459
|
-
function p(e) {
|
|
460
|
-
let t = (e - a.min) / (a.max - a.min || 1);
|
|
461
|
-
return E.bottom - d - t * f;
|
|
462
|
-
}
|
|
463
|
-
let m = p(0);
|
|
464
|
-
return {
|
|
465
|
-
...e,
|
|
466
|
-
__scale: a,
|
|
467
|
-
__yOffset: d,
|
|
468
|
-
__individualHeight: f,
|
|
469
|
-
__zeroY: m,
|
|
470
|
-
__scaleYLabels: P(a.ticks).map((t) => ({
|
|
471
|
-
value: t,
|
|
472
|
-
y: p(t),
|
|
473
|
-
serie: e
|
|
474
|
-
})),
|
|
475
|
-
plots: e.plots.map((e, t) => {
|
|
476
|
-
let n = e.value === null || e.value === void 0 ? null : Number(e.value);
|
|
477
|
-
return {
|
|
478
|
-
...e,
|
|
479
|
-
value: n,
|
|
480
|
-
x: R(e, t),
|
|
481
|
-
y: n === null || !Number.isFinite(n) ? null : p(n)
|
|
482
|
-
};
|
|
483
|
-
})
|
|
484
|
-
};
|
|
485
|
-
});
|
|
486
|
-
return {
|
|
487
|
-
...e,
|
|
488
|
-
drawingArea: E,
|
|
489
|
-
series: re,
|
|
490
|
-
__scaleGroups: I,
|
|
491
|
-
__useIndividualScale: F
|
|
492
|
-
};
|
|
493
|
-
}
|
|
494
|
-
function Ee(e) {
|
|
495
|
-
let { config: t, drawingArea: n, scale: r, series: i } = e;
|
|
496
|
-
if (!z(t, "chart.grid.labels.show", !0) || !z(t, "chart.grid.labels.yAxis.show", !0)) return "";
|
|
497
|
-
let a = B(t), o = X(t);
|
|
498
|
-
if (a) return De(e);
|
|
499
|
-
let s = q(t), c = J(t), l = z(t, "chart.grid.labels.yAxis.showCrosshairs", !1), u = N(z(t, "chart.grid.labels.yAxis.crosshairSize", 0), 0), d = N(z(t, "chart.grid.labels.yAxis.scaleValueOffsetX", 0), 0), f = z(t, "chart.grid.labels.color", "#2A2A2A"), p = z(t, "chart.grid.stroke", "#CCCCCC"), m = o ? i.flatMap((e) => P(e.__scaleYLabels)) : P(r.ticks).map((e) => {
|
|
500
|
-
let t = (e - r.min) / (r.max - r.min || 1);
|
|
501
|
-
return {
|
|
502
|
-
value: e,
|
|
503
|
-
y: n.bottom - t * n.height
|
|
504
|
-
};
|
|
505
|
-
}), h = [];
|
|
506
|
-
return m.forEach((e) => {
|
|
507
|
-
Number.isFinite(e.y) && (l && h.push(L("line", {
|
|
508
|
-
"data-cy": "axis-y-tick",
|
|
509
|
-
x1: c ? n.right : n.left,
|
|
510
|
-
x2: c ? n.right + u : n.left - u,
|
|
511
|
-
y1: e.y,
|
|
512
|
-
y2: e.y,
|
|
513
|
-
stroke: p,
|
|
514
|
-
"stroke-width": 1,
|
|
515
|
-
"stroke-linecap": "round"
|
|
516
|
-
})), h.push(R(Y(e.value, t), {
|
|
517
|
-
"data-cy": "axis-y-label",
|
|
518
|
-
transform: `translate(${c ? n.right + u + d + 5 : n.scaleLabelX - u}, ${e.y + s.dataLabels / 3})`,
|
|
519
|
-
"font-size": s.dataLabels,
|
|
520
|
-
"text-anchor": c ? "start" : "end",
|
|
521
|
-
fill: o && e.serie?.color ? z(t, "chart.grid.labels.yAxis.groupColor", null) || e.serie.color : f
|
|
522
|
-
})));
|
|
523
|
-
}), I("g", { "data-layer": "scale-labels" }, h.join(""));
|
|
524
|
-
}
|
|
525
|
-
function De(e) {
|
|
526
|
-
let { config: t, drawingArea: n, series: r } = e, i = q(t), a = J(t), o = X(t), s = e.__scaleGroups ?? U(t, r), c = z(t, "chart.grid.labels.yAxis.showCrosshairs", !1), l = N(z(t, "chart.grid.labels.yAxis.crosshairSize", 0), 0), u = N(z(t, "chart.grid.labels.yAxis.scaleValueOffsetX", 0), 0), d = N(z(t, "chart.grid.labels.yAxis.labelWidth", 40), 40), f = N(n.individualOffsetX, 36), p = [], m = Object.values(s);
|
|
527
|
-
return m.forEach((e, s) => {
|
|
528
|
-
let h = r.find((t) => V(t) === e.scaleLabel) ?? r[s];
|
|
529
|
-
if (!h) return;
|
|
530
|
-
let g = o ? a ? n.right : n.left : a ? n.right + H(t) * s : n.left - H(t) * (m.length - s - 1), _ = N(h.__yOffset, 0), v = N(h.__individualHeight, n.height), y = o ? n.bottom - _ - v : n.top, b = o ? n.bottom - _ : n.bottom;
|
|
531
|
-
p.push(L("line", {
|
|
532
|
-
x1: o || a ? g : g - f,
|
|
533
|
-
x2: o || a ? g : g - f,
|
|
534
|
-
y1: y,
|
|
535
|
-
y2: b,
|
|
536
|
-
stroke: e.color,
|
|
537
|
-
"stroke-width": z(t, "chart.grid.strokeWidth", 1),
|
|
538
|
-
"stroke-linecap": "round"
|
|
539
|
-
}));
|
|
540
|
-
let ee = o ? a ? n.right + l + u + 5 + d + f : n.left - l - u - d : a ? g + l + u + 5 + d : g - i.dataLabels / 2;
|
|
541
|
-
p.push(R(e.name, {
|
|
542
|
-
transform: `translate(${ee}, ${y + (b - y) / 2}) rotate(-90)`,
|
|
543
|
-
"font-size": i.dataLabels * .8,
|
|
544
|
-
"text-anchor": "middle",
|
|
545
|
-
fill: e.color
|
|
546
|
-
})), P(e.scale.ticks).forEach((r) => {
|
|
547
|
-
let s = b - (r - e.scale.min) / (e.scale.max - e.scale.min || 1) * (b - y);
|
|
548
|
-
Number.isFinite(s) && (c && p.push(L("line", {
|
|
549
|
-
"data-cy": "axis-y-tick",
|
|
550
|
-
x1: o || a ? g : g + 3 - l - f,
|
|
551
|
-
x2: o ? a ? g + l : g - l : a ? g + l : g - f,
|
|
552
|
-
y1: s,
|
|
553
|
-
y2: s,
|
|
554
|
-
stroke: e.color,
|
|
555
|
-
"stroke-width": 1,
|
|
556
|
-
"stroke-linecap": "round"
|
|
557
|
-
})), p.push(R(Y(r, t), {
|
|
558
|
-
"data-cy": "axis-y-label",
|
|
559
|
-
transform: `translate(${o ? a ? n.right + l + u + 5 : n.left - l - u - 5 : a ? g + l + u + 5 : g - 5 - f}, ${s + i.dataLabels / 3})`,
|
|
560
|
-
"font-size": i.dataLabels,
|
|
561
|
-
"text-anchor": a ? "start" : "end",
|
|
562
|
-
fill: e.color
|
|
563
|
-
})));
|
|
564
|
-
});
|
|
565
|
-
}), I("g", { "data-layer": "individual-scale-labels" }, p.join(""));
|
|
566
|
-
}
|
|
567
|
-
function Oe(e, t) {
|
|
568
|
-
let { config: n, drawingArea: r } = e, i = X(n), a = t.filter((e) => e.type === "bar");
|
|
569
|
-
if (!a.length) return "";
|
|
570
|
-
let o = Math.max(1, ...t.map((e) => P(e.plots).length)), s = r.width / o, c = N(z(n, "bar.periodGap", .2), .2), l = N(z(n, "bar.innerGap", .05), .05), u = z(n, "bar.borderRadius", 0), d = [];
|
|
571
|
-
if (i) {
|
|
572
|
-
let t = Math.max(1e-5, s * .9), n = t * Math.min(Math.abs(l), .95);
|
|
573
|
-
return a.forEach((i, a) => {
|
|
574
|
-
let o = Number.isFinite(Number(i.__zeroY)) ? Number(i.__zeroY) : W(e);
|
|
575
|
-
P(i.plots).forEach((c, l) => {
|
|
576
|
-
if (!c || c.value === null || c.value === void 0 || !Number.isFinite(Number(c.value)) || !Number.isFinite(Number(c.y))) return;
|
|
577
|
-
let f = r.left + s * l + s * .05 + n / 2, { y: p, height: m } = le(e, i, c, o);
|
|
578
|
-
c.__barLabelX = f + Math.max(1e-5, t - n) / 2, d.push(L("rect", {
|
|
579
|
-
"data-cy": "datapoint-bar",
|
|
580
|
-
x: f,
|
|
581
|
-
y: p,
|
|
582
|
-
width: Math.max(1e-5, t - n),
|
|
583
|
-
height: m,
|
|
584
|
-
rx: u,
|
|
585
|
-
fill: ye(e, i, a, Number(c.value)),
|
|
586
|
-
...tt(e, i)
|
|
587
|
-
}));
|
|
588
|
-
});
|
|
589
|
-
}), I("g", { "data-layer": "bars" }, d.join(""));
|
|
590
|
-
}
|
|
591
|
-
let f = s * (1 - c), p = f / Math.max(1, a.length), m = p * Math.min(Math.abs(l), .95);
|
|
592
|
-
return W(e), a.forEach((t, n) => {
|
|
593
|
-
let i = Number.isFinite(Number(t.__zeroY)) ? Number(t.__zeroY) : W(e);
|
|
594
|
-
P(t.plots).forEach((a, o) => {
|
|
595
|
-
if (!a || a.value === null || a.value === void 0 || !Number.isFinite(Number(a.value)) || !Number.isFinite(Number(a.y))) return;
|
|
596
|
-
let c = r.left + s * o + (s - f) / 2 + p * n + m / 2, { y: l, height: h } = le(e, t, a, i);
|
|
597
|
-
a.__barLabelX = c + Math.max(1e-5, p - m) / 2, d.push(L("rect", {
|
|
598
|
-
"data-cy": "datapoint-bar",
|
|
599
|
-
x: c,
|
|
600
|
-
y: l,
|
|
601
|
-
width: Math.max(1e-5, p - m),
|
|
602
|
-
height: h,
|
|
603
|
-
rx: u,
|
|
604
|
-
fill: ye(e, t, n, Number(a.value)),
|
|
605
|
-
...tt(e, t)
|
|
606
|
-
}));
|
|
607
|
-
});
|
|
608
|
-
}), I("g", { "data-layer": "bars" }, d.join(""));
|
|
609
|
-
}
|
|
610
|
-
function ke(e) {
|
|
611
|
-
let { config: t, drawingArea: n, scale: r, series: i } = e;
|
|
612
|
-
return B(t) || X(t) ? i.flatMap((e) => P(e.__scaleYLabels)) : P(r.ticks).map((e) => {
|
|
613
|
-
let t = (e - r.min) / (r.max - r.min || 1);
|
|
614
|
-
return {
|
|
615
|
-
value: e,
|
|
616
|
-
y: n.bottom - t * n.height
|
|
617
|
-
};
|
|
618
|
-
});
|
|
619
|
-
}
|
|
620
|
-
function Ae(e, t, n) {
|
|
621
|
-
let { drawingArea: r } = e, i = r.width / Math.max(1, n);
|
|
622
|
-
return r.left + i * t;
|
|
623
|
-
}
|
|
624
|
-
function je(e, t) {
|
|
625
|
-
let { config: n, drawingArea: r } = e, i = Math.max(1, ...t.map((e) => P(e.plots).length)), a = r.top, o = r.bottom;
|
|
626
|
-
if (Q(e)) {
|
|
627
|
-
let e = [...new Set(t.flatMap((e) => P(e.plots)).map((e) => Number(e.x)).filter(Number.isFinite))].sort((e, t) => e - t);
|
|
628
|
-
return e.length ? z(n, "chart.grid.position", "middle") === "middle" ? e.map((e, t, n) => {
|
|
629
|
-
if (t === 0) return null;
|
|
630
|
-
let r = n[t - 1], i = r + (e - r) / 2;
|
|
631
|
-
return `M${i},${a} L${i},${o}`;
|
|
632
|
-
}).filter(Boolean).join(" ") : e.map((e) => `M${e},${a} L${e},${o}`).join(" ") : "";
|
|
633
|
-
}
|
|
634
|
-
let s = i + +(z(n, "chart.grid.position", "middle") === "middle");
|
|
635
|
-
return Array.from({ length: s }).map((t, r) => {
|
|
636
|
-
let s = z(n, "chart.grid.position", "middle") === "middle" ? Ae(e, r, i) : $(e, r, i);
|
|
637
|
-
return `M${s},${a} L${s},${o}`;
|
|
638
|
-
}).join(" ");
|
|
639
|
-
}
|
|
640
|
-
function Me(e) {
|
|
641
|
-
let { config: t, drawingArea: n, scale: r, series: i } = e, a = z(t, "chart.grid.show", !0), o = z(t, "chart.grid.showHorizontalLines", !0), s = z(t, "chart.grid.showVerticalLines", !1), c = z(t, "chart.grid.stroke", "#CCCCCC"), l = N(z(t, "chart.grid.strokeWidth", .5), .5), u = [];
|
|
642
|
-
if (a && o && ke(e).forEach((e) => {
|
|
643
|
-
Number.isFinite(Number(e.y)) && u.push(L("line", {
|
|
644
|
-
"data-cy": "xy-grid-horizontal-line",
|
|
645
|
-
x1: n.left,
|
|
646
|
-
x2: n.right,
|
|
647
|
-
y1: e.y,
|
|
648
|
-
y2: e.y,
|
|
649
|
-
stroke: c,
|
|
650
|
-
"stroke-width": l,
|
|
651
|
-
"stroke-linecap": "round"
|
|
652
|
-
}));
|
|
653
|
-
}), a && s) {
|
|
654
|
-
let t = je(e, i);
|
|
655
|
-
t && u.push(L("path", {
|
|
656
|
-
"data-cy": "xy-grid-vertical-line",
|
|
657
|
-
d: t,
|
|
658
|
-
stroke: c,
|
|
659
|
-
"stroke-width": l,
|
|
660
|
-
"stroke-linecap": "round"
|
|
661
|
-
}));
|
|
662
|
-
}
|
|
663
|
-
u.push(L("line", {
|
|
664
|
-
x1: n.left,
|
|
665
|
-
y1: n.bottom,
|
|
666
|
-
x2: n.right,
|
|
667
|
-
y2: n.bottom,
|
|
668
|
-
stroke: c,
|
|
669
|
-
"stroke-width": l,
|
|
670
|
-
"stroke-linecap": "round"
|
|
671
|
-
}));
|
|
672
|
-
let d = J(t) ? n.right : n.left;
|
|
673
|
-
return u.push(L("line", {
|
|
674
|
-
x1: d,
|
|
675
|
-
y1: n.top,
|
|
676
|
-
x2: d,
|
|
677
|
-
y2: n.bottom,
|
|
678
|
-
stroke: c,
|
|
679
|
-
"stroke-width": l,
|
|
680
|
-
"stroke-linecap": "round"
|
|
681
|
-
})), r.min < 0 && r.max > 0 && u.push(L("line", {
|
|
682
|
-
x1: n.left,
|
|
683
|
-
y1: W(e),
|
|
684
|
-
x2: n.right,
|
|
685
|
-
y2: W(e),
|
|
686
|
-
stroke: c,
|
|
687
|
-
"stroke-width": l,
|
|
688
|
-
"stroke-dasharray": 4,
|
|
689
|
-
"stroke-linecap": "round"
|
|
690
|
-
})), I("g", { "data-layer": "grid" }, u.join(""));
|
|
691
|
-
}
|
|
692
|
-
function Ne(e) {
|
|
693
|
-
return e && typeof e == "object" && Number.isFinite(Number(e.x)) && Number.isFinite(Number(e.y));
|
|
694
|
-
}
|
|
695
|
-
function Q(e) {
|
|
696
|
-
return P(e.series).some((e) => P(e.series).some(Ne));
|
|
697
|
-
}
|
|
698
|
-
function $(e, t, n) {
|
|
699
|
-
let { drawingArea: r, config: i } = e, a = z(i, "chart.grid.position", "middle"), o = r.width, s = a === "middle" ? o / Math.max(1, n) : o / Math.max(1, n - 1);
|
|
700
|
-
return a === "middle" ? r.left + s / 2 + s * t : r.left + s * t;
|
|
701
|
-
}
|
|
702
|
-
function Pe(e) {
|
|
703
|
-
let t = P(e.series).flatMap((e) => P(e.series)).filter(Ne).map((e) => Number(e.x));
|
|
704
|
-
if (!t.length) return {
|
|
705
|
-
min: 0,
|
|
706
|
-
max: 1
|
|
707
|
-
};
|
|
708
|
-
let n = Math.min(...t), r = Math.max(...t);
|
|
709
|
-
return n === r ? {
|
|
710
|
-
min: n - 1,
|
|
711
|
-
max: r + 1
|
|
712
|
-
} : {
|
|
713
|
-
min: n,
|
|
714
|
-
max: r
|
|
715
|
-
};
|
|
716
|
-
}
|
|
717
|
-
function Fe(e, t) {
|
|
718
|
-
let { drawingArea: n, config: r } = e, i = Pe(e), a = (Number(t) - i.min) / (i.max - i.min || 1), o = z(r, "chart.grid.labels.xAxis.reverse", !1) ? 1 - a : a;
|
|
719
|
-
return n.left + n.width * o;
|
|
720
|
-
}
|
|
721
|
-
function Ie(e, t, n) {
|
|
722
|
-
let { config: r } = e;
|
|
723
|
-
return o({
|
|
724
|
-
v: t,
|
|
725
|
-
s: z(r, "chart.labels.prefix", ""),
|
|
726
|
-
p: z(r, "chart.labels.suffix", ""),
|
|
727
|
-
r: z(r, "chart.grid.labels.xAxis.rounding", 0)
|
|
728
|
-
});
|
|
729
|
-
}
|
|
730
|
-
function Le(e) {
|
|
731
|
-
let { scale: t, config: n } = e, r = P(t?.ticks);
|
|
732
|
-
return (z(n, "chart.grid.labels.xAxis.reverse", !1) ? [...r].reverse() : r).map((t, n) => ({
|
|
733
|
-
id: `continuous_x_label_${n}`,
|
|
734
|
-
text: Ie(e, t, n),
|
|
735
|
-
value: t,
|
|
736
|
-
x: Fe(e, t),
|
|
737
|
-
index: n,
|
|
738
|
-
absoluteIndex: n
|
|
739
|
-
}));
|
|
740
|
-
}
|
|
741
|
-
async function Re(e, t) {
|
|
742
|
-
let { config: n } = e, r = Math.max(0, ...t.map((e) => P(e.plots).length));
|
|
743
|
-
return await O({
|
|
744
|
-
values: z(n, "chart.grid.labels.xAxisLabels.values", []),
|
|
745
|
-
maxDatapoints: r,
|
|
746
|
-
formatter: z(n, "chart.grid.labels.xAxisLabels.datetimeFormatter", null),
|
|
747
|
-
start: N(e.slotStartIndex ?? e.startAbs, 0),
|
|
748
|
-
end: N(e.slotEndIndex ?? e.endAbs, r)
|
|
749
|
-
});
|
|
750
|
-
}
|
|
751
|
-
async function ze(e, t) {
|
|
752
|
-
let { config: n } = e, r = z(n, "chart.grid.labels.xAxisLabels", {}), i = Math.max(0, ...t.map((e) => P(e.plots).length)), a = await Re(e, t), o = await O({
|
|
753
|
-
values: z(n, "chart.grid.labels.xAxisLabels.values", []),
|
|
754
|
-
maxDatapoints: i,
|
|
755
|
-
formatter: z(n, "chart.grid.labels.xAxisLabels.datetimeFormatter", null),
|
|
756
|
-
start: 0,
|
|
757
|
-
end: i
|
|
758
|
-
}), s = a.map((e) => e?.text ?? ""), c = o.map((e) => e?.text ?? ""), l = Math.min(N(r.modulo, 1), Math.max(1, new Set(s).size));
|
|
759
|
-
return T(!!r.showOnlyFirstAndLast, !!r.showOnlyAtModulo, Math.max(1, l || 1), s, c, N(e.slotStartIndex ?? e.startAbs, 0), e.selectedXIndex ?? null, i);
|
|
760
|
-
}
|
|
761
|
-
async function Be(e, t) {
|
|
762
|
-
return Q(e) ? Le(e) : await ze(e, t);
|
|
763
|
-
}
|
|
764
|
-
function Ve(e, t, n, r) {
|
|
765
|
-
return Q(e) ? t.x : $(e, n, r);
|
|
766
|
-
}
|
|
767
|
-
function He(e) {
|
|
768
|
-
return w(e.userConfig ?? e.sourceConfig ?? e.props?.config ?? {}, "chart.grid.labels.xAxisLabels.rotation") ? N(z(e.config, "chart.grid.labels.xAxisLabels.rotation", 0), 0) : z(e.config, "chart.grid.labels.xAxisLabels.autoRotate.enable", !1) ? N(z(e.config, "chart.grid.labels.xAxisLabels.autoRotate.angle", 0), 0) : N(z(e.config, "chart.grid.labels.xAxisLabels.rotation", 0), 0);
|
|
769
|
-
}
|
|
770
|
-
async function Ue(e, n) {
|
|
771
|
-
let { config: r, drawingArea: i } = e;
|
|
772
|
-
if (!n[0] || !z(r, "chart.grid.labels.xAxisLabels.show", !0)) return "";
|
|
773
|
-
z(r, "chart.grid.labels.xAxisLabels", {});
|
|
774
|
-
let a = N(z(r, "chart.grid.labels.xAxisLabels.fontSize", 12), 12), o = z(r, "chart.grid.labels.xAxisLabels.color", z(r, "chart.grid.labels.color", "#2A2A2A")), s = He(e), c = Math.max(1, n[0].plots.length), l = await Be(e, n), u = s > 0 ? "start" : s < 0 ? "end" : "middle";
|
|
775
|
-
return I("g", { "data-layer": "x-axis-labels" }, l.map((n, r) => {
|
|
776
|
-
let l = typeof n == "string" ? n : n?.text;
|
|
777
|
-
if (!l) return "";
|
|
778
|
-
let d = `translate(${Ve(e, n, r, c)}, ${i.bottom + a * 1.5}), rotate(${s})`;
|
|
779
|
-
return String(l).includes("\n") ? I("text", {
|
|
780
|
-
class: "vue-data-ui-time-label",
|
|
781
|
-
"data-cy": "time-label",
|
|
782
|
-
"text-anchor": u,
|
|
783
|
-
"font-size": a,
|
|
784
|
-
fill: o,
|
|
785
|
-
transform: d
|
|
786
|
-
}, t({
|
|
787
|
-
content: String(l),
|
|
788
|
-
fontSize: a,
|
|
789
|
-
fill: o,
|
|
790
|
-
x: 0,
|
|
791
|
-
y: 0
|
|
792
|
-
})) : R(l, {
|
|
793
|
-
class: "vue-data-ui-time-label",
|
|
794
|
-
"data-cy": "time-label",
|
|
795
|
-
"text-anchor": u,
|
|
796
|
-
"font-size": a,
|
|
797
|
-
fill: o,
|
|
798
|
-
transform: d
|
|
799
|
-
});
|
|
800
|
-
}).join(""));
|
|
801
|
-
}
|
|
802
|
-
function We(e) {
|
|
803
|
-
let { config: t, drawingArea: n, height: r } = e, i = q(t), a = z(t, "chart.grid.labels.axis.xLabel", ""), o = z(t, "chart.grid.labels.axis.yLabel", ""), s = z(t, "chart.grid.labels.axis.color", z(t, "chart.grid.labels.color", "#2A2A2A")), c = N(z(t, "chart.grid.labels.axis.yLabelOffsetX", 0), 0), l = N(z(t, "chart.grid.labels.axis.xLabelOffsetY", 0), 0), u = N(z(t, "chart.grid.labels.yAxis.crosshairSize", 0), 0), d = N(z(t, "chart.grid.labels.yAxis.scaleValueOffsetX", 0), 0), f = N(z(t, "chart.grid.labels.yAxis.labelWidth", 0), 0), p = J(t), m = [];
|
|
804
|
-
if (a && m.push(R(a, {
|
|
805
|
-
x: n.left + n.width / 2,
|
|
806
|
-
y: Math.min(r - 4, n.bottom + i.xAxis * 3 + l),
|
|
807
|
-
"font-size": i.yAxis,
|
|
808
|
-
"text-anchor": "middle",
|
|
809
|
-
fill: s
|
|
810
|
-
})), o) {
|
|
811
|
-
let e = p ? n.right + u + d + 5 + f + c : n.scaleLabelX - u - d - f - c, t = n.top + n.height / 2;
|
|
812
|
-
m.push(R(o, {
|
|
813
|
-
x: e,
|
|
814
|
-
y: t,
|
|
815
|
-
transform: `rotate(-90 ${e} ${t})`,
|
|
816
|
-
"font-size": i.yAxis,
|
|
817
|
-
"text-anchor": "middle",
|
|
818
|
-
fill: s
|
|
819
|
-
}));
|
|
820
|
-
}
|
|
821
|
-
return I("g", { "data-layer": "axis-labels" }, m.join(""));
|
|
822
|
-
}
|
|
823
|
-
async function Ge(e, t) {
|
|
824
|
-
let { config: n, drawingArea: r } = e, i = z(n, "chart.grid.labels.xAxisLabels.show", !0), a = z(n, "chart.grid.labels.xAxis.showCrosshairs", !1);
|
|
825
|
-
if (!i || !a || !t[0]) return "";
|
|
826
|
-
let o = N(z(n, "chart.grid.labels.xAxis.crosshairSize", 6), 6), s = !!z(n, "chart.grid.labels.xAxis.crosshairsAlwaysAtZero", !1), c = Math.max(1, t[0].plots.length), l = await Be(e, t), u = W(e), d = l.map((t, n) => {
|
|
827
|
-
if (!(typeof t == "string" ? t : t?.text)) return "";
|
|
828
|
-
let i = Q(e) ? t.x : $(e, n, c);
|
|
829
|
-
return `M${i},${s ? u - (u === r.bottom ? 0 : o / 2) : r.bottom} L${i},${s ? u + o / (u === r.bottom ? 1 : 2) : r.bottom + o}`;
|
|
830
|
-
}).filter(Boolean).join(" ");
|
|
831
|
-
return d ? I("g", { "data-layer": "x-axis-ticks" }, L("path", {
|
|
832
|
-
d,
|
|
833
|
-
stroke: z(n, "chart.grid.stroke", "#CCCCCC"),
|
|
834
|
-
"stroke-width": 1,
|
|
835
|
-
"stroke-linecap": "round",
|
|
836
|
-
"data-cy": "axis-x-tick"
|
|
837
|
-
})) : "";
|
|
838
|
-
}
|
|
839
|
-
function Ke(e, t) {
|
|
840
|
-
let { config: n, width: r } = e, i = z(n, "chart.legend", {}), a = N(i.fontSize, 12), o = N(i.markerSize, 10), s = N(i.itemGap, 16), c = N(i.rowGap, 8), l = N(i.padding, 8), u = Math.max(1, r - l * 2), d = [], f = [], p = 0;
|
|
841
|
-
return t.forEach((e) => {
|
|
842
|
-
let t = String(e.name ?? ""), n = o + 6 + ae(t, a) + s;
|
|
843
|
-
f.length && p + n > u && (d.push({
|
|
844
|
-
items: f,
|
|
845
|
-
width: p
|
|
846
|
-
}), f = [], p = 0), f.push({
|
|
847
|
-
serie: e,
|
|
848
|
-
label: t,
|
|
849
|
-
itemWidth: n
|
|
850
|
-
}), p += n;
|
|
851
|
-
}), f.length && d.push({
|
|
852
|
-
items: f,
|
|
853
|
-
width: p
|
|
854
|
-
}), {
|
|
855
|
-
rows: d,
|
|
856
|
-
fontSize: a,
|
|
857
|
-
markerSize: o,
|
|
858
|
-
itemGap: s,
|
|
859
|
-
rowGap: c,
|
|
860
|
-
padding: l,
|
|
861
|
-
height: d.length * Math.max(o, a) + Math.max(0, d.length - 1) * c + l * 2
|
|
862
|
-
};
|
|
863
|
-
}
|
|
864
|
-
function qe(e, t) {
|
|
865
|
-
let { config: n, width: r, height: i } = e;
|
|
866
|
-
if (!z(n, "chart.legend.show", !0) || !t.length) return "";
|
|
867
|
-
let a = z(n, "chart.legend", {}), o = a.position || "bottom", s = a.color || z(n, "chart.color", "#2A2A2A"), c = Ke(e, t), l = Math.max(c.markerSize, c.fontSize), u = o === "top" ? c.padding + l : i - c.height + c.padding + l, d = [];
|
|
868
|
-
return c.rows.forEach((e, t) => {
|
|
869
|
-
let n = Math.max(c.padding, r / 2 - e.width / 2), i = u + t * (l + c.rowGap);
|
|
870
|
-
e.items.forEach(({ serie: e, label: t, itemWidth: r }) => {
|
|
871
|
-
d.push(L("rect", {
|
|
872
|
-
x: n,
|
|
873
|
-
y: i - c.markerSize / 2,
|
|
874
|
-
width: c.markerSize,
|
|
875
|
-
height: c.markerSize,
|
|
876
|
-
rx: 2,
|
|
877
|
-
fill: e.color
|
|
878
|
-
})), d.push(R(t, {
|
|
879
|
-
x: n + c.markerSize + 6,
|
|
880
|
-
y: i + 2,
|
|
881
|
-
"font-size": c.fontSize,
|
|
882
|
-
"dominant-baseline": "middle",
|
|
883
|
-
fill: s
|
|
884
|
-
})), n += r;
|
|
885
|
-
});
|
|
886
|
-
}), I("g", { "data-layer": "legend" }, d.join(""));
|
|
887
|
-
}
|
|
888
|
-
function Je(e, t) {
|
|
889
|
-
return `areaGradient_${t}_${e.uniqueId ?? "ssr"}`;
|
|
890
|
-
}
|
|
891
|
-
function Ye(e, t) {
|
|
892
|
-
let { config: n } = e;
|
|
893
|
-
if (!z(n, "line.area.useGradient", !1)) return "";
|
|
894
|
-
let r = N(z(n, "line.area.opacity", 30), 30), i = t.filter((e) => e.type === "line" && e.useArea).map((t, n) => I("linearGradient", {
|
|
895
|
-
id: Je(e, n),
|
|
896
|
-
x1: "0%",
|
|
897
|
-
x2: "0%",
|
|
898
|
-
y1: "0%",
|
|
899
|
-
y2: "100%"
|
|
900
|
-
}, [L("stop", {
|
|
901
|
-
offset: "0%",
|
|
902
|
-
"stop-color": h(a(D(t.color), .03), r),
|
|
903
|
-
"stop-opacity": 1
|
|
904
|
-
}), L("stop", {
|
|
905
|
-
offset: "100%",
|
|
906
|
-
"stop-color": t.color,
|
|
907
|
-
"stop-opacity": 0
|
|
908
|
-
})].join(""))).join("");
|
|
909
|
-
return i ? I("defs", {}, i) : "";
|
|
910
|
-
}
|
|
911
|
-
function Xe(e, t) {
|
|
912
|
-
let { config: n } = e, r = !!z(n, "line.cutNullValues", !1), a = [];
|
|
913
|
-
return t.filter((e) => e.type === "line" && e.useArea).forEach((t, n) => {
|
|
914
|
-
let o = P(t.plots), s = o.filter((e) => e && e.value !== null);
|
|
915
|
-
if (s.length < 2) return;
|
|
916
|
-
let c = Number.isFinite(Number(t.__zeroY)) ? Number(t.__zeroY) : W(e), l = ve(e, t, n);
|
|
917
|
-
if (t.smooth && !t.useStepper) {
|
|
918
|
-
f(r ? o : s, c, r).forEach((e) => {
|
|
919
|
-
e && a.push(L("path", {
|
|
920
|
-
d: e,
|
|
921
|
-
fill: l,
|
|
922
|
-
"data-cy": "datapoint-line-area-smooth"
|
|
923
|
-
}));
|
|
924
|
-
});
|
|
925
|
-
return;
|
|
926
|
-
}
|
|
927
|
-
(t.useStepper ? i(r ? o : s, c) : r ? v(o, c) : E(s, c)).split(";").filter(Boolean).forEach((e) => {
|
|
928
|
-
a.push(L("path", {
|
|
929
|
-
d: `M${e}Z`,
|
|
930
|
-
fill: l,
|
|
931
|
-
"data-cy": "datapoint-line-area-straight"
|
|
932
|
-
}));
|
|
933
|
-
});
|
|
934
|
-
}), I("g", { "data-layer": "line-areas" }, a.join(""));
|
|
935
|
-
}
|
|
936
|
-
function Ze(e, t) {
|
|
937
|
-
let n = N(t.slotStartIndex ?? t.startAbs, 0);
|
|
938
|
-
return P(e.dashIndices).map((e) => Number(e) - n).filter(Number.isFinite);
|
|
939
|
-
}
|
|
940
|
-
function Qe(e, t, n, r, i) {
|
|
941
|
-
let { config: a } = e, o = N(t.strokeWidth || z(a, "line.strokeWidth", 2), 2);
|
|
942
|
-
return L("path", {
|
|
943
|
-
d: `M${r}`,
|
|
944
|
-
fill: "none",
|
|
945
|
-
stroke: he(e, t, n),
|
|
946
|
-
"stroke-width": o,
|
|
947
|
-
"stroke-linecap": "round",
|
|
948
|
-
"stroke-linejoin": "round",
|
|
949
|
-
"stroke-dasharray": i ? o * 2 : 0
|
|
950
|
-
});
|
|
951
|
-
}
|
|
952
|
-
function $e(e, t) {
|
|
953
|
-
let { config: n } = e, r = t.filter((e) => e.type === "line"), a = !!z(n, "line.cutNullValues", !1), o = [];
|
|
954
|
-
return r.forEach((t, r) => {
|
|
955
|
-
let s = a ? P(t.plots) : P(t.plots).filter((e) => e.value !== null), d = s.filter((e) => e.value !== null);
|
|
956
|
-
if (!(d.length < 2)) {
|
|
957
|
-
if (P(t.dashIndices).length > 0 && !t.useStepper) {
|
|
958
|
-
let i = Ze(t, e);
|
|
959
|
-
(t.smooth || z(n, "line.smooth", !1) ? u(s, i) : _(s, i)).forEach((n) => {
|
|
960
|
-
n?.path && o.push(Qe(e, t, r, n.path, !!n.dashed));
|
|
961
|
-
});
|
|
962
|
-
return;
|
|
963
|
-
}
|
|
964
|
-
(t.useStepper ? i(s).split(";").filter(Boolean) : [t.smooth || z(n, "line.smooth", !1) ? a ? te(s) : C(d) : a ? l(s) : c(d, !1, !0)]).forEach((n) => {
|
|
965
|
-
n && o.push(Qe(e, t, r, n, !!t.dashed));
|
|
966
|
-
});
|
|
967
|
-
}
|
|
968
|
-
}), I("g", { "data-layer": "lines" }, o.join(""));
|
|
969
|
-
}
|
|
970
|
-
function et(e, t, n) {
|
|
971
|
-
let { config: r } = e;
|
|
972
|
-
return z(r, "plot.useGradient", !1) ? `url(#${ge(e, n)})` : z(r, "plot.dot.useSerieColor", !0) ? t.color : z(r, "plot.dot.fill", t.color);
|
|
973
|
-
}
|
|
974
|
-
function tt(e, t) {
|
|
975
|
-
let n = z(e.config, "bar.border", {});
|
|
976
|
-
return {
|
|
977
|
-
stroke: n.useSerieColor ? t.color : n.stroke,
|
|
978
|
-
"stroke-width": N(n.strokeWidth, 0)
|
|
979
|
-
};
|
|
980
|
-
}
|
|
981
|
-
function nt(e, t) {
|
|
982
|
-
let { config: n } = e, r = t.filter((e) => e.type === "plot"), i = z(n, "plot.radius", 4), a = z(n, "plot.dot.strokeWidth", 2), o = z(n, "chart.backgroundColor", "#FFFFFF"), s = [];
|
|
983
|
-
return r.forEach((t, r) => {
|
|
984
|
-
t.plots.forEach((c, l) => {
|
|
985
|
-
F(c.value) && s.push(ie({
|
|
986
|
-
dataCy: `xy-plot-${r}-${l}`,
|
|
987
|
-
shape: t.shape,
|
|
988
|
-
plot: c,
|
|
989
|
-
radius: t.radius || i,
|
|
990
|
-
fill: et(e, t, r),
|
|
991
|
-
stroke: z(n, "plot.dot.useSerieColor", !0) ? o : t.color,
|
|
992
|
-
strokeWidth: a
|
|
993
|
-
}));
|
|
994
|
-
});
|
|
995
|
-
}), I("g", { "data-layer": "plots" }, s.join(""));
|
|
996
|
-
}
|
|
997
|
-
function rt(e) {
|
|
998
|
-
return ![
|
|
999
|
-
null,
|
|
1000
|
-
void 0,
|
|
1001
|
-
NaN,
|
|
1002
|
-
Infinity,
|
|
1003
|
-
-Infinity
|
|
1004
|
-
].includes(e);
|
|
1005
|
-
}
|
|
1006
|
-
function it(e, t, n) {
|
|
1007
|
-
let r = e[t - 1], i = e[t + 1], a = !!r && !!i && r.value == null && i.value == null || !r && !!i && i.value == null || !!r && !i && r.value == null;
|
|
1008
|
-
return rt(e[t]?.value) && a && !!z(n, "line.cutNullValues", !1);
|
|
1009
|
-
}
|
|
1010
|
-
function at(e, t, n, r, i) {
|
|
1011
|
-
let { config: a } = e;
|
|
1012
|
-
if (!n || !rt(n.value)) return !1;
|
|
1013
|
-
if (!(i > N(z(a, "line.dot.hideAboveMaxSerieLength", Infinity), Infinity))) return !0;
|
|
1014
|
-
let o = e.selectedSerieIndex ?? null, s = e.selectedMinimapIndex ?? null;
|
|
1015
|
-
return o !== null && o === r || s !== null && s === r || it(t.plots, r, a);
|
|
1016
|
-
}
|
|
1017
|
-
function ot(e, t) {
|
|
1018
|
-
let { config: n } = e, r = t.filter((e) => e.type === "line"), i = Math.max(0, ...r.map((e) => P(e.plots).length)), a = z(n, "line.radius", 4), o = z(n, "line.dot.strokeWidth", 2), s = z(n, "chart.backgroundColor", "#FFFFFF"), c = [];
|
|
1019
|
-
return r.forEach((t, r) => {
|
|
1020
|
-
t.plots.forEach((l, u) => {
|
|
1021
|
-
at(e, t, l, u, i) && c.push(ie({
|
|
1022
|
-
dataCy: "datapoint-line-plot",
|
|
1023
|
-
shape: t.shape,
|
|
1024
|
-
plot: l,
|
|
1025
|
-
radius: t.radius || a,
|
|
1026
|
-
fill: _e(e, t, r),
|
|
1027
|
-
stroke: z(n, "line.dot.useSerieColor", !0) ? s : t.color,
|
|
1028
|
-
strokeWidth: o
|
|
1029
|
-
}));
|
|
1030
|
-
});
|
|
1031
|
-
}), I("g", { "data-layer": "line-dots" }, c.join(""));
|
|
1032
|
-
}
|
|
1033
|
-
function st(e, t) {
|
|
1034
|
-
let { config: n } = e;
|
|
1035
|
-
if (X(n)) return "";
|
|
1036
|
-
let r = z(n, "line.interLine", {}), i = P(r.pairs), a = P(r.colors);
|
|
1037
|
-
if (!i.length) return "";
|
|
1038
|
-
let o = t.filter((e) => e.type === "line"), s = N(r.fillOpacity, .2), c = !!z(n, "line.cutNullValues", !1), l = [];
|
|
1039
|
-
return i.forEach((e, t) => {
|
|
1040
|
-
let [n, r] = Array.isArray(e) ? e : [e?.a, e?.b];
|
|
1041
|
-
if (!n || !r) return;
|
|
1042
|
-
let i = o.find((e) => e.name === n), u = o.find((e) => e.name === r);
|
|
1043
|
-
if (!i || !u) return;
|
|
1044
|
-
let d = a?.[t]?.[0] ?? i.color, f = a?.[t]?.[1] ?? u.color;
|
|
1045
|
-
b({
|
|
1046
|
-
lineA: P(i.plots),
|
|
1047
|
-
lineB: P(u.plots),
|
|
1048
|
-
smoothA: !!i.smooth,
|
|
1049
|
-
smoothB: !!u.smooth,
|
|
1050
|
-
colorLineA: d,
|
|
1051
|
-
colorLineB: f,
|
|
1052
|
-
sampleStepPx: 2,
|
|
1053
|
-
cutNullValues: c
|
|
1054
|
-
}).forEach((e, i) => {
|
|
1055
|
-
l.push(L("path", {
|
|
1056
|
-
"data-cy": "interline-area",
|
|
1057
|
-
d: e.d,
|
|
1058
|
-
fill: e.color,
|
|
1059
|
-
"fill-opacity": s,
|
|
1060
|
-
stroke: "none",
|
|
1061
|
-
"pointer-events": "none",
|
|
1062
|
-
"data-key": `inter_${n}_${r}_${t}_${i}`
|
|
1063
|
-
}));
|
|
1064
|
-
});
|
|
1065
|
-
}), l.length ? I("g", { "data-layer": "interline-areas" }, l.join("")) : "";
|
|
1066
|
-
}
|
|
1067
|
-
function ct(e) {
|
|
1068
|
-
let t = z(e, "chart.title", {}), n = z(t, "subtitle", {});
|
|
1069
|
-
if (!t.show) return 0;
|
|
1070
|
-
let r = N(t.fontSize, 20), i = n.text ? N(n.fontSize, 14) : 0, a = N(t.paddingTop, 12), o = N(t.paddingBottom, 6);
|
|
1071
|
-
return a + r + (n.text ? i + 4 : 0) + o;
|
|
1072
|
-
}
|
|
1073
|
-
function lt(e) {
|
|
1074
|
-
let { config: t, width: n } = e, r = z(t, "chart.title", {}), i = z(r, "subtitle", {});
|
|
1075
|
-
if (!r.show || !r.text) return "";
|
|
1076
|
-
let a = r.textAlign || "center", o = a === "left" ? N(r.paddingLeft, 12) : a === "right" ? n - N(r.paddingRight, 12) : n / 2, s = a === "left" ? "start" : a === "right" ? "end" : "middle", c = N(r.fontSize, 20), l = N(i.fontSize, 14), u = N(r.paddingTop, 12) + c, d = [R(r.text, {
|
|
1077
|
-
"data-cy": "xy-div-title",
|
|
1078
|
-
x: o,
|
|
1079
|
-
y: u,
|
|
1080
|
-
"font-size": c,
|
|
1081
|
-
"font-weight": r.bold ? "700" : "400",
|
|
1082
|
-
"text-anchor": s,
|
|
1083
|
-
fill: r.color || z(t, "chart.color", "#2A2A2A")
|
|
1084
|
-
})];
|
|
1085
|
-
return i.text && d.push(R(i.text, {
|
|
1086
|
-
"data-cy": "xy-div-subtitle",
|
|
1087
|
-
x: o,
|
|
1088
|
-
y: u + l + 4,
|
|
1089
|
-
"font-size": l,
|
|
1090
|
-
"font-weight": i.bold ? "700" : "400",
|
|
1091
|
-
"text-anchor": s,
|
|
1092
|
-
fill: i.color || r.color || z(t, "chart.color", "#2A2A2A")
|
|
1093
|
-
})), I("g", { "data-layer": "title" }, d.join(""));
|
|
1094
|
-
}
|
|
1095
|
-
function ut(e) {
|
|
1096
|
-
return e.svgTitle ? I("desc", { "aria-hidden": "true" }, [e.svgTitle].join("")) : "";
|
|
1097
|
-
}
|
|
1098
|
-
function dt(e, t, n, r, i) {
|
|
1099
|
-
return !n || n.value === null || n.value === void 0 || !Number.isFinite(Number(n.value)) || !z(e.config, "dataLabels.show", !0) || !z(e.config, `${i}.labels.show`, !1) ? !1 : !Object.hasOwn(t, "dataLabels") || t.dataLabels === !0 || e.selectedSerieIndex === r || e.selectedMinimapIndex === r;
|
|
1100
|
-
}
|
|
1101
|
-
function ft(e, n, r, i) {
|
|
1102
|
-
let { config: a } = e, s = N(z(a, `${i}.labels.fontSize`, z(a, "chart.labels.fontSize", 12)), 12), c = z(a, `${i}.labels.color`, z(a, "chart.color", "#2A2A2A")), l = o({
|
|
1103
|
-
p: n.prefix || z(a, "chart.labels.prefix", ""),
|
|
1104
|
-
v: r.value,
|
|
1105
|
-
s: n.suffix || z(a, "chart.labels.suffix", ""),
|
|
1106
|
-
r: z(a, `${i}.labels.rounding`, 0)
|
|
1107
|
-
});
|
|
1108
|
-
return t({
|
|
1109
|
-
content: Q(e) && Number.isFinite(Number(r.x)) ? `x: ${o({
|
|
1110
|
-
v: r.x,
|
|
1111
|
-
r: z(a, "chart.grid.labels.xAxis.rounding", 0)
|
|
1112
|
-
})}\ny: ${l}` : S(z(a, `${i}.labels.formatter`, null), r.value, l, {
|
|
1113
|
-
datapoint: r,
|
|
1114
|
-
serie: n
|
|
1115
|
-
}),
|
|
1116
|
-
fontSize: s,
|
|
1117
|
-
fill: c,
|
|
1118
|
-
x: 0,
|
|
1119
|
-
y: 0
|
|
1120
|
-
});
|
|
1121
|
-
}
|
|
1122
|
-
function pt(e, t, n) {
|
|
1123
|
-
let r = z(e.config, `${n}.labels.textAnchor`, null);
|
|
1124
|
-
return r === null ? N(z(e.config, `${n}.labels.rotation`, 0), 0) === 0 ? "middle" : z(e.config, `${n}.labels.alwaysOnTop`, !1) || t.value >= 0 ? "start" : "end" : r;
|
|
1125
|
-
}
|
|
1126
|
-
function mt(e, t, n) {
|
|
1127
|
-
let r = N(z(e.config, `${n}.labels.offsetX`, 0), 0), i = N(z(e.config, `${n}.labels.offsetY`, -12), -12), a = N(z(e.config, `${n}.labels.rotation`, 0), 0), o = !!z(e.config, `${n}.labels.alwaysOnTop`, !1);
|
|
1128
|
-
return `translate(${t.x + r}, ${t.y + (o || t.value >= 0 ? i : -i * 3)}) rotate(${a})`;
|
|
1129
|
-
}
|
|
1130
|
-
function ht(e, t, n) {
|
|
1131
|
-
let r = N(z(e.config, "bar.labels.offsetX", 0), 0), i = N(z(e.config, "bar.labels.offsetY", -6), -6), a = N(z(e.config, "bar.labels.rotation", 0), 0), o = !!z(e.config, "bar.labels.alwaysOnTop", !1), s = Number.isFinite(Number(t.__zeroY)) ? Number(t.__zeroY) : W(e), c = Math.abs(s - n.y), l = n.__barLabelX ?? n.x, u = n.y + (o ? i - (n.value < 0 ? c : 0) : n.value >= 0 ? i : -i * 3);
|
|
1132
|
-
return `translate(${l + r}, ${u}) rotate(${a})`;
|
|
1133
|
-
}
|
|
1134
|
-
function gt(e, t) {
|
|
1135
|
-
let { config: n } = e, r = N(z(n, "chart.labels.fontSize", 12), 12), i = z(n, "chart.backgroundColor", "#FFFFFF"), a = [];
|
|
1136
|
-
return t.forEach((t) => {
|
|
1137
|
-
P(t.plots).forEach((o, s) => {
|
|
1138
|
-
let c = t.type;
|
|
1139
|
-
[
|
|
1140
|
-
"line",
|
|
1141
|
-
"bar",
|
|
1142
|
-
"plot"
|
|
1143
|
-
].includes(c) && dt(e, t, o, s, c) && a.push(I("text", {
|
|
1144
|
-
"data-cy": `datapoint-${c}-label`,
|
|
1145
|
-
transform: c === "bar" ? ht(e, t, o) : mt(e, o, c),
|
|
1146
|
-
"text-anchor": pt(e, o, c),
|
|
1147
|
-
"font-size": z(n, `${c}.labels.fontSize`, r),
|
|
1148
|
-
fill: z(n, `${c}.labels.color`, z(n, "chart.color", "#2A2A2A")),
|
|
1149
|
-
stroke: i,
|
|
1150
|
-
"paint-order": "stroke"
|
|
1151
|
-
}, ft(e, t, o, c)));
|
|
1152
|
-
});
|
|
1153
|
-
}), I("g", { "data-layer": "datapoint-labels" }, a.join(""));
|
|
1154
|
-
}
|
|
1155
|
-
function _t(e) {
|
|
1156
|
-
return N(e.slotStartIndex ?? e.startAbs, 0);
|
|
1157
|
-
}
|
|
1158
|
-
function vt(e, t) {
|
|
1159
|
-
let n = Math.max(0, ...t.map((e) => P(e.plots).length));
|
|
1160
|
-
return N(e.slotEndIndex ?? e.endAbs, n);
|
|
1161
|
-
}
|
|
1162
|
-
function yt(e, t) {
|
|
1163
|
-
let { drawingArea: n, config: r } = e;
|
|
1164
|
-
return z(r, "chart.grid.position", "middle") === "middle" ? n.width / Math.max(1, t) : n.width / Math.max(1, t - 1);
|
|
1165
|
-
}
|
|
1166
|
-
function bt(e, t, n) {
|
|
1167
|
-
let { drawingArea: r, config: i } = e, a = yt(e, n);
|
|
1168
|
-
return z(i, "chart.grid.position", "middle") === "middle" ? r.left + a * t : r.left + a * t - a / 2;
|
|
1169
|
-
}
|
|
1170
|
-
function xt(e, t) {
|
|
1171
|
-
return yt(e, t);
|
|
1172
|
-
}
|
|
1173
|
-
function St(e, t, n, r, i, a) {
|
|
1174
|
-
let { drawingArea: o } = e, s = t.caption ?? {};
|
|
1175
|
-
if (!s.text) return "";
|
|
1176
|
-
let c = xt(e, a) * i, l = s.width === "auto" ? c : N(s.width, c), u = bt(e, r, a) - (s.width === "auto" ? 0 : l / 2 - c / 2), d = o.top + N(s.offsetY, 0);
|
|
1177
|
-
return I("foreignObject", {
|
|
1178
|
-
"data-key": `highlight_area_caption_${n}`,
|
|
1179
|
-
x: u,
|
|
1180
|
-
y: d,
|
|
1181
|
-
width: l,
|
|
1182
|
-
height: 1,
|
|
1183
|
-
overflow: "visible"
|
|
1184
|
-
}, I("div", {
|
|
1185
|
-
xmlns: "http://www.w3.org/1999/xhtml",
|
|
1186
|
-
"data-cy": "highlight-area-caption",
|
|
1187
|
-
style: [
|
|
1188
|
-
`padding:${N(s.padding, 0)}px`,
|
|
1189
|
-
`text-align:${s.textAlign || "center"}`,
|
|
1190
|
-
`font-size:${N(s.fontSize, 12)}px`,
|
|
1191
|
-
`color:${s.color || "#2A2A2A"}`,
|
|
1192
|
-
`font-weight:${s.bold ? "bold" : "normal"}`
|
|
1193
|
-
].join(";")
|
|
1194
|
-
}, g(s.text)));
|
|
1195
|
-
}
|
|
1196
|
-
function Ct(e, t) {
|
|
1197
|
-
let { config: n, drawingArea: r } = e, i = P(z(n, "chart.highlightArea", []));
|
|
1198
|
-
if (!i.length) return "";
|
|
1199
|
-
let a = Math.max(1, ...t.map((e) => P(e.plots).length)), o = _t(e), s = vt(e, t), c = [];
|
|
1200
|
-
return i.forEach((t, n) => {
|
|
1201
|
-
if (!t?.show) return;
|
|
1202
|
-
let i = N(t.from, 0), l = Math.min(N(t.to, i), a - 1);
|
|
1203
|
-
if (l < i) return;
|
|
1204
|
-
for (let u = i; u <= l; u += 1) {
|
|
1205
|
-
if (u < o || u > s - 1) continue;
|
|
1206
|
-
let i = u - o;
|
|
1207
|
-
c.push(L("rect", {
|
|
1208
|
-
"data-cy": "highlight-area",
|
|
1209
|
-
"data-key": `highlight_area_${n}_${u}`,
|
|
1210
|
-
x: bt(e, i, a),
|
|
1211
|
-
y: r.top,
|
|
1212
|
-
width: xt(e, a),
|
|
1213
|
-
height: Math.max(1, r.height),
|
|
1214
|
-
fill: h(t.color, N(t.opacity, 20)),
|
|
1215
|
-
"pointer-events": "none"
|
|
1216
|
-
}));
|
|
1217
|
-
}
|
|
1218
|
-
let u = Math.max(i, o);
|
|
1219
|
-
u <= Math.min(l, s - 1) && c.push(St(e, t, n, u - o, l - i + 1, a));
|
|
1220
|
-
}), c.length ? I("g", { "data-layer": "highlight-areas" }, c.join("")) : "";
|
|
1221
|
-
}
|
|
1222
|
-
function wt(e, t) {
|
|
1223
|
-
let { drawingArea: n, scale: r } = e, i = (Number(t) - r.min) / (r.max - r.min || 1);
|
|
1224
|
-
return n.bottom - i * n.height;
|
|
1225
|
-
}
|
|
1226
|
-
function Tt(e) {
|
|
1227
|
-
return ae(e.text, N(e.fontSize, 12));
|
|
1228
|
-
}
|
|
1229
|
-
function Et(e, t, n) {
|
|
1230
|
-
let r = N(e.fontSize, 12), i = e.padding ?? {}, a = e.border ?? {}, o = Tt(e), s = r, c;
|
|
1231
|
-
return c = e.textAnchor === "middle" ? t - o / 2 - N(i.left, 0) : e.textAnchor === "end" ? t - o - N(i.right, 0) : t - N(i.left, 0), {
|
|
1232
|
-
x: c,
|
|
1233
|
-
y: n - s * .75 - N(i.top, 0),
|
|
1234
|
-
width: o + N(i.left, 0) + N(i.right, 0),
|
|
1235
|
-
height: s + N(i.top, 0) + N(i.bottom, 0),
|
|
1236
|
-
fill: e.backgroundColor,
|
|
1237
|
-
stroke: a.stroke,
|
|
1238
|
-
rx: a.rx,
|
|
1239
|
-
ry: a.ry,
|
|
1240
|
-
"stroke-width": a.strokeWidth
|
|
1241
|
-
};
|
|
1242
|
-
}
|
|
1243
|
-
function Dt(e) {
|
|
1244
|
-
let { config: t, drawingArea: n } = e;
|
|
1245
|
-
if (X(t)) return "";
|
|
1246
|
-
let r = P(z(t, "chart.annotations", [])).filter((e) => e?.show && (e.yAxis?.yTop !== null || e.yAxis?.yBottom !== null) && (e.yAxis?.yTop !== void 0 || e.yAxis?.yBottom !== void 0));
|
|
1247
|
-
if (!r.length) return "";
|
|
1248
|
-
let i = [];
|
|
1249
|
-
return r.forEach((r, a) => {
|
|
1250
|
-
let o = r.yAxis ?? {}, s = o.label ?? {}, c = o.line ?? {}, l = o.area ?? {}, u = o.yTop !== null && o.yTop !== void 0, d = o.yBottom !== null && o.yBottom !== void 0, f = u ? wt(e, o.yTop) : null, p = d ? wt(e, o.yBottom) : null, m = Number.isFinite(Number(f)), g = Number.isFinite(Number(p));
|
|
1251
|
-
if (!m && !g) return;
|
|
1252
|
-
let _ = [];
|
|
1253
|
-
if (m && _.push(L("line", {
|
|
1254
|
-
x1: n.left,
|
|
1255
|
-
y1: f,
|
|
1256
|
-
x2: n.right,
|
|
1257
|
-
y2: f,
|
|
1258
|
-
stroke: c.stroke,
|
|
1259
|
-
"stroke-width": c.strokeWidth,
|
|
1260
|
-
"stroke-dasharray": c.strokeDasharray,
|
|
1261
|
-
"stroke-linecap": "round",
|
|
1262
|
-
"data-cy": "xy-annotation-y-top-line"
|
|
1263
|
-
})), g && _.push(L("line", {
|
|
1264
|
-
x1: n.left,
|
|
1265
|
-
y1: p,
|
|
1266
|
-
x2: n.right,
|
|
1267
|
-
y2: p,
|
|
1268
|
-
stroke: c.stroke,
|
|
1269
|
-
"stroke-width": c.strokeWidth,
|
|
1270
|
-
"stroke-dasharray": c.strokeDasharray,
|
|
1271
|
-
"stroke-linecap": "round",
|
|
1272
|
-
"data-cy": "xy-annotation-y-bottom-line"
|
|
1273
|
-
})), m && g && f !== p && _.push(L("rect", {
|
|
1274
|
-
x: n.left,
|
|
1275
|
-
y: Math.min(f, p),
|
|
1276
|
-
width: n.width,
|
|
1277
|
-
height: Math.abs(f - p),
|
|
1278
|
-
fill: h(l.fill || c.stroke || z(t, "chart.color", "#2A2A2A"), N(l.opacity, 20)),
|
|
1279
|
-
"data-cy": "xy-annotation-y-area",
|
|
1280
|
-
"pointer-events": "none"
|
|
1281
|
-
})), s.text) {
|
|
1282
|
-
let e = s.padding ?? {}, t = m && g ? Math.min(f, p) : m ? f : p, r = (s.position === "start" ? n.left + N(e.left, 0) : n.right - N(e.right, 0)) + N(s.offsetX, 0), i = t - N(s.fontSize, 12) / 3 + N(s.offsetY, 0) - N(e.top, 0), a = Et(s, r, i);
|
|
1283
|
-
Number.isFinite(a.y) && Number.isFinite(i) && (_.push(L("rect", {
|
|
1284
|
-
class: "vue-ui-xy-annotation-label-box",
|
|
1285
|
-
...a,
|
|
1286
|
-
"data-cy": "xy-annotation-label-box"
|
|
1287
|
-
})), _.push(R(s.text, {
|
|
1288
|
-
class: "vue-ui-xy-annotation-label",
|
|
1289
|
-
x: r,
|
|
1290
|
-
y: i,
|
|
1291
|
-
"font-size": s.fontSize,
|
|
1292
|
-
fill: s.color,
|
|
1293
|
-
"text-anchor": s.textAnchor,
|
|
1294
|
-
"data-cy": "xy-annotation-label"
|
|
1295
|
-
})));
|
|
1296
|
-
}
|
|
1297
|
-
i.push(I("g", {
|
|
1298
|
-
"data-layer": "annotation",
|
|
1299
|
-
"data-key": `annotation_y_${a}`
|
|
1300
|
-
}, _.join("")));
|
|
1301
|
-
}), i.length ? I("g", { "data-layer": "annotations" }, i.join("")) : "";
|
|
1302
|
-
}
|
|
1303
|
-
function Ot(e, t) {
|
|
1304
|
-
let n = e.additionalSvgContent;
|
|
1305
|
-
return typeof n == "function" ? n({
|
|
1306
|
-
width: e.width,
|
|
1307
|
-
height: e.height,
|
|
1308
|
-
drawingArea: e.drawingArea,
|
|
1309
|
-
scale: e.scale,
|
|
1310
|
-
config: e.config,
|
|
1311
|
-
series: t.map((e) => ({
|
|
1312
|
-
...e,
|
|
1313
|
-
plots: P(e.plots).map((e) => ({ ...e }))
|
|
1314
|
-
}))
|
|
1315
|
-
}) ?? "" : n ?? "";
|
|
1316
|
-
}
|
|
1317
|
-
async function kt(e) {
|
|
1318
|
-
let t = e.config, n = N(e.width, t.chart.width ?? 1e3), r = N(e.height, t.chart.height ?? 600), i = fe({
|
|
1319
|
-
...e,
|
|
1320
|
-
config: t,
|
|
1321
|
-
width: n,
|
|
1322
|
-
height: r
|
|
1323
|
-
}), a = Te({
|
|
1324
|
-
...e,
|
|
1325
|
-
config: t,
|
|
1326
|
-
width: n,
|
|
1327
|
-
height: r,
|
|
1328
|
-
scale: se(t, e.scale, i)
|
|
1329
|
-
}, i), o = a.series;
|
|
1330
|
-
return `
|
|
1331
|
-
<svg
|
|
1332
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
1333
|
-
width="100%"
|
|
1334
|
-
viewBox="0 0 ${n} ${r}"
|
|
1335
|
-
role="img"
|
|
1336
|
-
>
|
|
1337
|
-
${ut(a)}
|
|
1338
|
-
${Ye(a, o)}
|
|
1339
|
-
${be(a, o)}
|
|
1340
|
-
${xe(a)}
|
|
1341
|
-
${lt(a)}
|
|
1342
|
-
${Ct(a, o)}
|
|
1343
|
-
${Dt(a)}
|
|
1344
|
-
${Me(a)}
|
|
1345
|
-
${await Ge(a, o)}
|
|
1346
|
-
${Ee(a)}
|
|
1347
|
-
${We(a)}
|
|
1348
|
-
${await Ue(a, o)}
|
|
1349
|
-
${Oe(a, o)}
|
|
1350
|
-
${st(a, o)}
|
|
1351
|
-
${Xe(a, o)}
|
|
1352
|
-
${$e(a, o)}
|
|
1353
|
-
${nt(a, o)}
|
|
1354
|
-
${ot(a, o)}
|
|
1355
|
-
${gt(a, o)}
|
|
1356
|
-
${qe(a, o)}
|
|
1357
|
-
${Ot(a, o)}
|
|
1358
|
-
</svg>`.trim();
|
|
1359
|
-
}
|
|
1360
|
-
//#endregion
|
|
1361
|
-
//#region src/svg/vue-ui-xy/index.js
|
|
1362
|
-
async function At(e = {}) {
|
|
1363
|
-
return await kt(M(e));
|
|
1364
|
-
}
|
|
1365
|
-
//#endregion
|
|
1366
|
-
export { At as createStaticVueUiXy };
|
|
1
|
+
import { t as e } from "./vue-ui-xy-DjB1eAEf.js";
|
|
2
|
+
import { t } from "./vue-ui-donut-BJyXzn6B.js";
|
|
3
|
+
export { t as createStaticVueUiDonut, e as createStaticVueUiXy };
|