vue-data-ui 2.4.58 → 2.4.60
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 +82 -51
- package/dist/{Arrow-gAjHZoeI.js → Arrow-BLYi22nR.js} +1 -1
- package/dist/{Arrow-DyvFEpcu.cjs → Arrow-BoAS4IQq.cjs} +1 -1
- package/dist/{BaseIcon-DKQOeA_7.cjs → BaseIcon-BHIQREMO.cjs} +1 -1
- package/dist/{BaseIcon-B0g_Fksl.js → BaseIcon-EWtqg17H.js} +1 -1
- package/dist/{DataTable-BloVsNyj.js → DataTable-DO8KGCcE.js} +2 -2
- package/dist/{DataTable-Bju6hUOX.cjs → DataTable-Dtq94CxH.cjs} +1 -1
- package/dist/{Legend-BsPIe_nG.cjs → Legend-CMyzYtIb.cjs} +1 -1
- package/dist/{Legend-CdpH9pz7.js → Legend-DGWOCyLt.js} +1 -1
- package/dist/{PackageVersion-W3d_oNMs.js → PackageVersion-BSLNI6kk.js} +1 -1
- package/dist/{PackageVersion-Bmujq1-q.cjs → PackageVersion-B_1OHk5A.cjs} +1 -1
- package/dist/{PenAndPaper-xuFs3BqZ.js → PenAndPaper-CxMtGtJt.js} +3 -3
- package/dist/{PenAndPaper-Be8tn5wI.cjs → PenAndPaper-DhXsAnuf.cjs} +1 -1
- package/dist/{Shape-CXTDY_Vo.js → Shape-DnqZey62.js} +1 -1
- package/dist/{Shape-Cx89w9Ul.cjs → Shape-y66NSXKp.cjs} +1 -1
- package/dist/{Slicer-HGyFRIya.cjs → Slicer-CkI4c7ft.cjs} +1 -1
- package/dist/{Slicer-ENfxtrty.js → Slicer-D9bKLcPd.js} +2 -2
- package/dist/{Title-1u-GspsX.js → Title-CSqO5Y62.js} +1 -1
- package/dist/{Title-CNO85jNx.cjs → Title-DjAOcuWO.cjs} +1 -1
- package/dist/{Tooltip-DQOeAhx3.cjs → Tooltip-AHTiRuWB.cjs} +1 -1
- package/dist/{Tooltip-B-1Q-Tts.js → Tooltip-D_6iYZSH.js} +1 -1
- package/dist/documentation/installation.md +48 -48
- package/dist/index-CgZGelSi.cjs +9 -0
- package/dist/{index-BSzkwF5n.js → index-D7dTQAhm.js} +2 -2
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-CSKuqs0C.cjs → useNestedProp-BxCE3J3Z.cjs} +1 -1
- package/dist/{useNestedProp-BWC_DPZ5.js → useNestedProp-Dqsj7eUX.js} +1 -1
- package/dist/{usePrinter-DtwWejoO.js → usePrinter-B_Ihuvge.js} +1 -1
- package/dist/{usePrinter-D-iwyLyE.cjs → usePrinter-sTw1FdN_.cjs} +1 -1
- package/dist/{vue-data-ui-Com866XF.cjs → vue-data-ui-BttN99Pm.cjs} +1 -1
- package/dist/{vue-data-ui-jb1K_VTO.js → vue-data-ui-CcmpjOfT.js} +60 -60
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/vue-ui-3d-bar-8ewYobNj.cjs +19 -0
- package/dist/{vue-ui-3d-bar-Cqc5gqnb.js → vue-ui-3d-bar-TVrDBG5I.js} +170 -158
- package/dist/{vue-ui-accordion-lCjQo2kd.cjs → vue-ui-accordion-BZH6cz4t.cjs} +1 -1
- package/dist/{vue-ui-accordion-CJdfn7N-.js → vue-ui-accordion-lCiFhb8k.js} +3 -3
- package/dist/vue-ui-age-pyramid-BqL8zDjt.cjs +1 -0
- package/dist/{vue-ui-age-pyramid-D89kDZnF.js → vue-ui-age-pyramid-rHtMf5-R.js} +176 -164
- package/dist/{vue-ui-annotator-Cf-zFFmT.js → vue-ui-annotator-DHgSReIY.js} +1 -1
- package/dist/{vue-ui-annotator-muK3_F6c.cjs → vue-ui-annotator-fZIPfk7y.cjs} +1 -1
- package/dist/vue-ui-bullet-48af9PqJ.cjs +34 -0
- package/dist/{vue-ui-bullet-CT5Gkoot.js → vue-ui-bullet-BwhlvcvA.js} +155 -143
- package/dist/vue-ui-candlestick-Ce3tBGpX.cjs +2 -0
- package/dist/{vue-ui-candlestick-DmsHITZF.js → vue-ui-candlestick-dMIrnPD6.js} +96 -84
- package/dist/{vue-ui-carousel-table-N7QL7jRR.js → vue-ui-carousel-table-EcwgqGoI.js} +97 -95
- package/dist/vue-ui-carousel-table-ZhjRbt5-.cjs +1 -0
- package/dist/vue-ui-chestnut-VbrVVUon.cjs +6 -0
- package/dist/{vue-ui-chestnut-C7b1puxs.js → vue-ui-chestnut-vnOyc43k.js} +160 -148
- package/dist/{vue-ui-cursor-BOS7Yvio.cjs → vue-ui-cursor-BdXcdH2e.cjs} +1 -1
- package/dist/{vue-ui-cursor-CAnOat4M.js → vue-ui-cursor-nMbvzf_R.js} +2 -2
- package/dist/{vue-ui-dashboard-OzgTaY3n.js → vue-ui-dashboard-BtaQn50h.js} +2 -2
- package/dist/{vue-ui-dashboard-DI22fn9M.cjs → vue-ui-dashboard-CboN2WC8.cjs} +1 -1
- package/dist/{vue-ui-digits-DGP4EmpQ.cjs → vue-ui-digits-CUvrlpPz.cjs} +1 -1
- package/dist/{vue-ui-digits-DCm2stj-.js → vue-ui-digits-CVfceh4-.js} +2 -2
- package/dist/vue-ui-donut-BckYXDZJ.cjs +1 -0
- package/dist/{vue-ui-donut-BilWHtZy.js → vue-ui-donut-CgYNthls.js} +292 -280
- package/dist/vue-ui-donut-evolution-BhlBp6R-.cjs +1 -0
- package/dist/{vue-ui-donut-evolution-DKmnEHH_.js → vue-ui-donut-evolution-Bose25D6.js} +285 -273
- package/dist/vue-ui-dumbbell-C2iT17s8.cjs +9 -0
- package/dist/{vue-ui-dumbbell-KwkTK5_q.js → vue-ui-dumbbell-CzSlukSu.js} +159 -147
- package/dist/vue-ui-flow-DDlFrtkk.cjs +1 -0
- package/dist/{vue-ui-flow-BShJPhpa.js → vue-ui-flow-DoDWK84L.js} +162 -150
- package/dist/vue-ui-funnel-BfJoFIfh.cjs +1 -0
- package/dist/{vue-ui-funnel-D4xk_DsA.js → vue-ui-funnel-CM_ixf98.js} +229 -215
- package/dist/vue-ui-galaxy-CP71UAF5.cjs +1 -0
- package/dist/{vue-ui-galaxy-Ch3QRiP6.js → vue-ui-galaxy-DlwjTJCx.js} +148 -136
- package/dist/{vue-ui-gauge-DZUv5beK.js → vue-ui-gauge-ByfGCK6z.js} +119 -107
- package/dist/vue-ui-gauge-LqhfOqH-.cjs +1 -0
- package/dist/{vue-ui-gizmo-B39J58Zm.js → vue-ui-gizmo-D8Rq5vzL.js} +45 -43
- package/dist/vue-ui-gizmo-DFnOaVHf.cjs +1 -0
- package/dist/vue-ui-heatmap-A8qDlc58.cjs +1 -0
- package/dist/{vue-ui-heatmap-z8KMf1yo.js → vue-ui-heatmap-BLjVXXW4.js} +138 -126
- package/dist/vue-ui-history-plot-Bxi5QRP8.cjs +1 -0
- package/dist/{vue-ui-history-plot--Lw1-910.js → vue-ui-history-plot-DXoNlRFZ.js} +127 -115
- package/dist/vue-ui-kpi-5cGZ0OBJ.cjs +1 -0
- package/dist/{vue-ui-kpi-BgNONvkD.js → vue-ui-kpi-Bbot_WSI.js} +36 -33
- package/dist/{vue-ui-mini-loader-BrCuKpE6.js → vue-ui-mini-loader-DOE9WO73.js} +2 -2
- package/dist/{vue-ui-mini-loader-DjEyKAQe.cjs → vue-ui-mini-loader-DWX9tRhG.cjs} +1 -1
- package/dist/{vue-ui-molecule-C_eF6tga.js → vue-ui-molecule-0TReXB2j.js} +212 -200
- package/dist/vue-ui-molecule-CxeFzXS5.cjs +1 -0
- package/dist/vue-ui-mood-radar-1jLzXLXZ.cjs +1 -0
- package/dist/{vue-ui-mood-radar-Ch_Qkx9d.js → vue-ui-mood-radar-BMFn685U.js} +123 -111
- package/dist/vue-ui-nested-donuts-4FVj04vI.cjs +17 -0
- package/dist/{vue-ui-nested-donuts-uqfXLRGX.js → vue-ui-nested-donuts-B9rWg9V8.js} +156 -144
- package/dist/vue-ui-onion-Br97OxbL.cjs +5 -0
- package/dist/{vue-ui-onion-CbYOkmrF.js → vue-ui-onion-CnIF_tv7.js} +125 -113
- package/dist/vue-ui-parallel-coordinate-plot-Bi_h0H7e.cjs +8 -0
- package/dist/{vue-ui-parallel-coordinate-plot-aLNOckoo.js → vue-ui-parallel-coordinate-plot-D9iHCwiA.js} +159 -147
- package/dist/{vue-ui-quadrant-CuPCDHgS.js → vue-ui-quadrant-4wjbqumK.js} +211 -199
- package/dist/vue-ui-quadrant-DHDToQ9a.cjs +1 -0
- package/dist/vue-ui-quick-chart-CJKM6r9X.cjs +15 -0
- package/dist/{vue-ui-quick-chart-DBCH5qM1.js → vue-ui-quick-chart-s6FHOZf8.js} +576 -540
- package/dist/vue-ui-radar-DBR2qBM5.cjs +1 -0
- package/dist/{vue-ui-radar-BamYIcPL.js → vue-ui-radar-DpT9w1N-.js} +183 -171
- package/dist/vue-ui-rating-D1Mbw1G8.cjs +1 -0
- package/dist/{vue-ui-rating-DxaSXiPx.js → vue-ui-rating-D31vSe7a.js} +102 -98
- package/dist/vue-ui-relation-circle-BNJbqK_A.cjs +1 -0
- package/dist/{vue-ui-relation-circle-C9_8YW0u.js → vue-ui-relation-circle-DfP6BpVn.js} +129 -117
- package/dist/{vue-ui-rings-DFzPi4m9.js → vue-ui-rings-ChcGuwL9.js} +150 -138
- package/dist/vue-ui-rings-CjB8a3kO.cjs +2 -0
- package/dist/vue-ui-scatter-jk0N3EwD.cjs +1 -0
- package/dist/{vue-ui-scatter-n_jHEngt.js → vue-ui-scatter-wUZ2CBpp.js} +320 -308
- package/dist/{vue-ui-screenshot-1_OHWjZv.js → vue-ui-screenshot-Blg3Suvg.js} +1 -1
- package/dist/{vue-ui-screenshot-BzY_uB1R.cjs → vue-ui-screenshot-DAFpjSWg.cjs} +1 -1
- package/dist/{vue-ui-skeleton-Ojz7f2oH.js → vue-ui-skeleton-BObG0eVD.js} +3 -3
- package/dist/{vue-ui-skeleton-DKtNfORj.cjs → vue-ui-skeleton-m4l9jfqA.cjs} +1 -1
- package/dist/{vue-ui-smiley-CXvJ3sXA.js → vue-ui-smiley-DuQ3M02e.js} +208 -206
- package/dist/vue-ui-smiley-rh3J3TRY.cjs +2 -0
- package/dist/vue-ui-spark-trend-DlNNTu2c.cjs +1 -0
- package/dist/{vue-ui-spark-trend-uyDT9RJC.js → vue-ui-spark-trend-SMpnQ3VV.js} +124 -112
- package/dist/{vue-ui-sparkbar-CxW1vMP2.js → vue-ui-sparkbar-BB6fvRXK.js} +100 -96
- package/dist/vue-ui-sparkbar-chnu8aw9.cjs +1 -0
- package/dist/{vue-ui-sparkgauge-NmLBla47.js → vue-ui-sparkgauge-Bk_78-YB.js} +60 -48
- package/dist/vue-ui-sparkgauge-FONvy7z9.cjs +1 -0
- package/dist/vue-ui-sparkhistogram--uyRru2f.cjs +1 -0
- package/dist/{vue-ui-sparkhistogram-B8SukBWt.js → vue-ui-sparkhistogram-CIsN7kQ2.js} +116 -104
- package/dist/{vue-ui-sparkline-CokyAm9w.js → vue-ui-sparkline-CFvUW--O.js} +124 -112
- package/dist/vue-ui-sparkline-i6LHjMJR.cjs +1 -0
- package/dist/vue-ui-sparkstackbar-1RvV2xwt.cjs +1 -0
- package/dist/{vue-ui-sparkstackbar-QgZq1O55.js → vue-ui-sparkstackbar-DDMsCq0l.js} +85 -81
- package/dist/{vue-ui-stackbar-CTvPYXjb.js → vue-ui-stackbar-BSo9t-88.js} +219 -207
- package/dist/vue-ui-stackbar-CQgtC1I4.cjs +6 -0
- package/dist/vue-ui-strip-plot-BOSoKxsk.cjs +1 -0
- package/dist/{vue-ui-strip-plot-DXPoWvNA.js → vue-ui-strip-plot-C99LsMeZ.js} +113 -101
- package/dist/{vue-ui-table-Bb3BBVjm.js → vue-ui-table-3M-aoEc7.js} +1 -1
- package/dist/{vue-ui-table-8M1ctuqL.cjs → vue-ui-table-M-6G46br.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-Bv0EfTut.js → vue-ui-table-heatmap-BuYlqsq9.js} +82 -78
- package/dist/vue-ui-table-heatmap-CoozQ9bU.cjs +1 -0
- package/dist/{vue-ui-table-sparkline-Bs72Df0-.js → vue-ui-table-sparkline-Dm5kErGp.js} +78 -74
- package/dist/vue-ui-table-sparkline-u0a2YCwp.cjs +1 -0
- package/dist/vue-ui-thermometer-DAz_NjaN.cjs +1 -0
- package/dist/{vue-ui-thermometer-DRGjTOIy.js → vue-ui-thermometer-DrY5FsCD.js} +132 -120
- package/dist/vue-ui-timer-dCCTsApx.cjs +64 -0
- package/dist/{vue-ui-timer-DCA2Dkfi.js → vue-ui-timer-meFVXDUZ.js} +94 -82
- package/dist/vue-ui-tiremarks-CRKQklZh.cjs +1 -0
- package/dist/{vue-ui-tiremarks-CTqweMbJ.js → vue-ui-tiremarks-PaZ-lr2D.js} +104 -94
- package/dist/vue-ui-treemap-Bce1C9jk.cjs +1 -0
- package/dist/{vue-ui-treemap-tz9AdMu0.js → vue-ui-treemap-RjHcVtc6.js} +336 -332
- package/dist/{vue-ui-vertical-bar-BEkWSr_A.js → vue-ui-vertical-bar-C8rC-QBl.js} +188 -176
- package/dist/vue-ui-vertical-bar-e7zR_v0M.cjs +4 -0
- package/dist/{vue-ui-waffle-DQPO5aOU.js → vue-ui-waffle-BT8Yn0cl.js} +140 -136
- package/dist/vue-ui-waffle-BZLPoVht.cjs +1 -0
- package/dist/{vue-ui-wheel-B0u6LKiw.js → vue-ui-wheel-Bq75N1i7.js} +100 -88
- package/dist/vue-ui-wheel-CT6r7EQR.cjs +1 -0
- package/dist/{vue-ui-word-cloud-CEns9_NI.js → vue-ui-word-cloud-BGh6DY8P.js} +132 -120
- package/dist/vue-ui-word-cloud-PcOI8TCE.cjs +1 -0
- package/dist/vue-ui-xy-BmNqzUPR.cjs +3 -0
- package/dist/{vue-ui-xy-DxpIt6dh.js → vue-ui-xy-DuCsguVf.js} +139 -127
- package/dist/{vue-ui-xy-canvas-D_Qiy2N1.js → vue-ui-xy-canvas-6qf3rgfa.js} +231 -227
- package/dist/{vue-ui-xy-canvas--zS_4x6O.cjs → vue-ui-xy-canvas-BnJBE19B.cjs} +2 -2
- package/package.json +1 -1
- package/dist/index-DHwfzZfj.cjs +0 -9
- package/dist/vue-ui-3d-bar-Dif8_wHk.cjs +0 -19
- package/dist/vue-ui-age-pyramid-DHxsu2a1.cjs +0 -1
- package/dist/vue-ui-bullet-CKbrouCq.cjs +0 -34
- package/dist/vue-ui-candlestick-C3YNgFyO.cjs +0 -2
- package/dist/vue-ui-carousel-table-BU1bmZWZ.cjs +0 -1
- package/dist/vue-ui-chestnut-BEALHSS3.cjs +0 -6
- package/dist/vue-ui-donut-Jjz58SJJ.cjs +0 -1
- package/dist/vue-ui-donut-evolution-BtfRmlIq.cjs +0 -1
- package/dist/vue-ui-dumbbell-C2LYuBRx.cjs +0 -9
- package/dist/vue-ui-flow-3vjkptJR.cjs +0 -1
- package/dist/vue-ui-funnel-DyJdIi_i.cjs +0 -1
- package/dist/vue-ui-galaxy-BmGIzIeD.cjs +0 -1
- package/dist/vue-ui-gauge-LeMSJBEk.cjs +0 -1
- package/dist/vue-ui-gizmo-B7Kum6eT.cjs +0 -1
- package/dist/vue-ui-heatmap-CqPuEjJ1.cjs +0 -1
- package/dist/vue-ui-history-plot-bjMvk_4h.cjs +0 -1
- package/dist/vue-ui-kpi-DIuPP4R7.cjs +0 -1
- package/dist/vue-ui-molecule-C3wtpoCr.cjs +0 -1
- package/dist/vue-ui-mood-radar-BomqP0zI.cjs +0 -1
- package/dist/vue-ui-nested-donuts-KRq3Fcqy.cjs +0 -17
- package/dist/vue-ui-onion-G4p7rA61.cjs +0 -5
- package/dist/vue-ui-parallel-coordinate-plot-B2OIBraO.cjs +0 -8
- package/dist/vue-ui-quadrant-DoWeGQSC.cjs +0 -1
- package/dist/vue-ui-quick-chart-DR1qF9kr.cjs +0 -15
- package/dist/vue-ui-radar-B6M2ZChR.cjs +0 -1
- package/dist/vue-ui-rating-HSL7IrbQ.cjs +0 -1
- package/dist/vue-ui-relation-circle-CM_QkigI.cjs +0 -1
- package/dist/vue-ui-rings-CmD8g04s.cjs +0 -2
- package/dist/vue-ui-scatter-D_WxNGoY.cjs +0 -1
- package/dist/vue-ui-smiley-sKWpgakD.cjs +0 -2
- package/dist/vue-ui-spark-trend-ByxJmVE5.cjs +0 -1
- package/dist/vue-ui-sparkbar-DYHuBv3f.cjs +0 -1
- package/dist/vue-ui-sparkgauge-CCvUn2R2.cjs +0 -1
- package/dist/vue-ui-sparkhistogram-FU-uE07T.cjs +0 -1
- package/dist/vue-ui-sparkline-9LU8yp1t.cjs +0 -1
- package/dist/vue-ui-sparkstackbar-9k6C-g_r.cjs +0 -1
- package/dist/vue-ui-stackbar-Drqz1of9.cjs +0 -6
- package/dist/vue-ui-strip-plot-UYP2fk1H.cjs +0 -1
- package/dist/vue-ui-table-heatmap-BqQpJ_Ou.cjs +0 -1
- package/dist/vue-ui-table-sparkline-D5xemE-q.cjs +0 -1
- package/dist/vue-ui-thermometer-DzynFkq0.cjs +0 -1
- package/dist/vue-ui-timer-W5dIiOew.cjs +0 -64
- package/dist/vue-ui-tiremarks-BbAzwE5q.cjs +0 -1
- package/dist/vue-ui-treemap-CEVP7-S2.cjs +0 -1
- package/dist/vue-ui-vertical-bar-D_2WzLxJ.cjs +0 -4
- package/dist/vue-ui-waffle-BAvqVwhK.cjs +0 -1
- package/dist/vue-ui-wheel-Cjnheeql.cjs +0 -1
- package/dist/vue-ui-word-cloud-bxF8a7TI.cjs +0 -1
- package/dist/vue-ui-xy-BBvVOSPm.cjs +0 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { computed as v, ref as m, watch as U, onMounted as re, openBlock as o, createElementBlock as
|
|
2
|
-
import { u as
|
|
3
|
-
import { u as J } from "./useNestedProp-
|
|
4
|
-
import be from "./vue-ui-skeleton-
|
|
1
|
+
import { computed as v, ref as m, watch as U, onMounted as re, openBlock as o, createElementBlock as r, normalizeStyle as C, renderSlot as I, normalizeProps as ne, guardReactiveProps as ie, createElementVNode as f, toDisplayString as X, createCommentVNode as h, unref as c, createVNode as de, Fragment as A, renderList as D, createBlock as ve } from "vue";
|
|
2
|
+
import { u as he, c as ce, t as ye, _ as T, o as fe, e as Z, g as pe, w as M, $ as ge, a0 as me, X as ke, s as P, R as q, i as H, f as Y } from "./index-D7dTQAhm.js";
|
|
3
|
+
import { u as J } from "./useNestedProp-Dqsj7eUX.js";
|
|
4
|
+
import be from "./vue-ui-skeleton-BObG0eVD.js";
|
|
5
5
|
import { t as _e, u as xe } from "./useResponsive-CoxXLe23.js";
|
|
6
|
-
import { _ as we } from "./PackageVersion-
|
|
7
|
-
import { _ as
|
|
8
|
-
const
|
|
6
|
+
import { _ as we } from "./PackageVersion-BSLNI6kk.js";
|
|
7
|
+
import { _ as $e } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
|
+
const Le = ["id"], Ne = ["xmlns", "viewBox"], Ce = ["width", "height"], Ie = ["id"], Me = ["stop-color"], Pe = ["stop-color"], Ve = ["id"], ze = ["stop-color"], Se = ["stop-color"], We = ["id"], Ae = ["stop-color"], De = ["stop-color"], Te = { key: 1 }, Oe = ["d", "fill"], Be = ["d", "fill"], Ee = ["d", "stroke", "stroke-width"], Fe = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ge = ["x", "y", "width", "height", "fill", "rx"], Re = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], je = ["x1", "x2", "y1", "y2", "stroke", "stroke-dasharray", "stroke-width"], Ue = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Xe = ["x", "y", "font-size", "font-weight", "fill"], Ze = ["x", "y", "height", "width", "onMouseenter", "onClick"], qe = {
|
|
9
9
|
__name: "vue-ui-sparkline",
|
|
10
10
|
props: {
|
|
11
11
|
config: {
|
|
@@ -38,12 +38,12 @@ const $e = ["id"], Ne = ["xmlns", "viewBox"], Ce = ["id"], Ie = ["stop-color"],
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
emits: ["hoverIndex", "selectDatapoint"],
|
|
41
|
-
setup(_, { emit:
|
|
42
|
-
const i = _, { vue_ui_sparkline: K } =
|
|
43
|
-
get: () =>
|
|
41
|
+
setup(_, { emit: V }) {
|
|
42
|
+
const i = _, { vue_ui_sparkline: K } = he(), $ = v(() => !!i.dataset && i.dataset.length), p = m(ce()), z = m(null), O = m(null), B = m(null), e = v({
|
|
43
|
+
get: () => E(),
|
|
44
44
|
set: (t) => t
|
|
45
45
|
});
|
|
46
|
-
function
|
|
46
|
+
function E() {
|
|
47
47
|
const t = J({
|
|
48
48
|
userConfig: i.config,
|
|
49
49
|
defaultConfig: K
|
|
@@ -55,12 +55,12 @@ const $e = ["id"], Ne = ["xmlns", "viewBox"], Ce = ["id"], Ie = ["stop-color"],
|
|
|
55
55
|
})
|
|
56
56
|
} : t;
|
|
57
57
|
}
|
|
58
|
-
const
|
|
58
|
+
const L = v(() => T({
|
|
59
59
|
data: i.dataset,
|
|
60
60
|
threshold: e.value.downsample.threshold
|
|
61
61
|
}));
|
|
62
62
|
U(() => i.config, (t) => {
|
|
63
|
-
e.value =
|
|
63
|
+
e.value = E(), G(), l.value.chartWidth = e.value.style.chartWidth;
|
|
64
64
|
}, { deep: !0 }), U(() => i.dataset, (t) => {
|
|
65
65
|
b.value = T({
|
|
66
66
|
data: i.dataset.map((u) => ({
|
|
@@ -83,13 +83,13 @@ const $e = ["id"], Ne = ["xmlns", "viewBox"], Ce = ["id"], Ie = ["stop-color"],
|
|
|
83
83
|
threshold: e.value.downsample.threshold
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
const
|
|
86
|
+
const F = m(null);
|
|
87
87
|
re(() => {
|
|
88
|
-
if (
|
|
88
|
+
if (G(), e.value.style.animation.show && i.dataset.length > 1) {
|
|
89
89
|
let a = function() {
|
|
90
|
-
u <
|
|
90
|
+
u < L.value.length ? (b.value.push(L.value[u]), setTimeout(() => {
|
|
91
91
|
requestAnimationFrame(a);
|
|
92
|
-
}, t)) : b.value =
|
|
92
|
+
}, t)) : b.value = L.value, u += 1;
|
|
93
93
|
};
|
|
94
94
|
b.value = [];
|
|
95
95
|
const t = e.value.style.animation.animationFrames / i.dataset.length;
|
|
@@ -97,7 +97,7 @@ const $e = ["id"], Ne = ["xmlns", "viewBox"], Ce = ["id"], Ie = ["stop-color"],
|
|
|
97
97
|
a();
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
|
-
function
|
|
100
|
+
function G() {
|
|
101
101
|
if (fe(i.dataset) ? Z({
|
|
102
102
|
componentName: "VueUiSparkline",
|
|
103
103
|
type: "dataset"
|
|
@@ -116,13 +116,13 @@ const $e = ["id"], Ne = ["xmlns", "viewBox"], Ce = ["id"], Ie = ["stop-color"],
|
|
|
116
116
|
}), e.value.responsive) {
|
|
117
117
|
const t = _e(() => {
|
|
118
118
|
const { width: u, height: a } = xe({
|
|
119
|
-
chart:
|
|
120
|
-
title: e.value.style.title.show && i.showInfo ?
|
|
121
|
-
source:
|
|
119
|
+
chart: z.value,
|
|
120
|
+
title: e.value.style.title.show && i.showInfo ? O.value : null,
|
|
121
|
+
source: B.value
|
|
122
122
|
});
|
|
123
123
|
l.value.width = u, l.value.height = a, l.value.chartWidth = e.value.style.chartWidth / 500 * u, l.value.padding = i.forcedPadding / 500 * u;
|
|
124
124
|
});
|
|
125
|
-
|
|
125
|
+
F.value = new ResizeObserver(t), F.value.observe(z.value.parentNode);
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
const l = m({
|
|
@@ -138,47 +138,47 @@ const $e = ["id"], Ne = ["xmlns", "viewBox"], Ce = ["id"], Ie = ["stop-color"],
|
|
|
138
138
|
start: i.showInfo && e.value.style.dataLabel.show && e.value.style.dataLabel.position === "left" ? l.value.width - l.value.chartWidth : l.value.padding,
|
|
139
139
|
width: i.showInfo && e.value.style.dataLabel.show ? l.value.chartWidth : l.value.width - l.value.padding,
|
|
140
140
|
height: l.value.height - 12
|
|
141
|
-
})),
|
|
142
|
-
const t =
|
|
141
|
+
})), S = v(() => Math.min(...b.value.map((t) => isNaN(t.value) || [void 0, null, "NaN", NaN, 1 / 0, -1 / 0].includes(t.value) ? 0 : t.value || 0))), te = v(() => Math.max(...b.value.map((t) => isNaN(t.value) || [void 0, null, "NaN", NaN, 1 / 0, -1 / 0].includes(t.value) ? 0 : t.value || 0))), x = v(() => {
|
|
142
|
+
const t = S.value >= 0 ? 0 : S.value;
|
|
143
143
|
return Math.abs(t);
|
|
144
|
-
}), ae = v(() => te.value + x.value + ee.value), N = v(() => s.value.bottom - s.value.height *
|
|
145
|
-
function
|
|
144
|
+
}), ae = v(() => te.value + x.value + ee.value), N = v(() => s.value.bottom - s.value.height * W(x.value));
|
|
145
|
+
function W(t) {
|
|
146
146
|
return t / ae.value;
|
|
147
147
|
}
|
|
148
|
-
const g = v(() =>
|
|
148
|
+
const g = v(() => L.value.length - 1), n = v(() => b.value.map((t, u) => {
|
|
149
149
|
const a = isNaN(t.value) || [void 0, null, "NaN", NaN, 1 / 0, -1 / 0].includes(t.value) ? 0 : t.value || 0;
|
|
150
150
|
return {
|
|
151
151
|
absoluteValue: a,
|
|
152
152
|
period: t.period,
|
|
153
153
|
plotValue: a + x.value,
|
|
154
|
-
toMax:
|
|
154
|
+
toMax: W(a + x.value),
|
|
155
155
|
x: s.value.start + u * (s.value.width / (g.value + 1) > l.padding ? l.padding : s.value.width / (g.value + 1)),
|
|
156
|
-
y: s.value.bottom - s.value.height *
|
|
156
|
+
y: s.value.bottom - s.value.height * W(a + x.value),
|
|
157
157
|
id: `plot_${p.value}_${u}`,
|
|
158
|
-
color: w.value ? e.value.style.bar.color : e.value.style.area.useGradient ?
|
|
158
|
+
color: w.value ? e.value.style.bar.color : e.value.style.area.useGradient ? M(e.value.style.line.color, 0.05 * (1 - u / g.value)) : e.value.style.line.color,
|
|
159
159
|
width: s.value.width / (g.value + 1) > l.padding ? l.padding : s.value.width / (g.value + 1)
|
|
160
160
|
};
|
|
161
161
|
})), le = v(() => {
|
|
162
|
-
const t = { x:
|
|
163
|
-
return
|
|
162
|
+
const t = { x: n.value[0].x, y: l.value.height - 6 }, u = { x: n.value[n.value.length - 1].x, y: l.value.height - 6 }, a = [];
|
|
163
|
+
return n.value.forEach((d) => {
|
|
164
164
|
a.push(`${d.x},${d.y} `);
|
|
165
165
|
}), [t.x, t.y, ...a, u.x, u.y].toString();
|
|
166
|
-
}),
|
|
166
|
+
}), y = m(void 0);
|
|
167
167
|
function ue(t, u) {
|
|
168
|
-
|
|
168
|
+
y.value = t, V("hoverIndex", { index: u });
|
|
169
169
|
}
|
|
170
170
|
function se() {
|
|
171
|
-
|
|
171
|
+
y.value = void 0, V("hoverIndex", { index: void 0 });
|
|
172
172
|
}
|
|
173
173
|
const k = v(() => {
|
|
174
|
-
if (
|
|
175
|
-
const t =
|
|
174
|
+
if ($.value) {
|
|
175
|
+
const t = n.value.map((a) => a.absoluteValue), u = t.reduce((a, d) => a + d, 0);
|
|
176
176
|
return {
|
|
177
|
-
latest:
|
|
177
|
+
latest: n.value[n.value.length - 1].absoluteValue,
|
|
178
178
|
sum: u,
|
|
179
|
-
average: u /
|
|
179
|
+
average: u / n.value.length,
|
|
180
180
|
median: ge(t),
|
|
181
|
-
trend: me(
|
|
181
|
+
trend: me(n.value.map(({ x: a, y: d, absoluteValue: j }) => ({
|
|
182
182
|
x: a,
|
|
183
183
|
y: d,
|
|
184
184
|
value: j
|
|
@@ -192,43 +192,55 @@ const $e = ["id"], Ne = ["xmlns", "viewBox"], Ce = ["id"], Ie = ["stop-color"],
|
|
|
192
192
|
median: null,
|
|
193
193
|
trend: null
|
|
194
194
|
};
|
|
195
|
-
}),
|
|
195
|
+
}), R = v(() => $.value ? e.value.style.dataLabel.valueType === "latest" ? k.value.latest : e.value.style.dataLabel.valueType === "sum" ? k.value.sum : e.value.style.dataLabel.valueType === "average" ? k.value.average : 0 : 0), w = v(() => e.value.type && e.value.type === "bar");
|
|
196
196
|
function oe(t, u) {
|
|
197
|
-
|
|
197
|
+
V("selectDatapoint", { datapoint: t, index: u });
|
|
198
198
|
}
|
|
199
|
-
return (t, u) => (o(),
|
|
199
|
+
return (t, u) => (o(), r("div", {
|
|
200
200
|
ref_key: "sparklineChart",
|
|
201
|
-
ref:
|
|
201
|
+
ref: z,
|
|
202
202
|
class: "vue-ui-sparkline",
|
|
203
203
|
id: p.value,
|
|
204
204
|
style: C(`width:100%;font-family:${e.value.style.fontFamily};`)
|
|
205
205
|
}, [
|
|
206
|
-
|
|
207
|
-
selected:
|
|
206
|
+
I(t.$slots, "before", ne(ie({
|
|
207
|
+
selected: y.value,
|
|
208
208
|
latest: k.value.latest,
|
|
209
209
|
sum: k.value.sum,
|
|
210
210
|
average: k.value.average,
|
|
211
211
|
median: k.value.median,
|
|
212
212
|
trend: k.value.trend
|
|
213
213
|
})), void 0, !0),
|
|
214
|
-
e.value.style.title.show && _.showInfo ? (o(),
|
|
214
|
+
e.value.style.title.show && _.showInfo ? (o(), r("div", {
|
|
215
215
|
key: 0,
|
|
216
216
|
ref_key: "chartTitle",
|
|
217
|
-
ref:
|
|
217
|
+
ref: O,
|
|
218
218
|
class: "vue-ui-sparkline-title",
|
|
219
219
|
style: C(`display:flex;align-items:center;width:100%;color:${e.value.style.title.color};background:${e.value.style.backgroundColor};justify-content:${e.value.style.title.textAlign === "left" ? "flex-start" : e.value.style.title.textAlign === "right" ? "flex-end" : "center"};height:${e.value.style.title.fontSize * 2}px;font-size:${e.value.style.title.fontSize}px;font-weight:${e.value.style.title.bold ? "bold" : "normal"};`)
|
|
220
220
|
}, [
|
|
221
221
|
f("span", {
|
|
222
222
|
style: C(`padding:${e.value.style.title.textAlign === "left" ? "0 0 0 12px" : e.value.style.title.textAlign === "right" ? "0 12px 0 0" : "0"}`)
|
|
223
|
-
}, X(
|
|
224
|
-
], 4)) :
|
|
225
|
-
|
|
223
|
+
}, X(y.value ? y.value.period : e.value.style.title.text), 5)
|
|
224
|
+
], 4)) : h("", !0),
|
|
225
|
+
$.value ? (o(), r("svg", {
|
|
226
226
|
key: 1,
|
|
227
227
|
xmlns: c(ke),
|
|
228
228
|
viewBox: `0 0 ${l.value.width} ${l.value.height}`,
|
|
229
229
|
style: C(`background:${e.value.style.backgroundColor};overflow:visible`)
|
|
230
230
|
}, [
|
|
231
231
|
de(we),
|
|
232
|
+
t.$slots["chart-background"] ? (o(), r("foreignObject", {
|
|
233
|
+
key: 0,
|
|
234
|
+
x: 0,
|
|
235
|
+
y: 0,
|
|
236
|
+
width: l.value.width <= 0 ? 10 : l.value.width,
|
|
237
|
+
height: l.value.height <= 0 ? 10 : l.value.height,
|
|
238
|
+
style: {
|
|
239
|
+
pointerEvents: "none"
|
|
240
|
+
}
|
|
241
|
+
}, [
|
|
242
|
+
I(t.$slots, "chart-background", {}, void 0, !0)
|
|
243
|
+
], 8, Ce)) : h("", !0),
|
|
232
244
|
f("defs", null, [
|
|
233
245
|
f("linearGradient", {
|
|
234
246
|
x1: "0%",
|
|
@@ -239,13 +251,13 @@ const $e = ["id"], Ne = ["xmlns", "viewBox"], Ce = ["id"], Ie = ["stop-color"],
|
|
|
239
251
|
}, [
|
|
240
252
|
f("stop", {
|
|
241
253
|
offset: "0%",
|
|
242
|
-
"stop-color": c(
|
|
243
|
-
}, null, 8,
|
|
254
|
+
"stop-color": c(P)(c(M)(e.value.style.area.color, 0.05), e.value.style.area.opacity)
|
|
255
|
+
}, null, 8, Me),
|
|
244
256
|
f("stop", {
|
|
245
257
|
offset: "100%",
|
|
246
|
-
"stop-color": c(
|
|
247
|
-
}, null, 8,
|
|
248
|
-
], 8,
|
|
258
|
+
"stop-color": c(P)(e.value.style.area.color, e.value.style.area.opacity)
|
|
259
|
+
}, null, 8, Pe)
|
|
260
|
+
], 8, Ie),
|
|
249
261
|
f("linearGradient", {
|
|
250
262
|
x2: "0%",
|
|
251
263
|
y2: "100%",
|
|
@@ -254,12 +266,12 @@ const $e = ["id"], Ne = ["xmlns", "viewBox"], Ce = ["id"], Ie = ["stop-color"],
|
|
|
254
266
|
f("stop", {
|
|
255
267
|
offset: "0%",
|
|
256
268
|
"stop-color": e.value.style.bar.color
|
|
257
|
-
}, null, 8,
|
|
269
|
+
}, null, 8, ze),
|
|
258
270
|
f("stop", {
|
|
259
271
|
offset: "100%",
|
|
260
|
-
"stop-color": c(
|
|
261
|
-
}, null, 8,
|
|
262
|
-
], 8,
|
|
272
|
+
"stop-color": c(M)(e.value.style.bar.color, 0.05)
|
|
273
|
+
}, null, 8, Se)
|
|
274
|
+
], 8, Ve),
|
|
263
275
|
f("linearGradient", {
|
|
264
276
|
x2: "0%",
|
|
265
277
|
y2: "100%",
|
|
@@ -267,47 +279,47 @@ const $e = ["id"], Ne = ["xmlns", "viewBox"], Ce = ["id"], Ie = ["stop-color"],
|
|
|
267
279
|
}, [
|
|
268
280
|
f("stop", {
|
|
269
281
|
offset: "0%",
|
|
270
|
-
"stop-color": c(
|
|
271
|
-
}, null, 8,
|
|
282
|
+
"stop-color": c(M)(e.value.style.bar.color, 0.05)
|
|
283
|
+
}, null, 8, Ae),
|
|
272
284
|
f("stop", {
|
|
273
285
|
offset: "100%",
|
|
274
286
|
"stop-color": e.value.style.bar.color
|
|
275
|
-
}, null, 8,
|
|
276
|
-
], 8,
|
|
287
|
+
}, null, 8, De)
|
|
288
|
+
], 8, We)
|
|
277
289
|
]),
|
|
278
|
-
e.value.style.area.show && !w.value &&
|
|
279
|
-
e.value.style.line.smooth ? (o(),
|
|
290
|
+
e.value.style.area.show && !w.value && n.value[0] ? (o(), r("g", Te, [
|
|
291
|
+
e.value.style.line.smooth ? (o(), r("path", {
|
|
280
292
|
key: 0,
|
|
281
|
-
d: `M ${
|
|
282
|
-
fill: e.value.style.area.useGradient ? `url(#sparkline_gradient_${p.value})` : c(
|
|
283
|
-
}, null, 8,
|
|
293
|
+
d: `M ${n.value[0].x},${s.value.bottom} ${c(q)(n.value)} L ${n.value.at(-1).x},${s.value.bottom} Z`,
|
|
294
|
+
fill: e.value.style.area.useGradient ? `url(#sparkline_gradient_${p.value})` : c(P)(e.value.style.area.color, e.value.style.area.opacity)
|
|
295
|
+
}, null, 8, Oe)) : (o(), r("path", {
|
|
284
296
|
key: 1,
|
|
285
297
|
d: `M${le.value}Z`,
|
|
286
|
-
fill: e.value.style.area.useGradient ? `url(#sparkline_gradient_${p.value})` : c(
|
|
298
|
+
fill: e.value.style.area.useGradient ? `url(#sparkline_gradient_${p.value})` : c(P)(e.value.style.area.color, e.value.style.area.opacity)
|
|
287
299
|
}, null, 8, Be))
|
|
288
|
-
])) :
|
|
289
|
-
e.value.style.line.smooth && !w.value ? (o(),
|
|
290
|
-
key:
|
|
291
|
-
d: `M ${c(q)(
|
|
300
|
+
])) : h("", !0),
|
|
301
|
+
e.value.style.line.smooth && !w.value ? (o(), r("path", {
|
|
302
|
+
key: 2,
|
|
303
|
+
d: `M ${c(q)(n.value)}`,
|
|
292
304
|
stroke: e.value.style.line.color,
|
|
293
305
|
fill: "none",
|
|
294
306
|
"stroke-width": e.value.style.line.strokeWidth,
|
|
295
307
|
"stroke-linecap": "round"
|
|
296
|
-
}, null, 8,
|
|
297
|
-
(o(!0),
|
|
298
|
-
d <
|
|
308
|
+
}, null, 8, Ee)) : h("", !0),
|
|
309
|
+
(o(!0), r(A, null, D(n.value, (a, d) => (o(), r("g", null, [
|
|
310
|
+
d < n.value.length - 1 && !e.value.style.line.smooth && !w.value ? (o(), r("line", {
|
|
299
311
|
key: 0,
|
|
300
312
|
x1: a.x,
|
|
301
|
-
x2:
|
|
313
|
+
x2: n.value[d + 1].x,
|
|
302
314
|
y1: a.y,
|
|
303
|
-
y2:
|
|
315
|
+
y2: n.value[d + 1].y,
|
|
304
316
|
stroke: a.color,
|
|
305
317
|
"stroke-width": e.value.style.line.strokeWidth,
|
|
306
318
|
"stroke-linecap": "round",
|
|
307
319
|
"stroke-linejoin": "round",
|
|
308
320
|
"shape-rendering": "geometricPrecision"
|
|
309
|
-
}, null, 8,
|
|
310
|
-
w.value ? (o(),
|
|
321
|
+
}, null, 8, Fe)) : h("", !0),
|
|
322
|
+
w.value ? (o(), r("rect", {
|
|
311
323
|
key: 1,
|
|
312
324
|
x: a.x - a.width / 2,
|
|
313
325
|
y: a.absoluteValue > 0 ? a.y : N.value,
|
|
@@ -315,8 +327,8 @@ const $e = ["id"], Ne = ["xmlns", "viewBox"], Ce = ["id"], Ie = ["stop-color"],
|
|
|
315
327
|
height: Math.abs(a.y - N.value),
|
|
316
328
|
fill: a.absoluteValue > 0 ? `url(#sparkline_bar_gradient_pos_${p.value})` : `url(#sparkline_bar_gradient_neg_${p.value})`,
|
|
317
329
|
rx: e.value.style.bar.borderRadius
|
|
318
|
-
}, null, 8,
|
|
319
|
-
e.value.style.verticalIndicator.show && (
|
|
330
|
+
}, null, 8, Ge)) : h("", !0),
|
|
331
|
+
e.value.style.verticalIndicator.show && (y.value && a.id === y.value.id || _.selectedIndex === d) ? (o(), r("line", {
|
|
320
332
|
key: 2,
|
|
321
333
|
x1: a.x,
|
|
322
334
|
x2: a.x,
|
|
@@ -326,10 +338,10 @@ const $e = ["id"], Ne = ["xmlns", "viewBox"], Ce = ["id"], Ie = ["stop-color"],
|
|
|
326
338
|
"stroke-width": e.value.style.verticalIndicator.strokeWidth,
|
|
327
339
|
"stroke-linecap": "round",
|
|
328
340
|
"stroke-dasharray": e.value.style.verticalIndicator.strokeDasharray || 0
|
|
329
|
-
}, null, 8, Re)) :
|
|
341
|
+
}, null, 8, Re)) : h("", !0)
|
|
330
342
|
]))), 256)),
|
|
331
|
-
|
|
332
|
-
key:
|
|
343
|
+
S.value < 0 ? (o(), r("line", {
|
|
344
|
+
key: 3,
|
|
333
345
|
x1: s.value.start,
|
|
334
346
|
x2: s.value.start + s.value.width - 16,
|
|
335
347
|
y1: N.value,
|
|
@@ -338,9 +350,9 @@ const $e = ["id"], Ne = ["xmlns", "viewBox"], Ce = ["id"], Ie = ["stop-color"],
|
|
|
338
350
|
"stroke-dasharray": e.value.style.zeroLine.strokeWidth * 2,
|
|
339
351
|
"stroke-width": e.value.style.zeroLine.strokeWidth,
|
|
340
352
|
"stroke-linecap": "round"
|
|
341
|
-
}, null, 8,
|
|
342
|
-
e.value.style.plot.show ? (o(!0),
|
|
343
|
-
|
|
353
|
+
}, null, 8, je)) : h("", !0),
|
|
354
|
+
e.value.style.plot.show ? (o(!0), r(A, { key: 4 }, D(n.value, (a, d) => (o(), r("g", null, [
|
|
355
|
+
y.value && a.id === y.value.id || _.selectedIndex === d ? (o(), r("circle", {
|
|
344
356
|
key: 0,
|
|
345
357
|
cx: a.x,
|
|
346
358
|
cy: a.y,
|
|
@@ -348,26 +360,26 @@ const $e = ["id"], Ne = ["xmlns", "viewBox"], Ce = ["id"], Ie = ["stop-color"],
|
|
|
348
360
|
fill: a.color,
|
|
349
361
|
stroke: e.value.style.plot.stroke,
|
|
350
362
|
"stroke-width": e.value.style.plot.strokeWidth
|
|
351
|
-
}, null, 8,
|
|
352
|
-
]))), 256)) :
|
|
353
|
-
_.showInfo && e.value.style.dataLabel.show ? (o(),
|
|
354
|
-
key:
|
|
363
|
+
}, null, 8, Ue)) : h("", !0)
|
|
364
|
+
]))), 256)) : h("", !0),
|
|
365
|
+
_.showInfo && e.value.style.dataLabel.show ? (o(), r("text", {
|
|
366
|
+
key: 5,
|
|
355
367
|
x: e.value.style.dataLabel.position === "left" ? 12 + e.value.style.dataLabel.offsetX : s.value.width + 12 + e.value.style.dataLabel.offsetX,
|
|
356
368
|
y: l.value.height / 2 + e.value.style.dataLabel.fontSize / 2.5 + e.value.style.dataLabel.offsetY,
|
|
357
369
|
"font-size": e.value.style.dataLabel.fontSize,
|
|
358
370
|
"font-weight": e.value.style.dataLabel.bold ? "bold" : "normal",
|
|
359
371
|
fill: e.value.style.dataLabel.color
|
|
360
|
-
}, X(
|
|
372
|
+
}, X(y.value ? c(H)(
|
|
361
373
|
e.value.style.dataLabel.formatter,
|
|
362
|
-
|
|
363
|
-
c(Y)({ p: e.value.style.dataLabel.prefix, v:
|
|
364
|
-
{ datapoint:
|
|
374
|
+
y.value.absoluteValue,
|
|
375
|
+
c(Y)({ p: e.value.style.dataLabel.prefix, v: y.value.absoluteValue, s: e.value.style.dataLabel.suffix, r: e.value.style.dataLabel.roundingValue }),
|
|
376
|
+
{ datapoint: y.value }
|
|
365
377
|
) : c(H)(
|
|
366
378
|
e.value.style.dataLabel.formatter,
|
|
367
|
-
|
|
368
|
-
c(Y)({ p: e.value.style.dataLabel.prefix, v:
|
|
369
|
-
)), 9,
|
|
370
|
-
(o(!0),
|
|
379
|
+
R.value,
|
|
380
|
+
c(Y)({ p: e.value.style.dataLabel.prefix, v: R.value, s: e.value.style.dataLabel.suffix, r: e.value.style.dataLabel.roundingValue })
|
|
381
|
+
)), 9, Xe)) : h("", !0),
|
|
382
|
+
(o(!0), r(A, null, D(n.value, (a, d) => (o(), r("rect", {
|
|
371
383
|
x: a.x - (s.value.width / (g.value + 1) > l.value.padding ? l.value.padding : s.value.width / (g.value + 1)) / 2,
|
|
372
384
|
y: s.value.top - 6,
|
|
373
385
|
height: s.value.height + 6,
|
|
@@ -376,18 +388,18 @@ const $e = ["id"], Ne = ["xmlns", "viewBox"], Ce = ["id"], Ie = ["stop-color"],
|
|
|
376
388
|
onMouseenter: (j) => ue(a, d),
|
|
377
389
|
onMouseleave: se,
|
|
378
390
|
onClick: () => oe(a, d)
|
|
379
|
-
}, null, 40,
|
|
380
|
-
|
|
381
|
-
], 12, Ne)) :
|
|
382
|
-
t.$slots.source ? (o(),
|
|
391
|
+
}, null, 40, Ze))), 256)),
|
|
392
|
+
I(t.$slots, "svg", { svg: l.value }, void 0, !0)
|
|
393
|
+
], 12, Ne)) : h("", !0),
|
|
394
|
+
t.$slots.source ? (o(), r("div", {
|
|
383
395
|
key: 2,
|
|
384
396
|
ref_key: "source",
|
|
385
|
-
ref:
|
|
397
|
+
ref: B,
|
|
386
398
|
dir: "auto"
|
|
387
399
|
}, [
|
|
388
|
-
|
|
389
|
-
], 512)) :
|
|
390
|
-
|
|
400
|
+
I(t.$slots, "source", {}, void 0, !0)
|
|
401
|
+
], 512)) : h("", !0),
|
|
402
|
+
$.value ? h("", !0) : (o(), ve(be, {
|
|
391
403
|
key: 3,
|
|
392
404
|
config: {
|
|
393
405
|
type: "sparkline",
|
|
@@ -399,9 +411,9 @@ const $e = ["id"], Ne = ["xmlns", "viewBox"], Ce = ["id"], Ie = ["stop-color"],
|
|
|
399
411
|
}
|
|
400
412
|
}
|
|
401
413
|
}, null, 8, ["config"]))
|
|
402
|
-
], 12,
|
|
414
|
+
], 12, Le));
|
|
403
415
|
}
|
|
404
|
-
},
|
|
416
|
+
}, at = /* @__PURE__ */ $e(qe, [["__scopeId", "data-v-eb31fee7"]]);
|
|
405
417
|
export {
|
|
406
|
-
|
|
418
|
+
at as default
|
|
407
419
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-CgZGelSi.cjs"),P=require("./useNestedProp-BxCE3J3Z.cjs"),G=require("./vue-ui-skeleton-m4l9jfqA.cjs"),M=require("./useResponsive-BJ7DTGpm.cjs"),R=require("./PackageVersion-B_1OHk5A.cjs"),H=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),U=["id"],X=["xmlns","viewBox"],Z=["width","height"],Y=["id"],J=["stop-color"],K=["stop-color"],Q=["id"],ee=["stop-color"],te=["stop-color"],le=["id"],ae=["stop-color"],oe=["stop-color"],re={key:1},ne=["d","fill"],ue=["d","fill"],se=["d","stroke","stroke-width"],ie=["x1","x2","y1","y2","stroke","stroke-width"],de=["x","y","width","height","fill","rx"],ce=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ve=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],he=["cx","cy","r","fill","stroke","stroke-width"],ye=["x","y","font-size","font-weight","fill"],pe=["x","y","height","width","onMouseenter","onClick"],fe={__name:"vue-ui-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},showInfo:{type:Boolean,default:!0},selectedIndex:{type:Number,default:void 0},heightRatio:{type:Number,default:1},forcedPadding:{type:Number,default:30}},emits:["hoverIndex","selectDatapoint"],setup(f,{emit:x}){const i=f,{vue_ui_sparkline:z}=n.useConfig(),k=e.computed(()=>!!i.dataset&&i.dataset.length),v=e.ref(n.createUid()),w=e.ref(null),C=e.ref(null),L=e.ref(null),t=e.computed({get:()=>V(),set:l=>l});function V(){const l=P.useNestedProp({userConfig:i.config,defaultConfig:z});return l.theme?{...P.useNestedProp({userConfig:n.themes.vue_ui_sparkline[l.theme]||i.config,defaultConfig:l})}:l}const b=e.computed(()=>n.largestTriangleThreeBucketsArrayObjects({data:i.dataset,threshold:t.value.downsample.threshold}));e.watch(()=>i.config,l=>{t.value=V(),$(),o.value.chartWidth=t.value.style.chartWidth},{deep:!0}),e.watch(()=>i.dataset,l=>{p.value=n.largestTriangleThreeBucketsArrayObjects({data:i.dataset.map(r=>({...r,value:[void 0].includes(r.value)?null:r.value})),threshold:t.value.downsample.threshold})},{deep:!0});const p=e.ref(A());function A(){return n.largestTriangleThreeBucketsArrayObjects({data:i.dataset.map(l=>t.value.style.animation.show?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value}),threshold:t.value.downsample.threshold})}const E=e.ref(null);e.onMounted(()=>{if($(),t.value.style.animation.show&&i.dataset.length>1){let a=function(){r<b.value.length?(p.value.push(b.value[r]),setTimeout(()=>{requestAnimationFrame(a)},l)):p.value=b.value,r+=1};p.value=[];const l=t.value.style.animation.animationFrames/i.dataset.length;let r=0;a()}});function $(){if(n.objectIsEmpty(i.dataset)?n.error({componentName:"VueUiSparkline",type:"dataset"}):i.dataset.forEach((l,r)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{n.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:r})})}),t.value.responsive){const l=M.throttle(()=>{const{width:r,height:a}=M.useResponsive({chart:w.value,title:t.value.style.title.show&&i.showInfo?C.value:null,source:L.value});o.value.width=r,o.value.height=a,o.value.chartWidth=t.value.style.chartWidth/500*r,o.value.padding=i.forcedPadding/500*r});E.value=new ResizeObserver(l),E.value.observe(w.value.parentNode)}}const o=e.ref({height:80*i.heightRatio,width:500,chartWidth:t.value.style.chartWidth,padding:i.forcedPadding}),O=e.ref(6),u=e.computed(()=>({top:12,left:0,right:o.value.width,bottom:o.value.height-3,start:i.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?o.value.width-o.value.chartWidth:o.value.padding,width:i.showInfo&&t.value.style.dataLabel.show?o.value.chartWidth:o.value.width-o.value.padding,height:o.value.height-12})),N=e.computed(()=>Math.min(...p.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),T=e.computed(()=>Math.max(...p.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),m=e.computed(()=>{const l=N.value>=0?0:N.value;return Math.abs(l)}),D=e.computed(()=>T.value+m.value+O.value),_=e.computed(()=>u.value.bottom-u.value.height*B(m.value));function B(l){return l/D.value}const h=e.computed(()=>b.value.length-1),s=e.computed(()=>p.value.map((l,r)=>{const a=isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0;return{absoluteValue:a,period:l.period,plotValue:a+m.value,toMax:B(a+m.value),x:u.value.start+r*(u.value.width/(h.value+1)>o.padding?o.padding:u.value.width/(h.value+1)),y:u.value.bottom-u.value.height*B(a+m.value),id:`plot_${v.value}_${r}`,color:g.value?t.value.style.bar.color:t.value.style.area.useGradient?n.shiftHue(t.value.style.line.color,.05*(1-r/h.value)):t.value.style.line.color,width:u.value.width/(h.value+1)>o.padding?o.padding:u.value.width/(h.value+1)}})),W=e.computed(()=>{const l={x:s.value[0].x,y:o.value.height-6},r={x:s.value[s.value.length-1].x,y:o.value.height-6},a=[];return s.value.forEach(d=>{a.push(`${d.x},${d.y} `)}),[l.x,l.y,...a,r.x,r.y].toString()}),c=e.ref(void 0);function j(l,r){c.value=l,x("hoverIndex",{index:r})}function F(){c.value=void 0,x("hoverIndex",{index:void 0})}const y=e.computed(()=>{if(k.value){const l=s.value.map(a=>a.absoluteValue),r=l.reduce((a,d)=>a+d,0);return{latest:s.value[s.value.length-1].absoluteValue,sum:r,average:r/s.value.length,median:n.calcMedian(l),trend:n.calcLinearProgression(s.value.map(({x:a,y:d,absoluteValue:S})=>({x:a,y:d,value:S}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),I=e.computed(()=>k.value?t.value.style.dataLabel.valueType==="latest"?y.value.latest:t.value.style.dataLabel.valueType==="sum"?y.value.sum:t.value.style.dataLabel.valueType==="average"?y.value.average:0:0),g=e.computed(()=>t.value.type&&t.value.type==="bar");function q(l,r){x("selectDatapoint",{datapoint:l,index:r})}return(l,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparklineChart",ref:w,class:"vue-ui-sparkline",id:v.value,style:e.normalizeStyle(`width:100%;font-family:${t.value.style.fontFamily};`)},[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps({selected:c.value,latest:y.value.latest,sum:y.value.sum,average:y.value.average,median:y.value.median,trend:y.value.trend})),void 0,!0),t.value.style.title.show&&f.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:C,class:"vue-ui-sparkline-title",style:e.normalizeStyle(`display:flex;align-items:center;width:100%;color:${t.value.style.title.color};background:${t.value.style.backgroundColor};justify-content:${t.value.style.title.textAlign==="left"?"flex-start":t.value.style.title.textAlign==="right"?"flex-end":"center"};height:${t.value.style.title.fontSize*2}px;font-size:${t.value.style.title.fontSize}px;font-weight:${t.value.style.title.bold?"bold":"normal"};`)},[e.createElementVNode("span",{style:e.normalizeStyle(`padding:${t.value.style.title.textAlign==="left"?"0 0 0 12px":t.value.style.title.textAlign==="right"?"0 12px 0 0":"0"}`)},e.toDisplayString(c.value?c.value.period:t.value.style.title.text),5)],4)):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(n.XMLNS),viewBox:`0 0 ${o.value.width} ${o.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`)},[e.createVNode(R._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:o.value.width<=0?10:o.value.width,height:o.value.height<=0?10:o.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,Z)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkline_gradient_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(t.value.style.area.color,.05),t.value.style.area.opacity)},null,8,J),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,K)],8,Y),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_pos_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.bar.color},null,8,ee),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.shiftHue)(t.value.style.bar.color,.05)},null,8,te)],8,Q),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_neg_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.shiftHue)(t.value.style.bar.color,.05)},null,8,ae),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,oe)],8,le)]),t.value.style.area.show&&!g.value&&s.value[0]?(e.openBlock(),e.createElementBlock("g",re,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${s.value[0].x},${u.value.bottom} ${e.unref(n.createSmoothPath)(s.value)} L ${s.value.at(-1).x},${u.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(n.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,ne)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${W.value}Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(n.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,ue))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&!g.value?(e.openBlock(),e.createElementBlock("path",{key:2,d:`M ${e.unref(n.createSmoothPath)(s.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,se)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("g",null,[d<s.value.length-1&&!t.value.style.line.smooth&&!g.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.x,x2:s.value[d+1].x,y1:a.y,y2:s.value[d+1].y,stroke:a.color,"stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"geometricPrecision"},null,8,ie)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("rect",{key:1,x:a.x-a.width/2,y:a.absoluteValue>0?a.y:_.value,width:a.width,height:Math.abs(a.y-_.value),fill:a.absoluteValue>0?`url(#sparkline_bar_gradient_pos_${v.value})`:`url(#sparkline_bar_gradient_neg_${v.value})`,rx:t.value.style.bar.borderRadius},null,8,de)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(c.value&&a.id===c.value.id||f.selectedIndex===d)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.x,x2:a.x,y1:u.value.top-6,y2:u.value.bottom,stroke:t.value.style.verticalIndicator.color||a.color,"stroke-width":t.value.style.verticalIndicator.strokeWidth,"stroke-linecap":"round","stroke-dasharray":t.value.style.verticalIndicator.strokeDasharray||0},null,8,ce)):e.createCommentVNode("",!0)]))),256)),N.value<0?(e.openBlock(),e.createElementBlock("line",{key:3,x1:u.value.start,x2:u.value.start+u.value.width-16,y1:_.value,y2:_.value,stroke:t.value.style.zeroLine.color,"stroke-dasharray":t.value.style.zeroLine.strokeWidth*2,"stroke-width":t.value.style.zeroLine.strokeWidth,"stroke-linecap":"round"},null,8,ve)):e.createCommentVNode("",!0),t.value.style.plot.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:4},e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("g",null,[c.value&&a.id===c.value.id||f.selectedIndex===d?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:a.x,cy:a.y,r:t.value.style.plot.radius,fill:a.color,stroke:t.value.style.plot.stroke,"stroke-width":t.value.style.plot.strokeWidth},null,8,he)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),f.showInfo&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:5,x:t.value.style.dataLabel.position==="left"?12+t.value.style.dataLabel.offsetX:u.value.width+12+t.value.style.dataLabel.offsetX,y:o.value.height/2+t.value.style.dataLabel.fontSize/2.5+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,"font-weight":t.value.style.dataLabel.bold?"bold":"normal",fill:t.value.style.dataLabel.color},e.toDisplayString(c.value?e.unref(n.applyDataLabel)(t.value.style.dataLabel.formatter,c.value.absoluteValue,e.unref(n.dataLabel)({p:t.value.style.dataLabel.prefix,v:c.value.absoluteValue,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}),{datapoint:c.value}):e.unref(n.applyDataLabel)(t.value.style.dataLabel.formatter,I.value,e.unref(n.dataLabel)({p:t.value.style.dataLabel.prefix,v:I.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}))),9,ye)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(u.value.width/(h.value+1)>o.value.padding?o.value.padding:u.value.width/(h.value+1))/2,y:u.value.top-6,height:u.value.height+6,width:u.value.width/(h.value+1)>o.value.padding?o.value.padding:u.value.width/(h.value+1),fill:"transparent",onMouseenter:S=>j(a,d),onMouseleave:F,onClick:()=>q(a,d)},null,40,pe))),256)),e.renderSlot(l.$slots,"svg",{svg:o.value},void 0,!0)],12,X)):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"source",ref:L,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(G.default,{key:3,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,U))}},me=H._export_sfc(fe,[["__scopeId","data-v-eb31fee7"]]);exports.default=me;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-CgZGelSi.cjs"),V=require("./useNestedProp-BxCE3J3Z.cjs"),q=require("./vue-ui-skeleton-m4l9jfqA.cjs"),O=require("./PackageVersion-B_1OHk5A.cjs"),U=require("./Tooltip-AHTiRuWB.cjs"),M=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),j=["xmlns","viewBox"],H=["id"],I=["stop-color"],R=["stop-color"],W=["stop-color"],Y={id:"stackPill",clipPathUnits:"objectBoundingBox"},G=["fill"],X={key:0,"clip-path":"url(#stackPill)"},J=["x","width","height","fill"],K=["x","width","height","fill","stroke"],Q=["onClick","x","width","height","onMouseenter"],Z=["width","height","rx"],ee=["onClick"],te={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},le=["height","width"],oe=["fill"],ae={key:4,ref:"source",dir:"auto"},re={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(P,{emit:D}){const u=P,{vue_ui_sparkstackbar:L}=a.useConfig(),F=e.useSlots();e.onMounted(()=>{F["chart-background"]&&console.warn("VueUiSparkStackbar does not support the #chart-background slot.")});const x=e.computed(()=>!!u.dataset&&u.dataset.length),B=e.ref(null),S=e.ref(a.createUid()),b=e.ref(!1),_=e.ref(""),t=e.computed({get:()=>$(),set:l=>l});function $(){const l=V.useNestedProp({userConfig:u.config,defaultConfig:L});return l.theme?{...V.useNestedProp({userConfig:a.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:a.themePalettes[l.theme]||a.palette}:l}e.watch(()=>u.config,l=>{t.value=$(),E()},{deep:!0}),e.watch(()=>u.dataset,l=>{v.value=u.dataset.map((n,o)=>({...n,color:n.color?a.convertColorToHex(n.color):f.value[o]||a.palette[o]||a.palette[o%a.palette.length]}))},{deep:!0});const f=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),v=e.ref(u.dataset.map((l,n)=>({...l,value:t.value.style.animation.show?0:l.value||0,color:l.color?a.convertColorToHex(l.color):f.value[n]||a.palette[n]||a.palette[n%a.palette.length]}))),g=e.ref(!0);e.onMounted(()=>{if(E(),t.value.style.animation.show){let p=function(){r+=o/l,r<o?(v.value=v.value.map((s,i)=>({...s,value:s.value+=n[i],color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length]})),requestAnimationFrame(p)):(g.value=!1,v.value=u.dataset.map((s,i)=>({...s,value:s.value||0,color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length],id:a.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,i)=>s.value/l),o=u.dataset.map(s=>s.value||0).reduce((s,i)=>s+i,0);let r=0;g.value=!0,p()}});function E(){a.objectIsEmpty(u.dataset)?a.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{a.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(o=>{a.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:o,index:n})})})}const c=e.ref({width:500,height:16}),d=e.ref([]),N=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!d.value.includes(n)).reduce((l,n)=>l+n,0)),y=e.computed(()=>v.value.map((l,n)=>{const o=l.value||0,r=o/N.value,p=isNaN(r)?0:r,s=p*c.value.width;return{...l,value:o,proportion:p,width:s,proportionLabel:a.dataLabel({v:p*100,s:"%",r:t.value.style.legend.percentage.rounding})}})),C=e.computed(()=>y.value.filter((l,n)=>!d.value.includes(n)));function T(l){d.value.includes(l)?d.value=d.value.filter(n=>n!==l):d.value.length<v.value.length-1&&d.value.push(l)}const h=e.computed(()=>{let l=0;const n=[];for(let o=0;o<C.value.length;o+=1)n.push({...C.value[o],start:l}),l+=C.value[o].width;return n});function z(l,n){D("selectDatapoint",{datapoint:l,index:n})}const w=e.ref(null),k=e.ref(!1),m=e.ref(null);function A({datapoint:l,seriesIndex:n}){if(!t.value.style.tooltip.show)return;w.value={datapoint:l,seriesIndex:n,config:t.value,series:y.value},b.value=!0,m.value=n;const o=t.value.style.tooltip.customFormat;if(a.isFunction(o))try{const r=o({seriesIndex:n,datapoint:l,series:y.value,config:t.value});typeof r=="string"&&(_.value=r,k.value=!0)}catch{console.warn("Custom format cannot be applied."),k.value=!1}if(!k.value){let r="";r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,r+=`<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="${l.color}"/></svg>`,r+=`<b>${l.proportionLabel}</b>`,r+=`<span>(${a.applyDataLabel(t.value.style.legend.value.formatter,l.value,a.dataLabel({p:t.value.style.legend.value.prefix,v:l.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:l,seriesIndex:n})})</span>`,_.value=`<div>${r}</div>`}}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparkstackbarChart",ref:B,style:e.normalizeStyle(`width:100%; background:${t.value.style.backgroundColor}`)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),width:"100%",viewBox:`0 0 ${c.value.width} ${c.value.height}`},[e.createVNode(O._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${S.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,I),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(o.color,.05),100-t.value.style.bar.gradient.intensity)},null,8,R),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,W)],8,H))),128)),e.createElementVNode("clipPath",Y,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,G)])]),N.value>0?(e.openBlock(),e.createElementBlock("g",X,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_underlayer_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,J))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${S.value})`:o.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,K))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_trap_${r}`,onClick:()=>z(o,r),x:o.start,y:0,width:o.width,height:c.value.height,fill:"transparent",stroke:"none",class:e.normalizeClass({animated:!g.value}),onMouseenter:()=>A({datapoint:o,seriesIndex:r}),onMouseleave:n[0]||(n[0]=p=>{b.value=!1,m.value=null})},null,42,Q))),128))])):(e.openBlock(),e.createElementBlock("rect",{key:1,x:2,y:1,width:c.value.width-4,height:c.value.height-2,stroke:"#CCCCCC","stroke-width":"2",fill:"transparent",rx:(c.value.height-4)/2},null,8,Z))],8,j)):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(q.default,{key:2,config:{type:"sparkStackbar",style:{backgroundColor:t.value.style.backgroundColor,sparkStackbar:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.legend.show?(e.openBlock(),e.createElementBlock("div",{key:3,style:e.normalizeStyle(`background:transparent;margin:0 auto;margin:${t.value.style.legend.margin};justify-content:${t.value.style.legend.textAlign==="left"?"flex-start":t.value.style.legend.textAlign==="right"?"flex-end":"center"}`),class:"vue-ui-sparkstackbar-legend"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(o,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`font-size:${t.value.style.legend.fontSize}px;`),class:e.normalizeClass({"vue-ui-sparkstackbar-legend-item":!0,"vue-ui-sparkstackbar-legend-item-unselected":d.value.includes(r)}),onClick:p=>{T(r),z(o,r)}},[e.createElementVNode("div",te,[(e.openBlock(),e.createElementBlock("svg",{height:`${t.value.style.legend.fontSize}px`,width:`${t.value.style.legend.fontSize}px`,viewBox:"0 0 10 10"},[e.createElementVNode("circle",{cx:5,cy:5,r:5,fill:o.color},null,8,oe)],8,le)),e.createElementVNode("span",{style:e.normalizeStyle(`color:${t.value.style.legend.name.color}; font-weight:${t.value.style.legend.name.bold?"bold":"normal"}`)},e.toDisplayString(o.name),5),t.value.style.legend.percentage.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.legend.percentage.bold?"bold":"normal"};color:${t.value.style.legend.percentage.color}`)},e.toDisplayString(d.value.includes(r)?" - ":o.proportionLabel),5)):e.createCommentVNode("",!0),t.value.style.legend.value.show?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(`font-weight:${t.value.style.legend.value.bold?"bold":"normal"};color:${t.value.style.legend.value.color}`)}," ("+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.legend.value.formatter,o.value,e.unref(a.dataLabel)({p:t.value.style.legend.value.prefix,v:o.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:o,seriesIndex:r}))+") ",5)):e.createCommentVNode("",!0)])],14,ee))),256))],4)):e.createCommentVNode("",!0),e.createVNode(U._sfc_main,{show:b.value&&t.value.style.tooltip.show,parent:B.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,fontSize:t.value.style.tooltip.fontSize,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,content:_.value,isCustom:k.value,offsetY:-124+t.value.style.tooltip.offsetY,blockShiftY:!0},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),_:3},8,["show","parent","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","content","isCustom","offsetY"]),l.$slots.source?(e.openBlock(),e.createElementBlock("div",ae,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],4))}},ne=M._export_sfc(re,[["__scopeId","data-v-72244c73"]]);exports.default=ne;
|