vue-data-ui 2.4.76 → 2.4.78
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-SYMRLSHC.js → Arrow-C7AmfY-d.js} +1 -1
- package/dist/{Arrow-BEL6nGJ5.cjs → Arrow-DbrjRMa6.cjs} +1 -1
- package/dist/{BaseIcon-Udj2sWh1.cjs → BaseIcon-CIjjPDqj.cjs} +1 -1
- package/dist/{BaseIcon-wfQ35Ioa.js → BaseIcon-Dzpk4O8L.js} +1 -1
- package/dist/{DataTable-CC3rD9iV.js → DataTable-DtRXoetj.js} +2 -2
- package/dist/{DataTable-RY8EUwF3.cjs → DataTable-wN-jvOfe.cjs} +1 -1
- package/dist/{Legend-CZrlsh2W.cjs → Legend-DqGE1lkA.cjs} +1 -1
- package/dist/{Legend-BBFx9L7u.js → Legend-RnRqBxiV.js} +2 -2
- package/dist/{PackageVersion-Cc8-1SRE.js → PackageVersion-CgJdp_Ki.js} +1 -1
- package/dist/{PackageVersion-C1zaH_aJ.cjs → PackageVersion-Dn-t7tbm.cjs} +1 -1
- package/dist/{PenAndPaper-BKX-8o1h.js → PenAndPaper-BTLEk55u.js} +3 -3
- package/dist/{PenAndPaper-Bv8oV7l0.cjs → PenAndPaper-DFXJJink.cjs} +1 -1
- package/dist/{Shape-CSj0rOyf.js → Shape-B1fqUhjt.js} +1 -1
- package/dist/{Shape-CuDuYYKF.cjs → Shape-D7IbPjU8.cjs} +1 -1
- package/dist/{Slicer-De-C8OB8.cjs → Slicer-8bCK41mN.cjs} +1 -1
- package/dist/{Slicer-4vVJHlL9.js → Slicer-GQf9ZyPj.js} +2 -2
- package/dist/{Title-m5N0oN0G.cjs → Title-D-6pIV0l.cjs} +1 -1
- package/dist/{Title-CmyP_ypC.js → Title-XYNHfYwN.js} +1 -1
- package/dist/{Tooltip-Dq7633oz.cjs → Tooltip-CNox4F8U.cjs} +1 -1
- package/dist/{Tooltip-Dz6sXvS2.js → Tooltip-DYRo59nq.js} +1 -1
- package/dist/{index-CpNLsWVB.js → index-B8Eaq54E.js} +1 -1
- package/dist/{index-CH3YkGpv.cjs → index-KJL8ra_6.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-2TBYsJKg.cjs → useNestedProp-Bu958azG.cjs} +1 -1
- package/dist/{useNestedProp-C14snYQ3.js → useNestedProp-Ka0R_Yqa.js} +1 -1
- package/dist/{usePrinter-D76t2otk.js → usePrinter-D83W2gfG.js} +1 -1
- package/dist/{usePrinter-A1_US3Dh.cjs → usePrinter-pDOF3CfL.cjs} +1 -1
- package/dist/{vue-data-ui-0qqDFsDV.js → vue-data-ui-DgmXnSUU.js} +60 -60
- package/dist/{vue-data-ui-C3B3pxcE.cjs → vue-data-ui-Ot5xYhbV.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-DsPyvRtf.cjs → vue-ui-3d-bar-CB0XzatQ.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-vXI86Ftg.js → vue-ui-3d-bar-CqiW8qFZ.js} +9 -9
- package/dist/{vue-ui-accordion-7RGF7sa1.js → vue-ui-accordion--5td7b94.js} +3 -3
- package/dist/{vue-ui-accordion-_LFrGkGx.cjs → vue-ui-accordion-4-dyMgJA.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-CotXvsaD.js → vue-ui-age-pyramid-Bsg0z9ei.js} +10 -10
- package/dist/{vue-ui-age-pyramid-ac5bW1yE.cjs → vue-ui-age-pyramid-DNseB8ej.cjs} +1 -1
- package/dist/{vue-ui-annotator-LO2QBLr-.cjs → vue-ui-annotator-CHjtF8NT.cjs} +1 -1
- package/dist/{vue-ui-annotator-C1RLefPu.js → vue-ui-annotator-obnYFvvq.js} +1 -1
- package/dist/{vue-ui-bullet-CngMCn0G.cjs → vue-ui-bullet-CNWHd7dO.cjs} +1 -1
- package/dist/{vue-ui-bullet-DZknfpTt.js → vue-ui-bullet-yKEVhE17.js} +8 -8
- package/dist/{vue-ui-candlestick-BIhS1XvX.js → vue-ui-candlestick-Cc-Ee4zv.js} +11 -11
- package/dist/{vue-ui-candlestick-BrHsZWBD.cjs → vue-ui-candlestick-VBq82rfW.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-DQOyjYrs.js → vue-ui-carousel-table-B6v1NycN.js} +4 -4
- package/dist/{vue-ui-carousel-table-CEYvDVp-.cjs → vue-ui-carousel-table-DLwVijSb.cjs} +1 -1
- package/dist/{vue-ui-chestnut-DOB6e1ur.js → vue-ui-chestnut-CekC1moT.js} +8 -8
- package/dist/{vue-ui-chestnut-Ck7UKhm3.cjs → vue-ui-chestnut-DHZbhIf_.cjs} +1 -1
- package/dist/{vue-ui-cursor-DbR8dGQz.cjs → vue-ui-cursor-Bz-jVx3a.cjs} +1 -1
- package/dist/{vue-ui-cursor-BaFPplLP.js → vue-ui-cursor-CISKzkNu.js} +2 -2
- package/dist/{vue-ui-dashboard-BiYrjIXc.cjs → vue-ui-dashboard-PAi8o4AC.cjs} +1 -1
- package/dist/{vue-ui-dashboard-CU1IswIu.js → vue-ui-dashboard-w7Ts26Xc.js} +2 -2
- package/dist/{vue-ui-digits-LLkWsjVe.cjs → vue-ui-digits-I_lj1m6d.cjs} +1 -1
- package/dist/{vue-ui-digits-Ccu0VX39.js → vue-ui-digits-kaBR5FUU.js} +2 -2
- package/dist/{vue-ui-donut-BZbOZXBY.js → vue-ui-donut-BVuaExCl.js} +111 -114
- package/dist/vue-ui-donut-dDpMdK4G.cjs +1 -0
- package/dist/{vue-ui-donut-evolution-BDBugP7m.cjs → vue-ui-donut-evolution-ChGao_WW.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-DtgcRiGo.js → vue-ui-donut-evolution-DAmX1OX-.js} +11 -11
- package/dist/{vue-ui-dumbbell-CeWOqVMa.js → vue-ui-dumbbell-CrQNRN_m.js} +10 -10
- package/dist/{vue-ui-dumbbell-Dg6X5Vj5.cjs → vue-ui-dumbbell-DsR4RQY9.cjs} +1 -1
- package/dist/{vue-ui-flow-CjG35xEC.js → vue-ui-flow-B0lCe4G8.js} +9 -9
- package/dist/{vue-ui-flow-CoAgjhdm.cjs → vue-ui-flow-Dhcvvzee.cjs} +1 -1
- package/dist/{vue-ui-funnel-hjZrLAhZ.cjs → vue-ui-funnel-Bu_wMJ98.cjs} +1 -1
- package/dist/{vue-ui-funnel-D8c4Gp8b.js → vue-ui-funnel-Cinv1hUx.js} +9 -9
- package/dist/{vue-ui-galaxy-2WU_lJvz.js → vue-ui-galaxy-BcwunIK3.js} +11 -11
- package/dist/{vue-ui-galaxy-DfTXwfQR.cjs → vue-ui-galaxy-zx6O9AuV.cjs} +1 -1
- package/dist/{vue-ui-gauge-Bj4H5esH.js → vue-ui-gauge-C4W4OAXQ.js} +7 -7
- package/dist/{vue-ui-gauge-C_IgZirr.cjs → vue-ui-gauge-Cb6sxoZI.cjs} +1 -1
- package/dist/{vue-ui-gizmo-CFUkIE1e.js → vue-ui-gizmo-D4VHyFmN.js} +3 -3
- package/dist/{vue-ui-gizmo-Dbsg9oG_.cjs → vue-ui-gizmo-DBSYx24z.cjs} +1 -1
- package/dist/{vue-ui-heatmap-Df4woeNc.js → vue-ui-heatmap-C3WHfifV.js} +10 -10
- package/dist/{vue-ui-heatmap-DECng1-9.cjs → vue-ui-heatmap-CBNt4Huo.cjs} +1 -1
- package/dist/{vue-ui-history-plot-C0X1_s96.cjs → vue-ui-history-plot-Dp8Llb3A.cjs} +1 -1
- package/dist/{vue-ui-history-plot-DHUuanXy.js → vue-ui-history-plot-dJp-Lai2.js} +11 -11
- package/dist/{vue-ui-kpi-d5eW2MQ3.js → vue-ui-kpi-B3XhowYx.js} +3 -3
- package/dist/{vue-ui-kpi-CGrN8rrL.cjs → vue-ui-kpi-Dnp8IUyb.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-C2-zQHTF.cjs → vue-ui-mini-loader-BgwhuEda.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-DRUBgzI9.js → vue-ui-mini-loader-Cca7PA4v.js} +2 -2
- package/dist/{vue-ui-molecule-Bst8lERC.cjs → vue-ui-molecule-B1AocG3H.cjs} +1 -1
- package/dist/{vue-ui-molecule-CqQBdd27.js → vue-ui-molecule-BcZNqWfD.js} +11 -11
- package/dist/{vue-ui-mood-radar-BM7pbHlc.cjs → vue-ui-mood-radar-Cn65TQEs.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-oB1S4QFm.js → vue-ui-mood-radar-HjLL0ZZ8.js} +11 -11
- package/dist/{vue-ui-nested-donuts-DdgoTSGG.js → vue-ui-nested-donuts-BIqySYG_.js} +11 -11
- package/dist/{vue-ui-nested-donuts-BUcrd4TR.cjs → vue-ui-nested-donuts-CymFt4B3.cjs} +1 -1
- package/dist/{vue-ui-onion-RimU8400.cjs → vue-ui-onion-BLMFR0GK.cjs} +1 -1
- package/dist/{vue-ui-onion-BD4CSF0A.js → vue-ui-onion-muCAMEG8.js} +11 -11
- package/dist/{vue-ui-parallel-coordinate-plot-CTUm9M3z.js → vue-ui-parallel-coordinate-plot-DYOlnKPw.js} +12 -12
- package/dist/{vue-ui-parallel-coordinate-plot-Cj8VtclE.cjs → vue-ui-parallel-coordinate-plot-i-hhfnwF.cjs} +1 -1
- package/dist/{vue-ui-quadrant-DjsY0y5B.cjs → vue-ui-quadrant-DJPOp1-A.cjs} +1 -1
- package/dist/{vue-ui-quadrant-DKrkCfAn.js → vue-ui-quadrant-TU5fWoEw.js} +12 -12
- package/dist/{vue-ui-quick-chart-Dy7EL7ta.cjs → vue-ui-quick-chart-CTJxOisL.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-BBCjtI-7.js → vue-ui-quick-chart-DzuUofFN.js} +9 -9
- package/dist/{vue-ui-radar-D5ufpNKc.js → vue-ui-radar-C0WA20R8.js} +12 -12
- package/dist/{vue-ui-radar-B3SwUPOg.cjs → vue-ui-radar-D4xX7TNQ.cjs} +1 -1
- package/dist/{vue-ui-rating-DzjVC24x.cjs → vue-ui-rating-C2JILb2g.cjs} +1 -1
- package/dist/{vue-ui-rating-D4G-LFWR.js → vue-ui-rating-DUcyhyrN.js} +2 -2
- package/dist/{vue-ui-relation-circle-WkD_rUnu.js → vue-ui-relation-circle-BYlIjbUK.js} +7 -7
- package/dist/{vue-ui-relation-circle-1pWCHVnC.cjs → vue-ui-relation-circle-D-Wxskec.cjs} +1 -1
- package/dist/{vue-ui-rings-CTYnhWv8.cjs → vue-ui-rings-CsXVOIn3.cjs} +1 -1
- package/dist/{vue-ui-rings-C8ty4dWD.js → vue-ui-rings-w4KQSfym.js} +12 -12
- package/dist/{vue-ui-scatter-BQVPLg6A.cjs → vue-ui-scatter--5Ob2lKM.cjs} +1 -1
- package/dist/{vue-ui-scatter-DfeNfnMl.js → vue-ui-scatter-CfgCA3Di.js} +12 -12
- package/dist/{vue-ui-screenshot-D03-LKwV.js → vue-ui-screenshot-BsD3ySuA.js} +1 -1
- package/dist/{vue-ui-screenshot-C7lsivHN.cjs → vue-ui-screenshot-UEVUHXWY.cjs} +1 -1
- package/dist/{vue-ui-skeleton-DwmP0u2B.cjs → vue-ui-skeleton-D_YCUi1y.cjs} +1 -1
- package/dist/{vue-ui-skeleton-CIp8lMA6.js → vue-ui-skeleton-DpadzgbS.js} +3 -3
- package/dist/{vue-ui-smiley-_J08wXf9.js → vue-ui-smiley-BHqeb-Ol.js} +2 -2
- package/dist/{vue-ui-smiley-Bp-UbI5r.cjs → vue-ui-smiley-C32dLhtP.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-UX4dEhft.cjs → vue-ui-spark-trend-Bt2wpc5C.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-iXsvKant.js → vue-ui-spark-trend-NAcB2zZ1.js} +5 -5
- package/dist/{vue-ui-sparkbar-JQ4SIcqX.js → vue-ui-sparkbar-BPpSxe5Z.js} +4 -4
- package/dist/{vue-ui-sparkbar-BJ_rGX_Y.cjs → vue-ui-sparkbar-CgoGRT0_.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-Ci5Jx-i_.js → vue-ui-sparkgauge-C1mW3KbZ.js} +4 -4
- package/dist/{vue-ui-sparkgauge-YQBQjjX1.cjs → vue-ui-sparkgauge-frN6uK_L.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-C5UeFik2.cjs → vue-ui-sparkhistogram-CqQY434G.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-D1VEZIa5.js → vue-ui-sparkhistogram-HgBi5OvP.js} +5 -5
- package/dist/{vue-ui-sparkline-CRFYizW3.js → vue-ui-sparkline-BABBXY2c.js} +4 -4
- package/dist/{vue-ui-sparkline-fF9WenrE.cjs → vue-ui-sparkline-XOa6LfX2.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-CynLB9us.cjs → vue-ui-sparkstackbar-B4Xduiv1.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-CWa5ELhE.js → vue-ui-sparkstackbar-Ch3JvFBq.js} +5 -5
- package/dist/{vue-ui-stackbar-jQdQH0Pu.cjs → vue-ui-stackbar-CH8tLDZq.cjs} +1 -1
- package/dist/{vue-ui-stackbar-DSammmJH.js → vue-ui-stackbar-JIEn0g7t.js} +13 -13
- package/dist/{vue-ui-strip-plot-yE9w6drR.cjs → vue-ui-strip-plot-BkWzm1mI.cjs} +1 -1
- package/dist/{vue-ui-strip-plot-PxONzaXd.js → vue-ui-strip-plot-RZu43QbP.js} +11 -11
- package/dist/{vue-ui-table-BskwuS44.js → vue-ui-table-CJ2gGmYi.js} +1 -1
- package/dist/{vue-ui-table-DG5RXhLE.cjs → vue-ui-table-CgtE4HWs.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-CzxnV1-0.js → vue-ui-table-heatmap-B_TfeHsa.js} +4 -4
- package/dist/{vue-ui-table-heatmap-D9W-4tm9.cjs → vue-ui-table-heatmap-DxTs_PZF.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-BlQy5f88.js → vue-ui-table-sparkline-DqMH7xbY.js} +5 -5
- package/dist/{vue-ui-table-sparkline-DT8VzRHY.cjs → vue-ui-table-sparkline-PA9L6AjE.cjs} +1 -1
- package/dist/{vue-ui-thermometer-CkJBESoa.cjs → vue-ui-thermometer-AwZdEG3j.cjs} +1 -1
- package/dist/{vue-ui-thermometer-BBvQ4tYx.js → vue-ui-thermometer-D7aR0elr.js} +7 -7
- package/dist/{vue-ui-timer-CNp59qFF.cjs → vue-ui-timer-C6fnDeD8.cjs} +1 -1
- package/dist/{vue-ui-timer-DFvFQF6d.js → vue-ui-timer-C9sO9AoQ.js} +5 -5
- package/dist/{vue-ui-tiremarks-Cf1637KV.cjs → vue-ui-tiremarks-Dje0I1vf.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-D4_LO9A5.js → vue-ui-tiremarks-KvOyYNVW.js} +7 -7
- package/dist/{vue-ui-treemap-CWoi0iKf.js → vue-ui-treemap-BPxLXNZ5.js} +11 -11
- package/dist/{vue-ui-treemap-Dnq85nnj.cjs → vue-ui-treemap-C2Vrj3tg.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-DgfIA9-H.js → vue-ui-vertical-bar-BAdSzbYU.js} +12 -12
- package/dist/{vue-ui-vertical-bar-pyVFnVaF.cjs → vue-ui-vertical-bar-_MWpPkwZ.cjs} +1 -1
- package/dist/{vue-ui-waffle-DQbEdVDN.js → vue-ui-waffle-CW1UVf-q.js} +12 -12
- package/dist/{vue-ui-waffle-DGeQNIVJ.cjs → vue-ui-waffle-DfJI5Lez.cjs} +1 -1
- package/dist/{vue-ui-wheel-Bhmjjfqi.cjs → vue-ui-wheel-CzZEsjmd.cjs} +1 -1
- package/dist/{vue-ui-wheel-B0vgQ4Ps.js → vue-ui-wheel-DAwYc7XY.js} +7 -7
- package/dist/{vue-ui-word-cloud-hcJsrwPF.cjs → vue-ui-word-cloud-BEyV6jMo.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-XrUyNMpH.js → vue-ui-word-cloud-BzfYkI08.js} +10 -10
- package/dist/vue-ui-xy-BolkwiXB.cjs +3 -0
- package/dist/{vue-ui-xy--QLh9NlZ.js → vue-ui-xy-CJYGMbMt.js} +610 -609
- package/dist/{vue-ui-xy-canvas-DO3kaKEf.cjs → vue-ui-xy-canvas-DkltjVWN.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-mtxLsToQ.js → vue-ui-xy-canvas-sB1dmJQc.js} +11 -11
- package/package.json +1 -1
- package/dist/vue-ui-donut-DzqE2EQ1.cjs +0 -1
- package/dist/vue-ui-xy-B8WkCl69.cjs +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-KJL8ra_6.cjs"),we=require("./useResponsive-BJ7DTGpm.cjs"),ze=require("./Title-D-6pIV0l.cjs"),Ce=require("./usePrinter-pDOF3CfL.cjs"),Te=require("./DataTable-wN-jvOfe.cjs"),Xe=require("./Tooltip-CNox4F8U.cjs"),De=require("./Legend-DqGE1lkA.cjs"),Me=require("./vue-ui-skeleton-D_YCUi1y.cjs"),Ye=require("./vue-ui-accordion-4-dyMgJA.cjs"),Be=require("./useNestedProp-Bu958azG.cjs"),Ae=require("./PackageVersion-Dn-t7tbm.cjs"),Ie=require("./PenAndPaper-DFXJJink.cjs"),qe=require("./useUserOptionState-BgepsfED.cjs"),Re=require("./Shape-D7IbPjU8.cjs"),Ge=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ue=V=>(e.pushScopeId("data-v-f39affda"),V=V(),e.popScopeId(),V),je=["id"],He=["xmlns","viewBox"],We=["width","height"],Je={key:1},Ke=["id"],Qe=["stop-color"],Ze=["offset","stop-color"],et=["offset","stop-color"],tt=["stop-color"],lt={key:2},ot=["id","cx","cy"],at=["stop-color","stop-opacity"],nt=["stop-color"],rt=["id"],ut=["id"],st=Ue(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),it=["id"],ct=["flood-color"],dt=["id"],vt=["flood-color"],ht=["d","stroke","filter"],ft=["x1","y1","x2","y2","stroke","filter"],yt=["cx","cy","r","fill","filter"],pt={key:6},mt=["stroke","d"],kt={key:0},gt=["d","fill","stroke","stroke-width","filter"],bt=["d","fill","stroke","stroke-width","filter"],wt={key:0},Ct=["stroke","d"],Bt={key:0},_t=["d","stroke","stroke-width","filter"],xt={key:1},$t=["d","fill","stroke","stroke-width","filter"],St=["d","fill","stroke","stroke-width","filter"],Et={key:1},Nt=["cx","cy","r","fill","stroke","stroke-width"],Pt=["cx","cy","r","fill","stroke","stroke-width"],Vt=["cx","cy","r","stroke"],Ft=["cx","cy","r","fill"],Lt={key:0},Ot=["d","fill","onMouseenter","onClick"],zt={key:1},Tt=["cx","cy","r","fill"],Xt=["x","y","fill","font-size"],Dt=["x","y","fill","font-size"],Mt=["x","y","fill","font-size"],Yt=["x","y","fill","font-size"],At=["filter"],It={key:0},qt=["x","y"],Rt={key:1},Gt=["cx","cy","fill","stroke","filter","onClick"],Ut=["cx","cy","fill","stroke","filter","onClick"],jt=["text-anchor","x","y","fill","font-size","onClick"],Ht=["text-anchor","x","y","fill","font-size","onClick"],Wt=["text-anchor","x","y","fill","font-size","onClick"],Jt=["text-anchor","x","y","fill","font-size","onClick"],Kt={key:2},Qt=["x","y","width"],Zt=["x","y","width"],el={key:5,class:"vue-data-ui-watermark"},tl=["onClick"],ll={key:0,style:{"font-variant-numeric":"tabular-nums"}},ol={key:1},al=["innerHTML"],nl={__name:"vue-ui-donut",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(V,{expose:_e,emit:G}){const b=V,{vue_ui_donut:xe}=n.useConfig(),$e=e.useSlots(),F=e.computed({get(){return!!b.dataset&&b.dataset.length},set(o){return o}}),E=e.ref(null),U=e.ref(null),j=e.ref(null),z=e.ref(null),H=e.ref(null),W=e.ref(null),J=e.ref(0),K=e.ref(0),Q=e.ref(0);e.onMounted(()=>{Z()}),e.onBeforeUnmount(()=>{z.value&&z.value.disconnect()});function Z(){if(n.objectIsEmpty(b.dataset)?n.error({componentName:"VueUiDonut",type:"dataset"}):b.dataset.forEach((o,u)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","values"]}).forEach(l=>{F.value=!1,n.error({componentName:"VueUiDonut",type:"datasetSerieAttribute",property:l,index:u})})}),t.value.responsive){const o=we.throttle(()=>{const{width:u,height:l}=we.useResponsive({chart:E.value,title:t.value.style.chart.title.text?U.value:null,legend:t.value.style.chart.legend.show?j.value:null,source:H.value,noTitle:W.value});r.value.width=u,r.value.height=l});z.value=new ResizeObserver(o),z.value.observe(E.value.parentNode)}}const d=e.ref(n.createUid()),Se=e.ref(null),T=e.ref(!1),M=e.ref(""),p=e.ref(null),ee=e.ref(0);function te(){const o=Be.useNestedProp({userConfig:b.config,defaultConfig:xe});return o.theme?{...Be.useNestedProp({userConfig:n.themes.vue_ui_donut[o.theme]||b.config,defaultConfig:o}),customPalette:n.themePalettes[o.theme]||n.palette}:o}const t=e.computed({get:()=>te(),set:o=>o}),{userOptionsVisible:Y,setUserOptionsVisibility:le,keepUserOptionState:oe}=qe.useUserOptionState({config:t.value});e.watch(()=>b.config,o=>{t.value=te(),Y.value=!t.value.showOnChartHover,Z(),J.value+=1,K.value+=1,Q.value+=1},{deep:!0});const{isPrinting:ae,isImaging:ne,generatePdf:re,generateImage:ue}=Ce.usePrinter({elementId:`donut__${d.value}`,fileName:t.value.style.chart.title.text||"vue-ui-donut"}),Ee=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),se=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),v=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),r=e.ref({height:360,width:512}),L=e.computed(()=>{const o=t.value.style.chart.layout.donut.strokeWidth/512,u=r.value.width*o,l=u>y.value?y.value:u;return l<24?24:l}),x=e.computed(()=>b.dataset.map((o,u)=>({name:o.name,color:n.convertColorToHex(o.color)||se.value[u]||n.palette[u]||n.palette[u%n.palette.length],value:o.values.reduce((l,a)=>l+a,0),absoluteValues:o.values,comment:o.comment||"",patternIndex:u}))),k=e.ref(x.value);e.watch(()=>x.value,o=>k.value=o);function Ne(){return x.value.map(o=>({name:o.name,color:o.color,value:o.value}))}const w=e.ref([]),ie=e.ref(null),ce=e.ref(null),$=e.ref(!1);function de(o){const u=x.value.find((s,h)=>h===o),l=k.value.find((s,h)=>h===o);let a=l.value;if(w.value.includes(o)){let h=function(){a>s?(cancelAnimationFrame(ie.value),k.value=k.value.map((f,R)=>o===R?{...f,value:s}:f),$.value=!1):($.value=!0,a+=s*.025,k.value=k.value.map((f,R)=>o===R?{...f,value:a}:f),ie.value=requestAnimationFrame(h))};w.value=w.value.filter(f=>f!==o);const s=u.value;h()}else if(w.value.length<x.value.length-1){let s=function(){a<l.value/100?(cancelAnimationFrame(ce.value),w.value.push(o),k.value=k.value.map((h,f)=>o===f?{...h,value:0}:h),$.value=!1):($.value=!0,a/=1.1,k.value=k.value.map((h,f)=>o===f?{...h,value:a}:h),ce.value=requestAnimationFrame(s))};s()}G("selectLegend",C.value.map(s=>({name:s.name,color:s.color,value:s.value})))}const C=e.computed(()=>(k.value.forEach((o,u)=>{if([null,void 0].includes(o.values))return{...o,values:[]}}),k.value.map((o,u)=>({...o,seriesIndex:u})).filter((o,u)=>!w.value.includes(u)))),ve=e.computed(()=>b.dataset.map((o,u)=>({name:o.name,color:n.convertColorToHex(o.color)||se.value[u]||n.palette[u]||n.palette[u%n.palette.length],value:(o.values||[]).reduce((l,a)=>l+a,0),shape:"circle",patternIndex:u})).map((o,u)=>({...o,proportion:o.value/b.dataset.map(l=>(l.values||[]).reduce((a,s)=>a+s,0)).reduce((l,a)=>l+a,0),opacity:w.value.includes(u)?.5:1,segregate:()=>!$.value&&de(u),isSegregated:w.value.includes(u)}))),Pe=e.computed(()=>({cy:"donut-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),y=e.computed(()=>{const o=Math.min(r.value.width/3,r.value.height/3);return o<55?55:o}),c=e.computed(()=>n.makeDonut({series:C.value},r.value.width/2,r.value.height/2,y.value,y.value,1.99999,2,1,360,105.25,L.value)),i=e.computed(()=>{const o=Math.max(...C.value.map(l=>l.value)),u=C.value.map(l=>l.value/o);return n.createPolarAreas({series:u,center:{x:r.value.width/2,y:r.value.height/2},maxRadius:Math.min(r.value.width,r.value.height)/3})});function N(o){return o.x>r.value.width/2+6?"start":o.x<r.value.width/2-6?"end":"middle"}function Ve(o){return o.middlePoint.y>r.value.height/2?n.offsetFromCenterPoint({initX:o.middlePoint.x,initY:o.middlePoint.y,offset:100,centerX:r.value.width/2,centerY:r.value.height/2}).y:n.offsetFromCenterPoint({initX:o.middlePoint.x,initY:o.middlePoint.y,offset:0,centerX:r.value.width/2,centerY:r.value.height/2}).y-100}function g(o){return o.proportion*100>t.value.style.chart.layout.labels.dataLabels.hideUnderValue}function A(o,u){const l=o.value/Fe(u);return isNaN(l)?0:n.applyDataLabel(t.value.style.chart.layout.labels.percentage.formatter,l*100,n.dataLabel({v:l*100,s:"%",r:t.value.style.chart.layout.labels.percentage.rounding}),{datapoint:o})}function Fe(o){return[...o].map(u=>u.value).reduce((u,l)=>u+l,0)}const m=e.computed(()=>C.value.map(o=>o.value).reduce((o,u)=>o+u,0)),he=e.computed(()=>m.value/C.value.length),fe=e.computed(()=>o=>$.value?o.proportion*100:o.value/m.value*100),I=e.ref(null),O=e.ref(!1);function ye({datapoint:o,relativeIndex:u,seriesIndex:l,show:a=!1}){I.value={datapoint:o,seriesIndex:l,config:t.value,series:x.value},T.value=a,p.value=u;let s="";const h=t.value.style.chart.tooltip.customFormat;if(O.value=!1,n.isFunction(h))try{const f=h({seriesIndex:l,datapoint:o,series:x.value,config:t.value});typeof f=="string"&&(M.value=f,O.value=!0)}catch{console.warn("Custom format cannot be applied."),O.value=!1}if(!O.value){if(s+=`<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>`,s+=`<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}"/>${$e.pattern?`<circle cx="30" cy="30" r="30" stroke="none" fill="url(#pattern_${d.value}_${l})"/>`:""}</svg>`,t.value.style.chart.tooltip.showValue&&(s+=`<b>${n.applyDataLabel(t.value.style.chart.layout.labels.value.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:o,relativeIndex:u,seriesIndex:l})}</b>`),t.value.style.chart.tooltip.showPercentage){const f=n.applyDataLabel(t.value.style.chart.layout.labels.percentage.formatter,o.proportion*100,n.dataLabel({v:o.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage}),{datapoint:o,relativeIndex:u,seriesIndex:l});t.value.style.chart.tooltip.showValue?s+=`<span>(${f})</span></div>`:s+=`<b>${f}</b></div>`}t.value.style.chart.comments.showInTooltip&&o.comment&&(s+=`<div class="vue-data-ui-tooltip-comment" style="background:${o.color}20; padding: 6px; margin-bottom: 6px; margin-top:6px; border-left: 1px solid ${o.color}">${o.comment}</div>`),M.value=`<div>${s}</div>`}}function S(o){return t.value.useBlurOnHover&&![null,void 0].includes(p.value)&&p.value!==o?`url(#blur_${d.value})`:""}const B=e.computed(()=>{const o=C.value.map(l=>({name:l.name,color:l.color})),u=C.value.map(l=>l.value);return{head:o,body:u}});function pe(){e.nextTick(()=>{const o=B.value.head.map((a,s)=>[[a.name],[B.value.body[s]],[isNaN(B.value.body[s]/m.value)?"-":B.value.body[s]/m.value*100]]),u=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(o),l=n.createCsvContent(u);n.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-donut"})})}const X=e.computed(()=>{const o=[' <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:m.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],u=B.value.head.map((s,h)=>[{color:s.color,name:s.name},B.value.body[h],isNaN(B.value.body[h]/m.value)?"-":(B.value.body[h]/m.value*100).toFixed(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{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],head:o,body:u,config:l}}),P=e.ref(!1);function Le(o){P.value=o,ee.value+=1}const me=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent));function Oe(o){return o.toFixed(t.value.style.chart.legend.roundingPercentage).split("").map(u=>"-").join("")}function _(o,u){G("selectDatapoint",{datapoint:o,index:u})}function ke(){v.value.showTable=!v.value.showTable}function ge(){v.value.dataLabels.show=!v.value.dataLabels.show}function be(){v.value.showTooltip=!v.value.showTooltip}const D=e.ref(!1);function q(){D.value=!D.value}return _e({getData:Ne,generatePdf:re,generateCsv:pe,generateImage:ue,toggleTable:ke,toggleLabels:ge,toggleTooltip:be,toggleAnnotator:q}),(o,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"donutChart",ref:E,class:e.normalizeClass(`vue-ui-donut ${P.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height:100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`donut__${d.value}`,onMouseenter:u[6]||(u[6]=()=>e.unref(le)(!0)),onMouseleave:u[7]||(u[7]=()=>e.unref(le)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ie.PenAndPaper,{key:0,parent:E.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:D.value,onClose:q},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"userConfig",{},void 0,!0),Ee.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:W,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:U,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ze._sfc_main,{key:`title_${J.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&F.value&&(e.unref(oe)||e.unref(Y))?(e.openBlock(),e.createBlock(Ce.UserOptions,{ref_key:"details",ref:Se,key:`user_option_${ee.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(ae),isImaging:e.unref(ne),uid:d.value,hasTooltip:t.value.style.chart.tooltip.show&&t.value.userOptions.buttons.tooltip,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:P.value,chartElement:E.value,position:t.value.userOptions.position,isTooltip:v.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:D.value,onToggleFullscreen:Le,onGeneratePdf:e.unref(re),onGenerateCsv:pe,onGenerateImage:e.unref(ue),onToggleTable:ke,onToggleLabels:ge,onToggleTooltip:be,onToggleAnnotator:q,style:e.normalizeStyle({visibility:e.unref(oe)?e.unref(Y)?"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.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:a})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:a})),void 0,!0)]),key:"6"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:a})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:a})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasLabel","hasFullscreen","isFullscreen","chartElement","position","isTooltip","titles","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),F.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":P.value,"vue-data-ui-fulscreen--off":!P.value}),viewBox:`0 0 ${r.value.width<=0?10:r.value.width} ${r.value.height<=0?10:r.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Ae._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:r.value.width<=0?10:r.value.width,height:r.value.height<=0?10:r.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,We)):e.createCommentVNode("",!0),t.value.type==="classic"?(e.openBlock(),e.createElementBlock("defs",Je,[t.value.style.chart.useGradient?(e.openBlock(),e.createElementBlock("radialGradient",{key:0,id:`gradient_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(t.value.style.chart.backgroundColor,0),"stop-opacity":"0"},null,8,Qe),e.createElementVNode("stop",{offset:`${(1-L.value/y.value)*100}%`,"stop-color":e.unref(n.setOpacity)("#FFFFFF",0),"stop-opacity":"0"},null,8,Ze),e.createElementVNode("stop",{offset:`${(1-L.value/y.value/2)*100}%`,"stop-color":e.unref(n.setOpacity)("#FFFFFF",t.value.style.chart.gradientIntensity)},null,8,et),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(t.value.style.chart.backgroundColor,0),"stop-opacity":"0"},null,8,tt)],8,Ke)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.type==="polar"?(e.openBlock(),e.createElementBlock("defs",lt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,a)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`polar_gradient_${a}_${d.value}`,cx:l.middlePoint.x/r.value.width*100+"%",cy:l.middlePoint.y/r.value.height*100+"%",r:"62%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.shiftHue)(c.value[a].color,.05),"stop-opacity":t.value.style.chart.gradientIntensity/100},null,8,at),e.createElementVNode("stop",{offset:"100%","stop-color":c.value[a].color},null,8,nt)],8,ot))),256))])):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${d.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2,id:`blur_std_${d.value}`},null,8,ut),st],8,rt),e.createElementVNode("filter",{id:`shadow_${d.value}`,"color-interpolation-filters":"sRGB"},[e.createElementVNode("feDropShadow",{dx:"0",dy:"0",stdDeviation:"10","flood-opacity":"0.5","flood-color":t.value.style.chart.layout.donut.shadowColor},null,8,ct)],8,it),e.createElementVNode("filter",{id:`drop_shadow_${d.value}`,"color-interpolation-filters":"sRGB",x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feDropShadow",{dx:"0",dy:"0",stdDeviation:"3","flood-opacity":"1","flood-color":t.value.style.chart.layout.donut.shadowColor},null,8,vt)],8,dt)]),t.value.type==="classic"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(c.value,(l,a)=>(e.openBlock(),e.createElementBlock("g",null,[g(l)&&v.value.dataLabels.show?(e.openBlock(),e.createElementBlock("path",{key:0,d:e.unref(n.calcNutArrowPath)(l,{x:r.value.width/2,y:r.value.height/2},16,16,!1,!1,L.value),stroke:l.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none",filter:S(a)},null,8,ht)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),t.value.type==="polar"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:4},e.renderList(c.value,(l,a)=>(e.openBlock(),e.createElementBlock("g",null,[g(l)&&v.value.dataLabels.show?(e.openBlock(),e.createElementBlock("line",{key:0,x1:e.unref(n.offsetFromCenterPoint)({initX:i.value[a].middlePoint.x,initY:i.value[a].middlePoint.y,offset:24,centerX:r.value.width/2,centerY:r.value.height/2}).x,y1:e.unref(n.offsetFromCenterPoint)({initX:i.value[a].middlePoint.x,initY:i.value[a].middlePoint.y,offset:24,centerX:r.value.width/2,centerY:r.value.height/2}).y,x2:i.value[a].middlePoint.x,y2:i.value[a].middlePoint.y,stroke:l.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none",filter:S(a)},null,8,ft)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),t.value.type==="classic"&&t.value.style.chart.layout.donut.useShadow?(e.openBlock(),e.createElementBlock("circle",{key:5,cx:r.value.width/2,cy:r.value.height/2,r:y.value<=0?10:y.value,fill:t.value.style.chart.backgroundColor,filter:`url(#shadow_${d.value})`},null,8,yt)):e.createCommentVNode("",!0),o.$slots.pattern?(e.openBlock(),e.createElementBlock("g",pt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,a)=>(e.openBlock(),e.createElementBlock("defs",null,[e.renderSlot(o.$slots,"pattern",e.normalizeProps(e.guardReactiveProps({...l,patternId:`pattern_${d.value}_${l.patternIndex}`})),void 0,!0)]))),256))])):e.createCommentVNode("",!0),m.value&&t.value.type==="classic"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,a)=>(e.openBlock(),e.createElementBlock("path",{stroke:t.value.style.chart.backgroundColor,d:l.arcSlice,fill:"#FFFFFF"},null,8,mt))),256)),o.$slots.pattern?(e.openBlock(),e.createElementBlock("g",kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,a)=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-donut-arc-path",d:l.arcSlice,fill:`url(#pattern_${d.value}_${l.patternIndex})`,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.donut.borderWidth,filter:S(a)},null,8,gt))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,a)=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-donut-arc-path",d:l.arcSlice,fill:e.unref(n.setOpacity)(l.color,80),stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.donut.borderWidth,filter:S(a)},null,8,bt))),256))],64)):e.createCommentVNode("",!0),m.value&&t.value.type==="polar"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[c.value.length>1?(e.openBlock(),e.createElementBlock("g",wt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,a)=>(e.openBlock(),e.createElementBlock("path",{stroke:t.value.style.chart.backgroundColor,d:i.value[a].path,fill:"#FFFFFF"},null,8,Ct))),256)),t.value.style.chart.layout.donut.useShadow?(e.openBlock(),e.createElementBlock("g",Bt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,a)=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-donut-arc-path",d:i.value[a].path,fill:"transparent",stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.donut.borderWidth,filter:`url(#drop_shadow_${d.value})`},null,8,_t))),256))])):e.createCommentVNode("",!0),o.$slots.pattern?(e.openBlock(),e.createElementBlock("g",xt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,a)=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-donut-arc-path",d:i.value[a].path,fill:`url(#pattern_${d.value}_${l.patternIndex})`,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.donut.borderWidth,filter:S(a)},null,8,$t))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,a)=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-donut-arc-path",d:i.value[a].path,fill:t.value.style.chart.useGradient?`url(#polar_gradient_${a}_${d.value})`:l.color,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.donut.borderWidth,filter:S(a)},null,8,St))),256))])):(e.openBlock(),e.createElementBlock("g",Et,[o.$slots.pattern?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:r.value.width/2,cy:r.value.height/2,r:y.value,fill:`url(#pattern_${d.value}_${c.value[0].patternIndex})`,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.donut.borderWidth},null,8,Nt)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:r.value.width/2,cy:r.value.height/2,r:y.value,fill:t.value.style.chart.useGradient?`url(#polar_gradient_0_${d.value})`:c.value[0].color,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.donut.borderWidth},null,8,Pt)]))],64)):(e.openBlock(),e.createElementBlock("circle",{key:9,cx:r.value.width/2,cy:r.value.height/2,r:y.value<=0?10:y.value,fill:"transparent",stroke:t.value.style.chart.backgroundColor},null,8,Vt)),t.value.style.chart.useGradient&&t.value.type==="classic"?(e.openBlock(),e.createElementBlock("circle",{key:10,cx:r.value.width/2,cy:r.value.height/2,r:y.value<=0?10:y.value,fill:`url(#gradient_${d.value})`},null,8,Ft)):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[c.value.length>1||t.value.type==="classic"?(e.openBlock(),e.createElementBlock("g",Lt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,a)=>(e.openBlock(),e.createElementBlock("path",{"data-cy-donut-trap":"",d:t.value.type==="classic"?l.arcSlice:i.value[a].path,fill:p.value===a?"rgba(0,0,0,0.1)":"transparent",onMouseenter:s=>ye({datapoint:l,relativeIndex:a,seriesIndex:l.seriesIndex,show:!0}),onMouseleave:u[0]||(u[0]=s=>{T.value=!1,p.value=null}),onClick:s=>_(l,a)},null,40,Ot))),256))])):(e.openBlock(),e.createElementBlock("g",zt,[e.createElementVNode("circle",{cx:r.value.width/2,cy:r.value.height/2,r:y.value,fill:p.value===o.i?"rgba(0,0,0,0.1)":"transparent","data-cy-donut-trap":"",onMouseenter:u[1]||(u[1]=l=>ye({datapoint:c.value[0],relativeIndex:0,seriesIndex:c.value[0].seriesIndex,show:!0})),onMouseleave:u[2]||(u[2]=l=>{T.value=!1,p.value=null}),onClick:u[3]||(u[3]=l=>_(c.value[0],o.i))},null,40,Tt)]))],64)):e.createCommentVNode("",!0),t.value.type==="classic"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:12},[t.value.style.chart.layout.labels.hollow.total.show?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":"middle",x:r.value.width/2,y:r.value.height/2-(t.value.style.chart.layout.labels.hollow.average.show?t.value.style.chart.layout.labels.hollow.total.fontSize:0)+t.value.style.chart.layout.labels.hollow.total.offsetY,fill:t.value.style.chart.layout.labels.hollow.total.color,"font-size":t.value.style.chart.layout.labels.hollow.total.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.total.bold?"bold":""}`)},e.toDisplayString(t.value.style.chart.layout.labels.hollow.total.text),13,Xt)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.total.show?(e.openBlock(),e.createElementBlock("text",{key:1,"text-anchor":"middle",x:r.value.width/2,y:r.value.height/2+t.value.style.chart.layout.labels.hollow.total.fontSize-(t.value.style.chart.layout.labels.hollow.average.show?t.value.style.chart.layout.labels.hollow.total.fontSize:0)+t.value.style.chart.layout.labels.hollow.total.value.offsetY,fill:t.value.style.chart.layout.labels.hollow.total.value.color,"font-size":t.value.style.chart.layout.labels.hollow.total.value.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.total.value.bold?"bold":""}`)},e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.hollow.total.value.formatter,m.value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.hollow.total.value.prefix,v:m.value,s:t.value.style.chart.layout.labels.hollow.total.value.suffix}))),13,Dt)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.average.show?(e.openBlock(),e.createElementBlock("text",{key:2,"text-anchor":"middle",x:r.value.width/2,y:r.value.height/2+(t.value.style.chart.layout.labels.hollow.total.show?t.value.style.chart.layout.labels.hollow.average.fontSize:0)+t.value.style.chart.layout.labels.hollow.average.offsetY,fill:t.value.style.chart.layout.labels.hollow.average.color,"font-size":t.value.style.chart.layout.labels.hollow.average.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.average.bold?"bold":""}`)},e.toDisplayString(t.value.style.chart.layout.labels.hollow.average.text),13,Mt)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.average.show?(e.openBlock(),e.createElementBlock("text",{key:3,"text-anchor":"middle",x:r.value.width/2,y:r.value.height/2+(t.value.style.chart.layout.labels.hollow.total.show?t.value.style.chart.layout.labels.hollow.average.fontSize:0)+t.value.style.chart.layout.labels.hollow.average.fontSize+t.value.style.chart.layout.labels.hollow.average.value.offsetY,fill:t.value.style.chart.layout.labels.hollow.average.value.color,"font-size":t.value.style.chart.layout.labels.hollow.average.value.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.average.value.bold?"bold":""}`)},e.toDisplayString($.value?"--":e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.hollow.average.value.formatter,he.value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.hollow.average.value.prefix,v:he.value,s:t.value.style.chart.layout.labels.hollow.average.value.suffix,r:t.value.style.chart.layout.labels.hollow.average.value.rounding}))),13,Yt)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,a)=>(e.openBlock(),e.createElementBlock("g",{filter:S(a),class:e.normalizeClass({animated:t.value.useCssAnimation})},[t.value.style.chart.layout.labels.dataLabels.useLabelSlots?(e.openBlock(),e.createElementBlock("g",It,[(e.openBlock(),e.createElementBlock("foreignObject",{x:e.unref(n.calcMarkerOffsetX)(l,!0).anchor==="end"?e.unref(n.calcMarkerOffsetX)(l).x-120:e.unref(n.calcMarkerOffsetX)(l,!0).anchor==="middle"?e.unref(n.calcMarkerOffsetX)(l).x-60:e.unref(n.calcMarkerOffsetX)(l).x,y:e.unref(n.calcMarkerOffsetY)(l)-(me.value?20:0),width:"120",height:"60",style:{overflow:"visible"}},[e.createElementVNode("div",null,[e.renderSlot(o.$slots,"dataLabel",e.normalizeProps(e.guardReactiveProps({datapoint:l,isBlur:!t.value.useBlurOnHover||[null,void 0].includes(p.value)||p.value===a,isSafari:me.value,isVisible:g(l)&&v.value.dataLabels.show,textAlign:e.unref(n.calcMarkerOffsetX)(l,!0,16,!0).anchor,flexAlign:e.unref(n.calcMarkerOffsetX)(l,!0,16).anchor,percentage:A(l,c.value)})),void 0,!0)])],8,qt))])):(e.openBlock(),e.createElementBlock("g",Rt,[t.value.type==="classic"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[g(l)&&v.value.dataLabels.show?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:e.unref(n.calcMarkerOffsetX)(l).x,cy:e.unref(n.calcMarkerOffsetY)(l)-3.5,fill:l.color,stroke:t.value.style.chart.backgroundColor,"stroke-width":1,r:3,filter:!t.value.useBlurOnHover||[null,void 0].includes(p.value)||p.value===a?"":`url(#blur_${d.value})`,onClick:s=>_(l,a)},null,8,Gt)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.type==="polar"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[g(l)&&v.value.dataLabels.show?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:e.unref(n.offsetFromCenterPoint)({initX:i.value[a].middlePoint.x,initY:i.value[a].middlePoint.y,offset:24,centerX:r.value.width/2,centerY:r.value.height/2}).x,cy:e.unref(n.offsetFromCenterPoint)({initX:i.value[a].middlePoint.x,initY:i.value[a].middlePoint.y,offset:24,centerX:r.value.width/2,centerY:r.value.height/2}).y,fill:l.color,stroke:t.value.style.chart.backgroundColor,"stroke-width":1,r:3,filter:!t.value.useBlurOnHover||[null,void 0].includes(p.value)||p.value===a?"":`url(#blur_${d.value})`,onClick:s=>_(l,a)},null,8,Ut)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.type==="classic"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[g(l)&&v.value.dataLabels.show?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":e.unref(n.calcMarkerOffsetX)(l,!0,12).anchor,x:e.unref(n.calcMarkerOffsetX)(l,!0,12).x,y:e.unref(n.calcMarkerOffsetY)(l),fill:t.value.style.chart.layout.labels.percentage.color,"font-size":t.value.style.chart.layout.labels.percentage.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.percentage.bold?"bold":""}`),onClick:s=>_(l,a)},e.toDisplayString(A(l,c.value))+" "+e.toDisplayString(t.value.style.chart.layout.labels.value.show?`(${e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.value.formatter,l.value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.value.rounding}),{datapoint:l})})`:""),13,jt)):e.createCommentVNode("",!0),g(l)&&v.value.dataLabels.show?(e.openBlock(),e.createElementBlock("text",{key:1,"text-anchor":e.unref(n.calcMarkerOffsetX)(l).anchor,x:e.unref(n.calcMarkerOffsetX)(l,!0,12).x,y:e.unref(n.calcMarkerOffsetY)(l)+t.value.style.chart.layout.labels.percentage.fontSize,fill:t.value.style.chart.layout.labels.name.color,"font-size":t.value.style.chart.layout.labels.name.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.name.bold?"bold":""}`),onClick:s=>_(l,a)},e.toDisplayString(l.name),13,Ht)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.type==="polar"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[g(l)&&v.value.dataLabels.show?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":N(i.value[a].middlePoint),x:e.unref(n.offsetFromCenterPoint)({initX:i.value[a].middlePoint.x,initY:i.value[a].middlePoint.y,offset:42,centerX:r.value.width/2,centerY:r.value.height/2}).x,y:e.unref(n.offsetFromCenterPoint)({initX:i.value[a].middlePoint.x,initY:i.value[a].middlePoint.y,offset:42,centerX:r.value.width/2,centerY:r.value.height/2}).y,fill:t.value.style.chart.layout.labels.percentage.color,"font-size":t.value.style.chart.layout.labels.percentage.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.percentage.bold?"bold":""}`),onClick:s=>_(l,a)},e.toDisplayString(A(l,c.value))+" "+e.toDisplayString(t.value.style.chart.layout.labels.value.show?`(${e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.value.formatter,l.value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.value.rounding}),{datapoint:l})})`:""),13,Wt)):e.createCommentVNode("",!0),g(l)&&v.value.dataLabels.show?(e.openBlock(),e.createElementBlock("text",{key:1,"text-anchor":N(i.value[a].middlePoint),x:e.unref(n.offsetFromCenterPoint)({initX:i.value[a].middlePoint.x,initY:i.value[a].middlePoint.y,offset:42,centerX:r.value.width/2,centerY:r.value.height/2}).x,y:e.unref(n.offsetFromCenterPoint)({initX:i.value[a].middlePoint.x,initY:i.value[a].middlePoint.y,offset:42,centerX:r.value.width/2,centerY:r.value.height/2}).y+t.value.style.chart.layout.labels.percentage.fontSize,fill:t.value.style.chart.layout.labels.name.color,"font-size":t.value.style.chart.layout.labels.name.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.name.bold?"bold":""}`),onClick:s=>_(l,a)},e.toDisplayString(l.name),13,Jt)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)])),v.value.dataLabels.show&&t.value.style.chart.comments.show&&l.comment?(e.openBlock(),e.createElementBlock("g",Kt,[g(l)&&t.value.type==="classic"?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:t.value.style.chart.comments.offsetX+(e.unref(n.calcMarkerOffsetX)(l,!0).anchor==="end"?e.unref(n.calcMarkerOffsetX)(l).x-t.value.style.chart.comments.width:e.unref(n.calcMarkerOffsetX)(l,!0).anchor==="middle"?e.unref(n.calcMarkerOffsetX)(l).x-t.value.style.chart.comments.width/2:e.unref(n.calcMarkerOffsetX)(l).x),y:e.unref(n.calcMarkerOffsetY)(l)+24+t.value.style.chart.comments.offsetY,width:t.value.style.chart.comments.width,height:"200",style:{overflow:"visible","pointer-events":"none"}},[e.createElementVNode("div",null,[e.renderSlot(o.$slots,"plot-comment",{plot:{...l,textAlign:e.unref(n.calcMarkerOffsetX)(l,!0,16,!0).anchor,flexAlign:e.unref(n.calcMarkerOffsetX)(l,!0,16).anchor}},void 0,!0)])],8,Qt)):e.createCommentVNode("",!0),g(l)&&t.value.type==="polar"?(e.openBlock(),e.createElementBlock("foreignObject",{key:1,x:t.value.style.chart.comments.offsetX+(N(i.value[a].middlePoint)==="end"?e.unref(n.offsetFromCenterPoint)({initX:i.value[a].middlePoint.x,initY:i.value[a].middlePoint.y,offset:42,centerX:r.value.width/2,centerY:r.value.height/2}).x-t.value.style.chart.comments.width:N(i.value[a].middlePoint)==="middle"?e.unref(n.offsetFromCenterPoint)({initX:i.value[a].middlePoint.x,initY:i.value[a].middlePoint.y,offset:42,centerX:r.value.width/2,centerY:r.value.height/2}).x-t.value.style.chart.comments.width/2:e.unref(n.offsetFromCenterPoint)({initX:i.value[a].middlePoint.x,initY:i.value[a].middlePoint.y,offset:42,centerX:r.value.width/2,centerY:r.value.height/2}).x),y:Ve(i.value[a])+t.value.style.chart.comments.offsetY,width:t.value.style.chart.comments.width,height:"200",style:{overflow:"visible","pointer-events":"none"}},[e.createElementVNode("div",null,[e.renderSlot(o.$slots,"plot-comment",{plot:{...l,textAlign:N(i.value[a].middlePoint),flexAlign:N(i.value[a].middlePoint)}},void 0,!0)])],8,Zt)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,At))),256)),e.renderSlot(o.$slots,"svg",{svg:r.value},void 0,!0)],14,He)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",el,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(ae)||e.unref(ne)})),void 0,!0)])):e.createCommentVNode("",!0),F.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Me.default,{key:6,config:{type:"donut",style:{backgroundColor:t.value.style.chart.backgroundColor,donut:{color:"#CCCCCC",strokeWidth:L.value*.8}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:j},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(De.Legend,{key:`legend_${Q.value}`,legendSet:ve.value,config:Pe.value,onClickMarker:u[4]||(u[4]=({i:l})=>de(l))},e.createSlots({item:e.withCtx(({legend:l,index:a})=>[e.createElementVNode("div",{style:e.normalizeStyle(`opacity:${w.value.includes(a)?.5:1}`),onClick:s=>l.segregate()},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.value.formatter,l.value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l,index:a}))+" ",1),w.value.includes(a)?(e.openBlock(),e.createElementBlock("span",ol," ( "+e.toDisplayString(Oe(l.proportion*100))+" % ) ",1)):(e.openBlock(),e.createElementBlock("span",ll," ("+e.toDisplayString(isNaN(l.value/m.value)?"-":e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.percentage.formatter,fe.value(l),e.unref(n.dataLabel)({v:fe.value(l),s:"%",r:t.value.style.chart.legend.roundingPercentage})))+") ",1))],12,tl)]),_:2},[o.$slots.pattern?{name:"legend-pattern",fn:e.withCtx(({legend:l,index:a})=>[e.createVNode(Re._sfc_main,{shape:l.shape,radius:30,stroke:"none",plot:{x:30,y:30},fill:`url(#pattern_${d.value}_${a})`},null,8,["shape","fill"])]),key:"0"}:void 0]),1032,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"legend",{legend:ve.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:H,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Xe._sfc_main,{show:v.value.showTooltip&&T.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,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,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:E.value,content:M.value,isCustom:O.value,isFullscreen:P.value},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...I.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...I.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom","isFullscreen"]),F.value?(e.openBlock(),e.createBlock(Ye.default,{key:8,hideDetails:"",config:{open:v.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Te.DataTable,{key:`table_${K.value}`,colNames:X.value.colNames,head:X.value.head,body:X.value.body,config:X.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:u[5]||(u[5]=l=>v.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,al)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name?l.name:isNaN(Number(l))?l.includes("%")?l:e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.percentage.formatter,l,e.unref(n.dataLabel)({v:l,s:"%",r:t.value.style.chart.layout.labels.percentage.rounding})):e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.value.formatter,l,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.value.rounding}))),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,je))}},rl=Ge._export_sfc(nl,[["__scopeId","data-v-f39affda"]]);exports.default=rl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-CH3YkGpv.cjs"),ze=require("./Title-m5N0oN0G.cjs"),me=require("./usePrinter-A1_US3Dh.cjs"),Ve=require("./DataTable-RY8EUwF3.cjs"),Ae=require("./Legend-CZrlsh2W.cjs"),$e=require("./vue-ui-skeleton-DwmP0u2B.cjs"),De=require("./Slicer-De-C8OB8.cjs"),Fe=require("./vue-ui-accordion-_LFrGkGx.cjs"),fe=require("./useNestedProp-2TBYsJKg.cjs"),Pe=require("./PackageVersion-C1zaH_aJ.cjs"),Ie=require("./PenAndPaper-Bv8oV7l0.cjs"),Oe=require("./useUserOptionState-BgepsfED.cjs"),Te=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),He=["id"],Me=["xmlns","viewBox"],Re=["x","y","width","height"],Ue=["id"],qe=["stop-color"],We=["stop-color"],Xe=["id"],Ge=["stop-color"],je=["stop-color"],Ye=["stop-color"],Ke={key:1},Je=["x1","x2","y1","y2","stroke","stroke-width"],Qe=["x1","x2","y1","y2","stroke","stroke-width"],Ze={key:0},et=["x1","x2","y1","y2","stroke","stroke-width"],tt=["x1","x2","y1","y2","stroke","stroke-width"],lt=["x","y","font-size","fill","font-weight"],at=["text-anchor","font-size","fill","transform"],ot=["x1","y1","x2","y2","stroke","stroke-width"],nt={key:1},ut=["cx","cy","r","fill"],rt={key:0},st={key:0},ct=["d","stroke"],it=["text-anchor","x","y","fill"],dt=["cx","cy","r","fill"],vt={key:0},ht=["cx","cy","fill"],yt={key:1},mt=["d","fill","stroke"],ft={key:2},gt=["d","fill","stroke"],pt=["x","y","font-size","fill"],kt=["x","y","width","fill","onClick"],bt=["x","y","width","height","onMouseenter","onClick"],xt={key:4,"data-cy-zoom":"",class:"vue-ui-donut-evolution-dialog"},Bt=["x","y","width","height","fill"],Ct=["x1","y1","x2","y2","stroke"],_t=["x1","y2","x2","y1","stroke"],Et=["onKeypress","cx","cy","r"],Nt=["d","stroke"],wt=["cx","cy","r","fill"],St=["d","fill","stroke"],Lt={class:"vue-ui-donut-evolution-focus"},zt=["text-anchor","x","y","fill"],Vt=["cx","cy","r","fill"],At=["cx","cy","r","fill"],$t=["x","y","fill"],Dt=["x","y","font-size","fill"],Ft={key:5,class:"vue-data-ui-watermark"},Pt=["onClick"],It={key:0},Ot={key:1},Tt={key:9,ref:"source",dir:"auto"},Ht={key:0},Mt={key:1},Rt={__name:"vue-ui-donut-evolution",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(ge,{expose:pe,emit:W}){const y=ge,{vue_ui_donut_evolution:ke}=r.useConfig(),A=e.computed(()=>!!y.dataset&&y.dataset.length),i=e.ref({start:0,end:Math.max(...y.dataset.map(a=>a.values.length))});function X(){G()}const N=e.ref(null);async function G(){(t.value.style.chart.zoom.startIndex!==null||t.value.style.chart.zoom.endIndex!==null)&&N.value?(t.value.style.chart.zoom.startIndex!==null&&(await e.nextTick(),await e.nextTick(),N.value&&N.value.setStartValue(t.value.style.chart.zoom.startIndex)),t.value.style.chart.zoom.endIndex!==null&&(await e.nextTick(),await e.nextTick(),N.value&&N.value.setEndValue(be(t.value.style.chart.zoom.endIndex+1)))):(i.value={start:0,end:E.value},K.value+=1)}function be(a){const o=E.value;return a>o?o:a<0||t.value.style.chart.zoom.startIndex!==null&&a<t.value.style.chart.zoom.startIndex?t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex+1:1:a}e.onMounted(()=>{j()});function j(){r.objectIsEmpty(y.dataset)?r.error({componentName:"VueUiDonutEvolution",type:"dataset"}):y.dataset.length&&y.dataset.forEach((a,o)=>{r.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","values"]}).forEach(l=>{r.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:l,index:o})})}),G()}const _=e.ref(r.createUid()),m=e.ref([]),h=e.ref(null),P=e.ref(null),k=e.ref(!1),b=e.ref(null),I=e.ref(null),xe=e.ref(null),Y=e.ref(0),K=e.ref(0),J=e.ref(0),Q=e.ref(0),Z=e.ref(0),t=e.computed({get:()=>le(),set:a=>a}),{userOptionsVisible:O,setUserOptionsVisibility:ee,keepUserOptionState:te}=Oe.useUserOptionState({config:t.value});function le(){const a=fe.useNestedProp({userConfig:y.config,defaultConfig:ke});let o={};return a.theme?o={...fe.useNestedProp({userConfig:r.themes.vue_ui_donut_evolution[a.theme]||y.config,defaultConfig:a}),customPalette:r.themePalettes[a.theme]||r.palette}:o=a,y.config&&r.hasDeepProperty(y.config,"style.chart.zoom.startIndex")?o.style.chart.zoom.startIndex=y.config.style.chart.zoom.startIndex:o.style.chart.zoom.startIndex=null,y.config&&r.hasDeepProperty(y.config,"style.chart.zoom.endIndex")?o.style.chart.zoom.endIndex=y.config.style.chart.zoom.endIndex:o.style.chart.zoom.endIndex=null,o}e.watch(()=>y.config,a=>{t.value=le(),O.value=!t.value.showOnChartHover,j(),J.value+=1,Q.value+=1,Z.value+=1},{deep:!0}),e.watch(()=>y.dataset,a=>{X()},{deep:!0});const{isPrinting:ae,isImaging:oe,generatePdf:ne,generateImage:ue}=me.usePrinter({elementId:_.value,fileName:t.value.style.chart.title.text||"vue-ui-donut-evolution"}),Be=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Ce=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),$=e.ref({showTable:t.value.table.show}),u=e.computed(()=>({top:t.value.style.chart.layout.padding.top,right:t.value.style.chart.layout.padding.right,bottom:t.value.style.chart.layout.padding.bottom,left:t.value.style.chart.layout.padding.left})),s=e.computed(()=>{const a=t.value.style.chart.layout.height,o=t.value.style.chart.layout.width,l=a-u.value.top-u.value.bottom,c=o-u.value.left-u.value.right;return{absoluteHeight:a,absoluteWidth:o,centerX:u.value.left+c/2,centerY:u.value.top+l/2,height:l,width:c}}),C=e.computed(()=>(y.dataset.forEach((a,o)=>{[null,void 0].includes(a.name)&&r.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:"name",index:o}),[null,void 0].includes(a.values)&&r.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:"values",index:o})}),y.dataset.map((a,o)=>({...a,values:r.sanitizeArray(a.values),color:r.convertColorToHex(a.color)||Ce.value[o]||r.palette[o]||r.palette[o%r.palette.length],length:(a.values||[]).length,uid:r.createUid()})))),z=e.computed(()=>C.value.filter(a=>!m.value.includes(a.uid)).map(a=>({...a,values:a.values.filter((o,l)=>l>=i.value.start&&l<=i.value.end)}))),E=e.computed(()=>Math.max(...z.value.map(a=>a.length))),g=e.computed(()=>s.value.width/(i.value.end-i.value.start)),f=e.computed(()=>{const a=[];for(let n=0;n<i.value.end-i.value.start;n+=1){const v=z.value.map(B=>B.values[n]??null),d=v.filter(B=>[void 0,null].includes(B)).length===v.length,x=v.reduce((B,p)=>B+p,0),q=v.map(B=>B/x),L=u.value.left+g.value*n+g.value/2;a.push({index:n,percentages:q,subtotal:d||x<0?null:x,values:v,x:L})}const o=0,l=Math.max(...a.map(n=>n.subtotal)),c=a.length===1?l*2:l;return a.map((n,v)=>{const d=g.value/2*.7,x=d>s.value.width/16?s.value.width/16:d,q=h.value===n.index?s.value.width/16:x,L=a.length>4?d*2:d*2>g.value/2*.7?g.value/2*.7:d*2,B=s.value.absoluteHeight-u.value.bottom-s.value.height*n.subtotal/r.calculateNiceScale(o,c,t.value.style.chart.layout.grid.yAxis.dataLabels.steps).max;return{...n,y:B,radius:x,activeRadius:q,hoverRadius:L,donut:r.makeDonut({series:z.value.map((p,ye)=>({color:p.color,name:p.name,value:p.values[v]??0}))},n.x,B,x,x,1.99999,2,1,360,105.25,x/2),donutHover:r.makeDonut({series:z.value.map((p,ye)=>({color:p.color,name:p.name,value:p.values[v]??0}))},n.x,B,L,L,1.99999,2,1,360,105.25,L/2),donutFocus:r.makeDonut({series:z.value.map((p,ye)=>({color:p.color,name:p.name,value:p.values[v]??0}))},s.value.centerX,s.value.centerY,s.value.height/3.6,s.value.height/3.6,1.99999,2,1,360,105.25,s.value.height/6)}})});function D(a,o,l){return r.applyDataLabel(t.value.style.chart.layout.dataLabels.formatter,a,r.dataLabel({p:t.value.style.chart.layout.dataLabels.prefix,v:a,s:t.value.style.chart.layout.dataLabels.suffix,r:t.value.style.chart.layout.dataLabels.rounding}),{datapoint:o,index:l})}const T=e.computed(()=>({max:Math.max(...f.value.map(a=>a.subtotal)),min:0})),w=e.computed(()=>{const a=f.value.length===1?T.value.max*2:T.value.max;return r.calculateNiceScale(T.value.min,a,t.value.style.chart.layout.grid.yAxis.dataLabels.steps)});function _e(a){return a/w.value.max}const Ee=e.computed(()=>w.value.ticks.map(a=>({y:s.value.absoluteHeight-u.value.bottom-s.value.height*_e(a),value:a})));function re(a,o){return isNaN(a.value/r.sumByAttribute(o,"value"))?0:(a.value/r.sumByAttribute(o,"value")*100).toFixed(0)+"%"}function se(){k.value||(h.value=null,P.value=null)}function Ne(a){k.value||(h.value=a.index,P.value=a)}const H=e.ref(null);function M(a,o){a.subtotal&&(P.value=null,h.value=null,k.value=!0,b.value=a,[null,void 0].includes(o)||(H.value=o))}function ce(){b.value=null,k.value=!1,H.value=null}const ie=e.computed(()=>C.value.map((a,o)=>({name:a.name,value:a.values.slice(i.value.start,i.value.end).reduce((l,c)=>l+c,0),shape:"circle",uid:a.uid,color:a.color})).sort((a,o)=>o.value-a.value).map(a=>({...a,opacity:m.value.includes(a.uid)?.5:1,segregate:()=>R(a.uid),isSegregated:m.value.includes(a.uid)}))),de=e.computed(()=>f.value.map(a=>a.subtotal).reduce((a,o)=>a+o,0)),we=e.computed(()=>({cy:"donut-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function R(a){if(m.value.includes(a))m.value=m.value.filter(o=>o!==a),W("selectLegend",null);else{if(m.value.length===C.value.length-1)return;m.value.push(a),W("selectLegend",C.value.find(o=>o.uid===a))}b.value&&M(f.value.find((o,l)=>l===H.value))}const S=e.computed(()=>{const a=[""].concat(C.value.filter(n=>!m.value.includes(n.uid)).map(n=>({name:n.name,color:n.color}))).concat(["Σ"]);let o=[];for(let n=0;n<E.value;n+=1){const v=C.value.filter(d=>!m.value.includes(d.uid)).map(d=>d.values[n]??0).reduce((d,x)=>d+x,0);o.push([t.value.style.chart.layout.grid.xAxis.dataLabels.values[n]??"-"].concat(C.value.filter(d=>!m.value.includes(d.uid)).map(d=>({value:d.values[n]??0,percentage:d.values[n]?d.values[n]/v*100:0}))).concat([`${t.value.style.chart.layout.dataLabels.prefix}${Number(v.toFixed(t.value.table.td.roundingValue))}${t.value.style.chart.layout.dataLabels.suffix}`]))}const 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},c=[t.value.table.columnNames.period].concat(C.value.filter(n=>!m.value.includes(n.uid)).map(n=>n.name)).concat(t.value.table.columnNames.total);return{head:a,body:o,config:l,colNames:c}});function Se(){return C.value}function ve(){e.nextTick(()=>{const a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],o=[...S.value.head.map(v=>v.name??v)],l=[...S.value.body.map(v=>v.map(d=>d.value??d))],c=a.concat([o]).concat(l),n=r.createCsvContent(c);r.downloadCsv({csvContent:n,title:t.value.style.chart.title.text||"vue-ui-donut-evolution"})})}const V=e.ref(!1);function Le(a){V.value=a,Y.value+=1}function he(){$.value.showTable=!$.value.showTable}const F=e.ref(!1);function U(){F.value=!F.value}return pe({getData:Se,generatePdf:ne,generateCsv:ve,generateImage:ue,toggleTable:he,toggleAnnotator:U}),(a,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"donutEvolutionChart",ref:I,class:e.normalizeClass(`vue-ui-donut-evolution ${V.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),id:_.value,onMouseenter:o[4]||(o[4]=()=>e.unref(ee)(!0)),onMouseleave:o[5]||(o[5]=()=>e.unref(ee)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ie.PenAndPaper,{key:0,parent:I.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:F.value,onClose:U},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Be.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:xe,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,style:"width:100%;background:transparent;padding-bottom:24px",onMouseleave:se},[(e.openBlock(),e.createBlock(ze._sfc_main,{key:`title_${J.value}`,config:{title:{cy:"donut-evolution-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-evolution-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],32)):e.createCommentVNode("",!0),t.value.userOptions.show&&A.value&&(e.unref(te)||e.unref(O))?(e.openBlock(),e.createBlock(me.UserOptions,{ref:"details",key:`user_options_${Y.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(ae),isImaging:e.unref(oe),uid:_.value,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:V.value,titles:{...t.value.userOptions.buttonTitles},chartElement:I.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:F.value,onToggleFullscreen:Le,onGeneratePdf:e.unref(ne),onGenerateCsv:ve,onGenerateImage:e.unref(ue),onToggleTable:he,onToggleAnnotator:U,style:e.normalizeStyle({visibility:e.unref(te)?e.unref(O)?"visible":"hidden":"visible"})},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:c})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:c})),void 0,!0)]),key:"4"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:c})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:c})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),A.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":V.value,"vue-data-ui-fulscreen--off":!V.value}),viewBox:`0 0 ${s.value.absoluteWidth} ${s.value.absoluteHeight}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Pe._sfc_main),a.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:u.value.left,y:u.value.top,width:s.value.width,height:s.value.height,style:{pointerEvents:"none"}},[e.renderSlot(a.$slots,"chart-background",{},void 0,!0)],8,Re)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`hover_${_.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.setOpacity)(t.value.style.chart.backgroundColor,t.value.style.chart.layout.highlighter.opacity)},null,8,qe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.setOpacity)(t.value.style.chart.layout.highlighter.color,t.value.style.chart.layout.highlighter.opacity)},null,8,We)],8,Ue),e.createElementVNode("radialGradient",{id:`focus_${_.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.setOpacity)(e.unref(r.convertColorToHex)(t.value.style.chart.backgroundColor),0)},null,8,Ge),e.createElementVNode("stop",{offset:"77%","stop-color":e.unref(r.setOpacity)("#FFFFFF",30)},null,8,je),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.setOpacity)(e.unref(r.convertColorToHex)(t.value.style.chart.backgroundColor),0)},null,8,Ye)],8,Xe)]),t.value.style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",Ke,[e.createElementVNode("line",{x1:u.value.left,x2:u.value.left,y1:u.value.top,y2:u.value.top+s.value.height,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Je),e.createElementVNode("line",{x1:u.value.left,x2:s.value.absoluteWidth-u.value.right,y1:s.value.absoluteHeight-u.value.bottom,y2:s.value.absoluteHeight-u.value.bottom,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Qe),t.value.style.chart.layout.grid.showVerticalLines?(e.openBlock(),e.createElementBlock("g",Ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.end-i.value.start,(l,c)=>(e.openBlock(),e.createElementBlock("line",{x1:u.value.left+(c+1)*g.value,x2:u.value.left+(c+1)*g.value,y1:u.value.top,y2:s.value.absoluteHeight-u.value.bottom,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,et))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.layout.grid.yAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",{key:2,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":h.value!==null||k.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ee.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",null,[l.value>=w.value.min&&l.value<=w.value.max?(e.openBlock(),e.createElementBlock("line",{key:0,x1:u.value.left,x2:u.value.left-5,y1:l.y,y2:l.y,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,tt)):e.createCommentVNode("",!0),l.value>=w.value.min&&l.value<=w.value.max?(e.openBlock(),e.createElementBlock("text",{key:1,x:u.value.left-8+t.value.style.chart.layout.grid.yAxis.dataLabels.offsetX,y:l.y+t.value.style.chart.layout.grid.yAxis.dataLabels.fontSize/3,"font-size":t.value.style.chart.layout.grid.yAxis.dataLabels.fontSize,"text-anchor":"end",fill:t.value.style.chart.layout.grid.yAxis.dataLabels.color,"font-weight":t.value.style.chart.layout.grid.yAxis.dataLabels.bold?"bold":"normal"},e.toDisplayString(e.unref(r.canShowValue)(l.value)?e.unref(r.applyDataLabel)(t.value.style.chart.layout.dataLabels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.dataLabels.suffix,r:t.value.style.chart.layout.grid.yAxis.dataLabels.roundingValue}),{datapoint:l,seriesIndex:c}):""),9,lt)):e.createCommentVNode("",!0)]))),256))],2)):e.createCommentVNode("",!0),t.value.style.chart.layout.grid.xAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":k.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.end-i.value.start,(l,c)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.grid.xAxis.dataLabels.showOnlyFirstAndLast&&(c===0||c===E.value-1)||!t.value.style.chart.layout.grid.xAxis.dataLabels.showOnlyFirstAndLast?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":t.value.style.chart.layout.grid.xAxis.dataLabels.rotation>0?"start":t.value.style.chart.layout.grid.xAxis.dataLabels.rotation<0?"end":"middle","font-size":t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize,fill:t.value.style.chart.layout.grid.xAxis.dataLabels.color,transform:`translate(${u.value.left+g.value*c+g.value/2}, ${t.value.style.chart.layout.grid.xAxis.dataLabels.offsetY+s.value.absoluteHeight-u.value.bottom+t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize*2}), rotate(${t.value.style.chart.layout.grid.xAxis.dataLabels.rotation})`},e.toDisplayString(t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(c)+Number(i.value.start)]??""),9,at)):e.createCommentVNode("",!0)]))),256))],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.line.show&&c<f.value.length-1&&![l.subtotal,f.value[c+1].subtotal].includes(null)?(e.openBlock(),e.createElementBlock("line",{key:0,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":h.value!==null||k.value}),x1:l.x,y1:l.y,x2:f.value[c+1].x,y2:f.value[c+1].y,stroke:t.value.style.chart.layout.line.stroke,"stroke-width":t.value.style.chart.layout.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,10,ot)):e.createCommentVNode("",!0),l.subtotal!==null?(e.openBlock(),e.createElementBlock("g",nt,[l.subtotal?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x,cy:l.y,r:l.activeRadius,fill:t.value.style.chart.backgroundColor},null,8,ut)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":c!==h.value&&h.value!==null||k.value})},[l.subtotal?(e.openBlock(),e.createElementBlock("g",rt,[h.value!==null&&h.value===c?(e.openBlock(),e.createElementBlock("g",st,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donutHover,n=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("path",{d:e.unref(r.calcNutArrowPath)(n,{x:n.center.endX,y:n.center.endY},12,12,{x:l.x,y:l.y},!0,20),stroke:n.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,ct)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donutHover,(n,v)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("text",{"data-cy-hover-label":"","text-anchor":e.unref(r.calcMarkerOffsetX)(n,!0,0).anchor,x:e.unref(r.calcMarkerOffsetX)(n,!0,3).x,y:e.unref(r.calcMarkerOffsetY)(n),fill:t.value.style.chart.layout.grid.yAxis.dataLabels.color,"font-size":8,"font-weight":"bold"},e.toDisplayString(n.name)+": "+e.toDisplayString(re(n,l.donut))+" ("+e.toDisplayString(n.value===null?"-":D(n.value,n,v))+") ",9,it)]))),256)),e.createElementVNode("g",null,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:l.hoverRadius,fill:t.value.style.chart.backgroundColor},null,8,dt)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":c!==h.value&&h.value!==null||k.value})},[l.subtotal!==null?(e.openBlock(),e.createElementBlock("g",vt,[l.subtotal===0?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x,cy:l.y,r:3,fill:t.value.style.chart.color},null,8,ht)):h.value!==null&&h.value===c?(e.openBlock(),e.createElementBlock("g",yt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donutHover,(n,v)=>(e.openBlock(),e.createElementBlock("path",{d:n.arcSlice,fill:`${n.color}`,"stroke-width":1,stroke:t.value.style.chart.backgroundColor},null,8,mt))),256))])):(e.openBlock(),e.createElementBlock("g",ft,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donut,(n,v)=>(e.openBlock(),e.createElementBlock("path",{d:n.arcSlice,fill:`${n.color}`,"stroke-width":.5,stroke:t.value.style.chart.backgroundColor},null,8,gt))),256))]))])):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":c!==h.value&&h.value!==null||k.value})},[l.subtotal!==null&&t.value.style.chart.layout.dataLabels.show?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":"middle",x:l.x,y:h.value===l.index&&l.subtotal?l.y+t.value.style.chart.layout.dataLabels.fontSize/3:l.y-l.radius-t.value.style.chart.layout.dataLabels.fontSize+t.value.style.chart.layout.dataLabels.offsetY,"font-size":t.value.style.chart.layout.dataLabels.fontSize,"font-weight":"bold",fill:t.value.style.chart.layout.dataLabels.color},e.toDisplayString(D(l.subtotal,l,c)),9,pt)):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,c)=>(e.openBlock(),e.createElementBlock("rect",{x:u.value.left+c*g.value,y:s.value.absoluteHeight-u.value.bottom-10,width:g.value,height:10,fill:h.value===l.index?`url(#hover_${_.value})`:"transparent",onClick:n=>M(l,c),class:e.normalizeClass({"donut-hover":h.value===l.index&&l.subtotal})},null,10,kt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,c)=>(e.openBlock(),e.createElementBlock("rect",{"data-cy-trap":"",x:u.value.left+c*g.value,y:u.value.top,width:g.value,height:s.value.height,fill:"transparent",onMouseenter:n=>Ne(l),onMouseleave:se,onClick:n=>M(l,c),class:e.normalizeClass({"donut-hover":h.value===l.index&&l.subtotal})},null,42,bt))),256)),k.value?(e.openBlock(),e.createElementBlock("g",xt,[e.createElementVNode("rect",{rx:4,x:u.value.left,y:u.value.top,width:s.value.width,height:s.value.height,fill:t.value.style.chart.backgroundColor,style:{filter:"drop-shadow(0 12px 12px rgba(0,0,0,0.3))"}},null,8,Bt),e.createElementVNode("line",{"data-html2canvas-ignore":"",x1:s.value.absoluteWidth-u.value.right-15,y1:u.value.top+5,x2:s.value.absoluteWidth-u.value.right-4,y2:u.value.top+15.5,"stroke-linecap":"round",stroke:t.value.style.chart.color,"stroke-width":"1.5"},null,8,Ct),e.createElementVNode("line",{"data-html2canvas-ignore":"",x1:s.value.absoluteWidth-u.value.right-15,y2:u.value.top+5,x2:s.value.absoluteWidth-u.value.right-4,y1:u.value.top+15.5,"stroke-linecap":"round",stroke:t.value.style.chart.color,"stroke-width":"1.5"},null,8,_t),e.createElementVNode("circle",{"data-cy-close":"",onClick:ce,onKeypress:e.withKeys(ce,["enter"]),cx:s.value.absoluteWidth-u.value.right-s.value.width/40,cy:u.value.top+s.value.height/30,r:s.value.height/12,fill:"transparent",style:{cursor:"pointer"},tabindex:"0"},null,40,Et),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.donutFocus,l=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("path",{"data-cy-zoom-donut":"",d:e.unref(r.calcNutArrowPath)(l,{x:s.value.centerX,y:s.value.centerY},12,12,!1,!1,15),stroke:l.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none",class:"vue-ui-donut-evolution-focus"},null,8,Nt)]))),256)),e.createElementVNode("circle",{cx:u.value.left+s.value.width/2,cy:u.value.top+s.value.height/2,r:s.value.height/7,fill:t.value.style.chart.backgroundColor},null,8,wt),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.donutFocus,(l,c)=>(e.openBlock(),e.createElementBlock("path",{d:l.arcSlice,fill:`${l.color}`,"stroke-width":1,stroke:t.value.style.chart.backgroundColor,class:"vue-ui-donut-evolution-focus"},null,8,St))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.donutFocus,(l,c)=>(e.openBlock(),e.createElementBlock("g",Lt,[e.createElementVNode("text",{"text-anchor":e.unref(r.calcMarkerOffsetX)(l,!0,20).anchor,x:e.unref(r.calcMarkerOffsetX)(l,!0,10).x,y:e.unref(r.calcMarkerOffsetY)(l),fill:t.value.style.chart.layout.grid.yAxis.dataLabels.color,"font-size":10,"font-weight":"bold"},e.toDisplayString(l.name)+": "+e.toDisplayString(re(l,b.value.donutFocus))+" ("+e.toDisplayString(l.value===null?"-":D(l.value,l,c))+") ",9,zt)]))),256)),e.createElementVNode("circle",{cx:u.value.left+s.value.width/2,cy:u.value.top+s.value.height/2,r:s.value.height/3.8,fill:`url(#focus_${_.value})`},null,8,Vt),e.createElementVNode("circle",{cx:u.value.left+s.value.width/2,cy:u.value.top+s.value.height/2,r:s.value.height/7.7,fill:t.value.style.chart.backgroundColor},null,8,At),e.createElementVNode("text",{"text-anchor":"middle",x:u.value.left+s.value.width/2,y:u.value.top+s.value.height/2+14/3,"font-size":14,"font-weight":"bold",fill:t.value.style.chart.layout.dataLabels.color,class:"vue-ui-donut-evolution-focus"},e.toDisplayString(D(b.value.subtotal,b.value,null)),9,$t),t.value.style.chart.layout.grid.xAxis.dataLabels.values[b.value.index]?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.value.left+6,y:u.value.top+t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize*2,"font-size":t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize*1.6,fill:t.value.style.chart.layout.dataLabels.color},e.toDisplayString(t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(b.value.index)+Number(i.value.start)]),9,Dt)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:s.value},void 0,!0)],14,Me)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ft,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(ae)||e.unref(oe)})),void 0,!0)])):e.createCommentVNode("",!0),A.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($e.default,{key:6,config:{type:"donutEvolution",style:{backgroundColor:t.value.style.chart.backgroundColor,donutEvolution:{axis:{color:"#CCCCCC"},donuts:{color:"#CCCCCC"}}}}},null,8,["config"])),E.value>1&&t.value.style.chart.zoom.show?(e.openBlock(),e.createBlock(De.Slicer,{ref_key:"slicerComponent",ref:N,key:`slicer_${K.value}`,background:t.value.style.chart.zoom.color,borderColor:t.value.style.chart.backgroundColor,fontSize:t.value.style.chart.zoom.fontSize,useResetSlot:t.value.style.chart.zoom.useResetSlot,labelLeft:t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(i.value.start)]||"",labelRight:t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(i.value.end)-1]||"",textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,max:E.value,min:0,valueStart:i.value.start,valueEnd:i.value.end,start:i.value.start,"onUpdate:start":o[0]||(o[0]=l=>i.value.start=l),end:i.value.end,"onUpdate:end":o[1]||(o[1]=l=>i.value.end=l),refreshStartPoint:t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex:0,refreshEndPoint:t.value.style.chart.zoom.endIndex!==null?t.value.style.chart.zoom.endIndex+1:E.value,enableRangeHandles:t.value.style.chart.zoom.enableRangeHandles,enableSelectionDrag:t.value.style.chart.zoom.enableSelectionDrag,onReset:X},{"reset-action":e.withCtx(({reset:l})=>[e.renderSlot(a.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:l})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end","refreshStartPoint","refreshEndPoint","enableRangeHandles","enableSelectionDrag"])):e.createCommentVNode("",!0),t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Ae.Legend,{key:`legend_${Z.value}`,legendSet:ie.value,config:we.value,onClickMarker:o[2]||(o[2]=({legend:l})=>R(l.uid))},{item:e.withCtx(({legend:l,index:c})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:n=>R(l.uid),style:e.normalizeStyle(`opacity:${m.value.includes(l.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.dataLabels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l,seriesIndex:c}))+" ",1),m.value.includes(l.uid)?(e.openBlock(),e.createElementBlock("span",Ot," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",It," ("+e.toDisplayString(isNaN(l.value/de.value)?"-":e.unref(r.dataLabel)({v:l.value/de.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,Pt)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"legend",{legend:ie.value},void 0,!0),a.$slots.source?(e.openBlock(),e.createElementBlock("div",Tt,[e.renderSlot(a.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),A.value?(e.openBlock(),e.createBlock(Fe.default,{key:10,hideDetails:"",config:{open:$.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(Ve.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:o[3]||(o[3]=l=>$.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l.name??l),1)]),td:e.withCtx(({td:l})=>[l.value===null?(e.openBlock(),e.createElementBlock("span",Ht,"-")):(e.openBlock(),e.createElementBlock("b",Mt,e.toDisplayString(isNaN(l.value)?"":t.value.style.chart.layout.dataLabels.prefix)+e.toDisplayString(!isNaN(l.value)&&l.value!==null?Number(l.value.toFixed(t.value.table.td.roundingValue)).toLocaleString():l)+e.toDisplayString(isNaN(l.value)?"":t.value.style.chart.layout.dataLabels.suffix),1)),e.createElementVNode("span",null,e.toDisplayString(l.percentage&&!isNaN(l.percentage)?`(${Number(l.percentage.toFixed(t.value.table.td.roundingPercentage)).toLocaleString()}%)`:""),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,He))}},Ut=Te._export_sfc(Rt,[["__scopeId","data-v-bfca0728"]]);exports.default=Ut;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-KJL8ra_6.cjs"),ze=require("./Title-D-6pIV0l.cjs"),me=require("./usePrinter-pDOF3CfL.cjs"),Ve=require("./DataTable-wN-jvOfe.cjs"),Ae=require("./Legend-DqGE1lkA.cjs"),$e=require("./vue-ui-skeleton-D_YCUi1y.cjs"),De=require("./Slicer-8bCK41mN.cjs"),Fe=require("./vue-ui-accordion-4-dyMgJA.cjs"),fe=require("./useNestedProp-Bu958azG.cjs"),Pe=require("./PackageVersion-Dn-t7tbm.cjs"),Ie=require("./PenAndPaper-DFXJJink.cjs"),Oe=require("./useUserOptionState-BgepsfED.cjs"),Te=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),He=["id"],Me=["xmlns","viewBox"],Re=["x","y","width","height"],Ue=["id"],qe=["stop-color"],We=["stop-color"],Xe=["id"],Ge=["stop-color"],je=["stop-color"],Ye=["stop-color"],Ke={key:1},Je=["x1","x2","y1","y2","stroke","stroke-width"],Qe=["x1","x2","y1","y2","stroke","stroke-width"],Ze={key:0},et=["x1","x2","y1","y2","stroke","stroke-width"],tt=["x1","x2","y1","y2","stroke","stroke-width"],lt=["x","y","font-size","fill","font-weight"],at=["text-anchor","font-size","fill","transform"],ot=["x1","y1","x2","y2","stroke","stroke-width"],nt={key:1},ut=["cx","cy","r","fill"],rt={key:0},st={key:0},ct=["d","stroke"],it=["text-anchor","x","y","fill"],dt=["cx","cy","r","fill"],vt={key:0},ht=["cx","cy","fill"],yt={key:1},mt=["d","fill","stroke"],ft={key:2},gt=["d","fill","stroke"],pt=["x","y","font-size","fill"],kt=["x","y","width","fill","onClick"],bt=["x","y","width","height","onMouseenter","onClick"],xt={key:4,"data-cy-zoom":"",class:"vue-ui-donut-evolution-dialog"},Bt=["x","y","width","height","fill"],Ct=["x1","y1","x2","y2","stroke"],_t=["x1","y2","x2","y1","stroke"],Et=["onKeypress","cx","cy","r"],Nt=["d","stroke"],wt=["cx","cy","r","fill"],St=["d","fill","stroke"],Lt={class:"vue-ui-donut-evolution-focus"},zt=["text-anchor","x","y","fill"],Vt=["cx","cy","r","fill"],At=["cx","cy","r","fill"],$t=["x","y","fill"],Dt=["x","y","font-size","fill"],Ft={key:5,class:"vue-data-ui-watermark"},Pt=["onClick"],It={key:0},Ot={key:1},Tt={key:9,ref:"source",dir:"auto"},Ht={key:0},Mt={key:1},Rt={__name:"vue-ui-donut-evolution",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(ge,{expose:pe,emit:W}){const y=ge,{vue_ui_donut_evolution:ke}=r.useConfig(),A=e.computed(()=>!!y.dataset&&y.dataset.length),i=e.ref({start:0,end:Math.max(...y.dataset.map(a=>a.values.length))});function X(){G()}const N=e.ref(null);async function G(){(t.value.style.chart.zoom.startIndex!==null||t.value.style.chart.zoom.endIndex!==null)&&N.value?(t.value.style.chart.zoom.startIndex!==null&&(await e.nextTick(),await e.nextTick(),N.value&&N.value.setStartValue(t.value.style.chart.zoom.startIndex)),t.value.style.chart.zoom.endIndex!==null&&(await e.nextTick(),await e.nextTick(),N.value&&N.value.setEndValue(be(t.value.style.chart.zoom.endIndex+1)))):(i.value={start:0,end:E.value},K.value+=1)}function be(a){const o=E.value;return a>o?o:a<0||t.value.style.chart.zoom.startIndex!==null&&a<t.value.style.chart.zoom.startIndex?t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex+1:1:a}e.onMounted(()=>{j()});function j(){r.objectIsEmpty(y.dataset)?r.error({componentName:"VueUiDonutEvolution",type:"dataset"}):y.dataset.length&&y.dataset.forEach((a,o)=>{r.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","values"]}).forEach(l=>{r.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:l,index:o})})}),G()}const _=e.ref(r.createUid()),m=e.ref([]),h=e.ref(null),P=e.ref(null),k=e.ref(!1),b=e.ref(null),I=e.ref(null),xe=e.ref(null),Y=e.ref(0),K=e.ref(0),J=e.ref(0),Q=e.ref(0),Z=e.ref(0),t=e.computed({get:()=>le(),set:a=>a}),{userOptionsVisible:O,setUserOptionsVisibility:ee,keepUserOptionState:te}=Oe.useUserOptionState({config:t.value});function le(){const a=fe.useNestedProp({userConfig:y.config,defaultConfig:ke});let o={};return a.theme?o={...fe.useNestedProp({userConfig:r.themes.vue_ui_donut_evolution[a.theme]||y.config,defaultConfig:a}),customPalette:r.themePalettes[a.theme]||r.palette}:o=a,y.config&&r.hasDeepProperty(y.config,"style.chart.zoom.startIndex")?o.style.chart.zoom.startIndex=y.config.style.chart.zoom.startIndex:o.style.chart.zoom.startIndex=null,y.config&&r.hasDeepProperty(y.config,"style.chart.zoom.endIndex")?o.style.chart.zoom.endIndex=y.config.style.chart.zoom.endIndex:o.style.chart.zoom.endIndex=null,o}e.watch(()=>y.config,a=>{t.value=le(),O.value=!t.value.showOnChartHover,j(),J.value+=1,Q.value+=1,Z.value+=1},{deep:!0}),e.watch(()=>y.dataset,a=>{X()},{deep:!0});const{isPrinting:ae,isImaging:oe,generatePdf:ne,generateImage:ue}=me.usePrinter({elementId:_.value,fileName:t.value.style.chart.title.text||"vue-ui-donut-evolution"}),Be=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Ce=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),$=e.ref({showTable:t.value.table.show}),u=e.computed(()=>({top:t.value.style.chart.layout.padding.top,right:t.value.style.chart.layout.padding.right,bottom:t.value.style.chart.layout.padding.bottom,left:t.value.style.chart.layout.padding.left})),s=e.computed(()=>{const a=t.value.style.chart.layout.height,o=t.value.style.chart.layout.width,l=a-u.value.top-u.value.bottom,c=o-u.value.left-u.value.right;return{absoluteHeight:a,absoluteWidth:o,centerX:u.value.left+c/2,centerY:u.value.top+l/2,height:l,width:c}}),C=e.computed(()=>(y.dataset.forEach((a,o)=>{[null,void 0].includes(a.name)&&r.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:"name",index:o}),[null,void 0].includes(a.values)&&r.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:"values",index:o})}),y.dataset.map((a,o)=>({...a,values:r.sanitizeArray(a.values),color:r.convertColorToHex(a.color)||Ce.value[o]||r.palette[o]||r.palette[o%r.palette.length],length:(a.values||[]).length,uid:r.createUid()})))),z=e.computed(()=>C.value.filter(a=>!m.value.includes(a.uid)).map(a=>({...a,values:a.values.filter((o,l)=>l>=i.value.start&&l<=i.value.end)}))),E=e.computed(()=>Math.max(...z.value.map(a=>a.length))),g=e.computed(()=>s.value.width/(i.value.end-i.value.start)),f=e.computed(()=>{const a=[];for(let n=0;n<i.value.end-i.value.start;n+=1){const v=z.value.map(B=>B.values[n]??null),d=v.filter(B=>[void 0,null].includes(B)).length===v.length,x=v.reduce((B,p)=>B+p,0),q=v.map(B=>B/x),L=u.value.left+g.value*n+g.value/2;a.push({index:n,percentages:q,subtotal:d||x<0?null:x,values:v,x:L})}const o=0,l=Math.max(...a.map(n=>n.subtotal)),c=a.length===1?l*2:l;return a.map((n,v)=>{const d=g.value/2*.7,x=d>s.value.width/16?s.value.width/16:d,q=h.value===n.index?s.value.width/16:x,L=a.length>4?d*2:d*2>g.value/2*.7?g.value/2*.7:d*2,B=s.value.absoluteHeight-u.value.bottom-s.value.height*n.subtotal/r.calculateNiceScale(o,c,t.value.style.chart.layout.grid.yAxis.dataLabels.steps).max;return{...n,y:B,radius:x,activeRadius:q,hoverRadius:L,donut:r.makeDonut({series:z.value.map((p,ye)=>({color:p.color,name:p.name,value:p.values[v]??0}))},n.x,B,x,x,1.99999,2,1,360,105.25,x/2),donutHover:r.makeDonut({series:z.value.map((p,ye)=>({color:p.color,name:p.name,value:p.values[v]??0}))},n.x,B,L,L,1.99999,2,1,360,105.25,L/2),donutFocus:r.makeDonut({series:z.value.map((p,ye)=>({color:p.color,name:p.name,value:p.values[v]??0}))},s.value.centerX,s.value.centerY,s.value.height/3.6,s.value.height/3.6,1.99999,2,1,360,105.25,s.value.height/6)}})});function D(a,o,l){return r.applyDataLabel(t.value.style.chart.layout.dataLabels.formatter,a,r.dataLabel({p:t.value.style.chart.layout.dataLabels.prefix,v:a,s:t.value.style.chart.layout.dataLabels.suffix,r:t.value.style.chart.layout.dataLabels.rounding}),{datapoint:o,index:l})}const T=e.computed(()=>({max:Math.max(...f.value.map(a=>a.subtotal)),min:0})),w=e.computed(()=>{const a=f.value.length===1?T.value.max*2:T.value.max;return r.calculateNiceScale(T.value.min,a,t.value.style.chart.layout.grid.yAxis.dataLabels.steps)});function _e(a){return a/w.value.max}const Ee=e.computed(()=>w.value.ticks.map(a=>({y:s.value.absoluteHeight-u.value.bottom-s.value.height*_e(a),value:a})));function re(a,o){return isNaN(a.value/r.sumByAttribute(o,"value"))?0:(a.value/r.sumByAttribute(o,"value")*100).toFixed(0)+"%"}function se(){k.value||(h.value=null,P.value=null)}function Ne(a){k.value||(h.value=a.index,P.value=a)}const H=e.ref(null);function M(a,o){a.subtotal&&(P.value=null,h.value=null,k.value=!0,b.value=a,[null,void 0].includes(o)||(H.value=o))}function ce(){b.value=null,k.value=!1,H.value=null}const ie=e.computed(()=>C.value.map((a,o)=>({name:a.name,value:a.values.slice(i.value.start,i.value.end).reduce((l,c)=>l+c,0),shape:"circle",uid:a.uid,color:a.color})).sort((a,o)=>o.value-a.value).map(a=>({...a,opacity:m.value.includes(a.uid)?.5:1,segregate:()=>R(a.uid),isSegregated:m.value.includes(a.uid)}))),de=e.computed(()=>f.value.map(a=>a.subtotal).reduce((a,o)=>a+o,0)),we=e.computed(()=>({cy:"donut-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function R(a){if(m.value.includes(a))m.value=m.value.filter(o=>o!==a),W("selectLegend",null);else{if(m.value.length===C.value.length-1)return;m.value.push(a),W("selectLegend",C.value.find(o=>o.uid===a))}b.value&&M(f.value.find((o,l)=>l===H.value))}const S=e.computed(()=>{const a=[""].concat(C.value.filter(n=>!m.value.includes(n.uid)).map(n=>({name:n.name,color:n.color}))).concat(["Σ"]);let o=[];for(let n=0;n<E.value;n+=1){const v=C.value.filter(d=>!m.value.includes(d.uid)).map(d=>d.values[n]??0).reduce((d,x)=>d+x,0);o.push([t.value.style.chart.layout.grid.xAxis.dataLabels.values[n]??"-"].concat(C.value.filter(d=>!m.value.includes(d.uid)).map(d=>({value:d.values[n]??0,percentage:d.values[n]?d.values[n]/v*100:0}))).concat([`${t.value.style.chart.layout.dataLabels.prefix}${Number(v.toFixed(t.value.table.td.roundingValue))}${t.value.style.chart.layout.dataLabels.suffix}`]))}const 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},c=[t.value.table.columnNames.period].concat(C.value.filter(n=>!m.value.includes(n.uid)).map(n=>n.name)).concat(t.value.table.columnNames.total);return{head:a,body:o,config:l,colNames:c}});function Se(){return C.value}function ve(){e.nextTick(()=>{const a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],o=[...S.value.head.map(v=>v.name??v)],l=[...S.value.body.map(v=>v.map(d=>d.value??d))],c=a.concat([o]).concat(l),n=r.createCsvContent(c);r.downloadCsv({csvContent:n,title:t.value.style.chart.title.text||"vue-ui-donut-evolution"})})}const V=e.ref(!1);function Le(a){V.value=a,Y.value+=1}function he(){$.value.showTable=!$.value.showTable}const F=e.ref(!1);function U(){F.value=!F.value}return pe({getData:Se,generatePdf:ne,generateCsv:ve,generateImage:ue,toggleTable:he,toggleAnnotator:U}),(a,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"donutEvolutionChart",ref:I,class:e.normalizeClass(`vue-ui-donut-evolution ${V.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),id:_.value,onMouseenter:o[4]||(o[4]=()=>e.unref(ee)(!0)),onMouseleave:o[5]||(o[5]=()=>e.unref(ee)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ie.PenAndPaper,{key:0,parent:I.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:F.value,onClose:U},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Be.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:xe,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,style:"width:100%;background:transparent;padding-bottom:24px",onMouseleave:se},[(e.openBlock(),e.createBlock(ze._sfc_main,{key:`title_${J.value}`,config:{title:{cy:"donut-evolution-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-evolution-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],32)):e.createCommentVNode("",!0),t.value.userOptions.show&&A.value&&(e.unref(te)||e.unref(O))?(e.openBlock(),e.createBlock(me.UserOptions,{ref:"details",key:`user_options_${Y.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(ae),isImaging:e.unref(oe),uid:_.value,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:V.value,titles:{...t.value.userOptions.buttonTitles},chartElement:I.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:F.value,onToggleFullscreen:Le,onGeneratePdf:e.unref(ne),onGenerateCsv:ve,onGenerateImage:e.unref(ue),onToggleTable:he,onToggleAnnotator:U,style:e.normalizeStyle({visibility:e.unref(te)?e.unref(O)?"visible":"hidden":"visible"})},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:c})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:c})),void 0,!0)]),key:"4"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:c})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:c})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),A.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":V.value,"vue-data-ui-fulscreen--off":!V.value}),viewBox:`0 0 ${s.value.absoluteWidth} ${s.value.absoluteHeight}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Pe._sfc_main),a.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:u.value.left,y:u.value.top,width:s.value.width,height:s.value.height,style:{pointerEvents:"none"}},[e.renderSlot(a.$slots,"chart-background",{},void 0,!0)],8,Re)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`hover_${_.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.setOpacity)(t.value.style.chart.backgroundColor,t.value.style.chart.layout.highlighter.opacity)},null,8,qe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.setOpacity)(t.value.style.chart.layout.highlighter.color,t.value.style.chart.layout.highlighter.opacity)},null,8,We)],8,Ue),e.createElementVNode("radialGradient",{id:`focus_${_.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.setOpacity)(e.unref(r.convertColorToHex)(t.value.style.chart.backgroundColor),0)},null,8,Ge),e.createElementVNode("stop",{offset:"77%","stop-color":e.unref(r.setOpacity)("#FFFFFF",30)},null,8,je),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.setOpacity)(e.unref(r.convertColorToHex)(t.value.style.chart.backgroundColor),0)},null,8,Ye)],8,Xe)]),t.value.style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",Ke,[e.createElementVNode("line",{x1:u.value.left,x2:u.value.left,y1:u.value.top,y2:u.value.top+s.value.height,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Je),e.createElementVNode("line",{x1:u.value.left,x2:s.value.absoluteWidth-u.value.right,y1:s.value.absoluteHeight-u.value.bottom,y2:s.value.absoluteHeight-u.value.bottom,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Qe),t.value.style.chart.layout.grid.showVerticalLines?(e.openBlock(),e.createElementBlock("g",Ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.end-i.value.start,(l,c)=>(e.openBlock(),e.createElementBlock("line",{x1:u.value.left+(c+1)*g.value,x2:u.value.left+(c+1)*g.value,y1:u.value.top,y2:s.value.absoluteHeight-u.value.bottom,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,et))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.layout.grid.yAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",{key:2,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":h.value!==null||k.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ee.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",null,[l.value>=w.value.min&&l.value<=w.value.max?(e.openBlock(),e.createElementBlock("line",{key:0,x1:u.value.left,x2:u.value.left-5,y1:l.y,y2:l.y,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,tt)):e.createCommentVNode("",!0),l.value>=w.value.min&&l.value<=w.value.max?(e.openBlock(),e.createElementBlock("text",{key:1,x:u.value.left-8+t.value.style.chart.layout.grid.yAxis.dataLabels.offsetX,y:l.y+t.value.style.chart.layout.grid.yAxis.dataLabels.fontSize/3,"font-size":t.value.style.chart.layout.grid.yAxis.dataLabels.fontSize,"text-anchor":"end",fill:t.value.style.chart.layout.grid.yAxis.dataLabels.color,"font-weight":t.value.style.chart.layout.grid.yAxis.dataLabels.bold?"bold":"normal"},e.toDisplayString(e.unref(r.canShowValue)(l.value)?e.unref(r.applyDataLabel)(t.value.style.chart.layout.dataLabels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.dataLabels.suffix,r:t.value.style.chart.layout.grid.yAxis.dataLabels.roundingValue}),{datapoint:l,seriesIndex:c}):""),9,lt)):e.createCommentVNode("",!0)]))),256))],2)):e.createCommentVNode("",!0),t.value.style.chart.layout.grid.xAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":k.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.end-i.value.start,(l,c)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.grid.xAxis.dataLabels.showOnlyFirstAndLast&&(c===0||c===E.value-1)||!t.value.style.chart.layout.grid.xAxis.dataLabels.showOnlyFirstAndLast?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":t.value.style.chart.layout.grid.xAxis.dataLabels.rotation>0?"start":t.value.style.chart.layout.grid.xAxis.dataLabels.rotation<0?"end":"middle","font-size":t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize,fill:t.value.style.chart.layout.grid.xAxis.dataLabels.color,transform:`translate(${u.value.left+g.value*c+g.value/2}, ${t.value.style.chart.layout.grid.xAxis.dataLabels.offsetY+s.value.absoluteHeight-u.value.bottom+t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize*2}), rotate(${t.value.style.chart.layout.grid.xAxis.dataLabels.rotation})`},e.toDisplayString(t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(c)+Number(i.value.start)]??""),9,at)):e.createCommentVNode("",!0)]))),256))],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.line.show&&c<f.value.length-1&&![l.subtotal,f.value[c+1].subtotal].includes(null)?(e.openBlock(),e.createElementBlock("line",{key:0,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":h.value!==null||k.value}),x1:l.x,y1:l.y,x2:f.value[c+1].x,y2:f.value[c+1].y,stroke:t.value.style.chart.layout.line.stroke,"stroke-width":t.value.style.chart.layout.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,10,ot)):e.createCommentVNode("",!0),l.subtotal!==null?(e.openBlock(),e.createElementBlock("g",nt,[l.subtotal?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x,cy:l.y,r:l.activeRadius,fill:t.value.style.chart.backgroundColor},null,8,ut)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":c!==h.value&&h.value!==null||k.value})},[l.subtotal?(e.openBlock(),e.createElementBlock("g",rt,[h.value!==null&&h.value===c?(e.openBlock(),e.createElementBlock("g",st,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donutHover,n=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("path",{d:e.unref(r.calcNutArrowPath)(n,{x:n.center.endX,y:n.center.endY},12,12,{x:l.x,y:l.y},!0,20),stroke:n.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,ct)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donutHover,(n,v)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("text",{"data-cy-hover-label":"","text-anchor":e.unref(r.calcMarkerOffsetX)(n,!0,0).anchor,x:e.unref(r.calcMarkerOffsetX)(n,!0,3).x,y:e.unref(r.calcMarkerOffsetY)(n),fill:t.value.style.chart.layout.grid.yAxis.dataLabels.color,"font-size":8,"font-weight":"bold"},e.toDisplayString(n.name)+": "+e.toDisplayString(re(n,l.donut))+" ("+e.toDisplayString(n.value===null?"-":D(n.value,n,v))+") ",9,it)]))),256)),e.createElementVNode("g",null,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:l.hoverRadius,fill:t.value.style.chart.backgroundColor},null,8,dt)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":c!==h.value&&h.value!==null||k.value})},[l.subtotal!==null?(e.openBlock(),e.createElementBlock("g",vt,[l.subtotal===0?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x,cy:l.y,r:3,fill:t.value.style.chart.color},null,8,ht)):h.value!==null&&h.value===c?(e.openBlock(),e.createElementBlock("g",yt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donutHover,(n,v)=>(e.openBlock(),e.createElementBlock("path",{d:n.arcSlice,fill:`${n.color}`,"stroke-width":1,stroke:t.value.style.chart.backgroundColor},null,8,mt))),256))])):(e.openBlock(),e.createElementBlock("g",ft,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donut,(n,v)=>(e.openBlock(),e.createElementBlock("path",{d:n.arcSlice,fill:`${n.color}`,"stroke-width":.5,stroke:t.value.style.chart.backgroundColor},null,8,gt))),256))]))])):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":c!==h.value&&h.value!==null||k.value})},[l.subtotal!==null&&t.value.style.chart.layout.dataLabels.show?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":"middle",x:l.x,y:h.value===l.index&&l.subtotal?l.y+t.value.style.chart.layout.dataLabels.fontSize/3:l.y-l.radius-t.value.style.chart.layout.dataLabels.fontSize+t.value.style.chart.layout.dataLabels.offsetY,"font-size":t.value.style.chart.layout.dataLabels.fontSize,"font-weight":"bold",fill:t.value.style.chart.layout.dataLabels.color},e.toDisplayString(D(l.subtotal,l,c)),9,pt)):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,c)=>(e.openBlock(),e.createElementBlock("rect",{x:u.value.left+c*g.value,y:s.value.absoluteHeight-u.value.bottom-10,width:g.value,height:10,fill:h.value===l.index?`url(#hover_${_.value})`:"transparent",onClick:n=>M(l,c),class:e.normalizeClass({"donut-hover":h.value===l.index&&l.subtotal})},null,10,kt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,c)=>(e.openBlock(),e.createElementBlock("rect",{"data-cy-trap":"",x:u.value.left+c*g.value,y:u.value.top,width:g.value,height:s.value.height,fill:"transparent",onMouseenter:n=>Ne(l),onMouseleave:se,onClick:n=>M(l,c),class:e.normalizeClass({"donut-hover":h.value===l.index&&l.subtotal})},null,42,bt))),256)),k.value?(e.openBlock(),e.createElementBlock("g",xt,[e.createElementVNode("rect",{rx:4,x:u.value.left,y:u.value.top,width:s.value.width,height:s.value.height,fill:t.value.style.chart.backgroundColor,style:{filter:"drop-shadow(0 12px 12px rgba(0,0,0,0.3))"}},null,8,Bt),e.createElementVNode("line",{"data-html2canvas-ignore":"",x1:s.value.absoluteWidth-u.value.right-15,y1:u.value.top+5,x2:s.value.absoluteWidth-u.value.right-4,y2:u.value.top+15.5,"stroke-linecap":"round",stroke:t.value.style.chart.color,"stroke-width":"1.5"},null,8,Ct),e.createElementVNode("line",{"data-html2canvas-ignore":"",x1:s.value.absoluteWidth-u.value.right-15,y2:u.value.top+5,x2:s.value.absoluteWidth-u.value.right-4,y1:u.value.top+15.5,"stroke-linecap":"round",stroke:t.value.style.chart.color,"stroke-width":"1.5"},null,8,_t),e.createElementVNode("circle",{"data-cy-close":"",onClick:ce,onKeypress:e.withKeys(ce,["enter"]),cx:s.value.absoluteWidth-u.value.right-s.value.width/40,cy:u.value.top+s.value.height/30,r:s.value.height/12,fill:"transparent",style:{cursor:"pointer"},tabindex:"0"},null,40,Et),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.donutFocus,l=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("path",{"data-cy-zoom-donut":"",d:e.unref(r.calcNutArrowPath)(l,{x:s.value.centerX,y:s.value.centerY},12,12,!1,!1,15),stroke:l.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none",class:"vue-ui-donut-evolution-focus"},null,8,Nt)]))),256)),e.createElementVNode("circle",{cx:u.value.left+s.value.width/2,cy:u.value.top+s.value.height/2,r:s.value.height/7,fill:t.value.style.chart.backgroundColor},null,8,wt),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.donutFocus,(l,c)=>(e.openBlock(),e.createElementBlock("path",{d:l.arcSlice,fill:`${l.color}`,"stroke-width":1,stroke:t.value.style.chart.backgroundColor,class:"vue-ui-donut-evolution-focus"},null,8,St))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.donutFocus,(l,c)=>(e.openBlock(),e.createElementBlock("g",Lt,[e.createElementVNode("text",{"text-anchor":e.unref(r.calcMarkerOffsetX)(l,!0,20).anchor,x:e.unref(r.calcMarkerOffsetX)(l,!0,10).x,y:e.unref(r.calcMarkerOffsetY)(l),fill:t.value.style.chart.layout.grid.yAxis.dataLabels.color,"font-size":10,"font-weight":"bold"},e.toDisplayString(l.name)+": "+e.toDisplayString(re(l,b.value.donutFocus))+" ("+e.toDisplayString(l.value===null?"-":D(l.value,l,c))+") ",9,zt)]))),256)),e.createElementVNode("circle",{cx:u.value.left+s.value.width/2,cy:u.value.top+s.value.height/2,r:s.value.height/3.8,fill:`url(#focus_${_.value})`},null,8,Vt),e.createElementVNode("circle",{cx:u.value.left+s.value.width/2,cy:u.value.top+s.value.height/2,r:s.value.height/7.7,fill:t.value.style.chart.backgroundColor},null,8,At),e.createElementVNode("text",{"text-anchor":"middle",x:u.value.left+s.value.width/2,y:u.value.top+s.value.height/2+14/3,"font-size":14,"font-weight":"bold",fill:t.value.style.chart.layout.dataLabels.color,class:"vue-ui-donut-evolution-focus"},e.toDisplayString(D(b.value.subtotal,b.value,null)),9,$t),t.value.style.chart.layout.grid.xAxis.dataLabels.values[b.value.index]?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.value.left+6,y:u.value.top+t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize*2,"font-size":t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize*1.6,fill:t.value.style.chart.layout.dataLabels.color},e.toDisplayString(t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(b.value.index)+Number(i.value.start)]),9,Dt)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:s.value},void 0,!0)],14,Me)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ft,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(ae)||e.unref(oe)})),void 0,!0)])):e.createCommentVNode("",!0),A.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($e.default,{key:6,config:{type:"donutEvolution",style:{backgroundColor:t.value.style.chart.backgroundColor,donutEvolution:{axis:{color:"#CCCCCC"},donuts:{color:"#CCCCCC"}}}}},null,8,["config"])),E.value>1&&t.value.style.chart.zoom.show?(e.openBlock(),e.createBlock(De.Slicer,{ref_key:"slicerComponent",ref:N,key:`slicer_${K.value}`,background:t.value.style.chart.zoom.color,borderColor:t.value.style.chart.backgroundColor,fontSize:t.value.style.chart.zoom.fontSize,useResetSlot:t.value.style.chart.zoom.useResetSlot,labelLeft:t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(i.value.start)]||"",labelRight:t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(i.value.end)-1]||"",textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,max:E.value,min:0,valueStart:i.value.start,valueEnd:i.value.end,start:i.value.start,"onUpdate:start":o[0]||(o[0]=l=>i.value.start=l),end:i.value.end,"onUpdate:end":o[1]||(o[1]=l=>i.value.end=l),refreshStartPoint:t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex:0,refreshEndPoint:t.value.style.chart.zoom.endIndex!==null?t.value.style.chart.zoom.endIndex+1:E.value,enableRangeHandles:t.value.style.chart.zoom.enableRangeHandles,enableSelectionDrag:t.value.style.chart.zoom.enableSelectionDrag,onReset:X},{"reset-action":e.withCtx(({reset:l})=>[e.renderSlot(a.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:l})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end","refreshStartPoint","refreshEndPoint","enableRangeHandles","enableSelectionDrag"])):e.createCommentVNode("",!0),t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Ae.Legend,{key:`legend_${Z.value}`,legendSet:ie.value,config:we.value,onClickMarker:o[2]||(o[2]=({legend:l})=>R(l.uid))},{item:e.withCtx(({legend:l,index:c})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:n=>R(l.uid),style:e.normalizeStyle(`opacity:${m.value.includes(l.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.dataLabels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l,seriesIndex:c}))+" ",1),m.value.includes(l.uid)?(e.openBlock(),e.createElementBlock("span",Ot," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",It," ("+e.toDisplayString(isNaN(l.value/de.value)?"-":e.unref(r.dataLabel)({v:l.value/de.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,Pt)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"legend",{legend:ie.value},void 0,!0),a.$slots.source?(e.openBlock(),e.createElementBlock("div",Tt,[e.renderSlot(a.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),A.value?(e.openBlock(),e.createBlock(Fe.default,{key:10,hideDetails:"",config:{open:$.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(Ve.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:o[3]||(o[3]=l=>$.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l.name??l),1)]),td:e.withCtx(({td:l})=>[l.value===null?(e.openBlock(),e.createElementBlock("span",Ht,"-")):(e.openBlock(),e.createElementBlock("b",Mt,e.toDisplayString(isNaN(l.value)?"":t.value.style.chart.layout.dataLabels.prefix)+e.toDisplayString(!isNaN(l.value)&&l.value!==null?Number(l.value.toFixed(t.value.table.td.roundingValue)).toLocaleString():l)+e.toDisplayString(isNaN(l.value)?"":t.value.style.chart.layout.dataLabels.suffix),1)),e.createElementVNode("span",null,e.toDisplayString(l.percentage&&!isNaN(l.percentage)?`(${Number(l.percentage.toFixed(t.value.table.td.roundingPercentage)).toLocaleString()}%)`:""),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,He))}},Ut=Te._export_sfc(Rt,[["__scopeId","data-v-bfca0728"]]);exports.default=Ut;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as p, ref as b, onMounted as nt, watch as He, openBlock as a, createElementBlock as o, normalizeClass as P, normalizeStyle as q, unref as c, createBlock as O, createCommentVNode as v, createSlots as rt, withCtx as F, renderSlot as S, normalizeProps as J, guardReactiveProps as Q, createVNode as it, createElementVNode as d, Fragment as k, renderList as _, toDisplayString as m, withKeys as ct, createTextVNode as Me, nextTick as X } from "vue";
|
|
2
|
-
import { u as vt, o as dt, e as Z, g as ht, c as Re, t as yt, a as ft, p as ee, C as Ue, b as gt, J as bt, d as de, D as We, m as he, X as mt, s as G, E as xt, i as ye, f as te, j as Xe, k as le, n as Ge, K as je, q as pt, r as kt } from "./index-
|
|
3
|
-
import { _ as _t } from "./Title-
|
|
4
|
-
import { u as Ct, U as wt } from "./usePrinter-
|
|
5
|
-
import { D as zt } from "./DataTable-
|
|
6
|
-
import { L as Lt } from "./Legend-
|
|
7
|
-
import St from "./vue-ui-skeleton-
|
|
8
|
-
import { S as $t } from "./Slicer-
|
|
9
|
-
import At from "./vue-ui-accordion
|
|
10
|
-
import { u as Be } from "./useNestedProp-
|
|
11
|
-
import { _ as Nt } from "./PackageVersion-
|
|
12
|
-
import { P as It } from "./PenAndPaper-
|
|
2
|
+
import { u as vt, o as dt, e as Z, g as ht, c as Re, t as yt, a as ft, p as ee, C as Ue, b as gt, J as bt, d as de, D as We, m as he, X as mt, s as G, E as xt, i as ye, f as te, j as Xe, k as le, n as Ge, K as je, q as pt, r as kt } from "./index-B8Eaq54E.js";
|
|
3
|
+
import { _ as _t } from "./Title-XYNHfYwN.js";
|
|
4
|
+
import { u as Ct, U as wt } from "./usePrinter-D83W2gfG.js";
|
|
5
|
+
import { D as zt } from "./DataTable-DtRXoetj.js";
|
|
6
|
+
import { L as Lt } from "./Legend-RnRqBxiV.js";
|
|
7
|
+
import St from "./vue-ui-skeleton-DpadzgbS.js";
|
|
8
|
+
import { S as $t } from "./Slicer-GQf9ZyPj.js";
|
|
9
|
+
import At from "./vue-ui-accordion--5td7b94.js";
|
|
10
|
+
import { u as Be } from "./useNestedProp-Ka0R_Yqa.js";
|
|
11
|
+
import { _ as Nt } from "./PackageVersion-CgJdp_Ki.js";
|
|
12
|
+
import { P as It } from "./PenAndPaper-BTLEk55u.js";
|
|
13
13
|
import { u as Ft } from "./useUserOptionState-BIvW1Kz7.js";
|
|
14
14
|
import { _ as Pt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
15
15
|
const Dt = ["id"], Ot = ["xmlns", "viewBox"], Et = ["x", "y", "width", "height"], Tt = ["id"], Vt = ["stop-color"], Ht = ["stop-color"], Mt = ["id"], Rt = ["stop-color"], Ut = ["stop-color"], Wt = ["stop-color"], Xt = { key: 1 }, Gt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], jt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Bt = { key: 0 }, Yt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Kt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], qt = ["x", "y", "font-size", "fill", "font-weight"], Jt = ["text-anchor", "font-size", "fill", "transform"], Qt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Zt = { key: 1 }, el = ["cx", "cy", "r", "fill"], tl = { key: 0 }, ll = { key: 0 }, al = ["d", "stroke"], ol = ["text-anchor", "x", "y", "fill"], ul = ["cx", "cy", "r", "fill"], sl = { key: 0 }, nl = ["cx", "cy", "fill"], rl = { key: 1 }, il = ["d", "fill", "stroke"], cl = { key: 2 }, vl = ["d", "fill", "stroke"], dl = ["x", "y", "font-size", "fill"], hl = ["x", "y", "width", "fill", "onClick"], yl = ["x", "y", "width", "height", "onMouseenter", "onClick"], fl = {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as m, ref as v, watch as ye, onMounted as fe, onBeforeUnmount as Oe, openBlock as o, createElementBlock as r, normalizeClass as be, normalizeStyle as F, unref as u, createBlock as L, createCommentVNode as h, createSlots as Ge, withCtx as k, renderSlot as _, normalizeProps as U, guardReactiveProps as R, createVNode as Me, Fragment as C, renderList as $, createElementVNode as i, toDisplayString as A, createTextVNode as ge, nextTick as De } from "vue";
|
|
2
|
-
import { u as Ie, c as pe, t as Fe, o as Ve, e as me, g as Ee, v as _e, D as He, f as z, X as ke, i as B, l as xe, h as we, q as We, r as Ue } from "./index-
|
|
2
|
+
import { u as Ie, c as pe, t as Fe, o as Ve, e as me, g as Ee, v as _e, D as He, f as z, X as ke, i as B, l as xe, h as we, q as We, r as Ue } from "./index-B8Eaq54E.js";
|
|
3
3
|
import { t as Re, u as Be } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { _ as je } from "./Title-
|
|
5
|
-
import { u as qe, U as Ye } from "./usePrinter-
|
|
6
|
-
import { D as Ze } from "./DataTable-
|
|
7
|
-
import Je from "./vue-ui-skeleton-
|
|
8
|
-
import { L as Ke } from "./Legend-
|
|
9
|
-
import Qe from "./vue-ui-accordion
|
|
10
|
-
import { u as Ce } from "./useNestedProp-
|
|
11
|
-
import { _ as et } from "./PackageVersion-
|
|
12
|
-
import { P as tt } from "./PenAndPaper-
|
|
4
|
+
import { _ as je } from "./Title-XYNHfYwN.js";
|
|
5
|
+
import { u as qe, U as Ye } from "./usePrinter-D83W2gfG.js";
|
|
6
|
+
import { D as Ze } from "./DataTable-DtRXoetj.js";
|
|
7
|
+
import Je from "./vue-ui-skeleton-DpadzgbS.js";
|
|
8
|
+
import { L as Ke } from "./Legend-RnRqBxiV.js";
|
|
9
|
+
import Qe from "./vue-ui-accordion--5td7b94.js";
|
|
10
|
+
import { u as Ce } from "./useNestedProp-Ka0R_Yqa.js";
|
|
11
|
+
import { _ as et } from "./PackageVersion-CgJdp_Ki.js";
|
|
12
|
+
import { P as tt } from "./PenAndPaper-BTLEk55u.js";
|
|
13
13
|
import { u as lt } from "./useUserOptionState-BIvW1Kz7.js";
|
|
14
14
|
import { _ as at } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
15
15
|
const st = ["id"], ot = ["xmlns", "viewBox"], rt = ["x", "y", "width", "height"], nt = { key: 1 }, ut = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], it = { key: 2 }, ct = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], dt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], vt = { key: 3 }, ht = ["x", "y", "font-size", "fill", "font-weight"], yt = ["x", "y", "font-size", "fill"], ft = { key: 4 }, bt = ["x", "y", "font-size", "fill", "font-weight"], gt = ["id"], pt = ["stop-color"], mt = ["stop-color"], _t = ["stop-color"], kt = ["id"], xt = ["stop-color"], wt = ["stop-color"], Ct = ["stop-color"], $t = ["id"], Lt = ["stop-color"], At = ["stop-color"], zt = ["id"], St = ["stop-color"], Xt = ["stop-color"], Nt = { key: 0 }, Tt = ["d", "fill"], Pt = { key: 1 }, Ot = ["x", "y", "height", "width", "fill"], Gt = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Mt = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Dt = { key: 2 }, It = ["x", "y", "fill", "font-size"], Ft = { key: 3 }, Vt = ["x", "y", "fill", "font-size"], Et = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-CH3YkGpv.cjs"),K=require("./useResponsive-BJ7DTGpm.cjs"),ce=require("./Title-m5N0oN0G.cjs"),Q=require("./usePrinter-A1_US3Dh.cjs"),de=require("./DataTable-RY8EUwF3.cjs"),ve=require("./vue-ui-skeleton-DwmP0u2B.cjs"),he=require("./Legend-CZrlsh2W.cjs"),ye=require("./vue-ui-accordion-_LFrGkGx.cjs"),ee=require("./useNestedProp-2TBYsJKg.cjs"),fe=require("./PackageVersion-C1zaH_aJ.cjs"),me=require("./PenAndPaper-Bv8oV7l0.cjs"),be=require("./useUserOptionState-BgepsfED.cjs"),pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ge=["id"],ke=["xmlns","viewBox"],xe=["x","y","width","height"],_e={key:1},Ce=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],we={key:2},Be=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Ne=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Ee={key:3},$e=["x","y","font-size","fill","font-weight"],Le=["x","y","font-size","fill"],Se={key:4},Ve=["x","y","font-size","fill","font-weight"],ze=["id"],Ae=["stop-color"],Pe=["stop-color"],Te=["stop-color"],Xe=["id"],De=["stop-color"],Oe=["stop-color"],Fe=["stop-color"],Me=["id"],Ge=["stop-color"],Ie=["stop-color"],qe=["id"],He=["stop-color"],Ue=["stop-color"],Re={key:0},We=["d","fill"],je={key:1},Ye=["x","y","height","width","fill"],Ze=["cx","cy","r","fill","stroke","stroke-width"],Je=["cx","cy","r","fill","stroke","stroke-width"],Ke={key:2},Qe=["x","y","fill","font-size"],et={key:3},tt=["x","y","fill","font-size"],lt={key:5,class:"vue-data-ui-watermark"},at=["xmlns","height","width"],ot=["fill"],rt=["innerHTML"],st={__name:"vue-ui-dumbbell",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(te,{expose:le,emit:ut}){const y=te,{vue_ui_dumbbell:ae}=s.useConfig(),b=e.computed({get(){return!!y.dataset&&y.dataset.length},set(a){return a}}),d=e.ref(s.createUid()),V=e.ref(0),p=e.ref(null),z=e.ref(null),A=e.ref(null),P=e.ref(null),T=e.ref(null),X=e.ref(0),D=e.ref(0),O=e.ref(0),t=e.computed({get:()=>G(),set:a=>a}),{userOptionsVisible:E,setUserOptionsVisibility:F,keepUserOptionState:M}=be.useUserOptionState({config:t.value});function G(){const a=ee.useNestedProp({userConfig:y.config,defaultConfig:ae});return a.theme?{...ee.useNestedProp({userConfig:s.themes.vue_ui_dumbbell[a.theme]||y.config,defaultConfig:a})}:a}e.watch(()=>y.config,a=>{t.value=G(),E.value=!t.value.showOnChartHover,I(),X.value+=1,D.value+=1,O.value+=1,c.value=t.value.style.chart.rowHeight,g.value=t.value.style.chart.width},{deep:!0}),e.watch(()=>y.dataset,a=>{j()},{deep:!0});const x=e.ref(null);e.onMounted(()=>{I()});function I(){if(s.objectIsEmpty(y.dataset)?s.error({componentName:"VueUiDumbbell",type:"dataset"}):y.dataset.forEach((a,n)=>{s.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","start","end"]}).forEach(l=>{b.value=!1,s.error({componentName:"VueUiDumbbell",type:"datasetSerieAttribute",property:l,index:n})})}),t.value.responsive){const a=K.throttle(()=>{const{width:n,height:l}=K.useResponsive({chart:p.value,title:t.value.style.chart.title.text?z.value:null,legend:t.value.style.chart.legend.show?A.value:null,source:P.value,noTitle:T.value});g.value=n,c.value=l/y.dataset.length,v.value=C()});x.value=new ResizeObserver(a),x.value.observe(p.value.parentNode)}}e.onBeforeUnmount(()=>{x.value&&x.value.disconnect()});const{isPrinting:q,isImaging:H,generatePdf:U,generateImage:R}=Q.usePrinter({elementId:`dumbbell_${d.value}`,fileName:t.value.style.chart.title.text||"vue-ui-dumbbell"}),oe=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),_=e.ref({showTable:t.value.table.show}),f=e.computed(()=>y.dataset.map((a,n)=>({...a,start:s.checkNaN(a.start),end:s.checkNaN(a.end),id:s.createUid()}))),$=e.computed(()=>({max:Math.max(...f.value.flatMap(a=>[a.start,a.end])),min:Math.min(...f.value.flatMap(a=>[a.start,a.end]))})),i=e.computed(()=>s.calculateNiceScale($.value.min<0?$.value.min:0,$.value.max,t.value.style.chart.grid.scaleSteps)),c=e.ref(t.value.style.chart.rowHeight),g=e.ref(t.value.style.chart.width),o=e.computed(()=>{const a=c.value,n=t.value.style.chart.padding.left+t.value.style.chart.padding.right+g.value,l=t.value.style.chart.padding.top+t.value.style.chart.padding.bottom+a*y.dataset.length,r=i.value.ticks.length*(g.value/i.value.ticks.length);return{left:t.value.style.chart.padding.left,right:n-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,bottom:l-t.value.style.chart.padding.bottom,width:g.value,height:a*y.dataset.length,rowHeight:a,absoluteHeight:l,absoluteWidth:n,widthPlotReference:r}});function C(){return f.value.map((a,n)=>{const l=o.value.left+(a.start+Math.abs(i.value.min))/(i.value.max+Math.abs(i.value.min))*o.value.widthPlotReference,r=o.value.left+(a.end+Math.abs(i.value.min))/(i.value.max+Math.abs(i.value.min))*o.value.widthPlotReference,u=l+(r-l)/2;return{...a,startX:l,endX:r,centerX:u,y:o.value.top+n*c.value+c.value/2,endVal:a.start}})}const v=e.ref([]),W=e.ref(null),re=e.computed(()=>f.value.map(a=>a.end).reduce((a,n)=>a+n,0));e.onMounted(()=>{j()});function j(){v.value=C();let a=v.value.map(l=>l.start).reduce((l,r)=>l+r,0);function n(){const l=f.value.map(r=>r.end-r.start);a>=re.value?(cancelAnimationFrame(W.value),v.value=C()):(v.value=v.value.map((r,u)=>{r.endVal+=l[u]*(t.value.animationSpeed/100);const h=o.value.left+(r.start+Math.abs(i.value.min))/(i.value.max+Math.abs(i.value.min))*o.value.widthPlotReference,N=o.value.left+(r.endVal+Math.abs(i.value.min))/(i.value.max+Math.abs(i.value.min))*o.value.widthPlotReference,S=h+(N-h)/2;return{...r,startX:h,endX:N,centerX:S,y:o.value.top+u*c.value+c.value/2,endVal:r.endVal}}),a=v.value.map(r=>r.endVal).reduce((r,u)=>r+u,0),W.value=requestAnimationFrame(n))}t.value.useAnimation?n():v.value=C()}const Y=e.computed(()=>[{name:t.value.style.chart.legend.labelStart,color:t.value.style.chart.plots.gradient.show?`url(#start_grad_${d.value})`:t.value.style.chart.plots.startColor},{name:t.value.style.chart.legend.labelEnd,color:t.value.style.chart.plots.gradient.show?`url(#end_grad_${d.value})`:t.value.style.chart.plots.endColor}]),se=e.computed(()=>({cy:"donut-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,paddingTop:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),m=e.computed(()=>{const a=v.value.map(l=>({name:l.name})),n=v.value.map(l=>({start:l.start,end:l.end}));return{head:a,body:n}}),w=e.computed(()=>{const a=[t.value.table.columnNames.series,t.value.table.columnNames.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],n=m.value.head.map((u,h)=>{const N=s.dataLabel({p:t.value.style.chart.labels.prefix,v:m.value.body[h].start,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),S=s.dataLabel({p:t.value.style.chart.labels.prefix,v:m.value.body[h].end,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),ie=s.dataLabel({v:100*(m.value.body[h].end/m.value.body[h].start-1),s:"%",r:t.value.table.td.roundingPercentage});return[{name:u.name},N,S,ie]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],head:a,body:n,config:l}});function Z(){e.nextTick(()=>{const a=m.value.head.map((r,u)=>[[r.name],[m.value.body[u].start],[m.value.body[u].end]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.start],[t.value.table.columnNames.end]]].concat(a),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-dumbbell"})})}const k=e.ref(!1);function ne(a){k.value=a,V.value+=1}function ue(){return v.value}function J(){_.value.showTable=!_.value.showTable}const B=e.ref(!1);function L(){B.value=!B.value}return le({getData:ue,generatePdf:U,generateCsv:Z,generateImage:R,toggleTable:J,toggleAnnotator:L}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dumbbellChart",ref:p,class:e.normalizeClass(`vue-ui-dumbbell ${k.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`dumbbell_${d.value}`,onMouseenter:n[1]||(n[1]=()=>e.unref(F)(!0)),onMouseleave:n[2]||(n[2]=()=>e.unref(F)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(me.PenAndPaper,{key:0,parent:p.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:L},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),oe.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:T,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:z,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ce._sfc_main,{key:`title_${X.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value&&(e.unref(M)||e.unref(E))?(e.openBlock(),e.createBlock(Q.UserOptions,{ref:"details",key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(q),isImaging:e.unref(H),uid:d.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:k.value,titles:{...t.value.userOptions.buttonTitles},chartElement:p.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:ne,onGeneratePdf:e.unref(U),onGenerateCsv:Z,onGenerateImage:e.unref(R),onToggleTable:J,onToggleAnnotator:L,style:e.normalizeStyle({visibility:e.unref(M)?e.unref(E)?"visible":"hidden":"visible"})},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"4"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:r})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value}),viewBox:`0 0 ${o.value.absoluteWidth<=0?10:o.value.absoluteWidth} ${o.value.absoluteHeight<=0?10:o.value.absoluteHeight}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(fe._sfc_main),a.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:o.value.left,y:o.value.top,width:o.value.width,height:o.value.height,style:{pointerEvents:"none"}},[e.renderSlot(a.$slots,"chart-background",{},void 0,!0)],8,xe)):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",_e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.ticks,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.value.left+r*o.value.width/(i.value.ticks.length-1),x2:o.value.left+r*o.value.width/(i.value.ticks.length-1),y1:o.value.top,y2:o.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray},null,8,Ce))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",we,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.value.left,x2:o.value.right,y1:o.value.top+r*c.value,y2:o.value.top+r*c.value,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,Be))),256)),e.createElementVNode("line",{x1:o.value.left,x2:o.value.right,y1:o.value.bottom,y2:o.value.bottom,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,Ne)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(),e.createElementBlock("g",Ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.value.top+r*c.value+(t.value.style.chart.labels.yAxisLabels.showProgression?c.value/3:c.value/2)+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"font-weight":t.value.style.chart.labels.yAxisLabels.bold?"bold":"normal","text-anchor":"end"},e.toDisplayString(l.name),9,$e))),256)),t.value.style.chart.labels.yAxisLabels.showProgression?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(f.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.value.top+r*c.value+c.value/1.3+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"text-anchor":"end"},e.toDisplayString(e.unref(s.dataLabel)({v:100*(l.end/l.start-1),s:"%",r:t.value.style.chart.labels.yAxisLabels.rounding})),9,Le))),256)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(),e.createElementBlock("g",Se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.ticks,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left+r*(o.value.width/(i.value.ticks.length-1)),y:o.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"font-weight":t.value.style.chart.labels.xAxisLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.labels.formatter,l,e.unref(s.dataLabel)({p:t.value.style.chart.labels.prefix,v:l,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.xAxisLabels.rounding}),{datapoint:l,seriesIndex:r})),9,Ve))),256))])):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`start_grad_${d.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.startColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,Ae),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.startColor,.1)},null,8,Pe),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Te)],8,ze),e.createElementVNode("radialGradient",{id:`end_grad_${d.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.endColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,De),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.endColor,.1)},null,8,Oe),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Fe)],8,Xe)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`grad_positive_${d.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.startColor},null,8,Ge),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Ie)],8,Me),e.createElementVNode("linearGradient",{id:`grad_negative_${d.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.endColor},null,8,He),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Ue)],8,qe)]),t.value.style.chart.plots.link.type==="curved"?(e.openBlock(),e.createElementBlock("g",Re,[e.createElementVNode("path",{d:`M
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-KJL8ra_6.cjs"),K=require("./useResponsive-BJ7DTGpm.cjs"),ce=require("./Title-D-6pIV0l.cjs"),Q=require("./usePrinter-pDOF3CfL.cjs"),de=require("./DataTable-wN-jvOfe.cjs"),ve=require("./vue-ui-skeleton-D_YCUi1y.cjs"),he=require("./Legend-DqGE1lkA.cjs"),ye=require("./vue-ui-accordion-4-dyMgJA.cjs"),ee=require("./useNestedProp-Bu958azG.cjs"),fe=require("./PackageVersion-Dn-t7tbm.cjs"),me=require("./PenAndPaper-DFXJJink.cjs"),be=require("./useUserOptionState-BgepsfED.cjs"),pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ge=["id"],ke=["xmlns","viewBox"],xe=["x","y","width","height"],_e={key:1},Ce=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],we={key:2},Be=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Ne=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Ee={key:3},$e=["x","y","font-size","fill","font-weight"],Le=["x","y","font-size","fill"],Se={key:4},Ve=["x","y","font-size","fill","font-weight"],ze=["id"],Ae=["stop-color"],Pe=["stop-color"],Te=["stop-color"],Xe=["id"],De=["stop-color"],Oe=["stop-color"],Fe=["stop-color"],Me=["id"],Ge=["stop-color"],Ie=["stop-color"],qe=["id"],He=["stop-color"],Ue=["stop-color"],Re={key:0},We=["d","fill"],je={key:1},Ye=["x","y","height","width","fill"],Ze=["cx","cy","r","fill","stroke","stroke-width"],Je=["cx","cy","r","fill","stroke","stroke-width"],Ke={key:2},Qe=["x","y","fill","font-size"],et={key:3},tt=["x","y","fill","font-size"],lt={key:5,class:"vue-data-ui-watermark"},at=["xmlns","height","width"],ot=["fill"],rt=["innerHTML"],st={__name:"vue-ui-dumbbell",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(te,{expose:le,emit:ut}){const y=te,{vue_ui_dumbbell:ae}=s.useConfig(),b=e.computed({get(){return!!y.dataset&&y.dataset.length},set(a){return a}}),d=e.ref(s.createUid()),V=e.ref(0),p=e.ref(null),z=e.ref(null),A=e.ref(null),P=e.ref(null),T=e.ref(null),X=e.ref(0),D=e.ref(0),O=e.ref(0),t=e.computed({get:()=>G(),set:a=>a}),{userOptionsVisible:E,setUserOptionsVisibility:F,keepUserOptionState:M}=be.useUserOptionState({config:t.value});function G(){const a=ee.useNestedProp({userConfig:y.config,defaultConfig:ae});return a.theme?{...ee.useNestedProp({userConfig:s.themes.vue_ui_dumbbell[a.theme]||y.config,defaultConfig:a})}:a}e.watch(()=>y.config,a=>{t.value=G(),E.value=!t.value.showOnChartHover,I(),X.value+=1,D.value+=1,O.value+=1,c.value=t.value.style.chart.rowHeight,g.value=t.value.style.chart.width},{deep:!0}),e.watch(()=>y.dataset,a=>{j()},{deep:!0});const x=e.ref(null);e.onMounted(()=>{I()});function I(){if(s.objectIsEmpty(y.dataset)?s.error({componentName:"VueUiDumbbell",type:"dataset"}):y.dataset.forEach((a,n)=>{s.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","start","end"]}).forEach(l=>{b.value=!1,s.error({componentName:"VueUiDumbbell",type:"datasetSerieAttribute",property:l,index:n})})}),t.value.responsive){const a=K.throttle(()=>{const{width:n,height:l}=K.useResponsive({chart:p.value,title:t.value.style.chart.title.text?z.value:null,legend:t.value.style.chart.legend.show?A.value:null,source:P.value,noTitle:T.value});g.value=n,c.value=l/y.dataset.length,v.value=C()});x.value=new ResizeObserver(a),x.value.observe(p.value.parentNode)}}e.onBeforeUnmount(()=>{x.value&&x.value.disconnect()});const{isPrinting:q,isImaging:H,generatePdf:U,generateImage:R}=Q.usePrinter({elementId:`dumbbell_${d.value}`,fileName:t.value.style.chart.title.text||"vue-ui-dumbbell"}),oe=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),_=e.ref({showTable:t.value.table.show}),f=e.computed(()=>y.dataset.map((a,n)=>({...a,start:s.checkNaN(a.start),end:s.checkNaN(a.end),id:s.createUid()}))),$=e.computed(()=>({max:Math.max(...f.value.flatMap(a=>[a.start,a.end])),min:Math.min(...f.value.flatMap(a=>[a.start,a.end]))})),i=e.computed(()=>s.calculateNiceScale($.value.min<0?$.value.min:0,$.value.max,t.value.style.chart.grid.scaleSteps)),c=e.ref(t.value.style.chart.rowHeight),g=e.ref(t.value.style.chart.width),o=e.computed(()=>{const a=c.value,n=t.value.style.chart.padding.left+t.value.style.chart.padding.right+g.value,l=t.value.style.chart.padding.top+t.value.style.chart.padding.bottom+a*y.dataset.length,r=i.value.ticks.length*(g.value/i.value.ticks.length);return{left:t.value.style.chart.padding.left,right:n-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,bottom:l-t.value.style.chart.padding.bottom,width:g.value,height:a*y.dataset.length,rowHeight:a,absoluteHeight:l,absoluteWidth:n,widthPlotReference:r}});function C(){return f.value.map((a,n)=>{const l=o.value.left+(a.start+Math.abs(i.value.min))/(i.value.max+Math.abs(i.value.min))*o.value.widthPlotReference,r=o.value.left+(a.end+Math.abs(i.value.min))/(i.value.max+Math.abs(i.value.min))*o.value.widthPlotReference,u=l+(r-l)/2;return{...a,startX:l,endX:r,centerX:u,y:o.value.top+n*c.value+c.value/2,endVal:a.start}})}const v=e.ref([]),W=e.ref(null),re=e.computed(()=>f.value.map(a=>a.end).reduce((a,n)=>a+n,0));e.onMounted(()=>{j()});function j(){v.value=C();let a=v.value.map(l=>l.start).reduce((l,r)=>l+r,0);function n(){const l=f.value.map(r=>r.end-r.start);a>=re.value?(cancelAnimationFrame(W.value),v.value=C()):(v.value=v.value.map((r,u)=>{r.endVal+=l[u]*(t.value.animationSpeed/100);const h=o.value.left+(r.start+Math.abs(i.value.min))/(i.value.max+Math.abs(i.value.min))*o.value.widthPlotReference,N=o.value.left+(r.endVal+Math.abs(i.value.min))/(i.value.max+Math.abs(i.value.min))*o.value.widthPlotReference,S=h+(N-h)/2;return{...r,startX:h,endX:N,centerX:S,y:o.value.top+u*c.value+c.value/2,endVal:r.endVal}}),a=v.value.map(r=>r.endVal).reduce((r,u)=>r+u,0),W.value=requestAnimationFrame(n))}t.value.useAnimation?n():v.value=C()}const Y=e.computed(()=>[{name:t.value.style.chart.legend.labelStart,color:t.value.style.chart.plots.gradient.show?`url(#start_grad_${d.value})`:t.value.style.chart.plots.startColor},{name:t.value.style.chart.legend.labelEnd,color:t.value.style.chart.plots.gradient.show?`url(#end_grad_${d.value})`:t.value.style.chart.plots.endColor}]),se=e.computed(()=>({cy:"donut-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,paddingTop:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),m=e.computed(()=>{const a=v.value.map(l=>({name:l.name})),n=v.value.map(l=>({start:l.start,end:l.end}));return{head:a,body:n}}),w=e.computed(()=>{const a=[t.value.table.columnNames.series,t.value.table.columnNames.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],n=m.value.head.map((u,h)=>{const N=s.dataLabel({p:t.value.style.chart.labels.prefix,v:m.value.body[h].start,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),S=s.dataLabel({p:t.value.style.chart.labels.prefix,v:m.value.body[h].end,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),ie=s.dataLabel({v:100*(m.value.body[h].end/m.value.body[h].start-1),s:"%",r:t.value.table.td.roundingPercentage});return[{name:u.name},N,S,ie]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],head:a,body:n,config:l}});function Z(){e.nextTick(()=>{const a=m.value.head.map((r,u)=>[[r.name],[m.value.body[u].start],[m.value.body[u].end]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.start],[t.value.table.columnNames.end]]].concat(a),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-dumbbell"})})}const k=e.ref(!1);function ne(a){k.value=a,V.value+=1}function ue(){return v.value}function J(){_.value.showTable=!_.value.showTable}const B=e.ref(!1);function L(){B.value=!B.value}return le({getData:ue,generatePdf:U,generateCsv:Z,generateImage:R,toggleTable:J,toggleAnnotator:L}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dumbbellChart",ref:p,class:e.normalizeClass(`vue-ui-dumbbell ${k.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`dumbbell_${d.value}`,onMouseenter:n[1]||(n[1]=()=>e.unref(F)(!0)),onMouseleave:n[2]||(n[2]=()=>e.unref(F)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(me.PenAndPaper,{key:0,parent:p.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:L},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),oe.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:T,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:z,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ce._sfc_main,{key:`title_${X.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value&&(e.unref(M)||e.unref(E))?(e.openBlock(),e.createBlock(Q.UserOptions,{ref:"details",key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(q),isImaging:e.unref(H),uid:d.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:k.value,titles:{...t.value.userOptions.buttonTitles},chartElement:p.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:ne,onGeneratePdf:e.unref(U),onGenerateCsv:Z,onGenerateImage:e.unref(R),onToggleTable:J,onToggleAnnotator:L,style:e.normalizeStyle({visibility:e.unref(M)?e.unref(E)?"visible":"hidden":"visible"})},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"4"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:r})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value}),viewBox:`0 0 ${o.value.absoluteWidth<=0?10:o.value.absoluteWidth} ${o.value.absoluteHeight<=0?10:o.value.absoluteHeight}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(fe._sfc_main),a.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:o.value.left,y:o.value.top,width:o.value.width,height:o.value.height,style:{pointerEvents:"none"}},[e.renderSlot(a.$slots,"chart-background",{},void 0,!0)],8,xe)):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",_e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.ticks,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.value.left+r*o.value.width/(i.value.ticks.length-1),x2:o.value.left+r*o.value.width/(i.value.ticks.length-1),y1:o.value.top,y2:o.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray},null,8,Ce))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",we,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.value.left,x2:o.value.right,y1:o.value.top+r*c.value,y2:o.value.top+r*c.value,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,Be))),256)),e.createElementVNode("line",{x1:o.value.left,x2:o.value.right,y1:o.value.bottom,y2:o.value.bottom,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,Ne)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(),e.createElementBlock("g",Ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.value.top+r*c.value+(t.value.style.chart.labels.yAxisLabels.showProgression?c.value/3:c.value/2)+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"font-weight":t.value.style.chart.labels.yAxisLabels.bold?"bold":"normal","text-anchor":"end"},e.toDisplayString(l.name),9,$e))),256)),t.value.style.chart.labels.yAxisLabels.showProgression?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(f.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.value.top+r*c.value+c.value/1.3+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"text-anchor":"end"},e.toDisplayString(e.unref(s.dataLabel)({v:100*(l.end/l.start-1),s:"%",r:t.value.style.chart.labels.yAxisLabels.rounding})),9,Le))),256)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(),e.createElementBlock("g",Se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.ticks,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left+r*(o.value.width/(i.value.ticks.length-1)),y:o.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"font-weight":t.value.style.chart.labels.xAxisLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.labels.formatter,l,e.unref(s.dataLabel)({p:t.value.style.chart.labels.prefix,v:l,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.xAxisLabels.rounding}),{datapoint:l,seriesIndex:r})),9,Ve))),256))])):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`start_grad_${d.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.startColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,Ae),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.startColor,.1)},null,8,Pe),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Te)],8,ze),e.createElementVNode("radialGradient",{id:`end_grad_${d.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.endColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,De),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.endColor,.1)},null,8,Oe),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Fe)],8,Xe)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`grad_positive_${d.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.startColor},null,8,Ge),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Ie)],8,Me),e.createElementVNode("linearGradient",{id:`grad_negative_${d.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.endColor},null,8,He),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Ue)],8,qe)]),t.value.style.chart.plots.link.type==="curved"?(e.openBlock(),e.createElementBlock("g",Re,[e.createElementVNode("path",{d:`M
|
|
2
2
|
${l.startX},${l.y+t.value.style.chart.plots.radius/2}
|
|
3
3
|
C ${l.centerX},${l.y} ${l.centerX},${l.y}
|
|
4
4
|
${l.endX},${l.y+t.value.style.chart.plots.radius/2}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { computed as p, onMounted as ze, ref as b, watch as Ye, openBlock as u, createElementBlock as c, normalizeClass as me, normalizeStyle as x, unref as i, createBlock as P, createCommentVNode as k, createSlots as De, withCtx as w, renderSlot as m, normalizeProps as W, guardReactiveProps as q, createVNode as ye, createElementVNode as M, Fragment as F, renderList as I, toDisplayString as R, createTextVNode as Ge, nextTick as Ue } from "vue";
|
|
2
|
-
import { u as Ve, o as Be, e as je, c as be, t as Xe, a as We, p as Z, b as qe, v as h, f as ke, X as Re, G as we, L as Ze, i as Je, q as Ke, r as Qe } from "./index-
|
|
3
|
-
import { _ as et } from "./Title-
|
|
4
|
-
import { u as tt, U as ot } from "./usePrinter-
|
|
5
|
-
import { D as lt } from "./DataTable-
|
|
6
|
-
import at from "./vue-ui-accordion
|
|
7
|
-
import nt from "./vue-ui-skeleton-
|
|
8
|
-
import { u as Ce } from "./useNestedProp-
|
|
9
|
-
import { _ as st } from "./PackageVersion-
|
|
10
|
-
import { P as rt } from "./PenAndPaper-
|
|
2
|
+
import { u as Ve, o as Be, e as je, c as be, t as Xe, a as We, p as Z, b as qe, v as h, f as ke, X as Re, G as we, L as Ze, i as Je, q as Ke, r as Qe } from "./index-B8Eaq54E.js";
|
|
3
|
+
import { _ as et } from "./Title-XYNHfYwN.js";
|
|
4
|
+
import { u as tt, U as ot } from "./usePrinter-D83W2gfG.js";
|
|
5
|
+
import { D as lt } from "./DataTable-DtRXoetj.js";
|
|
6
|
+
import at from "./vue-ui-accordion--5td7b94.js";
|
|
7
|
+
import nt from "./vue-ui-skeleton-DpadzgbS.js";
|
|
8
|
+
import { u as Ce } from "./useNestedProp-Ka0R_Yqa.js";
|
|
9
|
+
import { _ as st } from "./PackageVersion-CgJdp_Ki.js";
|
|
10
|
+
import { P as rt } from "./PenAndPaper-BTLEk55u.js";
|
|
11
11
|
import { u as ut } from "./useUserOptionState-BIvW1Kz7.js";
|
|
12
12
|
import { _ as it } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
13
|
const ct = ["id"], dt = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-CH3YkGpv.cjs"),ke=require("./Title-m5N0oN0G.cjs"),te=require("./usePrinter-A1_US3Dh.cjs"),ye=require("./DataTable-RY8EUwF3.cjs"),be=require("./vue-ui-accordion-_LFrGkGx.cjs"),we=require("./vue-ui-skeleton-DwmP0u2B.cjs"),oe=require("./useNestedProp-2TBYsJKg.cjs"),Ce=require("./PackageVersion-C1zaH_aJ.cjs"),Ne=require("./PenAndPaper-Bv8oV7l0.cjs"),xe=require("./useUserOptionState-BgepsfED.cjs"),Be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),$e=["id"],_e={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},Se={key:2,style:"width:100%;background:transparent;padding-bottom:24px"},Ee=["xmlns","viewBox"],Pe=["width","height"],Te=["id"],Oe=["stop-color"],Fe=["stop-color"],Le=["d","fill","stroke","stroke-width"],Ve=["x","y","height","width","fill","stroke","stroke-width","onMouseenter"],ze=["x","y","font-size","fill"],Ie=["x","y","font-size","fill"],Ae={key:4,class:"vue-data-ui-watermark"},He={key:6,ref:"source",dir:"auto"},Me=["innerHTML"],qe={__name:"vue-ui-flow",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(le,{expose:ne}){const h=le,{vue_ui_flow:ae}=s.useConfig(),$=e.computed(()=>!!h.dataset&&h.dataset.length);e.onMounted(()=>{V()});function V(){s.objectIsEmpty(h.dataset)&&s.error({componentName:"VueUiFlow",type:"dataset"})}const _=e.ref(s.createUid()),S=e.ref(null),z=e.ref(0),I=e.ref(0),y=e.ref(!1);function re(o){y.value=o,z.value+=1}const t=e.computed({get:()=>M(),set:o=>o}),{userOptionsVisible:E,setUserOptionsVisibility:A,keepUserOptionState:H}=xe.useUserOptionState({config:t.value});function M(){const o=oe.useNestedProp({userConfig:h.config,defaultConfig:ae});return o.theme?{...oe.useNestedProp({userConfig:s.themes.vue_ui_flow[o.theme]||h.config,defaultConfig:o}),customPalette:s.themePalettes[o.theme]||s.palette}:o}e.watch(()=>h.config,o=>{t.value=M(),E.value=!t.value.showOnChartHover,V(),I.value+=1},{deep:!0});const{isPrinting:q,isImaging:D,generatePdf:U,generateImage:Y}=te.usePrinter({elementId:`flow_${_.value}`,fileName:t.value.style.chart.title.text||"vue-ui-flow"}),se=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),P=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),G=e.computed(()=>t.value.style.chart.nodes.gap),g=e.computed(()=>t.value.style.chart.nodes.width),w=e.ref({showTable:t.value.table.show}),j=e.computed(()=>t.value.style.chart.links.width),T=e.computed(()=>!h.dataset||!h.dataset.length?[]:h.dataset.map(o=>[o[0],o[1],s.checkNaN(o[2])])),W=e.computed(()=>{const o={};function n(r){o[r]||(o[r]={inflow:0,outflow:0})}T.value.forEach(([r,a,c])=>{n(r),n(a),o[r].outflow+=c,o[a].inflow+=c});let l=0;for(const r in o){const a=Math.max(o[r].inflow,o[r].outflow);l=Math.max(l,a)}return l});function ue(o){return o/W.value*100+t.value.style.chart.nodes.minHeight}function ie(o){const n=t.value.style.chart.nodes.minHeight;return(o-n)/100*W.value}function ce(o){const n={},l={};function r(u,i){n[u]||(n[u]={height:0,level:null,inflow:0,outflow:0}),n[u].level===null&&(n[u].level=i),l[i]||(l[i]=[]),l[i].includes(u)||l[i].push(u)}o.forEach(([u,i,v],k)=>{const m=n[u]?n[u].level:0,B=m+1;r(u,m),r(i,B),n[u].children||(n[u].children=[]),n[u].children.push({target:i,value:v}),n[u].outflow+=v,n[i].inflow+=v}),Object.keys(n).forEach((u,i)=>{n[u].color=P.value[i]||P.value[i%P.value.length]||s.palette[i]||s.palette[i%d.length]});for(const u in n)n[u].height=ue(Math.max(n[u].inflow,n[u].outflow)),n[u].name=u;const a={};for(const u in l){let i=0;l[u].forEach((v,k)=>{const m=n[v].height;a[v]={x:parseInt(u,10)*j.value+t.value.style.chart.padding.left,y:i,absoluteY:i,height:m,i:k,color:n[v].color,value:ie(m)},i+=m+G.value})}const c=[];for(const u in n){let i=a[u].absoluteY+t.value.style.chart.padding.top;n[u].children&&n[u].children.forEach(({target:v,value:k},m)=>{const B=a[v].y+t.value.style.chart.padding.top,F=a[u],L=a[v],J=s.checkNaN(i),K=s.checkNaN(i+k/n[u].outflow*F.height),Q=s.checkNaN(B),ee=s.checkNaN(B+k/n[v].inflow*L.height),ge={id:s.createUid(),source:u,target:v,path:`M ${s.checkNaN(F.x)+s.checkNaN(g.value)} ${J} L ${s.checkNaN(F.x)+s.checkNaN(g.value)} ${K} L ${s.checkNaN(L.x)} ${ee} L ${s.checkNaN(L.x)} ${Q} Z`,value:k,sourceColor:n[u].color,targetColor:n[v].color};c.push(ge),i+=K-J,a[v].y+=ee-Q})}return{nodeCoordinates:a,links:c}}const f=e.computed(()=>{const o=ce(h.dataset);return{nodes:Object.keys(o.nodeCoordinates).map((n,l)=>({...o.nodeCoordinates[n],name:n})),links:o.links}}),de=e.computed(()=>ve(f.value.nodes));function ve(o){const n={};for(const r in o){const{x:a,height:c}=o[r];n[a]||(n[a]=0),n[a]+=c+G.value}return Math.max(...Object.values(n))}const b=e.computed(()=>{const{top:o,right:n,left:l,bottom:r}=t.value.style.chart.padding,a=T.value.length*j.value;return{height:de.value+o+r,width:n+Math.max(...f.value.nodes.map(c=>c.x))+g.value,left:l,top:o,right:a-n,p_top:o,p_bottom:r}});function he(o){const n={},l={},r=new Set;return T.value.forEach(([a,c,u])=>{n[a]||(n[a]=[]),l[c]||(l[c]=[]),n[a].push(c),l[c].push(a)}),n[o]&&n[o].forEach(a=>r.add(a)),l[o]&&l[o].forEach(a=>r.add(a)),Array.from(r).concat(o)}const p=e.ref(null),C=e.ref(null);function fe(o){p.value=he(o.name),C.value=o.name}function pe(){p.value=null,C.value=null}const X=e.computed(()=>f.value.links.map(({source:o,target:n,sourceColor:l,targetColor:r,value:a})=>({source:o,target:n,sourceColor:l,targetColor:r,value:a})));function R(){e.nextTick(()=>{const o=X.value.map((r,a)=>[[r.source],[r.target],[r.value]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.source],[t.value.table.columnNames.target],[t.value.table.columnNames.value]]].concat(o),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-flow"})})}const N=e.computed(()=>{const o=[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],n=X.value.map((a,c)=>[{color:a.sourceColor,name:a.source},{color:a.targetColor,name:a.target},s.dataLabel({p:t.value.style.chart.nodes.labels.prefix,v:a.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding})]),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],head:o,body:n,config:l}});function me(){return f.value}function Z(){w.value.showTable=!w.value.showTable}const x=e.ref(!1);function O(){x.value=!x.value}return ne({getData:me,generateCsv:R,generateImage:Y,generatePdf:U,toggleTable:Z,toggleAnnotator:O}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"flowChart",ref:S,class:e.normalizeClass(`vue-ui-flow ${y.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`flow_${_.value}`,onMouseenter:n[2]||(n[2]=()=>e.unref(A)(!0)),onMouseleave:n[3]||(n[3]=()=>e.unref(A)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ne.PenAndPaper,{key:0,parent:S.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:x.value,onClose:O},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),se.value?(e.openBlock(),e.createElementBlock("div",_e,null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",Se,[(e.openBlock(),e.createBlock(ke._sfc_main,{key:`title_${I.value}`,config:{title:{cy:"flow-title",...t.value.style.chart.title},subtitle:{cy:"flow-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&$.value&&(e.unref(H)||e.unref(E))?(e.openBlock(),e.createBlock(te.UserOptions,{ref:"details",key:`user_option_${z.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(q),isImaging:e.unref(D),uid:_.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:y.value,titles:{...t.value.userOptions.buttonTitles},chartElement:S.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:x.value,onToggleFullscreen:re,onGeneratePdf:e.unref(U),onGenerateCsv:R,onGenerateImage:e.unref(Y),onToggleTable:Z,onToggleAnnotator:O,style:e.normalizeStyle({visibility:e.unref(H)?e.unref(E)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"4"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:r})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${b.value.width} ${b.value.height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":y.value,"vue-data-ui-fulscreen--off":!y.value}),style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Ce._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:b.value.width,height:b.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,Pe)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.links,(l,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:l.id,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":l.sourceColor},null,8,Oe),e.createElementVNode("stop",{offset:"100%","stop-color":l.targetColor},null,8,Fe)],8,Te))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.links,l=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-flow-link",d:l.path,fill:`url(#${l.id})`,stroke:t.value.style.chart.links.stroke,"stroke-width":t.value.style.chart.links.strokeWidth,style:e.normalizeStyle(`opacity:${C.value?[l.target,l.source].includes(C.value)?1:.3:t.value.style.chart.links.opacity}`)},null,12,Le))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("rect",{class:"vue-ui-flow-node",x:l.x,y:e.unref(s.checkNaN)(l.absoluteY)+t.value.style.chart.padding.top,height:e.unref(s.checkNaN)(l.height),width:g.value,fill:l.color,stroke:t.value.style.chart.nodes.stroke,"stroke-width":t.value.style.chart.nodes.strokeWidth,onMouseenter:a=>fe(l),onMouseleave:n[0]||(n[0]=a=>pe()),style:e.normalizeStyle(`opacity:${p.value?p.value.includes(l.name)?1:.2:1}`)},null,44,Ve))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+g.value/2,y:e.unref(s.checkNaN)(l.absoluteY+l.height/2-t.value.style.chart.nodes.labels.fontSize/4)+t.value.style.chart.padding.top,"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${p.value?p.value.includes(l.name)?1:0:1}`)},e.toDisplayString(t.value.style.chart.nodes.labels.abbreviation.use?e.unref(s.abbreviate)({source:l.name,length:t.value.style.chart.nodes.labels.abbreviation.length}):l.name),13,ze))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+g.value/2,y:e.unref(s.checkNaN)(l.absoluteY+l.height/2+t.value.style.chart.nodes.labels.fontSize)+t.value.style.chart.padding.top,"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${p.value?p.value.includes(l.name)?1:0:1}`)},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.nodes.labels.formatter,l.value,e.unref(s.dataLabel)({p:t.value.style.chart.nodes.labels.prefix,v:l.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding}),{datapoint:l,seriesIndex:r})),13,Ie))),256)),e.renderSlot(o.$slots,"svg",{svg:b.value},void 0,!0)],14,Ee)),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ae,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(q)||e.unref(D)})),void 0,!0)])):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(we.default,{key:5,config:{type:"flow",style:{backgroundColor:t.value.style.chart.backgroundColor}}},null,8,["config"])),o.$slots.source?(e.openBlock(),e.createElementBlock("div",He,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createBlock(be.default,{key:7,hideDetails:"",config:{open:w.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ye.DataTable,{colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:n[1]||(n[1]=l=>w.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,Me)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,$e))}},De=Be._export_sfc(qe,[["__scopeId","data-v-02e90f12"]]);exports.default=De;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-KJL8ra_6.cjs"),ke=require("./Title-D-6pIV0l.cjs"),te=require("./usePrinter-pDOF3CfL.cjs"),ye=require("./DataTable-wN-jvOfe.cjs"),be=require("./vue-ui-accordion-4-dyMgJA.cjs"),we=require("./vue-ui-skeleton-D_YCUi1y.cjs"),oe=require("./useNestedProp-Bu958azG.cjs"),Ce=require("./PackageVersion-Dn-t7tbm.cjs"),Ne=require("./PenAndPaper-DFXJJink.cjs"),xe=require("./useUserOptionState-BgepsfED.cjs"),Be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),$e=["id"],_e={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},Se={key:2,style:"width:100%;background:transparent;padding-bottom:24px"},Ee=["xmlns","viewBox"],Pe=["width","height"],Te=["id"],Oe=["stop-color"],Fe=["stop-color"],Le=["d","fill","stroke","stroke-width"],Ve=["x","y","height","width","fill","stroke","stroke-width","onMouseenter"],ze=["x","y","font-size","fill"],Ie=["x","y","font-size","fill"],Ae={key:4,class:"vue-data-ui-watermark"},He={key:6,ref:"source",dir:"auto"},Me=["innerHTML"],qe={__name:"vue-ui-flow",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(le,{expose:ne}){const h=le,{vue_ui_flow:ae}=s.useConfig(),$=e.computed(()=>!!h.dataset&&h.dataset.length);e.onMounted(()=>{V()});function V(){s.objectIsEmpty(h.dataset)&&s.error({componentName:"VueUiFlow",type:"dataset"})}const _=e.ref(s.createUid()),S=e.ref(null),z=e.ref(0),I=e.ref(0),y=e.ref(!1);function re(o){y.value=o,z.value+=1}const t=e.computed({get:()=>M(),set:o=>o}),{userOptionsVisible:E,setUserOptionsVisibility:A,keepUserOptionState:H}=xe.useUserOptionState({config:t.value});function M(){const o=oe.useNestedProp({userConfig:h.config,defaultConfig:ae});return o.theme?{...oe.useNestedProp({userConfig:s.themes.vue_ui_flow[o.theme]||h.config,defaultConfig:o}),customPalette:s.themePalettes[o.theme]||s.palette}:o}e.watch(()=>h.config,o=>{t.value=M(),E.value=!t.value.showOnChartHover,V(),I.value+=1},{deep:!0});const{isPrinting:q,isImaging:D,generatePdf:U,generateImage:Y}=te.usePrinter({elementId:`flow_${_.value}`,fileName:t.value.style.chart.title.text||"vue-ui-flow"}),se=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),P=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),G=e.computed(()=>t.value.style.chart.nodes.gap),g=e.computed(()=>t.value.style.chart.nodes.width),w=e.ref({showTable:t.value.table.show}),j=e.computed(()=>t.value.style.chart.links.width),T=e.computed(()=>!h.dataset||!h.dataset.length?[]:h.dataset.map(o=>[o[0],o[1],s.checkNaN(o[2])])),W=e.computed(()=>{const o={};function n(r){o[r]||(o[r]={inflow:0,outflow:0})}T.value.forEach(([r,a,c])=>{n(r),n(a),o[r].outflow+=c,o[a].inflow+=c});let l=0;for(const r in o){const a=Math.max(o[r].inflow,o[r].outflow);l=Math.max(l,a)}return l});function ue(o){return o/W.value*100+t.value.style.chart.nodes.minHeight}function ie(o){const n=t.value.style.chart.nodes.minHeight;return(o-n)/100*W.value}function ce(o){const n={},l={};function r(u,i){n[u]||(n[u]={height:0,level:null,inflow:0,outflow:0}),n[u].level===null&&(n[u].level=i),l[i]||(l[i]=[]),l[i].includes(u)||l[i].push(u)}o.forEach(([u,i,v],k)=>{const m=n[u]?n[u].level:0,B=m+1;r(u,m),r(i,B),n[u].children||(n[u].children=[]),n[u].children.push({target:i,value:v}),n[u].outflow+=v,n[i].inflow+=v}),Object.keys(n).forEach((u,i)=>{n[u].color=P.value[i]||P.value[i%P.value.length]||s.palette[i]||s.palette[i%d.length]});for(const u in n)n[u].height=ue(Math.max(n[u].inflow,n[u].outflow)),n[u].name=u;const a={};for(const u in l){let i=0;l[u].forEach((v,k)=>{const m=n[v].height;a[v]={x:parseInt(u,10)*j.value+t.value.style.chart.padding.left,y:i,absoluteY:i,height:m,i:k,color:n[v].color,value:ie(m)},i+=m+G.value})}const c=[];for(const u in n){let i=a[u].absoluteY+t.value.style.chart.padding.top;n[u].children&&n[u].children.forEach(({target:v,value:k},m)=>{const B=a[v].y+t.value.style.chart.padding.top,F=a[u],L=a[v],J=s.checkNaN(i),K=s.checkNaN(i+k/n[u].outflow*F.height),Q=s.checkNaN(B),ee=s.checkNaN(B+k/n[v].inflow*L.height),ge={id:s.createUid(),source:u,target:v,path:`M ${s.checkNaN(F.x)+s.checkNaN(g.value)} ${J} L ${s.checkNaN(F.x)+s.checkNaN(g.value)} ${K} L ${s.checkNaN(L.x)} ${ee} L ${s.checkNaN(L.x)} ${Q} Z`,value:k,sourceColor:n[u].color,targetColor:n[v].color};c.push(ge),i+=K-J,a[v].y+=ee-Q})}return{nodeCoordinates:a,links:c}}const f=e.computed(()=>{const o=ce(h.dataset);return{nodes:Object.keys(o.nodeCoordinates).map((n,l)=>({...o.nodeCoordinates[n],name:n})),links:o.links}}),de=e.computed(()=>ve(f.value.nodes));function ve(o){const n={};for(const r in o){const{x:a,height:c}=o[r];n[a]||(n[a]=0),n[a]+=c+G.value}return Math.max(...Object.values(n))}const b=e.computed(()=>{const{top:o,right:n,left:l,bottom:r}=t.value.style.chart.padding,a=T.value.length*j.value;return{height:de.value+o+r,width:n+Math.max(...f.value.nodes.map(c=>c.x))+g.value,left:l,top:o,right:a-n,p_top:o,p_bottom:r}});function he(o){const n={},l={},r=new Set;return T.value.forEach(([a,c,u])=>{n[a]||(n[a]=[]),l[c]||(l[c]=[]),n[a].push(c),l[c].push(a)}),n[o]&&n[o].forEach(a=>r.add(a)),l[o]&&l[o].forEach(a=>r.add(a)),Array.from(r).concat(o)}const p=e.ref(null),C=e.ref(null);function fe(o){p.value=he(o.name),C.value=o.name}function pe(){p.value=null,C.value=null}const X=e.computed(()=>f.value.links.map(({source:o,target:n,sourceColor:l,targetColor:r,value:a})=>({source:o,target:n,sourceColor:l,targetColor:r,value:a})));function R(){e.nextTick(()=>{const o=X.value.map((r,a)=>[[r.source],[r.target],[r.value]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.source],[t.value.table.columnNames.target],[t.value.table.columnNames.value]]].concat(o),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-flow"})})}const N=e.computed(()=>{const o=[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],n=X.value.map((a,c)=>[{color:a.sourceColor,name:a.source},{color:a.targetColor,name:a.target},s.dataLabel({p:t.value.style.chart.nodes.labels.prefix,v:a.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding})]),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],head:o,body:n,config:l}});function me(){return f.value}function Z(){w.value.showTable=!w.value.showTable}const x=e.ref(!1);function O(){x.value=!x.value}return ne({getData:me,generateCsv:R,generateImage:Y,generatePdf:U,toggleTable:Z,toggleAnnotator:O}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"flowChart",ref:S,class:e.normalizeClass(`vue-ui-flow ${y.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`flow_${_.value}`,onMouseenter:n[2]||(n[2]=()=>e.unref(A)(!0)),onMouseleave:n[3]||(n[3]=()=>e.unref(A)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ne.PenAndPaper,{key:0,parent:S.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:x.value,onClose:O},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),se.value?(e.openBlock(),e.createElementBlock("div",_e,null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",Se,[(e.openBlock(),e.createBlock(ke._sfc_main,{key:`title_${I.value}`,config:{title:{cy:"flow-title",...t.value.style.chart.title},subtitle:{cy:"flow-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&$.value&&(e.unref(H)||e.unref(E))?(e.openBlock(),e.createBlock(te.UserOptions,{ref:"details",key:`user_option_${z.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(q),isImaging:e.unref(D),uid:_.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:y.value,titles:{...t.value.userOptions.buttonTitles},chartElement:S.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:x.value,onToggleFullscreen:re,onGeneratePdf:e.unref(U),onGenerateCsv:R,onGenerateImage:e.unref(Y),onToggleTable:Z,onToggleAnnotator:O,style:e.normalizeStyle({visibility:e.unref(H)?e.unref(E)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"4"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:r})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${b.value.width} ${b.value.height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":y.value,"vue-data-ui-fulscreen--off":!y.value}),style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Ce._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:b.value.width,height:b.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,Pe)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.links,(l,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:l.id,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":l.sourceColor},null,8,Oe),e.createElementVNode("stop",{offset:"100%","stop-color":l.targetColor},null,8,Fe)],8,Te))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.links,l=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-flow-link",d:l.path,fill:`url(#${l.id})`,stroke:t.value.style.chart.links.stroke,"stroke-width":t.value.style.chart.links.strokeWidth,style:e.normalizeStyle(`opacity:${C.value?[l.target,l.source].includes(C.value)?1:.3:t.value.style.chart.links.opacity}`)},null,12,Le))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("rect",{class:"vue-ui-flow-node",x:l.x,y:e.unref(s.checkNaN)(l.absoluteY)+t.value.style.chart.padding.top,height:e.unref(s.checkNaN)(l.height),width:g.value,fill:l.color,stroke:t.value.style.chart.nodes.stroke,"stroke-width":t.value.style.chart.nodes.strokeWidth,onMouseenter:a=>fe(l),onMouseleave:n[0]||(n[0]=a=>pe()),style:e.normalizeStyle(`opacity:${p.value?p.value.includes(l.name)?1:.2:1}`)},null,44,Ve))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+g.value/2,y:e.unref(s.checkNaN)(l.absoluteY+l.height/2-t.value.style.chart.nodes.labels.fontSize/4)+t.value.style.chart.padding.top,"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${p.value?p.value.includes(l.name)?1:0:1}`)},e.toDisplayString(t.value.style.chart.nodes.labels.abbreviation.use?e.unref(s.abbreviate)({source:l.name,length:t.value.style.chart.nodes.labels.abbreviation.length}):l.name),13,ze))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+g.value/2,y:e.unref(s.checkNaN)(l.absoluteY+l.height/2+t.value.style.chart.nodes.labels.fontSize)+t.value.style.chart.padding.top,"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${p.value?p.value.includes(l.name)?1:0:1}`)},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.nodes.labels.formatter,l.value,e.unref(s.dataLabel)({p:t.value.style.chart.nodes.labels.prefix,v:l.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding}),{datapoint:l,seriesIndex:r})),13,Ie))),256)),e.renderSlot(o.$slots,"svg",{svg:b.value},void 0,!0)],14,Ee)),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ae,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(q)||e.unref(D)})),void 0,!0)])):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(we.default,{key:5,config:{type:"flow",style:{backgroundColor:t.value.style.chart.backgroundColor}}},null,8,["config"])),o.$slots.source?(e.openBlock(),e.createElementBlock("div",He,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createBlock(be.default,{key:7,hideDetails:"",config:{open:w.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ye.DataTable,{colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:n[1]||(n[1]=l=>w.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,Me)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,$e))}},De=Be._export_sfc(qe,[["__scopeId","data-v-02e90f12"]]);exports.default=De;
|