vue-data-ui 2.4.52 → 2.4.53
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-CFlFdPC5.cjs → Arrow-BGjtcB03.cjs} +1 -1
- package/dist/{Arrow-BuBoE64l.js → Arrow-XbzVXHDF.js} +1 -1
- package/dist/{BaseIcon-zmxwsaLW.js → BaseIcon-CiQzR1fE.js} +1 -1
- package/dist/{BaseIcon-CfhoS_qC.cjs → BaseIcon-DGRZS55E.cjs} +1 -1
- package/dist/{DataTable-CwAdpLng.cjs → DataTable-DWQiMziO.cjs} +1 -1
- package/dist/{DataTable-COkA4Nyz.js → DataTable-jvL0XGWl.js} +2 -2
- package/dist/{Legend-CR9ydX8N.cjs → Legend-BstxUr4T.cjs} +1 -1
- package/dist/{Legend-bYlSC7I7.js → Legend-DcIfRSNC.js} +1 -1
- package/dist/{PackageVersion-C1F3QLoY.cjs → PackageVersion-CeJ2R9gK.cjs} +1 -1
- package/dist/{PackageVersion-Dz3KcTL4.js → PackageVersion-Ve0s76sL.js} +1 -1
- package/dist/{PenAndPaper-DDheVRNG.cjs → PenAndPaper-DQPbe0G_.cjs} +1 -1
- package/dist/{PenAndPaper-BycdTwSP.js → PenAndPaper-IHG7xTmx.js} +3 -3
- package/dist/{Shape-BBp5EwJH.cjs → Shape-Bzx4qKcd.cjs} +1 -1
- package/dist/{Shape-BDJJ38uM.js → Shape-Rg6yW7m3.js} +1 -1
- package/dist/{Slicer-D_DaIThC.js → Slicer-CP2Z31Lc.js} +2 -2
- package/dist/{Slicer-7oTpm-cZ.cjs → Slicer-CPp7_WWa.cjs} +1 -1
- package/dist/{Title-B7ruS8yl.cjs → Title-CSyDhu3S.cjs} +1 -1
- package/dist/{Title-aMb2ETf7.js → Title-DLo3Zo2_.js} +1 -1
- package/dist/{Tooltip-BRZ3DT4p.js → Tooltip-CA1QhFeE.js} +1 -1
- package/dist/{Tooltip-BqSN71SL.cjs → Tooltip-D88h1zvE.cjs} +1 -1
- package/dist/{index-BkXYJDpD.cjs → index-C3wsuQ2C.cjs} +1 -1
- package/dist/{index-K5uyh1gA.js → index-DhxnZ6ZS.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-DifqJZAs.js → useNestedProp-BcqToEU0.js} +1 -1
- package/dist/{useNestedProp-C6IvqE-r.cjs → useNestedProp-CFwQtnNB.cjs} +1 -1
- package/dist/{usePrinter-DHv-BwME.cjs → usePrinter-Dglf1bsw.cjs} +1 -1
- package/dist/{usePrinter-p_ZZlGc9.js → usePrinter-mDGfOQZA.js} +1 -1
- package/dist/{vue-data-ui-M0E2b8Dw.cjs → vue-data-ui-BM5qFlPf.cjs} +1 -1
- package/dist/{vue-data-ui-3PlAeIlX.js → vue-data-ui-C6tJVggL.js} +60 -60
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-PrijRaoI.js → vue-ui-3d-bar-BFzCyxbR.js} +9 -9
- package/dist/{vue-ui-3d-bar-VQyMytda.cjs → vue-ui-3d-bar-DiL5x37F.cjs} +1 -1
- package/dist/{vue-ui-accordion-CsJT7Az3.js → vue-ui-accordion-DDp8hUlk.js} +3 -3
- package/dist/{vue-ui-accordion-kr18wKfc.cjs → vue-ui-accordion-kv5FuXqU.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-DFYykOow.js → vue-ui-age-pyramid-ORFLMq65.js} +10 -10
- package/dist/{vue-ui-age-pyramid-BV1MgH8J.cjs → vue-ui-age-pyramid-xYMc6DPS.cjs} +1 -1
- package/dist/{vue-ui-annotator-Blg3LdqF.js → vue-ui-annotator-CYyuSx8D.js} +1 -1
- package/dist/{vue-ui-annotator-DffUZR4a.cjs → vue-ui-annotator-J_Ssv585.cjs} +1 -1
- package/dist/{vue-ui-bullet-DSampkai.cjs → vue-ui-bullet-BbOqOHbK.cjs} +1 -1
- package/dist/{vue-ui-bullet-Ybz4qPWl.js → vue-ui-bullet-D8w5qQKc.js} +8 -8
- package/dist/{vue-ui-candlestick-DsVBdCz_.js → vue-ui-candlestick-B7jJlgII.js} +11 -11
- package/dist/{vue-ui-candlestick-BxcwK8UI.cjs → vue-ui-candlestick-BbKj6Lt5.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-C2ThrWYt.js → vue-ui-carousel-table-3ntrCePt.js} +4 -4
- package/dist/{vue-ui-carousel-table-DkWNe0mJ.cjs → vue-ui-carousel-table-Cazhvs3E.cjs} +1 -1
- package/dist/{vue-ui-chestnut-Cw8LKuZG.cjs → vue-ui-chestnut-DyFTfNZi.cjs} +1 -1
- package/dist/{vue-ui-chestnut-BacH0ZYK.js → vue-ui-chestnut-apUInPn_.js} +8 -8
- package/dist/{vue-ui-cursor-CMKSCQ-v.js → vue-ui-cursor-CFTO66GQ.js} +2 -2
- package/dist/{vue-ui-cursor-D2kQNFWy.cjs → vue-ui-cursor-CsNO0-Tw.cjs} +1 -1
- package/dist/{vue-ui-dashboard-9PYl4mWC.js → vue-ui-dashboard-C-pDSWwi.js} +2 -2
- package/dist/{vue-ui-dashboard-BHwlhK33.cjs → vue-ui-dashboard-DddJvm7i.cjs} +1 -1
- package/dist/{vue-ui-digits-2yacgzrJ.cjs → vue-ui-digits-DSqN9pA7.cjs} +1 -1
- package/dist/{vue-ui-digits-CyTjq_oN.js → vue-ui-digits-DWAbSFx3.js} +2 -2
- package/dist/{vue-ui-donut-BxLlCBhU.js → vue-ui-donut-DSeDfu4H.js} +11 -11
- package/dist/{vue-ui-donut-BNv1eGiu.cjs → vue-ui-donut-DrAes-Cb.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-DGjHfyq8.cjs → vue-ui-donut-evolution-CYtTDj7r.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-Bw9hfwuO.js → vue-ui-donut-evolution-D7h33-ti.js} +11 -11
- package/dist/{vue-ui-dumbbell-CjHcgzti.cjs → vue-ui-dumbbell-DAK7iUrl.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-D0PjpD19.js → vue-ui-dumbbell-LF5uy2pG.js} +10 -10
- package/dist/{vue-ui-flow-BuTJcn6b.js → vue-ui-flow-ClPKB4R5.js} +9 -9
- package/dist/{vue-ui-flow-Dc-KV4a3.cjs → vue-ui-flow-u3UVnWTH.cjs} +1 -1
- package/dist/{vue-ui-funnel-CxO1aav3.js → vue-ui-funnel-BIXUXI8z.js} +8 -8
- package/dist/{vue-ui-funnel-QQGqK4OD.cjs → vue-ui-funnel-BY7rqfpW.cjs} +1 -1
- package/dist/{vue-ui-galaxy-B2uwYVgz.js → vue-ui-galaxy-CEnGrqn3.js} +11 -11
- package/dist/{vue-ui-galaxy-CABgAX76.cjs → vue-ui-galaxy-DBnbXO8c.cjs} +1 -1
- package/dist/{vue-ui-gauge-CqhJx__t.js → vue-ui-gauge-C7Qchm0R.js} +7 -7
- package/dist/{vue-ui-gauge-CTEPbzWe.cjs → vue-ui-gauge-CJYWRyeq.cjs} +1 -1
- package/dist/{vue-ui-gizmo-DlQOItIS.cjs → vue-ui-gizmo-C9_Ciat_.cjs} +1 -1
- package/dist/{vue-ui-gizmo-D7G-8Al-.js → vue-ui-gizmo-CKZRt29V.js} +3 -3
- package/dist/{vue-ui-heatmap-DLNzJh--.js → vue-ui-heatmap-BlbOJnS0.js} +10 -10
- package/dist/{vue-ui-heatmap-BOwY6qNR.cjs → vue-ui-heatmap-olBNo_Ui.cjs} +1 -1
- package/dist/{vue-ui-history-plot-CH2mN74k.js → vue-ui-history-plot-CBpL_OyR.js} +11 -11
- package/dist/{vue-ui-history-plot-EiYWpITj.cjs → vue-ui-history-plot-Cyd53pxt.cjs} +1 -1
- package/dist/{vue-ui-kpi-Cb3fLQlS.js → vue-ui-kpi-C2XDua17.js} +3 -3
- package/dist/{vue-ui-kpi-DB00TrXv.cjs → vue-ui-kpi-CkcQ40VT.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-DAaZwOTE.cjs → vue-ui-mini-loader-CpeOqmXd.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-Czn2u6m3.js → vue-ui-mini-loader-DXF2Zpi6.js} +2 -2
- package/dist/{vue-ui-molecule-BAwzIU19.js → vue-ui-molecule-ekgpnwl8.js} +11 -11
- package/dist/{vue-ui-molecule-DZ6Z4eru.cjs → vue-ui-molecule-qQjh4AkD.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-BXOWHB57.js → vue-ui-mood-radar-CV30YU_f.js} +11 -11
- package/dist/{vue-ui-mood-radar-BL3vQzMq.cjs → vue-ui-mood-radar-KoW8hhxL.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-D1EF5IEw.cjs → vue-ui-nested-donuts-AkaYvLCi.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-F1pwFa1Y.js → vue-ui-nested-donuts-DZ_eS-bB.js} +11 -11
- package/dist/{vue-ui-onion-nA8sXxh-.cjs → vue-ui-onion-Bl1UUCFU.cjs} +1 -1
- package/dist/{vue-ui-onion-C9dEaRbc.js → vue-ui-onion-YfHn7AeD.js} +11 -11
- package/dist/{vue-ui-parallel-coordinate-plot-Cgc8JHMy.js → vue-ui-parallel-coordinate-plot-BEqbS5A6.js} +12 -12
- package/dist/{vue-ui-parallel-coordinate-plot-DL4DOhyh.cjs → vue-ui-parallel-coordinate-plot-Dv_UD2bi.cjs} +1 -1
- package/dist/{vue-ui-quadrant-C_hJHr9T.js → vue-ui-quadrant-BU_pD15l.js} +12 -12
- package/dist/{vue-ui-quadrant-DJGxKeBq.cjs → vue-ui-quadrant-DO6afeTp.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-C5v_8Kpw.cjs → vue-ui-quick-chart-ByDBV3lo.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-D4k-zSan.js → vue-ui-quick-chart-U-1paiOI.js} +9 -9
- package/dist/{vue-ui-radar-WKQ-TavD.js → vue-ui-radar-B5FUXS1e.js} +12 -12
- package/dist/{vue-ui-radar-BeGVGueh.cjs → vue-ui-radar-DLsIiPBR.cjs} +1 -1
- package/dist/{vue-ui-rating-DI3L8UYN.cjs → vue-ui-rating-D4-ebrWA.cjs} +1 -1
- package/dist/{vue-ui-rating-BrSnMkzF.js → vue-ui-rating-DcCUrP6L.js} +2 -2
- package/dist/{vue-ui-relation-circle-DzZ5H4og.js → vue-ui-relation-circle-2i7B4Yf-.js} +7 -7
- package/dist/{vue-ui-relation-circle-BJ_TOhIp.cjs → vue-ui-relation-circle-jPx6gmw1.cjs} +1 -1
- package/dist/{vue-ui-rings-1qwg2E0O.cjs → vue-ui-rings-6JF72UH8.cjs} +1 -1
- package/dist/{vue-ui-rings-43dY-4_7.js → vue-ui-rings-DG0DQD21.js} +11 -11
- package/dist/{vue-ui-scatter-cTK10i0K.cjs → vue-ui-scatter-CfbMuDQy.cjs} +1 -1
- package/dist/{vue-ui-scatter-q6Sfqa4W.js → vue-ui-scatter-j6SU-TUb.js} +12 -12
- package/dist/{vue-ui-screenshot-CEy169Mc.js → vue-ui-screenshot-B6hhgFz_.js} +1 -1
- package/dist/{vue-ui-screenshot-gOGGT_ti.cjs → vue-ui-screenshot-BKfP266_.cjs} +1 -1
- package/dist/{vue-ui-skeleton-BTN1PKkz.cjs → vue-ui-skeleton-99lBQ_mF.cjs} +1 -1
- package/dist/{vue-ui-skeleton-BhA2lIT6.js → vue-ui-skeleton-pdtGfiV6.js} +3 -3
- package/dist/{vue-ui-smiley-BIEXWWWa.cjs → vue-ui-smiley-8UembS7P.cjs} +1 -1
- package/dist/{vue-ui-smiley-BAFdctGJ.js → vue-ui-smiley-fOlIEhGS.js} +2 -2
- package/dist/{vue-ui-spark-trend-Deg6oJxD.js → vue-ui-spark-trend-BkPSkOrh.js} +5 -5
- package/dist/{vue-ui-spark-trend-LqnAP3mZ.cjs → vue-ui-spark-trend-CV5Uq241.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-CJR8pSqp.cjs → vue-ui-sparkbar-DUNqm_AP.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-Dm393iij.js → vue-ui-sparkbar-qB9reaJo.js} +4 -4
- package/dist/{vue-ui-sparkgauge-DpP1XF6C.cjs → vue-ui-sparkgauge-D0hLQuMH.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-WTo7H8eC.js → vue-ui-sparkgauge-Mmm3mt-c.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-DNVBeCU9.js → vue-ui-sparkhistogram-9yQ-E0co.js} +5 -5
- package/dist/{vue-ui-sparkhistogram-CEvdVaLZ.cjs → vue-ui-sparkhistogram-CuB-M26R.cjs} +1 -1
- package/dist/{vue-ui-sparkline-Bcn_JAfC.js → vue-ui-sparkline-D_QkkgS-.js} +4 -4
- package/dist/{vue-ui-sparkline-B87AKRMY.cjs → vue-ui-sparkline-Du8Hm28x.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-DPPTp1Tm.js → vue-ui-sparkstackbar-BDubVDPN.js} +5 -5
- package/dist/{vue-ui-sparkstackbar-Cmafq74u.cjs → vue-ui-sparkstackbar-B_I1tmuS.cjs} +1 -1
- package/dist/{vue-ui-stackbar-DeFiDh8a.cjs → vue-ui-stackbar-DHnilreT.cjs} +1 -1
- package/dist/{vue-ui-stackbar-BeXW23yH.js → vue-ui-stackbar-rNiqr7aF.js} +12 -12
- package/dist/{vue-ui-strip-plot-CG-wp65N.js → vue-ui-strip-plot-DPn3qgdB.js} +11 -11
- package/dist/{vue-ui-strip-plot-5n6Om5PH.cjs → vue-ui-strip-plot-DlRej1u9.cjs} +1 -1
- package/dist/{vue-ui-table-BzuWkWse.js → vue-ui-table-BrZ__Cd2.js} +1 -1
- package/dist/{vue-ui-table-Bbfdq7B8.cjs → vue-ui-table-DLcFdjyM.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap--Uj5nFcF.cjs → vue-ui-table-heatmap-DIkXPyqe.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-obAYC2HB.js → vue-ui-table-heatmap-DQXI2uPZ.js} +4 -4
- package/dist/{vue-ui-table-sparkline-CW0-ubzl.js → vue-ui-table-sparkline-BUNsAEVY.js} +77 -76
- package/dist/vue-ui-table-sparkline-BazGMr3R.cjs +1 -0
- package/dist/{vue-ui-thermometer-BmgPuIr6.js → vue-ui-thermometer-DMkD9fS8.js} +7 -7
- package/dist/{vue-ui-thermometer-DW10BlzG.cjs → vue-ui-thermometer-_gbnwB1j.cjs} +1 -1
- package/dist/{vue-ui-timer-CKp_yNVJ.cjs → vue-ui-timer-BTfgxjIc.cjs} +1 -1
- package/dist/{vue-ui-timer-6eWSNYld.js → vue-ui-timer-Dv-GSUf1.js} +5 -5
- package/dist/{vue-ui-tiremarks-DeEI5TAa.js → vue-ui-tiremarks-CEMrBJPF.js} +7 -7
- package/dist/{vue-ui-tiremarks-nb8r7akm.cjs → vue-ui-tiremarks-Ct9y13Sl.cjs} +1 -1
- package/dist/{vue-ui-treemap-B54QUZ46.cjs → vue-ui-treemap-D7SBHWJ2.cjs} +1 -1
- package/dist/{vue-ui-treemap-tlPZye6M.js → vue-ui-treemap-D8AkLDqM.js} +11 -11
- package/dist/{vue-ui-vertical-bar-BIst1a32.js → vue-ui-vertical-bar-BnhysoC9.js} +11 -11
- package/dist/{vue-ui-vertical-bar-CCXF79YU.cjs → vue-ui-vertical-bar-_EQI8SXm.cjs} +1 -1
- package/dist/{vue-ui-waffle-Dctw-uNI.cjs → vue-ui-waffle-DOhi1BWD.cjs} +1 -1
- package/dist/{vue-ui-waffle-iJT4g4Ht.js → vue-ui-waffle-DfRmWfrG.js} +11 -11
- package/dist/{vue-ui-wheel-DnCpgZZo.cjs → vue-ui-wheel-BbDtndmW.cjs} +1 -1
- package/dist/{vue-ui-wheel-v1_jsNWp.js → vue-ui-wheel-CU6-VBD1.js} +7 -7
- package/dist/{vue-ui-word-cloud-BXa6XzUJ.cjs → vue-ui-word-cloud-CRarnngT.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-DR8E1ArH.js → vue-ui-word-cloud-CbuHwEkP.js} +10 -10
- package/dist/{vue-ui-xy-CvFWhRR-.cjs → vue-ui-xy-BRTegbdr.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-hPcU2SBK.js → vue-ui-xy-canvas-DsTqLLWp.js} +11 -11
- package/dist/{vue-ui-xy-canvas-BVw3zOIC.cjs → vue-ui-xy-canvas-hn3ncIFk.cjs} +1 -1
- package/dist/{vue-ui-xy-BZ3lbw6i.js → vue-ui-xy-pSvq591u.js} +14 -14
- package/package.json +1 -1
- package/dist/vue-ui-table-sparkline-Buh41Ovt.cjs +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as p, ref as m, onMounted as nt, watch as Me, openBlock as a, createElementBlock as u, normalizeClass as P, normalizeStyle as q, unref as c, createBlock as T, createCommentVNode as v, createSlots as rt, withCtx as I, renderSlot as F, normalizeProps as J, guardReactiveProps as Q, createVNode as it, createElementVNode as d, Fragment as k, renderList as _, toDisplayString as b, withKeys as ct, createTextVNode as He, nextTick as X } from "vue";
|
|
2
|
-
import { u as vt, o as dt, e as Z, g as ht, c as Ue, t as yt, a as ft, p as ee, C as We, b as gt, J as mt, d as de, D as Re, m as he, X as bt, s as G, E as xt, i as ye, f as te, j as Xe, k as le, n as Ge, K as je, q as pt, r as kt } from "./index-
|
|
3
|
-
import { _ as _t } from "./Title-
|
|
4
|
-
import { u as Ct, U as wt } from "./usePrinter-
|
|
5
|
-
import { D as Lt } from "./DataTable-
|
|
6
|
-
import { L as zt } from "./Legend-
|
|
7
|
-
import St from "./vue-ui-skeleton-
|
|
8
|
-
import { S as At } from "./Slicer-
|
|
9
|
-
import $t from "./vue-ui-accordion-
|
|
10
|
-
import { u as Be } from "./useNestedProp-
|
|
11
|
-
import { _ as Nt } from "./PackageVersion-
|
|
12
|
-
import { P as It } from "./PenAndPaper-
|
|
2
|
+
import { u as vt, o as dt, e as Z, g as ht, c as Ue, t as yt, a as ft, p as ee, C as We, b as gt, J as mt, d as de, D as Re, m as he, X as bt, s as G, E as xt, i as ye, f as te, j as Xe, k as le, n as Ge, K as je, q as pt, r as kt } from "./index-DhxnZ6ZS.js";
|
|
3
|
+
import { _ as _t } from "./Title-DLo3Zo2_.js";
|
|
4
|
+
import { u as Ct, U as wt } from "./usePrinter-mDGfOQZA.js";
|
|
5
|
+
import { D as Lt } from "./DataTable-jvL0XGWl.js";
|
|
6
|
+
import { L as zt } from "./Legend-DcIfRSNC.js";
|
|
7
|
+
import St from "./vue-ui-skeleton-pdtGfiV6.js";
|
|
8
|
+
import { S as At } from "./Slicer-CP2Z31Lc.js";
|
|
9
|
+
import $t from "./vue-ui-accordion-DDp8hUlk.js";
|
|
10
|
+
import { u as Be } from "./useNestedProp-BcqToEU0.js";
|
|
11
|
+
import { _ as Nt } from "./PackageVersion-Ve0s76sL.js";
|
|
12
|
+
import { P as It } from "./PenAndPaper-IHG7xTmx.js";
|
|
13
13
|
import { u as Ft } from "./useUserOptionState-BIvW1Kz7.js";
|
|
14
14
|
import { _ as Pt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
15
15
|
const Ot = ["id"], Tt = ["xmlns", "viewBox"], Dt = ["id"], Et = ["stop-color"], Vt = ["stop-color"], Mt = ["id"], Ht = ["stop-color"], Ut = ["stop-color"], Wt = ["stop-color"], Rt = { key: 0 }, Xt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Gt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], jt = { key: 0 }, Bt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Yt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Kt = ["x", "y", "font-size", "fill", "font-weight"], qt = ["text-anchor", "font-size", "fill", "transform"], Jt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Qt = { key: 1 }, Zt = ["cx", "cy", "r", "fill"], el = { key: 0 }, tl = { key: 0 }, ll = ["d", "stroke"], al = ["text-anchor", "x", "y", "fill"], ol = ["cx", "cy", "r", "fill"], ul = { key: 0 }, sl = ["cx", "cy", "fill"], nl = { key: 1 }, rl = ["d", "fill", "stroke"], il = { key: 2 }, cl = ["d", "fill", "stroke"], vl = ["x", "y", "font-size", "fill"], dl = ["x", "y", "width", "fill", "onClick"], hl = ["x", "y", "width", "height", "onMouseenter", "onClick"], yl = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-BkXYJDpD.cjs"),K=require("./useResponsive-BJ7DTGpm.cjs"),ce=require("./Title-B7ruS8yl.cjs"),Q=require("./usePrinter-DHv-BwME.cjs"),de=require("./DataTable-CwAdpLng.cjs"),ve=require("./vue-ui-skeleton-BTN1PKkz.cjs"),he=require("./Legend-CR9ydX8N.cjs"),ye=require("./vue-ui-accordion-kr18wKfc.cjs"),ee=require("./useNestedProp-C6IvqE-r.cjs"),fe=require("./PackageVersion-C1F3QLoY.cjs"),me=require("./PenAndPaper-DDheVRNG.cjs"),be=require("./useUserOptionState-BgepsfED.cjs"),pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ge=["id"],ke=["xmlns","viewBox"],xe={key:0},_e=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Ce={key:1},we=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Be=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Ne={key:2},Ee=["x","y","font-size","fill","font-weight"],$e=["x","y","font-size","fill"],Le={key:3},Se=["x","y","font-size","fill","font-weight"],Ve=["id"],ze=["stop-color"],Ae=["stop-color"],Pe=["stop-color"],Te=["id"],Xe=["stop-color"],De=["stop-color"],Oe=["stop-color"],Fe=["id"],Me=["stop-color"],Ge=["stop-color"],Ie=["id"],qe=["stop-color"],He=["stop-color"],Ue={key:0},Re=["d","fill"],We={key:1},je=["x","y","height","width","fill"],Ye=["cx","cy","r","fill","stroke","stroke-width"],Ze=["cx","cy","r","fill","stroke","stroke-width"],Je={key:2},Ke=["x","y","fill","font-size"],Qe={key:3},et=["x","y","fill","font-size"],tt={key:5,class:"vue-data-ui-watermark"},lt=["xmlns","height","width"],at=["fill"],ot=["innerHTML"],rt={__name:"vue-ui-dumbbell",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(te,{expose:le,emit:nt}){const y=te,{vue_ui_dumbbell:ae}=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),z=e.ref(null),A=e.ref(null),P=e.ref(null),T=e.ref(null),X=e.ref(0),D=e.ref(0),O=e.ref(0),t=e.computed({get:()=>G(),set:a=>a}),{userOptionsVisible:E,setUserOptionsVisibility:F,keepUserOptionState:M}=be.useUserOptionState({config:t.value});function G(){const a=ee.useNestedProp({userConfig:y.config,defaultConfig:ae});return a.theme?{...ee.useNestedProp({userConfig:s.themes.vue_ui_dumbbell[a.theme]||y.config,defaultConfig:a})}:a}e.watch(()=>y.config,a=>{t.value=G(),E.value=!t.value.showOnChartHover,I(),X.value+=1,D.value+=1,O.value+=1,c.value=t.value.style.chart.rowHeight,g.value=t.value.style.chart.width},{deep:!0}),e.watch(()=>y.dataset,a=>{j()},{deep:!0});const x=e.ref(null);e.onMounted(()=>{I()});function I(){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=K.throttle(()=>{const{width:n,height:l}=K.useResponsive({chart:p.value,title:t.value.style.chart.title.text?z.value:null,legend:t.value.style.chart.legend.show?A.value:null,source:P.value,noTitle:T.value});g.value=n,c.value=l/y.dataset.length,v.value=C()});x.value=new ResizeObserver(a),x.value.observe(p.value.parentNode)}}e.onBeforeUnmount(()=>{x.value&&x.value.disconnect()});const{isPrinting:q,isImaging:H,generatePdf:U,generateImage:R}=Q.usePrinter({elementId:`dumbbell_${d.value}`,fileName:t.value.style.chart.title.text||"vue-ui-dumbbell"}),oe=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),_=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.computed(()=>({max:Math.max(...f.value.flatMap(a=>[a.start,a.end])),min:Math.min(...f.value.flatMap(a=>[a.start,a.end]))})),i=e.computed(()=>s.calculateNiceScale($.value.min<0?$.value.min:0,$.value.max,t.value.style.chart.grid.scaleSteps)),c=e.ref(t.value.style.chart.rowHeight),g=e.ref(t.value.style.chart.width),r=e.computed(()=>{const a=c.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=i.value.ticks.length*(g.value/i.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(i.value.min))/(i.value.max+Math.abs(i.value.min))*r.value.widthPlotReference,o=r.value.left+(a.end+Math.abs(i.value.min))/(i.value.max+Math.abs(i.value.min))*r.value.widthPlotReference,u=l+(o-l)/2;return{...a,startX:l,endX:o,centerX:u,y:r.value.top+n*c.value+c.value/2,endVal:a.start}})}const v=e.ref([]),W=e.ref(null),re=e.computed(()=>f.value.map(a=>a.end).reduce((a,n)=>a+n,0));e.onMounted(()=>{j()});function j(){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>=re.value?(cancelAnimationFrame(W.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(i.value.min))/(i.value.max+Math.abs(i.value.min))*r.value.widthPlotReference,N=r.value.left+(o.endVal+Math.abs(i.value.min))/(i.value.max+Math.abs(i.value.min))*r.value.widthPlotReference,S=h+(N-h)/2;return{...o,startX:h,endX:N,centerX:S,y:r.value.top+u*c.value+c.value/2,endVal:o.endVal}}),a=v.value.map(o=>o.endVal).reduce((o,u)=>o+u,0),W.value=requestAnimationFrame(n))}t.value.useAnimation?n():v.value=C()}const Y=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}]),se=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}),S=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}),ie=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,S,ie]}),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 Z(){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 ne(a){k.value=a,V.value+=1}function ue(){return v.value}function J(){_.value.showTable=!_.value.showTable}const B=e.ref(!1);function L(){B.value=!B.value}return le({getData:ue,generatePdf:U,generateCsv:Z,generateImage:R,toggleTable:J,toggleAnnotator:L}),(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}`,onMouseenter:n[1]||(n[1]=()=>e.unref(F)(!0)),onMouseleave:n[2]||(n[2]=()=>e.unref(F)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(me.PenAndPaper,{key:0,parent:p.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:L},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),oe.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:T,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:z,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ce._sfc_main,{key:`title_${X.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.unref(M)||e.unref(E))?(e.openBlock(),e.createBlock(Q.UserOptions,{ref:"details",key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(q),isImaging:e.unref(H),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:ne,onGeneratePdf:e.unref(U),onGenerateCsv:Z,onGenerateImage:e.unref(R),onToggleTable:J,onToggleAnnotator:L,style:e.normalizeStyle({visibility:e.unref(M)?e.unref(E)?"visible":"hidden":"visible"})},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","style"])):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(fe._sfc_main),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.ticks,(l,o)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left+o*r.value.width/(i.value.ticks.length-1),x2:r.value.left+o*r.value.width/(i.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,_e))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",Ce,[(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*c.value,y2:r.value.top+o*c.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,we))),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,Be)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(),e.createElementBlock("g",Ne,[(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*c.value+(t.value.style.chart.labels.yAxisLabels.showProgression?c.value/3:c.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,Ee))),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*c.value+c.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,$e))),256)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(),e.createElementBlock("g",Le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.ticks,(l,o)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left+o*(r.value.width/(i.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,Se))),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,ze),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.startColor,.1)},null,8,Ae),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Pe)],8,Ve),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,Xe),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.endColor,.1)},null,8,De),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Oe)],8,Te)]),(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,Me),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Ge)],8,Fe),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,qe),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,He)],8,Ie)]),t.value.style.chart.plots.link.type==="curved"?(e.openBlock(),e.createElementBlock("g",Ue,[e.createElementVNode("path",{d:`M
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-C3wsuQ2C.cjs"),K=require("./useResponsive-BJ7DTGpm.cjs"),ce=require("./Title-CSyDhu3S.cjs"),Q=require("./usePrinter-Dglf1bsw.cjs"),de=require("./DataTable-DWQiMziO.cjs"),ve=require("./vue-ui-skeleton-99lBQ_mF.cjs"),he=require("./Legend-BstxUr4T.cjs"),ye=require("./vue-ui-accordion-kv5FuXqU.cjs"),ee=require("./useNestedProp-CFwQtnNB.cjs"),fe=require("./PackageVersion-CeJ2R9gK.cjs"),me=require("./PenAndPaper-DQPbe0G_.cjs"),be=require("./useUserOptionState-BgepsfED.cjs"),pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ge=["id"],ke=["xmlns","viewBox"],xe={key:0},_e=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Ce={key:1},we=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Be=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Ne={key:2},Ee=["x","y","font-size","fill","font-weight"],$e=["x","y","font-size","fill"],Le={key:3},Se=["x","y","font-size","fill","font-weight"],Ve=["id"],ze=["stop-color"],Ae=["stop-color"],Pe=["stop-color"],Te=["id"],Xe=["stop-color"],De=["stop-color"],Oe=["stop-color"],Fe=["id"],Me=["stop-color"],Ge=["stop-color"],Ie=["id"],qe=["stop-color"],He=["stop-color"],Ue={key:0},Re=["d","fill"],We={key:1},je=["x","y","height","width","fill"],Ye=["cx","cy","r","fill","stroke","stroke-width"],Ze=["cx","cy","r","fill","stroke","stroke-width"],Je={key:2},Ke=["x","y","fill","font-size"],Qe={key:3},et=["x","y","fill","font-size"],tt={key:5,class:"vue-data-ui-watermark"},lt=["xmlns","height","width"],at=["fill"],ot=["innerHTML"],rt={__name:"vue-ui-dumbbell",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(te,{expose:le,emit:nt}){const y=te,{vue_ui_dumbbell:ae}=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),z=e.ref(null),A=e.ref(null),P=e.ref(null),T=e.ref(null),X=e.ref(0),D=e.ref(0),O=e.ref(0),t=e.computed({get:()=>G(),set:a=>a}),{userOptionsVisible:E,setUserOptionsVisibility:F,keepUserOptionState:M}=be.useUserOptionState({config:t.value});function G(){const a=ee.useNestedProp({userConfig:y.config,defaultConfig:ae});return a.theme?{...ee.useNestedProp({userConfig:s.themes.vue_ui_dumbbell[a.theme]||y.config,defaultConfig:a})}:a}e.watch(()=>y.config,a=>{t.value=G(),E.value=!t.value.showOnChartHover,I(),X.value+=1,D.value+=1,O.value+=1,c.value=t.value.style.chart.rowHeight,g.value=t.value.style.chart.width},{deep:!0}),e.watch(()=>y.dataset,a=>{j()},{deep:!0});const x=e.ref(null);e.onMounted(()=>{I()});function I(){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=K.throttle(()=>{const{width:n,height:l}=K.useResponsive({chart:p.value,title:t.value.style.chart.title.text?z.value:null,legend:t.value.style.chart.legend.show?A.value:null,source:P.value,noTitle:T.value});g.value=n,c.value=l/y.dataset.length,v.value=C()});x.value=new ResizeObserver(a),x.value.observe(p.value.parentNode)}}e.onBeforeUnmount(()=>{x.value&&x.value.disconnect()});const{isPrinting:q,isImaging:H,generatePdf:U,generateImage:R}=Q.usePrinter({elementId:`dumbbell_${d.value}`,fileName:t.value.style.chart.title.text||"vue-ui-dumbbell"}),oe=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),_=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.computed(()=>({max:Math.max(...f.value.flatMap(a=>[a.start,a.end])),min:Math.min(...f.value.flatMap(a=>[a.start,a.end]))})),i=e.computed(()=>s.calculateNiceScale($.value.min<0?$.value.min:0,$.value.max,t.value.style.chart.grid.scaleSteps)),c=e.ref(t.value.style.chart.rowHeight),g=e.ref(t.value.style.chart.width),r=e.computed(()=>{const a=c.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=i.value.ticks.length*(g.value/i.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(i.value.min))/(i.value.max+Math.abs(i.value.min))*r.value.widthPlotReference,o=r.value.left+(a.end+Math.abs(i.value.min))/(i.value.max+Math.abs(i.value.min))*r.value.widthPlotReference,u=l+(o-l)/2;return{...a,startX:l,endX:o,centerX:u,y:r.value.top+n*c.value+c.value/2,endVal:a.start}})}const v=e.ref([]),W=e.ref(null),re=e.computed(()=>f.value.map(a=>a.end).reduce((a,n)=>a+n,0));e.onMounted(()=>{j()});function j(){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>=re.value?(cancelAnimationFrame(W.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(i.value.min))/(i.value.max+Math.abs(i.value.min))*r.value.widthPlotReference,N=r.value.left+(o.endVal+Math.abs(i.value.min))/(i.value.max+Math.abs(i.value.min))*r.value.widthPlotReference,S=h+(N-h)/2;return{...o,startX:h,endX:N,centerX:S,y:r.value.top+u*c.value+c.value/2,endVal:o.endVal}}),a=v.value.map(o=>o.endVal).reduce((o,u)=>o+u,0),W.value=requestAnimationFrame(n))}t.value.useAnimation?n():v.value=C()}const Y=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}]),se=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}),S=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}),ie=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,S,ie]}),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 Z(){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 ne(a){k.value=a,V.value+=1}function ue(){return v.value}function J(){_.value.showTable=!_.value.showTable}const B=e.ref(!1);function L(){B.value=!B.value}return le({getData:ue,generatePdf:U,generateCsv:Z,generateImage:R,toggleTable:J,toggleAnnotator:L}),(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}`,onMouseenter:n[1]||(n[1]=()=>e.unref(F)(!0)),onMouseleave:n[2]||(n[2]=()=>e.unref(F)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(me.PenAndPaper,{key:0,parent:p.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:L},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),oe.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:T,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:z,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ce._sfc_main,{key:`title_${X.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.unref(M)||e.unref(E))?(e.openBlock(),e.createBlock(Q.UserOptions,{ref:"details",key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(q),isImaging:e.unref(H),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:ne,onGeneratePdf:e.unref(U),onGenerateCsv:Z,onGenerateImage:e.unref(R),onToggleTable:J,onToggleAnnotator:L,style:e.normalizeStyle({visibility:e.unref(M)?e.unref(E)?"visible":"hidden":"visible"})},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","style"])):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(fe._sfc_main),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.ticks,(l,o)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left+o*r.value.width/(i.value.ticks.length-1),x2:r.value.left+o*r.value.width/(i.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,_e))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",Ce,[(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*c.value,y2:r.value.top+o*c.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,we))),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,Be)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(),e.createElementBlock("g",Ne,[(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*c.value+(t.value.style.chart.labels.yAxisLabels.showProgression?c.value/3:c.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,Ee))),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*c.value+c.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,$e))),256)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(),e.createElementBlock("g",Le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.ticks,(l,o)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left+o*(r.value.width/(i.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,Se))),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,ze),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.startColor,.1)},null,8,Ae),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Pe)],8,Ve),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,Xe),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.endColor,.1)},null,8,De),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Oe)],8,Te)]),(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,Me),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Ge)],8,Fe),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,qe),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,He)],8,Ie)]),t.value.style.chart.plots.link.type==="curved"?(e.openBlock(),e.createElementBlock("g",Ue,[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,15 +1,15 @@
|
|
|
1
1
|
import { computed as m, ref as v, watch as ye, onMounted as fe, onBeforeUnmount as Oe, openBlock as o, createElementBlock as r, normalizeClass as be, normalizeStyle as F, unref as u, createBlock as L, createCommentVNode as y, createSlots as Ge, withCtx as _, renderSlot as k, normalizeProps as U, guardReactiveProps as R, createVNode as Me, Fragment as w, renderList as $, createElementVNode as i, toDisplayString as A, createTextVNode as ge, nextTick as De } from "vue";
|
|
2
|
-
import { u as Ie, c as pe, t as Fe, o as Ve, e as me, g as Ee, v as _e, D as He, f as z, X as ke, i as B, l as xe, h as Ce, q as We, r as Ue } from "./index-
|
|
2
|
+
import { u as Ie, c as pe, t as Fe, o as Ve, e as me, g as Ee, v as _e, D as He, f as z, X as ke, i as B, l as xe, h as Ce, q as We, r as Ue } from "./index-DhxnZ6ZS.js";
|
|
3
3
|
import { t as Re, u as Be } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { _ as je } from "./Title-
|
|
5
|
-
import { u as qe, U as Ye } from "./usePrinter-
|
|
6
|
-
import { D as Ze } from "./DataTable-
|
|
7
|
-
import Je from "./vue-ui-skeleton-
|
|
8
|
-
import { L as Ke } from "./Legend-
|
|
9
|
-
import Qe from "./vue-ui-accordion-
|
|
10
|
-
import { u as we } from "./useNestedProp-
|
|
11
|
-
import { _ as et } from "./PackageVersion-
|
|
12
|
-
import { P as tt } from "./PenAndPaper-
|
|
4
|
+
import { _ as je } from "./Title-DLo3Zo2_.js";
|
|
5
|
+
import { u as qe, U as Ye } from "./usePrinter-mDGfOQZA.js";
|
|
6
|
+
import { D as Ze } from "./DataTable-jvL0XGWl.js";
|
|
7
|
+
import Je from "./vue-ui-skeleton-pdtGfiV6.js";
|
|
8
|
+
import { L as Ke } from "./Legend-DcIfRSNC.js";
|
|
9
|
+
import Qe from "./vue-ui-accordion-DDp8hUlk.js";
|
|
10
|
+
import { u as we } from "./useNestedProp-BcqToEU0.js";
|
|
11
|
+
import { _ as et } from "./PackageVersion-Ve0s76sL.js";
|
|
12
|
+
import { P as tt } from "./PenAndPaper-IHG7xTmx.js";
|
|
13
13
|
import { u as lt } from "./useUserOptionState-BIvW1Kz7.js";
|
|
14
14
|
import { _ as at } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
15
15
|
const st = ["id"], ot = ["xmlns", "viewBox"], rt = { key: 0 }, nt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], ut = { key: 1 }, it = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], ct = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], dt = { key: 2 }, vt = ["x", "y", "font-size", "fill", "font-weight"], ht = ["x", "y", "font-size", "fill"], yt = { key: 3 }, ft = ["x", "y", "font-size", "fill", "font-weight"], bt = ["id"], gt = ["stop-color"], pt = ["stop-color"], mt = ["stop-color"], _t = ["id"], kt = ["stop-color"], xt = ["stop-color"], Ct = ["stop-color"], wt = ["id"], $t = ["stop-color"], Lt = ["stop-color"], At = ["id"], zt = ["stop-color"], St = ["stop-color"], Xt = { key: 0 }, Nt = ["d", "fill"], Tt = { key: 1 }, Pt = ["x", "y", "height", "width", "fill"], Ot = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Gt = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Mt = { key: 2 }, Dt = ["x", "y", "fill", "font-size"], It = { key: 3 }, Ft = ["x", "y", "fill", "font-size"], Vt = {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { computed as m, onMounted as ze, ref as b, watch as Ye, openBlock as i, createElementBlock as c, normalizeClass as ge, normalizeStyle as x, unref as u, createBlock as O, createCommentVNode as C, createSlots as De, withCtx as y, renderSlot as k, normalizeProps as W, guardReactiveProps as q, createVNode as be, createElementVNode as M, Fragment as P, renderList as F, toDisplayString as R, createTextVNode as Ge, nextTick as Ue } from "vue";
|
|
2
|
-
import { u as Ve, o as Be, e as je, c as ye, t as Xe, a as We, p as Z, b as qe, v as f, f as ke, X as Re, G as we, L as Ze, i as Je, q as Ke, r as Qe } from "./index-
|
|
3
|
-
import { _ as et } from "./Title-
|
|
4
|
-
import { u as tt, U as ot } from "./usePrinter-
|
|
5
|
-
import { D as lt } from "./DataTable-
|
|
6
|
-
import at from "./vue-ui-accordion-
|
|
7
|
-
import nt from "./vue-ui-skeleton-
|
|
8
|
-
import { u as Ce } from "./useNestedProp-
|
|
9
|
-
import { _ as st } from "./PackageVersion-
|
|
10
|
-
import { P as rt } from "./PenAndPaper-
|
|
2
|
+
import { u as Ve, o as Be, e as je, c as ye, t as Xe, a as We, p as Z, b as qe, v as f, f as ke, X as Re, G as we, L as Ze, i as Je, q as Ke, r as Qe } from "./index-DhxnZ6ZS.js";
|
|
3
|
+
import { _ as et } from "./Title-DLo3Zo2_.js";
|
|
4
|
+
import { u as tt, U as ot } from "./usePrinter-mDGfOQZA.js";
|
|
5
|
+
import { D as lt } from "./DataTable-jvL0XGWl.js";
|
|
6
|
+
import at from "./vue-ui-accordion-DDp8hUlk.js";
|
|
7
|
+
import nt from "./vue-ui-skeleton-pdtGfiV6.js";
|
|
8
|
+
import { u as Ce } from "./useNestedProp-BcqToEU0.js";
|
|
9
|
+
import { _ as st } from "./PackageVersion-Ve0s76sL.js";
|
|
10
|
+
import { P as rt } from "./PenAndPaper-IHG7xTmx.js";
|
|
11
11
|
import { u as ut } from "./useUserOptionState-BIvW1Kz7.js";
|
|
12
12
|
import { _ as it } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
13
|
const ct = ["id"], dt = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-BkXYJDpD.cjs"),ke=require("./Title-B7ruS8yl.cjs"),te=require("./usePrinter-DHv-BwME.cjs"),ye=require("./DataTable-CwAdpLng.cjs"),be=require("./vue-ui-accordion-kr18wKfc.cjs"),Ce=require("./vue-ui-skeleton-BTN1PKkz.cjs"),oe=require("./useNestedProp-C6IvqE-r.cjs"),we=require("./PackageVersion-C1F3QLoY.cjs"),Ne=require("./PenAndPaper-DDheVRNG.cjs"),xe=require("./useUserOptionState-BgepsfED.cjs"),Be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),$e=["id"],_e={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},Se={key:2,style:"width:100%;background:transparent;padding-bottom:24px"},Pe=["xmlns","viewBox"],Ee=["id"],Te=["stop-color"],Oe=["stop-color"],Fe=["d","fill","stroke","stroke-width"],Le=["x","y","height","width","fill","stroke","stroke-width","onMouseenter"],ze=["x","y","font-size","fill"],Ve=["x","y","font-size","fill"],Ie={key:4,class:"vue-data-ui-watermark"},Ae={key:6,ref:"source",dir:"auto"},He=["innerHTML"],Me={__name:"vue-ui-flow",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(le,{expose:ne}){const f=le,{vue_ui_flow:ae}=s.useConfig(),B=e.computed(()=>!!f.dataset&&f.dataset.length);e.onMounted(()=>{z()});function z(){s.objectIsEmpty(f.dataset)&&s.error({componentName:"VueUiFlow",type:"dataset"})}const $=e.ref(s.createUid()),_=e.ref(null),V=e.ref(0),I=e.ref(0),y=e.ref(!1);function re(o){y.value=o,V.value+=1}const t=e.computed({get:()=>M(),set:o=>o}),{userOptionsVisible:S,setUserOptionsVisibility:A,keepUserOptionState:H}=xe.useUserOptionState({config:t.value});function M(){const o=oe.useNestedProp({userConfig:f.config,defaultConfig:ae});return o.theme?{...oe.useNestedProp({userConfig:s.themes.vue_ui_flow[o.theme]||f.config,defaultConfig:o}),customPalette:s.themePalettes[o.theme]||s.palette}:o}e.watch(()=>f.config,o=>{t.value=M(),S.value=!t.value.showOnChartHover,z(),I.value+=1},{deep:!0});const{isPrinting:q,isImaging:D,generatePdf:U,generateImage:Y}=te.usePrinter({elementId:`flow_${$.value}`,fileName:t.value.style.chart.title.text||"vue-ui-flow"}),se=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),P=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),G=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}),j=e.computed(()=>t.value.style.chart.links.width),E=e.computed(()=>!f.dataset||!f.dataset.length?[]:f.dataset.map(o=>[o[0],o[1],s.checkNaN(o[2])])),W=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 ue(o){return o/W.value*100+t.value.style.chart.nodes.minHeight}function ie(o){const n=t.value.style.chart.nodes.minHeight;return(o-n)/100*W.value}function ce(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=ue(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)*j.value+t.value.style.chart.padding.left,y:i,absoluteY:i,height:p,i:k,color:n[v].color,value:ie(p)},i+=p+G.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],J=s.checkNaN(i),K=s.checkNaN(i+k/n[u].outflow*F.height),Q=s.checkNaN(x),ee=s.checkNaN(x+k/n[v].inflow*L.height),ge={id:s.createUid(),source:u,target:v,path:`M ${s.checkNaN(F.x)+s.checkNaN(g.value)} ${J} L ${s.checkNaN(F.x)+s.checkNaN(g.value)} ${K} L ${s.checkNaN(L.x)} ${ee} L ${s.checkNaN(L.x)} ${Q} Z`,value:k,sourceColor:n[u].color,targetColor:n[v].color};c.push(ge),i+=K-J,a[v].y+=ee-Q})}return{nodeCoordinates:a,links:c}}const h=e.computed(()=>{const o=ce(f.dataset);return{nodes:Object.keys(o.nodeCoordinates).map((n,l)=>({...o.nodeCoordinates[n],name:n})),links:o.links}}),de=e.computed(()=>ve(h.value.nodes));function ve(o){const n={};for(const r in o){const{x:a,height:c}=o[r];n[a]||(n[a]=0),n[a]+=c+G.value}return Math.max(...Object.values(n))}const T=e.computed(()=>{const{top:o,right:n,left:l,bottom:r}=t.value.style.chart.padding,a=E.value.length*j.value;return{height:de.value+o+r,width:n+Math.max(...h.value.nodes.map(c=>c.x))+g.value,left:l,top:o,right:a-n,p_top:o,p_bottom:r}});function fe(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 he(o){m.value=fe(o.name),C.value=o.name}function me(){m.value=null,C.value=null}const X=e.computed(()=>h.value.links.map(({source:o,target:n,sourceColor:l,targetColor:r,value:a})=>({source:o,target:n,sourceColor:l,targetColor:r,value:a})));function R(){e.nextTick(()=>{const o=X.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=X.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 pe(){return h.value}function Z(){b.value.showTable=!b.value.showTable}const N=e.ref(!1);function O(){N.value=!N.value}return ne({getData:pe,generateCsv:R,generateImage:Y,generatePdf:U,toggleTable:Z,toggleAnnotator:O}),(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}`,onMouseenter:n[2]||(n[2]=()=>e.unref(A)(!0)),onMouseleave:n[3]||(n[3]=()=>e.unref(A)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ne.PenAndPaper,{key:0,parent:_.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:N.value,onClose:O},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),se.value?(e.openBlock(),e.createElementBlock("div",_e,null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",Se,[(e.openBlock(),e.createBlock(ke._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.unref(H)||e.unref(S))?(e.openBlock(),e.createBlock(te.UserOptions,{ref:"details",key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(q),isImaging:e.unref(D),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:re,onGeneratePdf:e.unref(U),onGenerateCsv:R,onGenerateImage:e.unref(Y),onToggleTable:Z,onToggleAnnotator:O,style:e.normalizeStyle({visibility:e.unref(H)?e.unref(S)?"visible":"hidden":"visible"})},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","style"])):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${T.value.width} ${T.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(we._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.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,Te),e.createElementVNode("stop",{offset:"100%","stop-color":l.targetColor},null,8,Oe)],8,Ee))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.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,Fe))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.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=>he(l),onMouseleave:n[0]||(n[0]=a=>me()),style:e.normalizeStyle(`opacity:${m.value?m.value.includes(l.name)?1:.2:1}`)},null,44,Le))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.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,ze))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.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,Ve))),256)),e.renderSlot(o.$slots,"svg",{svg:T.value},void 0,!0)],14,Pe)),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ie,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(q)||e.unref(D)})),void 0,!0)])):e.createCommentVNode("",!0),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ce.default,{key:5,config:{type:"flow",style:{backgroundColor:t.value.style.chart.backgroundColor}}},null,8,["config"])),o.$slots.source?(e.openBlock(),e.createElementBlock("div",Ae,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createBlock(be.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(ye.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,He)]),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)],46,$e))}},qe=Be._export_sfc(Me,[["__scopeId","data-v-a8be668a"]]);exports.default=qe;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-C3wsuQ2C.cjs"),ke=require("./Title-CSyDhu3S.cjs"),te=require("./usePrinter-Dglf1bsw.cjs"),ye=require("./DataTable-DWQiMziO.cjs"),be=require("./vue-ui-accordion-kv5FuXqU.cjs"),Ce=require("./vue-ui-skeleton-99lBQ_mF.cjs"),oe=require("./useNestedProp-CFwQtnNB.cjs"),we=require("./PackageVersion-CeJ2R9gK.cjs"),Ne=require("./PenAndPaper-DQPbe0G_.cjs"),xe=require("./useUserOptionState-BgepsfED.cjs"),Be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),$e=["id"],_e={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},Se={key:2,style:"width:100%;background:transparent;padding-bottom:24px"},Pe=["xmlns","viewBox"],Ee=["id"],Te=["stop-color"],Oe=["stop-color"],Fe=["d","fill","stroke","stroke-width"],Le=["x","y","height","width","fill","stroke","stroke-width","onMouseenter"],ze=["x","y","font-size","fill"],Ve=["x","y","font-size","fill"],Ie={key:4,class:"vue-data-ui-watermark"},Ae={key:6,ref:"source",dir:"auto"},He=["innerHTML"],Me={__name:"vue-ui-flow",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(le,{expose:ne}){const f=le,{vue_ui_flow:ae}=s.useConfig(),B=e.computed(()=>!!f.dataset&&f.dataset.length);e.onMounted(()=>{z()});function z(){s.objectIsEmpty(f.dataset)&&s.error({componentName:"VueUiFlow",type:"dataset"})}const $=e.ref(s.createUid()),_=e.ref(null),V=e.ref(0),I=e.ref(0),y=e.ref(!1);function re(o){y.value=o,V.value+=1}const t=e.computed({get:()=>M(),set:o=>o}),{userOptionsVisible:S,setUserOptionsVisibility:A,keepUserOptionState:H}=xe.useUserOptionState({config:t.value});function M(){const o=oe.useNestedProp({userConfig:f.config,defaultConfig:ae});return o.theme?{...oe.useNestedProp({userConfig:s.themes.vue_ui_flow[o.theme]||f.config,defaultConfig:o}),customPalette:s.themePalettes[o.theme]||s.palette}:o}e.watch(()=>f.config,o=>{t.value=M(),S.value=!t.value.showOnChartHover,z(),I.value+=1},{deep:!0});const{isPrinting:q,isImaging:D,generatePdf:U,generateImage:Y}=te.usePrinter({elementId:`flow_${$.value}`,fileName:t.value.style.chart.title.text||"vue-ui-flow"}),se=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),P=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),G=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}),j=e.computed(()=>t.value.style.chart.links.width),E=e.computed(()=>!f.dataset||!f.dataset.length?[]:f.dataset.map(o=>[o[0],o[1],s.checkNaN(o[2])])),W=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 ue(o){return o/W.value*100+t.value.style.chart.nodes.minHeight}function ie(o){const n=t.value.style.chart.nodes.minHeight;return(o-n)/100*W.value}function ce(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=ue(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)*j.value+t.value.style.chart.padding.left,y:i,absoluteY:i,height:p,i:k,color:n[v].color,value:ie(p)},i+=p+G.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],J=s.checkNaN(i),K=s.checkNaN(i+k/n[u].outflow*F.height),Q=s.checkNaN(x),ee=s.checkNaN(x+k/n[v].inflow*L.height),ge={id:s.createUid(),source:u,target:v,path:`M ${s.checkNaN(F.x)+s.checkNaN(g.value)} ${J} L ${s.checkNaN(F.x)+s.checkNaN(g.value)} ${K} L ${s.checkNaN(L.x)} ${ee} L ${s.checkNaN(L.x)} ${Q} Z`,value:k,sourceColor:n[u].color,targetColor:n[v].color};c.push(ge),i+=K-J,a[v].y+=ee-Q})}return{nodeCoordinates:a,links:c}}const h=e.computed(()=>{const o=ce(f.dataset);return{nodes:Object.keys(o.nodeCoordinates).map((n,l)=>({...o.nodeCoordinates[n],name:n})),links:o.links}}),de=e.computed(()=>ve(h.value.nodes));function ve(o){const n={};for(const r in o){const{x:a,height:c}=o[r];n[a]||(n[a]=0),n[a]+=c+G.value}return Math.max(...Object.values(n))}const T=e.computed(()=>{const{top:o,right:n,left:l,bottom:r}=t.value.style.chart.padding,a=E.value.length*j.value;return{height:de.value+o+r,width:n+Math.max(...h.value.nodes.map(c=>c.x))+g.value,left:l,top:o,right:a-n,p_top:o,p_bottom:r}});function fe(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 he(o){m.value=fe(o.name),C.value=o.name}function me(){m.value=null,C.value=null}const X=e.computed(()=>h.value.links.map(({source:o,target:n,sourceColor:l,targetColor:r,value:a})=>({source:o,target:n,sourceColor:l,targetColor:r,value:a})));function R(){e.nextTick(()=>{const o=X.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=X.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 pe(){return h.value}function Z(){b.value.showTable=!b.value.showTable}const N=e.ref(!1);function O(){N.value=!N.value}return ne({getData:pe,generateCsv:R,generateImage:Y,generatePdf:U,toggleTable:Z,toggleAnnotator:O}),(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}`,onMouseenter:n[2]||(n[2]=()=>e.unref(A)(!0)),onMouseleave:n[3]||(n[3]=()=>e.unref(A)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ne.PenAndPaper,{key:0,parent:_.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:N.value,onClose:O},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),se.value?(e.openBlock(),e.createElementBlock("div",_e,null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",Se,[(e.openBlock(),e.createBlock(ke._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.unref(H)||e.unref(S))?(e.openBlock(),e.createBlock(te.UserOptions,{ref:"details",key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(q),isImaging:e.unref(D),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:re,onGeneratePdf:e.unref(U),onGenerateCsv:R,onGenerateImage:e.unref(Y),onToggleTable:Z,onToggleAnnotator:O,style:e.normalizeStyle({visibility:e.unref(H)?e.unref(S)?"visible":"hidden":"visible"})},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","style"])):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${T.value.width} ${T.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(we._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.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,Te),e.createElementVNode("stop",{offset:"100%","stop-color":l.targetColor},null,8,Oe)],8,Ee))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.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,Fe))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.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=>he(l),onMouseleave:n[0]||(n[0]=a=>me()),style:e.normalizeStyle(`opacity:${m.value?m.value.includes(l.name)?1:.2:1}`)},null,44,Le))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.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,ze))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.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,Ve))),256)),e.renderSlot(o.$slots,"svg",{svg:T.value},void 0,!0)],14,Pe)),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ie,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(q)||e.unref(D)})),void 0,!0)])):e.createCommentVNode("",!0),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ce.default,{key:5,config:{type:"flow",style:{backgroundColor:t.value.style.chart.backgroundColor}}},null,8,["config"])),o.$slots.source?(e.openBlock(),e.createElementBlock("div",Ae,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createBlock(be.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(ye.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,He)]),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)],46,$e))}},qe=Be._export_sfc(Me,[["__scopeId","data-v-a8be668a"]]);exports.default=qe;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useCssVars as _e, computed as c, onMounted as Le, ref as i, watch as Te, openBlock as s, createElementBlock as u, normalizeClass as T, normalizeStyle as $, unref as r, createBlock as A, createCommentVNode as b, createSlots as Ae, withCtx as p, renderSlot as k, normalizeProps as X, guardReactiveProps as j, createElementVNode as C, mergeProps as Y, Fragment as M, renderList as B, toDisplayString as U, createTextVNode as Ne, nextTick as ze } from "vue";
|
|
2
|
-
import { u as Oe, o as Se, e as fe, g as Pe, c as Fe, d as De, l as Ie, i as V, f as G, X as Me, G as Be, t as Ue, q as Ve, r as Ge, F as q } from "./index-
|
|
3
|
-
import { u as be } from "./useNestedProp-
|
|
4
|
-
import { u as Re, U as Ee } from "./usePrinter-
|
|
5
|
-
import { _ as He } from "./Title-
|
|
6
|
-
import { P as Xe } from "./PenAndPaper-
|
|
7
|
-
import { D as je } from "./DataTable-
|
|
8
|
-
import Ye from "./vue-ui-accordion-
|
|
2
|
+
import { u as Oe, o as Se, e as fe, g as Pe, c as Fe, d as De, l as Ie, i as V, f as G, X as Me, G as Be, t as Ue, q as Ve, r as Ge, F as q } from "./index-DhxnZ6ZS.js";
|
|
3
|
+
import { u as be } from "./useNestedProp-BcqToEU0.js";
|
|
4
|
+
import { u as Re, U as Ee } from "./usePrinter-mDGfOQZA.js";
|
|
5
|
+
import { _ as He } from "./Title-DLo3Zo2_.js";
|
|
6
|
+
import { P as Xe } from "./PenAndPaper-IHG7xTmx.js";
|
|
7
|
+
import { D as je } from "./DataTable-jvL0XGWl.js";
|
|
8
|
+
import Ye from "./vue-ui-accordion-DDp8hUlk.js";
|
|
9
9
|
import { t as qe, u as We } from "./useResponsive-CoxXLe23.js";
|
|
10
|
-
import Je from "./vue-ui-skeleton-
|
|
10
|
+
import Je from "./vue-ui-skeleton-pdtGfiV6.js";
|
|
11
11
|
import { u as Ke } from "./useUserOptionState-BIvW1Kz7.js";
|
|
12
12
|
import { _ as Qe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
13
|
const Ze = ["id"], et = ["xmlns", "viewBox"], tt = ["id"], at = ["stop-color"], lt = ["stop-color"], st = ["stop-color"], ot = ["stroke", "stroke-width"], nt = ["stroke", "stroke-width"], rt = ["x", "y", "font-size", "fill", "font-weight"], ut = ["points", "fill"], it = ["stroke", "stroke-width", "rx"], ct = ["x", "y", "font-size", "fill", "font-weight"], vt = ["x", "y", "font-size", "fill", "font-weight"], dt = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-BkXYJDpD.cjs"),W=require("./useNestedProp-C6IvqE-r.cjs"),J=require("./usePrinter-DHv-BwME.cjs"),se=require("./Title-B7ruS8yl.cjs"),ue=require("./PenAndPaper-DDheVRNG.cjs"),ie=require("./DataTable-CwAdpLng.cjs"),ce=require("./vue-ui-accordion-kr18wKfc.cjs"),K=require("./useResponsive-BJ7DTGpm.cjs"),ve=require("./vue-ui-skeleton-BTN1PKkz.cjs"),de=require("./useUserOptionState-BgepsfED.cjs"),he=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),me=["id"],fe=["xmlns","viewBox"],pe=["id"],be=["stop-color"],ye=["stop-color"],ge=["stop-color"],ke=["stroke","stroke-width"],Ce=["stroke","stroke-width"],we=["x","y","font-size","fill","font-weight"],xe=["points","fill"],Le=["stroke","stroke-width","rx"],Be=["x","y","font-size","fill","font-weight"],$e=["x","y","font-size","fill","font-weight"],Se={key:5,class:"vue-data-ui-watermark"},_e=["innerHTML"],Ne={__name:"vue-ui-funnel",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(Q,{expose:Z}){const d=Q;e.useCssVars(l=>({"2b4b0562":re.value}));const{vue_ui_funnel:ee}=r.useConfig(),b=e.computed(()=>!!d.dataset&&d.dataset.length);e.onMounted(z);function z(){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=K.throttle(()=>{const{width:o,height:a}=K.useResponsive({chart:g.value,title:t.value.style.chart.title.text?O.value:null,source:V.value,noTitle:E.value});c.value.height=a,c.value.width=o,m.value=H(),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()),T=e.ref(0),A=e.ref(0),P=e.ref(0),E=e.ref(null),V=e.ref(null),O=e.ref(null),D=e.ref(null),f=e.ref(!1);function F(){const l=W.useNestedProp({userConfig:d.config,defaultConfig:ee});return l.theme?{...W.useNestedProp({userConfig:r.themes.vue_ui_funnel[l.theme]||d.config,defaultConfig:l})}:l}const t=e.computed({get:()=>F(),set:l=>l}),{userOptionsVisible:S,setUserOptionsVisibility:I,keepUserOptionState:M}=de.useUserOptionState({config:t.value});e.watch(()=>d.config,l=>{t.value=F(),S.value=!t.value.showOnChartHover,z(),A.value+=1,P.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:q,isImaging:R,generatePdf:U,generateImage:G}=J.usePrinter({elementId:`funnel_${k.value}`,fileName:t.value.style.chart.title.text||"vue-ui-funnel"}),te=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 H(){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(H()),y=e.computed(()=>m.value.height/d.dataset.length),p=e.computed(()=>y.value*t.value.style.chart.bars.gapRatio),j=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-j.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+j.value,y:s}})),ae=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}`}),le=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 oe(l){C.value=l,T.value+=1}const re=e.computed(()=>`${h.value.length*150}ms`),B=e.ref(!1);function _(){B.value=!B.value}function X(){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 Y(){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 ne(){return h.value}return Z({getData:ne,generatePdf:U,generateCsv:Y,generateImage:G,toggleTable:X,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}`,onMouseenter:o[1]||(o[1]=()=>e.unref(I)(!0)),onMouseleave:o[2]||(o[2]=()=>e.unref(I)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ue.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),te.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:E,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:O,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(se._sfc_main,{key:`title_${A.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.unref(M)||e.unref(S))?(e.openBlock(),e.createBlock(J.UserOptions,{ref:"details",key:`user_option_${T.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(q),isImaging:e.unref(R),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:oe,onGeneratePdf:e.unref(U),onGenerateImage:e.unref(G),onToggleTable:X,onGenerateCsv:Y,style:e.normalizeStyle({visibility:e.unref(M)?e.unref(S)?"visible":"hidden":"visible"})},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","style"])):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,be),e.createElementVNode("stop",{offset:"20%","stop-color":t.value.style.chart.area.color},null,8,ye),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.area.color},null,8,ge)],8,pe)]),t.value.style.chart.circleLinks.show?(e.openBlock(),e.createElementBlock("line",e.mergeProps({key:0},le.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,ke)):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,Ce))),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,we))),256)),t.value.style.chart.area.show?(e.openBlock(),e.createElementBlock("polygon",{key:1,points:ae.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,xe)):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,Le))),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,Be),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,$e)]))),256)),e.renderSlot(l.$slots,"svg",{svg:c.value},void 0,!0)],14,fe)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Se,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(q)||e.unref(R)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ve.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:V,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createBlock(ce.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(ie.DataTable,{key:`table_${P.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,_e)]),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)],46,me))}},ze=he._export_sfc(Ne,[["__scopeId","data-v-11626943"]]);exports.default=ze;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-C3wsuQ2C.cjs"),W=require("./useNestedProp-CFwQtnNB.cjs"),J=require("./usePrinter-Dglf1bsw.cjs"),se=require("./Title-CSyDhu3S.cjs"),ue=require("./PenAndPaper-DQPbe0G_.cjs"),ie=require("./DataTable-DWQiMziO.cjs"),ce=require("./vue-ui-accordion-kv5FuXqU.cjs"),K=require("./useResponsive-BJ7DTGpm.cjs"),ve=require("./vue-ui-skeleton-99lBQ_mF.cjs"),de=require("./useUserOptionState-BgepsfED.cjs"),he=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),me=["id"],fe=["xmlns","viewBox"],pe=["id"],be=["stop-color"],ye=["stop-color"],ge=["stop-color"],ke=["stroke","stroke-width"],Ce=["stroke","stroke-width"],we=["x","y","font-size","fill","font-weight"],xe=["points","fill"],Le=["stroke","stroke-width","rx"],Be=["x","y","font-size","fill","font-weight"],$e=["x","y","font-size","fill","font-weight"],Se={key:5,class:"vue-data-ui-watermark"},_e=["innerHTML"],Ne={__name:"vue-ui-funnel",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(Q,{expose:Z}){const d=Q;e.useCssVars(l=>({"2b4b0562":re.value}));const{vue_ui_funnel:ee}=r.useConfig(),b=e.computed(()=>!!d.dataset&&d.dataset.length);e.onMounted(z);function z(){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=K.throttle(()=>{const{width:o,height:a}=K.useResponsive({chart:g.value,title:t.value.style.chart.title.text?O.value:null,source:V.value,noTitle:E.value});c.value.height=a,c.value.width=o,m.value=H(),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()),T=e.ref(0),A=e.ref(0),P=e.ref(0),E=e.ref(null),V=e.ref(null),O=e.ref(null),D=e.ref(null),f=e.ref(!1);function F(){const l=W.useNestedProp({userConfig:d.config,defaultConfig:ee});return l.theme?{...W.useNestedProp({userConfig:r.themes.vue_ui_funnel[l.theme]||d.config,defaultConfig:l})}:l}const t=e.computed({get:()=>F(),set:l=>l}),{userOptionsVisible:S,setUserOptionsVisibility:I,keepUserOptionState:M}=de.useUserOptionState({config:t.value});e.watch(()=>d.config,l=>{t.value=F(),S.value=!t.value.showOnChartHover,z(),A.value+=1,P.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:q,isImaging:R,generatePdf:U,generateImage:G}=J.usePrinter({elementId:`funnel_${k.value}`,fileName:t.value.style.chart.title.text||"vue-ui-funnel"}),te=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 H(){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(H()),y=e.computed(()=>m.value.height/d.dataset.length),p=e.computed(()=>y.value*t.value.style.chart.bars.gapRatio),j=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-j.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+j.value,y:s}})),ae=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}`}),le=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 oe(l){C.value=l,T.value+=1}const re=e.computed(()=>`${h.value.length*150}ms`),B=e.ref(!1);function _(){B.value=!B.value}function X(){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 Y(){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 ne(){return h.value}return Z({getData:ne,generatePdf:U,generateCsv:Y,generateImage:G,toggleTable:X,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}`,onMouseenter:o[1]||(o[1]=()=>e.unref(I)(!0)),onMouseleave:o[2]||(o[2]=()=>e.unref(I)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ue.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),te.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:E,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:O,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(se._sfc_main,{key:`title_${A.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.unref(M)||e.unref(S))?(e.openBlock(),e.createBlock(J.UserOptions,{ref:"details",key:`user_option_${T.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(q),isImaging:e.unref(R),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:oe,onGeneratePdf:e.unref(U),onGenerateImage:e.unref(G),onToggleTable:X,onGenerateCsv:Y,style:e.normalizeStyle({visibility:e.unref(M)?e.unref(S)?"visible":"hidden":"visible"})},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","style"])):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,be),e.createElementVNode("stop",{offset:"20%","stop-color":t.value.style.chart.area.color},null,8,ye),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.area.color},null,8,ge)],8,pe)]),t.value.style.chart.circleLinks.show?(e.openBlock(),e.createElementBlock("line",e.mergeProps({key:0},le.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,ke)):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,Ce))),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,we))),256)),t.value.style.chart.area.show?(e.openBlock(),e.createElementBlock("polygon",{key:1,points:ae.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,xe)):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,Le))),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,Be),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,$e)]))),256)),e.renderSlot(l.$slots,"svg",{svg:c.value},void 0,!0)],14,fe)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Se,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(q)||e.unref(R)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ve.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:V,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createBlock(ce.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(ie.DataTable,{key:`table_${P.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,_e)]),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)],46,me))}},ze=he._export_sfc(Ne,[["__scopeId","data-v-11626943"]]);exports.default=ze;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as h, onMounted as Le, ref as u, watch as Fe, openBlock as o, createElementBlock as i, normalizeClass as A, normalizeStyle as V, unref as n, createBlock as $, createCommentVNode as c, createSlots as Ie, withCtx as v, renderSlot as d, normalizeProps as S, guardReactiveProps as O, createVNode as ie, createElementVNode as _, Fragment as ce, renderList as ve, createTextVNode as de, toDisplayString as E, nextTick as Ae } from "vue";
|
|
2
|
-
import { u as Ve, o as Ee, e as he, g as Me, c as pe, t as De, a as Be, p as M, b as Ge, d as ze, J as ye, M as Ue, f as k, X as We, i as fe, x as ge, y as He, q as Xe, r as Re } from "./index-
|
|
3
|
-
import { L as Ye } from "./Legend-
|
|
4
|
-
import { _ as je } from "./Title-
|
|
5
|
-
import { _ as qe } from "./Tooltip-
|
|
6
|
-
import { D as Je } from "./DataTable-
|
|
7
|
-
import { u as Ke, U as Qe } from "./usePrinter-
|
|
8
|
-
import Ze from "./vue-ui-skeleton-
|
|
9
|
-
import et from "./vue-ui-accordion-
|
|
10
|
-
import { u as be } from "./useNestedProp-
|
|
11
|
-
import { _ as tt } from "./PackageVersion-
|
|
12
|
-
import { P as lt } from "./PenAndPaper-
|
|
2
|
+
import { u as Ve, o as Ee, e as he, g as Me, c as pe, t as De, a as Be, p as M, b as Ge, d as ze, J as ye, M as Ue, f as k, X as We, i as fe, x as ge, y as He, q as Xe, r as Re } from "./index-DhxnZ6ZS.js";
|
|
3
|
+
import { L as Ye } from "./Legend-DcIfRSNC.js";
|
|
4
|
+
import { _ as je } from "./Title-DLo3Zo2_.js";
|
|
5
|
+
import { _ as qe } from "./Tooltip-CA1QhFeE.js";
|
|
6
|
+
import { D as Je } from "./DataTable-jvL0XGWl.js";
|
|
7
|
+
import { u as Ke, U as Qe } from "./usePrinter-mDGfOQZA.js";
|
|
8
|
+
import Ze from "./vue-ui-skeleton-pdtGfiV6.js";
|
|
9
|
+
import et from "./vue-ui-accordion-DDp8hUlk.js";
|
|
10
|
+
import { u as be } from "./useNestedProp-BcqToEU0.js";
|
|
11
|
+
import { _ as tt } from "./PackageVersion-Ve0s76sL.js";
|
|
12
|
+
import { P as lt } from "./PenAndPaper-IHG7xTmx.js";
|
|
13
13
|
import { u as at } from "./useUserOptionState-BIvW1Kz7.js";
|
|
14
14
|
import { _ as ot } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
15
15
|
const st = ["id"], rt = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-BkXYJDpD.cjs"),ue=require("./Legend-CR9ydX8N.cjs"),ie=require("./Title-B7ruS8yl.cjs"),ce=require("./Tooltip-BqSN71SL.cjs"),de=require("./DataTable-CwAdpLng.cjs"),j=require("./usePrinter-DHv-BwME.cjs"),ve=require("./vue-ui-skeleton-BTN1PKkz.cjs"),pe=require("./vue-ui-accordion-kr18wKfc.cjs"),Y=require("./useNestedProp-C6IvqE-r.cjs"),he=require("./PackageVersion-C1F3QLoY.cjs"),fe=require("./PenAndPaper-DDheVRNG.cjs"),ye=require("./useUserOptionState-BgepsfED.cjs"),ge=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),me=["id"],be={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},ke={key:2,style:"width:100%;background:transparent;padding-bottom:24px"},Ce=["xmlns","viewBox"],we=["id"],xe=["stdDeviation"],$e=["d","stroke","stroke-width"],Be=["d","stroke","stroke-width"],Se=["filter"],Ne=["d","stroke","stroke-width"],Te=["d","stroke-width","onMouseenter","onClick"],Pe={key:5,class:"vue-data-ui-watermark"},_e=["onClick"],Ve={key:0},Ee={key:1},Le={key:8,ref:"source",dir:"auto"},Oe=["innerHTML"],Fe={__name:"vue-ui-galaxy",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(J,{expose:K,emit:_}){const i=J,{vue_ui_galaxy:Q}=r.useConfig(),b=e.computed(()=>!!i.dataset&&i.dataset.length);e.onMounted(()=>{V()});function V(){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),Z=e.ref(null),x=e.ref(!1),$=e.ref(""),c=e.ref(null),E=e.ref(0),L=e.ref(0),O=e.ref(0),F=e.ref(0),t=e.computed({get:()=>I(),set:l=>l}),{userOptionsVisible:B,setUserOptionsVisibility:A,keepUserOptionState:z}=ye.useUserOptionState({config:t.value});function I(){const l=Y.useNestedProp({userConfig:i.config,defaultConfig:Q});return l.theme?{...Y.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=I(),B.value=!t.value.showOnChartHover,V(),L.value+=1,O.value+=1,F.value+=1},{deep:!0});const{isPrinting:D,isImaging:q,generatePdf:M,generateImage:U}=j.usePrinter({elementId:`galaxy_${g.value}`,fileName:t.value.style.chart.title.text||"vue-ui-galaxy"}),ee=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),te=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}),S=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),_("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)||te.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 le(){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)),oe=e.ref(190),G=e.computed(()=>h.value.filter(l=>!u.value.includes(l.id))),m=e.computed(()=>{const l=[];for(let a=0;a<G.value.length;a+=1){const o=G.value[a];let n=o.value/d.value*oe.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 ae(l){y.value=l,E.value+=1}const T=e.ref(null);function re({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 W=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)}))),ne=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 H(){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 se=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},se,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 R(){v.value.showTable=!v.value.showTable}function X(){v.value.showTooltip=!v.value.showTooltip}const w=e.ref(!1);function P(){w.value=!w.value}return K({getData:le,generatePdf:M,generateCsv:H,generateImage:U,toggleTable:R,toggleTooltip:X,toggleAnnotator:P}),(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}`,onMouseenter:a[3]||(a[3]=()=>e.unref(A)(!0)),onMouseleave:a[4]||(a[4]=()=>e.unref(A)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(fe.PenAndPaper,{key:0,parent:k.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:P},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ee.value?(e.openBlock(),e.createElementBlock("div",be,null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",ke,[(e.openBlock(),e.createBlock(ie._sfc_main,{key:`title_${L.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.unref(z)||e.unref(B))?(e.openBlock(),e.createBlock(j.UserOptions,{ref_key:"details",ref:Z,key:`user_option_${E.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(D),isImaging:e.unref(q),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:ae,onGeneratePdf:e.unref(M),onGenerateCsv:H,onGenerateImage:e.unref(U),onToggleTable:R,onToggleTooltip:X,onToggleAnnotator:P,style:e.normalizeStyle({visibility:e.unref(z)?e.unref(B)?"visible":"hidden":"visible"})},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","style"])):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 ${S.value.width} ${S.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(he._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,xe)],8,we)]),(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,$e)):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,Be)):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,Ne)],8,Se)):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=>re({datapoint:o,relativeIndex:n,seriesIndex:o.seriesIndex,show:!0}),onMouseleave:a[0]||(a[0]=s=>{x.value=!1,c.value=null}),onClick:s=>_("selectDatapoint",o)},null,40,Te)):e.createCommentVNode("",!0)]))),256)),e.renderSlot(l.$slots,"svg",{svg:S.value},void 0,!0)],14,Ce)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Pe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(D)||e.unref(q)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ve.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(ue.Legend,{key:`legend_${F.value}`,legendSet:W.value,config:ne.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",Ee," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Ve," ("+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,_e)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:W.value},void 0,!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Le,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ce._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(pe.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(de.DataTable,{key:`table_${O.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,Oe)]),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)],46,me))}},Ae=ge._export_sfc(Fe,[["__scopeId","data-v-00c62e74"]]);exports.default=Ae;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-C3wsuQ2C.cjs"),ue=require("./Legend-BstxUr4T.cjs"),ie=require("./Title-CSyDhu3S.cjs"),ce=require("./Tooltip-D88h1zvE.cjs"),de=require("./DataTable-DWQiMziO.cjs"),j=require("./usePrinter-Dglf1bsw.cjs"),ve=require("./vue-ui-skeleton-99lBQ_mF.cjs"),pe=require("./vue-ui-accordion-kv5FuXqU.cjs"),Y=require("./useNestedProp-CFwQtnNB.cjs"),he=require("./PackageVersion-CeJ2R9gK.cjs"),fe=require("./PenAndPaper-DQPbe0G_.cjs"),ye=require("./useUserOptionState-BgepsfED.cjs"),ge=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),me=["id"],be={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},ke={key:2,style:"width:100%;background:transparent;padding-bottom:24px"},Ce=["xmlns","viewBox"],we=["id"],xe=["stdDeviation"],$e=["d","stroke","stroke-width"],Be=["d","stroke","stroke-width"],Se=["filter"],Ne=["d","stroke","stroke-width"],Te=["d","stroke-width","onMouseenter","onClick"],Pe={key:5,class:"vue-data-ui-watermark"},_e=["onClick"],Ve={key:0},Ee={key:1},Le={key:8,ref:"source",dir:"auto"},Oe=["innerHTML"],Fe={__name:"vue-ui-galaxy",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(J,{expose:K,emit:_}){const i=J,{vue_ui_galaxy:Q}=r.useConfig(),b=e.computed(()=>!!i.dataset&&i.dataset.length);e.onMounted(()=>{V()});function V(){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),Z=e.ref(null),x=e.ref(!1),$=e.ref(""),c=e.ref(null),E=e.ref(0),L=e.ref(0),O=e.ref(0),F=e.ref(0),t=e.computed({get:()=>I(),set:l=>l}),{userOptionsVisible:B,setUserOptionsVisibility:A,keepUserOptionState:z}=ye.useUserOptionState({config:t.value});function I(){const l=Y.useNestedProp({userConfig:i.config,defaultConfig:Q});return l.theme?{...Y.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=I(),B.value=!t.value.showOnChartHover,V(),L.value+=1,O.value+=1,F.value+=1},{deep:!0});const{isPrinting:D,isImaging:q,generatePdf:M,generateImage:U}=j.usePrinter({elementId:`galaxy_${g.value}`,fileName:t.value.style.chart.title.text||"vue-ui-galaxy"}),ee=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),te=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}),S=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),_("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)||te.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 le(){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)),oe=e.ref(190),G=e.computed(()=>h.value.filter(l=>!u.value.includes(l.id))),m=e.computed(()=>{const l=[];for(let a=0;a<G.value.length;a+=1){const o=G.value[a];let n=o.value/d.value*oe.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 ae(l){y.value=l,E.value+=1}const T=e.ref(null);function re({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 W=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)}))),ne=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 H(){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 se=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},se,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 R(){v.value.showTable=!v.value.showTable}function X(){v.value.showTooltip=!v.value.showTooltip}const w=e.ref(!1);function P(){w.value=!w.value}return K({getData:le,generatePdf:M,generateCsv:H,generateImage:U,toggleTable:R,toggleTooltip:X,toggleAnnotator:P}),(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}`,onMouseenter:a[3]||(a[3]=()=>e.unref(A)(!0)),onMouseleave:a[4]||(a[4]=()=>e.unref(A)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(fe.PenAndPaper,{key:0,parent:k.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:P},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ee.value?(e.openBlock(),e.createElementBlock("div",be,null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",ke,[(e.openBlock(),e.createBlock(ie._sfc_main,{key:`title_${L.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.unref(z)||e.unref(B))?(e.openBlock(),e.createBlock(j.UserOptions,{ref_key:"details",ref:Z,key:`user_option_${E.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(D),isImaging:e.unref(q),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:ae,onGeneratePdf:e.unref(M),onGenerateCsv:H,onGenerateImage:e.unref(U),onToggleTable:R,onToggleTooltip:X,onToggleAnnotator:P,style:e.normalizeStyle({visibility:e.unref(z)?e.unref(B)?"visible":"hidden":"visible"})},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","style"])):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 ${S.value.width} ${S.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(he._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,xe)],8,we)]),(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,$e)):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,Be)):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,Ne)],8,Se)):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=>re({datapoint:o,relativeIndex:n,seriesIndex:o.seriesIndex,show:!0}),onMouseleave:a[0]||(a[0]=s=>{x.value=!1,c.value=null}),onClick:s=>_("selectDatapoint",o)},null,40,Te)):e.createCommentVNode("",!0)]))),256)),e.renderSlot(l.$slots,"svg",{svg:S.value},void 0,!0)],14,Ce)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Pe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(D)||e.unref(q)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ve.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(ue.Legend,{key:`legend_${F.value}`,legendSet:W.value,config:ne.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",Ee," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Ve," ("+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,_e)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:W.value},void 0,!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Le,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ce._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(pe.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(de.DataTable,{key:`table_${O.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,Oe)]),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)],46,me))}},Ae=ge._export_sfc(Fe,[["__scopeId","data-v-00c62e74"]]);exports.default=Ae;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { computed as y, ref as d, watch as me, onMounted as Ae, onBeforeUnmount as Re, openBlock as o, createElementBlock as u, normalizeClass as pe, normalizeStyle as L, unref as i, createBlock as R, createCommentVNode as h, withCtx as X, toDisplayString as C, createSlots as Ge, renderSlot as w, normalizeProps as D, guardReactiveProps as B, createVNode as Ee, createElementVNode as p, Fragment as x, renderList as S, mergeProps as G } from "vue";
|
|
2
|
-
import { u as Ue, c as We, t as Te, a as je, p as ge, b as Le, o as ke, d as De, e as E, g as be, m as V, I as z, X as Be, s as q, k as Ve, i as H, f as Z, F as J } from "./index-
|
|
2
|
+
import { u as Ue, c as We, t as Te, a as je, p as ge, b as Le, o as ke, d as De, e as E, g as be, m as V, I as z, X as Be, s as q, k as Ve, i as H, f as Z, F as J } from "./index-DhxnZ6ZS.js";
|
|
3
3
|
import { t as qe, u as He } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { u as Ze, U as Je } from "./usePrinter-
|
|
5
|
-
import Ke from "./vue-ui-skeleton-
|
|
6
|
-
import { _ as Qe } from "./Title-
|
|
7
|
-
import { u as xe } from "./useNestedProp-
|
|
8
|
-
import { _ as et } from "./PackageVersion-
|
|
9
|
-
import { P as tt } from "./PenAndPaper-
|
|
4
|
+
import { u as Ze, U as Je } from "./usePrinter-mDGfOQZA.js";
|
|
5
|
+
import Ke from "./vue-ui-skeleton-pdtGfiV6.js";
|
|
6
|
+
import { _ as Qe } from "./Title-DLo3Zo2_.js";
|
|
7
|
+
import { u as xe } from "./useNestedProp-BcqToEU0.js";
|
|
8
|
+
import { _ as et } from "./PackageVersion-Ve0s76sL.js";
|
|
9
|
+
import { P as tt } from "./PenAndPaper-IHG7xTmx.js";
|
|
10
10
|
import { u as at } from "./useUserOptionState-BIvW1Kz7.js";
|
|
11
11
|
import { _ as lt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
12
12
|
const st = ["id"], rt = { key: 0 }, ot = ["xmlns", "viewBox"], ut = ["id"], nt = ["stop-color"], it = ["stop-color"], ct = ["stop-color"], vt = ["id"], ht = ["stdDeviation"], dt = ["d", "fill", "stroke"], yt = ["id", "d"], ft = ["fill", "font-size", "font-weight"], mt = ["href", "startOffset"], pt = ["x", "y", "text-anchor", "fill", "font-size", "font-weight"], gt = ["d", "filter"], kt = ["stroke", "stroke-width"], bt = ["stroke", "stroke-width"], xt = ["stroke", "stroke-width"], _t = ["stroke", "stroke-width"], wt = { key: 4 }, St = ["x", "y", "text-anchor", "font-size", "font-weight", "fill"], zt = ["x", "y", "font-size", "font-weight", "fill"], $t = { key: 6 }, Ft = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Ct = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Ot = ["x1", "y1", "x2", "y2", "stroke-width", "filter"], Mt = { key: 7 }, Pt = ["d", "fill", "stroke", "stroke-width"], Nt = ["cx", "cy", "fill", "r", "stroke-width", "stroke"], Xt = ["x", "y", "font-size", "fill"], Yt = {
|