vue-data-ui 2.4.47 → 2.4.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Arrow-C3u-U00V.cjs → Arrow-CTukks_V.cjs} +1 -1
- package/dist/{Arrow-C-PQX3ZC.js → Arrow-Q0cOmO5p.js} +1 -1
- package/dist/{BaseIcon-8y_okNW6.cjs → BaseIcon-2ZD3jgGz.cjs} +1 -1
- package/dist/{BaseIcon-BeAMtwQX.js → BaseIcon-CaYP30Aq.js} +1 -1
- package/dist/{DataTable-D7JlgAbC.js → DataTable-CO5C8Cmb.js} +2 -2
- package/dist/{DataTable-CfxOc-In.cjs → DataTable-kMUhutQ4.cjs} +1 -1
- package/dist/{Legend-DDuxh17p.cjs → Legend-DPHcmrzd.cjs} +1 -1
- package/dist/{Legend-CEhIHRJc.js → Legend-FZN9UHoI.js} +1 -1
- package/dist/{PackageVersion-8Ql1gdmo.js → PackageVersion-DYk2hOG1.js} +1 -1
- package/dist/{PackageVersion-Df1iPzMk.cjs → PackageVersion-rnWHRWGI.cjs} +1 -1
- package/dist/{PenAndPaper-CvGft3ku.cjs → PenAndPaper-BQl9-uX0.cjs} +1 -1
- package/dist/{PenAndPaper-b1ZmLra1.js → PenAndPaper-BfgS_5ux.js} +3 -3
- package/dist/{Shape-D3F3Ki5y.cjs → Shape-BblkpCyL.cjs} +1 -1
- package/dist/{Shape-CvBLjLSE.js → Shape-BqkMzXqo.js} +1 -1
- package/dist/{Slicer-CRXNOGCh.js → Slicer-DlgqsI5C.js} +2 -2
- package/dist/{Slicer-CHKuuOOo.cjs → Slicer-yEeqKUDF.cjs} +1 -1
- package/dist/{Title-URF9hufV.cjs → Title-5Vedk01J.cjs} +1 -1
- package/dist/{Title-_dfoh5WC.js → Title-DED-PQ7X.js} +1 -1
- package/dist/{Tooltip-CAkj2Rmy.js → Tooltip-CHseiJu8.js} +1 -1
- package/dist/{Tooltip-87gbw8Ir.cjs → Tooltip-DjCKBAC4.cjs} +1 -1
- package/dist/index-BHQZE19X.cjs +9 -0
- package/dist/{index-BUHajhqq.js → index-igxqCP2w.js} +7 -1
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +6 -0
- package/dist/types/vue-data-ui.d.ts +6 -0
- package/dist/{useNestedProp-a0uhe7rJ.js → useNestedProp-CSVnZVwZ.js} +1 -1
- package/dist/{useNestedProp-C-g0SLHN.cjs → useNestedProp-CwpqC_aE.cjs} +1 -1
- package/dist/{usePrinter-DLHRtlhI.js → usePrinter-CnZYDQXB.js} +1 -1
- package/dist/{usePrinter-4Zj_RZ5v.cjs → usePrinter-DVgxBO4o.cjs} +1 -1
- package/dist/{vue-data-ui-zjfs-rk-.js → vue-data-ui-B--WWkUM.js} +60 -60
- package/dist/{vue-data-ui-CPc7dZQe.cjs → vue-data-ui-BrRTkOqu.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-zI1BF0gA.cjs → vue-ui-3d-bar-BGVLnjCh.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-B60j7yco.js → vue-ui-3d-bar-OzzLYbUl.js} +9 -9
- package/dist/{vue-ui-accordion-C0oMKEv0.cjs → vue-ui-accordion-CRVWlHxs.cjs} +1 -1
- package/dist/{vue-ui-accordion-2QOotHrr.js → vue-ui-accordion-lF7yVkiT.js} +3 -3
- package/dist/{vue-ui-age-pyramid-BT7HUZpj.js → vue-ui-age-pyramid-5Vj8AtW1.js} +10 -10
- package/dist/{vue-ui-age-pyramid-hZLKWqN9.cjs → vue-ui-age-pyramid-Cv0Rddsx.cjs} +1 -1
- package/dist/{vue-ui-annotator-ZpGqgGMp.js → vue-ui-annotator-BmO78L3H.js} +1 -1
- package/dist/{vue-ui-annotator-Da8-IgfK.cjs → vue-ui-annotator-D8Hx1BFF.cjs} +1 -1
- package/dist/{vue-ui-bullet-BfkujrD0.cjs → vue-ui-bullet-C0Q2Vs5p.cjs} +1 -1
- package/dist/{vue-ui-bullet-Da56_P30.js → vue-ui-bullet-DwFD41hN.js} +8 -8
- package/dist/{vue-ui-candlestick-CblCXKhS.js → vue-ui-candlestick-By609gwn.js} +11 -11
- package/dist/{vue-ui-candlestick-fM3nUsgr.cjs → vue-ui-candlestick-C7kRHFF3.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-D3rcSdcC.cjs → vue-ui-carousel-table-1_Hy8sGL.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-B1U41lku.js → vue-ui-carousel-table-wwMoteEN.js} +4 -4
- package/dist/{vue-ui-chestnut-CtMm9Hev.cjs → vue-ui-chestnut-D3LGylRp.cjs} +1 -1
- package/dist/{vue-ui-chestnut-Cnvf2Aav.js → vue-ui-chestnut-hqorA5EW.js} +8 -8
- package/dist/{vue-ui-cursor-C-7zi0ol.cjs → vue-ui-cursor-BCg5VZUb.cjs} +1 -1
- package/dist/{vue-ui-cursor-TzS0sCy1.js → vue-ui-cursor-GSkn7N7Z.js} +2 -2
- package/dist/{vue-ui-dashboard-DdMkGnE7.cjs → vue-ui-dashboard-Bkm9bcAc.cjs} +1 -1
- package/dist/{vue-ui-dashboard-Ajvddjlt.js → vue-ui-dashboard-DIoYWyXB.js} +2 -2
- package/dist/{vue-ui-digits-DwB-tHKl.cjs → vue-ui-digits-CpBBTAI9.cjs} +1 -1
- package/dist/{vue-ui-digits-CBPttkF2.js → vue-ui-digits-niqTltAv.js} +2 -2
- package/dist/{vue-ui-donut-Cz6xpVSC.cjs → vue-ui-donut-CQEOtlxM.cjs} +1 -1
- package/dist/{vue-ui-donut-DidXxdXO.js → vue-ui-donut-DfufBrkk.js} +11 -11
- package/dist/{vue-ui-donut-evolution-Dj73srrD.cjs → vue-ui-donut-evolution-Dg_XJyX8.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-B0xdulgT.js → vue-ui-donut-evolution-XQp6R0e_.js} +11 -11
- package/dist/{vue-ui-dumbbell-Cimude8K.js → vue-ui-dumbbell-DSS8sHHU.js} +10 -10
- package/dist/{vue-ui-dumbbell-BdwXaRk2.cjs → vue-ui-dumbbell-RAkNYRoJ.cjs} +1 -1
- package/dist/{vue-ui-flow-D2ekJwov.js → vue-ui-flow-BBNuPVgI.js} +9 -9
- package/dist/{vue-ui-flow-DMNNOEJy.cjs → vue-ui-flow-BUmSGSmR.cjs} +1 -1
- package/dist/{vue-ui-funnel-DLmzVrrA.cjs → vue-ui-funnel-B9HR0owO.cjs} +1 -1
- package/dist/{vue-ui-funnel-BsKFz_A9.js → vue-ui-funnel-BDGggRXE.js} +8 -8
- package/dist/{vue-ui-galaxy-WAy90dGq.js → vue-ui-galaxy-6Odi2CwM.js} +11 -11
- package/dist/{vue-ui-galaxy-CnZYKQA2.cjs → vue-ui-galaxy-DmsMWB1a.cjs} +1 -1
- package/dist/{vue-ui-gauge-Xvk_SGCc.js → vue-ui-gauge-DeYvNVnR.js} +7 -7
- package/dist/{vue-ui-gauge-DhqOgkfq.cjs → vue-ui-gauge-Dvv0v56Z.cjs} +1 -1
- package/dist/{vue-ui-gizmo-D-djUfJw.js → vue-ui-gizmo-BcAr2dTN.js} +3 -3
- package/dist/{vue-ui-gizmo-B6qoNeBK.cjs → vue-ui-gizmo-DXQt_8D0.cjs} +1 -1
- package/dist/{vue-ui-heatmap-jmKDOYnr.js → vue-ui-heatmap-Btm1mK6D.js} +10 -10
- package/dist/{vue-ui-heatmap-CitZU9av.cjs → vue-ui-heatmap-DZ02dS5q.cjs} +1 -1
- package/dist/{vue-ui-history-plot-EzFdtBwU.cjs → vue-ui-history-plot-DPQWcN0P.cjs} +1 -1
- package/dist/{vue-ui-history-plot-BoR791Gc.js → vue-ui-history-plot-OY6N31Ka.js} +11 -11
- package/dist/{vue-ui-kpi-CMXhw4Ll.cjs → vue-ui-kpi-CQIbWQMk.cjs} +1 -1
- package/dist/{vue-ui-kpi-CB47PO72.js → vue-ui-kpi-D5oNUDVm.js} +3 -3
- package/dist/{vue-ui-mini-loader-D4dKItUb.js → vue-ui-mini-loader-BjqV22Co.js} +2 -2
- package/dist/{vue-ui-mini-loader-DJx2b1Hs.cjs → vue-ui-mini-loader-ByDKGMAp.cjs} +1 -1
- package/dist/{vue-ui-molecule-CnERhdxF.cjs → vue-ui-molecule-C8O_ViVy.cjs} +1 -1
- package/dist/{vue-ui-molecule-C_VM1ZP2.js → vue-ui-molecule-FsLf3YTj.js} +11 -11
- package/dist/{vue-ui-mood-radar-BESMMSxA.js → vue-ui-mood-radar-31BX-GNG.js} +11 -11
- package/dist/{vue-ui-mood-radar-BBlokNSE.cjs → vue-ui-mood-radar-4u98wGWl.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-r1v-A7E3.js → vue-ui-nested-donuts-BMJW2oHk.js} +11 -11
- package/dist/{vue-ui-nested-donuts-C0IAo5oO.cjs → vue-ui-nested-donuts-BPc_OBoe.cjs} +1 -1
- package/dist/{vue-ui-onion-CZuFxIOX.js → vue-ui-onion-BUpGgnWA.js} +11 -11
- package/dist/{vue-ui-onion-PaHP7qHI.cjs → vue-ui-onion-IhkIHn1A.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-BeAArg3p.js → vue-ui-parallel-coordinate-plot-9I00rQEM.js} +12 -12
- package/dist/{vue-ui-parallel-coordinate-plot-Bwu4Q1dB.cjs → vue-ui-parallel-coordinate-plot-DzjggyLA.cjs} +1 -1
- package/dist/{vue-ui-quadrant-D5m9y_Vd.js → vue-ui-quadrant-CEmoMAL7.js} +12 -12
- package/dist/{vue-ui-quadrant-BLpgNZs9.cjs → vue-ui-quadrant-EZqQ-7Ev.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-CZ6gBVVk.cjs → vue-ui-quick-chart-BKUUR-A1.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-Ci4RKL62.js → vue-ui-quick-chart-T_oeRTqY.js} +9 -9
- package/dist/{vue-ui-radar-03mjX9gn.js → vue-ui-radar-DG_Zir8w.js} +12 -12
- package/dist/{vue-ui-radar-Ca1AvJAF.cjs → vue-ui-radar-QBwo6ybW.cjs} +1 -1
- package/dist/{vue-ui-rating-Dilq1rrJ.cjs → vue-ui-rating-Juprijdi.cjs} +1 -1
- package/dist/{vue-ui-rating-CSSdVGTk.js → vue-ui-rating-gswAA28b.js} +2 -2
- package/dist/{vue-ui-relation-circle-DsckG4af.cjs → vue-ui-relation-circle-BWX8zrfH.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-B3J9KW9u.js → vue-ui-relation-circle-DtnXrnOP.js} +7 -7
- package/dist/{vue-ui-rings-COAgson6.js → vue-ui-rings-D3g-ORch.js} +11 -11
- package/dist/{vue-ui-rings-6g022zEh.cjs → vue-ui-rings-Damuv7g9.cjs} +1 -1
- package/dist/{vue-ui-scatter-BrdWaLV6.js → vue-ui-scatter-DBO-XViT.js} +12 -12
- package/dist/{vue-ui-scatter-B3t_Q_4g.cjs → vue-ui-scatter-RUeAe7Sx.cjs} +1 -1
- package/dist/{vue-ui-screenshot-NpTxyR66.cjs → vue-ui-screenshot-3MDyr6v3.cjs} +1 -1
- package/dist/{vue-ui-screenshot-CWMAfSH3.js → vue-ui-screenshot-K0a-DVD6.js} +1 -1
- package/dist/{vue-ui-skeleton-BXPvqUO_.js → vue-ui-skeleton-CWjNNx-k.js} +3 -3
- package/dist/{vue-ui-skeleton-D6mdHYxB.cjs → vue-ui-skeleton-DUNkS05l.cjs} +1 -1
- package/dist/{vue-ui-smiley-BIAA0JuB.cjs → vue-ui-smiley-Cbqg-N-L.cjs} +1 -1
- package/dist/{vue-ui-smiley-TNgEIMFs.js → vue-ui-smiley-MwX1c6qK.js} +2 -2
- package/dist/{vue-ui-spark-trend-BWb59zfs.cjs → vue-ui-spark-trend-CN5JUPhn.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-Xtb0H-Ra.js → vue-ui-spark-trend-D9eWTtbE.js} +5 -5
- package/dist/{vue-ui-sparkbar-CO0RYq4S.js → vue-ui-sparkbar-CPF7YNDd.js} +4 -4
- package/dist/{vue-ui-sparkbar-mgvNuWjK.cjs → vue-ui-sparkbar-IphZ8jXh.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-Cn17RyPJ.js → vue-ui-sparkgauge-B29V7ZTv.js} +4 -4
- package/dist/{vue-ui-sparkgauge-CfgH_pIo.cjs → vue-ui-sparkgauge-BRMGqR9Z.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-yTF-QJCM.js → vue-ui-sparkhistogram-BJTgOWF5.js} +5 -5
- package/dist/{vue-ui-sparkhistogram-BU1jgcm9.cjs → vue-ui-sparkhistogram-rvYaVHmw.cjs} +1 -1
- package/dist/{vue-ui-sparkline-3ym-6DFE.cjs → vue-ui-sparkline-BI9jqI0h.cjs} +1 -1
- package/dist/{vue-ui-sparkline-D80w9cUt.js → vue-ui-sparkline-DX79otAB.js} +4 -4
- package/dist/{vue-ui-sparkstackbar-C1zVZqZh.cjs → vue-ui-sparkstackbar-DuollcwK.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-DhQNOgjS.js → vue-ui-sparkstackbar-vP28A6AT.js} +5 -5
- package/dist/{vue-ui-stackbar-yiVhLavI.cjs → vue-ui-stackbar-BumFmZZF.cjs} +1 -1
- package/dist/{vue-ui-stackbar-C_b754Op.js → vue-ui-stackbar-DnJEgIaA.js} +12 -12
- package/dist/{vue-ui-strip-plot-CqP7E3Fr.js → vue-ui-strip-plot-DqcHBwd_.js} +11 -11
- package/dist/{vue-ui-strip-plot-CK-U0tNX.cjs → vue-ui-strip-plot-DupREfRd.cjs} +1 -1
- package/dist/{vue-ui-table-x2Ylaftx.cjs → vue-ui-table-BMJ0I5nr.cjs} +1 -1
- package/dist/{vue-ui-table-BLPLqFFd.js → vue-ui-table-D8cgqIJl.js} +1 -1
- package/dist/{vue-ui-table-heatmap-2Qm41w8P.cjs → vue-ui-table-heatmap-D43pTFli.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-jWG59f0S.js → vue-ui-table-heatmap-D4qeClXn.js} +4 -4
- package/dist/vue-ui-table-sparkline-B7OPOium.cjs +1 -0
- package/dist/vue-ui-table-sparkline-B_Po0RuC.js +583 -0
- package/dist/{vue-ui-thermometer-CS4v4vKk.js → vue-ui-thermometer-C6nfW6uY.js} +7 -7
- package/dist/{vue-ui-thermometer-DVPaZfi5.cjs → vue-ui-thermometer-CaV3JF3h.cjs} +1 -1
- package/dist/{vue-ui-timer-op_p9xjL.js → vue-ui-timer-CfwmMRdZ.js} +5 -5
- package/dist/{vue-ui-timer-Bu17pe7S.cjs → vue-ui-timer-ldINTqND.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-CoKFLMWh.cjs → vue-ui-tiremarks-BlyxL_IU.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-CzNBUmn2.js → vue-ui-tiremarks-iNKMnu3P.js} +7 -7
- package/dist/{vue-ui-treemap-DLDn1gQ2.js → vue-ui-treemap-CwMnkcOi.js} +11 -11
- package/dist/{vue-ui-treemap-DXU0BagE.cjs → vue-ui-treemap-YdRDlSHA.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-BqTIL5Np.js → vue-ui-vertical-bar-BZR4YOLh.js} +11 -11
- package/dist/{vue-ui-vertical-bar-BlG3HwaX.cjs → vue-ui-vertical-bar-Bji3-X8i.cjs} +1 -1
- package/dist/{vue-ui-waffle-DFjArEi_.js → vue-ui-waffle-D2BccJmB.js} +11 -11
- package/dist/{vue-ui-waffle-CaTFfTmj.cjs → vue-ui-waffle-rO_LJaHR.cjs} +1 -1
- package/dist/{vue-ui-wheel-B22xmLY4.cjs → vue-ui-wheel-BTrpdV-C.cjs} +1 -1
- package/dist/{vue-ui-wheel-C95mjUTI.js → vue-ui-wheel-GqWFopE1.js} +7 -7
- package/dist/{vue-ui-word-cloud-05iWIjGT.cjs → vue-ui-word-cloud-DD-pKUen.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-Byx-M5Jn.js → vue-ui-word-cloud-DiG8DHOr.js} +10 -10
- package/dist/{vue-ui-xy-lPnzrWt8.cjs → vue-ui-xy-C32KNdyx.cjs} +1 -1
- package/dist/{vue-ui-xy-C8YrIKK6.js → vue-ui-xy-DicLnkBA.js} +14 -14
- package/dist/{vue-ui-xy-canvas-os8jbTXb.cjs → vue-ui-xy-canvas-9e630nJX.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-Cg0PIT5i.js → vue-ui-xy-canvas-D6CYL9A8.js} +11 -11
- package/package.json +1 -1
- package/dist/index-KYU_8xrX.cjs +0 -9
- package/dist/vue-ui-table-sparkline-BEeO-aWa.js +0 -516
- package/dist/vue-ui-table-sparkline-C0vzS1F3.cjs +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as p, ref as m, onMounted as ot, watch as Ee, openBlock as a, createElementBlock as o, normalizeClass as P, normalizeStyle as ce, createBlock as D, createCommentVNode as v, unref as c, createSlots as ut, withCtx as I, renderSlot as F, normalizeProps as q, guardReactiveProps as J, createVNode as st, createElementVNode as d, Fragment as k, renderList as _, toDisplayString as b, withKeys as nt, createTextVNode as Oe, nextTick as X } from "vue";
|
|
2
|
-
import { u as rt, o as it, e as Q, g as ct, c as Ve, t as vt, a as dt, p as Z, C as He, b as ht, J as yt, d as ve, D as Me, m as de, X as ft, s as G, E as gt, i as he, f as ee, j as We, k as te, n as Re, K as Ue, q as mt, r as bt } from "./index-
|
|
3
|
-
import { _ as xt } from "./Title-
|
|
4
|
-
import { u as pt, U as kt } from "./usePrinter-
|
|
5
|
-
import { D as _t } from "./DataTable-
|
|
6
|
-
import { L as Ct } from "./Legend-
|
|
7
|
-
import wt from "./vue-ui-skeleton-
|
|
8
|
-
import { S as Lt } from "./Slicer-
|
|
9
|
-
import zt from "./vue-ui-accordion-
|
|
10
|
-
import { u as Xe } from "./useNestedProp-
|
|
11
|
-
import { _ as At } from "./PackageVersion-
|
|
12
|
-
import { P as St } from "./PenAndPaper-
|
|
2
|
+
import { u as rt, o as it, e as Q, g as ct, c as Ve, t as vt, a as dt, p as Z, C as He, b as ht, J as yt, d as ve, D as Me, m as de, X as ft, s as G, E as gt, i as he, f as ee, j as We, k as te, n as Re, K as Ue, q as mt, r as bt } from "./index-igxqCP2w.js";
|
|
3
|
+
import { _ as xt } from "./Title-DED-PQ7X.js";
|
|
4
|
+
import { u as pt, U as kt } from "./usePrinter-CnZYDQXB.js";
|
|
5
|
+
import { D as _t } from "./DataTable-CO5C8Cmb.js";
|
|
6
|
+
import { L as Ct } from "./Legend-FZN9UHoI.js";
|
|
7
|
+
import wt from "./vue-ui-skeleton-CWjNNx-k.js";
|
|
8
|
+
import { S as Lt } from "./Slicer-DlgqsI5C.js";
|
|
9
|
+
import zt from "./vue-ui-accordion-lF7yVkiT.js";
|
|
10
|
+
import { u as Xe } from "./useNestedProp-CSVnZVwZ.js";
|
|
11
|
+
import { _ as At } from "./PackageVersion-DYk2hOG1.js";
|
|
12
|
+
import { P as St } from "./PenAndPaper-BfgS_5ux.js";
|
|
13
13
|
import { _ as $t } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
14
|
const Nt = ["id"], It = ["xmlns", "viewBox"], Ft = ["id"], Pt = ["stop-color"], Tt = ["stop-color"], Dt = ["id"], Et = ["stop-color"], Ot = ["stop-color"], Vt = ["stop-color"], Ht = { key: 0 }, Mt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Wt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Rt = { key: 0 }, Ut = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Xt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Gt = ["x", "y", "font-size", "fill", "font-weight"], jt = ["text-anchor", "font-size", "fill", "transform"], Bt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Yt = { key: 1 }, Kt = ["cx", "cy", "r", "fill"], qt = { key: 0 }, Jt = { key: 0 }, Qt = ["d", "stroke"], Zt = ["text-anchor", "x", "y", "fill"], el = ["cx", "cy", "r", "fill"], tl = { key: 0 }, ll = ["cx", "cy", "fill"], al = { key: 1 }, ol = ["d", "fill", "stroke"], ul = { key: 2 }, sl = ["d", "fill", "stroke"], nl = ["x", "y", "font-size", "fill"], rl = ["x", "y", "width", "fill", "onClick"], il = ["x", "y", "width", "height", "onMouseenter", "onClick"], cl = {
|
|
15
15
|
key: 3,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as m, ref as v, watch as de, onMounted as ve, onBeforeUnmount as Ne, openBlock as o, createElementBlock as r, normalizeClass as he, normalizeStyle as H, createBlock as L, createCommentVNode as y, unref as d, createSlots as Te, withCtx as _, renderSlot as k, normalizeProps as W, guardReactiveProps as R, createVNode as Pe, Fragment as w, renderList as $, createElementVNode as n, toDisplayString as A, createTextVNode as ye, nextTick as Ge } from "vue";
|
|
2
|
-
import { u as De, c as fe, t as Ie, o as Me, e as be, g as Oe, v as ge, D as Fe, f as z, X as pe, i as B, l as me, h as _e, q as Ve, r as Ee } from "./index-
|
|
2
|
+
import { u as De, c as fe, t as Ie, o as Me, e as be, g as Oe, v as ge, D as Fe, f as z, X as pe, i as B, l as me, h as _e, q as Ve, r as Ee } from "./index-igxqCP2w.js";
|
|
3
3
|
import { t as He, u as We } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { _ as Re } from "./Title-
|
|
5
|
-
import { u as Be, U as Ue } from "./usePrinter-
|
|
6
|
-
import { D as je } from "./DataTable-
|
|
7
|
-
import qe from "./vue-ui-skeleton-
|
|
8
|
-
import { L as Ye } from "./Legend-
|
|
9
|
-
import Ze from "./vue-ui-accordion-
|
|
10
|
-
import { u as ke } from "./useNestedProp-
|
|
11
|
-
import { _ as Je } from "./PackageVersion-
|
|
12
|
-
import { P as Ke } from "./PenAndPaper-
|
|
4
|
+
import { _ as Re } from "./Title-DED-PQ7X.js";
|
|
5
|
+
import { u as Be, U as Ue } from "./usePrinter-CnZYDQXB.js";
|
|
6
|
+
import { D as je } from "./DataTable-CO5C8Cmb.js";
|
|
7
|
+
import qe from "./vue-ui-skeleton-CWjNNx-k.js";
|
|
8
|
+
import { L as Ye } from "./Legend-FZN9UHoI.js";
|
|
9
|
+
import Ze from "./vue-ui-accordion-lF7yVkiT.js";
|
|
10
|
+
import { u as ke } from "./useNestedProp-CSVnZVwZ.js";
|
|
11
|
+
import { _ as Je } from "./PackageVersion-DYk2hOG1.js";
|
|
12
|
+
import { P as Ke } from "./PenAndPaper-BfgS_5ux.js";
|
|
13
13
|
import { _ as Qe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
14
|
const et = ["id"], tt = ["xmlns", "viewBox"], lt = { key: 0 }, at = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], st = { key: 1 }, ot = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], rt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], nt = { key: 2 }, ut = ["x", "y", "font-size", "fill", "font-weight"], it = ["x", "y", "font-size", "fill"], ct = { key: 3 }, dt = ["x", "y", "font-size", "fill", "font-weight"], vt = ["id"], ht = ["stop-color"], yt = ["stop-color"], ft = ["stop-color"], bt = ["id"], gt = ["stop-color"], pt = ["stop-color"], mt = ["stop-color"], _t = ["id"], kt = ["stop-color"], xt = ["stop-color"], Ct = ["id"], wt = ["stop-color"], $t = ["stop-color"], Lt = { key: 0 }, At = ["d", "fill"], zt = { key: 1 }, Xt = ["x", "y", "height", "width", "fill"], St = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Nt = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Tt = { key: 2 }, Pt = ["x", "y", "fill", "font-size"], Gt = { key: 3 }, Dt = ["x", "y", "fill", "font-size"], It = {
|
|
15
15
|
key: 5,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-KYU_8xrX.cjs"),Y=require("./useResponsive-BJ7DTGpm.cjs"),ne=require("./Title-URF9hufV.cjs"),Z=require("./usePrinter-4Zj_RZ5v.cjs"),ue=require("./DataTable-CfxOc-In.cjs"),ce=require("./vue-ui-skeleton-D6mdHYxB.cjs"),ie=require("./Legend-DDuxh17p.cjs"),de=require("./vue-ui-accordion-C0oMKEv0.cjs"),J=require("./useNestedProp-C-g0SLHN.cjs"),ve=require("./PackageVersion-Df1iPzMk.cjs"),he=require("./PenAndPaper-CvGft3ku.cjs"),ye=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),fe=["id"],me=["xmlns","viewBox"],be={key:0},pe=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ge={key:1},ke=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],_e=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],xe={key:2},Ce=["x","y","font-size","fill","font-weight"],we=["x","y","font-size","fill"],Be={key:3},Ne=["x","y","font-size","fill","font-weight"],Ee=["id"],$e=["stop-color"],Le=["stop-color"],Ve=["stop-color"],Se=["id"],ze=["stop-color"],Ae=["stop-color"],Pe=["stop-color"],Te=["id"],Xe=["stop-color"],De=["stop-color"],Fe=["id"],Me=["stop-color"],Ge=["stop-color"],Ie={key:0},Oe=["d","fill"],qe={key:1},He=["x","y","height","width","fill"],Re=["cx","cy","r","fill","stroke","stroke-width"],We=["cx","cy","r","fill","stroke","stroke-width"],Ue={key:2},je=["x","y","fill","font-size"],Ye={key:3},Ze=["x","y","fill","font-size"],Je={key:5,class:"vue-data-ui-watermark"},Ke=["xmlns","height","width"],Qe=["fill"],et=["innerHTML"],tt={__name:"vue-ui-dumbbell",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(K,{expose:Q,emit:at}){const y=K,{vue_ui_dumbbell:ee}=s.useConfig(),b=e.computed({get(){return!!y.dataset&&y.dataset.length},set(a){return a}}),d=e.ref(s.createUid()),V=e.ref(0),p=e.ref(null),S=e.ref(null),z=e.ref(null),A=e.ref(null),P=e.ref(null),T=e.ref(0),X=e.ref(0),D=e.ref(0),t=e.computed({get:()=>F(),set:a=>a});function F(){const a=J.useNestedProp({userConfig:y.config,defaultConfig:ee});return a.theme?{...J.useNestedProp({userConfig:s.themes.vue_ui_dumbbell[a.theme]||y.config,defaultConfig:a})}:a}e.watch(()=>y.config,a=>{t.value=F(),M(),T.value+=1,X.value+=1,D.value+=1,i.value=t.value.style.chart.rowHeight,g.value=t.value.style.chart.width},{deep:!0}),e.watch(()=>y.dataset,a=>{R()},{deep:!0});const _=e.ref(null);e.onMounted(()=>{M()});function M(){if(s.objectIsEmpty(y.dataset)?s.error({componentName:"VueUiDumbbell",type:"dataset"}):y.dataset.forEach((a,n)=>{s.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","start","end"]}).forEach(l=>{b.value=!1,s.error({componentName:"VueUiDumbbell",type:"datasetSerieAttribute",property:l,index:n})})}),t.value.responsive){const a=Y.throttle(()=>{const{width:n,height:l}=Y.useResponsive({chart:p.value,title:t.value.style.chart.title.text?S.value:null,legend:t.value.style.chart.legend.show?z.value:null,source:A.value,noTitle:P.value});g.value=n,i.value=l/y.dataset.length,v.value=C()});_.value=new ResizeObserver(a),_.value.observe(p.value.parentNode)}}e.onBeforeUnmount(()=>{_.value&&_.value.disconnect()});const{isPrinting:G,isImaging:I,generatePdf:O,generateImage:q}=Z.usePrinter({elementId:`dumbbell_${d.value}`,fileName:t.value.style.chart.title.text||"vue-ui-dumbbell"}),te=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),x=e.ref({showTable:t.value.table.show}),f=e.computed(()=>y.dataset.map((a,n)=>({...a,start:s.checkNaN(a.start),end:s.checkNaN(a.end),id:s.createUid()}))),E=e.computed(()=>({max:Math.max(...f.value.flatMap(a=>[a.start,a.end])),min:Math.min(...f.value.flatMap(a=>[a.start,a.end]))})),c=e.computed(()=>s.calculateNiceScale(E.value.min<0?E.value.min:0,E.value.max,t.value.style.chart.grid.scaleSteps)),i=e.ref(t.value.style.chart.rowHeight),g=e.ref(t.value.style.chart.width),r=e.computed(()=>{const a=i.value,n=t.value.style.chart.padding.left+t.value.style.chart.padding.right+g.value,l=t.value.style.chart.padding.top+t.value.style.chart.padding.bottom+a*y.dataset.length,o=c.value.ticks.length*(g.value/c.value.ticks.length);return{left:t.value.style.chart.padding.left,right:n-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,bottom:l-t.value.style.chart.padding.bottom,width:g.value,height:a*y.dataset.length,rowHeight:a,absoluteHeight:l,absoluteWidth:n,widthPlotReference:o}});function C(){return f.value.map((a,n)=>{const l=r.value.left+(a.start+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,o=r.value.left+(a.end+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,u=l+(o-l)/2;return{...a,startX:l,endX:o,centerX:u,y:r.value.top+n*i.value+i.value/2,endVal:a.start}})}const v=e.ref([]),H=e.ref(null),le=e.computed(()=>f.value.map(a=>a.end).reduce((a,n)=>a+n,0));e.onMounted(()=>{R()});function R(){v.value=C();let a=v.value.map(l=>l.start).reduce((l,o)=>l+o,0);function n(){const l=f.value.map(o=>o.end-o.start);a>=le.value?(cancelAnimationFrame(H.value),v.value=C()):(v.value=v.value.map((o,u)=>{o.endVal+=l[u]*(t.value.animationSpeed/100);const h=r.value.left+(o.start+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,N=r.value.left+(o.endVal+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,L=h+(N-h)/2;return{...o,startX:h,endX:N,centerX:L,y:r.value.top+u*i.value+i.value/2,endVal:o.endVal}}),a=v.value.map(o=>o.endVal).reduce((o,u)=>o+u,0),H.value=requestAnimationFrame(n))}t.value.useAnimation?n():v.value=C()}const W=e.computed(()=>[{name:t.value.style.chart.legend.labelStart,color:t.value.style.chart.plots.gradient.show?`url(#start_grad_${d.value})`:t.value.style.chart.plots.startColor},{name:t.value.style.chart.legend.labelEnd,color:t.value.style.chart.plots.gradient.show?`url(#end_grad_${d.value})`:t.value.style.chart.plots.endColor}]),ae=e.computed(()=>({cy:"donut-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,paddingTop:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),m=e.computed(()=>{const a=v.value.map(l=>({name:l.name})),n=v.value.map(l=>({start:l.start,end:l.end}));return{head:a,body:n}}),w=e.computed(()=>{const a=[t.value.table.columnNames.series,t.value.table.columnNames.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],n=m.value.head.map((u,h)=>{const N=s.dataLabel({p:t.value.style.chart.labels.prefix,v:m.value.body[h].start,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),L=s.dataLabel({p:t.value.style.chart.labels.prefix,v:m.value.body[h].end,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),se=s.dataLabel({v:100*(m.value.body[h].end/m.value.body[h].start-1),s:"%",r:t.value.table.td.roundingPercentage});return[{name:u.name},N,L,se]}),l={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.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],head:a,body:n,config:l}});function U(){e.nextTick(()=>{const a=m.value.head.map((o,u)=>[[o.name],[m.value.body[u].start],[m.value.body[u].end]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.start],[t.value.table.columnNames.end]]].concat(a),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-dumbbell"})})}const k=e.ref(!1);function oe(a){k.value=a,V.value+=1}function re(){return v.value}function j(){x.value.showTable=!x.value.showTable}const B=e.ref(!1);function $(){B.value=!B.value}return Q({getData:re,generatePdf:O,generateCsv:U,generateImage:q,toggleTable:j,toggleAnnotator:$}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dumbbellChart",ref:p,class:e.normalizeClass(`vue-ui-dumbbell ${k.value?"vue-data-ui-wrapper-fullscreen":""}`),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:`dumbbell_${d.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(he.PenAndPaper,{key:0,parent:p.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:$},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),te.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:P,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:S,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ne._sfc_main,{key:`title_${T.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&&b.value?(e.openBlock(),e.createBlock(Z.UserOptions,{ref:"details",key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(G),isImaging:e.unref(I),uid:d.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:k.value,titles:{...t.value.userOptions.buttonTitles},chartElement:p.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:oe,onGeneratePdf:e.unref(O),onGenerateCsv:U,onGenerateImage:e.unref(q),onToggleTable:j,onToggleAnnotator:$},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:o})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:o})),void 0,!0)]),key:"4"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:o})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:o})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value}),viewBox:`0 0 ${r.value.absoluteWidth<=0?10:r.value.absoluteWidth} ${r.value.absoluteHeight<=0?10:r.value.absoluteHeight}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(ve._sfc_main),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.ticks,(l,o)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left+o*r.value.width/(c.value.ticks.length-1),x2:r.value.left+o*r.value.width/(c.value.ticks.length-1),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},null,8,pe))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left,x2:r.value.right,y1:r.value.top+o*i.value,y2:r.value.top+o*i.value,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},null,8,ke))),256)),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.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,_e)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(),e.createElementBlock("g",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:r.value.top+o*i.value+(t.value.style.chart.labels.yAxisLabels.showProgression?i.value/3:i.value/2)+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"font-weight":t.value.style.chart.labels.yAxisLabels.bold?"bold":"normal","text-anchor":"end"},e.toDisplayString(l.name),9,Ce))),256)),t.value.style.chart.labels.yAxisLabels.showProgression?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:r.value.top+o*i.value+i.value/1.3+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"text-anchor":"end"},e.toDisplayString(e.unref(s.dataLabel)({v:100*(l.end/l.start-1),s:"%",r:t.value.style.chart.labels.yAxisLabels.rounding})),9,we))),256)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(),e.createElementBlock("g",Be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.ticks,(l,o)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left+o*(r.value.width/(c.value.ticks.length-1)),y:r.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"font-weight":t.value.style.chart.labels.xAxisLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.labels.formatter,l,e.unref(s.dataLabel)({p:t.value.style.chart.labels.prefix,v:l,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.xAxisLabels.rounding}),{datapoint:l,seriesIndex:o})),9,Ne))),256))])):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`start_grad_${d.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.startColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,$e),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.startColor,.1)},null,8,Le),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Ve)],8,Ee),e.createElementVNode("radialGradient",{id:`end_grad_${d.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.endColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,ze),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.endColor,.1)},null,8,Ae),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Pe)],8,Se)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,o)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`grad_positive_${d.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.startColor},null,8,Xe),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,De)],8,Te),e.createElementVNode("linearGradient",{id:`grad_negative_${d.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.endColor},null,8,Me),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Ge)],8,Fe)]),t.value.style.chart.plots.link.type==="curved"?(e.openBlock(),e.createElementBlock("g",Ie,[e.createElementVNode("path",{d:`M
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-BHQZE19X.cjs"),Y=require("./useResponsive-BJ7DTGpm.cjs"),ne=require("./Title-5Vedk01J.cjs"),Z=require("./usePrinter-DVgxBO4o.cjs"),ue=require("./DataTable-kMUhutQ4.cjs"),ce=require("./vue-ui-skeleton-DUNkS05l.cjs"),ie=require("./Legend-DPHcmrzd.cjs"),de=require("./vue-ui-accordion-CRVWlHxs.cjs"),J=require("./useNestedProp-CwpqC_aE.cjs"),ve=require("./PackageVersion-rnWHRWGI.cjs"),he=require("./PenAndPaper-BQl9-uX0.cjs"),ye=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),fe=["id"],me=["xmlns","viewBox"],be={key:0},pe=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ge={key:1},ke=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],_e=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],xe={key:2},Ce=["x","y","font-size","fill","font-weight"],we=["x","y","font-size","fill"],Be={key:3},Ne=["x","y","font-size","fill","font-weight"],Ee=["id"],$e=["stop-color"],Le=["stop-color"],Ve=["stop-color"],Se=["id"],ze=["stop-color"],Ae=["stop-color"],Pe=["stop-color"],Te=["id"],Xe=["stop-color"],De=["stop-color"],Fe=["id"],Me=["stop-color"],Ge=["stop-color"],Ie={key:0},Oe=["d","fill"],qe={key:1},He=["x","y","height","width","fill"],Re=["cx","cy","r","fill","stroke","stroke-width"],We=["cx","cy","r","fill","stroke","stroke-width"],Ue={key:2},je=["x","y","fill","font-size"],Ye={key:3},Ze=["x","y","fill","font-size"],Je={key:5,class:"vue-data-ui-watermark"},Ke=["xmlns","height","width"],Qe=["fill"],et=["innerHTML"],tt={__name:"vue-ui-dumbbell",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(K,{expose:Q,emit:at}){const y=K,{vue_ui_dumbbell:ee}=s.useConfig(),b=e.computed({get(){return!!y.dataset&&y.dataset.length},set(a){return a}}),d=e.ref(s.createUid()),V=e.ref(0),p=e.ref(null),S=e.ref(null),z=e.ref(null),A=e.ref(null),P=e.ref(null),T=e.ref(0),X=e.ref(0),D=e.ref(0),t=e.computed({get:()=>F(),set:a=>a});function F(){const a=J.useNestedProp({userConfig:y.config,defaultConfig:ee});return a.theme?{...J.useNestedProp({userConfig:s.themes.vue_ui_dumbbell[a.theme]||y.config,defaultConfig:a})}:a}e.watch(()=>y.config,a=>{t.value=F(),M(),T.value+=1,X.value+=1,D.value+=1,i.value=t.value.style.chart.rowHeight,g.value=t.value.style.chart.width},{deep:!0}),e.watch(()=>y.dataset,a=>{R()},{deep:!0});const _=e.ref(null);e.onMounted(()=>{M()});function M(){if(s.objectIsEmpty(y.dataset)?s.error({componentName:"VueUiDumbbell",type:"dataset"}):y.dataset.forEach((a,n)=>{s.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","start","end"]}).forEach(l=>{b.value=!1,s.error({componentName:"VueUiDumbbell",type:"datasetSerieAttribute",property:l,index:n})})}),t.value.responsive){const a=Y.throttle(()=>{const{width:n,height:l}=Y.useResponsive({chart:p.value,title:t.value.style.chart.title.text?S.value:null,legend:t.value.style.chart.legend.show?z.value:null,source:A.value,noTitle:P.value});g.value=n,i.value=l/y.dataset.length,v.value=C()});_.value=new ResizeObserver(a),_.value.observe(p.value.parentNode)}}e.onBeforeUnmount(()=>{_.value&&_.value.disconnect()});const{isPrinting:G,isImaging:I,generatePdf:O,generateImage:q}=Z.usePrinter({elementId:`dumbbell_${d.value}`,fileName:t.value.style.chart.title.text||"vue-ui-dumbbell"}),te=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),x=e.ref({showTable:t.value.table.show}),f=e.computed(()=>y.dataset.map((a,n)=>({...a,start:s.checkNaN(a.start),end:s.checkNaN(a.end),id:s.createUid()}))),E=e.computed(()=>({max:Math.max(...f.value.flatMap(a=>[a.start,a.end])),min:Math.min(...f.value.flatMap(a=>[a.start,a.end]))})),c=e.computed(()=>s.calculateNiceScale(E.value.min<0?E.value.min:0,E.value.max,t.value.style.chart.grid.scaleSteps)),i=e.ref(t.value.style.chart.rowHeight),g=e.ref(t.value.style.chart.width),r=e.computed(()=>{const a=i.value,n=t.value.style.chart.padding.left+t.value.style.chart.padding.right+g.value,l=t.value.style.chart.padding.top+t.value.style.chart.padding.bottom+a*y.dataset.length,o=c.value.ticks.length*(g.value/c.value.ticks.length);return{left:t.value.style.chart.padding.left,right:n-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,bottom:l-t.value.style.chart.padding.bottom,width:g.value,height:a*y.dataset.length,rowHeight:a,absoluteHeight:l,absoluteWidth:n,widthPlotReference:o}});function C(){return f.value.map((a,n)=>{const l=r.value.left+(a.start+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,o=r.value.left+(a.end+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,u=l+(o-l)/2;return{...a,startX:l,endX:o,centerX:u,y:r.value.top+n*i.value+i.value/2,endVal:a.start}})}const v=e.ref([]),H=e.ref(null),le=e.computed(()=>f.value.map(a=>a.end).reduce((a,n)=>a+n,0));e.onMounted(()=>{R()});function R(){v.value=C();let a=v.value.map(l=>l.start).reduce((l,o)=>l+o,0);function n(){const l=f.value.map(o=>o.end-o.start);a>=le.value?(cancelAnimationFrame(H.value),v.value=C()):(v.value=v.value.map((o,u)=>{o.endVal+=l[u]*(t.value.animationSpeed/100);const h=r.value.left+(o.start+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,N=r.value.left+(o.endVal+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,L=h+(N-h)/2;return{...o,startX:h,endX:N,centerX:L,y:r.value.top+u*i.value+i.value/2,endVal:o.endVal}}),a=v.value.map(o=>o.endVal).reduce((o,u)=>o+u,0),H.value=requestAnimationFrame(n))}t.value.useAnimation?n():v.value=C()}const W=e.computed(()=>[{name:t.value.style.chart.legend.labelStart,color:t.value.style.chart.plots.gradient.show?`url(#start_grad_${d.value})`:t.value.style.chart.plots.startColor},{name:t.value.style.chart.legend.labelEnd,color:t.value.style.chart.plots.gradient.show?`url(#end_grad_${d.value})`:t.value.style.chart.plots.endColor}]),ae=e.computed(()=>({cy:"donut-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,paddingTop:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),m=e.computed(()=>{const a=v.value.map(l=>({name:l.name})),n=v.value.map(l=>({start:l.start,end:l.end}));return{head:a,body:n}}),w=e.computed(()=>{const a=[t.value.table.columnNames.series,t.value.table.columnNames.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],n=m.value.head.map((u,h)=>{const N=s.dataLabel({p:t.value.style.chart.labels.prefix,v:m.value.body[h].start,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),L=s.dataLabel({p:t.value.style.chart.labels.prefix,v:m.value.body[h].end,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),se=s.dataLabel({v:100*(m.value.body[h].end/m.value.body[h].start-1),s:"%",r:t.value.table.td.roundingPercentage});return[{name:u.name},N,L,se]}),l={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.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],head:a,body:n,config:l}});function U(){e.nextTick(()=>{const a=m.value.head.map((o,u)=>[[o.name],[m.value.body[u].start],[m.value.body[u].end]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.start],[t.value.table.columnNames.end]]].concat(a),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-dumbbell"})})}const k=e.ref(!1);function oe(a){k.value=a,V.value+=1}function re(){return v.value}function j(){x.value.showTable=!x.value.showTable}const B=e.ref(!1);function $(){B.value=!B.value}return Q({getData:re,generatePdf:O,generateCsv:U,generateImage:q,toggleTable:j,toggleAnnotator:$}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dumbbellChart",ref:p,class:e.normalizeClass(`vue-ui-dumbbell ${k.value?"vue-data-ui-wrapper-fullscreen":""}`),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:`dumbbell_${d.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(he.PenAndPaper,{key:0,parent:p.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:$},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),te.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:P,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:S,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ne._sfc_main,{key:`title_${T.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&&b.value?(e.openBlock(),e.createBlock(Z.UserOptions,{ref:"details",key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(G),isImaging:e.unref(I),uid:d.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:k.value,titles:{...t.value.userOptions.buttonTitles},chartElement:p.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:oe,onGeneratePdf:e.unref(O),onGenerateCsv:U,onGenerateImage:e.unref(q),onToggleTable:j,onToggleAnnotator:$},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:o})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:o})),void 0,!0)]),key:"4"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:o})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:o})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value}),viewBox:`0 0 ${r.value.absoluteWidth<=0?10:r.value.absoluteWidth} ${r.value.absoluteHeight<=0?10:r.value.absoluteHeight}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(ve._sfc_main),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.ticks,(l,o)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left+o*r.value.width/(c.value.ticks.length-1),x2:r.value.left+o*r.value.width/(c.value.ticks.length-1),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},null,8,pe))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left,x2:r.value.right,y1:r.value.top+o*i.value,y2:r.value.top+o*i.value,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},null,8,ke))),256)),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.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,_e)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(),e.createElementBlock("g",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:r.value.top+o*i.value+(t.value.style.chart.labels.yAxisLabels.showProgression?i.value/3:i.value/2)+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"font-weight":t.value.style.chart.labels.yAxisLabels.bold?"bold":"normal","text-anchor":"end"},e.toDisplayString(l.name),9,Ce))),256)),t.value.style.chart.labels.yAxisLabels.showProgression?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:r.value.top+o*i.value+i.value/1.3+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"text-anchor":"end"},e.toDisplayString(e.unref(s.dataLabel)({v:100*(l.end/l.start-1),s:"%",r:t.value.style.chart.labels.yAxisLabels.rounding})),9,we))),256)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(),e.createElementBlock("g",Be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.ticks,(l,o)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left+o*(r.value.width/(c.value.ticks.length-1)),y:r.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"font-weight":t.value.style.chart.labels.xAxisLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.labels.formatter,l,e.unref(s.dataLabel)({p:t.value.style.chart.labels.prefix,v:l,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.xAxisLabels.rounding}),{datapoint:l,seriesIndex:o})),9,Ne))),256))])):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`start_grad_${d.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.startColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,$e),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.startColor,.1)},null,8,Le),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Ve)],8,Ee),e.createElementVNode("radialGradient",{id:`end_grad_${d.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.endColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,ze),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.endColor,.1)},null,8,Ae),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Pe)],8,Se)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,o)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`grad_positive_${d.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.startColor},null,8,Xe),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,De)],8,Te),e.createElementVNode("linearGradient",{id:`grad_negative_${d.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.endColor},null,8,Me),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Ge)],8,Fe)]),t.value.style.chart.plots.link.type==="curved"?(e.openBlock(),e.createElementBlock("g",Ie,[e.createElementVNode("path",{d:`M
|
|
2
2
|
${l.startX},${l.y+t.value.style.chart.plots.radius/2}
|
|
3
3
|
C ${l.centerX},${l.y} ${l.centerX},${l.y}
|
|
4
4
|
${l.endX},${l.y+t.value.style.chart.plots.radius/2}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { computed as m, onMounted as Ee, ref as b, watch as Se, openBlock as u, createElementBlock as i, normalizeClass as he, normalizeStyle as N, createBlock as P, createCommentVNode as C, unref as c, createSlots as Me, withCtx as y, renderSlot as k, normalizeProps as X, guardReactiveProps as W, createVNode as me, createElementVNode as S, Fragment as O, renderList as F, toDisplayString as q, createTextVNode as ze, nextTick as Ye } from "vue";
|
|
2
|
-
import { u as De, o as Ge, e as Be, c as ge, t as Ue, a as Ve, p as R, b as je, v as f, f as pe, X as Xe, G as be, L as We, i as qe, q as Re, r as Ze } from "./index-
|
|
3
|
-
import { _ as Je } from "./Title-
|
|
4
|
-
import { u as Ke, U as Qe } from "./usePrinter-
|
|
5
|
-
import { D as et } from "./DataTable-
|
|
6
|
-
import tt from "./vue-ui-accordion-
|
|
7
|
-
import ot from "./vue-ui-skeleton-
|
|
8
|
-
import { u as ye } from "./useNestedProp-
|
|
9
|
-
import { _ as lt } from "./PackageVersion-
|
|
10
|
-
import { P as at } from "./PenAndPaper-
|
|
2
|
+
import { u as De, o as Ge, e as Be, c as ge, t as Ue, a as Ve, p as R, b as je, v as f, f as pe, X as Xe, G as be, L as We, i as qe, q as Re, r as Ze } from "./index-igxqCP2w.js";
|
|
3
|
+
import { _ as Je } from "./Title-DED-PQ7X.js";
|
|
4
|
+
import { u as Ke, U as Qe } from "./usePrinter-CnZYDQXB.js";
|
|
5
|
+
import { D as et } from "./DataTable-CO5C8Cmb.js";
|
|
6
|
+
import tt from "./vue-ui-accordion-lF7yVkiT.js";
|
|
7
|
+
import ot from "./vue-ui-skeleton-CWjNNx-k.js";
|
|
8
|
+
import { u as ye } from "./useNestedProp-CSVnZVwZ.js";
|
|
9
|
+
import { _ as lt } from "./PackageVersion-DYk2hOG1.js";
|
|
10
|
+
import { P as at } from "./PenAndPaper-BfgS_5ux.js";
|
|
11
11
|
import { _ as nt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
12
12
|
const st = ["id"], rt = {
|
|
13
13
|
key: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-KYU_8xrX.cjs"),me=require("./Title-URF9hufV.cjs"),K=require("./usePrinter-4Zj_RZ5v.cjs"),pe=require("./DataTable-CfxOc-In.cjs"),ge=require("./vue-ui-accordion-C0oMKEv0.cjs"),ke=require("./vue-ui-skeleton-D6mdHYxB.cjs"),Q=require("./useNestedProp-C-g0SLHN.cjs"),ye=require("./PackageVersion-Df1iPzMk.cjs"),be=require("./PenAndPaper-CvGft3ku.cjs"),Ce=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),we=["id"],Ne={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},xe={key:2,style:"width:100%;background:transparent;padding-bottom:24px"},Be=["xmlns","viewBox"],$e=["id"],_e=["stop-color"],Pe=["stop-color"],Ee=["d","fill","stroke","stroke-width"],Se=["x","y","height","width","fill","stroke","stroke-width","onMouseenter"],Te=["x","y","font-size","fill"],Fe=["x","y","font-size","fill"],Le={key:4,class:"vue-data-ui-watermark"},Oe={key:6,ref:"source",dir:"auto"},ze=["innerHTML"],Ie={__name:"vue-ui-flow",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(ee,{expose:te}){const h=ee,{vue_ui_flow:oe}=s.useConfig(),B=e.computed(()=>!!h.dataset&&h.dataset.length);e.onMounted(()=>{O()});function O(){s.objectIsEmpty(h.dataset)&&s.error({componentName:"VueUiFlow",type:"dataset"})}const $=e.ref(s.createUid()),_=e.ref(null),z=e.ref(0),I=e.ref(0),y=e.ref(!1);function le(o){y.value=o,z.value+=1}const t=e.computed({get:()=>V(),set:o=>o});function V(){const o=Q.useNestedProp({userConfig:h.config,defaultConfig:oe});return o.theme?{...Q.useNestedProp({userConfig:s.themes.vue_ui_flow[o.theme]||h.config,defaultConfig:o}),customPalette:s.themePalettes[o.theme]||s.palette}:o}e.watch(()=>h.config,o=>{t.value=V(),O(),I.value+=1},{deep:!0});const{isPrinting:A,isImaging:H,generatePdf:M,generateImage:D}=K.usePrinter({elementId:`flow_${$.value}`,fileName:t.value.style.chart.title.text||"vue-ui-flow"}),ne=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),P=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),q=e.computed(()=>t.value.style.chart.nodes.gap),g=e.computed(()=>t.value.style.chart.nodes.width),b=e.ref({showTable:t.value.table.show}),Y=e.computed(()=>t.value.style.chart.links.width),E=e.computed(()=>!h.dataset||!h.dataset.length?[]:h.dataset.map(o=>[o[0],o[1],s.checkNaN(o[2])])),G=e.computed(()=>{const o={};function n(r){o[r]||(o[r]={inflow:0,outflow:0})}E.value.forEach(([r,a,c])=>{n(r),n(a),o[r].outflow+=c,o[a].inflow+=c});let l=0;for(const r in o){const a=Math.max(o[r].inflow,o[r].outflow);l=Math.max(l,a)}return l});function ae(o){return o/G.value*100+t.value.style.chart.nodes.minHeight}function re(o){const n=t.value.style.chart.nodes.minHeight;return(o-n)/100*G.value}function se(o){const n={},l={};function r(u,i){n[u]||(n[u]={height:0,level:null,inflow:0,outflow:0}),n[u].level===null&&(n[u].level=i),l[i]||(l[i]=[]),l[i].includes(u)||l[i].push(u)}o.forEach(([u,i,v],k)=>{const p=n[u]?n[u].level:0,x=p+1;r(u,p),r(i,x),n[u].children||(n[u].children=[]),n[u].children.push({target:i,value:v}),n[u].outflow+=v,n[i].inflow+=v}),Object.keys(n).forEach((u,i)=>{n[u].color=P.value[i]||P.value[i%P.value.length]||s.palette[i]||s.palette[i%d.length]});for(const u in n)n[u].height=ae(Math.max(n[u].inflow,n[u].outflow)),n[u].name=u;const a={};for(const u in l){let i=0;l[u].forEach((v,k)=>{const p=n[v].height;a[v]={x:parseInt(u,10)*Y.value+t.value.style.chart.padding.left,y:i,absoluteY:i,height:p,i:k,color:n[v].color,value:re(p)},i+=p+q.value})}const c=[];for(const u in n){let i=a[u].absoluteY;n[u].children&&n[u].children.forEach(({target:v,value:k},p)=>{const x=a[v].y,F=a[u],L=a[v],X=s.checkNaN(i),R=s.checkNaN(i+k/n[u].outflow*F.height),Z=s.checkNaN(x),J=s.checkNaN(x+k/n[v].inflow*L.height),fe={id:s.createUid(),source:u,target:v,path:`M ${s.checkNaN(F.x)+s.checkNaN(g.value)} ${X} L ${s.checkNaN(F.x)+s.checkNaN(g.value)} ${R} L ${s.checkNaN(L.x)} ${J} L ${s.checkNaN(L.x)} ${Z} Z`,value:k,sourceColor:n[u].color,targetColor:n[v].color};c.push(fe),i+=R-X,a[v].y+=J-Z})}return{nodeCoordinates:a,links:c}}const f=e.computed(()=>{const o=se(h.dataset);return{nodes:Object.keys(o.nodeCoordinates).map((n,l)=>({...o.nodeCoordinates[n],name:n})),links:o.links}}),ue=e.computed(()=>ie(f.value.nodes));function ie(o){const n={};for(const r in o){const{x:a,height:c}=o[r];n[a]||(n[a]=0),n[a]+=c+q.value}return Math.max(...Object.values(n))}const S=e.computed(()=>{const{top:o,right:n,left:l,bottom:r}=t.value.style.chart.padding,a=E.value.length*Y.value;return{height:ue.value+o+r,width:n+Math.max(...f.value.nodes.map(c=>c.x))+g.value,left:l,top:o,right:a-n,p_top:o,p_bottom:r}});function ce(o){const n={},l={},r=new Set;return E.value.forEach(([a,c,u])=>{n[a]||(n[a]=[]),l[c]||(l[c]=[]),n[a].push(c),l[c].push(a)}),n[o]&&n[o].forEach(a=>r.add(a)),l[o]&&l[o].forEach(a=>r.add(a)),Array.from(r).concat(o)}const m=e.ref(null),C=e.ref(null);function de(o){m.value=ce(o.name),C.value=o.name}function ve(){m.value=null,C.value=null}const U=e.computed(()=>f.value.links.map(({source:o,target:n,sourceColor:l,targetColor:r,value:a})=>({source:o,target:n,sourceColor:l,targetColor:r,value:a})));function j(){e.nextTick(()=>{const o=U.value.map((r,a)=>[[r.source],[r.target],[r.value]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.source],[t.value.table.columnNames.target],[t.value.table.columnNames.value]]].concat(o),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-flow"})})}const w=e.computed(()=>{const o=[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],n=U.value.map((a,c)=>[{color:a.sourceColor,name:a.source},{color:a.targetColor,name:a.target},s.dataLabel({p:t.value.style.chart.nodes.labels.prefix,v:a.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding})]),l={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.source,t.value.table.columnNames.target,t.value.table.columnNames.value],head:o,body:n,config:l}});function he(){return f.value}function W(){b.value.showTable=!b.value.showTable}const N=e.ref(!1);function T(){N.value=!N.value}return te({getData:he,generateCsv:j,generateImage:D,generatePdf:M,toggleTable:W,toggleAnnotator:T}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"flowChart",ref:_,class:e.normalizeClass(`vue-ui-flow ${y.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`flow_${$.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(be.PenAndPaper,{key:0,parent:_.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:N.value,onClose:T},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ne.value?(e.openBlock(),e.createElementBlock("div",Ne,null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",xe,[(e.openBlock(),e.createBlock(me._sfc_main,{key:`title_${I.value}`,config:{title:{cy:"flow-title",...t.value.style.chart.title},subtitle:{cy:"flow-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&B.value?(e.openBlock(),e.createBlock(K.UserOptions,{ref:"details",key:`user_option_${z.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(A),isImaging:e.unref(H),uid:$.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:y.value,titles:{...t.value.userOptions.buttonTitles},chartElement:_.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:N.value,onToggleFullscreen:le,onGeneratePdf:e.unref(M),onGenerateCsv:j,onGenerateImage:e.unref(D),onToggleTable:W,onToggleAnnotator:T},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"4"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:r})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${S.value.width} ${S.value.height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":y.value,"vue-data-ui-fulscreen--off":!y.value}),style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(ye._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.links,(l,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:l.id,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":l.sourceColor},null,8,_e),e.createElementVNode("stop",{offset:"100%","stop-color":l.targetColor},null,8,Pe)],8,$e))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.links,l=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-flow-link",d:l.path,fill:`url(#${l.id})`,stroke:t.value.style.chart.links.stroke,"stroke-width":t.value.style.chart.links.strokeWidth,style:e.normalizeStyle(`opacity:${C.value?[l.target,l.source].includes(C.value)?1:.3:t.value.style.chart.links.opacity}`)},null,12,Ee))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("rect",{class:"vue-ui-flow-node",x:l.x,y:e.unref(s.checkNaN)(l.absoluteY),height:e.unref(s.checkNaN)(l.height),width:g.value,fill:l.color,stroke:t.value.style.chart.nodes.stroke,"stroke-width":t.value.style.chart.nodes.strokeWidth,onMouseenter:a=>de(l),onMouseleave:n[0]||(n[0]=a=>ve()),style:e.normalizeStyle(`opacity:${m.value?m.value.includes(l.name)?1:.2:1}`)},null,44,Se))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+g.value/2,y:e.unref(s.checkNaN)(l.absoluteY+l.height/2-t.value.style.chart.nodes.labels.fontSize/4),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(l.name)?1:0:1}`)},e.toDisplayString(t.value.style.chart.nodes.labels.abbreviation.use?e.unref(s.abbreviate)({source:l.name,length:t.value.style.chart.nodes.labels.abbreviation.length}):l.name),13,Te))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+g.value/2,y:e.unref(s.checkNaN)(l.absoluteY+l.height/2+t.value.style.chart.nodes.labels.fontSize),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(l.name)?1:0:1}`)},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.nodes.labels.formatter,l.value,e.unref(s.dataLabel)({p:t.value.style.chart.nodes.labels.prefix,v:l.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding}),{datapoint:l,seriesIndex:r})),13,Fe))),256)),e.renderSlot(o.$slots,"svg",{svg:S.value},void 0,!0)],14,Be)),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Le,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(A)||e.unref(H)})),void 0,!0)])):e.createCommentVNode("",!0),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ke.default,{key:5,config:{type:"flow",style:{backgroundColor:t.value.style.chart.backgroundColor}}},null,8,["config"])),o.$slots.source?(e.openBlock(),e.createElementBlock("div",Oe,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createBlock(ge.default,{key:7,hideDetails:"",config:{open:b.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.createVNode(pe.DataTable,{colNames:w.value.colNames,head:w.value.head,body:w.value.body,config:w.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:n[1]||(n[1]=l=>b.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,ze)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,we))}},Ve=Ce._export_sfc(Ie,[["__scopeId","data-v-49421974"]]);exports.default=Ve;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-BHQZE19X.cjs"),me=require("./Title-5Vedk01J.cjs"),K=require("./usePrinter-DVgxBO4o.cjs"),pe=require("./DataTable-kMUhutQ4.cjs"),ge=require("./vue-ui-accordion-CRVWlHxs.cjs"),ke=require("./vue-ui-skeleton-DUNkS05l.cjs"),Q=require("./useNestedProp-CwpqC_aE.cjs"),ye=require("./PackageVersion-rnWHRWGI.cjs"),be=require("./PenAndPaper-BQl9-uX0.cjs"),Ce=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),we=["id"],Ne={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},xe={key:2,style:"width:100%;background:transparent;padding-bottom:24px"},Be=["xmlns","viewBox"],$e=["id"],_e=["stop-color"],Pe=["stop-color"],Ee=["d","fill","stroke","stroke-width"],Se=["x","y","height","width","fill","stroke","stroke-width","onMouseenter"],Te=["x","y","font-size","fill"],Fe=["x","y","font-size","fill"],Le={key:4,class:"vue-data-ui-watermark"},Oe={key:6,ref:"source",dir:"auto"},ze=["innerHTML"],Ie={__name:"vue-ui-flow",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(ee,{expose:te}){const h=ee,{vue_ui_flow:oe}=s.useConfig(),B=e.computed(()=>!!h.dataset&&h.dataset.length);e.onMounted(()=>{O()});function O(){s.objectIsEmpty(h.dataset)&&s.error({componentName:"VueUiFlow",type:"dataset"})}const $=e.ref(s.createUid()),_=e.ref(null),z=e.ref(0),I=e.ref(0),y=e.ref(!1);function le(o){y.value=o,z.value+=1}const t=e.computed({get:()=>V(),set:o=>o});function V(){const o=Q.useNestedProp({userConfig:h.config,defaultConfig:oe});return o.theme?{...Q.useNestedProp({userConfig:s.themes.vue_ui_flow[o.theme]||h.config,defaultConfig:o}),customPalette:s.themePalettes[o.theme]||s.palette}:o}e.watch(()=>h.config,o=>{t.value=V(),O(),I.value+=1},{deep:!0});const{isPrinting:A,isImaging:H,generatePdf:M,generateImage:D}=K.usePrinter({elementId:`flow_${$.value}`,fileName:t.value.style.chart.title.text||"vue-ui-flow"}),ne=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),P=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),q=e.computed(()=>t.value.style.chart.nodes.gap),g=e.computed(()=>t.value.style.chart.nodes.width),b=e.ref({showTable:t.value.table.show}),Y=e.computed(()=>t.value.style.chart.links.width),E=e.computed(()=>!h.dataset||!h.dataset.length?[]:h.dataset.map(o=>[o[0],o[1],s.checkNaN(o[2])])),G=e.computed(()=>{const o={};function n(r){o[r]||(o[r]={inflow:0,outflow:0})}E.value.forEach(([r,a,c])=>{n(r),n(a),o[r].outflow+=c,o[a].inflow+=c});let l=0;for(const r in o){const a=Math.max(o[r].inflow,o[r].outflow);l=Math.max(l,a)}return l});function ae(o){return o/G.value*100+t.value.style.chart.nodes.minHeight}function re(o){const n=t.value.style.chart.nodes.minHeight;return(o-n)/100*G.value}function se(o){const n={},l={};function r(u,i){n[u]||(n[u]={height:0,level:null,inflow:0,outflow:0}),n[u].level===null&&(n[u].level=i),l[i]||(l[i]=[]),l[i].includes(u)||l[i].push(u)}o.forEach(([u,i,v],k)=>{const p=n[u]?n[u].level:0,x=p+1;r(u,p),r(i,x),n[u].children||(n[u].children=[]),n[u].children.push({target:i,value:v}),n[u].outflow+=v,n[i].inflow+=v}),Object.keys(n).forEach((u,i)=>{n[u].color=P.value[i]||P.value[i%P.value.length]||s.palette[i]||s.palette[i%d.length]});for(const u in n)n[u].height=ae(Math.max(n[u].inflow,n[u].outflow)),n[u].name=u;const a={};for(const u in l){let i=0;l[u].forEach((v,k)=>{const p=n[v].height;a[v]={x:parseInt(u,10)*Y.value+t.value.style.chart.padding.left,y:i,absoluteY:i,height:p,i:k,color:n[v].color,value:re(p)},i+=p+q.value})}const c=[];for(const u in n){let i=a[u].absoluteY;n[u].children&&n[u].children.forEach(({target:v,value:k},p)=>{const x=a[v].y,F=a[u],L=a[v],X=s.checkNaN(i),R=s.checkNaN(i+k/n[u].outflow*F.height),Z=s.checkNaN(x),J=s.checkNaN(x+k/n[v].inflow*L.height),fe={id:s.createUid(),source:u,target:v,path:`M ${s.checkNaN(F.x)+s.checkNaN(g.value)} ${X} L ${s.checkNaN(F.x)+s.checkNaN(g.value)} ${R} L ${s.checkNaN(L.x)} ${J} L ${s.checkNaN(L.x)} ${Z} Z`,value:k,sourceColor:n[u].color,targetColor:n[v].color};c.push(fe),i+=R-X,a[v].y+=J-Z})}return{nodeCoordinates:a,links:c}}const f=e.computed(()=>{const o=se(h.dataset);return{nodes:Object.keys(o.nodeCoordinates).map((n,l)=>({...o.nodeCoordinates[n],name:n})),links:o.links}}),ue=e.computed(()=>ie(f.value.nodes));function ie(o){const n={};for(const r in o){const{x:a,height:c}=o[r];n[a]||(n[a]=0),n[a]+=c+q.value}return Math.max(...Object.values(n))}const S=e.computed(()=>{const{top:o,right:n,left:l,bottom:r}=t.value.style.chart.padding,a=E.value.length*Y.value;return{height:ue.value+o+r,width:n+Math.max(...f.value.nodes.map(c=>c.x))+g.value,left:l,top:o,right:a-n,p_top:o,p_bottom:r}});function ce(o){const n={},l={},r=new Set;return E.value.forEach(([a,c,u])=>{n[a]||(n[a]=[]),l[c]||(l[c]=[]),n[a].push(c),l[c].push(a)}),n[o]&&n[o].forEach(a=>r.add(a)),l[o]&&l[o].forEach(a=>r.add(a)),Array.from(r).concat(o)}const m=e.ref(null),C=e.ref(null);function de(o){m.value=ce(o.name),C.value=o.name}function ve(){m.value=null,C.value=null}const U=e.computed(()=>f.value.links.map(({source:o,target:n,sourceColor:l,targetColor:r,value:a})=>({source:o,target:n,sourceColor:l,targetColor:r,value:a})));function j(){e.nextTick(()=>{const o=U.value.map((r,a)=>[[r.source],[r.target],[r.value]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.source],[t.value.table.columnNames.target],[t.value.table.columnNames.value]]].concat(o),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-flow"})})}const w=e.computed(()=>{const o=[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],n=U.value.map((a,c)=>[{color:a.sourceColor,name:a.source},{color:a.targetColor,name:a.target},s.dataLabel({p:t.value.style.chart.nodes.labels.prefix,v:a.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding})]),l={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.source,t.value.table.columnNames.target,t.value.table.columnNames.value],head:o,body:n,config:l}});function he(){return f.value}function W(){b.value.showTable=!b.value.showTable}const N=e.ref(!1);function T(){N.value=!N.value}return te({getData:he,generateCsv:j,generateImage:D,generatePdf:M,toggleTable:W,toggleAnnotator:T}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"flowChart",ref:_,class:e.normalizeClass(`vue-ui-flow ${y.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`flow_${$.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(be.PenAndPaper,{key:0,parent:_.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:N.value,onClose:T},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ne.value?(e.openBlock(),e.createElementBlock("div",Ne,null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",xe,[(e.openBlock(),e.createBlock(me._sfc_main,{key:`title_${I.value}`,config:{title:{cy:"flow-title",...t.value.style.chart.title},subtitle:{cy:"flow-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&B.value?(e.openBlock(),e.createBlock(K.UserOptions,{ref:"details",key:`user_option_${z.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(A),isImaging:e.unref(H),uid:$.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:y.value,titles:{...t.value.userOptions.buttonTitles},chartElement:_.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:N.value,onToggleFullscreen:le,onGeneratePdf:e.unref(M),onGenerateCsv:j,onGenerateImage:e.unref(D),onToggleTable:W,onToggleAnnotator:T},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"4"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:r})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${S.value.width} ${S.value.height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":y.value,"vue-data-ui-fulscreen--off":!y.value}),style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(ye._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.links,(l,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:l.id,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":l.sourceColor},null,8,_e),e.createElementVNode("stop",{offset:"100%","stop-color":l.targetColor},null,8,Pe)],8,$e))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.links,l=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-flow-link",d:l.path,fill:`url(#${l.id})`,stroke:t.value.style.chart.links.stroke,"stroke-width":t.value.style.chart.links.strokeWidth,style:e.normalizeStyle(`opacity:${C.value?[l.target,l.source].includes(C.value)?1:.3:t.value.style.chart.links.opacity}`)},null,12,Ee))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("rect",{class:"vue-ui-flow-node",x:l.x,y:e.unref(s.checkNaN)(l.absoluteY),height:e.unref(s.checkNaN)(l.height),width:g.value,fill:l.color,stroke:t.value.style.chart.nodes.stroke,"stroke-width":t.value.style.chart.nodes.strokeWidth,onMouseenter:a=>de(l),onMouseleave:n[0]||(n[0]=a=>ve()),style:e.normalizeStyle(`opacity:${m.value?m.value.includes(l.name)?1:.2:1}`)},null,44,Se))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+g.value/2,y:e.unref(s.checkNaN)(l.absoluteY+l.height/2-t.value.style.chart.nodes.labels.fontSize/4),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(l.name)?1:0:1}`)},e.toDisplayString(t.value.style.chart.nodes.labels.abbreviation.use?e.unref(s.abbreviate)({source:l.name,length:t.value.style.chart.nodes.labels.abbreviation.length}):l.name),13,Te))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+g.value/2,y:e.unref(s.checkNaN)(l.absoluteY+l.height/2+t.value.style.chart.nodes.labels.fontSize),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(l.name)?1:0:1}`)},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.nodes.labels.formatter,l.value,e.unref(s.dataLabel)({p:t.value.style.chart.nodes.labels.prefix,v:l.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding}),{datapoint:l,seriesIndex:r})),13,Fe))),256)),e.renderSlot(o.$slots,"svg",{svg:S.value},void 0,!0)],14,Be)),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Le,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(A)||e.unref(H)})),void 0,!0)])):e.createCommentVNode("",!0),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ke.default,{key:5,config:{type:"flow",style:{backgroundColor:t.value.style.chart.backgroundColor}}},null,8,["config"])),o.$slots.source?(e.openBlock(),e.createElementBlock("div",Oe,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createBlock(ge.default,{key:7,hideDetails:"",config:{open:b.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.createVNode(pe.DataTable,{colNames:w.value.colNames,head:w.value.head,body:w.value.body,config:w.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:n[1]||(n[1]=l=>b.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,ze)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,we))}},Ve=Ce._export_sfc(Ie,[["__scopeId","data-v-49421974"]]);exports.default=Ve;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-KYU_8xrX.cjs"),H=require("./useNestedProp-C-g0SLHN.cjs"),X=require("./usePrinter-4Zj_RZ5v.cjs"),oe=require("./Title-URF9hufV.cjs"),re=require("./PenAndPaper-CvGft3ku.cjs"),ne=require("./DataTable-CfxOc-In.cjs"),se=require("./vue-ui-accordion-C0oMKEv0.cjs"),Y=require("./useResponsive-BJ7DTGpm.cjs"),ue=require("./vue-ui-skeleton-D6mdHYxB.cjs"),ie=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ce=["id"],ve=["xmlns","viewBox"],de=["id"],he=["stop-color"],me=["stop-color"],fe=["stop-color"],pe=["stroke","stroke-width"],be=["stroke","stroke-width"],ye=["x","y","font-size","fill","font-weight"],ge=["points","fill"],ke=["stroke","stroke-width","rx"],Ce=["x","y","font-size","fill","font-weight"],we=["x","y","font-size","fill","font-weight"],xe={key:5,class:"vue-data-ui-watermark"},Le=["innerHTML"],Be={__name:"vue-ui-funnel",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(W,{expose:J}){const d=W;e.useCssVars(l=>({"0dcc78a9":ae.value}));const{vue_ui_funnel:K}=r.useConfig(),b=e.computed(()=>!!d.dataset&&d.dataset.length);e.onMounted(S);function S(){if(r.objectIsEmpty(d.dataset)?r.error({componentName:"VueUiFunnel",type:"dataset"}):d.dataset.forEach((l,o)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(a=>{b.value=!1,r.error({componentName:"VueUiFunnel",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=Y.throttle(()=>{const{width:o,height:a}=Y.useResponsive({chart:g.value,title:t.value.style.chart.title.text?V.value:null,source:E.value,noTitle:P.value});c.value.height=a,c.value.width=o,m.value=R(),u.value.circles=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.circles.dataLabels.fontSize,threshold:10,fallback:10}),u.value.names=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.bars.dataLabels.name.fontSize,threshold:10,fallback:10}),u.value.values=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.bars.dataLabels.value.fontSize,threshold:10,fallback:10})});D.value=new ResizeObserver(l),D.value.observe(g.value.parentNode)}}const g=e.ref(null),k=e.ref(r.createUid()),z=e.ref(0),T=e.ref(0),A=e.ref(0),P=e.ref(null),E=e.ref(null),V=e.ref(null),D=e.ref(null),f=e.ref(!1);function F(){const l=H.useNestedProp({userConfig:d.config,defaultConfig:K});return l.theme?{...H.useNestedProp({userConfig:r.themes.vue_ui_funnel[l.theme]||d.config,defaultConfig:l})}:l}const t=e.computed({get:()=>F(),set:l=>l});e.watch(()=>d.config,l=>{t.value=F(),S(),T.value+=1,A.value+=1,u.value.circles=t.value.style.chart.circles.dataLabels.fontSize,u.value.names=t.value.style.chart.bars.dataLabels.name.fontSize,u.value.values=t.value.style.chart.bars.dataLabels.value.fontSize},{deep:!0});const{isPrinting:O,isImaging:I,generatePdf:q,generateImage:M}=X.usePrinter({elementId:`funnel_${k.value}`,fileName:t.value.style.chart.title.text||"vue-ui-funnel"}),Q=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),L=e.ref({showTable:t.value.table.show}),u=e.ref({circles:t.value.style.chart.circles.dataLabels.fontSize,names:t.value.style.chart.bars.dataLabels.name.fontSize,values:t.value.style.chart.bars.dataLabels.value.fontSize}),c=e.computed({get:()=>({height:t.value.style.chart.height,width:t.value.style.chart.width}),set:l=>l}),h=e.computed(()=>b.value?d.dataset.map((l,o)=>({...l,color:l.color?r.convertColorToHex(l.color):r.lightenHexColor(t.value.style.chart.bars.defaultColor,o/d.dataset.length)})):[]);setTimeout(()=>{f.value=!0},h.value.length*150);function R(){const l=t.value.style.chart.padding.left,o=t.value.style.chart.padding.top;return{left:l,top:o,right:c.value.width-t.value.style.chart.padding.right,bottom:c.value.height-t.value.style.chart.padding.bottom,width:c.value.width-l-t.value.style.chart.padding.right,height:c.value.height-o-t.value.style.chart.padding.bottom}}const m=e.ref(R()),y=e.computed(()=>m.value.height/d.dataset.length),p=e.computed(()=>y.value*t.value.style.chart.bars.gapRatio),G=e.computed(()=>m.value.width*t.value.style.chart.barCircleSpacingRatio),n=e.computed(()=>h.value.map((l,o)=>{const a=y.value-p.value,s=m.value.top+p.value/2*o+(y.value-p.value/2)*o+p.value/2,v=l.value/h.value[0].value,i=(m.value.width-a-G.value)*(l.value/h.value[0].value);return{...l,cx:m.value.left+a/2,cy:s+a/2,datapointIndex:o,fill:l.color,height:Math.max(a,0),proportion:v,r:Math.max(a/2,0),width:Math.max(i,0),x:m.value.left+a+G.value,y:s}})),Z=e.computed(()=>{const l=n.value.map(o=>`${o.x+o.width},${o.y+(y.value-p.value)/2}`);return`${n.value[0].x},${n.value[0].y+(y.value-p.value)/2} ${l.toString()} ${n.value.at(-1).x},${n.value.at(-1).y+(y.value-p.value)/2}`}),ee=e.computed(()=>({x1:n.value[0].cx,y1:n.value[0].cy,x2:n.value.at(-1).cx,y2:n.value.at(-1).cy})),C=e.ref(!1);function te(l){C.value=l,z.value+=1}const ae=e.computed(()=>`${h.value.length*150}ms`),B=e.ref(!1);function $(){B.value=!B.value}function U(){L.value.showTable=!L.value.showTable}const w=e.computed(()=>{const l=h.value.map(a=>({name:a.name,color:a.color})),o=h.value.map(a=>a.value);return{head:l,body:o}}),_=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],o=w.value.head.map((v,i)=>{const x=r.applyDataLabel(t.value.style.chart.bars.dataLabels.value.formatter,w.value.body[i],r.dataLabel({p:t.value.style.chart.bars.dataLabels.value.prefix,v:w.value.body[i],s:t.value.style.chart.bars.dataLabels.value.suffix,r:t.value.table.td.roundingValue}),{datapoint:n.value[i]}),N=r.applyDataLabel(t.value.style.chart.circles.dataLabels.formatter,n.value[i].proportion*100,r.dataLabel({v:n.value[i].proportion*100,s:"%",r:t.value.table.td.roundingPercentage}),{datapoint:n.value[i]});return[{color:v.color,name:v.name},x,N]}),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],head:l,body:o,config:a}});function j(){e.nextTick(()=>{const l=w.value.head.map((s,v)=>[[s.name],[w.value.body[v]],[n.value[v].proportion*100]]),o=[[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=r.createCsvContent(o);r.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-funnel"})})}function le(){return h.value}return J({getData:le,generatePdf:q,generateCsv:j,generateImage:M,toggleTable:U,toggleAnnotator:$}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"funnelChart",ref:g,class:e.normalizeClass(`vue-ui-funnel ${C.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height:100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`funnel_${k.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(re.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:$},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Q.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:P,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:V,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(oe._sfc_main,{key:`title_${T.value}`,config:{title:{cy:"funnel-div-title",...t.value.style.chart.title},subtitle:{cy:"funnel-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(X.UserOptions,{ref:"details",key:`user_option_${z.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(O),isImaging:e.unref(I),uid:k.value,hasTooltip:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasLabel:!1,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:C.value,chartElement:g.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleAnnotator:$,onToggleFullscreen:te,onGeneratePdf:e.unref(q),onGenerateImage:e.unref(M),onToggleTable:U,onGenerateCsv:j},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:s})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:s})),void 0,!0)]),key:"4"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:s})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:s})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","chartElement","position","titles","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.value}),viewBox:`0 0 ${c.value.width<=0?10:c.value.width} ${c.value.height<=0?10:c.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`funnel_area_${k.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.backgroundColor,"stop-opacity":0},null,8,he),e.createElementVNode("stop",{offset:"20%","stop-color":t.value.style.chart.area.color},null,8,me),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.area.color},null,8,fe)],8,de)]),t.value.style.chart.circleLinks.show?(e.openBlock(),e.createElementBlock("line",e.mergeProps({key:0},ee.value,{stroke:t.value.style.chart.circleLinks.color,"stroke-width":12*t.value.style.chart.circleLinks.widthRatio,"stroke-linecap":"round",class:{animated:t.value.useCssAnimation},style:{strokeDasharray:t.value.useCssAnimation?m.value.height:0,strokeDashoffset:t.value.useCssAnimation?m.value.height:0}}),null,16,pe)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,({cx:a,cy:s,r:v,fill:i},x)=>(e.openBlock(),e.createElementBlock("circle",e.mergeProps({cx:a,cy:s,r:v,fill:i},{stroke:t.value.style.chart.circles.stroke,"stroke-width":t.value.style.chart.circles.strokeWidth,class:{animated:t.value.useCssAnimation&&!f.value},style:{animationDelay:`${150*x}ms`}}),null,16,be))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(a,s)=>(e.openBlock(),e.createElementBlock("text",{x:a.cx,y:a.cy+u.value.circles/3+t.value.style.chart.circles.dataLabels.offsetY,"text-anchor":"middle","font-size":u.value.circles,fill:t.value.style.chart.circles.dataLabels.adaptColorToBackground?e.unref(r.adaptColorToBackground)(a.color):t.value.style.chart.circles.dataLabels.color,"font-weight":t.value.style.chart.circles.dataLabels.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.circles.dataLabels.formatter,a.proportion*100,e.unref(r.dataLabel)({v:a.proportion*100,s:"%",r:t.value.style.chart.circles.dataLabels.rounding}),{datapoint:a})),15,ye))),256)),t.value.style.chart.area.show?(e.openBlock(),e.createElementBlock("polygon",{key:1,points:Z.value,fill:`url(#funnel_area_${k.value})`,class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({transition:t.value.useCssAnimation?`all ${150*h.value.length}ms ease-in`:"none"})},null,14,ge)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,({x:a,y:s,height:v,width:i,fill:x},N)=>(e.openBlock(),e.createElementBlock("rect",e.mergeProps({x:a,y:s,height:v,width:i,fill:x},{stroke:t.value.style.chart.bars.stroke,"stroke-width":t.value.style.chart.bars.strokeWidth,rx:t.value.style.chart.bars.borderRadius,class:{animated:t.value.useCssAnimation&&!f.value},style:{animationDelay:`${150*N}ms`}}),null,16,ke))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(a,s)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("text",{x:a.x+a.width+t.value.style.chart.bars.dataLabels.name.offsetX+12,y:a.cy-u.value.names/2+t.value.style.chart.bars.dataLabels.name.offsetY,"text-anchor":"start","font-size":u.value.names,fill:t.value.style.chart.bars.dataLabels.name.color,"font-weight":t.value.style.chart.bars.dataLabels.name.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(a.name),15,Ce),e.createElementVNode("text",{x:a.x+a.width+t.value.style.chart.bars.dataLabels.value.offsetX+12,y:a.cy+u.value.values+t.value.style.chart.bars.dataLabels.value.offsetY,"text-anchor":"start","font-size":u.value.values,fill:t.value.style.chart.bars.dataLabels.value.color,"font-weight":t.value.style.chart.bars.dataLabels.value.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.bars.dataLabels.value.formatter,a.value,e.unref(r.dataLabel)({p:t.value.style.chart.bars.dataLabels.value.prefix,v:a.value,s:t.value.style.chart.bars.dataLabels.value.suffix,r:t.value.style.chart.bars.dataLabels.value.rounding}),{datapoint:a})),15,we)]))),256)),e.renderSlot(l.$slots,"svg",{svg:c.value},void 0,!0)],14,ve)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",xe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(O)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ue.default,{key:6,config:{type:"verticalBar",style:{backgroundColor:t.value.style.chart.backgroundColor,verticalBar:{axis:{color:"#CCCCCC"},color:"#CCCCCC"}}}},null,8,["config"])),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:E,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createBlock(se.default,{key:8,hideDetails:"",config:{open:L.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(ne.DataTable,{key:`table_${A.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:o[0]||(o[0]=a=>L.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,Le)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name?a.name:a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,ce))}},_e=ie._export_sfc(Be,[["__scopeId","data-v-51a14bf0"]]);exports.default=_e;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-BHQZE19X.cjs"),H=require("./useNestedProp-CwpqC_aE.cjs"),X=require("./usePrinter-DVgxBO4o.cjs"),oe=require("./Title-5Vedk01J.cjs"),re=require("./PenAndPaper-BQl9-uX0.cjs"),ne=require("./DataTable-kMUhutQ4.cjs"),se=require("./vue-ui-accordion-CRVWlHxs.cjs"),Y=require("./useResponsive-BJ7DTGpm.cjs"),ue=require("./vue-ui-skeleton-DUNkS05l.cjs"),ie=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ce=["id"],ve=["xmlns","viewBox"],de=["id"],he=["stop-color"],me=["stop-color"],fe=["stop-color"],pe=["stroke","stroke-width"],be=["stroke","stroke-width"],ye=["x","y","font-size","fill","font-weight"],ge=["points","fill"],ke=["stroke","stroke-width","rx"],Ce=["x","y","font-size","fill","font-weight"],we=["x","y","font-size","fill","font-weight"],xe={key:5,class:"vue-data-ui-watermark"},Le=["innerHTML"],Be={__name:"vue-ui-funnel",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(W,{expose:J}){const d=W;e.useCssVars(l=>({"0dcc78a9":ae.value}));const{vue_ui_funnel:K}=r.useConfig(),b=e.computed(()=>!!d.dataset&&d.dataset.length);e.onMounted(S);function S(){if(r.objectIsEmpty(d.dataset)?r.error({componentName:"VueUiFunnel",type:"dataset"}):d.dataset.forEach((l,o)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(a=>{b.value=!1,r.error({componentName:"VueUiFunnel",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=Y.throttle(()=>{const{width:o,height:a}=Y.useResponsive({chart:g.value,title:t.value.style.chart.title.text?V.value:null,source:E.value,noTitle:P.value});c.value.height=a,c.value.width=o,m.value=R(),u.value.circles=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.circles.dataLabels.fontSize,threshold:10,fallback:10}),u.value.names=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.bars.dataLabels.name.fontSize,threshold:10,fallback:10}),u.value.values=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.bars.dataLabels.value.fontSize,threshold:10,fallback:10})});D.value=new ResizeObserver(l),D.value.observe(g.value.parentNode)}}const g=e.ref(null),k=e.ref(r.createUid()),z=e.ref(0),T=e.ref(0),A=e.ref(0),P=e.ref(null),E=e.ref(null),V=e.ref(null),D=e.ref(null),f=e.ref(!1);function F(){const l=H.useNestedProp({userConfig:d.config,defaultConfig:K});return l.theme?{...H.useNestedProp({userConfig:r.themes.vue_ui_funnel[l.theme]||d.config,defaultConfig:l})}:l}const t=e.computed({get:()=>F(),set:l=>l});e.watch(()=>d.config,l=>{t.value=F(),S(),T.value+=1,A.value+=1,u.value.circles=t.value.style.chart.circles.dataLabels.fontSize,u.value.names=t.value.style.chart.bars.dataLabels.name.fontSize,u.value.values=t.value.style.chart.bars.dataLabels.value.fontSize},{deep:!0});const{isPrinting:O,isImaging:I,generatePdf:q,generateImage:M}=X.usePrinter({elementId:`funnel_${k.value}`,fileName:t.value.style.chart.title.text||"vue-ui-funnel"}),Q=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),L=e.ref({showTable:t.value.table.show}),u=e.ref({circles:t.value.style.chart.circles.dataLabels.fontSize,names:t.value.style.chart.bars.dataLabels.name.fontSize,values:t.value.style.chart.bars.dataLabels.value.fontSize}),c=e.computed({get:()=>({height:t.value.style.chart.height,width:t.value.style.chart.width}),set:l=>l}),h=e.computed(()=>b.value?d.dataset.map((l,o)=>({...l,color:l.color?r.convertColorToHex(l.color):r.lightenHexColor(t.value.style.chart.bars.defaultColor,o/d.dataset.length)})):[]);setTimeout(()=>{f.value=!0},h.value.length*150);function R(){const l=t.value.style.chart.padding.left,o=t.value.style.chart.padding.top;return{left:l,top:o,right:c.value.width-t.value.style.chart.padding.right,bottom:c.value.height-t.value.style.chart.padding.bottom,width:c.value.width-l-t.value.style.chart.padding.right,height:c.value.height-o-t.value.style.chart.padding.bottom}}const m=e.ref(R()),y=e.computed(()=>m.value.height/d.dataset.length),p=e.computed(()=>y.value*t.value.style.chart.bars.gapRatio),G=e.computed(()=>m.value.width*t.value.style.chart.barCircleSpacingRatio),n=e.computed(()=>h.value.map((l,o)=>{const a=y.value-p.value,s=m.value.top+p.value/2*o+(y.value-p.value/2)*o+p.value/2,v=l.value/h.value[0].value,i=(m.value.width-a-G.value)*(l.value/h.value[0].value);return{...l,cx:m.value.left+a/2,cy:s+a/2,datapointIndex:o,fill:l.color,height:Math.max(a,0),proportion:v,r:Math.max(a/2,0),width:Math.max(i,0),x:m.value.left+a+G.value,y:s}})),Z=e.computed(()=>{const l=n.value.map(o=>`${o.x+o.width},${o.y+(y.value-p.value)/2}`);return`${n.value[0].x},${n.value[0].y+(y.value-p.value)/2} ${l.toString()} ${n.value.at(-1).x},${n.value.at(-1).y+(y.value-p.value)/2}`}),ee=e.computed(()=>({x1:n.value[0].cx,y1:n.value[0].cy,x2:n.value.at(-1).cx,y2:n.value.at(-1).cy})),C=e.ref(!1);function te(l){C.value=l,z.value+=1}const ae=e.computed(()=>`${h.value.length*150}ms`),B=e.ref(!1);function $(){B.value=!B.value}function U(){L.value.showTable=!L.value.showTable}const w=e.computed(()=>{const l=h.value.map(a=>({name:a.name,color:a.color})),o=h.value.map(a=>a.value);return{head:l,body:o}}),_=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],o=w.value.head.map((v,i)=>{const x=r.applyDataLabel(t.value.style.chart.bars.dataLabels.value.formatter,w.value.body[i],r.dataLabel({p:t.value.style.chart.bars.dataLabels.value.prefix,v:w.value.body[i],s:t.value.style.chart.bars.dataLabels.value.suffix,r:t.value.table.td.roundingValue}),{datapoint:n.value[i]}),N=r.applyDataLabel(t.value.style.chart.circles.dataLabels.formatter,n.value[i].proportion*100,r.dataLabel({v:n.value[i].proportion*100,s:"%",r:t.value.table.td.roundingPercentage}),{datapoint:n.value[i]});return[{color:v.color,name:v.name},x,N]}),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],head:l,body:o,config:a}});function j(){e.nextTick(()=>{const l=w.value.head.map((s,v)=>[[s.name],[w.value.body[v]],[n.value[v].proportion*100]]),o=[[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=r.createCsvContent(o);r.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-funnel"})})}function le(){return h.value}return J({getData:le,generatePdf:q,generateCsv:j,generateImage:M,toggleTable:U,toggleAnnotator:$}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"funnelChart",ref:g,class:e.normalizeClass(`vue-ui-funnel ${C.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height:100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`funnel_${k.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(re.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:$},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Q.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:P,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:V,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(oe._sfc_main,{key:`title_${T.value}`,config:{title:{cy:"funnel-div-title",...t.value.style.chart.title},subtitle:{cy:"funnel-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(X.UserOptions,{ref:"details",key:`user_option_${z.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(O),isImaging:e.unref(I),uid:k.value,hasTooltip:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasLabel:!1,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:C.value,chartElement:g.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleAnnotator:$,onToggleFullscreen:te,onGeneratePdf:e.unref(q),onGenerateImage:e.unref(M),onToggleTable:U,onGenerateCsv:j},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:s})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:s})),void 0,!0)]),key:"4"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:s})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:s})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","chartElement","position","titles","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.value}),viewBox:`0 0 ${c.value.width<=0?10:c.value.width} ${c.value.height<=0?10:c.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`funnel_area_${k.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.backgroundColor,"stop-opacity":0},null,8,he),e.createElementVNode("stop",{offset:"20%","stop-color":t.value.style.chart.area.color},null,8,me),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.area.color},null,8,fe)],8,de)]),t.value.style.chart.circleLinks.show?(e.openBlock(),e.createElementBlock("line",e.mergeProps({key:0},ee.value,{stroke:t.value.style.chart.circleLinks.color,"stroke-width":12*t.value.style.chart.circleLinks.widthRatio,"stroke-linecap":"round",class:{animated:t.value.useCssAnimation},style:{strokeDasharray:t.value.useCssAnimation?m.value.height:0,strokeDashoffset:t.value.useCssAnimation?m.value.height:0}}),null,16,pe)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,({cx:a,cy:s,r:v,fill:i},x)=>(e.openBlock(),e.createElementBlock("circle",e.mergeProps({cx:a,cy:s,r:v,fill:i},{stroke:t.value.style.chart.circles.stroke,"stroke-width":t.value.style.chart.circles.strokeWidth,class:{animated:t.value.useCssAnimation&&!f.value},style:{animationDelay:`${150*x}ms`}}),null,16,be))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(a,s)=>(e.openBlock(),e.createElementBlock("text",{x:a.cx,y:a.cy+u.value.circles/3+t.value.style.chart.circles.dataLabels.offsetY,"text-anchor":"middle","font-size":u.value.circles,fill:t.value.style.chart.circles.dataLabels.adaptColorToBackground?e.unref(r.adaptColorToBackground)(a.color):t.value.style.chart.circles.dataLabels.color,"font-weight":t.value.style.chart.circles.dataLabels.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.circles.dataLabels.formatter,a.proportion*100,e.unref(r.dataLabel)({v:a.proportion*100,s:"%",r:t.value.style.chart.circles.dataLabels.rounding}),{datapoint:a})),15,ye))),256)),t.value.style.chart.area.show?(e.openBlock(),e.createElementBlock("polygon",{key:1,points:Z.value,fill:`url(#funnel_area_${k.value})`,class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({transition:t.value.useCssAnimation?`all ${150*h.value.length}ms ease-in`:"none"})},null,14,ge)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,({x:a,y:s,height:v,width:i,fill:x},N)=>(e.openBlock(),e.createElementBlock("rect",e.mergeProps({x:a,y:s,height:v,width:i,fill:x},{stroke:t.value.style.chart.bars.stroke,"stroke-width":t.value.style.chart.bars.strokeWidth,rx:t.value.style.chart.bars.borderRadius,class:{animated:t.value.useCssAnimation&&!f.value},style:{animationDelay:`${150*N}ms`}}),null,16,ke))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(a,s)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("text",{x:a.x+a.width+t.value.style.chart.bars.dataLabels.name.offsetX+12,y:a.cy-u.value.names/2+t.value.style.chart.bars.dataLabels.name.offsetY,"text-anchor":"start","font-size":u.value.names,fill:t.value.style.chart.bars.dataLabels.name.color,"font-weight":t.value.style.chart.bars.dataLabels.name.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(a.name),15,Ce),e.createElementVNode("text",{x:a.x+a.width+t.value.style.chart.bars.dataLabels.value.offsetX+12,y:a.cy+u.value.values+t.value.style.chart.bars.dataLabels.value.offsetY,"text-anchor":"start","font-size":u.value.values,fill:t.value.style.chart.bars.dataLabels.value.color,"font-weight":t.value.style.chart.bars.dataLabels.value.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.bars.dataLabels.value.formatter,a.value,e.unref(r.dataLabel)({p:t.value.style.chart.bars.dataLabels.value.prefix,v:a.value,s:t.value.style.chart.bars.dataLabels.value.suffix,r:t.value.style.chart.bars.dataLabels.value.rounding}),{datapoint:a})),15,we)]))),256)),e.renderSlot(l.$slots,"svg",{svg:c.value},void 0,!0)],14,ve)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",xe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(O)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ue.default,{key:6,config:{type:"verticalBar",style:{backgroundColor:t.value.style.chart.backgroundColor,verticalBar:{axis:{color:"#CCCCCC"},color:"#CCCCCC"}}}},null,8,["config"])),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:E,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createBlock(se.default,{key:8,hideDetails:"",config:{open:L.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(ne.DataTable,{key:`table_${A.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:o[0]||(o[0]=a=>L.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,Le)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name?a.name:a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,ce))}},_e=ie._export_sfc(Be,[["__scopeId","data-v-51a14bf0"]]);exports.default=_e;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useCssVars as we, computed as i, onMounted as xe, ref as u, watch as $e, openBlock as s, createElementBlock as r, normalizeClass as L, normalizeStyle as T, createBlock as A, createCommentVNode as m, unref as d, createSlots as _e, withCtx as p, renderSlot as k, normalizeProps as X, guardReactiveProps as j, createElementVNode as C, mergeProps as H, Fragment as M, renderList as B, toDisplayString as G, createTextVNode as Le, nextTick as Te } from "vue";
|
|
2
|
-
import { u as Ae, o as Ne, e as ve, g as ze, c as Pe, d as Se, l as Fe, i as R, f as E, X as Oe, G as De, t as Ie, q as Me, r as Be, F as Y } from "./index-
|
|
3
|
-
import { u as de } from "./useNestedProp-
|
|
4
|
-
import { u as Ge, U as Re } from "./usePrinter-
|
|
5
|
-
import { _ as Ee } from "./Title-
|
|
6
|
-
import { P as Ve } from "./PenAndPaper-
|
|
7
|
-
import { D as Ue } from "./DataTable-
|
|
8
|
-
import Xe from "./vue-ui-accordion-
|
|
2
|
+
import { u as Ae, o as Ne, e as ve, g as ze, c as Pe, d as Se, l as Fe, i as R, f as E, X as Oe, G as De, t as Ie, q as Me, r as Be, F as Y } from "./index-igxqCP2w.js";
|
|
3
|
+
import { u as de } from "./useNestedProp-CSVnZVwZ.js";
|
|
4
|
+
import { u as Ge, U as Re } from "./usePrinter-CnZYDQXB.js";
|
|
5
|
+
import { _ as Ee } from "./Title-DED-PQ7X.js";
|
|
6
|
+
import { P as Ve } from "./PenAndPaper-BfgS_5ux.js";
|
|
7
|
+
import { D as Ue } from "./DataTable-CO5C8Cmb.js";
|
|
8
|
+
import Xe from "./vue-ui-accordion-lF7yVkiT.js";
|
|
9
9
|
import { t as je, u as He } from "./useResponsive-CoxXLe23.js";
|
|
10
|
-
import Ye from "./vue-ui-skeleton-
|
|
10
|
+
import Ye from "./vue-ui-skeleton-CWjNNx-k.js";
|
|
11
11
|
import { _ as qe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
12
12
|
const We = ["id"], Je = ["xmlns", "viewBox"], Ke = ["id"], Qe = ["stop-color"], Ze = ["stop-color"], et = ["stop-color"], tt = ["stroke", "stroke-width"], at = ["stroke", "stroke-width"], lt = ["x", "y", "font-size", "fill", "font-weight"], st = ["points", "fill"], ot = ["stroke", "stroke-width", "rx"], nt = ["x", "y", "font-size", "fill", "font-weight"], rt = ["x", "y", "font-size", "fill", "font-weight"], ut = {
|
|
13
13
|
key: 5,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as d, onMounted as Se, ref as u, watch as Ne, openBlock as o, createElementBlock as n, normalizeClass as A, normalizeStyle as H, createBlock as $, createCommentVNode as i, unref as p, createSlots as Le, withCtx as c, renderSlot as v, normalizeProps as S, guardReactiveProps as N, createVNode as re, createElementVNode as _, Fragment as ue, renderList as ne, createTextVNode as ie, toDisplayString as E, nextTick as Oe } from "vue";
|
|
2
|
-
import { u as Fe, o as Ie, e as ce, g as Ae, c as ve, t as Ee, a as De, p as D, b as Ve, d as Be, J as de, M as Ge, f as k, X as Me, i as he, x as pe, y as ze, q as We, r as He } from "./index-
|
|
3
|
-
import { L as Ue } from "./Legend-
|
|
4
|
-
import { _ as Xe } from "./Title-
|
|
5
|
-
import { _ as Re } from "./Tooltip-
|
|
6
|
-
import { D as Ye } from "./DataTable-
|
|
7
|
-
import { u as je, U as qe } from "./usePrinter-
|
|
8
|
-
import Je from "./vue-ui-skeleton-
|
|
9
|
-
import Ke from "./vue-ui-accordion-
|
|
10
|
-
import { u as ye } from "./useNestedProp-
|
|
11
|
-
import { _ as Qe } from "./PackageVersion-
|
|
12
|
-
import { P as Ze } from "./PenAndPaper-
|
|
2
|
+
import { u as Fe, o as Ie, e as ce, g as Ae, c as ve, t as Ee, a as De, p as D, b as Ve, d as Be, J as de, M as Ge, f as k, X as Me, i as he, x as pe, y as ze, q as We, r as He } from "./index-igxqCP2w.js";
|
|
3
|
+
import { L as Ue } from "./Legend-FZN9UHoI.js";
|
|
4
|
+
import { _ as Xe } from "./Title-DED-PQ7X.js";
|
|
5
|
+
import { _ as Re } from "./Tooltip-CHseiJu8.js";
|
|
6
|
+
import { D as Ye } from "./DataTable-CO5C8Cmb.js";
|
|
7
|
+
import { u as je, U as qe } from "./usePrinter-CnZYDQXB.js";
|
|
8
|
+
import Je from "./vue-ui-skeleton-CWjNNx-k.js";
|
|
9
|
+
import Ke from "./vue-ui-accordion-lF7yVkiT.js";
|
|
10
|
+
import { u as ye } from "./useNestedProp-CSVnZVwZ.js";
|
|
11
|
+
import { _ as Qe } from "./PackageVersion-DYk2hOG1.js";
|
|
12
|
+
import { P as Ze } from "./PenAndPaper-BfgS_5ux.js";
|
|
13
13
|
import { _ as et } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
14
|
const tt = ["id"], lt = {
|
|
15
15
|
key: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-KYU_8xrX.cjs"),re=require("./Legend-DDuxh17p.cjs"),ne=require("./Title-URF9hufV.cjs"),se=require("./Tooltip-87gbw8Ir.cjs"),ue=require("./DataTable-CfxOc-In.cjs"),U=require("./usePrinter-4Zj_RZ5v.cjs"),ie=require("./vue-ui-skeleton-D6mdHYxB.cjs"),ce=require("./vue-ui-accordion-C0oMKEv0.cjs"),H=require("./useNestedProp-C-g0SLHN.cjs"),de=require("./PackageVersion-Df1iPzMk.cjs"),ve=require("./PenAndPaper-CvGft3ku.cjs"),pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),he=["id"],fe={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},ye={key:2,style:"width:100%;background:transparent;padding-bottom:24px"},ge=["xmlns","viewBox"],me=["id"],be=["stdDeviation"],ke=["d","stroke","stroke-width"],Ce=["d","stroke","stroke-width"],we=["filter"],xe=["d","stroke","stroke-width"],$e=["d","stroke-width","onMouseenter","onClick"],Be={key:5,class:"vue-data-ui-watermark"},Ne=["onClick"],Te={key:0},_e={key:1},Se={key:8,ref:"source",dir:"auto"},Pe=["innerHTML"],Ve={__name:"vue-ui-galaxy",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(X,{expose:j,emit:S}){const i=X,{vue_ui_galaxy:Y}=r.useConfig(),b=e.computed(()=>!!i.dataset&&i.dataset.length);e.onMounted(()=>{P()});function P(){r.objectIsEmpty(i.dataset)?r.error({componentName:"VueUiGalaxy",type:"dataset"}):i.dataset.forEach((l,a)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{r.error({componentName:"VueUiGalaxy",type:"datasetSerieAttribute",property:o,index:a})})})}const g=e.ref(r.createUid()),k=e.ref(null),J=e.ref(null),x=e.ref(!1),$=e.ref(""),c=e.ref(null),V=e.ref(0),E=e.ref(0),L=e.ref(0),F=e.ref(0),t=e.computed({get:()=>O(),set:l=>l});function O(){const l=H.useNestedProp({userConfig:i.config,defaultConfig:Y});return l.theme?{...H.useNestedProp({userConfig:r.themes.vue_ui_galaxy[l.theme]||i.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>i.config,l=>{t.value=O(),P(),E.value+=1,L.value+=1,F.value+=1},{deep:!0});const{isPrinting:A,isImaging:I,generatePdf:z,generateImage:D}=U.usePrinter({elementId:`galaxy_${g.value}`,fileName:t.value.style.chart.title.text||"vue-ui-galaxy"}),K=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Q=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),v=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),B=e.ref({height:180,width:250}),u=e.ref([]);function N(l){u.value.includes(l.id)?u.value=u.value.filter(a=>a!==l.id):u.value.push(l.id),S("selectLegend",m.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const h=e.computed(()=>i.dataset.map((l,a)=>({name:l.name,color:r.convertColorToHex(l.color)||Q.value[a]||r.palette[a]||r.palette[a%r.palette.length],value:l.values?r.sanitizeArray(l.values).reduce((o,n)=>o+n,0):0,absoluteValues:r.sanitizeArray(l.values),id:r.createUid(),seriesIndex:a})).sort((l,a)=>a.value-l.value));function Z(){return h.value.map(l=>({name:l.name,color:l.color,value:l.value}))}const d=e.computed(()=>h.value.filter(l=>!u.value.includes(l.id)).map(l=>l.value).reduce((l,a)=>l+a,0)),ee=e.ref(190),q=e.computed(()=>h.value.filter(l=>!u.value.includes(l.id))),m=e.computed(()=>{const l=[];for(let a=0;a<q.value.length;a+=1){const o=q.value[a];let n=o.value/d.value*ee.value;a>0&&l.length&&(n+=l[a-1].points),l.push({points:n,...o,seriesIndex:a,proportion:o.value/d.value,path:r.createSpiralPath({points:n,startX:115+t.value.style.chart.layout.arcs.offsetX,startY:90+t.value.style.chart.layout.arcs.offsetY})})}return l.filter((a,o)=>!u.value.includes(a.id)).toSorted((a,o)=>o.points-a.points)}),y=e.ref(!1);function te(l){y.value=l,V.value+=1}const T=e.ref(null);function le({datapoint:l,_relativeIndex:a,seriesIndex:o,show:n=!1}){T.value={datapoint:l,seriesIndex:o,series:h.value,config:t.value},x.value=n,c.value=l.id;let s="";const f=t.value.style.chart.tooltip.customFormat;r.isFunction(f)&&r.functionReturnsString(()=>f({seriesIndex:o,datapoint:l,series:h.value,config:t.value}))?$.value=f({seriesIndex:o,datapoint:l,series:h.value,config:t.value}):(s+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,s+=`<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>`,t.value.style.chart.tooltip.showValue&&(s+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,l.value,r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:o})}</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?s+=`<span>(${r.dataLabel({v:l.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})})</span></div>`:s+=`<b>${r.dataLabel({v:l.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`),$.value=`<div>${s}</div>`)}const G=e.computed(()=>h.value.map((l,a)=>({...l,proportion:(l.value||0)/i.dataset.map(o=>(o.values||[]).reduce((n,s)=>n+s,0)).reduce((o,n)=>o+n,0),opacity:u.value.includes(l.id)?.5:1,shape:l.shape||"circle",segregate:()=>N(l),isSegregated:u.value.includes(l.id)}))),oe=e.computed(()=>({cy:"galaxy-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),p=e.computed(()=>{const l=m.value.map(o=>({name:o.name,color:o.color})),a=m.value.map(o=>o.value);return{head:l,body:a}});function M(){e.nextTick(()=>{const l=p.value.head.map((n,s)=>[[n.name],[p.value.body[s]],[isNaN(p.value.body[s]/d.value)?"-":p.value.body[s]/d.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=r.createCsvContent(a);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-galaxy"})})}const C=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:d.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],a=p.value.head.map((s,f)=>{const ae=r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:p.value.body[f],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue});return[{color:s.color,name:s.name},ae,isNaN(p.value.body[f]/d.value)?"-":r.dataLabel({v:p.value.body[f]/d.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),o={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,t.value.table.columnNames.percentage],head:l,body:a,config:o}});function W(){v.value.showTable=!v.value.showTable}function R(){v.value.showTooltip=!v.value.showTooltip}const w=e.ref(!1);function _(){w.value=!w.value}return j({getData:Z,generatePdf:z,generateCsv:M,generateImage:D,toggleTable:W,toggleTooltip:R,toggleAnnotator:_}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"galaxyChart",ref:k,class:e.normalizeClass(`vue-ui-galaxy ${y.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`galaxy_${g.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ve.PenAndPaper,{key:0,parent:k.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:_},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),K.value?(e.openBlock(),e.createElementBlock("div",fe,null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(),e.createBlock(ne._sfc_main,{key:`title_${E.value}`,config:{title:{cy:"galaxy-div-title",...t.value.style.chart.title},subtitle:{cy:"galaxy-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(U.UserOptions,{ref_key:"details",ref:J,key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(A),isImaging:e.unref(I),uid:g.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,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:v.value.showTooltip,isFullscreen:y.value,titles:{...t.value.userOptions.buttonTitles},chartElement:k.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:te,onGeneratePdf:e.unref(z),onGenerateCsv:M,onGenerateImage:e.unref(D),onToggleTable:W,onToggleTooltip:R,onToggleAnnotator:_},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.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":y.value,"vue-data-ui-fulscreen--off":!y.value}),viewBox:`0 0 ${B.value.width} ${B.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(de._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${g.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.layout.arcs.gradient.intensity},null,8,be)],8,me)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,o=>(e.openBlock(),e.createElementBlock("g",null,[o.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.path,fill:"none",stroke:t.value.style.chart.backgroundColor,"stroke-width":(t.value.style.chart.layout.arcs.strokeWidth+t.value.style.chart.layout.arcs.borderWidth)*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round"},null,8,ke)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:o.path,fill:"none",stroke:o.color,"stroke-width":t.value.style.chart.layout.arcs.strokeWidth*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round",class:e.normalizeClass(`${c.value&&c.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,Ce)):e.createCommentVNode("",!0),o.value&&t.value.style.chart.layout.arcs.gradient.show?(e.openBlock(),e.createElementBlock("g",{key:2,filter:`url(#blur_${g.value})`},[e.createElementVNode("path",{d:o.path,fill:"none",stroke:t.value.style.chart.layout.arcs.gradient.color,"stroke-width":t.value.style.chart.layout.arcs.strokeWidth/2*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round",class:e.normalizeClass(`vue-ui-galaxy-gradient ${c.value&&c.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,xe)],8,we)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(o,n)=>(e.openBlock(),e.createElementBlock("g",null,[o.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.path,fill:"none",stroke:"transparent","stroke-width":t.value.style.chart.layout.arcs.strokeWidth+t.value.style.chart.layout.arcs.borderWidth,"stroke-linecap":"round",onMouseenter:s=>le({datapoint:o,relativeIndex:n,seriesIndex:o.seriesIndex,show:!0}),onMouseleave:a[0]||(a[0]=s=>{x.value=!1,c.value=null}),onClick:s=>S("selectDatapoint",o)},null,40,$e)):e.createCommentVNode("",!0)]))),256)),e.renderSlot(l.$slots,"svg",{svg:B.value},void 0,!0)],14,ge)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Be,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(A)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ie.default,{key:6,config:{type:"galaxy",style:{backgroundColor:t.value.style.chart.backgroundColor,galaxy:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(re.Legend,{key:`legend_${F.value}`,legendSet:G.value,config:oe.value,onClickMarker:a[1]||(a[1]=({legend:o})=>N(o))},{item:e.withCtx(({legend:o,index:n})=>[e.createElementVNode("div",{onClick:s=>N(o),style:e.normalizeStyle(`opacity:${u.value.includes(o.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:o,seriesIndex:n}))+" ",1),u.value.includes(o.id)?(e.openBlock(),e.createElementBlock("span",_e," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Te," ("+e.toDisplayString(isNaN(o.value/d.value)?"-":e.unref(r.dataLabel)({v:o.value/d.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,Ne)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:G.value},void 0,!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Se,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(se._sfc_main,{show:v.value.showTooltip&&x.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:k.value,content:$.value,isFullscreen:y.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...T.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...T.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),b.value?(e.openBlock(),e.createBlock(ce.default,{key:9,hideDetails:"",config:{open:v.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(ue.DataTable,{key:`table_${L.value}`,colNames:C.value.colNames,head:C.value.head,body:C.value.body,config:C.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=o=>v.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Pe)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,he))}},Ee=pe._export_sfc(Ve,[["__scopeId","data-v-9c1d1614"]]);exports.default=Ee;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-BHQZE19X.cjs"),re=require("./Legend-DPHcmrzd.cjs"),ne=require("./Title-5Vedk01J.cjs"),se=require("./Tooltip-DjCKBAC4.cjs"),ue=require("./DataTable-kMUhutQ4.cjs"),U=require("./usePrinter-DVgxBO4o.cjs"),ie=require("./vue-ui-skeleton-DUNkS05l.cjs"),ce=require("./vue-ui-accordion-CRVWlHxs.cjs"),H=require("./useNestedProp-CwpqC_aE.cjs"),de=require("./PackageVersion-rnWHRWGI.cjs"),ve=require("./PenAndPaper-BQl9-uX0.cjs"),pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),he=["id"],fe={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},ye={key:2,style:"width:100%;background:transparent;padding-bottom:24px"},ge=["xmlns","viewBox"],me=["id"],be=["stdDeviation"],ke=["d","stroke","stroke-width"],Ce=["d","stroke","stroke-width"],we=["filter"],xe=["d","stroke","stroke-width"],$e=["d","stroke-width","onMouseenter","onClick"],Be={key:5,class:"vue-data-ui-watermark"},Ne=["onClick"],Te={key:0},_e={key:1},Se={key:8,ref:"source",dir:"auto"},Pe=["innerHTML"],Ve={__name:"vue-ui-galaxy",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(X,{expose:j,emit:S}){const i=X,{vue_ui_galaxy:Y}=r.useConfig(),b=e.computed(()=>!!i.dataset&&i.dataset.length);e.onMounted(()=>{P()});function P(){r.objectIsEmpty(i.dataset)?r.error({componentName:"VueUiGalaxy",type:"dataset"}):i.dataset.forEach((l,a)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{r.error({componentName:"VueUiGalaxy",type:"datasetSerieAttribute",property:o,index:a})})})}const g=e.ref(r.createUid()),k=e.ref(null),J=e.ref(null),x=e.ref(!1),$=e.ref(""),c=e.ref(null),V=e.ref(0),E=e.ref(0),L=e.ref(0),F=e.ref(0),t=e.computed({get:()=>O(),set:l=>l});function O(){const l=H.useNestedProp({userConfig:i.config,defaultConfig:Y});return l.theme?{...H.useNestedProp({userConfig:r.themes.vue_ui_galaxy[l.theme]||i.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>i.config,l=>{t.value=O(),P(),E.value+=1,L.value+=1,F.value+=1},{deep:!0});const{isPrinting:A,isImaging:I,generatePdf:z,generateImage:D}=U.usePrinter({elementId:`galaxy_${g.value}`,fileName:t.value.style.chart.title.text||"vue-ui-galaxy"}),K=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Q=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),v=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),B=e.ref({height:180,width:250}),u=e.ref([]);function N(l){u.value.includes(l.id)?u.value=u.value.filter(a=>a!==l.id):u.value.push(l.id),S("selectLegend",m.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const h=e.computed(()=>i.dataset.map((l,a)=>({name:l.name,color:r.convertColorToHex(l.color)||Q.value[a]||r.palette[a]||r.palette[a%r.palette.length],value:l.values?r.sanitizeArray(l.values).reduce((o,n)=>o+n,0):0,absoluteValues:r.sanitizeArray(l.values),id:r.createUid(),seriesIndex:a})).sort((l,a)=>a.value-l.value));function Z(){return h.value.map(l=>({name:l.name,color:l.color,value:l.value}))}const d=e.computed(()=>h.value.filter(l=>!u.value.includes(l.id)).map(l=>l.value).reduce((l,a)=>l+a,0)),ee=e.ref(190),q=e.computed(()=>h.value.filter(l=>!u.value.includes(l.id))),m=e.computed(()=>{const l=[];for(let a=0;a<q.value.length;a+=1){const o=q.value[a];let n=o.value/d.value*ee.value;a>0&&l.length&&(n+=l[a-1].points),l.push({points:n,...o,seriesIndex:a,proportion:o.value/d.value,path:r.createSpiralPath({points:n,startX:115+t.value.style.chart.layout.arcs.offsetX,startY:90+t.value.style.chart.layout.arcs.offsetY})})}return l.filter((a,o)=>!u.value.includes(a.id)).toSorted((a,o)=>o.points-a.points)}),y=e.ref(!1);function te(l){y.value=l,V.value+=1}const T=e.ref(null);function le({datapoint:l,_relativeIndex:a,seriesIndex:o,show:n=!1}){T.value={datapoint:l,seriesIndex:o,series:h.value,config:t.value},x.value=n,c.value=l.id;let s="";const f=t.value.style.chart.tooltip.customFormat;r.isFunction(f)&&r.functionReturnsString(()=>f({seriesIndex:o,datapoint:l,series:h.value,config:t.value}))?$.value=f({seriesIndex:o,datapoint:l,series:h.value,config:t.value}):(s+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,s+=`<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>`,t.value.style.chart.tooltip.showValue&&(s+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,l.value,r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:o})}</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?s+=`<span>(${r.dataLabel({v:l.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})})</span></div>`:s+=`<b>${r.dataLabel({v:l.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`),$.value=`<div>${s}</div>`)}const G=e.computed(()=>h.value.map((l,a)=>({...l,proportion:(l.value||0)/i.dataset.map(o=>(o.values||[]).reduce((n,s)=>n+s,0)).reduce((o,n)=>o+n,0),opacity:u.value.includes(l.id)?.5:1,shape:l.shape||"circle",segregate:()=>N(l),isSegregated:u.value.includes(l.id)}))),oe=e.computed(()=>({cy:"galaxy-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),p=e.computed(()=>{const l=m.value.map(o=>({name:o.name,color:o.color})),a=m.value.map(o=>o.value);return{head:l,body:a}});function M(){e.nextTick(()=>{const l=p.value.head.map((n,s)=>[[n.name],[p.value.body[s]],[isNaN(p.value.body[s]/d.value)?"-":p.value.body[s]/d.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=r.createCsvContent(a);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-galaxy"})})}const C=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:d.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],a=p.value.head.map((s,f)=>{const ae=r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:p.value.body[f],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue});return[{color:s.color,name:s.name},ae,isNaN(p.value.body[f]/d.value)?"-":r.dataLabel({v:p.value.body[f]/d.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),o={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,t.value.table.columnNames.percentage],head:l,body:a,config:o}});function W(){v.value.showTable=!v.value.showTable}function R(){v.value.showTooltip=!v.value.showTooltip}const w=e.ref(!1);function _(){w.value=!w.value}return j({getData:Z,generatePdf:z,generateCsv:M,generateImage:D,toggleTable:W,toggleTooltip:R,toggleAnnotator:_}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"galaxyChart",ref:k,class:e.normalizeClass(`vue-ui-galaxy ${y.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`galaxy_${g.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ve.PenAndPaper,{key:0,parent:k.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:_},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),K.value?(e.openBlock(),e.createElementBlock("div",fe,null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(),e.createBlock(ne._sfc_main,{key:`title_${E.value}`,config:{title:{cy:"galaxy-div-title",...t.value.style.chart.title},subtitle:{cy:"galaxy-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(U.UserOptions,{ref_key:"details",ref:J,key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(A),isImaging:e.unref(I),uid:g.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,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:v.value.showTooltip,isFullscreen:y.value,titles:{...t.value.userOptions.buttonTitles},chartElement:k.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:te,onGeneratePdf:e.unref(z),onGenerateCsv:M,onGenerateImage:e.unref(D),onToggleTable:W,onToggleTooltip:R,onToggleAnnotator:_},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.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":y.value,"vue-data-ui-fulscreen--off":!y.value}),viewBox:`0 0 ${B.value.width} ${B.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(de._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${g.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.layout.arcs.gradient.intensity},null,8,be)],8,me)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,o=>(e.openBlock(),e.createElementBlock("g",null,[o.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.path,fill:"none",stroke:t.value.style.chart.backgroundColor,"stroke-width":(t.value.style.chart.layout.arcs.strokeWidth+t.value.style.chart.layout.arcs.borderWidth)*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round"},null,8,ke)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:o.path,fill:"none",stroke:o.color,"stroke-width":t.value.style.chart.layout.arcs.strokeWidth*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round",class:e.normalizeClass(`${c.value&&c.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,Ce)):e.createCommentVNode("",!0),o.value&&t.value.style.chart.layout.arcs.gradient.show?(e.openBlock(),e.createElementBlock("g",{key:2,filter:`url(#blur_${g.value})`},[e.createElementVNode("path",{d:o.path,fill:"none",stroke:t.value.style.chart.layout.arcs.gradient.color,"stroke-width":t.value.style.chart.layout.arcs.strokeWidth/2*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round",class:e.normalizeClass(`vue-ui-galaxy-gradient ${c.value&&c.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,xe)],8,we)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(o,n)=>(e.openBlock(),e.createElementBlock("g",null,[o.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.path,fill:"none",stroke:"transparent","stroke-width":t.value.style.chart.layout.arcs.strokeWidth+t.value.style.chart.layout.arcs.borderWidth,"stroke-linecap":"round",onMouseenter:s=>le({datapoint:o,relativeIndex:n,seriesIndex:o.seriesIndex,show:!0}),onMouseleave:a[0]||(a[0]=s=>{x.value=!1,c.value=null}),onClick:s=>S("selectDatapoint",o)},null,40,$e)):e.createCommentVNode("",!0)]))),256)),e.renderSlot(l.$slots,"svg",{svg:B.value},void 0,!0)],14,ge)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Be,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(A)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ie.default,{key:6,config:{type:"galaxy",style:{backgroundColor:t.value.style.chart.backgroundColor,galaxy:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(re.Legend,{key:`legend_${F.value}`,legendSet:G.value,config:oe.value,onClickMarker:a[1]||(a[1]=({legend:o})=>N(o))},{item:e.withCtx(({legend:o,index:n})=>[e.createElementVNode("div",{onClick:s=>N(o),style:e.normalizeStyle(`opacity:${u.value.includes(o.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:o,seriesIndex:n}))+" ",1),u.value.includes(o.id)?(e.openBlock(),e.createElementBlock("span",_e," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Te," ("+e.toDisplayString(isNaN(o.value/d.value)?"-":e.unref(r.dataLabel)({v:o.value/d.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,Ne)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:G.value},void 0,!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Se,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(se._sfc_main,{show:v.value.showTooltip&&x.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:k.value,content:$.value,isFullscreen:y.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...T.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...T.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),b.value?(e.openBlock(),e.createBlock(ce.default,{key:9,hideDetails:"",config:{open:v.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(ue.DataTable,{key:`table_${L.value}`,colNames:C.value.colNames,head:C.value.head,body:C.value.body,config:C.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=o=>v.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Pe)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,he))}},Ee=pe._export_sfc(Ve,[["__scopeId","data-v-9c1d1614"]]);exports.default=Ee;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { computed as y, ref as d, watch as he, onMounted as Xe, onBeforeUnmount as Ye, openBlock as o, createElementBlock as u, normalizeClass as de, normalizeStyle as ye, createBlock as R, createCommentVNode as h, withCtx as X, toDisplayString as C, unref as c, createSlots as Ie, renderSlot as w, normalizeProps as L, guardReactiveProps as D, createVNode as Ae, createElementVNode as g, Fragment as _, renderList as S, mergeProps as G } from "vue";
|
|
2
|
-
import { u as Re, c as Ge, t as Ee, a as We, p as fe, b as Te, o as me, d as je, e as E, g as ge, m as U, I as z, X as Le, s as B, k as De, i as V, f as q, F as H } from "./index-
|
|
2
|
+
import { u as Re, c as Ge, t as Ee, a as We, p as fe, b as Te, o as me, d as je, e as E, g as ge, m as U, I as z, X as Le, s as B, k as De, i as V, f as q, F as H } from "./index-igxqCP2w.js";
|
|
3
3
|
import { t as Ue, u as Be } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { u as Ve, U as qe } from "./usePrinter-
|
|
5
|
-
import He from "./vue-ui-skeleton-
|
|
6
|
-
import { _ as Ze } from "./Title-
|
|
7
|
-
import { u as pe } from "./useNestedProp-
|
|
8
|
-
import { _ as Je } from "./PackageVersion-
|
|
9
|
-
import { P as Ke } from "./PenAndPaper-
|
|
4
|
+
import { u as Ve, U as qe } from "./usePrinter-CnZYDQXB.js";
|
|
5
|
+
import He from "./vue-ui-skeleton-CWjNNx-k.js";
|
|
6
|
+
import { _ as Ze } from "./Title-DED-PQ7X.js";
|
|
7
|
+
import { u as pe } from "./useNestedProp-CSVnZVwZ.js";
|
|
8
|
+
import { _ as Je } from "./PackageVersion-DYk2hOG1.js";
|
|
9
|
+
import { P as Ke } from "./PenAndPaper-BfgS_5ux.js";
|
|
10
10
|
import { _ as Qe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
11
|
const et = ["id"], tt = { key: 0 }, at = ["xmlns", "viewBox"], lt = ["id"], rt = ["stop-color"], st = ["stop-color"], ot = ["stop-color"], ut = ["id"], nt = ["stdDeviation"], it = ["d", "fill", "stroke"], ct = ["id", "d"], vt = ["fill", "font-size", "font-weight"], ht = ["href", "startOffset"], dt = ["x", "y", "text-anchor", "fill", "font-size", "font-weight"], yt = ["d", "filter"], ft = ["stroke", "stroke-width"], mt = ["stroke", "stroke-width"], gt = ["stroke", "stroke-width"], pt = ["stroke", "stroke-width"], kt = { key: 4 }, bt = ["x", "y", "text-anchor", "font-size", "font-weight", "fill"], _t = ["x", "y", "font-size", "font-weight", "fill"], xt = { key: 6 }, wt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], St = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], zt = ["x1", "y1", "x2", "y2", "stroke-width", "filter"], $t = { key: 7 }, Ft = ["d", "fill", "stroke", "stroke-width"], Ct = ["cx", "cy", "fill", "r", "stroke-width", "stroke"], Pt = ["x", "y", "font-size", "fill"], Mt = {
|
|
12
12
|
key: 5,
|