vue-data-ui 3.0.0-next.60 → 3.0.0-next.62
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/{Arrow-Dt0ZxTK2.js → Arrow-vPQ5umgl.js} +1 -1
- package/dist/{BaseDraggableDialog-Bl-2tw3H.js → BaseDraggableDialog-rmweWafM.js} +2 -2
- package/dist/{BaseIcon-C3ljqn8J.js → BaseIcon-BdOuqa-n.js} +1 -1
- package/dist/{ColorPicker-0d0whOB3.js → ColorPicker-BJYD-Akc.js} +2 -2
- package/dist/{DataTable-C_tJHvMd.js → DataTable-DKhkUltp.js} +2 -2
- package/dist/{Legend-VD0VB7l7.js → Legend-DJVidRKZ.js} +2 -2
- package/dist/{NonSvgPenAndPaper-DQsHc_AG.js → NonSvgPenAndPaper-BO1MTyPj.js} +3 -3
- package/dist/{PackageVersion-5S8ajCUS.js → PackageVersion-CvXTVTaQ.js} +1 -1
- package/dist/{PenAndPaper-D6wazxlT.js → PenAndPaper-B_AMsItI.js} +3 -3
- package/dist/{Shape-DDSX29LV.js → Shape-CVE1tn78.js} +1 -1
- package/dist/{Slicer-D3SbIarX.js → Slicer-Bu8DjZuX.js} +2 -2
- package/dist/{SparkTooltip-BCdP3VDl.js → SparkTooltip-CZVDoHxg.js} +1 -1
- package/dist/{Title-DEKAfzRX.js → Title-Cr_usVXc.js} +1 -1
- package/dist/{Tooltip-DJlC-n25.js → Tooltip-7jDTalyv.js} +1 -1
- package/dist/{UserOptions-D2G7II3G.js → UserOptions-UTvI0Q98.js} +2 -2
- package/dist/{dom-to-png-Y0tASTWQ.js → dom-to-png-ONrUYTRb.js} +1 -1
- package/dist/{img-ChLGv8nO.js → img-iMtnfYdI.js} +1 -1
- package/dist/{index-BLtc1AIS.js → index-CwGyyfTA.js} +75 -50
- package/dist/{pdf-DNiq-xsc.js → pdf-DiMYy8s9.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +14 -0
- package/dist/types/vue-data-ui.d.ts +14 -0
- package/dist/{useAutoSizeLabelsInsideViewbox-BJDcwsoB.js → useAutoSizeLabelsInsideViewbox-CqI-y0RH.js} +1 -1
- package/dist/{useNestedProp-DExlTpuj.js → useNestedProp-Dd5rDkqs.js} +1 -1
- package/dist/{usePrinter-fqbzwh0l.js → usePrinter-Ctvv8qBg.js} +2 -2
- package/dist/{vue-data-ui-B8bRwUEL.js → vue-data-ui-DwvF4C9M.js} +64 -64
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-Dddx5kJW.js → vue-ui-3d-bar-zgyRNuSO.js} +6 -6
- package/dist/{vue-ui-accordion-EMAj3Ykx.js → vue-ui-accordion-5YUMPNG1.js} +3 -3
- package/dist/{vue-ui-age-pyramid-CMzKOGfv.js → vue-ui-age-pyramid-DW6p9iWS.js} +6 -6
- package/dist/{vue-ui-annotator-BQxXVdZW.js → vue-ui-annotator-C2CMEveI.js} +2 -2
- package/dist/{vue-ui-bullet-DIie_6-T.js → vue-ui-bullet-I1UZAw0O.js} +7 -7
- package/dist/{vue-ui-candlestick-DU796IGE.js → vue-ui-candlestick-N2rX18KX.js} +7 -7
- package/dist/{vue-ui-carousel-table-xDItqzuw.js → vue-ui-carousel-table-CXe6ghc3.js} +4 -4
- package/dist/{vue-ui-chestnut-DnQ494SU.js → vue-ui-chestnut-Dkeqv0lM.js} +5 -5
- package/dist/{vue-ui-chord-DTs9gQ-R.js → vue-ui-chord-Dp_n9sP9.js} +8 -8
- package/dist/{vue-ui-circle-pack-D73gxFJW.js → vue-ui-circle-pack-DrPM1UXc.js} +6 -6
- package/dist/{vue-ui-cursor-CNXTFeSs.js → vue-ui-cursor-BcS6aiX1.js} +2 -2
- package/dist/{vue-ui-dashboard-Duph5Yta.js → vue-ui-dashboard-BcyCNmVV.js} +62 -62
- package/dist/{vue-ui-digits-D7qOSGZ-.js → vue-ui-digits-BvNRrVgl.js} +2 -2
- package/dist/{vue-ui-donut-EfxITdHJ.js → vue-ui-donut-Rvu6m-aE.js} +8 -8
- package/dist/{vue-ui-donut-evolution-H6nfW_kx.js → vue-ui-donut-evolution-D2ZcgYhJ.js} +8 -8
- package/dist/{vue-ui-dumbbell-DCUR8kl_.js → vue-ui-dumbbell-CvYVCA6I.js} +7 -7
- package/dist/{vue-ui-flow-DUENWmgc.js → vue-ui-flow-_6zAZMI6.js} +7 -7
- package/dist/{vue-ui-funnel-BSGUxWhW.js → vue-ui-funnel-CIEJVq4d.js} +6 -6
- package/dist/{vue-ui-galaxy-D8PBQfbb.js → vue-ui-galaxy-DcZ04iAF.js} +5 -5
- package/dist/{vue-ui-gauge-C8v8wKJO.js → vue-ui-gauge-C5j1wKcj.js} +7 -7
- package/dist/{vue-ui-gizmo-DmguslRh.js → vue-ui-gizmo-BD9EY4bZ.js} +3 -3
- package/dist/{vue-ui-heatmap-BM5Gfdzz.js → vue-ui-heatmap-DDZ8g5dM.js} +7 -7
- package/dist/{vue-ui-history-plot-CF6SlpwK.js → vue-ui-history-plot-C7ZRZHzl.js} +7 -7
- package/dist/{vue-ui-kpi-BCyX-Zu-.js → vue-ui-kpi-DZ5FITOL.js} +3 -3
- package/dist/{vue-ui-mini-loader-ByMff4PK.js → vue-ui-mini-loader-BaQpwyu-.js} +2 -2
- package/dist/{vue-ui-molecule-Cxnf2xDy.js → vue-ui-molecule-B8Ob6p-h.js} +5 -5
- package/dist/{vue-ui-mood-radar-DEfJWXE7.js → vue-ui-mood-radar-BrTY3gyR.js} +7 -7
- package/dist/{vue-ui-nested-donuts-Bt7Pw9l0.js → vue-ui-nested-donuts-yN_txLmU.js} +9 -9
- package/dist/{vue-ui-onion-Bk3KL1Nk.js → vue-ui-onion-C613Zf1i.js} +8 -8
- package/dist/{vue-ui-parallel-coordinate-plot-BpKRlOYy.js → vue-ui-parallel-coordinate-plot-B-aXg4S4.js} +8 -8
- package/dist/{vue-ui-quadrant-D1dgOAp2.js → vue-ui-quadrant-C2AeZvmZ.js} +8 -8
- package/dist/{vue-ui-quick-chart-_I6OrH-J.js → vue-ui-quick-chart-CkE6ybPo.js} +6 -6
- package/dist/{vue-ui-radar-BWnhxayf.js → vue-ui-radar-BbiqR92L.js} +7 -7
- package/dist/{vue-ui-rating-I08lL1Nb.js → vue-ui-rating-CbRUCAxl.js} +2 -2
- package/dist/{vue-ui-relation-circle-CMF5FSha.js → vue-ui-relation-circle-vWsjRm3W.js} +6 -6
- package/dist/{vue-ui-ridgeline-prYrXNYF.js → vue-ui-ridgeline-CaiytuOs.js} +8 -8
- package/dist/{vue-ui-rings-DmbUIw9S.js → vue-ui-rings-AFUuMvpu.js} +8 -8
- package/dist/{vue-ui-scatter-srTVLcUK.js → vue-ui-scatter-Dcb9tLMu.js} +8 -8
- package/dist/{vue-ui-skeleton-FanSnKr8.js → vue-ui-skeleton-B1SFKW_l.js} +3 -3
- package/dist/{vue-ui-smiley-CWA0Y6wM.js → vue-ui-smiley-Ba-ctrns.js} +2 -2
- package/dist/{vue-ui-spark-trend-EiEzMoPj.js → vue-ui-spark-trend-BshA2mRL.js} +3 -3
- package/dist/{vue-ui-sparkbar-CCe0U_o0.js → vue-ui-sparkbar-D8-HNaN_.js} +3 -3
- package/dist/vue-ui-sparkgauge-Dfnr6Bjc.js +232 -0
- package/dist/vue-ui-sparkhistogram-BMtpx_0l.js +444 -0
- package/dist/{vue-ui-sparkline-B2-YztKx.js → vue-ui-sparkline-BA_5ICer.js} +3 -3
- package/dist/{vue-ui-sparkstackbar-BGMtc_HC.js → vue-ui-sparkstackbar-BQkH5ltm.js} +3 -3
- package/dist/{vue-ui-stackbar-DrKaioRS.js → vue-ui-stackbar-C7iPaQOn.js} +9 -9
- package/dist/{vue-ui-strip-plot-C4qWoDEh.js → vue-ui-strip-plot-CnfeJeRi.js} +7 -7
- package/dist/{vue-ui-table-CXqyTj_Z.js → vue-ui-table-Dz6RLYoS.js} +3 -3
- package/dist/{vue-ui-table-heatmap-BZTn3qnM.js → vue-ui-table-heatmap-Cbgogx6N.js} +5 -5
- package/dist/{vue-ui-table-sparkline-CIBdN_KF.js → vue-ui-table-sparkline-CLEfp8d2.js} +4 -4
- package/dist/{vue-ui-thermometer-DPIpWKUI.js → vue-ui-thermometer-CzNFOqrV.js} +7 -7
- package/dist/{vue-ui-timer-Cha-Gb1x.js → vue-ui-timer-CI7VUX-B.js} +5 -5
- package/dist/{vue-ui-tiremarks-B4SjQyS7.js → vue-ui-tiremarks-C0QDwzEt.js} +6 -6
- package/dist/{vue-ui-treemap-1twI_ag-.js → vue-ui-treemap-D-5MOqu3.js} +8 -8
- package/dist/{vue-ui-vertical-bar-C31Jqkbw.js → vue-ui-vertical-bar-sZjQranC.js} +9 -9
- package/dist/{vue-ui-waffle-DkZykFPK.js → vue-ui-waffle-6zNYC1rh.js} +8 -8
- package/dist/{vue-ui-wheel-CYOrBHBD.js → vue-ui-wheel-kx79XCaH.js} +6 -6
- package/dist/{vue-ui-word-cloud-Clyg0CRZ.js → vue-ui-word-cloud-DI8bEQrN.js} +6 -6
- package/dist/{vue-ui-world-BYgMbS-e.js → vue-ui-world-Ba2tdGRe.js} +6 -6
- package/dist/{vue-ui-xy-BMszd4wZ.js → vue-ui-xy-TM3uzoN-.js} +9 -9
- package/dist/{vue-ui-xy-canvas-DwXvZ311.js → vue-ui-xy-canvas-DFqIhqzJ.js} +8 -8
- package/package.json +1 -1
- package/dist/vue-ui-sparkgauge-Cdcirik_.js +0 -201
- package/dist/vue-ui-sparkhistogram-CEj9qz9m.js +0 -313
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { defineAsyncComponent as P, ref as b, toRefs as T, onMounted as N, computed as s, watch as M, createElementBlock as r, openBlock as u, normalizeStyle as g, createCommentVNode as d, createBlock as U, toDisplayString as k, unref as i, createVNode as q, createElementVNode as y, renderSlot as F, normalizeClass as V } from "vue";
|
|
2
|
+
import { u as B } from "./useNestedProp-Dd5rDkqs.js";
|
|
3
|
+
import { u as X, c as Y, t as H, b as J, o as K, f as E, g as Q, P as W, X as Z, k as ee, h as x, i as te } from "./index-CwGyyfTA.js";
|
|
4
|
+
import { u as ae, B as le } from "./useLoading-Bt5Doa8m.js";
|
|
5
|
+
import { u as oe } from "./useChartAccessibility-9icAAmYg.js";
|
|
6
|
+
const se = ["xmlns", "viewBox"], ue = ["width", "height"], ie = ["id"], ne = ["stop-color"], re = ["stop-color"], ve = ["d", "stroke", "stroke-linecap"], ce = ["d", "stroke", "stroke-linecap", "stroke-dashoffset"], de = ["x", "y", "width", "height"], fe = ["x", "y", "font-size", "fill", "font-weight"], ye = {
|
|
7
|
+
key: 2,
|
|
8
|
+
ref: "source",
|
|
9
|
+
dir: "auto"
|
|
10
|
+
}, ke = {
|
|
11
|
+
__name: "vue-ui-sparkgauge",
|
|
12
|
+
props: {
|
|
13
|
+
config: {
|
|
14
|
+
type: Object,
|
|
15
|
+
default() {
|
|
16
|
+
return {};
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
dataset: {
|
|
20
|
+
type: Object,
|
|
21
|
+
default() {
|
|
22
|
+
return {};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
setup(D) {
|
|
27
|
+
const O = P(() => import("./PackageVersion-CvXTVTaQ.js")), { vue_ui_sparkgauge: j } = X(), c = D, _ = b(Y()), e = b(p()), { loading: h, FINAL_DATASET: v } = ae({
|
|
28
|
+
...T(c),
|
|
29
|
+
FINAL_CONFIG: e,
|
|
30
|
+
prepareConfig: p,
|
|
31
|
+
skeletonDataset: {
|
|
32
|
+
value: 0,
|
|
33
|
+
min: -1,
|
|
34
|
+
max: 1,
|
|
35
|
+
title: ""
|
|
36
|
+
},
|
|
37
|
+
skeletonConfig: H({
|
|
38
|
+
defaultConfig: e.value,
|
|
39
|
+
userConfig: {
|
|
40
|
+
style: {
|
|
41
|
+
animation: { show: !1 },
|
|
42
|
+
background: "#99999930",
|
|
43
|
+
colors: {
|
|
44
|
+
min: "#CACACA",
|
|
45
|
+
max: "#6A6A6A"
|
|
46
|
+
},
|
|
47
|
+
track: {
|
|
48
|
+
autoColor: !0
|
|
49
|
+
},
|
|
50
|
+
gutter: {
|
|
51
|
+
color: "#6A6A6A80"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
}), { svgRef: I } = oe({ config: { text: c.dataset.title } });
|
|
57
|
+
function p() {
|
|
58
|
+
const t = B({
|
|
59
|
+
userConfig: c.config,
|
|
60
|
+
defaultConfig: j
|
|
61
|
+
});
|
|
62
|
+
return t.theme ? {
|
|
63
|
+
...B({
|
|
64
|
+
userConfig: J.vue_ui_sparkgauge[t.theme] || c.config,
|
|
65
|
+
defaultConfig: t
|
|
66
|
+
})
|
|
67
|
+
} : t;
|
|
68
|
+
}
|
|
69
|
+
N(() => {
|
|
70
|
+
A();
|
|
71
|
+
});
|
|
72
|
+
const w = s(() => e.value.debug);
|
|
73
|
+
function A() {
|
|
74
|
+
K(c.dataset) ? E({
|
|
75
|
+
componentName: "VueUiSparkgauge",
|
|
76
|
+
type: "dataset",
|
|
77
|
+
debug: w.value
|
|
78
|
+
}) : Q({
|
|
79
|
+
datasetObject: c.dataset,
|
|
80
|
+
requiredAttributes: ["value", "min", "max"]
|
|
81
|
+
}).forEach((t) => {
|
|
82
|
+
E({
|
|
83
|
+
componentName: "VueUiSparkgauge",
|
|
84
|
+
type: "datasetAttribute",
|
|
85
|
+
property: t,
|
|
86
|
+
debug: w.value
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
M(() => c.config, (t) => {
|
|
91
|
+
e.value = p(), a.value = e.value.style.animation.show ? o.value.min : v.value.value, A();
|
|
92
|
+
}, { deep: !0 });
|
|
93
|
+
const l = s(() => ({
|
|
94
|
+
height: e.value.style.height,
|
|
95
|
+
width: 128,
|
|
96
|
+
base: e.value.style.basePosition
|
|
97
|
+
})), o = s(() => {
|
|
98
|
+
const t = v.value.min ?? 0, n = v.value.max ?? 0, f = n - t;
|
|
99
|
+
return {
|
|
100
|
+
min: t,
|
|
101
|
+
max: n,
|
|
102
|
+
diff: f
|
|
103
|
+
};
|
|
104
|
+
}), a = b(e.value.style.animation.show ? o.value.min : v.value.value);
|
|
105
|
+
M(() => v.value.value, () => {
|
|
106
|
+
$(v.value.value || 0);
|
|
107
|
+
});
|
|
108
|
+
const R = s(() => a.value > o.value.max ? o.value.max : a.value < o.value.min ? o.value.min : a.value), C = s(() => o.value.diff / e.value.style.animation.speedMs);
|
|
109
|
+
N(() => {
|
|
110
|
+
$(v.value.value || 0);
|
|
111
|
+
});
|
|
112
|
+
function $(t) {
|
|
113
|
+
function n() {
|
|
114
|
+
a.value < t ? a.value = Math.min(a.value + C.value, t) : a.value > t && (a.value = Math.max(a.value - C.value, t)), a.value !== t && requestAnimationFrame(n);
|
|
115
|
+
}
|
|
116
|
+
n();
|
|
117
|
+
}
|
|
118
|
+
const m = s(() => v.value.title ?? ""), L = s(() => {
|
|
119
|
+
const t = o.value.diff;
|
|
120
|
+
if (!isFinite(t) || t === 0) return 0;
|
|
121
|
+
const n = o.value.min, f = R.value;
|
|
122
|
+
return f >= 0 ? (f - n) / t : (Math.abs(n) - Math.abs(f)) / t;
|
|
123
|
+
}), S = s(() => W(e.value.style.colors.min, e.value.style.colors.max, o.value.min, o.value.max, a.value)), z = s(() => e.value.style.dataLabel.autoColor ? S.value : e.value.style.dataLabel.color), G = s(() => e.value.style.track.autoColor ? S.value : e.value.style.track.color);
|
|
124
|
+
return (t, n) => (u(), r("div", {
|
|
125
|
+
class: "vue-ui-sparkgauge",
|
|
126
|
+
style: g(`font-family:${e.value.style.fontFamily};width: 100%; background:${e.value.style.background}`)
|
|
127
|
+
}, [
|
|
128
|
+
e.value.style.title.show && m.value && e.value.style.title.position === "top" ? (u(), r("div", {
|
|
129
|
+
key: 0,
|
|
130
|
+
class: "vue-data-ui-sparkgauge-label",
|
|
131
|
+
style: g(`font-size:${e.value.style.title.fontSize}px;text-align:${e.value.style.title.textAlign};font-weight:${e.value.style.title.bold ? "bold" : "normal"};color:${e.value.style.title.color}`)
|
|
132
|
+
}, k(m.value), 5)) : d("", !0),
|
|
133
|
+
(u(), r("svg", {
|
|
134
|
+
ref_key: "svgRef",
|
|
135
|
+
ref: I,
|
|
136
|
+
xmlns: i(Z),
|
|
137
|
+
viewBox: `0 0 ${l.value.width} ${l.value.height}`,
|
|
138
|
+
style: "overflow: visible; background:transparent; width:100%;"
|
|
139
|
+
}, [
|
|
140
|
+
q(i(O)),
|
|
141
|
+
t.$slots["chart-background"] && !i(h) ? (u(), r("foreignObject", {
|
|
142
|
+
key: 0,
|
|
143
|
+
x: 0,
|
|
144
|
+
y: 0,
|
|
145
|
+
width: l.value.width,
|
|
146
|
+
height: l.value.height,
|
|
147
|
+
style: {
|
|
148
|
+
pointerEvents: "none"
|
|
149
|
+
}
|
|
150
|
+
}, [
|
|
151
|
+
F(t.$slots, "chart-background")
|
|
152
|
+
], 8, ue)) : d("", !0),
|
|
153
|
+
y("defs", null, [
|
|
154
|
+
y("linearGradient", {
|
|
155
|
+
id: `gradient_${_.value}`,
|
|
156
|
+
x1: "-10%",
|
|
157
|
+
y1: "100%",
|
|
158
|
+
x2: "110%",
|
|
159
|
+
y2: "100%"
|
|
160
|
+
}, [
|
|
161
|
+
y("stop", {
|
|
162
|
+
offset: "0%",
|
|
163
|
+
"stop-color": e.value.style.colors.min
|
|
164
|
+
}, null, 8, ne),
|
|
165
|
+
y("stop", {
|
|
166
|
+
offset: "100%",
|
|
167
|
+
"stop-color": e.value.style.colors.max
|
|
168
|
+
}, null, 8, re)
|
|
169
|
+
], 8, ie)
|
|
170
|
+
]),
|
|
171
|
+
y("path", {
|
|
172
|
+
d: `M10 ${l.value.base} A 1 1 0 1 1 118 ${l.value.base}`,
|
|
173
|
+
stroke: e.value.style.gutter.color,
|
|
174
|
+
"stroke-width": 8,
|
|
175
|
+
"stroke-linecap": e.value.style.gutter.strokeLinecap,
|
|
176
|
+
fill: "none"
|
|
177
|
+
}, null, 8, ve),
|
|
178
|
+
L.value !== 0 ? (u(), r("path", {
|
|
179
|
+
key: 1,
|
|
180
|
+
d: `M10 ${l.value.base} A 1 1 0 1 1 118 ${l.value.base}`,
|
|
181
|
+
stroke: e.value.style.colors.showGradient ? `url(#gradient_${_.value})` : G.value,
|
|
182
|
+
"stroke-width": 8,
|
|
183
|
+
"stroke-linecap": e.value.style.track.strokeLinecap,
|
|
184
|
+
fill: "none",
|
|
185
|
+
"stroke-dasharray": 169.5,
|
|
186
|
+
"stroke-dashoffset": 169.5 - 169.5 * L.value,
|
|
187
|
+
class: V({ "vue-ui-sparkgauge-track": e.value.style.animation.show }),
|
|
188
|
+
style: g(e.value.style.animation.show ? `animation: vue-ui-sparkgauge-animation ${e.value.style.animation.speedMs}ms ease-in;` : "")
|
|
189
|
+
}, null, 14, ce)) : d("", !0),
|
|
190
|
+
i(h) ? (u(), r("rect", {
|
|
191
|
+
key: 2,
|
|
192
|
+
x: l.value.width / 2 - e.value.style.dataLabel.fontSize / 2,
|
|
193
|
+
y: l.value.base + 6 + e.value.style.dataLabel.offsetY - e.value.style.dataLabel.fontSize,
|
|
194
|
+
width: e.value.style.dataLabel.fontSize,
|
|
195
|
+
height: e.value.style.dataLabel.fontSize,
|
|
196
|
+
fill: "#6A6A6A50",
|
|
197
|
+
rx: 3
|
|
198
|
+
}, null, 8, de)) : (u(), r("text", {
|
|
199
|
+
key: 3,
|
|
200
|
+
"text-anchor": "middle",
|
|
201
|
+
x: l.value.width / 2,
|
|
202
|
+
y: l.value.base + 6 + e.value.style.dataLabel.offsetY,
|
|
203
|
+
"font-size": e.value.style.dataLabel.fontSize,
|
|
204
|
+
fill: z.value,
|
|
205
|
+
"font-weight": e.value.style.dataLabel.bold ? "bold" : "normal"
|
|
206
|
+
}, k(i(ee)(
|
|
207
|
+
e.value.style.dataLabel.formatter,
|
|
208
|
+
i(x)(a.value),
|
|
209
|
+
i(te)({
|
|
210
|
+
p: e.value.style.dataLabel.prefix,
|
|
211
|
+
v: i(x)(a.value),
|
|
212
|
+
s: e.value.style.dataLabel.suffix,
|
|
213
|
+
r: e.value.style.dataLabel.rounding
|
|
214
|
+
}),
|
|
215
|
+
{ datapoint: i(x)(a.value), color: z.value }
|
|
216
|
+
)), 9, fe))
|
|
217
|
+
], 8, se)),
|
|
218
|
+
e.value.style.title.show && m.value && e.value.style.title.position === "bottom" ? (u(), r("div", {
|
|
219
|
+
key: 1,
|
|
220
|
+
class: "vue-data-ui-sparkgauge-label",
|
|
221
|
+
style: g(`font-size:${e.value.style.title.fontSize}px;text-align:${e.value.style.title.textAlign};font-weight:${e.value.style.title.bold ? "bold" : "normal"};font-weight:${e.value.style.title.bold ? "bold" : "normal"};color:${e.value.style.title.color}`)
|
|
222
|
+
}, k(m.value), 5)) : d("", !0),
|
|
223
|
+
t.$slots.source ? (u(), r("div", ye, [
|
|
224
|
+
F(t.$slots, "source")
|
|
225
|
+
], 512)) : d("", !0),
|
|
226
|
+
i(h) ? (u(), U(le, { key: 3 })) : d("", !0)
|
|
227
|
+
], 4));
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
export {
|
|
231
|
+
ke as default
|
|
232
|
+
};
|
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
import { nextTick as Q, useCssVars as ge, computed as F, defineAsyncComponent as be, ref as p, toRefs as me, onMounted as Z, watch as ee, createElementBlock as o, openBlock as a, normalizeStyle as R, createCommentVNode as h, createBlock as te, createElementVNode as m, createTextVNode as _e, toDisplayString as A, unref as d, createVNode as xe, renderSlot as le, Fragment as f, renderList as g, normalizeClass as ae } from "vue";
|
|
2
|
+
import { u as ke, c as Ce, t as Ae, b as we, o as ze, f as se, g as Se, s as w, k as oe, i as ie, X as $e, x as K } from "./index-CwGyyfTA.js";
|
|
3
|
+
import { t as Le, u as Me } from "./useResponsive-DfdjqQps.js";
|
|
4
|
+
import { u as Fe, B as Ne } from "./useLoading-Bt5Doa8m.js";
|
|
5
|
+
import { u as ne } from "./useNestedProp-Dd5rDkqs.js";
|
|
6
|
+
import { u as Te } from "./useChartAccessibility-9icAAmYg.js";
|
|
7
|
+
import { _ as Ee } from "./Shape-CVE1tn78.js";
|
|
8
|
+
import { _ as Ie } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
|
+
function De({
|
|
10
|
+
svgRef: U,
|
|
11
|
+
unitWidth: X,
|
|
12
|
+
fontSize: j = 12,
|
|
13
|
+
step: q = 0.5,
|
|
14
|
+
maxIterations: _ = 60,
|
|
15
|
+
hideUnderMin: x = !0
|
|
16
|
+
}) {
|
|
17
|
+
const S = /* @__PURE__ */ new WeakMap(), N = (i) => {
|
|
18
|
+
if (typeof i == "number") return i;
|
|
19
|
+
if (!i) return NaN;
|
|
20
|
+
const c = parseFloat(String(i).replace("px", ""));
|
|
21
|
+
return Number.isFinite(c) ? c : NaN;
|
|
22
|
+
}, $ = (i) => {
|
|
23
|
+
const c = N(i.getAttribute("font-size"));
|
|
24
|
+
if (Number.isFinite(c)) return c;
|
|
25
|
+
const k = window.getComputedStyle(i);
|
|
26
|
+
return N(k.fontSize) || j;
|
|
27
|
+
}, y = (i, c) => {
|
|
28
|
+
i.setAttribute("font-size", String(c));
|
|
29
|
+
}, L = (i) => {
|
|
30
|
+
if (S.has(i))
|
|
31
|
+
y(i, S.get(i));
|
|
32
|
+
else {
|
|
33
|
+
const c = $(i);
|
|
34
|
+
S.set(i, c), y(i, c);
|
|
35
|
+
}
|
|
36
|
+
}, e = (i) => {
|
|
37
|
+
try {
|
|
38
|
+
return i.getBBox().width || 0;
|
|
39
|
+
} catch {
|
|
40
|
+
return 0;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
return {
|
|
44
|
+
fitText: async (i, c = 6) => {
|
|
45
|
+
await Q();
|
|
46
|
+
const k = U?.value;
|
|
47
|
+
if (!k) return;
|
|
48
|
+
const T = k.querySelectorAll(i);
|
|
49
|
+
if (!T.length) return;
|
|
50
|
+
const C = Math.max(0, X.value);
|
|
51
|
+
if (C <= 0) return;
|
|
52
|
+
const z = [];
|
|
53
|
+
T.forEach((s) => {
|
|
54
|
+
const E = s.style.display, W = s.style.opacity;
|
|
55
|
+
s.style.display = "", s.style.opacity = "0", L(s);
|
|
56
|
+
let r = e(s), I = $(s), v = I, B = 0;
|
|
57
|
+
if (r <= C)
|
|
58
|
+
z.push({ el: s, finalSize: I, fits: !0 });
|
|
59
|
+
else {
|
|
60
|
+
for (; r > C && v > c && B < _; )
|
|
61
|
+
v = Math.max(c, v - q), y(s, v), r = e(s), B += 1;
|
|
62
|
+
const P = r <= C && v > c;
|
|
63
|
+
z.push({ el: s, finalSize: v, fits: P }), y(s, I);
|
|
64
|
+
}
|
|
65
|
+
s.style.display = E, s.style.opacity = W;
|
|
66
|
+
});
|
|
67
|
+
const D = x && z.some((s) => !s.fits);
|
|
68
|
+
z.forEach(({ el: s, finalSize: E, fits: W }) => {
|
|
69
|
+
D ? s.style.display = "none" : (s.style.display = "", y(s, E));
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
const We = { key: 0 }, Be = { key: 1 }, He = ["xmlns", "viewBox"], Oe = ["width", "height"], Ve = ["id"], Re = ["stop-color"], Ue = ["stop-color"], Xe = ["id"], je = ["stop-color"], qe = ["stop-color"], Ge = ["id"], Pe = ["stop-color"], Ye = ["stop-color"], Je = ["height", "width", "fill", "x", "stroke", "stroke-width", "rx", "stroke-dasharray"], Ke = { key: 1 }, Qe = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "rx"], Ze = { key: 2 }, et = ["x", "y", "font-size", "font-weight", "fill"], tt = ["x", "y", "font-size", "fill"], lt = ["x", "y", "font-size", "fill"], at = ["height", "width", "x", "onMouseover", "onMouseleave", "onClick"], st = {
|
|
75
|
+
__name: "vue-ui-sparkhistogram",
|
|
76
|
+
props: {
|
|
77
|
+
config: {
|
|
78
|
+
type: Object,
|
|
79
|
+
default() {
|
|
80
|
+
return {};
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
dataset: {
|
|
84
|
+
type: Array,
|
|
85
|
+
default() {
|
|
86
|
+
return [];
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
emits: ["selectDatapoint"],
|
|
91
|
+
setup(U, { emit: X }) {
|
|
92
|
+
ge((l) => ({
|
|
93
|
+
c8e2d1ee: ve.value
|
|
94
|
+
}));
|
|
95
|
+
const j = be(() => import("./PackageVersion-CvXTVTaQ.js")), { vue_ui_sparkhistogram: q } = ke(), _ = U, x = p(Ce()), S = p(null), N = p(null), $ = p(null), y = p(null), L = p(null), e = p(C()), { loading: G, FINAL_DATASET: i } = Fe({
|
|
96
|
+
...me(_),
|
|
97
|
+
FINAL_CONFIG: e,
|
|
98
|
+
prepareConfig: C,
|
|
99
|
+
skeletonDataset: [
|
|
100
|
+
{ value: 1, intensity: 0.2, color: "#CACACA" },
|
|
101
|
+
{ value: 2, intensity: 0.3, color: "#CACACA" },
|
|
102
|
+
{ value: 3, intensity: 0.5, color: "#CACACA" },
|
|
103
|
+
{ value: 5, intensity: 0.7, color: "#CACACA" },
|
|
104
|
+
{ value: 8, intensity: 0.9, color: "#CACACA" },
|
|
105
|
+
{ value: 13, intensity: 0.95, color: "#CACACA" },
|
|
106
|
+
{ value: 21, intensity: 1, color: "#CACACA" },
|
|
107
|
+
{ value: 13, intensity: 0.95, color: "#CACACA" },
|
|
108
|
+
{ value: 8, intensity: 0.9, color: "#CACACA" },
|
|
109
|
+
{ value: 5, intensity: 0.7, color: "#CACACA" },
|
|
110
|
+
{ value: 3, intensity: 0.5, color: "#CACACA" },
|
|
111
|
+
{ value: 2, intensity: 0.3, color: "#CACACA" },
|
|
112
|
+
{ value: 1, intensity: 0.2, color: "#CACACA" }
|
|
113
|
+
],
|
|
114
|
+
skeletonConfig: Ae({
|
|
115
|
+
defaultConfig: e.value,
|
|
116
|
+
userConfig: {
|
|
117
|
+
style: {
|
|
118
|
+
animation: { show: !1 },
|
|
119
|
+
backgroundColor: "#99999930"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
})
|
|
123
|
+
}), c = p(e.value.style.layout.width), k = p(e.value.style.layout.height), { svgRef: T } = Te({ config: e.value.style.title });
|
|
124
|
+
function C() {
|
|
125
|
+
const l = ne({
|
|
126
|
+
userConfig: _.config,
|
|
127
|
+
defaultConfig: q
|
|
128
|
+
});
|
|
129
|
+
return l.theme ? {
|
|
130
|
+
...ne({
|
|
131
|
+
userConfig: we.vue_ui_sparkhistogram[l.theme] || _.config,
|
|
132
|
+
defaultConfig: l
|
|
133
|
+
})
|
|
134
|
+
} : l;
|
|
135
|
+
}
|
|
136
|
+
Z(() => {
|
|
137
|
+
D();
|
|
138
|
+
});
|
|
139
|
+
const z = F(() => !!e.value.debug);
|
|
140
|
+
function D() {
|
|
141
|
+
if (ze(_.dataset) ? se({
|
|
142
|
+
componentName: "VueUiSparkHistogram",
|
|
143
|
+
type: "dataset",
|
|
144
|
+
debug: z.value
|
|
145
|
+
}) : _.dataset.forEach((l, n) => {
|
|
146
|
+
Se({
|
|
147
|
+
datasetObject: l,
|
|
148
|
+
requiredAttributes: ["value"]
|
|
149
|
+
}).forEach((t) => {
|
|
150
|
+
se({
|
|
151
|
+
componentName: "VueUiSparkHistogram",
|
|
152
|
+
type: "datasetSerieAttribute",
|
|
153
|
+
property: t,
|
|
154
|
+
index: n,
|
|
155
|
+
debug: z.value
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
}), e.value.responsive) {
|
|
159
|
+
const l = Le(() => {
|
|
160
|
+
const { width: n, height: t } = Me({
|
|
161
|
+
chart: $.value,
|
|
162
|
+
title: e.value.style.title.text ? N.value : null,
|
|
163
|
+
source: S.value
|
|
164
|
+
});
|
|
165
|
+
requestAnimationFrame(() => {
|
|
166
|
+
c.value = Math.max(10, n), k.value = Math.max(10, t - 12);
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
y.value && (L.value && y.value.unobserve(L.value), y.value.disconnect()), y.value = new ResizeObserver(l), L.value = $.value.parentNode, y.value.observe(L.value);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
ee(() => _.config, (l) => {
|
|
173
|
+
e.value = C(), D();
|
|
174
|
+
}, { deep: !0 });
|
|
175
|
+
const s = F(() => {
|
|
176
|
+
const l = k.value, n = c.value, t = e.value.style.layout.padding.top, u = l - e.value.style.layout.padding.bottom, b = e.value.style.layout.padding.left, H = n - e.value.style.layout.padding.right, O = t + (l - t - e.value.style.layout.padding.bottom) / 2, Y = l - e.value.style.layout.padding.top - e.value.style.layout.padding.bottom, V = n - e.value.style.layout.padding.left - e.value.style.layout.padding.right;
|
|
177
|
+
return {
|
|
178
|
+
bottom: u,
|
|
179
|
+
centerY: O,
|
|
180
|
+
drawingHeight: Y,
|
|
181
|
+
drawingWidth: V,
|
|
182
|
+
height: l,
|
|
183
|
+
left: b,
|
|
184
|
+
right: H,
|
|
185
|
+
top: t,
|
|
186
|
+
width: n
|
|
187
|
+
};
|
|
188
|
+
}), E = F(() => Math.max(...i.value.map((l) => Math.abs(l.value || 0))));
|
|
189
|
+
function W(l) {
|
|
190
|
+
return Math.abs(l) / E.value;
|
|
191
|
+
}
|
|
192
|
+
const r = F(() => i.value.map((l, n) => {
|
|
193
|
+
const t = W(l.value || 0), u = s.value.drawingHeight * t, b = s.value.drawingWidth / i.value.length, H = b * (e.value.style.bars.gap / 100), O = b - H, Y = s.value.centerY - u / 2, V = s.value.left + (H / 2 + n * b), de = s.value.left + n * b, J = typeof l.intensity > "u" ? 100 : Math.round(l.intensity * 100), ye = l.color ? l.color : l.value >= 0 ? w(e.value.style.bars.colors.positive, J) : w(e.value.style.bars.colors.negative, J), he = l.color ? l.color : l.value >= 0 ? e.value.style.bars.colors.positive : e.value.style.bars.colors.negative, fe = l.color ? `url(#gradient_datapoint_${n}_${x.value})` : l.value >= 0 ? `url(#gradient_positive_${n}_${x.value})` : `url(#gradient_negative_${n}_${x.value})`, pe = V + O / 2;
|
|
194
|
+
return {
|
|
195
|
+
...l,
|
|
196
|
+
color: ye,
|
|
197
|
+
gradient: fe,
|
|
198
|
+
height: u,
|
|
199
|
+
intensity: J,
|
|
200
|
+
proportion: t,
|
|
201
|
+
stroke: he,
|
|
202
|
+
textAnchor: pe,
|
|
203
|
+
trapX: de,
|
|
204
|
+
unitWidth: b,
|
|
205
|
+
width: O,
|
|
206
|
+
x: V,
|
|
207
|
+
y: Y
|
|
208
|
+
};
|
|
209
|
+
}));
|
|
210
|
+
function I(l, n) {
|
|
211
|
+
return oe(
|
|
212
|
+
e.value.style.labels.value.formatter,
|
|
213
|
+
l.value,
|
|
214
|
+
ie({
|
|
215
|
+
p: e.value.style.labels.value.prefix,
|
|
216
|
+
v: l.value,
|
|
217
|
+
s: e.value.style.labels.value.suffix,
|
|
218
|
+
r: e.value.style.labels.value.rounding
|
|
219
|
+
}),
|
|
220
|
+
{ datapoint: l, seriesIndex: n }
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
const v = p(null), B = X;
|
|
224
|
+
function P(l, n) {
|
|
225
|
+
B("selectDatapoint", { datapoint: l, index: n }), e.value.events.datapointClick && e.value.events.datapointClick({ datapoint: l, seriesIndex: n });
|
|
226
|
+
}
|
|
227
|
+
function ue(l, n) {
|
|
228
|
+
v.value = n, e.value.events.datapointEnter && e.value.events.datapointEnter({ datapoint: l, seriesIndex: n });
|
|
229
|
+
}
|
|
230
|
+
function re(l, n) {
|
|
231
|
+
v.value = null, e.value.events.datapointLeave && e.value.events.datapointLeave({ datapoint: l, seriesIndex: n });
|
|
232
|
+
}
|
|
233
|
+
const ve = F(() => `${e.value.style.animation.speedMs}ms`), ce = F(() => s.value.drawingWidth / i.value.length * 0.9), { fitText: M } = De({
|
|
234
|
+
svgRef: T,
|
|
235
|
+
unitWidth: ce
|
|
236
|
+
});
|
|
237
|
+
return Z(async () => {
|
|
238
|
+
await Q(), M(".vue-ui-sparkhistogram-top-label", e.value.style.labels.value.minFontSize), M(".vue-ui-sparkhistogram-bottom-label", e.value.style.labels.valueLabel.minFontSize), M(".vue-ui-sparkhistogram-time-label", e.value.style.labels.timeLabel.minFontSize);
|
|
239
|
+
}), ee([c, k, () => i.value], async () => {
|
|
240
|
+
await Q(), M(".vue-ui-sparkhistogram-top-label", e.value.style.labels.value.minFontSize), M(".vue-ui-sparkhistogram-bottom-label", e.value.style.labels.valueLabel.minFontSize), M(".vue-ui-sparkhistogram-time-label", e.value.style.labels.timeLabel.minFontSize);
|
|
241
|
+
}), (l, n) => (a(), o("div", {
|
|
242
|
+
class: "vue-ui-spark-histogram",
|
|
243
|
+
ref_key: "histogramChart",
|
|
244
|
+
ref: $,
|
|
245
|
+
style: R(`width:100%;background:${e.value.style.backgroundColor};font-family:${e.value.style.fontFamily}`),
|
|
246
|
+
onMouseleave: n[0] || (n[0] = (t) => v.value = null)
|
|
247
|
+
}, [
|
|
248
|
+
e.value.style.title.text ? (a(), o("div", {
|
|
249
|
+
key: 0,
|
|
250
|
+
ref_key: "chartTitle",
|
|
251
|
+
ref: N,
|
|
252
|
+
style: R(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${e.value.style.title.margin};padding: 0 6px;text-align:${e.value.style.title.textAlign}`)
|
|
253
|
+
}, [
|
|
254
|
+
m("div", {
|
|
255
|
+
style: R(`font-size:${e.value.style.title.fontSize}px;color:${e.value.style.title.color};font-weight:${e.value.style.title.bold ? "bold" : "normal"}`)
|
|
256
|
+
}, [
|
|
257
|
+
_e(A(e.value.style.title.text) + " ", 1),
|
|
258
|
+
v.value !== null ? (a(), o("span", We, "- " + A(r.value[v.value].timeLabel || "") + " " + A(d(oe)(
|
|
259
|
+
e.value.style.labels.value.formatter,
|
|
260
|
+
r.value[v.value].value,
|
|
261
|
+
d(ie)({
|
|
262
|
+
p: e.value.style.labels.value.prefix,
|
|
263
|
+
v: r.value[v.value].value,
|
|
264
|
+
s: e.value.style.labels.value.suffix,
|
|
265
|
+
r: e.value.style.labels.value.rounding
|
|
266
|
+
}),
|
|
267
|
+
{ datapoint: r.value[v.value], seriesIndex: v.value }
|
|
268
|
+
)), 1)) : h("", !0),
|
|
269
|
+
![void 0, null].includes(v.value) && ![null, void 0].includes(r.value[v.value].valueLabel) ? (a(), o("span", Be, "(" + A(r.value[v.value].valueLabel || 0) + ")", 1)) : h("", !0)
|
|
270
|
+
], 4),
|
|
271
|
+
e.value.style.title.subtitle.text ? (a(), o("div", {
|
|
272
|
+
key: 0,
|
|
273
|
+
style: R(`font-size:${e.value.style.title.subtitle.fontSize}px;color:${e.value.style.title.subtitle.color};font-weight:${e.value.style.title.subtitle.bold ? "bold" : "normal"}`)
|
|
274
|
+
}, A(e.value.style.title.subtitle.text), 5)) : h("", !0)
|
|
275
|
+
], 4)) : h("", !0),
|
|
276
|
+
(a(), o("svg", {
|
|
277
|
+
ref_key: "svgRef",
|
|
278
|
+
ref: T,
|
|
279
|
+
xmlns: d($e),
|
|
280
|
+
viewBox: `0 0 ${s.value.width} ${s.value.height}`,
|
|
281
|
+
style: { overflow: "visible" }
|
|
282
|
+
}, [
|
|
283
|
+
xe(d(j)),
|
|
284
|
+
l.$slots["chart-background"] ? (a(), o("foreignObject", {
|
|
285
|
+
key: 0,
|
|
286
|
+
x: 0,
|
|
287
|
+
y: 0,
|
|
288
|
+
width: s.value.width,
|
|
289
|
+
height: s.value.height,
|
|
290
|
+
style: {
|
|
291
|
+
pointerEvents: "none"
|
|
292
|
+
}
|
|
293
|
+
}, [
|
|
294
|
+
le(l.$slots, "chart-background", {}, void 0, !0)
|
|
295
|
+
], 8, Oe)) : h("", !0),
|
|
296
|
+
m("defs", null, [
|
|
297
|
+
(a(!0), o(f, null, g(r.value, (t, u) => (a(), o("radialGradient", {
|
|
298
|
+
id: `gradient_positive_${u}_${x.value}`,
|
|
299
|
+
cy: "50%",
|
|
300
|
+
cx: "50%",
|
|
301
|
+
r: "50%",
|
|
302
|
+
fx: "50%",
|
|
303
|
+
fy: "50%"
|
|
304
|
+
}, [
|
|
305
|
+
m("stop", {
|
|
306
|
+
offset: "0%",
|
|
307
|
+
"stop-color": d(w)(d(K)(e.value.style.bars.colors.positive, 0.05), t.intensity)
|
|
308
|
+
}, null, 8, Re),
|
|
309
|
+
m("stop", {
|
|
310
|
+
offset: "100%",
|
|
311
|
+
"stop-color": d(w)(e.value.style.bars.colors.positive, t.intensity)
|
|
312
|
+
}, null, 8, Ue)
|
|
313
|
+
], 8, Ve))), 256)),
|
|
314
|
+
(a(!0), o(f, null, g(r.value, (t, u) => (a(), o("radialGradient", {
|
|
315
|
+
id: `gradient_negative_${u}_${x.value}`,
|
|
316
|
+
cy: "50%",
|
|
317
|
+
cx: "50%",
|
|
318
|
+
r: "50%",
|
|
319
|
+
fx: "50%",
|
|
320
|
+
fy: "50%"
|
|
321
|
+
}, [
|
|
322
|
+
m("stop", {
|
|
323
|
+
offset: "0%",
|
|
324
|
+
"stop-color": d(w)(d(K)(e.value.style.bars.colors.negative, 0.05), t.intensity)
|
|
325
|
+
}, null, 8, je),
|
|
326
|
+
m("stop", {
|
|
327
|
+
offset: "100%",
|
|
328
|
+
"stop-color": d(w)(e.value.style.bars.colors.negative, t.intensity)
|
|
329
|
+
}, null, 8, qe)
|
|
330
|
+
], 8, Xe))), 256)),
|
|
331
|
+
(a(!0), o(f, null, g(r.value, (t, u) => (a(), o("radialGradient", {
|
|
332
|
+
id: `gradient_datapoint_${u}_${x.value}`,
|
|
333
|
+
cy: "50%",
|
|
334
|
+
cx: "50%",
|
|
335
|
+
r: "50%",
|
|
336
|
+
fx: "50%",
|
|
337
|
+
fy: "50%"
|
|
338
|
+
}, [
|
|
339
|
+
m("stop", {
|
|
340
|
+
offset: "0%",
|
|
341
|
+
"stop-color": d(w)(d(K)(t.color, 0.05), t.intensity)
|
|
342
|
+
}, null, 8, Pe),
|
|
343
|
+
m("stop", {
|
|
344
|
+
offset: "100%",
|
|
345
|
+
"stop-color": d(w)(t.color, t.intensity)
|
|
346
|
+
}, null, 8, Ye)
|
|
347
|
+
], 8, Ge))), 256))
|
|
348
|
+
]),
|
|
349
|
+
(a(!0), o(f, null, g(r.value, (t, u) => (a(), o("g", null, [
|
|
350
|
+
v.value !== null && v.value === u ? (a(), o("rect", {
|
|
351
|
+
key: 0,
|
|
352
|
+
height: s.value.height,
|
|
353
|
+
width: t.unitWidth,
|
|
354
|
+
fill: e.value.style.selector.fill,
|
|
355
|
+
x: t.trapX,
|
|
356
|
+
y: 0,
|
|
357
|
+
stroke: e.value.style.selector.stroke,
|
|
358
|
+
"stroke-width": e.value.style.selector.strokeWidth,
|
|
359
|
+
rx: e.value.style.selector.borderRadius,
|
|
360
|
+
"stroke-dasharray": e.value.style.selector.strokeDasharray
|
|
361
|
+
}, null, 8, Je)) : h("", !0)
|
|
362
|
+
]))), 256)),
|
|
363
|
+
!e.value.style.bars.shape || e.value.style.bars.shape === "square" ? (a(), o("g", Ke, [
|
|
364
|
+
(a(!0), o(f, null, g(r.value, (t, u) => (a(), o("rect", {
|
|
365
|
+
x: t.x,
|
|
366
|
+
y: t.y,
|
|
367
|
+
height: t.height,
|
|
368
|
+
width: t.width,
|
|
369
|
+
fill: e.value.style.bars.colors.gradient.show ? t.gradient : t.color,
|
|
370
|
+
stroke: t.stroke,
|
|
371
|
+
"stroke-width": e.value.style.bars.strokeWidth,
|
|
372
|
+
rx: `${e.value.style.bars.borderRadius * t.proportion / 12}%`,
|
|
373
|
+
class: ae({ "vue-ui-sparkhistogram-shape": e.value.style.animation.show })
|
|
374
|
+
}, null, 10, Qe))), 256))
|
|
375
|
+
])) : (a(), o("g", Ze, [
|
|
376
|
+
(a(!0), o(f, null, g(r.value, (t, u) => (a(), te(Ee, {
|
|
377
|
+
plot: { x: t.x + t.width / 2, y: t.y + t.height / 2 },
|
|
378
|
+
color: e.value.style.bars.colors.gradient.show ? t.gradient : t.color,
|
|
379
|
+
shape: e.value.style.bars.shape,
|
|
380
|
+
radius: Math.min(t.height * 0.4, t.width * 0.4),
|
|
381
|
+
class: ae({ "vue-ui-sparkhistogram-shape": e.value.style.animation.show })
|
|
382
|
+
}, null, 8, ["plot", "color", "shape", "radius", "class"]))), 256))
|
|
383
|
+
])),
|
|
384
|
+
d(G) ? h("", !0) : (a(), o(f, { key: 3 }, [
|
|
385
|
+
(a(!0), o(f, null, g(r.value, (t, u) => (a(), o("text", {
|
|
386
|
+
class: "vue-ui-sparkhistogram-top-label",
|
|
387
|
+
"text-anchor": "middle",
|
|
388
|
+
x: t.textAnchor,
|
|
389
|
+
y: t.y - e.value.style.labels.value.fontSize / 3 + e.value.style.labels.value.offsetY,
|
|
390
|
+
"font-size": e.value.style.labels.value.fontSize,
|
|
391
|
+
"font-weight": e.value.style.labels.value.bold ? "bold" : "normal",
|
|
392
|
+
fill: e.value.style.labels.value.color
|
|
393
|
+
}, A(I(t, u)), 9, et))), 256)),
|
|
394
|
+
(a(!0), o(f, null, g(r.value, (t, u) => (a(), o("g", null, [
|
|
395
|
+
t.valueLabel ? (a(), o("text", {
|
|
396
|
+
key: 0,
|
|
397
|
+
class: "vue-ui-sparkhistogram-bottom-label",
|
|
398
|
+
x: t.textAnchor,
|
|
399
|
+
y: t.y + t.height + e.value.style.labels.valueLabel.fontSize,
|
|
400
|
+
"font-size": e.value.style.labels.valueLabel.fontSize,
|
|
401
|
+
"text-anchor": "middle",
|
|
402
|
+
fill: e.value.style.labels.valueLabel.color
|
|
403
|
+
}, A(t.valueLabel), 9, tt)) : h("", !0)
|
|
404
|
+
]))), 256)),
|
|
405
|
+
(a(!0), o(f, null, g(r.value, (t, u) => (a(), o("g", null, [
|
|
406
|
+
t.timeLabel ? (a(), o("text", {
|
|
407
|
+
key: 0,
|
|
408
|
+
class: "vue-ui-sparkhistogram-time-label",
|
|
409
|
+
x: t.textAnchor,
|
|
410
|
+
y: s.value.height - e.value.style.labels.timeLabel.fontSize / 2,
|
|
411
|
+
"font-size": e.value.style.labels.timeLabel.fontSize,
|
|
412
|
+
fill: e.value.style.labels.timeLabel.color,
|
|
413
|
+
"text-anchor": "middle"
|
|
414
|
+
}, A(t.timeLabel), 9, lt)) : h("", !0)
|
|
415
|
+
]))), 256))
|
|
416
|
+
], 64)),
|
|
417
|
+
(a(!0), o(f, null, g(r.value, (t, u) => (a(), o("g", null, [
|
|
418
|
+
m("rect", {
|
|
419
|
+
height: s.value.height,
|
|
420
|
+
width: t.unitWidth,
|
|
421
|
+
fill: "transparent",
|
|
422
|
+
x: t.trapX,
|
|
423
|
+
y: 0,
|
|
424
|
+
onMouseover: (b) => ue(t, u),
|
|
425
|
+
onMouseleave: (b) => re(t, u),
|
|
426
|
+
onClick: () => P(t, u)
|
|
427
|
+
}, null, 40, at)
|
|
428
|
+
]))), 256))
|
|
429
|
+
], 8, He)),
|
|
430
|
+
l.$slots.source ? (a(), o("div", {
|
|
431
|
+
key: 1,
|
|
432
|
+
ref_key: "source",
|
|
433
|
+
ref: S,
|
|
434
|
+
dir: "auto"
|
|
435
|
+
}, [
|
|
436
|
+
le(l.$slots, "source", {}, void 0, !0)
|
|
437
|
+
], 512)) : h("", !0),
|
|
438
|
+
d(G) ? (a(), te(Ne, { key: 2 })) : h("", !0)
|
|
439
|
+
], 36));
|
|
440
|
+
}
|
|
441
|
+
}, yt = /* @__PURE__ */ Ie(st, [["__scopeId", "data-v-f8e879db"]]);
|
|
442
|
+
export {
|
|
443
|
+
yt as default
|
|
444
|
+
};
|