vue-data-ui 2.4.7 → 2.4.8
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/README.md +11 -10
- package/dist/{Arrow-Ds1Mhkkt.cjs → Arrow-CyaIC3_N.cjs} +1 -1
- package/dist/{Arrow-BCeetU2P.js → Arrow-csGlRFph.js} +1 -1
- package/dist/{BaseIcon-Icg3SIlH.js → BaseIcon-C4xMR9-8.js} +1 -1
- package/dist/{BaseIcon-C31iTAGj.cjs → BaseIcon-fwPMcivX.cjs} +1 -1
- package/dist/{DataTable-CnLqhXZ2.js → DataTable-BlGRB1Pa.js} +2 -2
- package/dist/{DataTable-CqaGqXkz.cjs → DataTable-CxaymjxX.cjs} +1 -1
- package/dist/{Legend-D2iK-_M0.cjs → Legend-Ds7yCP4e.cjs} +1 -1
- package/dist/{Legend-8QHo6cZQ.js → Legend-xj_UZPuw.js} +1 -1
- package/dist/{PackageVersion-Bw7N_9KM.js → PackageVersion-Crfv987V.js} +1 -1
- package/dist/{PackageVersion-DjuywB0J.cjs → PackageVersion-DgPnBWYN.cjs} +1 -1
- package/dist/{PenAndPaper-BiWc81tP.js → PenAndPaper-D8QdkfKM.js} +18 -18
- package/dist/{PenAndPaper-DoKpW2Tl.cjs → PenAndPaper-vKdCNpVJ.cjs} +1 -1
- package/dist/{Shape-CppjH62a.js → Shape-DNQDrxfn.js} +1 -1
- package/dist/{Shape-BfZLKYNk.cjs → Shape-M9CIgwzd.cjs} +1 -1
- package/dist/{Slicer-U4q5iMIE.cjs → Slicer-BMIoaXrp.cjs} +1 -1
- package/dist/{Slicer-CA5jR9Em.js → Slicer-BtiO3aSt.js} +2 -2
- package/dist/{Title-aR9ViX_A.cjs → Title-BqcJ8-j1.cjs} +1 -1
- package/dist/{Title-yJsQ5q-l.js → Title-CoonHZp1.js} +1 -1
- package/dist/Tooltip-DSZJXOZo.cjs +1 -0
- package/dist/Tooltip-WJvwo3eC.js +109 -0
- package/dist/documentation/installation.md +10 -10
- package/dist/{index-Cn1EWnYG.js → index-Qst-5kz0.js} +66 -63
- package/dist/index-uTaoMjg1.cjs +9 -0
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +3 -0
- package/dist/types/vue-data-ui.d.ts +3 -0
- package/dist/{useNestedProp-BXn-g9sr.js → useNestedProp-D3SUMrZY.js} +1 -1
- package/dist/{useNestedProp-DxZ05ZEt.cjs → useNestedProp-P8wzQfmW.cjs} +1 -1
- package/dist/{usePrinter-B3HaYNI4.cjs → usePrinter-DGnyAFMM.cjs} +1 -1
- package/dist/{usePrinter-ZkzmtO6K.js → usePrinter-srpiqIq8.js} +1 -1
- package/dist/{vue-data-ui-DfGCpkA8.js → vue-data-ui-BWV0_3wY.js} +58 -58
- package/dist/{vue-data-ui-Bn_29KuS.cjs → vue-data-ui-vuDWhbxy.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-CERRaGHQ.cjs → vue-ui-3d-bar-DXXySQ7-.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-Cz7ZSFFf.js → vue-ui-3d-bar-nqIMKDVC.js} +9 -9
- package/dist/{vue-ui-accordion-UADqAdVj.js → vue-ui-accordion-CHl3zwsU.js} +3 -3
- package/dist/{vue-ui-accordion-kQwtYRmD.cjs → vue-ui-accordion-D88l7NVk.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-DhGijqy5.js → vue-ui-age-pyramid-Cm9zRjyB.js} +10 -10
- package/dist/{vue-ui-age-pyramid-Rfk1WUfJ.cjs → vue-ui-age-pyramid-DlRVNxj5.cjs} +1 -1
- package/dist/{vue-ui-annotator-BdAFNoMu.cjs → vue-ui-annotator-BaLbEuPn.cjs} +1 -1
- package/dist/{vue-ui-annotator-CCgDEOdY.js → vue-ui-annotator-BcZwMf4k.js} +1 -1
- package/dist/{vue-ui-bullet-Bkx9sfrv.cjs → vue-ui-bullet-DZ3ISzEy.cjs} +1 -1
- package/dist/{vue-ui-bullet-CSVuqhhg.js → vue-ui-bullet-DfIZfg_U.js} +8 -8
- package/dist/{vue-ui-candlestick-CuNi5UZ7.cjs → vue-ui-candlestick-CjSR_UwH.cjs} +1 -1
- package/dist/{vue-ui-candlestick-D0RfMi-W.js → vue-ui-candlestick-CrKXtUTA.js} +11 -11
- package/dist/{vue-ui-carousel-table-Dch3TChE.cjs → vue-ui-carousel-table-DSYgD9k3.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-DeY0f9Ba.js → vue-ui-carousel-table-RTzJDG_m.js} +4 -4
- package/dist/{vue-ui-chestnut-bqu8whHd.cjs → vue-ui-chestnut-C-P3GVoT.cjs} +1 -1
- package/dist/{vue-ui-chestnut-B2Gio3KC.js → vue-ui-chestnut-DvGUaaag.js} +8 -8
- package/dist/{vue-ui-cursor-BlW4uLBm.js → vue-ui-cursor-CURrSWJH.js} +2 -2
- package/dist/{vue-ui-cursor-Dnv5a5oy.cjs → vue-ui-cursor-u0uJ1nPk.cjs} +1 -1
- package/dist/{vue-ui-dashboard-DCaNJXOd.js → vue-ui-dashboard-D5UQ9d4W.js} +2 -2
- package/dist/{vue-ui-dashboard-De5_U4a9.cjs → vue-ui-dashboard-DJSg-19y.cjs} +1 -1
- package/dist/{vue-ui-digits-DlteJApK.js → vue-ui-digits-BESFcIu-.js} +2 -2
- package/dist/{vue-ui-digits-Dc0L7473.cjs → vue-ui-digits-OdhKcT0Z.cjs} +1 -1
- package/dist/{vue-ui-donut-CBTZK6YJ.cjs → vue-ui-donut-D1JD2JpW.cjs} +1 -1
- package/dist/{vue-ui-donut-6Vh9u3Xp.js → vue-ui-donut-eLSljaMD.js} +11 -11
- package/dist/{vue-ui-donut-evolution-CmgjvLvu.cjs → vue-ui-donut-evolution-C5IpwddH.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-gQyMiCiu.js → vue-ui-donut-evolution-nogin4DH.js} +11 -11
- package/dist/{vue-ui-dumbbell-ByhSaE6s.cjs → vue-ui-dumbbell-BHd8UFZA.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-C4xg1FG4.js → vue-ui-dumbbell-D1g4t_ba.js} +10 -10
- package/dist/{vue-ui-flow-DYF0P7LD.js → vue-ui-flow-CQ4ZPEf9.js} +9 -9
- package/dist/{vue-ui-flow-Bef5hCwj.cjs → vue-ui-flow-Cbo8koaf.cjs} +1 -1
- package/dist/{vue-ui-galaxy-COY_QSwC.cjs → vue-ui-galaxy-CwqWivy9.cjs} +1 -1
- package/dist/{vue-ui-galaxy-aM8uOGRD.js → vue-ui-galaxy-cJyFGSj3.js} +11 -11
- package/dist/{vue-ui-gauge-qYg_QM-A.js → vue-ui-gauge-BJ73VPHK.js} +7 -7
- package/dist/{vue-ui-gauge-CW8ZpODM.cjs → vue-ui-gauge-BjlSrIzM.cjs} +1 -1
- package/dist/{vue-ui-gizmo-BZyOCD_y.js → vue-ui-gizmo-B0_McLBu.js} +3 -3
- package/dist/{vue-ui-gizmo-DgS57tJ2.cjs → vue-ui-gizmo-LKVdd220.cjs} +1 -1
- package/dist/{vue-ui-heatmap-BfJGluVp.js → vue-ui-heatmap-B_p_NA69.js} +10 -10
- package/dist/{vue-ui-heatmap-Czg21edC.cjs → vue-ui-heatmap-CMwpGcs-.cjs} +1 -1
- package/dist/{vue-ui-kpi-C5ISBjIs.js → vue-ui-kpi-BTjso80e.js} +3 -3
- package/dist/{vue-ui-kpi-DQpkO2MX.cjs → vue-ui-kpi-JdTRJHRm.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-BiaLLW3x.js → vue-ui-mini-loader-CaQfIaet.js} +2 -2
- package/dist/{vue-ui-mini-loader-Db5Khvfw.cjs → vue-ui-mini-loader-DzPmmR1Y.cjs} +1 -1
- package/dist/{vue-ui-molecule-fmAXI5nL.js → vue-ui-molecule-fG82cUkT.js} +11 -11
- package/dist/{vue-ui-molecule-4AXvVmWt.cjs → vue-ui-molecule-j_a9VBda.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-BzfFikJv.cjs → vue-ui-mood-radar-DKVd8LUE.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-CVLad_RZ.js → vue-ui-mood-radar-Up3yenwX.js} +11 -11
- package/dist/{vue-ui-nested-donuts-BP0qdKto.cjs → vue-ui-nested-donuts-B7hiJJ1U.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-7VePVE4W.js → vue-ui-nested-donuts-JT8N_ith.js} +11 -11
- package/dist/{vue-ui-onion-tzmb3ARN.cjs → vue-ui-onion-CIWDaVKe.cjs} +1 -1
- package/dist/{vue-ui-onion-LCcrKbXJ.js → vue-ui-onion-CWJlmMOv.js} +11 -11
- package/dist/{vue-ui-parallel-coordinate-plot-Dgu-tY5L.cjs → vue-ui-parallel-coordinate-plot-BPmehEq0.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-D0Xxq5a9.js → vue-ui-parallel-coordinate-plot-BdS7FR9e.js} +12 -12
- package/dist/{vue-ui-quadrant-DkOZbxio.cjs → vue-ui-quadrant-Bj0_m09T.cjs} +1 -1
- package/dist/{vue-ui-quadrant-D_e1Knsr.js → vue-ui-quadrant-DNSSfYxO.js} +12 -12
- package/dist/{vue-ui-quick-chart-Brzheuk8.cjs → vue-ui-quick-chart-CaePwM8z.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-CIm7vclU.js → vue-ui-quick-chart-DdHb8oXV.js} +9 -9
- package/dist/{vue-ui-radar-DoNZ8Qv9.cjs → vue-ui-radar-B3kRIdyQ.cjs} +1 -1
- package/dist/{vue-ui-radar-Cx_w_viT.js → vue-ui-radar-BLaCDKDI.js} +12 -12
- package/dist/{vue-ui-rating-B4zDVBEd.cjs → vue-ui-rating-6murOKLs.cjs} +1 -1
- package/dist/{vue-ui-rating-NRP3A0oA.js → vue-ui-rating-ZTFd5PY9.js} +2 -2
- package/dist/{vue-ui-relation-circle-C4LKLsEz.js → vue-ui-relation-circle-8HwwVi9V.js} +7 -7
- package/dist/{vue-ui-relation-circle-Cuk4LDJo.cjs → vue-ui-relation-circle-dng0Wo7U.cjs} +1 -1
- package/dist/{vue-ui-rings-DXawhL1m.js → vue-ui-rings-Bg-gI2AV.js} +11 -11
- package/dist/{vue-ui-rings-D6Rs1eq0.cjs → vue-ui-rings-cJg30GML.cjs} +1 -1
- package/dist/{vue-ui-scatter-8EzIXx2n.js → vue-ui-scatter-BbGF7Kqu.js} +12 -12
- package/dist/{vue-ui-scatter-DlfZqYP9.cjs → vue-ui-scatter-mE1PRE_c.cjs} +1 -1
- package/dist/{vue-ui-screenshot-Wwmw7VVM.js → vue-ui-screenshot-8L5oXuB8.js} +1 -1
- package/dist/{vue-ui-screenshot-Dt0UpXVm.cjs → vue-ui-screenshot-BDncUrRv.cjs} +1 -1
- package/dist/{vue-ui-skeleton-D3AGluiW.js → vue-ui-skeleton-3V3a9YDD.js} +3 -3
- package/dist/{vue-ui-skeleton-Si57O3af.cjs → vue-ui-skeleton-B9HVcMQ5.cjs} +1 -1
- package/dist/{vue-ui-smiley-UxTt4IMY.cjs → vue-ui-smiley-D0cPnUvD.cjs} +1 -1
- package/dist/{vue-ui-smiley-CRddsfyu.js → vue-ui-smiley-bfJp-uDp.js} +2 -2
- package/dist/{vue-ui-spark-trend-Cgr4pAvU.js → vue-ui-spark-trend-CUiHyXEy.js} +5 -5
- package/dist/{vue-ui-spark-trend-tMuRiISe.cjs → vue-ui-spark-trend-QESJyQLY.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-B6TEBbyt.js → vue-ui-sparkbar-DQ6xAWCW.js} +4 -4
- package/dist/{vue-ui-sparkbar-BZVjpA5h.cjs → vue-ui-sparkbar-LgONGPmJ.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-P5fVXRT8.js → vue-ui-sparkgauge-C71yrtal.js} +4 -4
- package/dist/{vue-ui-sparkgauge-B9P3ngyj.cjs → vue-ui-sparkgauge-Ebcv5WPF.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-BSQsOim4.cjs → vue-ui-sparkhistogram-DR5bbtjv.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-vlWx_CFP.js → vue-ui-sparkhistogram-DV9-qngy.js} +5 -5
- package/dist/{vue-ui-sparkline-B1UrThV_.js → vue-ui-sparkline-BUQwEBGh.js} +4 -4
- package/dist/{vue-ui-sparkline-5FsmrmmU.cjs → vue-ui-sparkline-CFApZqM6.cjs} +1 -1
- package/dist/vue-ui-sparkstackbar-CWfd4U7P.cjs +1 -0
- package/dist/vue-ui-sparkstackbar-Dy8NuRTo.js +374 -0
- package/dist/{vue-ui-stackbar-BpFxY9uX.cjs → vue-ui-stackbar-B8k4q2Ci.cjs} +1 -1
- package/dist/{vue-ui-stackbar-DhnCj5jR.js → vue-ui-stackbar-Dm3TUSfv.js} +12 -12
- package/dist/{vue-ui-strip-plot-CutPMUb1.js → vue-ui-strip-plot-AZWlE4bf.js} +11 -11
- package/dist/{vue-ui-strip-plot-DnFquLCu.cjs → vue-ui-strip-plot-BGIlRwxX.cjs} +1 -1
- package/dist/{vue-ui-table-CUtRHuc4.cjs → vue-ui-table-D07ATtZj.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-DS2cSiGt.cjs → vue-ui-table-heatmap-Cga1jg-5.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-DyGuk9kw.js → vue-ui-table-heatmap-DIYuyeya.js} +4 -4
- package/dist/{vue-ui-table-Cx0eqrK_.js → vue-ui-table-j1JKMJlY.js} +1 -1
- package/dist/{vue-ui-table-sparkline-C1ril5t8.cjs → vue-ui-table-sparkline-BCtjl04c.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline--Ekk_QoU.js → vue-ui-table-sparkline-Bs68Kr3b.js} +5 -5
- package/dist/{vue-ui-thermometer-Dr6_S2Qz.cjs → vue-ui-thermometer-B-bVUAFf.cjs} +1 -1
- package/dist/{vue-ui-thermometer-Dz_xaxCt.js → vue-ui-thermometer-XragDhm1.js} +7 -7
- package/dist/{vue-ui-timer-DRdgSmMv.js → vue-ui-timer-CD6NO3sW.js} +5 -5
- package/dist/{vue-ui-timer-BkmRYrPn.cjs → vue-ui-timer-CzKkkrH7.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-BwVRnR-c.cjs → vue-ui-tiremarks-B2nQDIj-.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-XuaMScx0.js → vue-ui-tiremarks-CgFVKqyp.js} +7 -7
- package/dist/{vue-ui-treemap-yUQZvXta.cjs → vue-ui-treemap-FK55MDjM.cjs} +1 -1
- package/dist/{vue-ui-treemap-D8HfM8ny.js → vue-ui-treemap-gj4510HN.js} +11 -11
- package/dist/{vue-ui-vertical-bar-DpaRYTVo.cjs → vue-ui-vertical-bar-BFtin4EH.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-BcWnPMjH.js → vue-ui-vertical-bar-iEd5iot7.js} +11 -11
- package/dist/{vue-ui-waffle-uur49hDo.cjs → vue-ui-waffle-DcsTaFaS.cjs} +1 -1
- package/dist/{vue-ui-waffle-sLIM61xh.js → vue-ui-waffle-XLMUuduF.js} +11 -11
- package/dist/{vue-ui-wheel-CJBuFjJt.cjs → vue-ui-wheel-BuLz0PvU.cjs} +1 -1
- package/dist/{vue-ui-wheel-D3Pfhpbe.js → vue-ui-wheel-DvNNNUNo.js} +7 -7
- package/dist/{vue-ui-word-cloud-Dhz-n0_M.cjs → vue-ui-word-cloud-Cs6kdOG-.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-DhC8SN1l.js → vue-ui-word-cloud-IMAaNlwt.js} +10 -10
- package/dist/{vue-ui-xy-D7nWzSu1.js → vue-ui-xy-Dc67UrQD.js} +14 -14
- package/dist/{vue-ui-xy-Cn-JnSRl.cjs → vue-ui-xy-DvgA1d7k.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-DWZRAtDJ.js → vue-ui-xy-canvas-CMQ_w0PG.js} +11 -11
- package/dist/{vue-ui-xy-canvas-BI5nAbis.cjs → vue-ui-xy-canvas-CzydPKZG.cjs} +1 -1
- package/package.json +1 -1
- package/dist/Tooltip-CN6_JyjT.cjs +0 -1
- package/dist/Tooltip-klg8yuWM.js +0 -104
- package/dist/index-Ci5MafHS.cjs +0 -9
- package/dist/vue-ui-sparkstackbar-BzrHl4LW.js +0 -290
- package/dist/vue-ui-sparkstackbar-CEXgwtwV.cjs +0 -1
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import { computed as m, ref as d, watch as Y, onMounted as se, openBlock as s, createElementBlock as r, normalizeStyle as v, createElementVNode as p, toDisplayString as w, createCommentVNode as y, unref as C, createVNode as G, Fragment as x, renderList as $, normalizeClass as F, createBlock as re, withCtx as q, renderSlot as j, normalizeProps as H, guardReactiveProps as X } from "vue";
|
|
2
|
+
import { u as ne, c as J, t as ue, a as ie, p as i, d as N, b as ce, o as de, e as K, g as ve, f as E, X as pe, s as ge, w as fe, i as Q, x as he } from "./index-Qst-5kz0.js";
|
|
3
|
+
import { u as Z } from "./useNestedProp-D3SUMrZY.js";
|
|
4
|
+
import ye from "./vue-ui-skeleton-3V3a9YDD.js";
|
|
5
|
+
import { _ as me } from "./PackageVersion-Crfv987V.js";
|
|
6
|
+
import { _ as be } from "./Tooltip-WJvwo3eC.js";
|
|
7
|
+
import { _ as ke } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
|
+
const _e = ["xmlns", "viewBox"], we = ["id"], Ce = ["stop-color"], xe = ["stop-color"], $e = ["stop-color"], Se = {
|
|
9
|
+
id: "stackPill",
|
|
10
|
+
clipPathUnits: "objectBoundingBox"
|
|
11
|
+
}, ze = ["fill"], Pe = {
|
|
12
|
+
key: 0,
|
|
13
|
+
"clip-path": "url(#stackPill)"
|
|
14
|
+
}, De = ["x", "width", "height", "fill"], Fe = ["x", "width", "height", "fill", "stroke"], Ne = ["onClick", "x", "width", "height", "onMouseenter"], Ae = ["width", "height", "rx"], Le = ["onClick"], Be = { style: { display: "flex", "flex-direction": "row", "align-items": "center", gap: "4px", "justify-content": "center" } }, Oe = ["height", "width"], je = ["fill"], Ee = {
|
|
15
|
+
key: 4,
|
|
16
|
+
ref: "source",
|
|
17
|
+
dir: "auto"
|
|
18
|
+
}, Me = {
|
|
19
|
+
__name: "vue-ui-sparkstackbar",
|
|
20
|
+
props: {
|
|
21
|
+
config: {
|
|
22
|
+
type: Object,
|
|
23
|
+
default() {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
dataset: {
|
|
28
|
+
type: Array,
|
|
29
|
+
default() {
|
|
30
|
+
return [];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
emits: ["selectDatapoint"],
|
|
35
|
+
setup(ee, { emit: te }) {
|
|
36
|
+
const u = ee, { vue_ui_sparkstackbar: le } = ne(), M = m(() => !!u.dataset && u.dataset.length), T = d(null), U = d(J()), A = d(!1), L = d(""), e = m({
|
|
37
|
+
get: () => V(),
|
|
38
|
+
set: (t) => t
|
|
39
|
+
});
|
|
40
|
+
function V() {
|
|
41
|
+
const t = Z({
|
|
42
|
+
userConfig: u.config,
|
|
43
|
+
defaultConfig: le
|
|
44
|
+
});
|
|
45
|
+
return t.theme ? {
|
|
46
|
+
...Z({
|
|
47
|
+
userConfig: ue.vue_ui_sparkstackbar[t.theme] || u.config,
|
|
48
|
+
defaultConfig: t
|
|
49
|
+
}),
|
|
50
|
+
customPalette: ie[t.theme] || i
|
|
51
|
+
} : t;
|
|
52
|
+
}
|
|
53
|
+
Y(() => u.config, (t) => {
|
|
54
|
+
e.value = V(), I();
|
|
55
|
+
}, { deep: !0 }), Y(() => u.dataset, (t) => {
|
|
56
|
+
b.value = u.dataset.map((a, l) => ({
|
|
57
|
+
...a,
|
|
58
|
+
color: a.color ? N(a.color) : S.value[l] || i[l] || i[l % i.length]
|
|
59
|
+
}));
|
|
60
|
+
}, { deep: !0 });
|
|
61
|
+
const S = m(() => ce(e.value.customPalette)), b = d(u.dataset.map((t, a) => ({
|
|
62
|
+
...t,
|
|
63
|
+
value: e.value.style.animation.show ? 0 : t.value || 0,
|
|
64
|
+
color: t.color ? N(t.color) : S.value[a] || i[a] || i[a % i.length]
|
|
65
|
+
}))), _ = d(!0);
|
|
66
|
+
se(() => {
|
|
67
|
+
if (I(), e.value.style.animation.show) {
|
|
68
|
+
let h = function() {
|
|
69
|
+
o += l / t, o < l ? (b.value = b.value.map((n, c) => ({
|
|
70
|
+
...n,
|
|
71
|
+
value: n.value += a[c],
|
|
72
|
+
color: n.color ? N(n.color) : S.value[c] || i[c] || i[c % i.length]
|
|
73
|
+
})), requestAnimationFrame(h)) : (_.value = !1, b.value = u.dataset.map((n, c) => ({
|
|
74
|
+
...n,
|
|
75
|
+
value: n.value || 0,
|
|
76
|
+
color: n.color ? N(n.color) : S.value[c] || i[c] || i[c % i.length],
|
|
77
|
+
id: J()
|
|
78
|
+
})));
|
|
79
|
+
};
|
|
80
|
+
const t = e.value.style.animation.animationFrames, a = u.dataset.map((n, c) => n.value / t), l = u.dataset.map((n) => n.value || 0).reduce((n, c) => n + c, 0);
|
|
81
|
+
let o = 0;
|
|
82
|
+
_.value = !0, h();
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
function I() {
|
|
86
|
+
de(u.dataset) ? K({
|
|
87
|
+
componentName: "VueUiSparkStackbar",
|
|
88
|
+
type: "dataset"
|
|
89
|
+
}) : u.dataset.forEach((t, a) => {
|
|
90
|
+
ve({
|
|
91
|
+
datasetObject: t,
|
|
92
|
+
requiredAttributes: ["name", "value"]
|
|
93
|
+
}).forEach((l) => {
|
|
94
|
+
K({
|
|
95
|
+
componentName: "VueUiSparkStackbar",
|
|
96
|
+
type: "datasetSerieAttribute",
|
|
97
|
+
property: l,
|
|
98
|
+
index: a
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
const g = d({
|
|
104
|
+
width: 500,
|
|
105
|
+
height: 16
|
|
106
|
+
}), f = d([]), R = m(() => u.dataset.map((t) => t.value || 0).filter((t, a) => !f.value.includes(a)).reduce((t, a) => t + a, 0)), z = m(() => b.value.map((t, a) => {
|
|
107
|
+
const l = t.value || 0, o = l / R.value, h = isNaN(o) ? 0 : o, n = h * g.value.width;
|
|
108
|
+
return {
|
|
109
|
+
...t,
|
|
110
|
+
value: l,
|
|
111
|
+
proportion: h,
|
|
112
|
+
width: n,
|
|
113
|
+
proportionLabel: E({
|
|
114
|
+
v: h * 100,
|
|
115
|
+
s: "%",
|
|
116
|
+
r: e.value.style.legend.percentage.rounding
|
|
117
|
+
})
|
|
118
|
+
};
|
|
119
|
+
})), B = m(() => z.value.filter((t, a) => !f.value.includes(a)));
|
|
120
|
+
function oe(t) {
|
|
121
|
+
f.value.includes(t) ? f.value = f.value.filter((a) => a !== t) : f.value.length < b.value.length - 1 && f.value.push(t);
|
|
122
|
+
}
|
|
123
|
+
const P = m(() => {
|
|
124
|
+
let t = 0;
|
|
125
|
+
const a = [];
|
|
126
|
+
for (let l = 0; l < B.value.length; l += 1)
|
|
127
|
+
a.push({
|
|
128
|
+
...B.value[l],
|
|
129
|
+
start: t
|
|
130
|
+
}), t += B.value[l].width;
|
|
131
|
+
return a;
|
|
132
|
+
});
|
|
133
|
+
function W(t, a) {
|
|
134
|
+
te("selectDatapoint", { datapoint: t, index: a });
|
|
135
|
+
}
|
|
136
|
+
const O = d(null), D = d(!1), k = d(null);
|
|
137
|
+
function ae({ datapoint: t, seriesIndex: a }) {
|
|
138
|
+
if (!e.value.style.tooltip.show)
|
|
139
|
+
return;
|
|
140
|
+
O.value = { datapoint: t, seriesIndex: a, config: e.value, series: z.value }, A.value = !0, k.value = a;
|
|
141
|
+
const l = e.value.style.tooltip.customFormat;
|
|
142
|
+
if (he(l))
|
|
143
|
+
try {
|
|
144
|
+
const o = l({
|
|
145
|
+
seriesIndex: a,
|
|
146
|
+
datapoint: t,
|
|
147
|
+
series: z.value,
|
|
148
|
+
config: e.value
|
|
149
|
+
});
|
|
150
|
+
typeof o == "string" && (L.value = o, D.value = !0);
|
|
151
|
+
} catch {
|
|
152
|
+
console.warn("Custom format cannot be applied."), D.value = !1;
|
|
153
|
+
}
|
|
154
|
+
if (!D.value) {
|
|
155
|
+
let o = "";
|
|
156
|
+
o += `<div style="width:100%;text-align:center;border-bottom:1px solid ${e.value.style.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${t.name}</div>`, o += `<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.color}"/></svg>`, o += `<b>${t.proportionLabel}</b>`, o += `<span>(${Q(
|
|
157
|
+
e.value.style.legend.value.formatter,
|
|
158
|
+
t.value,
|
|
159
|
+
E({
|
|
160
|
+
p: e.value.style.legend.value.prefix,
|
|
161
|
+
v: t.value,
|
|
162
|
+
s: e.value.style.legend.value.suffix,
|
|
163
|
+
r: e.value.style.legend.value.rounding
|
|
164
|
+
}),
|
|
165
|
+
{
|
|
166
|
+
datapoint: t,
|
|
167
|
+
seriesIndex: a
|
|
168
|
+
}
|
|
169
|
+
)})</span>`, L.value = `<div>${o}</div>`;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return (t, a) => (s(), r("div", {
|
|
173
|
+
ref_key: "sparkstackbarChart",
|
|
174
|
+
ref: T,
|
|
175
|
+
style: v(`width:100%; background:${e.value.style.backgroundColor}`)
|
|
176
|
+
}, [
|
|
177
|
+
e.value.style.title.text ? (s(), r("div", {
|
|
178
|
+
key: 0,
|
|
179
|
+
style: v(`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}`)
|
|
180
|
+
}, [
|
|
181
|
+
p("div", {
|
|
182
|
+
style: v(`font-size:${e.value.style.title.fontSize}px;color:${e.value.style.title.color};font-weight:${e.value.style.title.bold ? "bold" : "normal"}`)
|
|
183
|
+
}, w(e.value.style.title.text), 5),
|
|
184
|
+
e.value.style.title.subtitle.text ? (s(), r("div", {
|
|
185
|
+
key: 0,
|
|
186
|
+
style: v(`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"}`)
|
|
187
|
+
}, w(e.value.style.title.subtitle.text), 5)) : y("", !0)
|
|
188
|
+
], 4)) : y("", !0),
|
|
189
|
+
M.value ? (s(), r("svg", {
|
|
190
|
+
key: 1,
|
|
191
|
+
xmlns: C(pe),
|
|
192
|
+
width: "100%",
|
|
193
|
+
viewBox: `0 0 ${g.value.width} ${g.value.height}`
|
|
194
|
+
}, [
|
|
195
|
+
G(me),
|
|
196
|
+
p("defs", null, [
|
|
197
|
+
(s(!0), r(x, null, $(P.value, (l, o) => (s(), r("linearGradient", {
|
|
198
|
+
key: `stack_gradient_${o}`,
|
|
199
|
+
gradientTransform: "rotate(90)",
|
|
200
|
+
id: `stack_gradient_${o}_${U.value}`
|
|
201
|
+
}, [
|
|
202
|
+
p("stop", {
|
|
203
|
+
offset: "0%",
|
|
204
|
+
"stop-color": l.color
|
|
205
|
+
}, null, 8, Ce),
|
|
206
|
+
p("stop", {
|
|
207
|
+
offset: "50%",
|
|
208
|
+
"stop-color": C(ge)(C(fe)(l.color, 0.05), 100 - e.value.style.bar.gradient.intensity)
|
|
209
|
+
}, null, 8, xe),
|
|
210
|
+
p("stop", {
|
|
211
|
+
offset: "100%",
|
|
212
|
+
"stop-color": l.color
|
|
213
|
+
}, null, 8, $e)
|
|
214
|
+
], 8, we))), 128)),
|
|
215
|
+
p("clipPath", Se, [
|
|
216
|
+
p("rect", {
|
|
217
|
+
x: "0.005",
|
|
218
|
+
y: "-2",
|
|
219
|
+
width: "0.99",
|
|
220
|
+
height: "5",
|
|
221
|
+
rx: "3",
|
|
222
|
+
ry: "3",
|
|
223
|
+
fill: e.value.style.backgroundColor
|
|
224
|
+
}, null, 8, ze)
|
|
225
|
+
])
|
|
226
|
+
]),
|
|
227
|
+
R.value > 0 ? (s(), r("g", Pe, [
|
|
228
|
+
(s(!0), r(x, null, $(P.value, (l, o) => (s(), r("rect", {
|
|
229
|
+
key: `stack_underlayer_${o}`,
|
|
230
|
+
x: l.start,
|
|
231
|
+
y: 0,
|
|
232
|
+
width: l.width,
|
|
233
|
+
height: g.value.height,
|
|
234
|
+
fill: e.value.style.bar.gradient.underlayerColor,
|
|
235
|
+
class: F({ animated: !_.value }),
|
|
236
|
+
style: v({
|
|
237
|
+
opacity: k.value !== null && e.value.style.tooltip.show ? k.value === o ? 1 : 0.5 : 1
|
|
238
|
+
})
|
|
239
|
+
}, null, 14, De))), 128)),
|
|
240
|
+
(s(!0), r(x, null, $(P.value, (l, o) => (s(), r("rect", {
|
|
241
|
+
key: `stack_${o}`,
|
|
242
|
+
x: l.start,
|
|
243
|
+
y: 0,
|
|
244
|
+
width: l.width,
|
|
245
|
+
height: g.value.height,
|
|
246
|
+
fill: e.value.style.bar.gradient.show ? `url(#stack_gradient_${o}_${U.value})` : l.color,
|
|
247
|
+
stroke: e.value.style.backgroundColor,
|
|
248
|
+
"stroke-linecap": "round",
|
|
249
|
+
class: F({ animated: !_.value }),
|
|
250
|
+
style: v({
|
|
251
|
+
opacity: k.value !== null && e.value.style.tooltip.show ? k.value === o ? 1 : 0.5 : 1
|
|
252
|
+
})
|
|
253
|
+
}, null, 14, Fe))), 128)),
|
|
254
|
+
(s(!0), r(x, null, $(P.value, (l, o) => (s(), r("rect", {
|
|
255
|
+
key: `stack_trap_${o}`,
|
|
256
|
+
onClick: () => W(l, o),
|
|
257
|
+
x: l.start,
|
|
258
|
+
y: 0,
|
|
259
|
+
width: l.width,
|
|
260
|
+
height: g.value.height,
|
|
261
|
+
fill: "transparent",
|
|
262
|
+
stroke: "none",
|
|
263
|
+
class: F({ animated: !_.value }),
|
|
264
|
+
onMouseenter: () => ae({ datapoint: l, seriesIndex: o }),
|
|
265
|
+
onMouseleave: a[0] || (a[0] = (h) => {
|
|
266
|
+
A.value = !1, k.value = null;
|
|
267
|
+
})
|
|
268
|
+
}, null, 42, Ne))), 128))
|
|
269
|
+
])) : (s(), r("rect", {
|
|
270
|
+
key: 1,
|
|
271
|
+
x: 2,
|
|
272
|
+
y: 1,
|
|
273
|
+
width: g.value.width - 4,
|
|
274
|
+
height: g.value.height - 2,
|
|
275
|
+
stroke: "#CCCCCC",
|
|
276
|
+
"stroke-width": "2",
|
|
277
|
+
fill: "transparent",
|
|
278
|
+
rx: (g.value.height - 4) / 2
|
|
279
|
+
}, null, 8, Ae))
|
|
280
|
+
], 8, _e)) : y("", !0),
|
|
281
|
+
M.value ? y("", !0) : (s(), re(ye, {
|
|
282
|
+
key: 2,
|
|
283
|
+
config: {
|
|
284
|
+
type: "sparkStackbar",
|
|
285
|
+
style: {
|
|
286
|
+
backgroundColor: e.value.style.backgroundColor,
|
|
287
|
+
sparkStackbar: {
|
|
288
|
+
color: "#CCCCCC"
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}, null, 8, ["config"])),
|
|
293
|
+
e.value.style.legend.show ? (s(), r("div", {
|
|
294
|
+
key: 3,
|
|
295
|
+
style: v(`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"}`),
|
|
296
|
+
class: "vue-ui-sparkstackbar-legend"
|
|
297
|
+
}, [
|
|
298
|
+
(s(!0), r(x, null, $(z.value, (l, o) => (s(), r("div", {
|
|
299
|
+
style: v(`font-size:${e.value.style.legend.fontSize}px;`),
|
|
300
|
+
class: F({ "vue-ui-sparkstackbar-legend-item": !0, "vue-ui-sparkstackbar-legend-item-unselected": f.value.includes(o) }),
|
|
301
|
+
onClick: (h) => {
|
|
302
|
+
oe(o), W(l, o);
|
|
303
|
+
}
|
|
304
|
+
}, [
|
|
305
|
+
p("div", Be, [
|
|
306
|
+
(s(), r("svg", {
|
|
307
|
+
height: `${e.value.style.legend.fontSize}px`,
|
|
308
|
+
width: `${e.value.style.legend.fontSize}px`,
|
|
309
|
+
viewBox: "0 0 10 10"
|
|
310
|
+
}, [
|
|
311
|
+
p("circle", {
|
|
312
|
+
cx: 5,
|
|
313
|
+
cy: 5,
|
|
314
|
+
r: 5,
|
|
315
|
+
fill: l.color
|
|
316
|
+
}, null, 8, je)
|
|
317
|
+
], 8, Oe)),
|
|
318
|
+
p("span", {
|
|
319
|
+
style: v(`color:${e.value.style.legend.name.color}; font-weight:${e.value.style.legend.name.bold ? "bold" : "normal"}`)
|
|
320
|
+
}, w(l.name), 5),
|
|
321
|
+
e.value.style.legend.percentage.show ? (s(), r("span", {
|
|
322
|
+
key: 0,
|
|
323
|
+
style: v(`font-weight:${e.value.style.legend.percentage.bold ? "bold" : "normal"};color:${e.value.style.legend.percentage.color}`)
|
|
324
|
+
}, w(f.value.includes(o) ? " - " : l.proportionLabel), 5)) : y("", !0),
|
|
325
|
+
e.value.style.legend.value.show ? (s(), r("span", {
|
|
326
|
+
key: 1,
|
|
327
|
+
style: v(`font-weight:${e.value.style.legend.value.bold ? "bold" : "normal"};color:${e.value.style.legend.value.color}`)
|
|
328
|
+
}, " (" + w(C(Q)(
|
|
329
|
+
e.value.style.legend.value.formatter,
|
|
330
|
+
l.value,
|
|
331
|
+
C(E)({
|
|
332
|
+
p: e.value.style.legend.value.prefix,
|
|
333
|
+
v: l.value,
|
|
334
|
+
s: e.value.style.legend.value.suffix,
|
|
335
|
+
r: e.value.style.legend.value.rounding
|
|
336
|
+
}),
|
|
337
|
+
{ datapoint: l, seriesIndex: o }
|
|
338
|
+
)) + ") ", 5)) : y("", !0)
|
|
339
|
+
])
|
|
340
|
+
], 14, Le))), 256))
|
|
341
|
+
], 4)) : y("", !0),
|
|
342
|
+
G(be, {
|
|
343
|
+
show: A.value && e.value.style.tooltip.show,
|
|
344
|
+
parent: T.value,
|
|
345
|
+
backgroundColor: e.value.style.backgroundColor,
|
|
346
|
+
color: e.value.style.color,
|
|
347
|
+
fontSize: e.value.style.tooltip.fontSize,
|
|
348
|
+
borderRadius: e.value.style.tooltip.borderRadius,
|
|
349
|
+
borderColor: e.value.style.tooltip.borderColor,
|
|
350
|
+
borderWidth: e.value.style.tooltip.borderWidth,
|
|
351
|
+
backgroundOpacity: e.value.style.tooltip.backgroundOpacity,
|
|
352
|
+
position: e.value.style.tooltip.position,
|
|
353
|
+
content: L.value,
|
|
354
|
+
isCustom: D.value,
|
|
355
|
+
offsetY: -124 + e.value.style.tooltip.offsetY,
|
|
356
|
+
blockShiftY: !0
|
|
357
|
+
}, {
|
|
358
|
+
"tooltip-before": q(() => [
|
|
359
|
+
j(t.$slots, "tooltip-before", H(X({ ...O.value })), void 0, !0)
|
|
360
|
+
]),
|
|
361
|
+
"tooltip-after": q(() => [
|
|
362
|
+
j(t.$slots, "tooltip-after", H(X({ ...O.value })), void 0, !0)
|
|
363
|
+
]),
|
|
364
|
+
_: 3
|
|
365
|
+
}, 8, ["show", "parent", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "content", "isCustom", "offsetY"]),
|
|
366
|
+
t.$slots.source ? (s(), r("div", Ee, [
|
|
367
|
+
j(t.$slots, "source", {}, void 0, !0)
|
|
368
|
+
], 512)) : y("", !0)
|
|
369
|
+
], 4));
|
|
370
|
+
}
|
|
371
|
+
}, Ge = /* @__PURE__ */ ke(Me, [["__scopeId", "data-v-6f122b0f"]]);
|
|
372
|
+
export {
|
|
373
|
+
Ge as default
|
|
374
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-Ci5MafHS.cjs"),Le=require("./useNestedProp-DxZ05ZEt.cjs"),Se=require("./useResponsive-BJ7DTGpm.cjs"),ze=require("./usePrinter-B3HaYNI4.cjs"),Ye=require("./Slicer-U4q5iMIE.cjs"),Ge=require("./Tooltip-CN6_JyjT.cjs"),Je=require("./Title-aR9ViX_A.cjs"),Ze=require("./Legend-D2iK-_M0.cjs"),Ke=require("./vue-ui-accordion-kQwtYRmD.cjs"),Qe=require("./DataTable-CqaGqXkz.cjs"),je=require("./vue-ui-skeleton-Si57O3af.cjs"),et=require("./PackageVersion-DjuywB0J.cjs"),tt=require("./PenAndPaper-DoKpW2Tl.cjs"),at=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),lt=["id"],ot=["xmlns","viewBox"],rt={key:0},st=["id"],nt=["stop-color"],it=["stop-color"],ut=["stop-color"],ct=["x1","x2","y1","y2","stroke"],dt=["x1","x2","y1","y2","stroke"],vt=["x1","x2","y1","y2","stroke"],ht=["x1","x2","y1","y2","stroke"],gt=["x","y","height","rx","width","fill","stroke","stroke-width"],yt=["x","y","width","rx","height","fill","stroke","stroke-width"],mt=["x1","x2","y1","y2","stroke","stroke-width"],bt=["x1","x2","y1","y2","stroke","stroke-width"],pt=["x","y","font-size","fill","font-weight"],ft=["transform","font-size","fill","font-weight"],kt=["x","y","font-size","fill","font-weight"],xt={key:0},wt=["x","y","font-size","font-weight","fill"],Ct=["x","y","font-size","fill","font-weight"],Bt={key:0},Lt=["x","y","font-size","font-weight","fill"],St=["x1","x2","y1","y2","stroke"],zt=["x","y","font-size","font-weight","fill"],_t=["x1","x2","y1","y2","stroke"],Nt=["font-size","font-weight","fill","text-anchor","transform"],Et=["text-anchor","font-size","font-weight","fill","transform"],Mt=["font-size","font-weight","fill","x","y"],$t=["x","y","width","height","onClick","onMouseenter","fill"],Tt=["x","y","width","height","onClick","onMouseenter","fill"],Vt={key:4,class:"vue-data-ui-watermark"},Pt=["onClick"],Ft=["innerHTML"],Rt={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend"],setup(Z,{expose:_e,emit:K}){const y=Z,{vue_ui_stackbar:Ne}=c.useConfig(),E=e.computed({get(){return!!y.dataset&&y.dataset.length},set(l){return l}}),M=e.ref(null),U=e.ref(c.createUid()),O=e.ref(!1),Q=e.ref(null),X=e.ref(""),p=e.ref([]),j=e.ref(0),ee=e.ref(null),te=e.ref(null),ae=e.ref(null),le=e.ref(null),oe=e.ref(0),Y=e.ref(!1),$=e.ref(null),T=e.ref(!1),Ee=e.ref(0),Me=e.ref(0),$e=e.ref(0);e.onMounted(()=>{G()});const t=e.computed({get:()=>re(),set:l=>l});function re(){const l=Le.useNestedProp({userConfig:y.config,defaultConfig:Ne});let r={};return l.theme?r={...Le.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=re(),G(),Ee.value+=1,Me.value+=1,$e.value+=1},{deep:!0}),e.watch(()=>y.dataset,l=>{ve()},{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:se,isImaging:ne,generatePdf:ie,generateImage:ue}=ze.usePrinter({elementId:`stackbar_${U.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}}),Te=e.computed(()=>c.convertCustomPalette(t.value.customPalette)),ce=e.ref(null),de=e.ref(null);e.onMounted(()=>{G()});function G(){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=Se.throttle(()=>{T.value=!1;const{width:r,height:a}=Se.useResponsive({chart:M.value,title:t.value.style.chart.title.text?ee.value:null,legend:t.value.style.chart.legend.show?te.value:null,slicer:t.value.style.chart.zoom.show&&L.value>1?ae.value:null,source:le.value});D.value.width=r,D.value.height=a,clearTimeout(de.value),de.value=setTimeout(()=>{T.value=!0},10)});ce.value=new ResizeObserver(l),ce.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)||Te.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 ve(){u.value={start:0,end:Math.max(...y.dataset.map(l=>l.series.length))},oe.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)),Ve=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)),A=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(...A.value.positive),r=Math.min(...A.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}))}),P=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(...A.value.positive)||0,i=Math.min(...A.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:F}=S,_=F+(z>=0?0:Math.abs(z))||1,f=s.value.height,W=s.value.width,Ce=w.value[0]?w.value[0].zero:s.value.bottom,Be=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),De=R.signedSeries.slice(u.value.start,u.value.end),Ae=C.map((v,h)=>s.value.left+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),Ie=C.map((v,h)=>s.value.top+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),qe=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=Ce-x-l[h],l[h]+=x):(x=f*k,N=Ce+a[h],a[h]+=Math.abs(x)),N}),He=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=W*k,N=Be+r[h],r[h]+=x):(x=W*k,N=Be-Math.abs(x)-o[h],o[h]+=Math.abs(x)),N}),We=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)}),Ue=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?W*k:W*Math.abs(k)}),Xe=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)/Xe),series:C,signedSeries:De,x:Ae,y:qe,height:We,horizontal_width:Ue,horizontal_y:Ie,horizontal_x:He}})}),he=e.computed(()=>Ve.value.map((l,r)=>({value:l,sign:l>=0?1:-1})));function I(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 ge(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 ye(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}));K("selectDatapoint",{datapoint:r,period:P.value[l]})}function me(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})))X.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 F="";P.value[l]&&(F+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${m};padding-bottom:6px;margin-bottom:3px;">${P.value[l]}</div>`);const _=[n&&i?"(":"",n&&i?")":""];a.reverse().forEach(f=>{F+=`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-uTaoMjg1.cjs"),Le=require("./useNestedProp-P8wzQfmW.cjs"),Se=require("./useResponsive-BJ7DTGpm.cjs"),ze=require("./usePrinter-DGnyAFMM.cjs"),Ye=require("./Slicer-BMIoaXrp.cjs"),Ge=require("./Tooltip-DSZJXOZo.cjs"),Je=require("./Title-BqcJ8-j1.cjs"),Ze=require("./Legend-Ds7yCP4e.cjs"),Ke=require("./vue-ui-accordion-D88l7NVk.cjs"),Qe=require("./DataTable-CxaymjxX.cjs"),je=require("./vue-ui-skeleton-B9HVcMQ5.cjs"),et=require("./PackageVersion-DgPnBWYN.cjs"),tt=require("./PenAndPaper-vKdCNpVJ.cjs"),at=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),lt=["id"],ot=["xmlns","viewBox"],rt={key:0},st=["id"],nt=["stop-color"],it=["stop-color"],ut=["stop-color"],ct=["x1","x2","y1","y2","stroke"],dt=["x1","x2","y1","y2","stroke"],vt=["x1","x2","y1","y2","stroke"],ht=["x1","x2","y1","y2","stroke"],gt=["x","y","height","rx","width","fill","stroke","stroke-width"],yt=["x","y","width","rx","height","fill","stroke","stroke-width"],mt=["x1","x2","y1","y2","stroke","stroke-width"],bt=["x1","x2","y1","y2","stroke","stroke-width"],pt=["x","y","font-size","fill","font-weight"],ft=["transform","font-size","fill","font-weight"],kt=["x","y","font-size","fill","font-weight"],xt={key:0},wt=["x","y","font-size","font-weight","fill"],Ct=["x","y","font-size","fill","font-weight"],Bt={key:0},Lt=["x","y","font-size","font-weight","fill"],St=["x1","x2","y1","y2","stroke"],zt=["x","y","font-size","font-weight","fill"],_t=["x1","x2","y1","y2","stroke"],Nt=["font-size","font-weight","fill","text-anchor","transform"],Et=["text-anchor","font-size","font-weight","fill","transform"],Mt=["font-size","font-weight","fill","x","y"],$t=["x","y","width","height","onClick","onMouseenter","fill"],Tt=["x","y","width","height","onClick","onMouseenter","fill"],Vt={key:4,class:"vue-data-ui-watermark"},Pt=["onClick"],Ft=["innerHTML"],Rt={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend"],setup(Z,{expose:_e,emit:K}){const y=Z,{vue_ui_stackbar:Ne}=c.useConfig(),E=e.computed({get(){return!!y.dataset&&y.dataset.length},set(l){return l}}),M=e.ref(null),U=e.ref(c.createUid()),O=e.ref(!1),Q=e.ref(null),X=e.ref(""),p=e.ref([]),j=e.ref(0),ee=e.ref(null),te=e.ref(null),ae=e.ref(null),le=e.ref(null),oe=e.ref(0),Y=e.ref(!1),$=e.ref(null),T=e.ref(!1),Ee=e.ref(0),Me=e.ref(0),$e=e.ref(0);e.onMounted(()=>{G()});const t=e.computed({get:()=>re(),set:l=>l});function re(){const l=Le.useNestedProp({userConfig:y.config,defaultConfig:Ne});let r={};return l.theme?r={...Le.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=re(),G(),Ee.value+=1,Me.value+=1,$e.value+=1},{deep:!0}),e.watch(()=>y.dataset,l=>{ve()},{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:se,isImaging:ne,generatePdf:ie,generateImage:ue}=ze.usePrinter({elementId:`stackbar_${U.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}}),Te=e.computed(()=>c.convertCustomPalette(t.value.customPalette)),ce=e.ref(null),de=e.ref(null);e.onMounted(()=>{G()});function G(){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=Se.throttle(()=>{T.value=!1;const{width:r,height:a}=Se.useResponsive({chart:M.value,title:t.value.style.chart.title.text?ee.value:null,legend:t.value.style.chart.legend.show?te.value:null,slicer:t.value.style.chart.zoom.show&&L.value>1?ae.value:null,source:le.value});D.value.width=r,D.value.height=a,clearTimeout(de.value),de.value=setTimeout(()=>{T.value=!0},10)});ce.value=new ResizeObserver(l),ce.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)||Te.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 ve(){u.value={start:0,end:Math.max(...y.dataset.map(l=>l.series.length))},oe.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)),Ve=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)),A=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(...A.value.positive),r=Math.min(...A.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}))}),P=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(...A.value.positive)||0,i=Math.min(...A.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:F}=S,_=F+(z>=0?0:Math.abs(z))||1,f=s.value.height,W=s.value.width,Ce=w.value[0]?w.value[0].zero:s.value.bottom,Be=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),De=R.signedSeries.slice(u.value.start,u.value.end),Ae=C.map((v,h)=>s.value.left+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),Ie=C.map((v,h)=>s.value.top+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),qe=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=Ce-x-l[h],l[h]+=x):(x=f*k,N=Ce+a[h],a[h]+=Math.abs(x)),N}),He=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=W*k,N=Be+r[h],r[h]+=x):(x=W*k,N=Be-Math.abs(x)-o[h],o[h]+=Math.abs(x)),N}),We=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)}),Ue=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?W*k:W*Math.abs(k)}),Xe=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)/Xe),series:C,signedSeries:De,x:Ae,y:qe,height:We,horizontal_width:Ue,horizontal_y:Ie,horizontal_x:He}})}),he=e.computed(()=>Ve.value.map((l,r)=>({value:l,sign:l>=0?1:-1})));function I(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 ge(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 ye(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}));K("selectDatapoint",{datapoint:r,period:P.value[l]})}function me(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})))X.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 F="";P.value[l]&&(F+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${m};padding-bottom:6px;margin-bottom:3px;">${P.value[l]}</div>`);const _=[n&&i?"(":"",n&&i?")":""];a.reverse().forEach(f=>{F+=`
|
|
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,17 +1,17 @@
|
|
|
1
1
|
import { computed as p, ref as g, onMounted as Xe, watch as Ue, openBlock as s, createElementBlock as n, normalizeClass as ye, normalizeStyle as U, createBlock as Y, createCommentVNode as v, renderSlot as k, createVNode as se, unref as z, createSlots as xt, withCtx as C, normalizeProps as D, guardReactiveProps as E, Fragment as h, renderList as f, createElementVNode as H, toDisplayString as S, createTextVNode as kt } from "vue";
|
|
2
|
-
import { u as wt, c as Ye, t as Ct, a as _t, p as ie, M as Ge, b as zt, o as Lt, e as Je, g as St, d as $t, a4 as ne, a0 as qe, C as Ze, X as Mt, l as Tt, F as Ke, f as B, x as Qe, i as je, y as Nt, q as Ot, r as Pt } from "./index-
|
|
3
|
-
import { u as et } from "./useNestedProp-
|
|
2
|
+
import { u as wt, c as Ye, t as Ct, a as _t, p as ie, M as Ge, b as zt, o as Lt, e as Je, g as St, d as $t, a4 as ne, a0 as qe, C as Ze, X as Mt, l as Tt, F as Ke, f as B, x as Qe, i as je, y as Nt, q as Ot, r as Pt } from "./index-Qst-5kz0.js";
|
|
3
|
+
import { u as et } from "./useNestedProp-D3SUMrZY.js";
|
|
4
4
|
import { t as At, u as Rt } from "./useResponsive-CoxXLe23.js";
|
|
5
|
-
import { u as It, U as Ft } from "./usePrinter-
|
|
6
|
-
import { S as Vt } from "./Slicer-
|
|
7
|
-
import { _ as Dt } from "./Tooltip-
|
|
8
|
-
import { _ as Et } from "./Title-
|
|
9
|
-
import { L as Ht } from "./Legend-
|
|
10
|
-
import Bt from "./vue-ui-accordion-
|
|
11
|
-
import { D as Wt } from "./DataTable-
|
|
12
|
-
import Xt from "./vue-ui-skeleton-
|
|
13
|
-
import { _ as Ut } from "./PackageVersion-
|
|
14
|
-
import { P as Yt } from "./PenAndPaper-
|
|
5
|
+
import { u as It, U as Ft } from "./usePrinter-srpiqIq8.js";
|
|
6
|
+
import { S as Vt } from "./Slicer-BtiO3aSt.js";
|
|
7
|
+
import { _ as Dt } from "./Tooltip-WJvwo3eC.js";
|
|
8
|
+
import { _ as Et } from "./Title-CoonHZp1.js";
|
|
9
|
+
import { L as Ht } from "./Legend-xj_UZPuw.js";
|
|
10
|
+
import Bt from "./vue-ui-accordion-CHl3zwsU.js";
|
|
11
|
+
import { D as Wt } from "./DataTable-BlGRB1Pa.js";
|
|
12
|
+
import Xt from "./vue-ui-skeleton-3V3a9YDD.js";
|
|
13
|
+
import { _ as Ut } from "./PackageVersion-Crfv987V.js";
|
|
14
|
+
import { P as Yt } from "./PenAndPaper-D8QdkfKM.js";
|
|
15
15
|
import { _ as Gt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
16
16
|
const Jt = ["id"], qt = ["xmlns", "viewBox"], Zt = { key: 0 }, Kt = ["id"], Qt = ["stop-color"], jt = ["stop-color"], ea = ["stop-color"], ta = ["x1", "x2", "y1", "y2", "stroke"], aa = ["x1", "x2", "y1", "y2", "stroke"], la = ["x1", "x2", "y1", "y2", "stroke"], oa = ["x1", "x2", "y1", "y2", "stroke"], ra = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], sa = ["x", "y", "width", "rx", "height", "fill", "stroke", "stroke-width"], ia = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], na = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ua = ["x", "y", "font-size", "fill", "font-weight"], ca = ["transform", "font-size", "fill", "font-weight"], va = ["x", "y", "font-size", "fill", "font-weight"], ha = { key: 0 }, da = ["x", "y", "font-size", "font-weight", "fill"], ya = ["x", "y", "font-size", "fill", "font-weight"], ga = { key: 0 }, ba = ["x", "y", "font-size", "font-weight", "fill"], fa = ["x1", "x2", "y1", "y2", "stroke"], ma = ["x", "y", "font-size", "font-weight", "fill"], pa = ["x1", "x2", "y1", "y2", "stroke"], xa = ["font-size", "font-weight", "fill", "text-anchor", "transform"], ka = ["text-anchor", "font-size", "font-weight", "fill", "transform"], wa = ["font-size", "font-weight", "fill", "x", "y"], Ca = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], _a = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], za = {
|
|
17
17
|
key: 4,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { computed as h, ref as i, watch as Ie, onMounted as Me, onBeforeUnmount as De, openBlock as o, createElementBlock as u, normalizeClass as F, normalizeStyle as Q, createBlock as T, createCommentVNode as v, unref as d, createSlots as Ge, withCtx as f, renderSlot as y, normalizeProps as W, guardReactiveProps as I, createVNode as xe, Fragment as g, renderList as C, createElementVNode as k, toDisplayString as L, mergeProps as Ee, createTextVNode as Ve, nextTick as He } from "vue";
|
|
2
|
-
import { u as Re, c as Z, t as Ue, a as Be, p as A, o as Xe, e as ee, g as Ce, b as je, d as we, v as Ye, C as Je, f as B, X as qe, i as te, l as Ke, h as Qe, x as _e, y as Ze, q as et, r as tt, E as lt } from "./index-
|
|
2
|
+
import { u as Re, c as Z, t as Ue, a as Be, p as A, o as Xe, e as ee, g as Ce, b as je, d as we, v as Ye, C as Je, f as B, X as qe, i as te, l as Ke, h as Qe, x as _e, y as Ze, q as et, r as tt, E as lt } from "./index-Qst-5kz0.js";
|
|
3
3
|
import { t as at, u as ot } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { _ as st } from "./Title-
|
|
5
|
-
import { u as rt, U as ut } from "./usePrinter-
|
|
6
|
-
import { _ as nt } from "./Tooltip-
|
|
7
|
-
import { D as it } from "./DataTable-
|
|
8
|
-
import vt from "./vue-ui-skeleton-
|
|
9
|
-
import { _ as ct } from "./Shape-
|
|
10
|
-
import ht from "./vue-ui-accordion-
|
|
11
|
-
import { u as $e } from "./useNestedProp-
|
|
12
|
-
import { _ as dt } from "./PackageVersion-
|
|
13
|
-
import { P as pt } from "./PenAndPaper-
|
|
4
|
+
import { _ as st } from "./Title-CoonHZp1.js";
|
|
5
|
+
import { u as rt, U as ut } from "./usePrinter-srpiqIq8.js";
|
|
6
|
+
import { _ as nt } from "./Tooltip-WJvwo3eC.js";
|
|
7
|
+
import { D as it } from "./DataTable-BlGRB1Pa.js";
|
|
8
|
+
import vt from "./vue-ui-skeleton-3V3a9YDD.js";
|
|
9
|
+
import { _ as ct } from "./Shape-DNQDrxfn.js";
|
|
10
|
+
import ht from "./vue-ui-accordion-CHl3zwsU.js";
|
|
11
|
+
import { u as $e } from "./useNestedProp-D3SUMrZY.js";
|
|
12
|
+
import { _ as dt } from "./PackageVersion-Crfv987V.js";
|
|
13
|
+
import { P as pt } from "./PenAndPaper-D8QdkfKM.js";
|
|
14
14
|
import { _ as ft } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
15
15
|
const yt = ["id"], bt = ["xmlns", "viewBox"], mt = { key: 0 }, gt = { key: 0 }, kt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], xt = { key: 1 }, Ct = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], wt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], _t = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], $t = ["x", "y", "fill", "font-size"], Tt = ["x", "y", "font-size", "fill"], Lt = ["fill", "font-size", "transform"], At = ["fill", "font-size", "x", "y"], Pt = ["x1", "x2", "y1", "y2", "stroke"], St = ["cx", "cy", "fill"], zt = ["cx", "cy", "fill"], Nt = ["id"], Ot = ["stop-color"], Ft = ["stop-color"], Wt = ["stop-color"], It = { key: 0 }, Mt = ["x", "y", "font-size", "fill"], Dt = {
|
|
16
16
|
key: 5,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-Ci5MafHS.cjs"),te=require("./useResponsive-BJ7DTGpm.cjs"),pe=require("./Title-aR9ViX_A.cjs"),le=require("./usePrinter-B3HaYNI4.cjs"),me=require("./Tooltip-CN6_JyjT.cjs"),fe=require("./DataTable-CqaGqXkz.cjs"),ye=require("./vue-ui-skeleton-Si57O3af.cjs"),be=require("./Shape-BfZLKYNk.cjs"),ge=require("./vue-ui-accordion-kQwtYRmD.cjs"),ae=require("./useNestedProp-DxZ05ZEt.cjs"),ke=require("./PackageVersion-DjuywB0J.cjs"),xe=require("./PenAndPaper-DoKpW2Tl.cjs"),Ce=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),we=["id"],Be=["xmlns","viewBox"],Ne={key:0},_e={key:0},$e=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Se={key:1},Te=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Le=["x1","x2","y1","y2","stroke","stroke-width"],Pe=["x1","x2","y1","y2","stroke","stroke-width"],Ee=["x","y","fill","font-size"],Ae=["x","y","font-size","fill"],ze=["fill","font-size","transform"],Ve=["fill","font-size","x","y"],Fe=["x1","x2","y1","y2","stroke"],Oe=["cx","cy","fill"],De=["cx","cy","fill"],Me=["id"],We=["stop-color"],Ie=["stop-color"],qe=["stop-color"],Ge={key:0},Re=["x","y","font-size","fill"],Ue={key:5,class:"vue-data-ui-watermark"},He=["innerHTML"],je={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(oe,{expose:re,emit:se}){const v=oe,{vue_ui_strip_plot:ne}=o.useConfig(),p=e.computed({get(){return!!v.dataset&&v.dataset.length},set(l){return l}}),L=e.ref(o.createUid()),F=e.ref(0),P=e.ref(!1),E=e.ref(""),y=e.ref(null),O=e.ref(null),D=e.ref(null),M=e.ref(null),W=e.ref(!1),I=e.ref(0),q=e.ref(0),t=e.computed({get:()=>G(),set:l=>l});function G(){const l=ae.useNestedProp({userConfig:v.config,defaultConfig:ne});return l.theme?{...ae.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=G(),R(),I.value+=1,q.value+=1},{deep:!0});const C=e.ref(null);e.onMounted(()=>{R()});function R(){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=te.throttle(()=>{const{width:s,height:a}=te.useResponsive({chart:y.value,title:t.value.style.chart.title.text?O.value:null,source:D.value,noTitle:M.value});w.value=a,b.value.width=s,b.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(y.value.parentNode)}W.value=!0,setTimeout(()=>{g.value=!1},ie.value*50)}e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:U,isImaging:H,generatePdf:j,generateImage:X}=le.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot"}),ue=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Y=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),b=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}}),N=e.computed(()=>p.value?v.dataset.map((l,s)=>{const a=o.createUid();return{...l,id:a,color:l.color?o.convertColorToHex(l.color):Y.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):Y.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(()=>(N.value||[]).map((l,s)=>({...l,plots:l.plots.map(a=>({...a,x:r.value.left+(s+1)*r.value.stripWidth-r.value.stripWidth/2}))}))),ie=e.computed(()=>Math.max(...h.value.map(l=>l.plots.length))),A=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(A.value.min<0?A.value.min:0,A.value.max,t.value.style.chart.grid.scaleSteps)),ce=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}))}))),J=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 ve({datapoint:l,seriesIndex:s}){z.value={datapoint:l,seriesIndex:s,config:t.value,series:N.value},P.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:N.value,config:t.value})))E.value=a({seriesIndex:s,datapoint:l,series:N.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>`,E.value=`<div>${n}</div>`}}const _=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 K(){e.nextTick(()=>{const l=_.value.head.map((n,u)=>[[n.name],[_.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=_.value.head.map((u,f)=>{const T=o.dataLabel({p:t.value.style.chart.labels.prefix,v:_.value.body[f],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},T]}),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 de(l){x.value=l,F.value+=1}function he(){return h.value}function Q(){c.value.showTable=!c.value.showTable}function Z(){c.value.dataLabels.show=!c.value.dataLabels.show}function ee(){c.value.showTooltip=!c.value.showTooltip}const S=e.ref(!1);function V(){S.value=!S.value}return re({getData:he,generatePdf:j,generateCsv:K,generateImage:X,toggleTable:Q,toggleLabels:Z,toggleTooltip:ee,toggleAnnotator:V}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"stripPlotChart",ref:y,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;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`strip-plot_${L.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(xe.PenAndPaper,{key:0,parent:y.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:S.value,onClose:V},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ue.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:M,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:O,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(pe._sfc_main,{key:`title_${I.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(le.UserOptions,{ref:"details",key:`user_option_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(U),isImaging:e.unref(H),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:y.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:S.value,onToggleFullscreen:de,onGeneratePdf:e.unref(j),onGenerateCsv:K,onGenerateImage:e.unref(X),onToggleTable:Q,onToggleLabels:Z,onToggleTooltip:ee,onToggleAnnotator:V},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,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:n})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:4,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 ${b.value.width<=0?10:b.value.width} ${b.value.height<=0?10:b.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color};`)},[e.createVNode(ke._sfc_main),t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",Ne,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",_e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.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,$e))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",Se,[(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,Te))),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,Le),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,Pe)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(J.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,Ee))),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,Ae))),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,ze)):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,Ve)):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,Fe),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,Oe),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,De)],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,We),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(o.darkenHexColor)(a.color,.1)},null,8,Ie),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,qe)],8,Me))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ce.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(be._sfc_main,e.mergeProps({plot:{x:u.x,y:W.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:T=>ve({datapoint:u,seriesIndex:f}),onMouseleave:s[0]||(s[0]=T=>{P.value=!1,i.value=null}),onClick:T=>se("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",Ge,[(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,Re)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:r.value},void 0,!0)],14,Be)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ue,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(U)||e.unref(H)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ye.default,{key:6,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:D,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(me._sfc_main,{show:c.value.showTooltip&&P.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:y.value,content:E.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(ge.default,{key:8,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(fe.DataTable,{key:`table_${q.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,He)]),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,we))}},Xe=Ce._export_sfc(je,[["__scopeId","data-v-1a3e0788"]]);exports.default=Xe;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-uTaoMjg1.cjs"),te=require("./useResponsive-BJ7DTGpm.cjs"),pe=require("./Title-BqcJ8-j1.cjs"),le=require("./usePrinter-DGnyAFMM.cjs"),me=require("./Tooltip-DSZJXOZo.cjs"),fe=require("./DataTable-CxaymjxX.cjs"),ye=require("./vue-ui-skeleton-B9HVcMQ5.cjs"),be=require("./Shape-M9CIgwzd.cjs"),ge=require("./vue-ui-accordion-D88l7NVk.cjs"),ae=require("./useNestedProp-P8wzQfmW.cjs"),ke=require("./PackageVersion-DgPnBWYN.cjs"),xe=require("./PenAndPaper-vKdCNpVJ.cjs"),Ce=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),we=["id"],Be=["xmlns","viewBox"],Ne={key:0},_e={key:0},$e=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Se={key:1},Te=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Le=["x1","x2","y1","y2","stroke","stroke-width"],Pe=["x1","x2","y1","y2","stroke","stroke-width"],Ee=["x","y","fill","font-size"],Ae=["x","y","font-size","fill"],ze=["fill","font-size","transform"],Ve=["fill","font-size","x","y"],Fe=["x1","x2","y1","y2","stroke"],Oe=["cx","cy","fill"],De=["cx","cy","fill"],Me=["id"],We=["stop-color"],Ie=["stop-color"],qe=["stop-color"],Ge={key:0},Re=["x","y","font-size","fill"],Ue={key:5,class:"vue-data-ui-watermark"},He=["innerHTML"],je={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(oe,{expose:re,emit:se}){const v=oe,{vue_ui_strip_plot:ne}=o.useConfig(),p=e.computed({get(){return!!v.dataset&&v.dataset.length},set(l){return l}}),L=e.ref(o.createUid()),F=e.ref(0),P=e.ref(!1),E=e.ref(""),y=e.ref(null),O=e.ref(null),D=e.ref(null),M=e.ref(null),W=e.ref(!1),I=e.ref(0),q=e.ref(0),t=e.computed({get:()=>G(),set:l=>l});function G(){const l=ae.useNestedProp({userConfig:v.config,defaultConfig:ne});return l.theme?{...ae.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=G(),R(),I.value+=1,q.value+=1},{deep:!0});const C=e.ref(null);e.onMounted(()=>{R()});function R(){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=te.throttle(()=>{const{width:s,height:a}=te.useResponsive({chart:y.value,title:t.value.style.chart.title.text?O.value:null,source:D.value,noTitle:M.value});w.value=a,b.value.width=s,b.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(y.value.parentNode)}W.value=!0,setTimeout(()=>{g.value=!1},ie.value*50)}e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:U,isImaging:H,generatePdf:j,generateImage:X}=le.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot"}),ue=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Y=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),b=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}}),N=e.computed(()=>p.value?v.dataset.map((l,s)=>{const a=o.createUid();return{...l,id:a,color:l.color?o.convertColorToHex(l.color):Y.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):Y.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(()=>(N.value||[]).map((l,s)=>({...l,plots:l.plots.map(a=>({...a,x:r.value.left+(s+1)*r.value.stripWidth-r.value.stripWidth/2}))}))),ie=e.computed(()=>Math.max(...h.value.map(l=>l.plots.length))),A=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(A.value.min<0?A.value.min:0,A.value.max,t.value.style.chart.grid.scaleSteps)),ce=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}))}))),J=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 ve({datapoint:l,seriesIndex:s}){z.value={datapoint:l,seriesIndex:s,config:t.value,series:N.value},P.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:N.value,config:t.value})))E.value=a({seriesIndex:s,datapoint:l,series:N.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>`,E.value=`<div>${n}</div>`}}const _=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 K(){e.nextTick(()=>{const l=_.value.head.map((n,u)=>[[n.name],[_.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=_.value.head.map((u,f)=>{const T=o.dataLabel({p:t.value.style.chart.labels.prefix,v:_.value.body[f],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},T]}),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 de(l){x.value=l,F.value+=1}function he(){return h.value}function Q(){c.value.showTable=!c.value.showTable}function Z(){c.value.dataLabels.show=!c.value.dataLabels.show}function ee(){c.value.showTooltip=!c.value.showTooltip}const S=e.ref(!1);function V(){S.value=!S.value}return re({getData:he,generatePdf:j,generateCsv:K,generateImage:X,toggleTable:Q,toggleLabels:Z,toggleTooltip:ee,toggleAnnotator:V}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"stripPlotChart",ref:y,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;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`strip-plot_${L.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(xe.PenAndPaper,{key:0,parent:y.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:S.value,onClose:V},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ue.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:M,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:O,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(pe._sfc_main,{key:`title_${I.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(le.UserOptions,{ref:"details",key:`user_option_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(U),isImaging:e.unref(H),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:y.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:S.value,onToggleFullscreen:de,onGeneratePdf:e.unref(j),onGenerateCsv:K,onGenerateImage:e.unref(X),onToggleTable:Q,onToggleLabels:Z,onToggleTooltip:ee,onToggleAnnotator:V},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,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:n})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:4,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 ${b.value.width<=0?10:b.value.width} ${b.value.height<=0?10:b.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color};`)},[e.createVNode(ke._sfc_main),t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",Ne,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",_e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.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,$e))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",Se,[(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,Te))),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,Le),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,Pe)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(J.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,Ee))),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,Ae))),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,ze)):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,Ve)):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,Fe),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,Oe),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,De)],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,We),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(o.darkenHexColor)(a.color,.1)},null,8,Ie),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,qe)],8,Me))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ce.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(be._sfc_main,e.mergeProps({plot:{x:u.x,y:W.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:T=>ve({datapoint:u,seriesIndex:f}),onMouseleave:s[0]||(s[0]=T=>{P.value=!1,i.value=null}),onClick:T=>se("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",Ge,[(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,Re)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:r.value},void 0,!0)],14,Be)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ue,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(U)||e.unref(H)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ye.default,{key:6,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:D,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(me._sfc_main,{show:c.value.showTooltip&&P.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:y.value,content:E.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(ge.default,{key:8,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(fe.DataTable,{key:`table_${q.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,He)]),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,we))}},Xe=Ce._export_sfc(je,[["__scopeId","data-v-1a3e0788"]]);exports.default=Xe;
|