vue-data-ui 2.3.89 → 2.3.90
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-6DWnAEHt.js → Arrow-C_Fnn6al.js} +1 -1
- package/dist/{Arrow-CW5gDSmt.cjs → Arrow-D1pymKl6.cjs} +1 -1
- package/dist/{BaseIcon-Dj8EbAXm.js → BaseIcon-BMfi5PnL.js} +1 -1
- package/dist/{BaseIcon-B_MrASni.cjs → BaseIcon-CnFXP_n9.cjs} +1 -1
- package/dist/{DataTable-BmYcdJ1w.js → DataTable-Cmbf3abv.js} +2 -2
- package/dist/{DataTable-DAwK5x3h.cjs → DataTable-cOEA6Z37.cjs} +1 -1
- package/dist/{Legend-BRG8ddDy.js → Legend-CCq0mNRg.js} +1 -1
- package/dist/{Legend-DhQ-a1RH.cjs → Legend-XqP6-7Ac.cjs} +1 -1
- package/dist/{Shape-D7jva0XA.cjs → Shape-B51JGReT.cjs} +1 -1
- package/dist/{Shape-BcL3EDZ5.js → Shape-BNocET8E.js} +1 -1
- package/dist/{Slicer-DI1kgq9D.js → Slicer-BKszZXjM.js} +2 -2
- package/dist/{Slicer-DV29nclP.cjs → Slicer-Bc7OWCcl.cjs} +1 -1
- package/dist/{Title-DYwo_Q5b.cjs → Title-BaR4XyXa.cjs} +1 -1
- package/dist/{Title-fAvrqioZ.js → Title-DlBwa3-X.js} +1 -1
- package/dist/{Tooltip-03RvVGln.cjs → Tooltip-CX57w9Q9.cjs} +1 -1
- package/dist/{Tooltip-TZYYFvPe.js → Tooltip-w32n-8sY.js} +1 -1
- package/dist/{index-BKTciLz4.cjs → index-B8EMsnjU.cjs} +1 -1
- package/dist/{index-Ca4RHJ4t.js → index-DQl1TFXa.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-BFnXnY0k.cjs → useNestedProp-DlCe_zZz.cjs} +1 -1
- package/dist/{useNestedProp-vP7uimPz.js → useNestedProp-lmeFt-ev.js} +1 -1
- package/dist/{usePrinter-CxYg-Dw-.cjs → usePrinter-BmXrEJ99.cjs} +1 -1
- package/dist/{usePrinter-5fwXghqP.js → usePrinter-DgKGVvJC.js} +1 -1
- package/dist/{vue-data-ui-4VG00HFR.js → vue-data-ui-Byrb_Y3k.js} +57 -57
- package/dist/{vue-data-ui-BaLkNH7M.cjs → vue-data-ui-DQurgvN8.cjs} +1 -1
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-DPJWcxqV.js → vue-ui-3d-bar-CM_usP2U.js} +7 -7
- package/dist/{vue-ui-3d-bar-rOT9iPsm.cjs → vue-ui-3d-bar-Ce-Re50D.cjs} +1 -1
- package/dist/{vue-ui-accordion-vYoYjedX.js → vue-ui-accordion-CroZrm7T.js} +3 -3
- package/dist/{vue-ui-accordion-SXHdW20_.cjs → vue-ui-accordion-DRI-fN6I.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-BEC4SHLl.js → vue-ui-age-pyramid-BZU-WI_a.js} +8 -8
- package/dist/{vue-ui-age-pyramid-HElID9Ax.cjs → vue-ui-age-pyramid-C08rTXJn.cjs} +1 -1
- package/dist/{vue-ui-annotator-B1NZRuJJ.cjs → vue-ui-annotator-BpzM25VY.cjs} +1 -1
- package/dist/{vue-ui-annotator-DFpv61wn.js → vue-ui-annotator-CsfYgmrC.js} +1 -1
- package/dist/{vue-ui-candlestick-AEKT8X3p.js → vue-ui-candlestick-BPi7aBEf.js} +9 -9
- package/dist/{vue-ui-candlestick-p1s0Av21.cjs → vue-ui-candlestick-m8fjxbj-.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-DCk2p-1k.cjs → vue-ui-carousel-table-CpodLcgX.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-DhzVxOvp.js → vue-ui-carousel-table-tbviS8Fo.js} +4 -4
- package/dist/{vue-ui-chestnut-oFfB3fBF.cjs → vue-ui-chestnut-Y0gQvbbf.cjs} +1 -1
- package/dist/{vue-ui-chestnut-qqcIpMGB.js → vue-ui-chestnut-ql9yEs6j.js} +6 -6
- package/dist/{vue-ui-cursor-CvJgJk1M.cjs → vue-ui-cursor-B3w0SgJP.cjs} +1 -1
- package/dist/{vue-ui-cursor-CgSghVjL.js → vue-ui-cursor-Dw7_R_Pd.js} +2 -2
- package/dist/{vue-ui-dashboard-CYzkic0X.js → vue-ui-dashboard-DAY0cdat.js} +2 -2
- package/dist/{vue-ui-dashboard-CtJdVmtu.cjs → vue-ui-dashboard-enrB5B3P.cjs} +1 -1
- package/dist/{vue-ui-digits-C0dMG-hR.cjs → vue-ui-digits-3Q6uZCzD.cjs} +1 -1
- package/dist/{vue-ui-digits-BO1hSjoq.js → vue-ui-digits-DN6CRpXc.js} +2 -2
- package/dist/{vue-ui-donut-DP-yxiw3.js → vue-ui-donut-B3yDJvZI.js} +9 -9
- package/dist/{vue-ui-donut-Dnnoj71c.cjs → vue-ui-donut-CCm7GJsm.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-C-yDyglF.js → vue-ui-donut-evolution-CzBvVRKG.js} +9 -9
- package/dist/{vue-ui-donut-evolution-vBUH5VVx.cjs → vue-ui-donut-evolution-DiN8Jm0n.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-BUA_uSse.cjs → vue-ui-dumbbell-lb72j7bY.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-D2SQ4cKV.js → vue-ui-dumbbell-vQ5YRGwJ.js} +8 -8
- package/dist/{vue-ui-flow-B-AFlw-n.cjs → vue-ui-flow-B5Gxaqvl.cjs} +1 -1
- package/dist/{vue-ui-flow-D_E9V2A1.js → vue-ui-flow-DAOKURA6.js} +7 -7
- package/dist/{vue-ui-galaxy-DqE2UiA3.js → vue-ui-galaxy-B86BK1JM.js} +9 -9
- package/dist/{vue-ui-galaxy-CbL5nONj.cjs → vue-ui-galaxy-Ck5cPkrh.cjs} +1 -1
- package/dist/{vue-ui-gauge-BUV_hQND.cjs → vue-ui-gauge-BwIhwSUw.cjs} +1 -1
- package/dist/{vue-ui-gauge-CFYXDw2p.js → vue-ui-gauge-n8TilFo9.js} +5 -5
- package/dist/{vue-ui-gizmo-BWztIJ3j.js → vue-ui-gizmo-CFIBlG4V.js} +2 -2
- package/dist/{vue-ui-gizmo-B-LxuvDh.cjs → vue-ui-gizmo-DrGaoiM_.cjs} +1 -1
- package/dist/{vue-ui-heatmap-DW5StHKM.cjs → vue-ui-heatmap-BLc6thGZ.cjs} +1 -1
- package/dist/{vue-ui-heatmap-E1MlhSCs.js → vue-ui-heatmap-ZkmD9EAg.js} +8 -8
- package/dist/{vue-ui-kpi-DeP0XmP7.js → vue-ui-kpi-CtJ3t6GX.js} +3 -3
- package/dist/{vue-ui-kpi-BWDPF-9X.cjs → vue-ui-kpi-D6Myg0y1.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-D5e8uW_d.cjs → vue-ui-mini-loader-BjJ_YYZj.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-Bal12IrX.js → vue-ui-mini-loader-Cosy9XjR.js} +2 -2
- package/dist/{vue-ui-molecule-DHBId4h4.cjs → vue-ui-molecule-CAj1HFit.cjs} +1 -1
- package/dist/{vue-ui-molecule-DHrHeQgF.js → vue-ui-molecule-DTFOBjgC.js} +9 -9
- package/dist/{vue-ui-mood-radar-DSXB9l99.cjs → vue-ui-mood-radar-CV2in2wO.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-dJaJotNf.js → vue-ui-mood-radar-J_dI9m_i.js} +9 -9
- package/dist/{vue-ui-nested-donuts-CEX2cvop.cjs → vue-ui-nested-donuts-4vO23n9z.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts--K9ygdH3.js → vue-ui-nested-donuts-CtqU4xxu.js} +9 -9
- package/dist/{vue-ui-onion-Iekdjs8b.cjs → vue-ui-onion-B3mtn6xf.cjs} +1 -1
- package/dist/{vue-ui-onion-Bm1inM56.js → vue-ui-onion-BMo0Ye54.js} +9 -9
- package/dist/{vue-ui-parallel-coordinate-plot-OlFoYL_3.cjs → vue-ui-parallel-coordinate-plot-DFMbhLY9.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-9PSGD-LR.js → vue-ui-parallel-coordinate-plot-yKLZbDS5.js} +10 -10
- package/dist/{vue-ui-quadrant-iGQbx93I.js → vue-ui-quadrant-BrRasVaj.js} +10 -10
- package/dist/{vue-ui-quadrant-CgJeo2zZ.cjs → vue-ui-quadrant-CpJX1Jwa.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-Du8lDPmh.cjs → vue-ui-quick-chart-CTxsI2tk.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-DeEQcx6A.js → vue-ui-quick-chart-uH33UIjX.js} +7 -7
- package/dist/{vue-ui-radar-DfnhsNQV.js → vue-ui-radar-BJ3qMHP4.js} +10 -10
- package/dist/{vue-ui-radar-BYk9DWnM.cjs → vue-ui-radar-DFjsXmJ3.cjs} +1 -1
- package/dist/{vue-ui-rating-D0rgVdkT.cjs → vue-ui-rating-BEWaQMBR.cjs} +1 -1
- package/dist/{vue-ui-rating-CCesFD6e.js → vue-ui-rating-BFskhiyh.js} +2 -2
- package/dist/{vue-ui-relation-circle-8eoBav4O.cjs → vue-ui-relation-circle-DXuKdCih.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-D2GXm_Fk.js → vue-ui-relation-circle-DdK4qk0P.js} +5 -5
- package/dist/{vue-ui-rings-B7_-G3JM.js → vue-ui-rings-BqHSq6Wt.js} +9 -9
- package/dist/{vue-ui-rings-CScmcQ1n.cjs → vue-ui-rings-D_T_D6AS.cjs} +1 -1
- package/dist/{vue-ui-scatter-DdhiNjLc.js → vue-ui-scatter-C0gfF6NJ.js} +10 -10
- package/dist/{vue-ui-scatter-BnBI8qdt.cjs → vue-ui-scatter-DPByFMNL.cjs} +1 -1
- package/dist/{vue-ui-screenshot-Cpy2qbf1.js → vue-ui-screenshot-6tOLntj9.js} +1 -1
- package/dist/{vue-ui-screenshot-BrhjnTwn.cjs → vue-ui-screenshot-CbvIYfYU.cjs} +1 -1
- package/dist/{vue-ui-skeleton-D7aLznpP.js → vue-ui-skeleton-BVJGmYjj.js} +2 -2
- package/dist/{vue-ui-skeleton-pDeQ3NcD.cjs → vue-ui-skeleton-Bli7jLZ7.cjs} +1 -1
- package/dist/{vue-ui-smiley-vcpYARLj.js → vue-ui-smiley-2EoxEmXW.js} +2 -2
- package/dist/{vue-ui-smiley-Cj0yi7_H.cjs → vue-ui-smiley-CUgH2tnV.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-CFJSCQnf.js → vue-ui-spark-trend-DjNPMOkN.js} +4 -4
- package/dist/{vue-ui-spark-trend-BW8k0jDd.cjs → vue-ui-spark-trend-sfgUJ32Q.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-CgRdDfk6.js → vue-ui-sparkbar-BBm3DE1P.js} +3 -3
- package/dist/{vue-ui-sparkbar-BbJHfAQj.cjs → vue-ui-sparkbar-CKWYzriN.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-BESRB8_4.cjs → vue-ui-sparkgauge-D0q9F9Nz.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-CCPMNge0.js → vue-ui-sparkgauge-IIW24eJQ.js} +3 -3
- package/dist/{vue-ui-sparkhistogram-BYnSfLdb.cjs → vue-ui-sparkhistogram-CywhBkm2.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-D5z2Wtpk.js → vue-ui-sparkhistogram-DVXxA6ji.js} +4 -4
- package/dist/{vue-ui-sparkline-D5WUy4p5.cjs → vue-ui-sparkline-Besp8Ffy.cjs} +1 -1
- package/dist/{vue-ui-sparkline-KYN0oKt1.js → vue-ui-sparkline-CH89kcaa.js} +3 -3
- package/dist/{vue-ui-sparkstackbar-7lurD9-4.js → vue-ui-sparkstackbar-Bcod5yu_.js} +83 -70
- package/dist/vue-ui-sparkstackbar-qXm8Ozzm.cjs +1 -0
- package/dist/{vue-ui-stackbar-Ch-fmE9l.cjs → vue-ui-stackbar-D0fGVkCR.cjs} +1 -1
- package/dist/{vue-ui-stackbar-CsVmAvl3.js → vue-ui-stackbar-Djjcgtyg.js} +10 -10
- package/dist/{vue-ui-strip-plot-B63AgKts.js → vue-ui-strip-plot-ByPCQ4xk.js} +9 -9
- package/dist/{vue-ui-strip-plot-BLRl-tF6.cjs → vue-ui-strip-plot-XDj8rL9m.cjs} +1 -1
- package/dist/{vue-ui-table-hPqdMR-m.cjs → vue-ui-table-B6Kpda3o.cjs} +1 -1
- package/dist/{vue-ui-table-G5O8K-F_.js → vue-ui-table-D8Sm2fzX.js} +1 -1
- package/dist/{vue-ui-table-heatmap-BhVuTdSS.cjs → vue-ui-table-heatmap-DjEN0l12.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-t9Ngijvp.js → vue-ui-table-heatmap-mlq_J56h.js} +4 -4
- package/dist/{vue-ui-table-sparkline-DtjJrGve.cjs → vue-ui-table-sparkline-DByva7rj.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-BX4en1c-.js → vue-ui-table-sparkline-DF29_qZk.js} +5 -5
- package/dist/{vue-ui-thermometer-BWGyDQ7_.js → vue-ui-thermometer-BKf-rGuS.js} +5 -5
- package/dist/{vue-ui-thermometer-B07RI9fZ.cjs → vue-ui-thermometer-C3T56ras.cjs} +1 -1
- package/dist/{vue-ui-timer-8AlVLAJi.js → vue-ui-timer-B8jW8M60.js} +4 -4
- package/dist/{vue-ui-timer-CXrENAVg.cjs → vue-ui-timer-B_ZvV1ON.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-C43c4_IR.cjs → vue-ui-tiremarks-DRbSpTgq.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-DYIHGkBU.js → vue-ui-tiremarks-riEfve5q.js} +5 -5
- package/dist/{vue-ui-treemap-mmvdTHiX.js → vue-ui-treemap-5F0ynBnb.js} +9 -9
- package/dist/{vue-ui-treemap-BN90ISQv.cjs → vue-ui-treemap-CtKUTs2G.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-BRDO_Rsu.cjs → vue-ui-vertical-bar-BBIWdeXH.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-DAKHNRoR.js → vue-ui-vertical-bar-CxRBvHZy.js} +9 -9
- package/dist/{vue-ui-waffle-BN_yZEtJ.cjs → vue-ui-waffle-9a3C4Nj-.cjs} +1 -1
- package/dist/{vue-ui-waffle-B-A4NYNd.js → vue-ui-waffle-B8G4i5WH.js} +9 -9
- package/dist/{vue-ui-wheel-50_zeiIW.cjs → vue-ui-wheel-CErxlmqw.cjs} +1 -1
- package/dist/{vue-ui-wheel-DN9WvA6Z.js → vue-ui-wheel-DmzkGeCY.js} +5 -5
- package/dist/{vue-ui-word-cloud-BWTyaGAT.js → vue-ui-word-cloud-dMBTVGVk.js} +7 -7
- package/dist/{vue-ui-word-cloud-BVoFIb_q.cjs → vue-ui-word-cloud-nmx846H2.cjs} +1 -1
- package/dist/{vue-ui-xy-CJHHesUD.cjs → vue-ui-xy-CLYgZk3Y.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-CAcTkk_r.cjs → vue-ui-xy-canvas-CCwtKYgd.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-9NPbm7dE.js → vue-ui-xy-canvas-nraUv13Y.js} +10 -10
- package/dist/{vue-ui-xy-Dzp4qCjk.js → vue-ui-xy-iUQyB_PL.js} +12 -12
- package/package.json +1 -1
- package/dist/vue-ui-sparkstackbar-Dy-IfQ3q.cjs +0 -1
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { computed as f, ref as k, watch as
|
|
2
|
-
import { u as J, c as
|
|
3
|
-
import { u as
|
|
4
|
-
import oe from "./vue-ui-skeleton-
|
|
1
|
+
import { computed as f, ref as k, watch as I, onMounted as X, openBlock as n, createElementBlock as r, normalizeStyle as g, createElementVNode as d, toDisplayString as _, createCommentVNode as y, unref as b, Fragment as D, renderList as P, normalizeClass as N, createBlock as W } from "vue";
|
|
2
|
+
import { u as J, c as U, t as K, a as Q, p as i, d as C, b as R, o as Y, e as O, g as Z, f as V, X as ee, s as te, w as le, i as ae } from "./index-DQl1TFXa.js";
|
|
3
|
+
import { u as G } from "./useNestedProp-lmeFt-ev.js";
|
|
4
|
+
import oe from "./vue-ui-skeleton-BVJGmYjj.js";
|
|
5
5
|
import { _ as se } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
const ne = ["xmlns", "viewBox"], re = ["id"], ue = ["stop-color"], ie = ["stop-color"], ce = ["stop-color"], de = {
|
|
7
7
|
id: "stackPill",
|
|
8
8
|
clipPathUnits: "objectBoundingBox"
|
|
9
|
-
}, ve = ["fill"], ge = {
|
|
9
|
+
}, ve = ["fill"], ge = {
|
|
10
|
+
key: 0,
|
|
11
|
+
"clip-path": "url(#stackPill)"
|
|
12
|
+
}, pe = ["height", "width", "fill"], he = ["onClick", "x", "width", "height", "fill", "stroke"], fe = ["width", "height", "rx"], ye = ["onClick"], me = { style: { display: "flex", "flex-direction": "row", "align-items": "center", gap: "4px", "justify-content": "center" } }, ke = ["height", "width"], _e = ["fill"], be = {
|
|
10
13
|
__name: "vue-ui-sparkstackbar",
|
|
11
14
|
props: {
|
|
12
15
|
config: {
|
|
@@ -23,33 +26,33 @@ const ne = ["xmlns", "viewBox"], re = ["id"], ue = ["stop-color"], ie = ["stop-c
|
|
|
23
26
|
}
|
|
24
27
|
},
|
|
25
28
|
emits: ["selectDatapoint"],
|
|
26
|
-
setup(
|
|
27
|
-
const
|
|
29
|
+
setup(M, { emit: T }) {
|
|
30
|
+
const u = M, { vue_ui_sparkstackbar: q } = J(), z = f(() => !!u.dataset && u.dataset.length), A = k(U()), e = f({
|
|
28
31
|
get: () => L(),
|
|
29
32
|
set: (t) => t
|
|
30
33
|
});
|
|
31
34
|
function L() {
|
|
32
|
-
const t =
|
|
33
|
-
userConfig:
|
|
34
|
-
defaultConfig:
|
|
35
|
+
const t = G({
|
|
36
|
+
userConfig: u.config,
|
|
37
|
+
defaultConfig: q
|
|
35
38
|
});
|
|
36
39
|
return t.theme ? {
|
|
37
|
-
...
|
|
38
|
-
userConfig: K.vue_ui_sparkstackbar[t.theme] ||
|
|
40
|
+
...G({
|
|
41
|
+
userConfig: K.vue_ui_sparkstackbar[t.theme] || u.config,
|
|
39
42
|
defaultConfig: t
|
|
40
43
|
}),
|
|
41
44
|
customPalette: Q[t.theme] || i
|
|
42
45
|
} : t;
|
|
43
46
|
}
|
|
44
|
-
|
|
47
|
+
I(() => u.config, (t) => {
|
|
45
48
|
e.value = L(), B();
|
|
46
|
-
}, { deep: !0 }),
|
|
47
|
-
|
|
49
|
+
}, { deep: !0 }), I(() => u.dataset, (t) => {
|
|
50
|
+
m.value = u.dataset.map((a, l) => ({
|
|
48
51
|
...a,
|
|
49
52
|
color: a.color ? C(a.color) : x.value[l] || i[l] || i[l % i.length]
|
|
50
53
|
}));
|
|
51
54
|
}, { deep: !0 });
|
|
52
|
-
const x = f(() => R(e.value.customPalette)),
|
|
55
|
+
const x = f(() => R(e.value.customPalette)), m = k(u.dataset.map((t, a) => ({
|
|
53
56
|
...t,
|
|
54
57
|
value: e.value.style.animation.show ? 0 : t.value || 0,
|
|
55
58
|
color: t.color ? C(t.color) : x.value[a] || i[a] || i[a % i.length]
|
|
@@ -57,32 +60,32 @@ const ne = ["xmlns", "viewBox"], re = ["id"], ue = ["stop-color"], ie = ["stop-c
|
|
|
57
60
|
X(() => {
|
|
58
61
|
if (B(), e.value.style.animation.show) {
|
|
59
62
|
let h = function() {
|
|
60
|
-
o += l / t, o < l ? (
|
|
63
|
+
o += l / t, o < l ? (m.value = m.value.map((s, c) => ({
|
|
61
64
|
...s,
|
|
62
|
-
value: s.value += a[
|
|
63
|
-
color: s.color ? C(s.color) : x.value[
|
|
64
|
-
})), requestAnimationFrame(h)) : (w.value = !1,
|
|
65
|
+
value: s.value += a[c],
|
|
66
|
+
color: s.color ? C(s.color) : x.value[c] || i[c] || i[c % i.length]
|
|
67
|
+
})), requestAnimationFrame(h)) : (w.value = !1, m.value = u.dataset.map((s, c) => ({
|
|
65
68
|
...s,
|
|
66
69
|
value: s.value || 0,
|
|
67
|
-
color: s.color ? C(s.color) : x.value[
|
|
68
|
-
id:
|
|
70
|
+
color: s.color ? C(s.color) : x.value[c] || i[c] || i[c % i.length],
|
|
71
|
+
id: U()
|
|
69
72
|
})));
|
|
70
73
|
};
|
|
71
|
-
const t = e.value.style.animation.animationFrames, a =
|
|
74
|
+
const t = e.value.style.animation.animationFrames, a = u.dataset.map((s, c) => s.value / t), l = u.dataset.map((s) => s.value || 0).reduce((s, c) => s + c, 0);
|
|
72
75
|
let o = 0;
|
|
73
76
|
w.value = !0, h();
|
|
74
77
|
}
|
|
75
78
|
});
|
|
76
79
|
function B() {
|
|
77
|
-
Y(
|
|
80
|
+
Y(u.dataset) ? O({
|
|
78
81
|
componentName: "VueUiSparkStackbar",
|
|
79
82
|
type: "dataset"
|
|
80
|
-
}) :
|
|
83
|
+
}) : u.dataset.forEach((t, a) => {
|
|
81
84
|
Z({
|
|
82
85
|
datasetObject: t,
|
|
83
86
|
requiredAttributes: ["name", "value"]
|
|
84
87
|
}).forEach((l) => {
|
|
85
|
-
|
|
88
|
+
O({
|
|
86
89
|
componentName: "VueUiSparkStackbar",
|
|
87
90
|
type: "datasetSerieAttribute",
|
|
88
91
|
property: l,
|
|
@@ -91,25 +94,25 @@ const ne = ["xmlns", "viewBox"], re = ["id"], ue = ["stop-color"], ie = ["stop-c
|
|
|
91
94
|
});
|
|
92
95
|
});
|
|
93
96
|
}
|
|
94
|
-
const
|
|
97
|
+
const p = k({
|
|
95
98
|
width: 500,
|
|
96
99
|
height: 16
|
|
97
|
-
}), v = k([]),
|
|
98
|
-
const l = t.value || 0, o = l /
|
|
100
|
+
}), v = k([]), F = f(() => u.dataset.map((t) => t.value || 0).filter((t, a) => !v.value.includes(a)).reduce((t, a) => t + a, 0)), j = f(() => m.value.map((t, a) => {
|
|
101
|
+
const l = t.value || 0, o = l / F.value, h = isNaN(o) ? 0 : o, s = h * p.value.width;
|
|
99
102
|
return {
|
|
100
103
|
...t,
|
|
101
104
|
value: l,
|
|
102
105
|
proportion: h,
|
|
103
|
-
width: s
|
|
104
|
-
proportionLabel:
|
|
106
|
+
width: s,
|
|
107
|
+
proportionLabel: V({
|
|
105
108
|
v: h * 100,
|
|
106
109
|
s: "%",
|
|
107
110
|
r: e.value.style.legend.percentage.rounding
|
|
108
111
|
})
|
|
109
112
|
};
|
|
110
|
-
})), $ = f(() =>
|
|
113
|
+
})), $ = f(() => j.value.filter((t, a) => !v.value.includes(a)));
|
|
111
114
|
function H(t) {
|
|
112
|
-
v.value.includes(t) ? v.value = v.value.filter((a) => a !== t) : v.value.length <
|
|
115
|
+
v.value.includes(t) ? v.value = v.value.filter((a) => a !== t) : v.value.length < m.value.length - 1 && v.value.push(t);
|
|
113
116
|
}
|
|
114
117
|
const S = f(() => {
|
|
115
118
|
let t = 0;
|
|
@@ -121,51 +124,51 @@ const ne = ["xmlns", "viewBox"], re = ["id"], ue = ["stop-color"], ie = ["stop-c
|
|
|
121
124
|
}), t += $.value[l].width;
|
|
122
125
|
return a;
|
|
123
126
|
});
|
|
124
|
-
function
|
|
125
|
-
|
|
127
|
+
function E(t, a) {
|
|
128
|
+
T("selectDatapoint", { datapoint: t, index: a });
|
|
126
129
|
}
|
|
127
|
-
return (t, a) => (n(),
|
|
130
|
+
return (t, a) => (n(), r("div", {
|
|
128
131
|
style: g(`width:100%; background:${e.value.style.backgroundColor}`)
|
|
129
132
|
}, [
|
|
130
|
-
e.value.style.title.text ? (n(),
|
|
133
|
+
e.value.style.title.text ? (n(), r("div", {
|
|
131
134
|
key: 0,
|
|
132
135
|
style: g(`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}`)
|
|
133
136
|
}, [
|
|
134
|
-
|
|
137
|
+
d("div", {
|
|
135
138
|
style: g(`font-size:${e.value.style.title.fontSize}px;color:${e.value.style.title.color};font-weight:${e.value.style.title.bold ? "bold" : "normal"}`)
|
|
136
139
|
}, _(e.value.style.title.text), 5),
|
|
137
|
-
e.value.style.title.subtitle.text ? (n(),
|
|
140
|
+
e.value.style.title.subtitle.text ? (n(), r("div", {
|
|
138
141
|
key: 0,
|
|
139
142
|
style: g(`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"}`)
|
|
140
143
|
}, _(e.value.style.title.subtitle.text), 5)) : y("", !0)
|
|
141
144
|
], 4)) : y("", !0),
|
|
142
|
-
z.value ? (n(),
|
|
145
|
+
z.value ? (n(), r("svg", {
|
|
143
146
|
key: 1,
|
|
144
147
|
xmlns: b(ee),
|
|
145
148
|
width: "100%",
|
|
146
|
-
viewBox: `0 0 ${
|
|
149
|
+
viewBox: `0 0 ${p.value.width} ${p.value.height}`
|
|
147
150
|
}, [
|
|
148
|
-
|
|
149
|
-
(n(!0),
|
|
151
|
+
d("defs", null, [
|
|
152
|
+
(n(!0), r(D, null, P(S.value, (l, o) => (n(), r("linearGradient", {
|
|
150
153
|
key: `stack_gradient_${o}`,
|
|
151
154
|
gradientTransform: "rotate(90)",
|
|
152
155
|
id: `stack_gradient_${o}_${A.value}`
|
|
153
156
|
}, [
|
|
154
|
-
|
|
157
|
+
d("stop", {
|
|
155
158
|
offset: "0%",
|
|
156
159
|
"stop-color": l.color
|
|
157
160
|
}, null, 8, ue),
|
|
158
|
-
|
|
161
|
+
d("stop", {
|
|
159
162
|
offset: "50%",
|
|
160
163
|
"stop-color": b(te)(b(le)(l.color, 0.05), 100 - e.value.style.bar.gradient.intensity)
|
|
161
164
|
}, null, 8, ie),
|
|
162
|
-
|
|
165
|
+
d("stop", {
|
|
163
166
|
offset: "100%",
|
|
164
167
|
"stop-color": l.color
|
|
165
168
|
}, null, 8, ce)
|
|
166
169
|
], 8, re))), 128)),
|
|
167
|
-
|
|
168
|
-
|
|
170
|
+
d("clipPath", de, [
|
|
171
|
+
d("rect", {
|
|
169
172
|
x: "0.005",
|
|
170
173
|
y: "-2",
|
|
171
174
|
width: "0.99",
|
|
@@ -176,28 +179,38 @@ const ne = ["xmlns", "viewBox"], re = ["id"], ue = ["stop-color"], ie = ["stop-c
|
|
|
176
179
|
}, null, 8, ve)
|
|
177
180
|
])
|
|
178
181
|
]),
|
|
179
|
-
|
|
180
|
-
|
|
182
|
+
F.value > 0 ? (n(), r("g", ge, [
|
|
183
|
+
d("rect", {
|
|
181
184
|
x: 0,
|
|
182
185
|
y: 0,
|
|
183
|
-
height:
|
|
186
|
+
height: p.value.height,
|
|
184
187
|
width: S.value.map((l) => l.width).reduce((l, o) => l + o, 0),
|
|
185
188
|
fill: e.value.style.bar.gradient.underlayerColor,
|
|
186
189
|
class: N({ animated: !w.value })
|
|
187
190
|
}, null, 10, pe),
|
|
188
|
-
(n(!0),
|
|
191
|
+
(n(!0), r(D, null, P(S.value, (l, o) => (n(), r("rect", {
|
|
189
192
|
key: `stack_${o}`,
|
|
190
|
-
onClick: () =>
|
|
193
|
+
onClick: () => E(l, o),
|
|
191
194
|
x: l.start,
|
|
192
195
|
y: 0,
|
|
193
196
|
width: l.width,
|
|
194
|
-
height:
|
|
197
|
+
height: p.value.height,
|
|
195
198
|
fill: e.value.style.bar.gradient.show ? `url(#stack_gradient_${o}_${A.value})` : l.color,
|
|
196
199
|
stroke: e.value.style.backgroundColor,
|
|
197
200
|
"stroke-linecap": "round",
|
|
198
201
|
class: N({ animated: !w.value })
|
|
199
202
|
}, null, 10, he))), 128))
|
|
200
|
-
])
|
|
203
|
+
])) : (n(), r("rect", {
|
|
204
|
+
key: 1,
|
|
205
|
+
x: 2,
|
|
206
|
+
y: 1,
|
|
207
|
+
width: p.value.width - 4,
|
|
208
|
+
height: p.value.height - 2,
|
|
209
|
+
stroke: "#CCCCCC",
|
|
210
|
+
"stroke-width": "2",
|
|
211
|
+
fill: "transparent",
|
|
212
|
+
rx: (p.value.height - 4) / 2
|
|
213
|
+
}, null, 8, fe))
|
|
201
214
|
], 8, ne)) : y("", !0),
|
|
202
215
|
z.value ? y("", !0) : (n(), W(oe, {
|
|
203
216
|
key: 2,
|
|
@@ -211,45 +224,45 @@ const ne = ["xmlns", "viewBox"], re = ["id"], ue = ["stop-color"], ie = ["stop-c
|
|
|
211
224
|
}
|
|
212
225
|
}
|
|
213
226
|
}, null, 8, ["config"])),
|
|
214
|
-
e.value.style.legend.show ? (n(),
|
|
227
|
+
e.value.style.legend.show ? (n(), r("div", {
|
|
215
228
|
key: 3,
|
|
216
229
|
style: g(`background:transparent;margin:0 auto;margin:${e.value.style.legend.margin};justify-content:${e.value.style.legend.textAlign === "left" ? "flex-start" : e.value.style.legend.textAlign === "right" ? "flex-end" : "center"}`),
|
|
217
230
|
class: "vue-ui-sparkstackbar-legend"
|
|
218
231
|
}, [
|
|
219
|
-
(n(!0),
|
|
232
|
+
(n(!0), r(D, null, P(j.value, (l, o) => (n(), r("div", {
|
|
220
233
|
style: g(`font-size:${e.value.style.legend.fontSize}px;`),
|
|
221
234
|
class: N({ "vue-ui-sparkstackbar-legend-item": !0, "vue-ui-sparkstackbar-legend-item-unselected": v.value.includes(o) }),
|
|
222
235
|
onClick: (h) => {
|
|
223
|
-
H(o),
|
|
236
|
+
H(o), E(l, o);
|
|
224
237
|
}
|
|
225
238
|
}, [
|
|
226
|
-
|
|
227
|
-
(n(),
|
|
239
|
+
d("div", me, [
|
|
240
|
+
(n(), r("svg", {
|
|
228
241
|
height: `${e.value.style.legend.fontSize}px`,
|
|
229
242
|
width: `${e.value.style.legend.fontSize}px`,
|
|
230
243
|
viewBox: "0 0 10 10"
|
|
231
244
|
}, [
|
|
232
|
-
|
|
245
|
+
d("circle", {
|
|
233
246
|
cx: 5,
|
|
234
247
|
cy: 5,
|
|
235
248
|
r: 5,
|
|
236
249
|
fill: l.color
|
|
237
|
-
}, null, 8,
|
|
238
|
-
], 8,
|
|
239
|
-
|
|
250
|
+
}, null, 8, _e)
|
|
251
|
+
], 8, ke)),
|
|
252
|
+
d("span", {
|
|
240
253
|
style: g(`color:${e.value.style.legend.name.color}; font-weight:${e.value.style.legend.name.bold ? "bold" : "normal"}`)
|
|
241
254
|
}, _(l.name), 5),
|
|
242
|
-
e.value.style.legend.percentage.show ? (n(),
|
|
255
|
+
e.value.style.legend.percentage.show ? (n(), r("span", {
|
|
243
256
|
key: 0,
|
|
244
257
|
style: g(`font-weight:${e.value.style.legend.percentage.bold ? "bold" : "normal"};color:${e.value.style.legend.percentage.color}`)
|
|
245
258
|
}, _(v.value.includes(o) ? " - " : l.proportionLabel), 5)) : y("", !0),
|
|
246
|
-
e.value.style.legend.value.show ? (n(),
|
|
259
|
+
e.value.style.legend.value.show ? (n(), r("span", {
|
|
247
260
|
key: 1,
|
|
248
261
|
style: g(`font-weight:${e.value.style.legend.value.bold ? "bold" : "normal"};color:${e.value.style.legend.value.color}`)
|
|
249
262
|
}, " (" + _(b(ae)(
|
|
250
263
|
e.value.style.legend.value.formatter,
|
|
251
264
|
l.value,
|
|
252
|
-
b(
|
|
265
|
+
b(V)({
|
|
253
266
|
p: e.value.style.legend.value.prefix,
|
|
254
267
|
v: l.value,
|
|
255
268
|
s: e.value.style.legend.value.suffix,
|
|
@@ -258,11 +271,11 @@ const ne = ["xmlns", "viewBox"], re = ["id"], ue = ["stop-color"], ie = ["stop-c
|
|
|
258
271
|
{ datapoint: l, seriesIndex: o }
|
|
259
272
|
)) + ") ", 5)) : y("", !0)
|
|
260
273
|
])
|
|
261
|
-
], 14,
|
|
274
|
+
], 14, ye))), 256))
|
|
262
275
|
], 4)) : y("", !0)
|
|
263
276
|
], 4));
|
|
264
277
|
}
|
|
265
|
-
},
|
|
278
|
+
}, De = /* @__PURE__ */ se(be, [["__scopeId", "data-v-25e78abf"]]);
|
|
266
279
|
export {
|
|
267
|
-
|
|
280
|
+
De as default
|
|
268
281
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-B8EMsnjU.cjs"),B=require("./useNestedProp-DlCe_zZz.cjs"),V=require("./vue-ui-skeleton-Bli7jLZ7.cjs"),z=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),D=["xmlns","viewBox"],P=["id"],L=["stop-color"],A=["stop-color"],F=["stop-color"],U={id:"stackPill",clipPathUnits:"objectBoundingBox"},j=["fill"],q={key:0,"clip-path":"url(#stackPill)"},T=["height","width","fill"],H=["onClick","x","width","height","fill","stroke"],I=["width","height","rx"],O=["onClick"],M={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},G=["height","width"],W=["fill"],X={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(S,{emit:E}){const u=S,{vue_ui_sparkstackbar:N}=o.useConfig(),f=e.computed(()=>!!u.dataset&&u.dataset.length),k=e.ref(o.createUid()),t=e.computed({get:()=>_(),set:l=>l});function _(){const l=B.useNestedProp({userConfig:u.config,defaultConfig:N});return l.theme?{...B.useNestedProp({userConfig:o.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}e.watch(()=>u.config,l=>{t.value=_(),b()},{deep:!0}),e.watch(()=>u.dataset,l=>{v.value=u.dataset.map((n,a)=>({...n,color:n.color?o.convertColorToHex(n.color):g.value[a]||o.palette[a]||o.palette[a%o.palette.length]}))},{deep:!0});const g=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),v=e.ref(u.dataset.map((l,n)=>({...l,value:t.value.style.animation.show?0:l.value||0,color:l.color?o.convertColorToHex(l.color):g.value[n]||o.palette[n]||o.palette[n%o.palette.length]}))),m=e.ref(!0);e.onMounted(()=>{if(b(),t.value.style.animation.show){let p=function(){r+=a/l,r<a?(v.value=v.value.map((s,i)=>({...s,value:s.value+=n[i],color:s.color?o.convertColorToHex(s.color):g.value[i]||o.palette[i]||o.palette[i%o.palette.length]})),requestAnimationFrame(p)):(m.value=!1,v.value=u.dataset.map((s,i)=>({...s,value:s.value||0,color:s.color?o.convertColorToHex(s.color):g.value[i]||o.palette[i]||o.palette[i%o.palette.length],id:o.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,i)=>s.value/l),a=u.dataset.map(s=>s.value||0).reduce((s,i)=>s+i,0);let r=0;m.value=!0,p()}});function b(){o.objectIsEmpty(u.dataset)?o.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(a=>{o.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:a,index:n})})})}const d=e.ref({width:500,height:16}),c=e.ref([]),C=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!c.value.includes(n)).reduce((l,n)=>l+n,0)),x=e.computed(()=>v.value.map((l,n)=>{const a=l.value||0,r=a/C.value,p=isNaN(r)?0:r,s=p*d.value.width;return{...l,value:a,proportion:p,width:s,proportionLabel:o.dataLabel({v:p*100,s:"%",r:t.value.style.legend.percentage.rounding})}})),h=e.computed(()=>x.value.filter((l,n)=>!c.value.includes(n)));function $(l){c.value.includes(l)?c.value=c.value.filter(n=>n!==l):c.value.length<v.value.length-1&&c.value.push(l)}const y=e.computed(()=>{let l=0;const n=[];for(let a=0;a<h.value.length;a+=1)n.push({...h.value[a],start:l}),l+=h.value[a].width;return n});function w(l,n){E("selectDatapoint",{datapoint:l,index:n})}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`width:100%; background:${t.value.style.backgroundColor}`)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),width:"100%",viewBox:`0 0 ${d.value.width} ${d.value.height}`},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(a,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${k.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,L),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(o.setOpacity)(e.unref(o.shiftHue)(a.color,.05),100-t.value.style.bar.gradient.intensity)},null,8,A),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,F)],8,P))),128)),e.createElementVNode("clipPath",U,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,j)])]),C.value>0?(e.openBlock(),e.createElementBlock("g",q,[e.createElementVNode("rect",{x:0,y:0,height:d.value.height,width:y.value.map(a=>a.width).reduce((a,r)=>a+r,0),fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!m.value})},null,10,T),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,onClick:()=>w(a,r),x:a.start,y:0,width:a.width,height:d.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${k.value})`:a.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!m.value})},null,10,H))),128))])):(e.openBlock(),e.createElementBlock("rect",{key:1,x:2,y:1,width:d.value.width-4,height:d.value.height-2,stroke:"#CCCCCC","stroke-width":"2",fill:"transparent",rx:(d.value.height-4)/2},null,8,I))],8,D)):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(V.default,{key:2,config:{type:"sparkStackbar",style:{backgroundColor:t.value.style.backgroundColor,sparkStackbar:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.legend.show?(e.openBlock(),e.createElementBlock("div",{key:3,style:e.normalizeStyle(`background:transparent;margin:0 auto;margin:${t.value.style.legend.margin};justify-content:${t.value.style.legend.textAlign==="left"?"flex-start":t.value.style.legend.textAlign==="right"?"flex-end":"center"}`),class:"vue-ui-sparkstackbar-legend"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(a,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`font-size:${t.value.style.legend.fontSize}px;`),class:e.normalizeClass({"vue-ui-sparkstackbar-legend-item":!0,"vue-ui-sparkstackbar-legend-item-unselected":c.value.includes(r)}),onClick:p=>{$(r),w(a,r)}},[e.createElementVNode("div",M,[(e.openBlock(),e.createElementBlock("svg",{height:`${t.value.style.legend.fontSize}px`,width:`${t.value.style.legend.fontSize}px`,viewBox:"0 0 10 10"},[e.createElementVNode("circle",{cx:5,cy:5,r:5,fill:a.color},null,8,W)],8,G)),e.createElementVNode("span",{style:e.normalizeStyle(`color:${t.value.style.legend.name.color}; font-weight:${t.value.style.legend.name.bold?"bold":"normal"}`)},e.toDisplayString(a.name),5),t.value.style.legend.percentage.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.legend.percentage.bold?"bold":"normal"};color:${t.value.style.legend.percentage.color}`)},e.toDisplayString(c.value.includes(r)?" - ":a.proportionLabel),5)):e.createCommentVNode("",!0),t.value.style.legend.value.show?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(`font-weight:${t.value.style.legend.value.bold?"bold":"normal"};color:${t.value.style.legend.value.color}`)}," ("+e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.legend.value.formatter,a.value,e.unref(o.dataLabel)({p:t.value.style.legend.value.prefix,v:a.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:a,seriesIndex:r}))+") ",5)):e.createCommentVNode("",!0)])],14,O))),256))],4)):e.createCommentVNode("",!0)],4))}},J=z._export_sfc(X,[["__scopeId","data-v-25e78abf"]]);exports.default=J;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-BKTciLz4.cjs"),we=require("./useNestedProp-BFnXnY0k.cjs"),Ce=require("./useResponsive-B3TrDDIG.cjs"),Be=require("./usePrinter-CxYg-Dw-.cjs"),We=require("./Slicer-DV29nclP.cjs"),Ue=require("./Tooltip-03RvVGln.cjs"),Xe=require("./Title-DYwo_Q5b.cjs"),Ye=require("./Legend-DhQ-a1RH.cjs"),Ge=require("./vue-ui-accordion-SXHdW20_.cjs"),Je=require("./DataTable-DAwK5x3h.cjs"),Ze=require("./vue-ui-skeleton-pDeQ3NcD.cjs"),Ke=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Qe=["id"],je=["xmlns","viewBox"],et={key:0},tt=["id"],at=["stop-color"],lt=["stop-color"],ot=["stop-color"],rt=["x1","x2","y1","y2","stroke"],st=["x1","x2","y1","y2","stroke"],nt=["x1","x2","y1","y2","stroke"],it=["x1","x2","y1","y2","stroke"],ut=["x","y","height","rx","width","fill","stroke","stroke-width"],ct=["x","y","width","rx","height","fill","stroke","stroke-width"],dt=["x1","x2","y1","y2","stroke","stroke-width"],vt=["x1","x2","y1","y2","stroke","stroke-width"],ht=["x","y","font-size","fill","font-weight"],gt=["transform","font-size","fill","font-weight"],yt=["x","y","font-size","fill","font-weight"],mt={key:0},bt=["x","y","font-size","font-weight","fill"],pt=["x","y","font-size","fill","font-weight"],ft={key:0},kt=["x","y","font-size","font-weight","fill"],xt=["x1","x2","y1","y2","stroke"],wt=["x","y","font-size","font-weight","fill"],Ct=["x1","x2","y1","y2","stroke"],Bt=["font-size","font-weight","fill","text-anchor","transform"],Lt=["text-anchor","font-size","font-weight","fill","transform"],St=["font-size","font-weight","fill","x","y"],zt=["x","y","width","height","onClick","onMouseenter","fill"],_t=["x","y","width","height","onClick","onMouseenter","fill"],Nt={key:3,class:"vue-data-ui-watermark"},Et=["onClick"],Mt=["innerHTML"],$t={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend"],setup(G,{expose:Le,emit:J}){const y=G,{vue_ui_stackbar:Se}=c.useConfig(),E=e.computed({get(){return!!y.dataset&&y.dataset.length},set(l){return l}}),M=e.ref(null),W=e.ref(c.createUid()),O=e.ref(!1),Z=e.ref(null),U=e.ref(""),p=e.ref([]),K=e.ref(0),Q=e.ref(null),j=e.ref(null),ee=e.ref(null),te=e.ref(0),X=e.ref(!1),$=e.ref(null),T=e.ref(!1),ze=e.ref(0),_e=e.ref(0),Ne=e.ref(0);e.onMounted(()=>{Y()});const t=e.computed({get:()=>ae(),set:l=>l});function ae(){const l=we.useNestedProp({userConfig:y.config,defaultConfig:Se});let r={};return l.theme?r={...we.useNestedProp({userConfig:c.themes.vue_ui_stackbar[l.theme]||y.config,defaultConfig:l}),customPalette:c.themePalettes[l.theme]||c.palette}:r=l,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMin")?r.style.chart.grid.scale.scaleMin=y.config.style.chart.grid.scale.scaleMin:r.style.chart.grid.scale.scaleMin=null,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMax")?r.style.chart.grid.scale.scaleMax=y.config.style.chart.grid.scale.scaleMax:r.style.chart.grid.scale.scaleMax=null,r}e.watch(()=>y.config,l=>{t.value=ae(),Y(),ze.value+=1,_e.value+=1,Ne.value+=1},{deep:!0}),e.watch(()=>y.dataset,l=>{ue()},{deep:!0});const b=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:le,isImaging:oe,generatePdf:re,generateImage:se}=Be.usePrinter({elementId:`stackbar_${W.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),D=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,paddingRatio:{top:t.value.style.chart.padding.top/t.value.style.chart.height,right:t.value.style.chart.padding.right/t.value.style.chart.width,bottom:t.value.style.chart.padding.bottom/t.value.style.chart.height,left:t.value.style.chart.padding.left/t.value.style.chart.width}}),Ee=e.computed(()=>c.convertCustomPalette(t.value.customPalette)),ne=e.ref(null),ie=e.ref(null);e.onMounted(()=>{Y()});function Y(){if(c.objectIsEmpty(y.dataset)?c.error({componentName:"VueUiStackbar",type:"dataset"}):y.dataset.forEach((l,r)=>{c.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{E.value=!1,c.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:r})})}),setTimeout(()=>{T.value=!0},10),t.value.responsive){const l=Ce.throttle(()=>{T.value=!1;const{width:r,height:a}=Ce.useResponsive({chart:M.value,title:t.value.style.chart.title.text?Q.value:null,legend:t.value.style.chart.legend.show?j.value:null,slicer:t.value.style.chart.zoom.show&&L.value>1?ee.value:null});D.value.width=r,D.value.height=a,clearTimeout(ie.value),ie.value=setTimeout(()=>{T.value=!0},10)});ne.value=new ResizeObserver(l),ne.value.observe(M.value.parentNode)}}const s=e.computed(()=>{const{height:l,width:r}=D.value,{right:a}=D.value.paddingRatio,o=t.value.style.chart.padding.top,n=r-r*a,i=l-t.value.style.chart.padding.bottom,m=t.value.style.chart.padding.left,S=r-m-r*a,z=l-o-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:r,top:o,right:n,bottom:i,left:m,width:S,height:z<0?0:z}}),B=e.computed(()=>y.dataset.map((l,r)=>{const a=c.convertColorToHex(l.color)||Ee.value[r]||c.palette[r]||c.palette[r%c.palette.length];return{...l,series:JSON.parse(JSON.stringify(l.series)).map(o=>t.value.style.chart.bars.distributed?Math.abs(o):o),signedSeries:l.series.map(o=>o>=0?1:-1),absoluteIndex:r,id:c.createUid(),color:a}})),L=e.computed(()=>Math.max(...B.value.filter(l=>!p.value.includes(l.id)).map(l=>l.series.length))),u=e.ref({start:0,end:Math.max(...y.dataset.map(l=>l.series.length))});function ue(){u.value={start:0,end:Math.max(...y.dataset.map(l=>l.series.length))},te.value+=1}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(u.value.end-u.value.start):l=s.value.height/(u.value.end-u.value.start),l<=0?0:l}),V=e.computed(()=>c.sumSeries(B.value.filter(l=>!p.value.includes(l.id))).slice(u.value.start,u.value.end)),Me=e.computed(()=>c.sumSeries(B.value.filter(l=>!p.value.includes(l.id)).map(l=>({...l,series:l.series.map((r,a)=>l.signedSeries[a]===-1&&r>=0?-r:r)}))).slice(u.value.start,u.value.end)),I=e.computed(()=>{const l=B.value.filter(r=>!p.value.includes(r.id));return{positive:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a>=0?a:0)}))),negative:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a<0?a:0)})))}}),w=e.computed(()=>{const l=t.value.style.chart.grid.scale.scaleMax!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMax:Math.max(...I.value.positive),r=Math.min(...I.value.negative),a=t.value.style.chart.grid.scale.scaleMin!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMin:[-1/0,1/0,NaN,void 0,null].includes(r)?0:r,o=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return o.ticks.map(n=>({zero:s.value.bottom-s.value.height*(Math.abs(o.min)/(o.max+Math.abs(o.min))),y:s.value.bottom-s.value.height*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),x:s.value.left-8,horizontal_zero:s.value.left+s.value.width*(Math.abs(o.min)/(o.max+Math.abs(o.min))),horizontal_x:s.value.left+s.value.width*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),horizontal_y:s.value.bottom-8,value:n}))}),F=e.computed(()=>t.value.style.chart.grid.x.timeLabels.values.slice(u.value.start,u.value.end)),g=e.computed(()=>{if(!E.value)return[];let l=Array(L.value).fill(0),r=Array(L.value).fill(0),a=Array(L.value).fill(0),o=Array(L.value).fill(0);const n=Math.max(...I.value.positive)||0,i=Math.min(...I.value.negative),m=[-1/0,1/0,NaN,void 0,null].includes(i)?0:i,S=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks),{min:z,max:P}=S,_=P+(z>=0?0:Math.abs(z))||1,f=s.value.height,q=s.value.width,ke=w.value[0]?w.value[0].zero:s.value.bottom,xe=w.value[0]?w.value[0].horizontal_zero:s.value.left;return B.value.filter(R=>!p.value.includes(R.id)).map(R=>{const C=R.series.slice(u.value.start,u.value.end),Pe=R.signedSeries.slice(u.value.start,u.value.end),Re=C.map((v,h)=>s.value.left+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),Oe=C.map((v,h)=>s.value.top+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),De=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=f*k,N=ke-x-l[h],l[h]+=x):(x=f*k,N=ke+a[h],a[h]+=Math.abs(x)),N}),Ie=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=q*k,N=xe+r[h],r[h]+=x):(x=q*k,N=xe-Math.abs(x)-o[h],o[h]+=Math.abs(x)),N}),Ae=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?f*k:f*Math.abs(k)}),He=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?q*k:q*Math.abs(k)}),qe=C.map(v=>Math.abs(v)).reduce((v,h)=>v+h,0);return{...R,proportions:C.map((v,h)=>t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/qe),series:C,signedSeries:Pe,x:Re,y:De,height:Ae,horizontal_width:He,horizontal_y:Oe,horizontal_x:Ie}})}),ce=e.computed(()=>Me.value.map((l,r)=>({value:l,sign:l>=0?1:-1})));function A(l,r,a,o,n){const i=n===-1&&l>=0?-l:l;return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,i,c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:i,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function de(l,r,a,o){return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,c.dataLabel({v:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ve(l){const r=JSON.parse(JSON.stringify(g.value)).map(a=>({name:a.name,value:a.series[l]===0?0:a.series[l]||null,proportion:a.proportions[l]||null,color:a.color,id:a.id}));J("selectDatapoint",{datapoint:r,period:F.value[l]})}function he(l){$.value=l,O.value=!0;const r=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(n=>({name:n.name,value:n.series[l]===0?0:(n.signedSeries[l]===-1&&n.series[l]>=0?-n.series[l]:n.series[l])||null,proportion:n.proportions[l]||null,color:n.color,id:n.id})),o=a.map(n=>Math.abs(n.value)).reduce((n,i)=>n+i,0);if(c.isFunction(r)&&c.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:g.value,config:t.value})))U.value=r({seriesIndex:l,datapoint:a,series:g.value,config:t.value});else{const{showValue:n,showPercentage:i,borderColor:m,roundingValue:S,roundingPercentage:z}=t.value.style.chart.tooltip;let P="";F.value[l]&&(P+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${m};padding-bottom:6px;margin-bottom:3px;">${F.value[l]}</div>`);const _=[n&&i?"(":"",n&&i?")":""];a.reverse().forEach(f=>{P+=`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-B8EMsnjU.cjs"),we=require("./useNestedProp-DlCe_zZz.cjs"),Ce=require("./useResponsive-B3TrDDIG.cjs"),Be=require("./usePrinter-BmXrEJ99.cjs"),We=require("./Slicer-Bc7OWCcl.cjs"),Ue=require("./Tooltip-CX57w9Q9.cjs"),Xe=require("./Title-BaR4XyXa.cjs"),Ye=require("./Legend-XqP6-7Ac.cjs"),Ge=require("./vue-ui-accordion-DRI-fN6I.cjs"),Je=require("./DataTable-cOEA6Z37.cjs"),Ze=require("./vue-ui-skeleton-Bli7jLZ7.cjs"),Ke=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Qe=["id"],je=["xmlns","viewBox"],et={key:0},tt=["id"],at=["stop-color"],lt=["stop-color"],ot=["stop-color"],rt=["x1","x2","y1","y2","stroke"],st=["x1","x2","y1","y2","stroke"],nt=["x1","x2","y1","y2","stroke"],it=["x1","x2","y1","y2","stroke"],ut=["x","y","height","rx","width","fill","stroke","stroke-width"],ct=["x","y","width","rx","height","fill","stroke","stroke-width"],dt=["x1","x2","y1","y2","stroke","stroke-width"],vt=["x1","x2","y1","y2","stroke","stroke-width"],ht=["x","y","font-size","fill","font-weight"],gt=["transform","font-size","fill","font-weight"],yt=["x","y","font-size","fill","font-weight"],mt={key:0},bt=["x","y","font-size","font-weight","fill"],pt=["x","y","font-size","fill","font-weight"],ft={key:0},kt=["x","y","font-size","font-weight","fill"],xt=["x1","x2","y1","y2","stroke"],wt=["x","y","font-size","font-weight","fill"],Ct=["x1","x2","y1","y2","stroke"],Bt=["font-size","font-weight","fill","text-anchor","transform"],Lt=["text-anchor","font-size","font-weight","fill","transform"],St=["font-size","font-weight","fill","x","y"],zt=["x","y","width","height","onClick","onMouseenter","fill"],_t=["x","y","width","height","onClick","onMouseenter","fill"],Nt={key:3,class:"vue-data-ui-watermark"},Et=["onClick"],Mt=["innerHTML"],$t={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend"],setup(G,{expose:Le,emit:J}){const y=G,{vue_ui_stackbar:Se}=c.useConfig(),E=e.computed({get(){return!!y.dataset&&y.dataset.length},set(l){return l}}),M=e.ref(null),W=e.ref(c.createUid()),O=e.ref(!1),Z=e.ref(null),U=e.ref(""),p=e.ref([]),K=e.ref(0),Q=e.ref(null),j=e.ref(null),ee=e.ref(null),te=e.ref(0),X=e.ref(!1),$=e.ref(null),T=e.ref(!1),ze=e.ref(0),_e=e.ref(0),Ne=e.ref(0);e.onMounted(()=>{Y()});const t=e.computed({get:()=>ae(),set:l=>l});function ae(){const l=we.useNestedProp({userConfig:y.config,defaultConfig:Se});let r={};return l.theme?r={...we.useNestedProp({userConfig:c.themes.vue_ui_stackbar[l.theme]||y.config,defaultConfig:l}),customPalette:c.themePalettes[l.theme]||c.palette}:r=l,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMin")?r.style.chart.grid.scale.scaleMin=y.config.style.chart.grid.scale.scaleMin:r.style.chart.grid.scale.scaleMin=null,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMax")?r.style.chart.grid.scale.scaleMax=y.config.style.chart.grid.scale.scaleMax:r.style.chart.grid.scale.scaleMax=null,r}e.watch(()=>y.config,l=>{t.value=ae(),Y(),ze.value+=1,_e.value+=1,Ne.value+=1},{deep:!0}),e.watch(()=>y.dataset,l=>{ue()},{deep:!0});const b=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:le,isImaging:oe,generatePdf:re,generateImage:se}=Be.usePrinter({elementId:`stackbar_${W.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),D=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,paddingRatio:{top:t.value.style.chart.padding.top/t.value.style.chart.height,right:t.value.style.chart.padding.right/t.value.style.chart.width,bottom:t.value.style.chart.padding.bottom/t.value.style.chart.height,left:t.value.style.chart.padding.left/t.value.style.chart.width}}),Ee=e.computed(()=>c.convertCustomPalette(t.value.customPalette)),ne=e.ref(null),ie=e.ref(null);e.onMounted(()=>{Y()});function Y(){if(c.objectIsEmpty(y.dataset)?c.error({componentName:"VueUiStackbar",type:"dataset"}):y.dataset.forEach((l,r)=>{c.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{E.value=!1,c.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:r})})}),setTimeout(()=>{T.value=!0},10),t.value.responsive){const l=Ce.throttle(()=>{T.value=!1;const{width:r,height:a}=Ce.useResponsive({chart:M.value,title:t.value.style.chart.title.text?Q.value:null,legend:t.value.style.chart.legend.show?j.value:null,slicer:t.value.style.chart.zoom.show&&L.value>1?ee.value:null});D.value.width=r,D.value.height=a,clearTimeout(ie.value),ie.value=setTimeout(()=>{T.value=!0},10)});ne.value=new ResizeObserver(l),ne.value.observe(M.value.parentNode)}}const s=e.computed(()=>{const{height:l,width:r}=D.value,{right:a}=D.value.paddingRatio,o=t.value.style.chart.padding.top,n=r-r*a,i=l-t.value.style.chart.padding.bottom,m=t.value.style.chart.padding.left,S=r-m-r*a,z=l-o-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:r,top:o,right:n,bottom:i,left:m,width:S,height:z<0?0:z}}),B=e.computed(()=>y.dataset.map((l,r)=>{const a=c.convertColorToHex(l.color)||Ee.value[r]||c.palette[r]||c.palette[r%c.palette.length];return{...l,series:JSON.parse(JSON.stringify(l.series)).map(o=>t.value.style.chart.bars.distributed?Math.abs(o):o),signedSeries:l.series.map(o=>o>=0?1:-1),absoluteIndex:r,id:c.createUid(),color:a}})),L=e.computed(()=>Math.max(...B.value.filter(l=>!p.value.includes(l.id)).map(l=>l.series.length))),u=e.ref({start:0,end:Math.max(...y.dataset.map(l=>l.series.length))});function ue(){u.value={start:0,end:Math.max(...y.dataset.map(l=>l.series.length))},te.value+=1}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(u.value.end-u.value.start):l=s.value.height/(u.value.end-u.value.start),l<=0?0:l}),V=e.computed(()=>c.sumSeries(B.value.filter(l=>!p.value.includes(l.id))).slice(u.value.start,u.value.end)),Me=e.computed(()=>c.sumSeries(B.value.filter(l=>!p.value.includes(l.id)).map(l=>({...l,series:l.series.map((r,a)=>l.signedSeries[a]===-1&&r>=0?-r:r)}))).slice(u.value.start,u.value.end)),I=e.computed(()=>{const l=B.value.filter(r=>!p.value.includes(r.id));return{positive:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a>=0?a:0)}))),negative:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a<0?a:0)})))}}),w=e.computed(()=>{const l=t.value.style.chart.grid.scale.scaleMax!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMax:Math.max(...I.value.positive),r=Math.min(...I.value.negative),a=t.value.style.chart.grid.scale.scaleMin!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMin:[-1/0,1/0,NaN,void 0,null].includes(r)?0:r,o=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return o.ticks.map(n=>({zero:s.value.bottom-s.value.height*(Math.abs(o.min)/(o.max+Math.abs(o.min))),y:s.value.bottom-s.value.height*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),x:s.value.left-8,horizontal_zero:s.value.left+s.value.width*(Math.abs(o.min)/(o.max+Math.abs(o.min))),horizontal_x:s.value.left+s.value.width*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),horizontal_y:s.value.bottom-8,value:n}))}),F=e.computed(()=>t.value.style.chart.grid.x.timeLabels.values.slice(u.value.start,u.value.end)),g=e.computed(()=>{if(!E.value)return[];let l=Array(L.value).fill(0),r=Array(L.value).fill(0),a=Array(L.value).fill(0),o=Array(L.value).fill(0);const n=Math.max(...I.value.positive)||0,i=Math.min(...I.value.negative),m=[-1/0,1/0,NaN,void 0,null].includes(i)?0:i,S=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks),{min:z,max:P}=S,_=P+(z>=0?0:Math.abs(z))||1,f=s.value.height,q=s.value.width,ke=w.value[0]?w.value[0].zero:s.value.bottom,xe=w.value[0]?w.value[0].horizontal_zero:s.value.left;return B.value.filter(R=>!p.value.includes(R.id)).map(R=>{const C=R.series.slice(u.value.start,u.value.end),Pe=R.signedSeries.slice(u.value.start,u.value.end),Re=C.map((v,h)=>s.value.left+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),Oe=C.map((v,h)=>s.value.top+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),De=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=f*k,N=ke-x-l[h],l[h]+=x):(x=f*k,N=ke+a[h],a[h]+=Math.abs(x)),N}),Ie=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=q*k,N=xe+r[h],r[h]+=x):(x=q*k,N=xe-Math.abs(x)-o[h],o[h]+=Math.abs(x)),N}),Ae=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?f*k:f*Math.abs(k)}),He=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?q*k:q*Math.abs(k)}),qe=C.map(v=>Math.abs(v)).reduce((v,h)=>v+h,0);return{...R,proportions:C.map((v,h)=>t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/qe),series:C,signedSeries:Pe,x:Re,y:De,height:Ae,horizontal_width:He,horizontal_y:Oe,horizontal_x:Ie}})}),ce=e.computed(()=>Me.value.map((l,r)=>({value:l,sign:l>=0?1:-1})));function A(l,r,a,o,n){const i=n===-1&&l>=0?-l:l;return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,i,c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:i,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function de(l,r,a,o){return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,c.dataLabel({v:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ve(l){const r=JSON.parse(JSON.stringify(g.value)).map(a=>({name:a.name,value:a.series[l]===0?0:a.series[l]||null,proportion:a.proportions[l]||null,color:a.color,id:a.id}));J("selectDatapoint",{datapoint:r,period:F.value[l]})}function he(l){$.value=l,O.value=!0;const r=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(n=>({name:n.name,value:n.series[l]===0?0:(n.signedSeries[l]===-1&&n.series[l]>=0?-n.series[l]:n.series[l])||null,proportion:n.proportions[l]||null,color:n.color,id:n.id})),o=a.map(n=>Math.abs(n.value)).reduce((n,i)=>n+i,0);if(c.isFunction(r)&&c.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:g.value,config:t.value})))U.value=r({seriesIndex:l,datapoint:a,series:g.value,config:t.value});else{const{showValue:n,showPercentage:i,borderColor:m,roundingValue:S,roundingPercentage:z}=t.value.style.chart.tooltip;let P="";F.value[l]&&(P+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${m};padding-bottom:6px;margin-bottom:3px;">${F.value[l]}</div>`);const _=[n&&i?"(":"",n&&i?")":""];a.reverse().forEach(f=>{P+=`
|
|
2
2
|
<div style="display:flex;flex-direction:row;align-items:center;gap:4px">
|
|
3
3
|
<svg viewBox="0 0 12 12" height="14" width="14"><rect rx="1" x="0" y="0" height="12" width="12" stroke="none" fill="${t.value.style.chart.bars.gradient.show?`url(#gradient_${f.id})`:f.color}"/></svg>
|
|
4
4
|
${f.name}${n||i?":":""} ${n?c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:f.value,s:t.value.style.chart.bars.dataLabels.suffix,r:S}):""} ${_[0]}${i?c.dataLabel({v:isNaN(f.value/o)?0:Math.abs(f.value)/o*100,s:"%",r:z}):""}${_[1]}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as p, ref as b, onMounted as He, watch as Be, openBlock as s, createElementBlock as u, normalizeClass as ve, normalizeStyle as B, renderSlot as C, createVNode as he, createCommentVNode as v, createBlock as Q, unref as _, createSlots as ft, withCtx as z, normalizeProps as W, guardReactiveProps as X, Fragment as h, renderList as f, createElementVNode as D, toDisplayString as S, createTextVNode as mt } from "vue";
|
|
2
|
-
import { u as pt, c as We, t as xt, a as kt, p as oe, L as Xe, b as wt, o as Ct, e as Ue, g as _t, d as zt, a2 as se, _ as Ye, C as Ge, X as Lt, l as St, F as Je, f as E, x as qe, i as Ze, y as Mt, q as $t, r as Tt } from "./index-
|
|
3
|
-
import { u as Ke } from "./useNestedProp-
|
|
2
|
+
import { u as pt, c as We, t as xt, a as kt, p as oe, L as Xe, b as wt, o as Ct, e as Ue, g as _t, d as zt, a2 as se, _ as Ye, C as Ge, X as Lt, l as St, F as Je, f as E, x as qe, i as Ze, y as Mt, q as $t, r as Tt } from "./index-DQl1TFXa.js";
|
|
3
|
+
import { u as Ke } from "./useNestedProp-lmeFt-ev.js";
|
|
4
4
|
import { t as Nt, u as Ot } from "./useResponsive-NZB-WLRF.js";
|
|
5
|
-
import { u as Pt, U as Rt } from "./usePrinter-
|
|
6
|
-
import { S as It } from "./Slicer-
|
|
7
|
-
import { _ as Ft } from "./Tooltip-
|
|
8
|
-
import { _ as Vt } from "./Title-
|
|
9
|
-
import { L as At } from "./Legend-
|
|
10
|
-
import Dt from "./vue-ui-accordion-
|
|
11
|
-
import { D as Et } from "./DataTable-
|
|
12
|
-
import Ht from "./vue-ui-skeleton-
|
|
5
|
+
import { u as Pt, U as Rt } from "./usePrinter-DgKGVvJC.js";
|
|
6
|
+
import { S as It } from "./Slicer-BKszZXjM.js";
|
|
7
|
+
import { _ as Ft } from "./Tooltip-w32n-8sY.js";
|
|
8
|
+
import { _ as Vt } from "./Title-DlBwa3-X.js";
|
|
9
|
+
import { L as At } from "./Legend-CCq0mNRg.js";
|
|
10
|
+
import Dt from "./vue-ui-accordion-CroZrm7T.js";
|
|
11
|
+
import { D as Et } from "./DataTable-Cmbf3abv.js";
|
|
12
|
+
import Ht from "./vue-ui-skeleton-BVJGmYjj.js";
|
|
13
13
|
import { _ as Bt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
14
|
const Wt = ["id"], Xt = ["xmlns", "viewBox"], Ut = { key: 0 }, Yt = ["id"], Gt = ["stop-color"], Jt = ["stop-color"], qt = ["stop-color"], Zt = ["x1", "x2", "y1", "y2", "stroke"], Kt = ["x1", "x2", "y1", "y2", "stroke"], Qt = ["x1", "x2", "y1", "y2", "stroke"], jt = ["x1", "x2", "y1", "y2", "stroke"], ea = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], ta = ["x", "y", "width", "rx", "height", "fill", "stroke", "stroke-width"], aa = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], la = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ra = ["x", "y", "font-size", "fill", "font-weight"], oa = ["transform", "font-size", "fill", "font-weight"], sa = ["x", "y", "font-size", "fill", "font-weight"], ia = { key: 0 }, ua = ["x", "y", "font-size", "font-weight", "fill"], na = ["x", "y", "font-size", "fill", "font-weight"], ca = { key: 0 }, va = ["x", "y", "font-size", "font-weight", "fill"], ha = ["x1", "x2", "y1", "y2", "stroke"], da = ["x", "y", "font-size", "font-weight", "fill"], ya = ["x1", "x2", "y1", "y2", "stroke"], ga = ["font-size", "font-weight", "fill", "text-anchor", "transform"], ba = ["text-anchor", "font-size", "font-weight", "fill", "transform"], fa = ["font-size", "font-weight", "fill", "x", "y"], ma = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], pa = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], xa = {
|
|
15
15
|
key: 3,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { computed as p, ref as n, watch as ze, onMounted as Ne, onBeforeUnmount as Ae, openBlock as s, createElementBlock as i, normalizeClass as F, normalizeStyle as q, createBlock as P, createCommentVNode as c, unref as h, createSlots as Oe, withCtx as b, renderSlot as m, normalizeProps as H, guardReactiveProps as R, Fragment as g, renderList as C, createElementVNode as x, toDisplayString as T, mergeProps as Fe, createVNode as We, createTextVNode as Ie, nextTick as Me } from "vue";
|
|
2
|
-
import { u as De, c as K, t as Ge, a as Ee, p as L, o as Ve, e as Q, g as be, b as He, d as me, v as Re, C as Ue, f as U, X as Be, i as Z, l as Xe, h as je, x as ge, y as Ye, q as Je, r as qe, E as Ke } from "./index-
|
|
2
|
+
import { u as De, c as K, t as Ge, a as Ee, p as L, o as Ve, e as Q, g as be, b as He, d as me, v as Re, C as Ue, f as U, X as Be, i as Z, l as Xe, h as je, x as ge, y as Ye, q as Je, r as qe, E as Ke } from "./index-DQl1TFXa.js";
|
|
3
3
|
import { t as Qe, u as Ze } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as et } from "./Title-
|
|
5
|
-
import { u as tt, U as lt } from "./usePrinter-
|
|
6
|
-
import { _ as at } from "./Tooltip-
|
|
7
|
-
import { D as ot } from "./DataTable-
|
|
8
|
-
import st from "./vue-ui-skeleton-
|
|
9
|
-
import { _ as rt } from "./Shape-
|
|
10
|
-
import ut from "./vue-ui-accordion-
|
|
11
|
-
import { u as xe } from "./useNestedProp-
|
|
4
|
+
import { _ as et } from "./Title-DlBwa3-X.js";
|
|
5
|
+
import { u as tt, U as lt } from "./usePrinter-DgKGVvJC.js";
|
|
6
|
+
import { _ as at } from "./Tooltip-w32n-8sY.js";
|
|
7
|
+
import { D as ot } from "./DataTable-Cmbf3abv.js";
|
|
8
|
+
import st from "./vue-ui-skeleton-BVJGmYjj.js";
|
|
9
|
+
import { _ as rt } from "./Shape-BNocET8E.js";
|
|
10
|
+
import ut from "./vue-ui-accordion-CroZrm7T.js";
|
|
11
|
+
import { u as xe } from "./useNestedProp-lmeFt-ev.js";
|
|
12
12
|
import { _ as it } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
13
|
const nt = ["id"], vt = ["xmlns", "viewBox"], ct = { key: 0 }, ht = { key: 0 }, dt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], pt = { key: 1 }, yt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], ft = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], bt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], mt = ["x", "y", "fill", "font-size"], gt = ["x", "y", "font-size", "fill"], xt = ["fill", "font-size", "transform"], kt = ["fill", "font-size", "x", "y"], Ct = ["x1", "x2", "y1", "y2", "stroke"], wt = ["cx", "cy", "fill"], _t = ["cx", "cy", "fill"], $t = ["id"], Tt = ["stop-color"], Lt = ["stop-color"], St = ["stop-color"], Pt = { key: 0 }, zt = ["x", "y", "font-size", "fill"], Nt = {
|
|
14
14
|
key: 3,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-BKTciLz4.cjs"),K=require("./useResponsive-B3TrDDIG.cjs"),ie=require("./Title-DYwo_Q5b.cjs"),Q=require("./usePrinter-CxYg-Dw-.cjs"),ce=require("./Tooltip-03RvVGln.cjs"),ve=require("./DataTable-DAwK5x3h.cjs"),de=require("./vue-ui-skeleton-pDeQ3NcD.cjs"),he=require("./Shape-D7jva0XA.cjs"),pe=require("./vue-ui-accordion-SXHdW20_.cjs"),Z=require("./useNestedProp-BFnXnY0k.cjs"),me=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),fe=["id"],ye=["xmlns","viewBox"],be={key:0},ge={key:0},ke=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],xe={key:1},Ce=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],we=["x1","x2","y1","y2","stroke","stroke-width"],Be=["x1","x2","y1","y2","stroke","stroke-width"],_e=["x","y","fill","font-size"],Se=["x","y","font-size","fill"],$e=["fill","font-size","transform"],Ne=["fill","font-size","x","y"],Le=["x1","x2","y1","y2","stroke"],Te=["cx","cy","fill"],Pe=["cx","cy","fill"],Ee=["id"],ze=["stop-color"],Ve=["stop-color"],Ae=["stop-color"],Fe={key:0},Oe=["x","y","font-size","fill"],De={key:3,class:"vue-data-ui-watermark"},Me=["innerHTML"],We={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(ee,{expose:te,emit:le}){const v=ee,{vue_ui_strip_plot:ae}=o.useConfig(),p=e.computed({get(){return!!v.dataset&&v.dataset.length},set(l){return l}}),L=e.ref(o.createUid()),V=e.ref(0),T=e.ref(!1),P=e.ref(""),b=e.ref(null),A=e.ref(null),F=e.ref(!1),O=e.ref(0),D=e.ref(0),t=e.computed({get:()=>M(),set:l=>l});function M(){const l=Z.useNestedProp({userConfig:v.config,defaultConfig:ae});return l.theme?{...Z.useNestedProp({userConfig:o.themes.vue_ui_strip_plot[l.theme]||v.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}e.watch(()=>v.config,l=>{t.value=M(),W(),O.value+=1,D.value+=1},{deep:!0});const C=e.ref(null);e.onMounted(()=>{W()});function W(){if(o.objectIsEmpty(v.dataset)?o.error({componentName:"VueUiStripPlot",type:"dataset"}):v.dataset.forEach((l,s)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","plots"]}).forEach(a=>{p.value=!1,o.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:a,index:s})}),l.plots&&l.plots.forEach((a,n)=>{o.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","value"]}).forEach(u=>{p.value=!1,o.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:u,index:`${s},${n}`})})})}),t.value.responsive){const l=K.throttle(()=>{const{width:s,height:a}=K.useResponsive({chart:b.value,title:t.value.style.chart.title.text?A.value:null});w.value=a,y.value.width=s,y.value.height=a,k.value=(s-d.value.left-d.value.right)/v.dataset.length,B.value=o.translateSize({relator:Math.min(a,s),adjuster:600,source:t.value.style.chart.plots.radius,threshold:6,fallback:6})});C.value=new ResizeObserver(l),C.value.observe(b.value.parentNode)}F.value=!0,setTimeout(()=>{g.value=!1},oe.value*50)}e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:I,isImaging:G,generatePdf:q,generateImage:R}=Q.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot"}),U=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),g=e.ref(t.value.useCssAnimation),c=e.ref({showTable:t.value.table.show,dataLabels:{show:t.value.style.chart.labels.bestPlotLabel.show},showTooltip:t.value.style.chart.tooltip.show}),d=e.ref({top:t.value.style.chart.padding.top,bottom:t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right}),k=e.ref(t.value.style.chart.stripWidth),w=e.ref(t.value.style.chart.height),B=e.ref(t.value.style.chart.plots.radius),y=e.ref({width:k.value*v.dataset.length+d.value.left+d.value.right,height:t.value.style.chart.height}),r=e.computed(()=>{const l=k.value*v.dataset.length+d.value.left+d.value.right;return{left:d.value.left,right:l-d.value.right,top:d.value.top,bottom:w.value-d.value.bottom,width:k.value*v.dataset.length,height:w.value-d.value.top-d.value.bottom,stripWidth:k.value,absoluteHeight:w.value,absoluteWidth:l}}),_=e.computed(()=>p.value?v.dataset.map((l,s)=>{const a=o.createUid();return{...l,id:a,color:l.color?o.convertColorToHex(l.color):U.value[s]||o.palette[s]||o.palette[s%o.palette.length],plots:l.plots.map(n=>({...n,value:o.checkNaN(n.value),parentId:a,color:l.color?o.convertColorToHex(l.color):U.value[s]||o.palette[s]||o.palette[s%o.palette.length],id:o.createUid()})).sort((n,u)=>n.value-u.value)}}):null),h=e.computed(()=>(_.value||[]).map((l,s)=>({...l,plots:l.plots.map(a=>({...a,x:r.value.left+(s+1)*r.value.stripWidth-r.value.stripWidth/2}))}))),oe=e.computed(()=>Math.max(...h.value.map(l=>l.plots.length))),E=e.computed(()=>{const l=h.value.flatMap(s=>s.plots.map(a=>a.value));return{max:Math.max(...l),min:Math.min(...l)}}),m=e.computed(()=>o.calculateNiceScale(E.value.min<0?E.value.min:0,E.value.max,t.value.style.chart.grid.scaleSteps)),re=e.computed(()=>(h.value||[]).map((l,s)=>({...l,plots:l.plots.map(a=>({...a,y:r.value.bottom-(a.value+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))*r.value.height}))}))),H=e.computed(()=>m.value.ticks.map(l=>({y:r.value.bottom-r.value.height*((l+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))),x1:r.value.left,x2:r.value.right,value:l}))),z=e.ref(null),i=e.ref(null);function se({datapoint:l,seriesIndex:s}){z.value={datapoint:l,seriesIndex:s,config:t.value,series:_.value},T.value=!0,i.value=l;const a=t.value.style.chart.tooltip.customFormat;if(o.isFunction(a)&&o.functionReturnsString(()=>a({seriesIndex:s,datapoint:l,series:_.value,config:t.value})))P.value=a({seriesIndex:s,datapoint:l,series:_.value,config:t.value});else{let n="";n+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${t.value.style.chart.plots.gradient.show?`url(#${l.parentId})`:l.color}"/></svg>${l.name}</div>`,n+=`<div>${o.applyDataLabel(t.value.style.chart.labels.formatter,l.value,o.dataLabel({p:t.value.style.chart.labels.prefix,v:l.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</div>`,P.value=`<div>${n}</div>`}}const S=e.computed(()=>{const l=h.value.flatMap(a=>JSON.parse(JSON.stringify(a.plots)).sort((n,u)=>u.value-n.value).map(n=>({name:`${a.name} - ${n.name}`,color:n.color}))),s=h.value.flatMap(a=>JSON.parse(JSON.stringify(a.plots)).sort((n,u)=>u.value-n.value).map(n=>n.value));return{head:l,body:s}});function j(){e.nextTick(()=>{const l=S.value.head.map((n,u)=>[[n.name],[S.value.body[u]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value]]].concat(l),a=o.createCsvContent(s);o.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-strip-plot"})})}const $=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=S.value.head.map((u,f)=>{const N=o.dataLabel({p:t.value.style.chart.labels.prefix,v:S.value.body[f],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},N]}),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:s,config:a}}),x=e.ref(!1);function ne(l){x.value=l,V.value+=1}function ue(){return h.value}function X(){c.value.showTable=!c.value.showTable}function Y(){c.value.dataLabels.show=!c.value.dataLabels.show}function J(){c.value.showTooltip=!c.value.showTooltip}return te({getData:ue,generatePdf:q,generateCsv:j,generateImage:R,toggleTable:X,toggleLabels:Y,toggleTooltip:J}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"stripPlotChart",ref:b,class:e.normalizeClass(`vue-ui-strip-plot ${x.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`strip-plot_${L.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:A,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ie._sfc_main,{key:`title_${O.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value?(e.openBlock(),e.createBlock(Q.UserOptions,{ref:"details",key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(I),isImaging:e.unref(G),uid:L.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:c.value.showTooltip,isFullscreen:x.value,titles:{...t.value.userOptions.buttonTitles},chartElement:b.value,position:t.value.userOptions.position,onToggleFullscreen:ne,onGeneratePdf:e.unref(q),onGenerateCsv:j,onGenerateImage:e.unref(R),onToggleTable:X,onToggleLabels:Y,onToggleTooltip:J},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:n})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":x.value,"vue-data-ui-fulscreen--off":!x.value}),viewBox:`0 0 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color};`)},[t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",be,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.value,a=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,x2:a.x2,y1:a.y,y2:a.y,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,ke))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(a,n)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left+(n+1)*r.value.stripWidth,x2:r.value.left+(n+1)*r.value.stripWidth,y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Ce))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:r.value.left,x2:r.value.left,y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,we),e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:r.value.bottom,y2:r.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Be)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(H.value,(a,n)=>(e.openBlock(),e.createElementBlock("text",{x:a.x1-t.value.style.chart.labels.yAxisLabels.fontSize/2+t.value.style.chart.labels.yAxisLabels.offsetX,y:a.y+t.value.style.chart.labels.yAxisLabels.fontSize/3,fill:t.value.style.chart.labels.yAxisLabels.color,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,"text-anchor":"end"},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.labels.formatter,a.value,e.unref(o.dataLabel)({p:t.value.style.chart.labels.prefix,v:a.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.yAxisLabels.rounding}),{datapoint:a,seriesIndex:n})),9,_e))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(h.value,(a,n)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left+(n+1)*r.value.stripWidth-r.value.stripWidth/2,y:r.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize*2+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"text-anchor":"middle"},e.toDisplayString(a.name),9,Se))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.yLabel?(e.openBlock(),e.createElementBlock("text",{key:3,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,transform:`translate(${t.value.style.chart.labels.axis.fontSize+t.value.style.chart.labels.axis.yLabelOffsetX}, ${r.value.top+r.value.height/2}) rotate(-90)`,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.yLabel),9,$e)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.xLabel?(e.openBlock(),e.createElementBlock("text",{key:4,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,x:r.value.left+r.value.width/2,y:r.value.absoluteHeight,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.xLabel),9,Ne)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:i.value.y,y2:i.value.y,stroke:i.value.color,"stroke-width":1,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Le),e.createElementVNode("circle",{cx:r.value.left,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Te),e.createElementVNode("circle",{cx:r.value.right,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Pe)],64)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,a=>(e.openBlock(),e.createElementBlock("radialGradient",{id:a.id,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(o.lightenHexColor)(a.color,t.value.style.chart.plots.gradient.intensity/100)},null,8,ze),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(o.darkenHexColor)(a.color,.1)},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Ae)],8,Ee))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,(a,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,f)=>(e.openBlock(),e.createBlock(he._sfc_main,e.mergeProps({plot:{x:u.x,y:F.value?u.y:r.value.top},radius:i.value&&i.value.id===u.id?B.value*1.5:B.value,shape:t.value.style.chart.plots.shape,stroke:t.value.style.chart.plots.stroke,strokeWidth:t.value.style.chart.plots.strokeWidth,color:t.value.style.chart.plots.gradient.show?`url(#${a.id})`:a.color,onMouseenter:N=>se({datapoint:u,seriesIndex:f}),onMouseleave:s[0]||(s[0]=N=>{T.value=!1,i.value=null}),onClick:N=>le("selectDatapoint",u),style:`transition: all 0.2s ease-in-out; opacity:${i.value?i.value.id===u.id?1:.2:t.value.style.chart.plots.opacity};${g.value?`transition-delay:${f*50}ms`:""}`,class:{"vue-ui-strip-plot-animated":t.value.useCssAnimation&&g.value,"vue-ui-strip-plot-select-circle":t.value.useCssAnimation&&!g.value}},l.$attrs),null,16,["plot","radius","shape","stroke","strokeWidth","color","onMouseenter","onClick","style","class"]))),256)),c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[f===a.plots.length-1||i.value&&i.value.id===u.id&&!c.value.showTooltip?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.x,y:u.y+t.value.style.chart.labels.bestPlotLabel.offsetY-B.value*(i.value&&i.value.id===u.id&&!c.value.showTooltip?2:1.5),"font-size":t.value.style.chart.labels.bestPlotLabel.fontSize,fill:t.value.style.chart.labels.bestPlotLabel.color,"text-anchor":"middle",style:e.normalizeStyle(`opacity:${t.value.useCssAnimation&&g.value?0:1};transition:opacity 0.2s ease-in;`)},e.toDisplayString(u.name)+" "+e.toDisplayString(t.value.style.chart.labels.bestPlotLabel.showValue?e.unref(o.applyDataLabel)(t.value.style.chart.labels.formatter,u.value,e.unref(o.dataLabel)({p:`(${t.value.style.chart.labels.prefix}`,v:u.value,s:`${t.value.style.chart.labels.suffix})`,r:t.value.style.chart.labels.bestPlotLabel.rounding}),{datapoint:u,seriesIndex:f}):""),13,Oe)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:r.value},void 0,!0)],14,ye)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",De,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(I)||e.unref(G)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(de.default,{key:4,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),e.createVNode(ce._sfc_main,{show:c.value.showTooltip&&T.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:b.value,content:P.value,isCustom:e.unref(o.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),p.value?(e.openBlock(),e.createBlock(pe.default,{key:5,hideDetails:"",config:{open:c.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(ve.DataTable,{key:`table_${D.value}`,colNames:$.value.colNames,head:$.value.head,body:$.value.body,config:$.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[1]||(s[1]=a=>c.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,Me)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name||a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,fe))}},Ie=me._export_sfc(We,[["__scopeId","data-v-773b4af1"]]);exports.default=Ie;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-B8EMsnjU.cjs"),K=require("./useResponsive-B3TrDDIG.cjs"),ie=require("./Title-BaR4XyXa.cjs"),Q=require("./usePrinter-BmXrEJ99.cjs"),ce=require("./Tooltip-CX57w9Q9.cjs"),ve=require("./DataTable-cOEA6Z37.cjs"),de=require("./vue-ui-skeleton-Bli7jLZ7.cjs"),he=require("./Shape-B51JGReT.cjs"),pe=require("./vue-ui-accordion-DRI-fN6I.cjs"),Z=require("./useNestedProp-DlCe_zZz.cjs"),me=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),fe=["id"],ye=["xmlns","viewBox"],be={key:0},ge={key:0},ke=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],xe={key:1},Ce=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],we=["x1","x2","y1","y2","stroke","stroke-width"],Be=["x1","x2","y1","y2","stroke","stroke-width"],_e=["x","y","fill","font-size"],Se=["x","y","font-size","fill"],$e=["fill","font-size","transform"],Ne=["fill","font-size","x","y"],Le=["x1","x2","y1","y2","stroke"],Te=["cx","cy","fill"],Pe=["cx","cy","fill"],Ee=["id"],ze=["stop-color"],Ve=["stop-color"],Ae=["stop-color"],Fe={key:0},Oe=["x","y","font-size","fill"],De={key:3,class:"vue-data-ui-watermark"},Me=["innerHTML"],We={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(ee,{expose:te,emit:le}){const v=ee,{vue_ui_strip_plot:ae}=o.useConfig(),p=e.computed({get(){return!!v.dataset&&v.dataset.length},set(l){return l}}),L=e.ref(o.createUid()),V=e.ref(0),T=e.ref(!1),P=e.ref(""),b=e.ref(null),A=e.ref(null),F=e.ref(!1),O=e.ref(0),D=e.ref(0),t=e.computed({get:()=>M(),set:l=>l});function M(){const l=Z.useNestedProp({userConfig:v.config,defaultConfig:ae});return l.theme?{...Z.useNestedProp({userConfig:o.themes.vue_ui_strip_plot[l.theme]||v.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}e.watch(()=>v.config,l=>{t.value=M(),W(),O.value+=1,D.value+=1},{deep:!0});const C=e.ref(null);e.onMounted(()=>{W()});function W(){if(o.objectIsEmpty(v.dataset)?o.error({componentName:"VueUiStripPlot",type:"dataset"}):v.dataset.forEach((l,s)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","plots"]}).forEach(a=>{p.value=!1,o.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:a,index:s})}),l.plots&&l.plots.forEach((a,n)=>{o.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","value"]}).forEach(u=>{p.value=!1,o.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:u,index:`${s},${n}`})})})}),t.value.responsive){const l=K.throttle(()=>{const{width:s,height:a}=K.useResponsive({chart:b.value,title:t.value.style.chart.title.text?A.value:null});w.value=a,y.value.width=s,y.value.height=a,k.value=(s-d.value.left-d.value.right)/v.dataset.length,B.value=o.translateSize({relator:Math.min(a,s),adjuster:600,source:t.value.style.chart.plots.radius,threshold:6,fallback:6})});C.value=new ResizeObserver(l),C.value.observe(b.value.parentNode)}F.value=!0,setTimeout(()=>{g.value=!1},oe.value*50)}e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:I,isImaging:G,generatePdf:q,generateImage:R}=Q.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot"}),U=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),g=e.ref(t.value.useCssAnimation),c=e.ref({showTable:t.value.table.show,dataLabels:{show:t.value.style.chart.labels.bestPlotLabel.show},showTooltip:t.value.style.chart.tooltip.show}),d=e.ref({top:t.value.style.chart.padding.top,bottom:t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right}),k=e.ref(t.value.style.chart.stripWidth),w=e.ref(t.value.style.chart.height),B=e.ref(t.value.style.chart.plots.radius),y=e.ref({width:k.value*v.dataset.length+d.value.left+d.value.right,height:t.value.style.chart.height}),r=e.computed(()=>{const l=k.value*v.dataset.length+d.value.left+d.value.right;return{left:d.value.left,right:l-d.value.right,top:d.value.top,bottom:w.value-d.value.bottom,width:k.value*v.dataset.length,height:w.value-d.value.top-d.value.bottom,stripWidth:k.value,absoluteHeight:w.value,absoluteWidth:l}}),_=e.computed(()=>p.value?v.dataset.map((l,s)=>{const a=o.createUid();return{...l,id:a,color:l.color?o.convertColorToHex(l.color):U.value[s]||o.palette[s]||o.palette[s%o.palette.length],plots:l.plots.map(n=>({...n,value:o.checkNaN(n.value),parentId:a,color:l.color?o.convertColorToHex(l.color):U.value[s]||o.palette[s]||o.palette[s%o.palette.length],id:o.createUid()})).sort((n,u)=>n.value-u.value)}}):null),h=e.computed(()=>(_.value||[]).map((l,s)=>({...l,plots:l.plots.map(a=>({...a,x:r.value.left+(s+1)*r.value.stripWidth-r.value.stripWidth/2}))}))),oe=e.computed(()=>Math.max(...h.value.map(l=>l.plots.length))),E=e.computed(()=>{const l=h.value.flatMap(s=>s.plots.map(a=>a.value));return{max:Math.max(...l),min:Math.min(...l)}}),m=e.computed(()=>o.calculateNiceScale(E.value.min<0?E.value.min:0,E.value.max,t.value.style.chart.grid.scaleSteps)),re=e.computed(()=>(h.value||[]).map((l,s)=>({...l,plots:l.plots.map(a=>({...a,y:r.value.bottom-(a.value+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))*r.value.height}))}))),H=e.computed(()=>m.value.ticks.map(l=>({y:r.value.bottom-r.value.height*((l+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))),x1:r.value.left,x2:r.value.right,value:l}))),z=e.ref(null),i=e.ref(null);function se({datapoint:l,seriesIndex:s}){z.value={datapoint:l,seriesIndex:s,config:t.value,series:_.value},T.value=!0,i.value=l;const a=t.value.style.chart.tooltip.customFormat;if(o.isFunction(a)&&o.functionReturnsString(()=>a({seriesIndex:s,datapoint:l,series:_.value,config:t.value})))P.value=a({seriesIndex:s,datapoint:l,series:_.value,config:t.value});else{let n="";n+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${t.value.style.chart.plots.gradient.show?`url(#${l.parentId})`:l.color}"/></svg>${l.name}</div>`,n+=`<div>${o.applyDataLabel(t.value.style.chart.labels.formatter,l.value,o.dataLabel({p:t.value.style.chart.labels.prefix,v:l.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</div>`,P.value=`<div>${n}</div>`}}const S=e.computed(()=>{const l=h.value.flatMap(a=>JSON.parse(JSON.stringify(a.plots)).sort((n,u)=>u.value-n.value).map(n=>({name:`${a.name} - ${n.name}`,color:n.color}))),s=h.value.flatMap(a=>JSON.parse(JSON.stringify(a.plots)).sort((n,u)=>u.value-n.value).map(n=>n.value));return{head:l,body:s}});function j(){e.nextTick(()=>{const l=S.value.head.map((n,u)=>[[n.name],[S.value.body[u]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value]]].concat(l),a=o.createCsvContent(s);o.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-strip-plot"})})}const $=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=S.value.head.map((u,f)=>{const N=o.dataLabel({p:t.value.style.chart.labels.prefix,v:S.value.body[f],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},N]}),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:s,config:a}}),x=e.ref(!1);function ne(l){x.value=l,V.value+=1}function ue(){return h.value}function X(){c.value.showTable=!c.value.showTable}function Y(){c.value.dataLabels.show=!c.value.dataLabels.show}function J(){c.value.showTooltip=!c.value.showTooltip}return te({getData:ue,generatePdf:q,generateCsv:j,generateImage:R,toggleTable:X,toggleLabels:Y,toggleTooltip:J}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"stripPlotChart",ref:b,class:e.normalizeClass(`vue-ui-strip-plot ${x.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`strip-plot_${L.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:A,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ie._sfc_main,{key:`title_${O.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value?(e.openBlock(),e.createBlock(Q.UserOptions,{ref:"details",key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(I),isImaging:e.unref(G),uid:L.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:c.value.showTooltip,isFullscreen:x.value,titles:{...t.value.userOptions.buttonTitles},chartElement:b.value,position:t.value.userOptions.position,onToggleFullscreen:ne,onGeneratePdf:e.unref(q),onGenerateCsv:j,onGenerateImage:e.unref(R),onToggleTable:X,onToggleLabels:Y,onToggleTooltip:J},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:n})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":x.value,"vue-data-ui-fulscreen--off":!x.value}),viewBox:`0 0 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color};`)},[t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",be,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.value,a=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,x2:a.x2,y1:a.y,y2:a.y,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,ke))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(a,n)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left+(n+1)*r.value.stripWidth,x2:r.value.left+(n+1)*r.value.stripWidth,y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Ce))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:r.value.left,x2:r.value.left,y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,we),e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:r.value.bottom,y2:r.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Be)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(H.value,(a,n)=>(e.openBlock(),e.createElementBlock("text",{x:a.x1-t.value.style.chart.labels.yAxisLabels.fontSize/2+t.value.style.chart.labels.yAxisLabels.offsetX,y:a.y+t.value.style.chart.labels.yAxisLabels.fontSize/3,fill:t.value.style.chart.labels.yAxisLabels.color,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,"text-anchor":"end"},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.labels.formatter,a.value,e.unref(o.dataLabel)({p:t.value.style.chart.labels.prefix,v:a.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.yAxisLabels.rounding}),{datapoint:a,seriesIndex:n})),9,_e))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(h.value,(a,n)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left+(n+1)*r.value.stripWidth-r.value.stripWidth/2,y:r.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize*2+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"text-anchor":"middle"},e.toDisplayString(a.name),9,Se))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.yLabel?(e.openBlock(),e.createElementBlock("text",{key:3,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,transform:`translate(${t.value.style.chart.labels.axis.fontSize+t.value.style.chart.labels.axis.yLabelOffsetX}, ${r.value.top+r.value.height/2}) rotate(-90)`,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.yLabel),9,$e)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.xLabel?(e.openBlock(),e.createElementBlock("text",{key:4,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,x:r.value.left+r.value.width/2,y:r.value.absoluteHeight,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.xLabel),9,Ne)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:i.value.y,y2:i.value.y,stroke:i.value.color,"stroke-width":1,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Le),e.createElementVNode("circle",{cx:r.value.left,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Te),e.createElementVNode("circle",{cx:r.value.right,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Pe)],64)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,a=>(e.openBlock(),e.createElementBlock("radialGradient",{id:a.id,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(o.lightenHexColor)(a.color,t.value.style.chart.plots.gradient.intensity/100)},null,8,ze),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(o.darkenHexColor)(a.color,.1)},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Ae)],8,Ee))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,(a,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,f)=>(e.openBlock(),e.createBlock(he._sfc_main,e.mergeProps({plot:{x:u.x,y:F.value?u.y:r.value.top},radius:i.value&&i.value.id===u.id?B.value*1.5:B.value,shape:t.value.style.chart.plots.shape,stroke:t.value.style.chart.plots.stroke,strokeWidth:t.value.style.chart.plots.strokeWidth,color:t.value.style.chart.plots.gradient.show?`url(#${a.id})`:a.color,onMouseenter:N=>se({datapoint:u,seriesIndex:f}),onMouseleave:s[0]||(s[0]=N=>{T.value=!1,i.value=null}),onClick:N=>le("selectDatapoint",u),style:`transition: all 0.2s ease-in-out; opacity:${i.value?i.value.id===u.id?1:.2:t.value.style.chart.plots.opacity};${g.value?`transition-delay:${f*50}ms`:""}`,class:{"vue-ui-strip-plot-animated":t.value.useCssAnimation&&g.value,"vue-ui-strip-plot-select-circle":t.value.useCssAnimation&&!g.value}},l.$attrs),null,16,["plot","radius","shape","stroke","strokeWidth","color","onMouseenter","onClick","style","class"]))),256)),c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[f===a.plots.length-1||i.value&&i.value.id===u.id&&!c.value.showTooltip?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.x,y:u.y+t.value.style.chart.labels.bestPlotLabel.offsetY-B.value*(i.value&&i.value.id===u.id&&!c.value.showTooltip?2:1.5),"font-size":t.value.style.chart.labels.bestPlotLabel.fontSize,fill:t.value.style.chart.labels.bestPlotLabel.color,"text-anchor":"middle",style:e.normalizeStyle(`opacity:${t.value.useCssAnimation&&g.value?0:1};transition:opacity 0.2s ease-in;`)},e.toDisplayString(u.name)+" "+e.toDisplayString(t.value.style.chart.labels.bestPlotLabel.showValue?e.unref(o.applyDataLabel)(t.value.style.chart.labels.formatter,u.value,e.unref(o.dataLabel)({p:`(${t.value.style.chart.labels.prefix}`,v:u.value,s:`${t.value.style.chart.labels.suffix})`,r:t.value.style.chart.labels.bestPlotLabel.rounding}),{datapoint:u,seriesIndex:f}):""),13,Oe)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:r.value},void 0,!0)],14,ye)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",De,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(I)||e.unref(G)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(de.default,{key:4,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),e.createVNode(ce._sfc_main,{show:c.value.showTooltip&&T.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:b.value,content:P.value,isCustom:e.unref(o.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),p.value?(e.openBlock(),e.createBlock(pe.default,{key:5,hideDetails:"",config:{open:c.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(ve.DataTable,{key:`table_${D.value}`,colNames:$.value.colNames,head:$.value.head,body:$.value.body,config:$.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[1]||(s[1]=a=>c.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,Me)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name||a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,fe))}},Ie=me._export_sfc(We,[["__scopeId","data-v-773b4af1"]]);exports.default=Ie;
|