vue-data-ui 2.5.6 → 2.5.7
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-D0mlKPSd.js → Arrow-5QI0f9hp.js} +1 -1
- package/dist/{Arrow-DsebY7M5.cjs → Arrow-BQy5IqAX.cjs} +1 -1
- package/dist/{BaseIcon-C_HpYm7J.js → BaseIcon-BXpK120h.js} +1 -1
- package/dist/{BaseIcon-C8K0PDCr.cjs → BaseIcon-Dk8gByg1.cjs} +1 -1
- package/dist/{DataTable-C6-IwvDN.js → DataTable-CpOh1tx3.js} +2 -2
- package/dist/{DataTable-CvEk_3ue.cjs → DataTable-D93-QmC8.cjs} +1 -1
- package/dist/{Legend-_VSW3gtH.cjs → Legend-Dh9aF6uH.cjs} +1 -1
- package/dist/{Legend-BMQRE4wt.js → Legend-DqRstaxU.js} +2 -2
- package/dist/{PackageVersion-D3FEDqJ4.cjs → PackageVersion-CdmZAhdE.cjs} +1 -1
- package/dist/{PackageVersion-CT0EYzFv.js → PackageVersion-iscNRe7N.js} +1 -1
- package/dist/{PenAndPaper-DhMT8zUE.js → PenAndPaper-B-VQ8eSo.js} +3 -3
- package/dist/{PenAndPaper-0PiYibYi.cjs → PenAndPaper-BsncKiRE.cjs} +1 -1
- package/dist/{Shape-DUv8_NIN.js → Shape-CB0mE9KP.js} +1 -1
- package/dist/{Shape-Cilordd5.cjs → Shape-DZRynz5E.cjs} +1 -1
- package/dist/{Slicer-CS9co0ra.cjs → Slicer-Cm0a7Otv.cjs} +1 -1
- package/dist/{Slicer-CT-dGY0K.js → Slicer-DiUftIFQ.js} +2 -2
- package/dist/{Title-BH26TG78.js → Title-CiQQgFbV.js} +1 -1
- package/dist/{Title-BX4Wt59j.cjs → Title-DFq_8HYJ.cjs} +1 -1
- package/dist/{Tooltip-vdsIKE2_.js → Tooltip-ZYQUXVWv.js} +1 -1
- package/dist/{Tooltip-BRF0SCJo.cjs → Tooltip-pcZXVRMj.cjs} +1 -1
- package/dist/index-C_VTEz1N.cjs +9 -0
- package/dist/{index-BpkxOytt.js → index-DiqenHrX.js} +3 -1
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +2 -0
- package/dist/types/vue-data-ui.d.ts +2 -0
- package/dist/{useNestedProp-XW-Jo5ax.js → useNestedProp-B3CQkP95.js} +1 -1
- package/dist/{useNestedProp-C5bsAL3S.cjs → useNestedProp-C7bLHE7v.cjs} +1 -1
- package/dist/{usePrinter-Cbh3Ya4M.js → usePrinter-CHAgX1f-.js} +1 -1
- package/dist/{usePrinter-DOZ7DmEX.cjs → usePrinter-DWCqeYW6.cjs} +1 -1
- package/dist/{vue-data-ui-CwBKTkGS.js → vue-data-ui-BAAnNikX.js} +61 -61
- package/dist/{vue-data-ui-Dbznz6XK.cjs → vue-data-ui-VikO3yRe.cjs} +1 -1
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-DC0EeOla.cjs → vue-ui-3d-bar-BR-ihA3S.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-B0smLY_E.js → vue-ui-3d-bar-C4OjP6pi.js} +9 -9
- package/dist/{vue-ui-accordion-BFGSPdZa.cjs → vue-ui-accordion-CtBhoUw4.cjs} +1 -1
- package/dist/{vue-ui-accordion-DSCrwQ1c.js → vue-ui-accordion-DA6XnWaz.js} +3 -3
- package/dist/{vue-ui-age-pyramid-Cshs8aQx.js → vue-ui-age-pyramid-2AgqaHOS.js} +10 -10
- package/dist/{vue-ui-age-pyramid-Ddrrqt6J.cjs → vue-ui-age-pyramid-E0fCV03f.cjs} +1 -1
- package/dist/{vue-ui-annotator-axaLgcSw.js → vue-ui-annotator-CdLA2R6h.js} +1 -1
- package/dist/{vue-ui-annotator-CZavUoIP.cjs → vue-ui-annotator-UcABxDAz.cjs} +1 -1
- package/dist/{vue-ui-bullet-BZ5bRAeI.js → vue-ui-bullet-AFqmPWo3.js} +8 -8
- package/dist/{vue-ui-bullet-ChqQFfgl.cjs → vue-ui-bullet-C4wEiJn8.cjs} +1 -1
- package/dist/{vue-ui-candlestick-DnyNK5cD.cjs → vue-ui-candlestick-BkQsD1Yi.cjs} +1 -1
- package/dist/{vue-ui-candlestick-Bgh8xG_8.js → vue-ui-candlestick-Bs0DE1Xi.js} +11 -11
- package/dist/{vue-ui-carousel-table-C5VY-kzI.cjs → vue-ui-carousel-table-KX-cLx3F.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-CesPP16e.js → vue-ui-carousel-table-NYlYQbo9.js} +4 -4
- package/dist/{vue-ui-chestnut-CCYod_9i.js → vue-ui-chestnut-BAJjfgKR.js} +8 -8
- package/dist/{vue-ui-chestnut-Lcrru7aA.cjs → vue-ui-chestnut-BzHRBq_Z.cjs} +1 -1
- package/dist/{vue-ui-circle-pack-BCk8TBYV.js → vue-ui-circle-pack-BoolEIij.js} +126 -120
- package/dist/vue-ui-circle-pack-BrmdreXG.cjs +1 -0
- package/dist/{vue-ui-cursor-71zF-JDU.cjs → vue-ui-cursor-BjQLjw1a.cjs} +1 -1
- package/dist/{vue-ui-cursor-DBtL_mGd.js → vue-ui-cursor-ut60ihG1.js} +2 -2
- package/dist/{vue-ui-dashboard-CjUkRkFX.cjs → vue-ui-dashboard-BXVdZdEF.cjs} +1 -1
- package/dist/{vue-ui-dashboard-C4naVahi.js → vue-ui-dashboard-FQxiN7Jj.js} +2 -2
- package/dist/{vue-ui-digits-DsjcFYeL.js → vue-ui-digits-Rb48H8et.js} +2 -2
- package/dist/{vue-ui-digits-DJ053E_1.cjs → vue-ui-digits-j2WKJUNf.cjs} +1 -1
- package/dist/{vue-ui-donut-CgK9ni10.cjs → vue-ui-donut-CbFW--I1.cjs} +1 -1
- package/dist/{vue-ui-donut-WZ50Vvo0.js → vue-ui-donut-DUKnsxUu.js} +12 -12
- package/dist/{vue-ui-donut-evolution-DWmEdszT.cjs → vue-ui-donut-evolution-9mJgbwpR.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-CNLISKb_.js → vue-ui-donut-evolution-n-ue754h.js} +11 -11
- package/dist/{vue-ui-dumbbell-Di6hNJyp.js → vue-ui-dumbbell-C4r0NeY_.js} +10 -10
- package/dist/{vue-ui-dumbbell-CNk9SRIK.cjs → vue-ui-dumbbell-sXSCnY75.cjs} +1 -1
- package/dist/{vue-ui-flow-BVRCJKqg.cjs → vue-ui-flow-C8-oqGo7.cjs} +1 -1
- package/dist/{vue-ui-flow-wzudVfwo.js → vue-ui-flow-CuZbUegy.js} +9 -9
- package/dist/{vue-ui-funnel-BkQ729Lk.cjs → vue-ui-funnel-Cb0LSIxk.cjs} +1 -1
- package/dist/{vue-ui-funnel-DDgrNiIx.js → vue-ui-funnel-D9whnJ6X.js} +9 -9
- package/dist/{vue-ui-galaxy-DDR33VLd.js → vue-ui-galaxy-CRECMRY6.js} +11 -11
- package/dist/{vue-ui-galaxy-CCxgO-Ut.cjs → vue-ui-galaxy-DUHSlUJQ.cjs} +1 -1
- package/dist/{vue-ui-gauge-BmYimTMu.js → vue-ui-gauge-BEhMYmCg.js} +7 -7
- package/dist/{vue-ui-gauge-6nNhmzjK.cjs → vue-ui-gauge-BfmvvI7e.cjs} +1 -1
- package/dist/{vue-ui-gizmo-BEDeV0ju.cjs → vue-ui-gizmo-BkZTXg7I.cjs} +1 -1
- package/dist/{vue-ui-gizmo-D7n0y9Xb.js → vue-ui-gizmo-DtXR6xgr.js} +3 -3
- package/dist/{vue-ui-heatmap-BRouZjc0.cjs → vue-ui-heatmap-B1XZnqbm.cjs} +1 -1
- package/dist/{vue-ui-heatmap-DcvyIipN.js → vue-ui-heatmap-BlBHNDJV.js} +10 -10
- package/dist/{vue-ui-history-plot-CdsNfUw3.js → vue-ui-history-plot-BmzpDPL6.js} +11 -11
- package/dist/{vue-ui-history-plot-OAR3Zmfr.cjs → vue-ui-history-plot-DqM3d3p7.cjs} +1 -1
- package/dist/{vue-ui-kpi-eAJqL_IN.cjs → vue-ui-kpi-D1i-2otW.cjs} +1 -1
- package/dist/{vue-ui-kpi-7w8bSN5A.js → vue-ui-kpi-XdIADLDq.js} +3 -3
- package/dist/{vue-ui-mini-loader-DgW6tqQq.js → vue-ui-mini-loader-BdDY5AwD.js} +2 -2
- package/dist/{vue-ui-mini-loader-Iil3HNis.cjs → vue-ui-mini-loader-DZgbFjuS.cjs} +1 -1
- package/dist/{vue-ui-molecule-Dbzc2SXh.js → vue-ui-molecule-DstYXfTV.js} +11 -11
- package/dist/{vue-ui-molecule-Cdoog-Pu.cjs → vue-ui-molecule-a0IHQMkN.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-U7w0Tah2.cjs → vue-ui-mood-radar-BafPNccC.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-BDHEAPC5.js → vue-ui-mood-radar-DjtnprtG.js} +11 -11
- package/dist/{vue-ui-nested-donuts-hCTBO5wt.cjs → vue-ui-nested-donuts-DC7oX5GH.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-BfFnlW9x.js → vue-ui-nested-donuts-XQ_auu4H.js} +11 -11
- package/dist/{vue-ui-onion-CuVCB7RM.cjs → vue-ui-onion-DEfVifyj.cjs} +1 -1
- package/dist/{vue-ui-onion-B1AiYUgS.js → vue-ui-onion-D_myFmJv.js} +11 -11
- package/dist/{vue-ui-parallel-coordinate-plot-CHSzunQI.cjs → vue-ui-parallel-coordinate-plot-Bv3lIZ0J.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-Box7xMhZ.js → vue-ui-parallel-coordinate-plot-DQsyE4kf.js} +12 -12
- package/dist/{vue-ui-quadrant-DAWxPvEO.js → vue-ui-quadrant-DBvqgk3y.js} +12 -12
- package/dist/{vue-ui-quadrant-CWNw-UWV.cjs → vue-ui-quadrant-DXU4OdLD.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-r3ohg6Cy.js → vue-ui-quick-chart-C-bsRZf1.js} +9 -9
- package/dist/{vue-ui-quick-chart-5OT4sNfY.cjs → vue-ui-quick-chart-Dl-94hQE.cjs} +1 -1
- package/dist/{vue-ui-radar-C1CdBUUI.js → vue-ui-radar-He8orFXJ.js} +12 -12
- package/dist/{vue-ui-radar-nniZ57pv.cjs → vue-ui-radar-QQ8vOOYq.cjs} +1 -1
- package/dist/{vue-ui-rating-B6KkUn_L.cjs → vue-ui-rating-6kyP3DDH.cjs} +1 -1
- package/dist/{vue-ui-rating-BOB44E6x.js → vue-ui-rating-qUauyHHk.js} +2 -2
- package/dist/{vue-ui-relation-circle-CGcO1q75.cjs → vue-ui-relation-circle-BO4wP-bR.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-BHA9HuI0.js → vue-ui-relation-circle-DfVg4VBp.js} +7 -7
- package/dist/{vue-ui-rings-DnrxCB5o.cjs → vue-ui-rings-D_cVoXDa.cjs} +1 -1
- package/dist/{vue-ui-rings-BJPit1Ra.js → vue-ui-rings-DjoVPXun.js} +12 -12
- package/dist/{vue-ui-scatter-BZ027kSK.cjs → vue-ui-scatter-45hc4NIf.cjs} +1 -1
- package/dist/{vue-ui-scatter-DNB5bka2.js → vue-ui-scatter-DBcO00g4.js} +12 -12
- package/dist/{vue-ui-screenshot-CtUiJQiA.cjs → vue-ui-screenshot-lJJxoLDu.cjs} +1 -1
- package/dist/{vue-ui-screenshot-DymukoBK.js → vue-ui-screenshot-zc-jsepS.js} +1 -1
- package/dist/{vue-ui-skeleton-CwwH64lu.js → vue-ui-skeleton-BwWHgSoq.js} +3 -3
- package/dist/{vue-ui-skeleton-BVhUJapg.cjs → vue-ui-skeleton-D1bJntn7.cjs} +1 -1
- package/dist/{vue-ui-smiley-DAOVxquy.js → vue-ui-smiley-BVFxYYJl.js} +2 -2
- package/dist/{vue-ui-smiley-BgYL5aLw.cjs → vue-ui-smiley-CZPe292C.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-Pj2sDKI5.js → vue-ui-spark-trend-8LZqy_wz.js} +5 -5
- package/dist/{vue-ui-spark-trend-D-UfGnMi.cjs → vue-ui-spark-trend-BJ3_K1DU.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-D-odOB5o.cjs → vue-ui-sparkbar-B3idsjFj.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-CouWvtoJ.js → vue-ui-sparkbar-C93PvNz6.js} +4 -4
- package/dist/{vue-ui-sparkgauge-Dp2myRtH.cjs → vue-ui-sparkgauge-66qZ-DgD.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-ntZ966hh.js → vue-ui-sparkgauge-B1uABI9w.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-BBqNkAC9.cjs → vue-ui-sparkhistogram-D7ECtpUW.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-CVcHSsRt.js → vue-ui-sparkhistogram-vAgBJK79.js} +5 -5
- package/dist/{vue-ui-sparkline-B4YkZ8aR.js → vue-ui-sparkline-B2JarTjo.js} +4 -4
- package/dist/{vue-ui-sparkline-D-jKCztU.cjs → vue-ui-sparkline-YOIgP_Dl.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-SlfuB973.js → vue-ui-sparkstackbar-C2E7YRP0.js} +5 -5
- package/dist/{vue-ui-sparkstackbar-CgSpNVWV.cjs → vue-ui-sparkstackbar-DMClZgds.cjs} +1 -1
- package/dist/{vue-ui-stackbar-Do0cVXn_.cjs → vue-ui-stackbar-BP_qrJ-s.cjs} +1 -1
- package/dist/{vue-ui-stackbar-BNHmR_5M.js → vue-ui-stackbar-n27TJh0C.js} +13 -13
- package/dist/{vue-ui-strip-plot-DfvoiHgh.js → vue-ui-strip-plot-Bjy7C_Ry.js} +11 -11
- package/dist/{vue-ui-strip-plot-CUIM6p_e.cjs → vue-ui-strip-plot-DN7X6zBk.cjs} +1 -1
- package/dist/{vue-ui-table-IRFF_yye.cjs → vue-ui-table-6rqw4Gi-.cjs} +1 -1
- package/dist/{vue-ui-table-B1yvOggj.js → vue-ui-table-DnHvIIqi.js} +1 -1
- package/dist/{vue-ui-table-heatmap-BXY52SRf.cjs → vue-ui-table-heatmap-BQKXP9Na.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-GItg9-dC.js → vue-ui-table-heatmap-Dt8DAC4A.js} +4 -4
- package/dist/{vue-ui-table-sparkline-iGFAWMYo.js → vue-ui-table-sparkline-CLQJbHX8.js} +5 -5
- package/dist/{vue-ui-table-sparkline-BHfIm9UT.cjs → vue-ui-table-sparkline-DmNJFPHo.cjs} +1 -1
- package/dist/{vue-ui-thermometer-UICgp_zs.js → vue-ui-thermometer-BTmiPdUs.js} +7 -7
- package/dist/{vue-ui-thermometer-DvqP69hY.cjs → vue-ui-thermometer-DnVSE7_V.cjs} +1 -1
- package/dist/{vue-ui-timer-DJzscIpZ.cjs → vue-ui-timer-CINerMki.cjs} +1 -1
- package/dist/{vue-ui-timer-p0KgWSfy.js → vue-ui-timer-D6j-aYnJ.js} +5 -5
- package/dist/{vue-ui-tiremarks-DpXsBy1-.cjs → vue-ui-tiremarks-CRGMkwwv.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-Bq6ciZp0.js → vue-ui-tiremarks-ztoJZwQn.js} +7 -7
- package/dist/{vue-ui-treemap-B9TKmG5Z.js → vue-ui-treemap-B0NYnKie.js} +11 -11
- package/dist/{vue-ui-treemap-BIXzY6rt.cjs → vue-ui-treemap-CbqRlXgA.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-p8nAYFrW.cjs → vue-ui-vertical-bar-Cosr8beH.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-CBsaQ0m4.js → vue-ui-vertical-bar-DzcpRwPF.js} +12 -12
- package/dist/{vue-ui-waffle-CecnWv5a.js → vue-ui-waffle-CE1MnOqa.js} +12 -12
- package/dist/{vue-ui-waffle-CMDTMHXM.cjs → vue-ui-waffle-DkVKQERp.cjs} +1 -1
- package/dist/{vue-ui-wheel-ChZI90Rv.cjs → vue-ui-wheel-CGYGLKyG.cjs} +1 -1
- package/dist/{vue-ui-wheel-BvML9VG5.js → vue-ui-wheel-DMS12xPv.js} +7 -7
- package/dist/{vue-ui-word-cloud-0Kj2o6G9.cjs → vue-ui-word-cloud-C1klEiea.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-T_f0AHVo.js → vue-ui-word-cloud-D_CyZOE0.js} +10 -10
- package/dist/{vue-ui-xy-DYGyMln-.js → vue-ui-xy-GgA45y9X.js} +14 -14
- package/dist/{vue-ui-xy-wLaSuJNp.cjs → vue-ui-xy-Nj-5ko1z.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-D00_TYAC.js → vue-ui-xy-canvas-BRPQBL8l.js} +11 -11
- package/dist/{vue-ui-xy-canvas-BB8ojPuv.cjs → vue-ui-xy-canvas-CQt5pre_.cjs} +1 -1
- package/package.json +1 -1
- package/dist/index--Qj2S12-.cjs +0 -9
- package/dist/vue-ui-circle-pack-nfi25HeN.cjs +0 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { computed as p, ref as i, watch as je, onMounted as qe, onBeforeUnmount as He, openBlock as r, createElementBlock as n, normalizeClass as z, normalizeStyle as W, unref as d, createBlock as _, createCommentVNode as c, createSlots as Ye, withCtx as m, renderSlot as f, normalizeProps as M, guardReactiveProps as R, createVNode as ee, createElementVNode as $, Fragment as T, renderList as P, toDisplayString as U, createTextVNode as Pe, nextTick as Qe } from "vue";
|
|
2
|
-
import { u as Je, c as Ke, t as Ze, a as et, p as x, o as tt, e as S, b as at, g as xe, d as Ae, P as Oe, v as ot, i as Fe, f as V, X as lt, s as te, w as rt, Q as Ne, x as st, y as nt, q as ut, r as it } from "./index-
|
|
2
|
+
import { u as Je, c as Ke, t as Ze, a as et, p as x, o as tt, e as S, b as at, g as xe, d as Ae, P as Oe, v as ot, i as Fe, f as V, X as lt, s as te, w as rt, Q as Ne, x as st, y as nt, q as ut, r as it } from "./index-DiqenHrX.js";
|
|
3
3
|
import { t as dt, u as ct } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { _ as vt } from "./Title-
|
|
5
|
-
import { u as ht, U as pt } from "./usePrinter-
|
|
6
|
-
import { _ as gt } from "./Tooltip-
|
|
7
|
-
import ft from "./vue-ui-sparkbar-
|
|
8
|
-
import { L as yt } from "./Legend-
|
|
9
|
-
import { D as mt } from "./DataTable-
|
|
10
|
-
import bt from "./vue-ui-skeleton-
|
|
11
|
-
import kt from "./vue-ui-accordion-
|
|
12
|
-
import { u as Se } from "./useNestedProp-
|
|
13
|
-
import { _ as Ct } from "./PackageVersion-
|
|
14
|
-
import { P as wt } from "./PenAndPaper-
|
|
4
|
+
import { _ as vt } from "./Title-CiQQgFbV.js";
|
|
5
|
+
import { u as ht, U as pt } from "./usePrinter-CHAgX1f-.js";
|
|
6
|
+
import { _ as gt } from "./Tooltip-ZYQUXVWv.js";
|
|
7
|
+
import ft from "./vue-ui-sparkbar-C93PvNz6.js";
|
|
8
|
+
import { L as yt } from "./Legend-DqRstaxU.js";
|
|
9
|
+
import { D as mt } from "./DataTable-CpOh1tx3.js";
|
|
10
|
+
import bt from "./vue-ui-skeleton-BwWHgSoq.js";
|
|
11
|
+
import kt from "./vue-ui-accordion-DA6XnWaz.js";
|
|
12
|
+
import { u as Se } from "./useNestedProp-B3CQkP95.js";
|
|
13
|
+
import { _ as Ct } from "./PackageVersion-iscNRe7N.js";
|
|
14
|
+
import { P as wt } from "./PenAndPaper-B-VQ8eSo.js";
|
|
15
15
|
import { u as _t } from "./useUserOptionState-BIvW1Kz7.js";
|
|
16
16
|
import { _ as $t } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
17
17
|
const Tt = ["id"], Pt = ["xmlns", "viewBox"], xt = ["width", "height"], At = ["id"], Ot = ["stop-color"], Ft = ["stop-color"], Nt = { key: 1 }, St = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], It = { key: 0 }, Lt = ["d", "stroke", "stroke-width"], zt = ["d", "stroke", "stroke-width"], Mt = { key: 2 }, Rt = ["x", "y", "text-anchor", "font-size", "fill", "onMouseenter"], Ut = ["points", "stroke", "stroke-width"], Vt = ["points", "stroke", "stroke-width", "fill"], Et = { key: 3 }, Bt = ["cx", "cy", "fill", "r", "stroke"], Dt = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index--Qj2S12-.cjs"),ne=require("./useResponsive-BJ7DTGpm.cjs"),we=require("./Title-BX4Wt59j.cjs"),se=require("./usePrinter-DOZ7DmEX.cjs"),Be=require("./Tooltip-BRF0SCJo.cjs"),Pe=require("./vue-ui-sparkbar-D-odOB5o.cjs"),_e=require("./Legend-_VSW3gtH.cjs"),$e=require("./DataTable-CvEk_3ue.cjs"),Te=require("./vue-ui-skeleton-BVhUJapg.cjs"),xe=require("./vue-ui-accordion-BFGSPdZa.cjs"),ue=require("./useNestedProp-C5bsAL3S.cjs"),Ne=require("./PackageVersion-D3FEDqJ4.cjs"),Se=require("./PenAndPaper-0PiYibYi.cjs"),Ee=require("./useUserOptionState-BgepsfED.cjs"),Ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Fe=["id"],Oe=["xmlns","viewBox"],Ae=["width","height"],Le=["id"],ze=["stop-color"],Ie=["stop-color"],Re={key:1},qe=["x1","y1","x2","y2","stroke","stroke-width"],Me={key:0},Ue=["d","stroke","stroke-width"],De=["d","stroke","stroke-width"],Ge={key:2},We=["x","y","text-anchor","font-size","fill","onMouseenter"],He=["points","stroke","stroke-width"],je=["points","stroke","stroke-width","fill"],Xe={key:3},Ye=["cx","cy","fill","r","stroke"],Je={key:5,class:"vue-data-ui-watermark"},Ke=["onClick"],Qe={key:0,style:{"max-width":"200px",margin:"0 auto"}},Ze={__name:"vue-ui-radar",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["selectLegend"],setup(ie,{expose:ce,emit:de}){const d=ie,{vue_ui_radar:ve}=n.useConfig(),C=e.computed(()=>!!d.dataset&&Object.keys(d.dataset).length),f=e.ref(n.createUid()),pe=e.ref(null),T=e.ref(!1),x=e.ref(""),L=e.ref(0),m=e.ref(null),z=e.ref(null),I=e.ref(null),R=e.ref(null),q=e.ref(null),M=e.ref(0),U=e.ref(0),D=e.ref(0),t=e.computed({get:()=>H(),set:o=>o}),{userOptionsVisible:N,setUserOptionsVisibility:G,keepUserOptionState:W}=Ee.useUserOptionState({config:t.value});function H(){const o=ue.useNestedProp({userConfig:d.config,defaultConfig:ve});return o.theme?{...ue.useNestedProp({userConfig:n.themes.vue_ui_radar[o.theme]||d.config,defaultConfig:o}),customPalette:n.themePalettes[o.theme]||n.palette}:o}e.watch(()=>d.config,o=>{t.value=H(),N.value=!t.value.userOptions.showOnChartHover,j(),M.value+=1,U.value+=1,D.value+=1,p.value.dataLabels.show=t.value.style.chart.layout.labels.dataLabels.show,p.value.showTable=t.value.table.show,p.value.showTooltip=t.value.style.chart.tootlip.show},{deep:!0});const B=e.ref(null);function j(){if(n.objectIsEmpty(d.dataset)&&n.error({componentName:"VueUiRadar",type:"dataset"}),t.value.responsive){const o=ne.throttle(()=>{const{width:a,height:l}=ne.useResponsive({chart:m.value,title:t.value.style.chart.title.text?z.value:null,legend:t.value.style.chart.legend.show?I.value:null,source:R.value,noTitle:q.value});requestAnimationFrame(()=>{u.value.width=a,u.value.height=l})});B.value=new ResizeObserver(o),B.value.observe(m.value.parentNode)}}e.onMounted(()=>{j()}),e.onBeforeUnmount(()=>{B.value&&B.value.disconnect()});const{isPrinting:X,isImaging:Y,generatePdf:J,generateImage:K}=se.usePrinter({elementId:`vue-ui-radar_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-radar"}),he=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Q=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),p=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),ge=e.computed(()=>({style:{backgroundColor:"#FFFFFF00",animation:{show:t.value.style.chart.tooltip.animation.show,animationFrames:t.value.style.chart.tooltip.animation.animationFrames},labels:{fontSize:t.value.style.chart.tooltip.fontSize,name:{color:t.value.style.chart.tooltip.color}},gutter:{backgroundColor:"#CCCCCC",opacity:30}}})),u=e.ref({height:312,width:512}),i=e.ref([]),w=e.ref(null),y=e.ref(!1);function Z(o){y.value=!0,i.value.includes(o)?(w.value=o,i.value=i.value.filter(a=>a!==o),setTimeout(()=>{y.value=!1,w.value=null},500)):(i.value.push(o),setTimeout(()=>{y.value=!1},500)),de("selectLegend",k.value.filter((a,l)=>!i.value.includes(l)).map(a=>({name:a.name,color:a.color,proportion:a.totalProportion})))}function fe(){return k.value.map(o=>({name:o.name,color:o.color,proportion:o.totalProportion}))}const v=e.computed(()=>[null,void 0].includes(d.dataset.categories)?(n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:"categories ({ name: string; prefix?: string; suffix?: string}[])"}),[]):(d.dataset.categories.length===0?n.error({componentName:"VueUiRadar",type:"datasetAttributeEmpty",property:"categories"}):d.dataset.categories.forEach((o,a)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name"]}).forEach(l=>{n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:`category.${l} at index ${a}`,index:a})})}),[null,void 0].includes(d.dataset.series)?n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:"series ({ name: string; values: number[]; color?: string; target: number}[])"}):d.dataset.series.forEach((o,a)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","values","target"]}).forEach(l=>{n.error({componentName:"VueUiRadar",type:"datasetSerieAttribute",key:"series",property:l,index:a})})}),d.dataset.categories.map((o,a)=>({name:o.name,categoryId:`radar_category_${f.value}_${a}`,color:n.convertColorToHex(o.color)||Q.value[a]||n.palette[a]||n.palette[a%n.palette.length],prefix:o.prefix??"",suffix:o.suffix??""})))),h=e.computed(()=>C.value?d.dataset.series.map((o,a)=>({...o,color:n.convertColorToHex(o.color)||Q.value[a]||n.palette[a]||n.palette[a%n.palette.length],serieId:`radar_serie_${f.value}_${a}`,formatter:o.formatter||null})):[]),ee=e.computed(()=>Math.max(...h.value.flatMap(o=>o.values))),te=e.computed(()=>h.value.length),S=e.computed(()=>Math.min(u.value.width,u.value.height)/3),oe=e.computed(()=>n.createPolygonPath({plot:{x:u.value.width/2,y:u.value.height/2},radius:S.value,sides:te.value,rotation:0})),me=e.computed(()=>{const o=[];for(let a=0;a<S.value;a+=S.value/t.value.style.chart.layout.grid.graduations)o.push(a);return o}),g=e.computed(()=>oe.value.coordinates.map((o,a)=>{const l=h.value[a].values.map(r=>ye({centerX:u.value.width/2,centerY:u.value.height/2,apexX:o.x,apexY:o.y,proportion:r/(h.value[a].target||ee.value)}));return{...o,...h.value[a],plots:l}}));function E({x:o,y:a}){let l="middle";return o=Math.round(o),a=Math.round(a),o>u.value.width/2&&(o+=12,l="start"),o<u.value.width/2&&(o-=12,l="end"),a>u.value.height/2&&(a+=20),a<u.value.height/2&&(a-=12),a===u.value.height/2&&(a+=4),{x:o,y:a,anchor:l}}function ye({centerX:o,centerY:a,apexX:l,apexY:r,proportion:s}){return{x:o+(l-o)*s,y:a+(r-a)*s}}const k=e.computed(()=>{const o=h.value.map((a,l)=>a.values.map(r=>r/(a.target||ee.value)));return v.value.map((a,l)=>({...a,totalProportion:n.checkNaN(o.map(r=>r[l]).reduce((r,s)=>r+s,0)/h.value.length),shape:"circle",opacity:i.value.includes(l)?.5:1,segregate:()=>Z(l),isSegregated:i.value.includes(l)}))}),ke=e.computed(()=>({cy:"radar-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 o=[{name:t.value.translations.datapoint,color:""},{name:t.value.translations.target,color:""},...k.value],a=d.dataset.series.map(r=>[r.name,n.applyDataLabel(r.formatter,r.target,n.dataLabel({p:r.prefix,v:r.target,s:r.suffix,r:t.value.table.td.roundingValue})),...r.values.map((s,c)=>`${n.applyDataLabel(r.formatter,s,n.dataLabel({p:v.value[c].prefix,v:s,s:v.value[c].suffix,r:t.value.table.td.roundingValue}))} (${isNaN(s/r.target)?"":n.dataLabel({v:s/r.target*100,s:"%",r:t.value.table.td.roundingPercentage})})`)]),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{head:o,body:a,config:l,colNames:o}}),_=e.ref(null),V=e.ref([]),F=e.ref(null);function be(o,a){V.value=[],_.value=a,T.value=!0;let l="";F.value={datapoint:o,seriesIndex:a,series:{categories:v.value,datapoints:h.value,radar:g.value},config:t.value};const r=t.value.style.chart.tooltip.customFormat;if(n.isFunction(r)&&n.functionReturnsString(()=>r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:h.value,radar:g.value},config:t.value})))x.value=r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:h.value,radar:g.value},config:t.value});else{l+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`;for(let s=0;s<o.values.length;s+=1)i.value.includes(s)||V.value.push({name:v.value[s].name,value:o.values[s]/o.target*100,color:v.value[s].color,suffix:"%)",prefix:`${n.dataLabel({p:v.value[s].prefix??"",v:o.values[s],s:v.value[s].suffix??"",r:t.value.style.chart.tooltip.roundingValue})} (`,rounding:t.value.style.chart.tooltip.roundingPercentage,formatter:o.formatter});x.value=l}}function ae(){e.nextTick(()=>{const o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],a=[[""],[t.value.translations.target],...k.value.flatMap(c=>[[c.name],["%"]])],l=d.dataset.series.map((c,tt)=>[c.name,c.target,...c.values.flatMap(A=>[A,isNaN(A/c.target)?"":A/c.target*100])]),r=o.concat([a]).concat(l),s=n.createCsvContent(r);n.downloadCsv({csvContent:s,title:t.value.style.chart.title.text||"vue-ui-radar"})})}const b=e.ref(!1);function Ce(o){b.value=o,L.value+=1}function le(){p.value.showTable=!p.value.showTable}function re(){p.value.showTooltip=!p.value.showTooltip}const $=e.ref(!1);function O(){$.value=!$.value}return ce({getData:fe,generatePdf:J,generateCsv:ae,generateImage:K,toggleTable:le,toggleTooltip:re,toggleAnnotator:O}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-radar ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"radarChart",ref:m,id:`vue-ui-radar_${f.value}`,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}`),onMouseenter:a[3]||(a[3]=()=>e.unref(G)(!0)),onMouseleave:a[4]||(a[4]=()=>e.unref(G)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Se.PenAndPaper,{key:0,parent:m.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:$.value,onClose:O},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),he.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:q,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:12px"},[(e.openBlock(),e.createBlock(we._sfc_main,{key:`title_${M.value}`,config:{title:{cy:"radar-div-title",...t.value.style.chart.title},subtitle:{cy:"radar-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&C.value&&(e.unref(W)||e.unref(N))?(e.openBlock(),e.createBlock(se.UserOptions,{ref_key:"details",ref:pe,key:`user_options_${L.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(Y),isPrinting:e.unref(X),uid:f.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:p.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:m.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:$.value,onToggleFullscreen:Ce,onGeneratePdf:e.unref(J),onGenerateCsv:ae,onGenerateImage:e.unref(K),onToggleTable:le,onToggleTooltip:re,onToggleAnnotator:O,style:e.normalizeStyle({visibility:e.unref(W)?e.unref(N)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}: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:"5"}: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:"6"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),viewBox:`0 0 ${u.value.width<=0?10:u.value.width} ${u.value.height<=0?10:u.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Ne._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:u.value.width<=0?10:u.value.width,height:u.value.height<=0?10:u.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,Ae)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`radar_gradient_${f.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(l.color,.05),t.value.style.chart.layout.dataPolygon.opacity)},null,8,ze),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(l.color,t.value.style.chart.layout.dataPolygon.opacity)},null,8,Ie)],8,Le))),256))]),t.value.style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",Re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,l=>(e.openBlock(),e.createElementBlock("line",{x1:u.value.width/2,y1:u.value.height/2,x2:l.x,y2:l.y,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,qe))),256)),t.value.style.chart.layout.grid.graduations>0?(e.openBlock(),e.createElementBlock("g",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(me.value,l=>(e.openBlock(),e.createElementBlock("path",{d:e.unref(n.createPolygonPath)({plot:{x:u.value.width/2,y:u.value.height/2},radius:l,sides:te.value,rotation:0}).path,fill:"none",stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,Ue))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("path",{d:oe.value.path,fill:"none",stroke:t.value.style.chart.layout.outerPolygon.stroke,"stroke-width":t.value.style.chart.layout.outerPolygon.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round"},null,8,De),t.value.style.chart.layout.labels.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:E(l).x,y:E(l).y,"text-anchor":E(l).anchor,"font-size":t.value.style.chart.layout.labels.dataLabels.fontSize,fill:t.value.style.chart.layout.labels.dataLabels.color,onMouseenter:s=>be(l,r),onMouseleave:a[0]||(a[0]=s=>{T.value=!1,_.value=null})},e.toDisplayString(l.name),41,We))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("g",null,[t.value.useCssAnimation||!t.value.useCssAnimation&&!i.value.includes(r)?(e.openBlock(),e.createElementBlock("polygon",{key:0,"data-cy-radar-path":"",points:e.unref(n.makePath)(g.value.map(s=>s.plots[r]),!1,!0),stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.dataPolygon.strokeWidth+1,fill:"none",class:e.normalizeClass({"animated-out":i.value.includes(r)&&t.value.useCssAnimation,"animated-in":y.value&&w.value===r&&t.value.useCssAnimation})},null,10,He)):e.createCommentVNode("",!0),t.value.useCssAnimation||!t.value.useCssAnimation&&!i.value.includes(r)?(e.openBlock(),e.createElementBlock("polygon",{key:1,"data-cy-radar-path":"",points:e.unref(n.makePath)(g.value.map(s=>s.plots[r]),!1,!0),stroke:l.color,"stroke-width":t.value.style.chart.layout.dataPolygon.strokeWidth,fill:t.value.style.chart.layout.dataPolygon.transparent?"transparent":t.value.style.chart.layout.dataPolygon.useGradient?`url(#radar_gradient_${f.value}_${r})`:e.unref(n.setOpacity)(l.color,t.value.style.chart.layout.dataPolygon.opacity),class:e.normalizeClass({"animated-out":i.value.includes(r)&&t.value.useCssAnimation,"animated-in":y.value&&w.value===r&&t.value.useCssAnimation})},null,10,je)):e.createCommentVNode("",!0)])]))),256)),t.value.style.chart.layout.plots.show?(e.openBlock(),e.createElementBlock("g",Xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.plots,(s,c)=>(e.openBlock(),e.createElementBlock("circle",{cx:s.x,cy:s.y,fill:i.value.includes(c)?"transparent":v.value[c].color,r:_.value!==null&&_.value===r?t.value.style.chart.layout.plots.radius*1.6:t.value.style.chart.layout.plots.radius,stroke:i.value.includes(c)?"transparent":t.value.style.chart.backgroundColor,"stroke-width":.5,class:e.normalizeClass({"animated-out":i.value.includes(c)&&t.value.useCssAnimation,"animated-in":y.value&&w.value===c&&t.value.useCssAnimation})},null,10,Ye))),256))]))),256))])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:u.value},void 0,!0)],14,Oe)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Je,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(X)||e.unref(Y)})),void 0,!0)])):e.createCommentVNode("",!0),C.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Te.default,{key:6,config:{type:"radar",style:{backgroundColor:t.value.style.chart.backgroundColor,radar:{grid:{color:t.value.style.chart.layout.outerPolygon.stroke},shapes:{color:t.value.style.chart.layout.outerPolygon.stroke}}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:I},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(_e.Legend,{key:`legend_${D.value}`,legendSet:k.value,config:ke.value,onClickMarker:a[1]||(a[1]=({i:l})=>Z(l))},{item:e.withCtx(({legend:l,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:s=>l.segregate(),style:e.normalizeStyle(`opacity:${i.value.includes(r)?.5:1}`)},e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(n.dataLabel)({v:l.totalProportion*100,s:"%",r:t.value.style.chart.legend.roundingPercentage})),13,Ke)]),_:1},8,["legendSet","config"])):e.renderSlot(o.$slots,"legend",{key:1,legend:k.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:R,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Be._sfc_main,{show:p.value.showTooltip&&T.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,fontSize:t.value.style.chart.tooltip.fontSize,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:m.value,content:x.value,isFullscreen:b.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...F.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[["function"].includes(typeof t.value.style.chart.tooltip.customFormat)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Qe,[e.createVNode(Pe.default,{dataset:V.value,config:ge.value,backgroundOpacity:0},null,8,["dataset","config"])])),e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...F.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","fontSize","position","offsetY","parent","content","isFullscreen","isCustom"]),C.value?(e.openBlock(),e.createBlock(xe.default,{key:8,hideDetails:"",config:{open:p.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($e.DataTable,{key:`table_${U.value}`,colNames:P.value.colNames,head:P.value.head,body:P.value.body,config:P.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]=l=>p.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l.name),1)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Fe))}},et=Ve._export_sfc(Ze,[["__scopeId","data-v-905ab625"]]);exports.default=et;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-C_VTEz1N.cjs"),ne=require("./useResponsive-BJ7DTGpm.cjs"),we=require("./Title-DFq_8HYJ.cjs"),se=require("./usePrinter-DWCqeYW6.cjs"),Be=require("./Tooltip-pcZXVRMj.cjs"),Pe=require("./vue-ui-sparkbar-B3idsjFj.cjs"),_e=require("./Legend-Dh9aF6uH.cjs"),$e=require("./DataTable-D93-QmC8.cjs"),Te=require("./vue-ui-skeleton-D1bJntn7.cjs"),xe=require("./vue-ui-accordion-CtBhoUw4.cjs"),ue=require("./useNestedProp-C7bLHE7v.cjs"),Ne=require("./PackageVersion-CdmZAhdE.cjs"),Se=require("./PenAndPaper-BsncKiRE.cjs"),Ee=require("./useUserOptionState-BgepsfED.cjs"),Ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Fe=["id"],Oe=["xmlns","viewBox"],Ae=["width","height"],Le=["id"],ze=["stop-color"],Ie=["stop-color"],Re={key:1},qe=["x1","y1","x2","y2","stroke","stroke-width"],Me={key:0},Ue=["d","stroke","stroke-width"],De=["d","stroke","stroke-width"],Ge={key:2},We=["x","y","text-anchor","font-size","fill","onMouseenter"],He=["points","stroke","stroke-width"],je=["points","stroke","stroke-width","fill"],Xe={key:3},Ye=["cx","cy","fill","r","stroke"],Je={key:5,class:"vue-data-ui-watermark"},Ke=["onClick"],Qe={key:0,style:{"max-width":"200px",margin:"0 auto"}},Ze={__name:"vue-ui-radar",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["selectLegend"],setup(ie,{expose:ce,emit:de}){const d=ie,{vue_ui_radar:ve}=n.useConfig(),C=e.computed(()=>!!d.dataset&&Object.keys(d.dataset).length),f=e.ref(n.createUid()),pe=e.ref(null),T=e.ref(!1),x=e.ref(""),L=e.ref(0),m=e.ref(null),z=e.ref(null),I=e.ref(null),R=e.ref(null),q=e.ref(null),M=e.ref(0),U=e.ref(0),D=e.ref(0),t=e.computed({get:()=>H(),set:o=>o}),{userOptionsVisible:N,setUserOptionsVisibility:G,keepUserOptionState:W}=Ee.useUserOptionState({config:t.value});function H(){const o=ue.useNestedProp({userConfig:d.config,defaultConfig:ve});return o.theme?{...ue.useNestedProp({userConfig:n.themes.vue_ui_radar[o.theme]||d.config,defaultConfig:o}),customPalette:n.themePalettes[o.theme]||n.palette}:o}e.watch(()=>d.config,o=>{t.value=H(),N.value=!t.value.userOptions.showOnChartHover,j(),M.value+=1,U.value+=1,D.value+=1,p.value.dataLabels.show=t.value.style.chart.layout.labels.dataLabels.show,p.value.showTable=t.value.table.show,p.value.showTooltip=t.value.style.chart.tootlip.show},{deep:!0});const B=e.ref(null);function j(){if(n.objectIsEmpty(d.dataset)&&n.error({componentName:"VueUiRadar",type:"dataset"}),t.value.responsive){const o=ne.throttle(()=>{const{width:a,height:l}=ne.useResponsive({chart:m.value,title:t.value.style.chart.title.text?z.value:null,legend:t.value.style.chart.legend.show?I.value:null,source:R.value,noTitle:q.value});requestAnimationFrame(()=>{u.value.width=a,u.value.height=l})});B.value=new ResizeObserver(o),B.value.observe(m.value.parentNode)}}e.onMounted(()=>{j()}),e.onBeforeUnmount(()=>{B.value&&B.value.disconnect()});const{isPrinting:X,isImaging:Y,generatePdf:J,generateImage:K}=se.usePrinter({elementId:`vue-ui-radar_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-radar"}),he=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Q=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),p=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),ge=e.computed(()=>({style:{backgroundColor:"#FFFFFF00",animation:{show:t.value.style.chart.tooltip.animation.show,animationFrames:t.value.style.chart.tooltip.animation.animationFrames},labels:{fontSize:t.value.style.chart.tooltip.fontSize,name:{color:t.value.style.chart.tooltip.color}},gutter:{backgroundColor:"#CCCCCC",opacity:30}}})),u=e.ref({height:312,width:512}),i=e.ref([]),w=e.ref(null),y=e.ref(!1);function Z(o){y.value=!0,i.value.includes(o)?(w.value=o,i.value=i.value.filter(a=>a!==o),setTimeout(()=>{y.value=!1,w.value=null},500)):(i.value.push(o),setTimeout(()=>{y.value=!1},500)),de("selectLegend",k.value.filter((a,l)=>!i.value.includes(l)).map(a=>({name:a.name,color:a.color,proportion:a.totalProportion})))}function fe(){return k.value.map(o=>({name:o.name,color:o.color,proportion:o.totalProportion}))}const v=e.computed(()=>[null,void 0].includes(d.dataset.categories)?(n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:"categories ({ name: string; prefix?: string; suffix?: string}[])"}),[]):(d.dataset.categories.length===0?n.error({componentName:"VueUiRadar",type:"datasetAttributeEmpty",property:"categories"}):d.dataset.categories.forEach((o,a)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name"]}).forEach(l=>{n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:`category.${l} at index ${a}`,index:a})})}),[null,void 0].includes(d.dataset.series)?n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:"series ({ name: string; values: number[]; color?: string; target: number}[])"}):d.dataset.series.forEach((o,a)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","values","target"]}).forEach(l=>{n.error({componentName:"VueUiRadar",type:"datasetSerieAttribute",key:"series",property:l,index:a})})}),d.dataset.categories.map((o,a)=>({name:o.name,categoryId:`radar_category_${f.value}_${a}`,color:n.convertColorToHex(o.color)||Q.value[a]||n.palette[a]||n.palette[a%n.palette.length],prefix:o.prefix??"",suffix:o.suffix??""})))),h=e.computed(()=>C.value?d.dataset.series.map((o,a)=>({...o,color:n.convertColorToHex(o.color)||Q.value[a]||n.palette[a]||n.palette[a%n.palette.length],serieId:`radar_serie_${f.value}_${a}`,formatter:o.formatter||null})):[]),ee=e.computed(()=>Math.max(...h.value.flatMap(o=>o.values))),te=e.computed(()=>h.value.length),S=e.computed(()=>Math.min(u.value.width,u.value.height)/3),oe=e.computed(()=>n.createPolygonPath({plot:{x:u.value.width/2,y:u.value.height/2},radius:S.value,sides:te.value,rotation:0})),me=e.computed(()=>{const o=[];for(let a=0;a<S.value;a+=S.value/t.value.style.chart.layout.grid.graduations)o.push(a);return o}),g=e.computed(()=>oe.value.coordinates.map((o,a)=>{const l=h.value[a].values.map(r=>ye({centerX:u.value.width/2,centerY:u.value.height/2,apexX:o.x,apexY:o.y,proportion:r/(h.value[a].target||ee.value)}));return{...o,...h.value[a],plots:l}}));function E({x:o,y:a}){let l="middle";return o=Math.round(o),a=Math.round(a),o>u.value.width/2&&(o+=12,l="start"),o<u.value.width/2&&(o-=12,l="end"),a>u.value.height/2&&(a+=20),a<u.value.height/2&&(a-=12),a===u.value.height/2&&(a+=4),{x:o,y:a,anchor:l}}function ye({centerX:o,centerY:a,apexX:l,apexY:r,proportion:s}){return{x:o+(l-o)*s,y:a+(r-a)*s}}const k=e.computed(()=>{const o=h.value.map((a,l)=>a.values.map(r=>r/(a.target||ee.value)));return v.value.map((a,l)=>({...a,totalProportion:n.checkNaN(o.map(r=>r[l]).reduce((r,s)=>r+s,0)/h.value.length),shape:"circle",opacity:i.value.includes(l)?.5:1,segregate:()=>Z(l),isSegregated:i.value.includes(l)}))}),ke=e.computed(()=>({cy:"radar-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 o=[{name:t.value.translations.datapoint,color:""},{name:t.value.translations.target,color:""},...k.value],a=d.dataset.series.map(r=>[r.name,n.applyDataLabel(r.formatter,r.target,n.dataLabel({p:r.prefix,v:r.target,s:r.suffix,r:t.value.table.td.roundingValue})),...r.values.map((s,c)=>`${n.applyDataLabel(r.formatter,s,n.dataLabel({p:v.value[c].prefix,v:s,s:v.value[c].suffix,r:t.value.table.td.roundingValue}))} (${isNaN(s/r.target)?"":n.dataLabel({v:s/r.target*100,s:"%",r:t.value.table.td.roundingPercentage})})`)]),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{head:o,body:a,config:l,colNames:o}}),_=e.ref(null),V=e.ref([]),F=e.ref(null);function be(o,a){V.value=[],_.value=a,T.value=!0;let l="";F.value={datapoint:o,seriesIndex:a,series:{categories:v.value,datapoints:h.value,radar:g.value},config:t.value};const r=t.value.style.chart.tooltip.customFormat;if(n.isFunction(r)&&n.functionReturnsString(()=>r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:h.value,radar:g.value},config:t.value})))x.value=r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:h.value,radar:g.value},config:t.value});else{l+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`;for(let s=0;s<o.values.length;s+=1)i.value.includes(s)||V.value.push({name:v.value[s].name,value:o.values[s]/o.target*100,color:v.value[s].color,suffix:"%)",prefix:`${n.dataLabel({p:v.value[s].prefix??"",v:o.values[s],s:v.value[s].suffix??"",r:t.value.style.chart.tooltip.roundingValue})} (`,rounding:t.value.style.chart.tooltip.roundingPercentage,formatter:o.formatter});x.value=l}}function ae(){e.nextTick(()=>{const o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],a=[[""],[t.value.translations.target],...k.value.flatMap(c=>[[c.name],["%"]])],l=d.dataset.series.map((c,tt)=>[c.name,c.target,...c.values.flatMap(A=>[A,isNaN(A/c.target)?"":A/c.target*100])]),r=o.concat([a]).concat(l),s=n.createCsvContent(r);n.downloadCsv({csvContent:s,title:t.value.style.chart.title.text||"vue-ui-radar"})})}const b=e.ref(!1);function Ce(o){b.value=o,L.value+=1}function le(){p.value.showTable=!p.value.showTable}function re(){p.value.showTooltip=!p.value.showTooltip}const $=e.ref(!1);function O(){$.value=!$.value}return ce({getData:fe,generatePdf:J,generateCsv:ae,generateImage:K,toggleTable:le,toggleTooltip:re,toggleAnnotator:O}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-radar ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"radarChart",ref:m,id:`vue-ui-radar_${f.value}`,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}`),onMouseenter:a[3]||(a[3]=()=>e.unref(G)(!0)),onMouseleave:a[4]||(a[4]=()=>e.unref(G)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Se.PenAndPaper,{key:0,parent:m.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:$.value,onClose:O},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),he.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:q,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:12px"},[(e.openBlock(),e.createBlock(we._sfc_main,{key:`title_${M.value}`,config:{title:{cy:"radar-div-title",...t.value.style.chart.title},subtitle:{cy:"radar-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&C.value&&(e.unref(W)||e.unref(N))?(e.openBlock(),e.createBlock(se.UserOptions,{ref_key:"details",ref:pe,key:`user_options_${L.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(Y),isPrinting:e.unref(X),uid:f.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:p.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:m.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:$.value,onToggleFullscreen:Ce,onGeneratePdf:e.unref(J),onGenerateCsv:ae,onGenerateImage:e.unref(K),onToggleTable:le,onToggleTooltip:re,onToggleAnnotator:O,style:e.normalizeStyle({visibility:e.unref(W)?e.unref(N)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}: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:"5"}: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:"6"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),viewBox:`0 0 ${u.value.width<=0?10:u.value.width} ${u.value.height<=0?10:u.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Ne._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:u.value.width<=0?10:u.value.width,height:u.value.height<=0?10:u.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,Ae)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`radar_gradient_${f.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(l.color,.05),t.value.style.chart.layout.dataPolygon.opacity)},null,8,ze),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(l.color,t.value.style.chart.layout.dataPolygon.opacity)},null,8,Ie)],8,Le))),256))]),t.value.style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",Re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,l=>(e.openBlock(),e.createElementBlock("line",{x1:u.value.width/2,y1:u.value.height/2,x2:l.x,y2:l.y,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,qe))),256)),t.value.style.chart.layout.grid.graduations>0?(e.openBlock(),e.createElementBlock("g",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(me.value,l=>(e.openBlock(),e.createElementBlock("path",{d:e.unref(n.createPolygonPath)({plot:{x:u.value.width/2,y:u.value.height/2},radius:l,sides:te.value,rotation:0}).path,fill:"none",stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,Ue))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("path",{d:oe.value.path,fill:"none",stroke:t.value.style.chart.layout.outerPolygon.stroke,"stroke-width":t.value.style.chart.layout.outerPolygon.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round"},null,8,De),t.value.style.chart.layout.labels.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:E(l).x,y:E(l).y,"text-anchor":E(l).anchor,"font-size":t.value.style.chart.layout.labels.dataLabels.fontSize,fill:t.value.style.chart.layout.labels.dataLabels.color,onMouseenter:s=>be(l,r),onMouseleave:a[0]||(a[0]=s=>{T.value=!1,_.value=null})},e.toDisplayString(l.name),41,We))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("g",null,[t.value.useCssAnimation||!t.value.useCssAnimation&&!i.value.includes(r)?(e.openBlock(),e.createElementBlock("polygon",{key:0,"data-cy-radar-path":"",points:e.unref(n.makePath)(g.value.map(s=>s.plots[r]),!1,!0),stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.dataPolygon.strokeWidth+1,fill:"none",class:e.normalizeClass({"animated-out":i.value.includes(r)&&t.value.useCssAnimation,"animated-in":y.value&&w.value===r&&t.value.useCssAnimation})},null,10,He)):e.createCommentVNode("",!0),t.value.useCssAnimation||!t.value.useCssAnimation&&!i.value.includes(r)?(e.openBlock(),e.createElementBlock("polygon",{key:1,"data-cy-radar-path":"",points:e.unref(n.makePath)(g.value.map(s=>s.plots[r]),!1,!0),stroke:l.color,"stroke-width":t.value.style.chart.layout.dataPolygon.strokeWidth,fill:t.value.style.chart.layout.dataPolygon.transparent?"transparent":t.value.style.chart.layout.dataPolygon.useGradient?`url(#radar_gradient_${f.value}_${r})`:e.unref(n.setOpacity)(l.color,t.value.style.chart.layout.dataPolygon.opacity),class:e.normalizeClass({"animated-out":i.value.includes(r)&&t.value.useCssAnimation,"animated-in":y.value&&w.value===r&&t.value.useCssAnimation})},null,10,je)):e.createCommentVNode("",!0)])]))),256)),t.value.style.chart.layout.plots.show?(e.openBlock(),e.createElementBlock("g",Xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.plots,(s,c)=>(e.openBlock(),e.createElementBlock("circle",{cx:s.x,cy:s.y,fill:i.value.includes(c)?"transparent":v.value[c].color,r:_.value!==null&&_.value===r?t.value.style.chart.layout.plots.radius*1.6:t.value.style.chart.layout.plots.radius,stroke:i.value.includes(c)?"transparent":t.value.style.chart.backgroundColor,"stroke-width":.5,class:e.normalizeClass({"animated-out":i.value.includes(c)&&t.value.useCssAnimation,"animated-in":y.value&&w.value===c&&t.value.useCssAnimation})},null,10,Ye))),256))]))),256))])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:u.value},void 0,!0)],14,Oe)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Je,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(X)||e.unref(Y)})),void 0,!0)])):e.createCommentVNode("",!0),C.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Te.default,{key:6,config:{type:"radar",style:{backgroundColor:t.value.style.chart.backgroundColor,radar:{grid:{color:t.value.style.chart.layout.outerPolygon.stroke},shapes:{color:t.value.style.chart.layout.outerPolygon.stroke}}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:I},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(_e.Legend,{key:`legend_${D.value}`,legendSet:k.value,config:ke.value,onClickMarker:a[1]||(a[1]=({i:l})=>Z(l))},{item:e.withCtx(({legend:l,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:s=>l.segregate(),style:e.normalizeStyle(`opacity:${i.value.includes(r)?.5:1}`)},e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(n.dataLabel)({v:l.totalProportion*100,s:"%",r:t.value.style.chart.legend.roundingPercentage})),13,Ke)]),_:1},8,["legendSet","config"])):e.renderSlot(o.$slots,"legend",{key:1,legend:k.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:R,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Be._sfc_main,{show:p.value.showTooltip&&T.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,fontSize:t.value.style.chart.tooltip.fontSize,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:m.value,content:x.value,isFullscreen:b.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...F.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[["function"].includes(typeof t.value.style.chart.tooltip.customFormat)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Qe,[e.createVNode(Pe.default,{dataset:V.value,config:ge.value,backgroundOpacity:0},null,8,["dataset","config"])])),e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...F.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","fontSize","position","offsetY","parent","content","isFullscreen","isCustom"]),C.value?(e.openBlock(),e.createBlock(xe.default,{key:8,hideDetails:"",config:{open:p.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($e.DataTable,{key:`table_${U.value}`,colNames:P.value.colNames,head:P.value.head,body:P.value.body,config:P.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]=l=>p.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l.name),1)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Fe))}},et=Ve._export_sfc(Ze,[["__scopeId","data-v-905ab625"]]);exports.default=et;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index--Qj2S12-.cjs"),M=require("./useNestedProp-C5bsAL3S.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),A={key:0,class:"vue-ui-rating-title",style:{width:"100%"}},R=["src","height","width"],X=["xmlns","height","width"],j=["id"],F=["stop-color"],I=["stop-color"],O=["points","fill","stroke","stroke-width"],Y=["src","alt","height","width","id"],G=["xmlns","viewBox","height","id"],U=["id"],q=["stop-color"],H=["stop-color"],K=["points","fill","stroke"],P=["xmlns","height"],T=["onClick","onMouseenter","onKeyup"],W=["onMouseenter"],J={__name:"vue-ui-rating",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["rate"],setup(k,{expose:S,emit:_}){const i=k,{vue_ui_rating:w}=o.useConfig(),d=e.ref(o.createUid()),g=e.ref(!1),s=e.ref(void 0),y=e.ref([]),z=e.useSlots();e.onMounted(()=>{z["chart-background"]&&console.warn("VueUiRating does not support the #chart-background slot.")});const t=e.computed({get:()=>f(),set:a=>a});function f(){return M.useNestedProp({userConfig:i.config,defaultConfig:w})}e.watch(()=>i.config,a=>{t.value=f(),h()},{deep:!0});const B=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)?C(i.dataset.rating):i.dataset.rating),N=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)),r=e.ref(B.value),m=e.computed(()=>t.value.type==="image"),c=e.computed(()=>t.value.readonly);function C(a){let n=0,l=0;for(const u in a){const L=parseInt(u),$=a[u];n+=L*$,l+=$}if(l===0)return 0;const v=n/l;return Math.min(t.value.to,Math.max(t.value.from,v))}e.onMounted(()=>{h()});function h(){o.objectIsEmpty(i.dataset)&&o.error({componentName:"VueUiRating",type:"dataset"}),y.value=[];for(let a=t.value.from;a<=t.value.to;a+=1)y.value.push(a)}function p(a,n=!1){return a>s.value||c.value?n?t.value.style.image.inactiveOpacity:t.value.style.star.inactiveColor:n?1:t.value.style.star.useGradient?`url(#star_gradient_under_${d.value})`:t.value.style.star.activeColor}function x(a,n=!1){const l=r.value-a,v=n?1:100;switch(!0){case l<=0:return .001;case l>1:return 1*v;default:return l*v}}function b(a){c.value||(r.value=a,_("rate",a))}function E(){return r.value}function V(a=!0){c.value=a}return S({getData:E,toggleReadonly:V}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily};width:100%`),class:"vue-ui-rating",onMouseover:n[2]||(n[2]=l=>g.value=!0),onMouseleave:n[3]||(n[3]=l=>{g.value=!1,s.value=void 0})},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",A,[e.createElementVNode("div",{style:e.normalizeStyle(`color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"};text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.offsetY}px;font-size:${t.value.style.title.fontSize}px`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`color:${t.value.style.title.subtitle.color};font-size:${t.value.style.title.subtitle.fontSize}px;text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.subtitle.offsetY}px;font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.rating.show&&t.value.style.rating.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:100%;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(o.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"vue-ui-rating-wrapper",style:e.normalizeStyle(`height:${t.value.style.itemSize}px;width:100%;display:flex;align-items:center;justify-content:center`)},[t.value.style.rating.show&&t.value.style.rating.position==="left"?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-right:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(o.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(l,v)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-rating-unit-container",style:e.normalizeStyle(`position:relative;height:${t.value.style.itemSize}px;width:${t.value.style.itemSize}px`)},[m.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.value.style.image.src,height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;opacity:${isNaN(s.value)?t.value.style.image.inactiveOpacity:p(l,!0)}`)},null,12,R)):(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit"},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_under_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(o.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,F),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,I)],8,j)]),e.createElementVNode("polygon",{points:e.unref(o.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:isNaN(s.value)?t.value.style.star.inactiveColor:p(l),stroke:t.value.style.star.borderColor?t.value.style.star.borderColor:s.value?p(l):t.value.style.star.inactiveColor,"stroke-width":t.value.style.star.borderWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,O)],8,X)),m.value?(e.openBlock(),e.createElementBlock("img",{key:2,src:t.value.style.image.src,alt:`${t.value.style.image.alt} ${l}`,height:t.value.style.itemSize,width:t.value.style.itemSize,id:`active_${d.value}_${l}`,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;clip:rect(0px,${x(v,!0)*t.value.style.itemSize}px,${t.value.style.itemSize}px,0px`)},null,12,Y)):(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(o.XMLNS),viewBox:`0 0 ${x(v)} 100`,height:t.value.style.itemSize,class:"vue-ui-rating-unit",id:`active_${d.value}_${l}`,style:{position:"absolute",top:"0",left:"0"}},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_over_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(o.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,q),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,H)],8,U)]),e.createElementVNode("polygon",{points:e.unref(o.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:t.value.style.star.useGradient?`url(#star_gradient_over_${d.value})`:t.value.style.star.activeColor,stroke:t.value.style.star.activeColor},null,8,K)],8,G)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(o.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;${c.value?"":"cursor:pointer"}`)},[c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("rect",{key:0,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onClick:u=>b(l),onMouseenter:u=>s.value=l,onMouseleave:n[0]||(n[0]=u=>s.value=void 0),tabindex:"0",onKeyup:e.withKeys(u=>b(l),["enter"])},null,40,T)),c.value?(e.openBlock(),e.createElementBlock("rect",{key:1,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onMouseenter:u=>s.value=l,onMouseleave:n[1]||(n[1]=u=>s.value=void 0)},null,40,W)):e.createCommentVNode("",!0)],12,P)),t.value.style.tooltip.show&&N.value&&c.value?(e.openBlock(),e.createElementBlock("div",{key:4,class:"vue-ui-rating-tooltip",style:e.normalizeStyle(`border:1px solid ${t.value.style.tooltip.borderColor};position:absolute;top:${-48+t.value.style.tooltip.offsetY}px;left:50%;transform:translateX(-50%);width:fit-content;text-align:center;background:${t.value.style.tooltip.backgroundColor};display:${s.value===l?"block":"none"};padding:2px 12px;border-radius:${t.value.style.tooltip.borderRadius}px;box-shadow:${t.value.style.tooltip.boxShadow}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`width:100%;display:flex;flex-direction:row;gap:6px;position:relative;text-align:center;color:${t.value.style.tooltip.color}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(l)+":",5),e.createElementVNode("span",{style:e.normalizeStyle(`font-weight:${t.value.style.tooltip.bold?"bold":"normal"};font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.tooltip.formatter,i.dataset.rating[l],e.unref(o.dataLabel)({v:i.dataset.rating[l],r:t.value.style.tooltip.roundingValue}),t.value)),5),e.createElementVNode("div",{style:e.normalizeStyle(`font-family:Arial !important;position:absolute;top:calc(100% - 4px);left:50%;transform:translateX(-50%);color:${t.value.style.tooltip.borderColor}`)}," ▼ ",4)],4)],4)):e.createCommentVNode("",!0)],4))),256)),t.value.style.rating.show&&t.value.style.rating.position==="right"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(o.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0)],4),t.value.style.rating.show&&t.value.style.rating.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle(`width:100%;text-align:center;margin-top:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(o.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0)],36))}},Q=D._export_sfc(J,[["__scopeId","data-v-9e1d13d5"]]);exports.default=Q;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-C_VTEz1N.cjs"),M=require("./useNestedProp-C7bLHE7v.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),A={key:0,class:"vue-ui-rating-title",style:{width:"100%"}},R=["src","height","width"],X=["xmlns","height","width"],j=["id"],F=["stop-color"],I=["stop-color"],O=["points","fill","stroke","stroke-width"],Y=["src","alt","height","width","id"],G=["xmlns","viewBox","height","id"],U=["id"],q=["stop-color"],H=["stop-color"],K=["points","fill","stroke"],P=["xmlns","height"],T=["onClick","onMouseenter","onKeyup"],W=["onMouseenter"],J={__name:"vue-ui-rating",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["rate"],setup(k,{expose:S,emit:_}){const i=k,{vue_ui_rating:w}=o.useConfig(),d=e.ref(o.createUid()),g=e.ref(!1),s=e.ref(void 0),y=e.ref([]),z=e.useSlots();e.onMounted(()=>{z["chart-background"]&&console.warn("VueUiRating does not support the #chart-background slot.")});const t=e.computed({get:()=>f(),set:a=>a});function f(){return M.useNestedProp({userConfig:i.config,defaultConfig:w})}e.watch(()=>i.config,a=>{t.value=f(),h()},{deep:!0});const B=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)?C(i.dataset.rating):i.dataset.rating),N=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)),r=e.ref(B.value),m=e.computed(()=>t.value.type==="image"),c=e.computed(()=>t.value.readonly);function C(a){let n=0,l=0;for(const u in a){const L=parseInt(u),$=a[u];n+=L*$,l+=$}if(l===0)return 0;const v=n/l;return Math.min(t.value.to,Math.max(t.value.from,v))}e.onMounted(()=>{h()});function h(){o.objectIsEmpty(i.dataset)&&o.error({componentName:"VueUiRating",type:"dataset"}),y.value=[];for(let a=t.value.from;a<=t.value.to;a+=1)y.value.push(a)}function p(a,n=!1){return a>s.value||c.value?n?t.value.style.image.inactiveOpacity:t.value.style.star.inactiveColor:n?1:t.value.style.star.useGradient?`url(#star_gradient_under_${d.value})`:t.value.style.star.activeColor}function x(a,n=!1){const l=r.value-a,v=n?1:100;switch(!0){case l<=0:return .001;case l>1:return 1*v;default:return l*v}}function b(a){c.value||(r.value=a,_("rate",a))}function E(){return r.value}function V(a=!0){c.value=a}return S({getData:E,toggleReadonly:V}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily};width:100%`),class:"vue-ui-rating",onMouseover:n[2]||(n[2]=l=>g.value=!0),onMouseleave:n[3]||(n[3]=l=>{g.value=!1,s.value=void 0})},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",A,[e.createElementVNode("div",{style:e.normalizeStyle(`color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"};text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.offsetY}px;font-size:${t.value.style.title.fontSize}px`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`color:${t.value.style.title.subtitle.color};font-size:${t.value.style.title.subtitle.fontSize}px;text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.subtitle.offsetY}px;font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.rating.show&&t.value.style.rating.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:100%;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(o.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"vue-ui-rating-wrapper",style:e.normalizeStyle(`height:${t.value.style.itemSize}px;width:100%;display:flex;align-items:center;justify-content:center`)},[t.value.style.rating.show&&t.value.style.rating.position==="left"?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-right:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(o.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(l,v)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-rating-unit-container",style:e.normalizeStyle(`position:relative;height:${t.value.style.itemSize}px;width:${t.value.style.itemSize}px`)},[m.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.value.style.image.src,height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;opacity:${isNaN(s.value)?t.value.style.image.inactiveOpacity:p(l,!0)}`)},null,12,R)):(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit"},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_under_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(o.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,F),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,I)],8,j)]),e.createElementVNode("polygon",{points:e.unref(o.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:isNaN(s.value)?t.value.style.star.inactiveColor:p(l),stroke:t.value.style.star.borderColor?t.value.style.star.borderColor:s.value?p(l):t.value.style.star.inactiveColor,"stroke-width":t.value.style.star.borderWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,O)],8,X)),m.value?(e.openBlock(),e.createElementBlock("img",{key:2,src:t.value.style.image.src,alt:`${t.value.style.image.alt} ${l}`,height:t.value.style.itemSize,width:t.value.style.itemSize,id:`active_${d.value}_${l}`,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;clip:rect(0px,${x(v,!0)*t.value.style.itemSize}px,${t.value.style.itemSize}px,0px`)},null,12,Y)):(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(o.XMLNS),viewBox:`0 0 ${x(v)} 100`,height:t.value.style.itemSize,class:"vue-ui-rating-unit",id:`active_${d.value}_${l}`,style:{position:"absolute",top:"0",left:"0"}},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_over_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(o.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,q),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,H)],8,U)]),e.createElementVNode("polygon",{points:e.unref(o.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:t.value.style.star.useGradient?`url(#star_gradient_over_${d.value})`:t.value.style.star.activeColor,stroke:t.value.style.star.activeColor},null,8,K)],8,G)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(o.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;${c.value?"":"cursor:pointer"}`)},[c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("rect",{key:0,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onClick:u=>b(l),onMouseenter:u=>s.value=l,onMouseleave:n[0]||(n[0]=u=>s.value=void 0),tabindex:"0",onKeyup:e.withKeys(u=>b(l),["enter"])},null,40,T)),c.value?(e.openBlock(),e.createElementBlock("rect",{key:1,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onMouseenter:u=>s.value=l,onMouseleave:n[1]||(n[1]=u=>s.value=void 0)},null,40,W)):e.createCommentVNode("",!0)],12,P)),t.value.style.tooltip.show&&N.value&&c.value?(e.openBlock(),e.createElementBlock("div",{key:4,class:"vue-ui-rating-tooltip",style:e.normalizeStyle(`border:1px solid ${t.value.style.tooltip.borderColor};position:absolute;top:${-48+t.value.style.tooltip.offsetY}px;left:50%;transform:translateX(-50%);width:fit-content;text-align:center;background:${t.value.style.tooltip.backgroundColor};display:${s.value===l?"block":"none"};padding:2px 12px;border-radius:${t.value.style.tooltip.borderRadius}px;box-shadow:${t.value.style.tooltip.boxShadow}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`width:100%;display:flex;flex-direction:row;gap:6px;position:relative;text-align:center;color:${t.value.style.tooltip.color}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(l)+":",5),e.createElementVNode("span",{style:e.normalizeStyle(`font-weight:${t.value.style.tooltip.bold?"bold":"normal"};font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.tooltip.formatter,i.dataset.rating[l],e.unref(o.dataLabel)({v:i.dataset.rating[l],r:t.value.style.tooltip.roundingValue}),t.value)),5),e.createElementVNode("div",{style:e.normalizeStyle(`font-family:Arial !important;position:absolute;top:calc(100% - 4px);left:50%;transform:translateX(-50%);color:${t.value.style.tooltip.borderColor}`)}," ▼ ",4)],4)],4)):e.createCommentVNode("",!0)],4))),256)),t.value.style.rating.show&&t.value.style.rating.position==="right"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(o.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0)],4),t.value.style.rating.show&&t.value.style.rating.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle(`width:100%;text-align:center;margin-top:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(o.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0)],36))}},Q=D._export_sfc(J,[["__scopeId","data-v-9e1d13d5"]]);exports.default=Q;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as h, useSlots as T, onMounted as R, computed as x, watch as W, openBlock as a, createElementBlock as o, normalizeStyle as i, createElementVNode as r, toDisplayString as g, createCommentVNode as y, unref as s, Fragment as H, renderList as P, withKeys as q } from "vue";
|
|
2
|
-
import { u as J, c as Q, o as Z, e as tt, i as $, f as b, X as k, w as F, W as X } from "./index-
|
|
3
|
-
import { u as et } from "./useNestedProp-
|
|
2
|
+
import { u as J, c as Q, o as Z, e as tt, i as $, f as b, X as k, w as F, W as X } from "./index-DiqenHrX.js";
|
|
3
|
+
import { u as et } from "./useNestedProp-B3CQkP95.js";
|
|
4
4
|
import { _ as lt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
const at = {
|
|
6
6
|
key: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index--Qj2S12-.cjs"),Z=require("./useResponsive-BJ7DTGpm.cjs"),Ce=require("./Title-BX4Wt59j.cjs"),ee=require("./usePrinter-DOZ7DmEX.cjs"),Be=require("./vue-ui-skeleton-BVhUJapg.cjs"),te=require("./useNestedProp-C5bsAL3S.cjs"),$e=require("./PackageVersion-D3FEDqJ4.cjs"),Pe=require("./PenAndPaper-0PiYibYi.cjs"),_e=require("./useUserOptionState-BgepsfED.cjs"),Le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ze=["id"],Oe=["xmlns","viewBox"],Se=["width","height"],Ee=["cx","cy","r","stroke","stroke-width"],Ae={key:1},Ne=["stroke","d","stroke-width"],Ie={style:{"pointer-events":"none"}},Ve=["cx","cy","fill","r","stroke"],Fe=["x","y","fill","font-size"],Me={key:2},Te=["stroke","stroke-width","x1","x2","y1","y2"],Re={style:{"pointer-events":"none"}},je=["cx","cy","fill","r","stroke"],qe=["x","y","fill","font-size"],De=["text-anchor","transform","x","y","onClick","font-weight","font-size","fill"],Ue=["cx","cy","fill","stroke","onClick","r"],Ge={key:5,class:"vue-data-ui-watermark"},We={__name:"vue-ui-relation-circle",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},setup(le,{expose:re}){const y=le;e.useCssVars(t=>({"51b67ab0":ue.value,"3bc0348f":ie.value,"5deebf9e":ce.value}));const{vue_ui_relation_circle:ne}=o.useConfig(),$=e.computed(()=>!!y.dataset&&Object.keys(y.dataset).length),w=e.ref(o.createUid()),E=e.ref(0),b=e.ref(null),A=e.ref(null),N=e.ref(null),I=e.ref(null),V=e.ref(0),r=e.computed({get:()=>T(),set:t=>t}),{userOptionsVisible:P,setUserOptionsVisibility:F,keepUserOptionState:M}=_e.useUserOptionState({config:r.value});function T(){const t=te.useNestedProp({userConfig:y.config,defaultConfig:ne});return t.theme?{...te.useNestedProp({userConfig:o.themes.vue_ui_relation_circle[t.theme]||y.config,defaultConfig:t}),customPalette:o.themePalettes[t.theme]||o.palette}:t}e.watch(()=>y.config,t=>{r.value=T(),P.value=!r.value.userOptions.showOnChartHover,Y(),V.value+=1},{deep:!0});const{isPrinting:R,isImaging:j,generatePdf:q,generateImage:D}=ee.usePrinter({elementId:`relation_circle_${w.value}`,fileName:r.value.style.title.text||"vue-ui-relation-circle"}),oe=e.computed(()=>r.value.userOptions.show&&!r.value.style.title.text),U=e.computed(()=>o.convertCustomPalette(r.value.customPalette)),h=e.ref([]),d=e.ref([]),i=e.ref({}),v=e.ref([]),se=e.ref(0),_=e.computed(()=>y.dataset.slice(0,r.value.style.limit)),k=e.ref(r.value.style.size),f=e.ref(r.value.style.weightLabels.size),G=e.ref(r.value.style.plot.radius),W=e.ref(r.value.style.labels.fontSize),a=e.ref({height:r.value.style.size,width:r.value.style.size}),m=e.computed({get(){return k.value*r.value.style.circle.radiusProportion},set(t){return t}}),ae=e.computed(()=>r.value.style.links.curved),ie=e.computed(()=>`${r.value.style.animation.speedMs}ms`),ue=e.computed(()=>m.value*2),ce=e.computed(()=>m.value*4),x=e.ref(null);e.onMounted(()=>{Y(),document.getElementById(`relation_circle_${w.value}`).addEventListener("click",X)});function Y(){if(o.objectIsEmpty(y.dataset)?o.error({componentName:"VueUiRelationCircle",type:"dataset"}):y.dataset.forEach((t,n)=>{o.getMissingDatasetAttributes({datasetObject:t,requiredAttributes:["id","label","relations","weights"]}).forEach(l=>{o.error({componentName:"VueUiRelationCircle",type:"datasetSerieAttribute",property:l,index:n})})}),r.value.responsive){const t=Z.throttle(()=>{const{width:n,height:l}=Z.useResponsive({chart:b.value,title:r.value.style.title.text?A.value:null,source:N.value,noTitle:I.value});requestAnimationFrame(()=>{k.value=Math.min(n,l),a.value.width=n,a.value.height=l,m.value=k.value*r.value.style.circle.radiusProportion,h.value=[],d.value=[],H(),J(),f.value=o.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.weightLabels.size,threshold:6,fallback:6}),G.value=o.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.plot.radius,threshold:1,fallback:1}),W.value=o.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.labels.fontSize,threshold:6,fallback:6})})});x.value=new ResizeObserver(t),x.value.observe(b.value.parentNode)}else h.value=[],d.value=[],H(),J()}e.onBeforeUnmount(()=>{document.getElementById(`relation_circle_${w.value}`).removeEventListener("click",X),x.value&&x.value.disconnect()});function X(t){const n=t.target;n&&Array.from(n.classList).includes("vue-ui-user-options")||n&&Array.from(n.classList).includes("vue-ui-user-options-summary")||n&&Array.from(n.classList).includes("vue-data-ui-button")||n&&Array.from(n.classList).includes("vue-ui-relation-circle-legend")||(i.value={},v.value=[])}function H(){const t=6.28319/_.value.length,n=360/_.value.length;let l=0,s=0;_.value.forEach((c,u)=>{const O=c.weights.reduce((be,xe)=>be+xe,0),S=m.value*Math.cos(l)+a.value.width/2,we=m.value*Math.sin(l)+a.value.height/2+r.value.style.circle.offsetY;h.value.push({x:S,y:we,...c,color:c.color?c.color:U.value[u]?U.value[u]:o.palette[u],regAngle:s,totalWeight:O}),l+=t,s+=n})}function de(t,n){const l=(t.x+n.x)/2,s=(t.y+n.y)/2;return{x:l,y:s}}function J(){d.value=[],h.value.forEach(t=>{h.value.filter(l=>l.relations.includes(t.id)).forEach((l,s)=>{const c=l.relations.indexOf(t.id);d.value.push({weight:l.weights[c]?l.weights[c]:0,relationId:`${t.id}_${l.id}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,colorSource:t.color,colorTarget:l.color,midPointLine:de({x:t.x,y:t.y},{x:l.x,y:l.y}),midPointBezier:ve({x1:t.x,x2:l.x,y1:t.y,y2:l.y}),...t})})})}function ve(t){const n={x:t.x1,y:t.y1},l={x:t.x2,y:t.y2},s={x:t.x1,y:t.y1},c={x:a.value.width/2,y:a.value.height/2+r.value.style.circle.offsetY},u=.5,O=Math.pow(1-u,3)*n.x+3*Math.pow(1-u,2)*u*s.x+3*(1-u)*Math.pow(u,2)*c.x+Math.pow(u,3)*l.x,S=Math.pow(1-u,3)*n.y+3*Math.pow(1-u,2)*u*s.y+3*(1-u)*Math.pow(u,2)*c.y+Math.pow(u,3)*l.y;return{x:O,y:S}}const fe=e.computed(()=>Math.max(...d.value.map(t=>t.weight)));function ye(t){return Object.hasOwn(i.value,"x")?v.value.includes(t.id)?"opacity:1":"opacity:0.1":"opacity:1"}function g(t){return t.colorSource}function K(t){return Object.hasOwn(i.value,"x")?v.value.includes(t.id)&&t.relationId===`${t.id}_${i.value.id}`||t.relationId===`${i.value.id}_${t.id}`?`opacity:1;stroke-width:${L(t)}`:"opacity: 0":"opacity: 1"}function p(t){return Object.hasOwn(i.value,"x")?!!(v.value.includes(t.id)&&t.relationId===`${t.id}_${i.value.id}`||t.relationId===`${i.value.id}_${t.id}`):!1}function ge(t){return t.regAngle>90&&t.regAngle<270?"end":"start"}function he(t){return t.regAngle>90&&t.regAngle<270?t.x-5:t.x+5}function me(t){return Object.hasOwn(i.value,"x")?i.value.id===t.id||v.value.includes(t.id)?"opacity:1":"opacity:0.2":"opacity:1"}function ke(t){return t.regAngle>90&&t.regAngle<270?`rotate(${t.regAngle+180},${t.x},${t.y})`:`rotate(${t.regAngle},${t.x},${t.y})`}function Q(t){se.value=360-t.regAngle,i.value.id&&t.id===i.value.id?(i.value={},v.value=[]):(i.value=t,v.value=[...t.relations])}function L(t){const n=t.weight/fe.value*r.value.style.links.maxWidth;return Math.max(.3,n)}const C=e.ref(!1);function pe(t){C.value=t,E.value+=1}const B=e.ref(!1);function z(){B.value=!B.value}return re({generatePdf:q,generateImage:D,toggleAnnotator:z}),(t,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"relationCircleChart",ref:b,class:"vue-ui-relation-circle",style:e.normalizeStyle(`width:100%;background:${r.value.style.backgroundColor};text-align:center;${r.value.responsive?"height: 100%":""}`),id:`relation_circle_${w.value}`,onMouseenter:n[0]||(n[0]=()=>e.unref(F)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref(F)(!1))},[r.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Pe.PenAndPaper,{key:0,parent:b.value,backgroundColor:r.value.style.backgroundColor,color:r.value.style.color,active:B.value,onClose:z},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),oe.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:I,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),r.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:A,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(Ce._sfc_main,{key:`title_${V.value}`,config:{title:{cy:"relation-div-title",...r.value.style.title},subtitle:{cy:"relation-div-subtitle",...r.value.style.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),r.value.userOptions.show&&$.value&&(e.unref(M)||e.unref(P))?(e.openBlock(),e.createBlock(ee.UserOptions,{ref:"details",key:`user_options_${E.value}`,backgroundColor:r.value.style.backgroundColor,color:r.value.style.color,isPrinting:e.unref(R),isImaging:e.unref(j),uid:w.value,hasPdf:r.value.userOptions.buttons.pdf,hasImg:r.value.userOptions.buttons.img,hasFullscreen:r.value.userOptions.buttons.img,hasXls:!1,isFullscreen:C.value,titles:{...r.value.userOptions.buttonTitles},chartElement:b.value,position:r.value.userOptions.position,hasAnnotator:r.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:pe,onGeneratePdf:e.unref(q),onGenerateImage:e.unref(D),onToggleAnnotator:z,style:e.normalizeStyle({visibility:e.unref(M)?e.unref(P)?"visible":"hidden":"visible"})},e.createSlots({_:2},[t.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,t.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,t.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:s})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:s})),void 0,!0)]),key:"2"}:void 0,t.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:s})=>[e.renderSlot(t.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:s})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(o.XMLNS),class:e.normalizeClass([{"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.value},"relation-circle"]),viewBox:`0 0 ${a.value.width<=0?10:a.value.width} ${a.value.height<=0?10:a.value.height}`,width:"100%",style:"user-select:none; background:transparent"},[e.createVNode($e._sfc_main),t.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:a.value.width<=0?10:a.value.width,height:a.value.height<=0?10:a.value.height,style:{pointerEvents:"none"}},[e.renderSlot(t.$slots,"chart-background",{},void 0,!0)],8,Se)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:(a.value.width<=0?1e-4:a.value.width)/2,cy:(a.value.height<=0?1e-4:a.value.height)/2+r.value.style.circle.offsetY,r:m.value<=0?1e-4:m.value,stroke:r.value.style.circle.stroke,"stroke-width":r.value.style.circle.strokeWidth,fill:"transparent",class:"main-circle"},null,8,Ee),ae.value?(e.openBlock(),e.createElementBlock("g",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,s)=>(e.openBlock(),e.createElementBlock("path",{key:`relation_${s}`,style:e.normalizeStyle(K(l)),stroke:g(l),class:e.normalizeClass(["relation",{"vue-ui-relation-circle-selected":i.value.hasOwnProperty("id")&&v.value.includes(l.id)}]),d:`M${l.x1},${l.y1} C${l.x1},${l.y1} ${a.value.width/2},${a.value.height/2+r.value.style.circle.offsetY} ${l.x2},${l.y2}`,fill:"none","stroke-width":L(l),"stroke-linecap":"round"},null,14,Ne))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",Ie,[p(l)?e.renderSlot(t.$slots,"dataLabel",e.normalizeProps(e.mergeProps({key:0},{x:l.midPointBezier.x,y:l.midPointBezier.y,color:g(l),weight:l.weight,fontSize:f.value})),void 0,!0):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel?(e.openBlock(),e.createElementBlock("circle",{key:1,cx:l.midPointBezier.x,cy:l.midPointBezier.y,fill:g(l),r:f.value,stroke:r.value.style.backgroundColor,"stroke-width":"1"},null,8,Ve)):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel?(e.openBlock(),e.createElementBlock("text",{key:2,x:l.midPointBezier.x,y:l.midPointBezier.y+f.value/3,fill:e.unref(o.adaptColorToBackground)(g(l)),"text-anchor":"middle","font-size":f.value},e.toDisplayString(e.unref(o.applyDataLabel)(r.value.style.weightLabels.formatter,l.weight,e.unref(o.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.weight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l})),9,Fe)):e.createCommentVNode("",!0)]))),256))])):(e.openBlock(),e.createElementBlock("g",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,s)=>(e.openBlock(),e.createElementBlock("line",{key:`relation_${s}`,stroke:g(l),"stroke-width":L(l),style:e.normalizeStyle(K(l)),x1:l.x1,x2:l.x2,y1:l.y1,y2:l.y2,class:e.normalizeClass({"vue-ui-relation-circle-selected":i.value.hasOwnProperty("id")&&v.value.includes(l.id)}),"stroke-linecap":"round"},null,14,Te))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",Re,[p(l)?e.renderSlot(t.$slots,"dataLabel",e.normalizeProps(e.mergeProps({key:0},{x:l.midPointLine.x,y:l.midPointLine.y,color:g(l),weight:l.weight,fontSize:f.value})),void 0,!0):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel&&r.value.style.weightLabels.show?(e.openBlock(),e.createElementBlock("circle",{key:1,cx:l.midPointLine.x,cy:l.midPointLine.y,fill:g(l),r:f.value,stroke:r.value.style.backgroundColor,"stroke-width":"1"},null,8,je)):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel&&r.value.style.weightLabels.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:l.midPointLine.x,y:l.midPointLine.y+f.value/3,fill:e.unref(o.adaptColorToBackground)(g(l)),"text-anchor":"middle","font-size":f.value},e.toDisplayString(e.unref(o.applyDataLabel)(r.value.style.weightLabels.formatter,l.weight,e.unref(o.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.weight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l})),9,qe)):e.createCommentVNode("",!0)]))),256))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,s)=>(e.openBlock(),e.createElementBlock("text",{key:`plot_text_${s}`,"text-anchor":ge(l),transform:ke(l),x:he(l),y:l.y+5,onClick:c=>Q(l),class:"vue-ui-relation-circle-legend","transform-origin":"start","font-weight":i.value.id===l.id?"900":"400",style:e.normalizeStyle(`font-family:${r.value.style.fontFamily};${me(l)}`),"font-size":W.value,fill:r.value.style.labels.color},e.toDisplayString(l.label)+" ("+e.toDisplayString(e.unref(o.applyDataLabel)(r.value.style.weightLabels.formatter,l.totalWeight,e.unref(o.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.totalWeight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l}))+") ",13,De))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,s)=>(e.openBlock(),e.createElementBlock("circle",{cx:l.x,cy:l.y,key:`plot_${s}`,style:e.normalizeStyle(ye(l)),class:"vue-ui-relation-circle-plot",fill:r.value.style.plot.useSerieColor?l.color:r.value.style.plot.color,stroke:r.value.style.backgroundColor,"stroke-width":"1",onClick:c=>Q(l),r:G.value},null,12,Ue))),128)),e.renderSlot(t.$slots,"svg",{svg:a.value},void 0,!0)],10,Oe)):e.createCommentVNode("",!0),t.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ge,[e.renderSlot(t.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(R)||e.unref(j)})),void 0,!0)])):e.createCommentVNode("",!0),t.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:N,dir:"auto"},[e.renderSlot(t.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Be.default,{key:7,config:{type:"relationCircle",style:{backgroundColor:r.value.style.backgroundColor,relationCircle:{color:"#CCCCCC"}}}},null,8,["config"]))],44,ze))}},Ye=Le._export_sfc(We,[["__scopeId","data-v-dd9e8e63"]]);exports.default=Ye;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-C_VTEz1N.cjs"),Z=require("./useResponsive-BJ7DTGpm.cjs"),Ce=require("./Title-DFq_8HYJ.cjs"),ee=require("./usePrinter-DWCqeYW6.cjs"),Be=require("./vue-ui-skeleton-D1bJntn7.cjs"),te=require("./useNestedProp-C7bLHE7v.cjs"),$e=require("./PackageVersion-CdmZAhdE.cjs"),Pe=require("./PenAndPaper-BsncKiRE.cjs"),_e=require("./useUserOptionState-BgepsfED.cjs"),Le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ze=["id"],Oe=["xmlns","viewBox"],Se=["width","height"],Ee=["cx","cy","r","stroke","stroke-width"],Ae={key:1},Ne=["stroke","d","stroke-width"],Ie={style:{"pointer-events":"none"}},Ve=["cx","cy","fill","r","stroke"],Fe=["x","y","fill","font-size"],Me={key:2},Te=["stroke","stroke-width","x1","x2","y1","y2"],Re={style:{"pointer-events":"none"}},je=["cx","cy","fill","r","stroke"],qe=["x","y","fill","font-size"],De=["text-anchor","transform","x","y","onClick","font-weight","font-size","fill"],Ue=["cx","cy","fill","stroke","onClick","r"],Ge={key:5,class:"vue-data-ui-watermark"},We={__name:"vue-ui-relation-circle",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},setup(le,{expose:re}){const y=le;e.useCssVars(t=>({"51b67ab0":ue.value,"3bc0348f":ie.value,"5deebf9e":ce.value}));const{vue_ui_relation_circle:ne}=o.useConfig(),$=e.computed(()=>!!y.dataset&&Object.keys(y.dataset).length),w=e.ref(o.createUid()),E=e.ref(0),b=e.ref(null),A=e.ref(null),N=e.ref(null),I=e.ref(null),V=e.ref(0),r=e.computed({get:()=>T(),set:t=>t}),{userOptionsVisible:P,setUserOptionsVisibility:F,keepUserOptionState:M}=_e.useUserOptionState({config:r.value});function T(){const t=te.useNestedProp({userConfig:y.config,defaultConfig:ne});return t.theme?{...te.useNestedProp({userConfig:o.themes.vue_ui_relation_circle[t.theme]||y.config,defaultConfig:t}),customPalette:o.themePalettes[t.theme]||o.palette}:t}e.watch(()=>y.config,t=>{r.value=T(),P.value=!r.value.userOptions.showOnChartHover,Y(),V.value+=1},{deep:!0});const{isPrinting:R,isImaging:j,generatePdf:q,generateImage:D}=ee.usePrinter({elementId:`relation_circle_${w.value}`,fileName:r.value.style.title.text||"vue-ui-relation-circle"}),oe=e.computed(()=>r.value.userOptions.show&&!r.value.style.title.text),U=e.computed(()=>o.convertCustomPalette(r.value.customPalette)),h=e.ref([]),d=e.ref([]),i=e.ref({}),v=e.ref([]),se=e.ref(0),_=e.computed(()=>y.dataset.slice(0,r.value.style.limit)),k=e.ref(r.value.style.size),f=e.ref(r.value.style.weightLabels.size),G=e.ref(r.value.style.plot.radius),W=e.ref(r.value.style.labels.fontSize),a=e.ref({height:r.value.style.size,width:r.value.style.size}),m=e.computed({get(){return k.value*r.value.style.circle.radiusProportion},set(t){return t}}),ae=e.computed(()=>r.value.style.links.curved),ie=e.computed(()=>`${r.value.style.animation.speedMs}ms`),ue=e.computed(()=>m.value*2),ce=e.computed(()=>m.value*4),x=e.ref(null);e.onMounted(()=>{Y(),document.getElementById(`relation_circle_${w.value}`).addEventListener("click",X)});function Y(){if(o.objectIsEmpty(y.dataset)?o.error({componentName:"VueUiRelationCircle",type:"dataset"}):y.dataset.forEach((t,n)=>{o.getMissingDatasetAttributes({datasetObject:t,requiredAttributes:["id","label","relations","weights"]}).forEach(l=>{o.error({componentName:"VueUiRelationCircle",type:"datasetSerieAttribute",property:l,index:n})})}),r.value.responsive){const t=Z.throttle(()=>{const{width:n,height:l}=Z.useResponsive({chart:b.value,title:r.value.style.title.text?A.value:null,source:N.value,noTitle:I.value});requestAnimationFrame(()=>{k.value=Math.min(n,l),a.value.width=n,a.value.height=l,m.value=k.value*r.value.style.circle.radiusProportion,h.value=[],d.value=[],H(),J(),f.value=o.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.weightLabels.size,threshold:6,fallback:6}),G.value=o.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.plot.radius,threshold:1,fallback:1}),W.value=o.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.labels.fontSize,threshold:6,fallback:6})})});x.value=new ResizeObserver(t),x.value.observe(b.value.parentNode)}else h.value=[],d.value=[],H(),J()}e.onBeforeUnmount(()=>{document.getElementById(`relation_circle_${w.value}`).removeEventListener("click",X),x.value&&x.value.disconnect()});function X(t){const n=t.target;n&&Array.from(n.classList).includes("vue-ui-user-options")||n&&Array.from(n.classList).includes("vue-ui-user-options-summary")||n&&Array.from(n.classList).includes("vue-data-ui-button")||n&&Array.from(n.classList).includes("vue-ui-relation-circle-legend")||(i.value={},v.value=[])}function H(){const t=6.28319/_.value.length,n=360/_.value.length;let l=0,s=0;_.value.forEach((c,u)=>{const O=c.weights.reduce((be,xe)=>be+xe,0),S=m.value*Math.cos(l)+a.value.width/2,we=m.value*Math.sin(l)+a.value.height/2+r.value.style.circle.offsetY;h.value.push({x:S,y:we,...c,color:c.color?c.color:U.value[u]?U.value[u]:o.palette[u],regAngle:s,totalWeight:O}),l+=t,s+=n})}function de(t,n){const l=(t.x+n.x)/2,s=(t.y+n.y)/2;return{x:l,y:s}}function J(){d.value=[],h.value.forEach(t=>{h.value.filter(l=>l.relations.includes(t.id)).forEach((l,s)=>{const c=l.relations.indexOf(t.id);d.value.push({weight:l.weights[c]?l.weights[c]:0,relationId:`${t.id}_${l.id}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,colorSource:t.color,colorTarget:l.color,midPointLine:de({x:t.x,y:t.y},{x:l.x,y:l.y}),midPointBezier:ve({x1:t.x,x2:l.x,y1:t.y,y2:l.y}),...t})})})}function ve(t){const n={x:t.x1,y:t.y1},l={x:t.x2,y:t.y2},s={x:t.x1,y:t.y1},c={x:a.value.width/2,y:a.value.height/2+r.value.style.circle.offsetY},u=.5,O=Math.pow(1-u,3)*n.x+3*Math.pow(1-u,2)*u*s.x+3*(1-u)*Math.pow(u,2)*c.x+Math.pow(u,3)*l.x,S=Math.pow(1-u,3)*n.y+3*Math.pow(1-u,2)*u*s.y+3*(1-u)*Math.pow(u,2)*c.y+Math.pow(u,3)*l.y;return{x:O,y:S}}const fe=e.computed(()=>Math.max(...d.value.map(t=>t.weight)));function ye(t){return Object.hasOwn(i.value,"x")?v.value.includes(t.id)?"opacity:1":"opacity:0.1":"opacity:1"}function g(t){return t.colorSource}function K(t){return Object.hasOwn(i.value,"x")?v.value.includes(t.id)&&t.relationId===`${t.id}_${i.value.id}`||t.relationId===`${i.value.id}_${t.id}`?`opacity:1;stroke-width:${L(t)}`:"opacity: 0":"opacity: 1"}function p(t){return Object.hasOwn(i.value,"x")?!!(v.value.includes(t.id)&&t.relationId===`${t.id}_${i.value.id}`||t.relationId===`${i.value.id}_${t.id}`):!1}function ge(t){return t.regAngle>90&&t.regAngle<270?"end":"start"}function he(t){return t.regAngle>90&&t.regAngle<270?t.x-5:t.x+5}function me(t){return Object.hasOwn(i.value,"x")?i.value.id===t.id||v.value.includes(t.id)?"opacity:1":"opacity:0.2":"opacity:1"}function ke(t){return t.regAngle>90&&t.regAngle<270?`rotate(${t.regAngle+180},${t.x},${t.y})`:`rotate(${t.regAngle},${t.x},${t.y})`}function Q(t){se.value=360-t.regAngle,i.value.id&&t.id===i.value.id?(i.value={},v.value=[]):(i.value=t,v.value=[...t.relations])}function L(t){const n=t.weight/fe.value*r.value.style.links.maxWidth;return Math.max(.3,n)}const C=e.ref(!1);function pe(t){C.value=t,E.value+=1}const B=e.ref(!1);function z(){B.value=!B.value}return re({generatePdf:q,generateImage:D,toggleAnnotator:z}),(t,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"relationCircleChart",ref:b,class:"vue-ui-relation-circle",style:e.normalizeStyle(`width:100%;background:${r.value.style.backgroundColor};text-align:center;${r.value.responsive?"height: 100%":""}`),id:`relation_circle_${w.value}`,onMouseenter:n[0]||(n[0]=()=>e.unref(F)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref(F)(!1))},[r.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Pe.PenAndPaper,{key:0,parent:b.value,backgroundColor:r.value.style.backgroundColor,color:r.value.style.color,active:B.value,onClose:z},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),oe.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:I,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),r.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:A,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(Ce._sfc_main,{key:`title_${V.value}`,config:{title:{cy:"relation-div-title",...r.value.style.title},subtitle:{cy:"relation-div-subtitle",...r.value.style.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),r.value.userOptions.show&&$.value&&(e.unref(M)||e.unref(P))?(e.openBlock(),e.createBlock(ee.UserOptions,{ref:"details",key:`user_options_${E.value}`,backgroundColor:r.value.style.backgroundColor,color:r.value.style.color,isPrinting:e.unref(R),isImaging:e.unref(j),uid:w.value,hasPdf:r.value.userOptions.buttons.pdf,hasImg:r.value.userOptions.buttons.img,hasFullscreen:r.value.userOptions.buttons.img,hasXls:!1,isFullscreen:C.value,titles:{...r.value.userOptions.buttonTitles},chartElement:b.value,position:r.value.userOptions.position,hasAnnotator:r.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:pe,onGeneratePdf:e.unref(q),onGenerateImage:e.unref(D),onToggleAnnotator:z,style:e.normalizeStyle({visibility:e.unref(M)?e.unref(P)?"visible":"hidden":"visible"})},e.createSlots({_:2},[t.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,t.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,t.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:s})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:s})),void 0,!0)]),key:"2"}:void 0,t.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:s})=>[e.renderSlot(t.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:s})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(o.XMLNS),class:e.normalizeClass([{"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.value},"relation-circle"]),viewBox:`0 0 ${a.value.width<=0?10:a.value.width} ${a.value.height<=0?10:a.value.height}`,width:"100%",style:"user-select:none; background:transparent"},[e.createVNode($e._sfc_main),t.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:a.value.width<=0?10:a.value.width,height:a.value.height<=0?10:a.value.height,style:{pointerEvents:"none"}},[e.renderSlot(t.$slots,"chart-background",{},void 0,!0)],8,Se)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:(a.value.width<=0?1e-4:a.value.width)/2,cy:(a.value.height<=0?1e-4:a.value.height)/2+r.value.style.circle.offsetY,r:m.value<=0?1e-4:m.value,stroke:r.value.style.circle.stroke,"stroke-width":r.value.style.circle.strokeWidth,fill:"transparent",class:"main-circle"},null,8,Ee),ae.value?(e.openBlock(),e.createElementBlock("g",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,s)=>(e.openBlock(),e.createElementBlock("path",{key:`relation_${s}`,style:e.normalizeStyle(K(l)),stroke:g(l),class:e.normalizeClass(["relation",{"vue-ui-relation-circle-selected":i.value.hasOwnProperty("id")&&v.value.includes(l.id)}]),d:`M${l.x1},${l.y1} C${l.x1},${l.y1} ${a.value.width/2},${a.value.height/2+r.value.style.circle.offsetY} ${l.x2},${l.y2}`,fill:"none","stroke-width":L(l),"stroke-linecap":"round"},null,14,Ne))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",Ie,[p(l)?e.renderSlot(t.$slots,"dataLabel",e.normalizeProps(e.mergeProps({key:0},{x:l.midPointBezier.x,y:l.midPointBezier.y,color:g(l),weight:l.weight,fontSize:f.value})),void 0,!0):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel?(e.openBlock(),e.createElementBlock("circle",{key:1,cx:l.midPointBezier.x,cy:l.midPointBezier.y,fill:g(l),r:f.value,stroke:r.value.style.backgroundColor,"stroke-width":"1"},null,8,Ve)):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel?(e.openBlock(),e.createElementBlock("text",{key:2,x:l.midPointBezier.x,y:l.midPointBezier.y+f.value/3,fill:e.unref(o.adaptColorToBackground)(g(l)),"text-anchor":"middle","font-size":f.value},e.toDisplayString(e.unref(o.applyDataLabel)(r.value.style.weightLabels.formatter,l.weight,e.unref(o.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.weight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l})),9,Fe)):e.createCommentVNode("",!0)]))),256))])):(e.openBlock(),e.createElementBlock("g",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,s)=>(e.openBlock(),e.createElementBlock("line",{key:`relation_${s}`,stroke:g(l),"stroke-width":L(l),style:e.normalizeStyle(K(l)),x1:l.x1,x2:l.x2,y1:l.y1,y2:l.y2,class:e.normalizeClass({"vue-ui-relation-circle-selected":i.value.hasOwnProperty("id")&&v.value.includes(l.id)}),"stroke-linecap":"round"},null,14,Te))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",Re,[p(l)?e.renderSlot(t.$slots,"dataLabel",e.normalizeProps(e.mergeProps({key:0},{x:l.midPointLine.x,y:l.midPointLine.y,color:g(l),weight:l.weight,fontSize:f.value})),void 0,!0):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel&&r.value.style.weightLabels.show?(e.openBlock(),e.createElementBlock("circle",{key:1,cx:l.midPointLine.x,cy:l.midPointLine.y,fill:g(l),r:f.value,stroke:r.value.style.backgroundColor,"stroke-width":"1"},null,8,je)):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel&&r.value.style.weightLabels.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:l.midPointLine.x,y:l.midPointLine.y+f.value/3,fill:e.unref(o.adaptColorToBackground)(g(l)),"text-anchor":"middle","font-size":f.value},e.toDisplayString(e.unref(o.applyDataLabel)(r.value.style.weightLabels.formatter,l.weight,e.unref(o.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.weight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l})),9,qe)):e.createCommentVNode("",!0)]))),256))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,s)=>(e.openBlock(),e.createElementBlock("text",{key:`plot_text_${s}`,"text-anchor":ge(l),transform:ke(l),x:he(l),y:l.y+5,onClick:c=>Q(l),class:"vue-ui-relation-circle-legend","transform-origin":"start","font-weight":i.value.id===l.id?"900":"400",style:e.normalizeStyle(`font-family:${r.value.style.fontFamily};${me(l)}`),"font-size":W.value,fill:r.value.style.labels.color},e.toDisplayString(l.label)+" ("+e.toDisplayString(e.unref(o.applyDataLabel)(r.value.style.weightLabels.formatter,l.totalWeight,e.unref(o.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.totalWeight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l}))+") ",13,De))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,s)=>(e.openBlock(),e.createElementBlock("circle",{cx:l.x,cy:l.y,key:`plot_${s}`,style:e.normalizeStyle(ye(l)),class:"vue-ui-relation-circle-plot",fill:r.value.style.plot.useSerieColor?l.color:r.value.style.plot.color,stroke:r.value.style.backgroundColor,"stroke-width":"1",onClick:c=>Q(l),r:G.value},null,12,Ue))),128)),e.renderSlot(t.$slots,"svg",{svg:a.value},void 0,!0)],10,Oe)):e.createCommentVNode("",!0),t.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ge,[e.renderSlot(t.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(R)||e.unref(j)})),void 0,!0)])):e.createCommentVNode("",!0),t.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:N,dir:"auto"},[e.renderSlot(t.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Be.default,{key:7,config:{type:"relationCircle",style:{backgroundColor:r.value.style.backgroundColor,relationCircle:{color:"#CCCCCC"}}}},null,8,["config"]))],44,ze))}},Ye=Le._export_sfc(We,[["__scopeId","data-v-dd9e8e63"]]);exports.default=Ye;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useCssVars as Ge, computed as f, ref as o, watch as Ve, onMounted as We, onBeforeUnmount as De, openBlock as i, createElementBlock as a, normalizeStyle as C, unref as u, createBlock as F, createCommentVNode as v, createSlots as Xe, withCtx as B, renderSlot as h, normalizeProps as A, guardReactiveProps as W, normalizeClass as D, createVNode as Ye, createElementVNode as qe, Fragment as P, renderList as L, mergeProps as ge, toDisplayString as E } from "vue";
|
|
2
|
-
import { u as He, c as Je, t as Ke, a as Qe, p as me, b as Ze, o as et, e as ke, g as tt, X as lt, G as pe, i as X, f as Y, F as q } from "./index-
|
|
2
|
+
import { u as He, c as Je, t as Ke, a as Qe, p as me, b as Ze, o as et, e as ke, g as tt, X as lt, G as pe, i as X, f as Y, F as q } from "./index-DiqenHrX.js";
|
|
3
3
|
import { t as st, u as it } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { _ as at } from "./Title-
|
|
5
|
-
import { u as nt, U as rt } from "./usePrinter-
|
|
6
|
-
import ut from "./vue-ui-skeleton-
|
|
7
|
-
import { u as we } from "./useNestedProp-
|
|
8
|
-
import { _ as ot } from "./PackageVersion-
|
|
9
|
-
import { P as ct } from "./PenAndPaper-
|
|
4
|
+
import { _ as at } from "./Title-CiQQgFbV.js";
|
|
5
|
+
import { u as nt, U as rt } from "./usePrinter-CHAgX1f-.js";
|
|
6
|
+
import ut from "./vue-ui-skeleton-BwWHgSoq.js";
|
|
7
|
+
import { u as we } from "./useNestedProp-B3CQkP95.js";
|
|
8
|
+
import { _ as ot } from "./PackageVersion-iscNRe7N.js";
|
|
9
|
+
import { P as ct } from "./PenAndPaper-B-VQ8eSo.js";
|
|
10
10
|
import { u as dt } from "./useUserOptionState-BIvW1Kz7.js";
|
|
11
11
|
import { _ as vt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
12
12
|
const yt = ["id"], ft = ["xmlns", "viewBox"], ht = ["width", "height"], gt = ["cx", "cy", "r", "stroke", "stroke-width"], mt = { key: 1 }, kt = ["stroke", "d", "stroke-width"], pt = { style: { "pointer-events": "none" } }, wt = ["cx", "cy", "fill", "r", "stroke"], xt = ["x", "y", "fill", "font-size"], bt = { key: 2 }, $t = ["stroke", "stroke-width", "x1", "x2", "y1", "y2"], _t = { style: { "pointer-events": "none" } }, Ct = ["cx", "cy", "fill", "r", "stroke"], Pt = ["x", "y", "fill", "font-size"], Lt = ["text-anchor", "transform", "x", "y", "onClick", "font-weight", "font-size", "fill"], Ot = ["cx", "cy", "fill", "stroke", "onClick", "r"], zt = {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-C_VTEz1N.cjs"),le=require("./useResponsive-BJ7DTGpm.cjs"),be=require("./Title-DFq_8HYJ.cjs"),oe=require("./usePrinter-DWCqeYW6.cjs"),ke=require("./Tooltip-pcZXVRMj.cjs"),Ce=require("./DataTable-D93-QmC8.cjs"),we=require("./Legend-Dh9aF6uH.cjs"),$e=require("./vue-ui-skeleton-D1bJntn7.cjs"),xe=require("./vue-ui-accordion-CtBhoUw4.cjs"),ae=require("./useNestedProp-C7bLHE7v.cjs"),Ne=require("./PackageVersion-CdmZAhdE.cjs"),Te=require("./PenAndPaper-BsncKiRE.cjs"),Se=require("./useUserOptionState-BgepsfED.cjs"),Be=require("./Shape-DZRynz5E.cjs"),_e=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Pe=["id"],Ve=["xmlns","viewBox"],Le=["width","height"],Ee=["id"],Oe=["stop-color"],Ie=["stop-color"],ze={key:1},Ae=["stroke","cx","cy","r","fill"],Fe=["stroke","stroke-width","cx","cy","r","fill"],Re=["stroke","stroke-width","cx","cy","r","fill"],qe=["cx","cy","r","onMouseenter"],Me={key:5,class:"vue-data-ui-watermark"},Ue=["onClick"],De={key:0},We={key:1},He=["innerHTML"],Ge={__name:"vue-ui-rings",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(re,{expose:ne,emit:se}){const p=re,{vue_ui_rings:ue}=n.useConfig(),ie=e.useSlots(),b=e.ref(!1),$=e.computed(()=>!!p.dataset&&p.dataset.length),g=e.ref(n.createUid()),ce=e.ref(null),x=e.ref(!1),_=e.ref(""),m=e.ref(null),O=e.ref(0),k=e.ref(null),I=e.ref(null),z=e.ref(null),A=e.ref(null),F=e.ref(null),R=e.ref(0),q=e.ref(0),M=e.ref(0),t=e.computed({get:()=>W(),set:l=>l}),{userOptionsVisible:P,setUserOptionsVisibility:U,keepUserOptionState:D}=Se.useUserOptionState({config:t.value});function W(){const l=ae.useNestedProp({userConfig:p.config,defaultConfig:ue});return l.theme?{...ae.useNestedProp({userConfig:n.themes.vue_ui_rings[l.theme]||p.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}e.watch(()=>p.config,l=>{t.value=W(),P.value=!t.value.userOptions.showOnChartHover,H(),R.value+=1,q.value+=1,M.value+=1,h.value.showTable=t.value.table.show,h.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0});const N=e.ref(null);e.onMounted(()=>{H()});function H(){if(n.objectIsEmpty(p.dataset)?n.error({componentName:"VueUiRings",type:"dataset"}):p.dataset.forEach((l,a)=>{l.values.length||n.error({componentName:"VueUiRings",type:"dataset"}),n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{n.error({componentName:"VueUiRings",type:"datasetSerieAttribute",property:o,index:a})})}),t.value.responsive){const l=le.throttle(()=>{const{width:a,height:o}=le.useResponsive({chart:k.value,title:t.value.style.chart.title.text?I.value:null,legend:t.value.style.chart.legend.show?z.value:null,source:A.value,noTitle:F.value});requestAnimationFrame(()=>{s.value.width=a,s.value.height=o})});N.value=new ResizeObserver(l),N.value.observe(k.value.parentNode)}setTimeout(()=>{b.value=!0},600)}e.onBeforeUnmount(()=>{N.value&&N.value.disconnect()});const{isPrinting:G,isImaging:j,generatePdf:X,generateImage:Y}=oe.usePrinter({elementId:`rings_${g.value}`,fileName:t.value.style.chart.title.text||"vue-ui-rings"}),de=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),J=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),h=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),s=e.ref({height:360,width:360}),ve=e.computed(()=>Math.min(s.value.height,s.value.width)),d=e.ref([]);function V(l){d.value.includes(l)?d.value=d.value.filter(a=>a!==l):d.value.push(l),se("selectLegend",c.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const pe=e.computed(()=>Math.max(...T.value.filter(l=>!d.value.includes(l.uid)).map(({value:l})=>l)));function K(l){return l/pe.value}const T=e.computed(()=>p.dataset.map(({values:l,name:a,color:o=null},r)=>{const u=n.sanitizeArray(l).reduce((v,w)=>v+w,0);return{name:a,color:o||n.convertColorToHex(o)||J.value[r]||n.palette[r]||n.palette[r%n.palette.length],value:u,proportion:u/p.dataset.map(v=>(v.values||[]).reduce((w,ye)=>w+ye,0)).reduce((v,w)=>v+w,0),uid:n.createUid(),absoluteIndex:r}})),Q=e.computed(()=>T.value.map(l=>({...l,shape:"circle",opacity:d.value.includes(l.uid)?.5:1,segregate:()=>V(l.uid),isSegregated:d.value.includes(l.uid)})).toSorted((l,a)=>a.value-l.value)),he=e.computed(()=>({cy:"rings-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":""})),f=e.computed(()=>T.value.filter(l=>!d.value.includes(l.uid)).map(({value:l})=>l).reduce((l,a)=>l+a,0)),c=e.computed(()=>T.value.filter(l=>!d.value.includes(l.uid)).map(({name:l,value:a,color:o=null,uid:r,absoluteIndex:u},v)=>({absoluteIndex:u,uid:r,name:l,color:o||n.convertColorToHex(o)||J.value[v]||n.palette[v]||n.palette[v%n.palette.length],value:a,proportion:K(a),percentage:a/f.value*100,strokeWidth:t.value.style.chart.layout.rings.strokeWidth*K(a)})).toSorted((l,a)=>a.value-l.value));function fe(){return c.value.map(({name:l,color:a,value:o,absoluteValues:r,percentage:u})=>({name:l,color:a,value:o,absoluteValues:r,percentage:u}))}const i=e.computed(()=>ve.value-t.value.style.chart.layout.rings.strokeWidth*2),L=e.ref(null);function ge(l,a){if(d.value.length===p.dataset.length)return;L.value={datapoint:a,seriesIndex:l,series:c.value,config:t.value},m.value=l;const o=c.value[l],r=t.value.style.chart.tooltip.customFormat;if(n.isFunction(r)&&n.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:c.value,config:t.value})))_.value=r({seriesIndex:l,datapoint:a,series:c.value,config:t.value});else{let u="";u+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,u+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 60 60" height="14" width="14"><circle cx="30" cy="30" r="30" stroke="none" fill="${o.color}" />${ie.pattern?`<circle cx="30" cy="30" r="30" stroke="none" fill="url(#pattern_${g.value}_${a.absoluteIndex})" />`:""}</svg>`,t.value.style.chart.tooltip.showValue&&(u+=`<b>${n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,n.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.tooltip.roundingValue}),{datapoint:a,seriesIndex:l})}
|
|
2
2
|
</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?u+=`<span>(${n.dataLabel({v:o.value/f.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})})</span></div>`:u+=`<b>${n.dataLabel({v:o.value/f.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`),_.value=u}x.value=!0}const y=e.computed(()=>{const l=c.value.map(o=>({name:o.name,color:o.color})),a=c.value.map(o=>o.value);return{head:l,body:a}}),S=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>',n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:f.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],a=y.value.head.map((u,v)=>[{color:u.color,name:u.name},n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:y.value.body[v],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),isNaN(y.value.body[v]/f.value)?"-":(y.value.body[v]/f.value*100).toFixed(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},r=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:a,config:o,colNames:r}});function Z(){e.nextTick(()=>{const l=y.value.head.map((r,u)=>[[r.name],[y.value.body[u]],[isNaN(y.value.body[u]/f.value)?"-":y.value.body[u]/f.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=n.createCsvContent(a);n.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-rings"})})}const C=e.ref(!1);function me(l){C.value=l,O.value+=1}function ee(){h.value.showTable=!h.value.showTable}function te(){h.value.showTooltip=!h.value.showTooltip}const B=e.ref(!1);function E(){B.value=!B.value}return ne({getData:fe,generatePdf:X,generateCsv:Z,generateImage:Y,toggleTable:ee,toggleTooltip:te,toggleAnnotator:E}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"ringsChart",ref:k,class:e.normalizeClass(`vue-ui-rings ${C.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};text-align:center;width:100%;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`),id:`rings_${g.value}`,onMouseleave:a[3]||(a[3]=o=>{m.value=null,x.value=!1,e.unref(U)(!1)}),onMouseenter:a[4]||(a[4]=()=>e.unref(U)(!0))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Te.PenAndPaper,{key:0,parent:k.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:E},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),de.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:F,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:I,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(be._sfc_main,{key:`title_${R.value}`,config:{title:{cy:"rings-div-title",...t.value.style.chart.title},subtitle:{cy:"rings-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&$.value&&(e.unref(D)||e.unref(P))?(e.openBlock(),e.createBlock(oe.UserOptions,{ref_key:"details",ref:ce,key:`user_options_${O.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(G),isImaging:e.unref(j),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:h.value.showTooltip,isFullscreen:C.value,titles:{...t.value.userOptions.buttonTitles},chartElement:k.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:me,onGeneratePdf:e.unref(X),onGenerateCsv:Z,onGenerateImage:e.unref(Y),onToggleTable:ee,onToggleTooltip:te,onToggleAnnotator:E,style:e.normalizeStyle({visibility:e.unref(D)?e.unref(P)?"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:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:r})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:r})),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),$.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.value}),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Ne._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:s.value.width<=0?10:s.value.width,height:s.value.height<=0?10:s.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,Le)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"30%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${g.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(o.color,.05),100-t.value.style.chart.layout.rings.gradient.intensity)},null,8,Oe),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,Ie)],8,Ee))),256))]),l.$slots.pattern?(e.openBlock(),e.createElementBlock("g",ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,o=>(e.openBlock(),e.createElementBlock("defs",null,[e.renderSlot(l.$slots,"pattern",e.normalizeProps(e.guardReactiveProps({seriesIndex:o.absoluteIndex,patternId:`pattern_${g.value}_${o.absoluteIndex}`})),void 0,!0)]))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("circle",{class:e.normalizeClass({"vue-ui-rings-item":b.value&&t.value.useCssAnimation,"vue-rings-item-onload":!b.value&&t.value.useCssAnimation,"vue-ui-rings-opacity":m.value!==null&&m.value!==r}),style:e.normalizeStyle(`animation-delay:${r*100}ms`),stroke:t.value.style.chart.layout.rings.stroke,cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+i.value*c.value[0].proportion/2-i.value*o.proportion/2-2*(r+1),r:e.unref(n.checkNaN)(i.value*o.proportion/2*.9<=0?1e-4:i.value*o.proportion/2*.9),fill:t.value.style.chart.layout.rings.gradient.underlayerColor},null,14,Ae),e.createElementVNode("circle",{class:e.normalizeClass({"vue-ui-rings-item":b.value&&t.value.useCssAnimation,"vue-rings-item-onload":!b.value&&t.value.useCssAnimation,"vue-ui-rings-shadow":t.value.style.chart.layout.rings.useShadow,"vue-ui-rings-blur":m.value!==null&&m.value!==r}),style:e.normalizeStyle(`animation-delay:${r*100}ms`),stroke:t.value.style.chart.layout.rings.stroke,"stroke-width":o.strokeWidth<.5?.5:o.strokeWidth,cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+i.value*c.value[0].proportion/2-i.value*o.proportion/2-2*(r+1),r:e.unref(n.checkNaN)(i.value*o.proportion/2*.9<=0?1e-4:i.value*o.proportion/2*.9),fill:t.value.style.chart.layout.rings.gradient.show?`url(#gradient_${g.value}_${r})`:o.color},null,14,Fe),l.$slots.pattern?(e.openBlock(),e.createElementBlock("circle",{key:0,class:e.normalizeClass({"vue-ui-rings-item":b.value&&t.value.useCssAnimation,"vue-rings-item-onload":!b.value&&t.value.useCssAnimation,"vue-ui-rings-shadow":t.value.style.chart.layout.rings.useShadow,"vue-ui-rings-blur":m.value!==null&&m.value!==r}),style:e.normalizeStyle(`animation-delay:${r*100}ms`),stroke:t.value.style.chart.layout.rings.stroke,"stroke-width":o.strokeWidth<.5?.5:o.strokeWidth,cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+i.value*c.value[0].proportion/2-i.value*o.proportion/2-2*(r+1),r:e.unref(n.checkNaN)(i.value*o.proportion/2*.9<=0?1e-4:i.value*o.proportion/2*.9),fill:`url(#pattern_${g.value}_${o.absoluteIndex})`},null,14,Re)):e.createCommentVNode("",!0),e.createElementVNode("circle",{"data-cy-trap":"",stroke:"none",cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+i.value*c.value[0].proportion/2-i.value*o.proportion/2-2*(r+1),r:e.unref(n.checkNaN)(i.value*o.proportion/2*.9<=0?1e-4:i.value*o.proportion/2*.9),fill:"transparent",onMouseenter:u=>ge(r,o),onMouseleave:a[0]||(a[0]=u=>{m.value=null,x.value=!1})},null,40,qe)]))),256)),e.renderSlot(l.$slots,"svg",{svg:s.value},void 0,!0)],14,Ve)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Me,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(G)||e.unref(j)})),void 0,!0)])):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($e.default,{key:6,config:{type:"rings",style:{backgroundColor:t.value.style.chart.backgroundColor,rings:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:z},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(we.Legend,{key:`legend_${M.value}`,legendSet:Q.value,config:he.value,onClickMarker:a[1]||(a[1]=({legend:o})=>V(o.uid))},e.createSlots({item:e.withCtx(({legend:o,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:u=>V(o.uid),style:e.normalizeStyle(`opacity:${d.value.includes(o.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,e.unref(n.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:r}))+" ",1),d.value.includes(o.uid)?(e.openBlock(),e.createElementBlock("span",We," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",De," ("+e.toDisplayString(isNaN(o.value/f.value)?"-":e.unref(n.dataLabel)({v:o.value/f.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,Ue)]),_:2},[l.$slots.pattern?{name:"legend-pattern",fn:e.withCtx(({legend:o,index:r})=>[e.createVNode(Be._sfc_main,{shape:o.shape,radius:30,stroke:"none",plot:{x:30,y:30},fill:`url(#pattern_${g.value}_${r})`},null,8,["shape","fill"])]),key:"0"}:void 0]),1032,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:Q.value},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:A,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ke._sfc_main,{show:h.value.showTooltip&&x.value&&d.value.length<p.dataset.length,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:C.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...L.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...L.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),$.value?(e.openBlock(),e.createBlock(xe.default,{key:8,hideDetails:"",config:{open:h.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(Ce.DataTable,{key:`table_${q.value}`,colNames:S.value.colNames,head:S.value.head,body:S.value.body,config:S.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=>h.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,He)]),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,Pe))}},je=_e._export_sfc(Ge,[["__scopeId","data-v-c89acd2c"]]);exports.default=je;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { useSlots as De, ref as r, computed as h, watch as Ee, onMounted as Ge, onBeforeUnmount as He, openBlock as n, createElementBlock as v, normalizeClass as V, normalizeStyle as O, unref as i, createBlock as N, createCommentVNode as m, createSlots as we, withCtx as g, renderSlot as p, normalizeProps as F, guardReactiveProps as L, createVNode as J, createElementVNode as T, Fragment as K, renderList as Q, createTextVNode as $e, toDisplayString as E, nextTick as je } from "vue";
|
|
2
|
-
import { u as Xe, c as Te, t as qe, a as Ye, p as I, o as Je, e as Z, g as Ke, b as Qe, J as Ze, d as _e, f as P, X as et, s as tt, w as lt, v as G, i as xe, x as ot, y as at, q as st, r as nt } from "./index-
|
|
2
|
+
import { u as Xe, c as Te, t as qe, a as Ye, p as I, o as Je, e as Z, g as Ke, b as Qe, J as Ze, d as _e, f as P, X as et, s as tt, w as lt, v as G, i as xe, x as ot, y as at, q as st, r as nt } from "./index-DiqenHrX.js";
|
|
3
3
|
import { t as ut, u as rt } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { _ as it } from "./Title-
|
|
5
|
-
import { u as vt, U as ct } from "./usePrinter-
|
|
6
|
-
import { _ as dt } from "./Tooltip-
|
|
7
|
-
import { D as pt } from "./DataTable-
|
|
8
|
-
import { L as ht } from "./Legend-
|
|
9
|
-
import gt from "./vue-ui-skeleton-
|
|
10
|
-
import ft from "./vue-ui-accordion-
|
|
11
|
-
import { u as Oe } from "./useNestedProp-
|
|
12
|
-
import { _ as yt } from "./PackageVersion-
|
|
13
|
-
import { P as mt } from "./PenAndPaper-
|
|
4
|
+
import { _ as it } from "./Title-CiQQgFbV.js";
|
|
5
|
+
import { u as vt, U as ct } from "./usePrinter-CHAgX1f-.js";
|
|
6
|
+
import { _ as dt } from "./Tooltip-ZYQUXVWv.js";
|
|
7
|
+
import { D as pt } from "./DataTable-CpOh1tx3.js";
|
|
8
|
+
import { L as ht } from "./Legend-DqRstaxU.js";
|
|
9
|
+
import gt from "./vue-ui-skeleton-BwWHgSoq.js";
|
|
10
|
+
import ft from "./vue-ui-accordion-DA6XnWaz.js";
|
|
11
|
+
import { u as Oe } from "./useNestedProp-B3CQkP95.js";
|
|
12
|
+
import { _ as yt } from "./PackageVersion-iscNRe7N.js";
|
|
13
|
+
import { P as mt } from "./PenAndPaper-B-VQ8eSo.js";
|
|
14
14
|
import { u as bt } from "./useUserOptionState-BIvW1Kz7.js";
|
|
15
|
-
import { _ as kt } from "./Shape-
|
|
15
|
+
import { _ as kt } from "./Shape-CB0mE9KP.js";
|
|
16
16
|
import { _ as Ct } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
17
17
|
const wt = ["id"], $t = ["xmlns", "viewBox"], Tt = ["width", "height"], _t = ["id"], xt = ["stop-color"], Ot = ["stop-color"], Nt = { key: 1 }, It = ["stroke", "cx", "cy", "r", "fill"], Pt = ["stroke", "stroke-width", "cx", "cy", "r", "fill"], St = ["stroke", "stroke-width", "cx", "cy", "r", "fill"], At = ["cx", "cy", "r", "onMouseenter"], Ft = {
|
|
18
18
|
key: 5,
|