vue-data-ui 2.4.85 → 2.4.87
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-Ajt3NMEa.cjs → Arrow-B6C-c2DT.cjs} +1 -1
- package/dist/{Arrow-Qayb_B0s.js → Arrow-C8PrFeHS.js} +1 -1
- package/dist/{BaseIcon-BVrsMbvi.cjs → BaseIcon-CdOKZmHr.cjs} +1 -1
- package/dist/{BaseIcon-B8U62FEj.js → BaseIcon-plElWres.js} +1 -1
- package/dist/{DataTable-1PQD-SFb.cjs → DataTable-BmKl4AAb.cjs} +1 -1
- package/dist/{DataTable-C0tCPQ9i.js → DataTable-CKke7C6w.js} +2 -2
- package/dist/{Legend-BJ2Wbqut.cjs → Legend-CY6wjCYY.cjs} +1 -1
- package/dist/{Legend-BTpe6qQB.js → Legend-DMeEvZOT.js} +2 -2
- package/dist/{PackageVersion-BjfedMsH.cjs → PackageVersion-DvDNPRrJ.cjs} +1 -1
- package/dist/{PackageVersion-CENy3Lm2.js → PackageVersion-Rh3rgo6A.js} +1 -1
- package/dist/{PenAndPaper-nqRtAh6J.cjs → PenAndPaper--xHLJRME.cjs} +1 -1
- package/dist/{PenAndPaper-Dr7ndoP_.js → PenAndPaper-DqVsdeLc.js} +3 -3
- package/dist/{Shape-zFv85Gc2.js → Shape-CL3HglYL.js} +1 -1
- package/dist/{Shape-Boa32JEn.cjs → Shape-DEwnzwRB.cjs} +1 -1
- package/dist/{Slicer-D6QLMg5N.cjs → Slicer-CnNbe-dl.cjs} +1 -1
- package/dist/{Slicer-BUYuk07t.js → Slicer-ZryQKOl5.js} +2 -2
- package/dist/{Title-CaET2xuF.js → Title-BU5Aq1_x.js} +1 -1
- package/dist/{Title-DJUxOiaO.cjs → Title-C10173bN.cjs} +1 -1
- package/dist/{Tooltip-C5QuW94e.cjs → Tooltip-CL7aSMgq.cjs} +1 -1
- package/dist/{Tooltip-Bkc4233T.js → Tooltip-Dm-obTbx.js} +1 -1
- package/dist/{index-COIn1phv.cjs → index-1HOIfTy2.cjs} +1 -1
- package/dist/{index-B7nCQFK0.js → index-BG5J_ybN.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-CbMuGGl3.cjs → useNestedProp-BFNnjpX-.cjs} +1 -1
- package/dist/{useNestedProp-C9rlBRTT.js → useNestedProp-BN1ZmAKT.js} +1 -1
- package/dist/{usePrinter-CQMn1b4E.js → usePrinter-CWeJt84b.js} +1 -1
- package/dist/{usePrinter-CXXfgFFN.cjs → usePrinter-i-j4CdEi.cjs} +1 -1
- package/dist/{vue-data-ui-Bu_VIHgr.cjs → vue-data-ui-549nX1yu.cjs} +1 -1
- package/dist/{vue-data-ui-BnsKGbqb.js → vue-data-ui-B5u9V9lC.js} +60 -60
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-V5FBS9MA.js → vue-ui-3d-bar-DBtozgXL.js} +38 -38
- package/dist/{vue-ui-3d-bar-D39F2dKF.cjs → vue-ui-3d-bar-J7LkJgTZ.cjs} +11 -11
- package/dist/{vue-ui-accordion-CGlnNTr8.cjs → vue-ui-accordion-Cd6GaDwU.cjs} +1 -1
- package/dist/{vue-ui-accordion-B8ptB5BQ.js → vue-ui-accordion-JBOceVq2.js} +3 -3
- package/dist/{vue-ui-age-pyramid-Bjp1R8Ku.js → vue-ui-age-pyramid-BIkYjL8e.js} +29 -29
- package/dist/vue-ui-age-pyramid-DeryBRqg.cjs +1 -0
- package/dist/{vue-ui-annotator-V9m5fTGG.js → vue-ui-annotator-Bt90Iec6.js} +1 -1
- package/dist/{vue-ui-annotator-BoWZZRPg.cjs → vue-ui-annotator-Dw8cVACs.cjs} +1 -1
- package/dist/{vue-ui-bullet-DLIxlhFF.cjs → vue-ui-bullet-BMAYQESQ.cjs} +1 -1
- package/dist/{vue-ui-bullet-Bqvb5PV-.js → vue-ui-bullet-DzosZUYl.js} +8 -8
- package/dist/{vue-ui-candlestick-D4BD8LyJ.cjs → vue-ui-candlestick-BaLnAKB9.cjs} +2 -2
- package/dist/{vue-ui-candlestick-DHCtmsh3.js → vue-ui-candlestick-dTATEFOU.js} +48 -48
- package/dist/{vue-ui-carousel-table-VIuoh2QI.cjs → vue-ui-carousel-table-CWNI7Ri5.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-Cn2RJkSb.js → vue-ui-carousel-table-rMcj65Bo.js} +4 -4
- package/dist/{vue-ui-chestnut-C5qUO1uK.js → vue-ui-chestnut-B_NLFSaY.js} +29 -29
- package/dist/{vue-ui-chestnut-ClG9HZoC.cjs → vue-ui-chestnut-DjOEVM3w.cjs} +2 -2
- package/dist/{vue-ui-cursor-Bo8et-dD.cjs → vue-ui-cursor-CBUwAZd1.cjs} +1 -1
- package/dist/{vue-ui-cursor-eJau3iyr.js → vue-ui-cursor-CTvVj3YO.js} +2 -2
- package/dist/{vue-ui-dashboard-DnaH9bCw.js → vue-ui-dashboard-CG9J3DLT.js} +2 -2
- package/dist/{vue-ui-dashboard-WJqGQ8iR.cjs → vue-ui-dashboard-DcfhPFVi.cjs} +1 -1
- package/dist/{vue-ui-digits-qIckO4-r.cjs → vue-ui-digits-B8lUQcKK.cjs} +1 -1
- package/dist/{vue-ui-digits-Cqjts2eq.js → vue-ui-digits-CF6qbsmO.js} +2 -2
- package/dist/{vue-ui-donut-pprcnbIw.js → vue-ui-donut-Bbkz0M-R.js} +76 -76
- package/dist/vue-ui-donut-CzmOCuxn.cjs +1 -0
- package/dist/{vue-ui-donut-evolution-EzYvP11F.js → vue-ui-donut-evolution-BkE-sAyn.js} +66 -66
- package/dist/vue-ui-donut-evolution-CjFUAKXU.cjs +1 -0
- package/dist/vue-ui-dumbbell-BiHzKPGP.cjs +9 -0
- package/dist/{vue-ui-dumbbell-DaxcxmnU.js → vue-ui-dumbbell-D8JuHhzi.js} +28 -28
- package/dist/vue-ui-flow-CR1Qo5Rt.cjs +1 -0
- package/dist/{vue-ui-flow-DbRgaKBu.js → vue-ui-flow-Cie8iHDK.js} +31 -31
- package/dist/vue-ui-funnel-B8uRuzDx.cjs +1 -0
- package/dist/{vue-ui-funnel-B2del8KB.js → vue-ui-funnel-tW6PGqcE.js} +32 -32
- package/dist/vue-ui-galaxy-BfbYEvnO.cjs +1 -0
- package/dist/{vue-ui-galaxy-pUYeASJf.js → vue-ui-galaxy-p4j0h3ZX.js} +81 -81
- package/dist/{vue-ui-gauge-DpsXpEaW.js → vue-ui-gauge-CtVmazzP.js} +7 -7
- package/dist/{vue-ui-gauge-BOXoAgWk.cjs → vue-ui-gauge-DnTOvr4T.cjs} +1 -1
- package/dist/{vue-ui-gizmo-Bq9uAmqd.cjs → vue-ui-gizmo-BdlVxVqD.cjs} +1 -1
- package/dist/{vue-ui-gizmo-BpYrhkon.js → vue-ui-gizmo-wjZJgWPe.js} +3 -3
- package/dist/{vue-ui-heatmap-Cz6_9Veh.js → vue-ui-heatmap-DJXLmzGL.js} +63 -63
- package/dist/vue-ui-heatmap-Gd3nkwzC.cjs +1 -0
- package/dist/vue-ui-history-plot-CevSrT7E.cjs +1 -0
- package/dist/{vue-ui-history-plot-DAotUjSF.js → vue-ui-history-plot-DJQck-9N.js} +69 -69
- package/dist/{vue-ui-kpi-D6mp6EQ2.cjs → vue-ui-kpi-D8NVXEfO.cjs} +1 -1
- package/dist/{vue-ui-kpi-Ch2p7m-i.js → vue-ui-kpi-MK6JH8yi.js} +3 -3
- package/dist/{vue-ui-mini-loader-E13lmwfO.js → vue-ui-mini-loader-UiC0NYsO.js} +2 -2
- package/dist/{vue-ui-mini-loader-CO-KGVlC.cjs → vue-ui-mini-loader-a8JZaxIy.cjs} +1 -1
- package/dist/vue-ui-molecule-CXgKUNCL.cjs +1 -0
- package/dist/{vue-ui-molecule-C69K6EPO.js → vue-ui-molecule-Cz9zZQ95.js} +155 -155
- package/dist/vue-ui-mood-radar-B-PSds5c.cjs +1 -0
- package/dist/{vue-ui-mood-radar-DDtky572.js → vue-ui-mood-radar-BMMCFkEk.js} +33 -33
- package/dist/{vue-ui-nested-donuts-DMCd6DqT.cjs → vue-ui-nested-donuts-Cdx6UQwF.cjs} +5 -5
- package/dist/{vue-ui-nested-donuts-AYPYIRrE.js → vue-ui-nested-donuts-Da9c-H0Y.js} +147 -147
- package/dist/{vue-ui-onion-Bsa88sKK.js → vue-ui-onion-D1wExDGP.js} +44 -44
- package/dist/{vue-ui-onion-BedLvfFe.cjs → vue-ui-onion-HAS4P8nS.cjs} +2 -2
- package/dist/{vue-ui-parallel-coordinate-plot-KCEb4iRs.js → vue-ui-parallel-coordinate-plot-BH0xKZAE.js} +79 -79
- package/dist/{vue-ui-parallel-coordinate-plot-CSOMIABF.cjs → vue-ui-parallel-coordinate-plot-BYeyzJnE.cjs} +3 -3
- package/dist/{vue-ui-quadrant-Bd_88Eht.js → vue-ui-quadrant-BDkbMaNf.js} +108 -108
- package/dist/vue-ui-quadrant-DbWSZWfP.cjs +1 -0
- package/dist/{vue-ui-quick-chart-CXAYKYHa.js → vue-ui-quick-chart-D3b2YwMY.js} +212 -212
- package/dist/vue-ui-quick-chart-qnbmA75J.cjs +15 -0
- package/dist/{vue-ui-radar-De397oTB.js → vue-ui-radar--Bt67L0i.js} +107 -107
- package/dist/vue-ui-radar-DSZpmaIZ.cjs +1 -0
- package/dist/{vue-ui-rating-wK3_ZWE5.js → vue-ui-rating-Bgr7tvIq.js} +2 -2
- package/dist/{vue-ui-rating-BjiMVoyX.cjs → vue-ui-rating-Z_ANkBeZ.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-BEGyr1h-.cjs → vue-ui-relation-circle-3cgv8yC-.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-BxlK8MVs.js → vue-ui-relation-circle-B22VP_p1.js} +7 -7
- package/dist/{vue-ui-rings-BcNMBXxq.cjs → vue-ui-rings-DZEwaUv5.cjs} +2 -2
- package/dist/{vue-ui-rings-BXrtMSML.js → vue-ui-rings-DgzfAEvJ.js} +66 -66
- package/dist/{vue-ui-scatter-BWZfLJ9P.js → vue-ui-scatter-BwlbShJE.js} +85 -85
- package/dist/vue-ui-scatter-CSI15Dgp.cjs +1 -0
- package/dist/{vue-ui-screenshot-BJgOwFMW.cjs → vue-ui-screenshot-DK2xyINC.cjs} +1 -1
- package/dist/{vue-ui-screenshot-hw4PC9Uu.js → vue-ui-screenshot-Dk0TqQpi.js} +1 -1
- package/dist/{vue-ui-skeleton-BIqMxXV7.cjs → vue-ui-skeleton-CLiDRcQX.cjs} +1 -1
- package/dist/{vue-ui-skeleton-D66ZIUln.js → vue-ui-skeleton-c211TxZ8.js} +3 -3
- package/dist/{vue-ui-smiley-Duy5Xo-j.cjs → vue-ui-smiley-Kr6bQ-7L.cjs} +1 -1
- package/dist/{vue-ui-smiley-DWPYdcDB.js → vue-ui-smiley-hIooew3m.js} +2 -2
- package/dist/{vue-ui-spark-trend-Ce4IaqPz.js → vue-ui-spark-trend-CgpDYM8f.js} +5 -5
- package/dist/{vue-ui-spark-trend-DP5foaNi.cjs → vue-ui-spark-trend-SVqMwS1X.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-Bbns4V16.cjs → vue-ui-sparkbar-DY1J0X8K.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-Fa-Kc9Fr.js → vue-ui-sparkbar-D_HgtfBM.js} +4 -4
- package/dist/{vue-ui-sparkgauge-BrLrvNLH.cjs → vue-ui-sparkgauge-C4p0nAHp.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-DUWcJ7cM.js → vue-ui-sparkgauge-jO5jKAyz.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-PgC-c-5a.js → vue-ui-sparkhistogram-BpQfz14e.js} +5 -5
- package/dist/{vue-ui-sparkhistogram-B0rhs_UN.cjs → vue-ui-sparkhistogram-gSNvSVcP.cjs} +1 -1
- package/dist/{vue-ui-sparkline-BqNlrKjb.js → vue-ui-sparkline-BTgaJjMj.js} +4 -4
- package/dist/{vue-ui-sparkline-c5Awoj8J.cjs → vue-ui-sparkline-D53BDGCi.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-DyJIUulr.js → vue-ui-sparkstackbar-COm1EqFN.js} +5 -5
- package/dist/{vue-ui-sparkstackbar-BmYIcpVZ.cjs → vue-ui-sparkstackbar-DcEhBuvP.cjs} +1 -1
- package/dist/{vue-ui-stackbar-BebRtOYL.js → vue-ui-stackbar-BHyysJyj.js} +51 -51
- package/dist/{vue-ui-stackbar-DJ9NH_l1.cjs → vue-ui-stackbar-D4-vrvMz.cjs} +3 -3
- package/dist/{vue-ui-strip-plot-BGHj1BHd.js → vue-ui-strip-plot-BOLWDlTl.js} +118 -118
- package/dist/vue-ui-strip-plot-iUjpocRA.cjs +1 -0
- package/dist/{vue-ui-table-BFdGppRF.cjs → vue-ui-table-DG3-RAEv.cjs} +1 -1
- package/dist/{vue-ui-table-ClPMKcMn.js → vue-ui-table-XThR7HtD.js} +1 -1
- package/dist/{vue-ui-table-heatmap-B7wTjM-H.cjs → vue-ui-table-heatmap-B82Dmfv2.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-DVQtPt-M.js → vue-ui-table-heatmap-DxWQ3cdf.js} +4 -4
- package/dist/{vue-ui-table-sparkline-DjxKXWQm.js → vue-ui-table-sparkline-BIQAc-eX.js} +5 -5
- package/dist/{vue-ui-table-sparkline-DaKODjfM.cjs → vue-ui-table-sparkline-C3JrSwmi.cjs} +1 -1
- package/dist/{vue-ui-thermometer-CV_9k37V.js → vue-ui-thermometer-Ci0OBAEN.js} +7 -7
- package/dist/{vue-ui-thermometer-DE9r0emf.cjs → vue-ui-thermometer-t1cul6jD.cjs} +1 -1
- package/dist/{vue-ui-timer-Ct-KYWSX.cjs → vue-ui-timer-BLqulQx5.cjs} +1 -1
- package/dist/{vue-ui-timer-2w5Ayq7G.js → vue-ui-timer-CwJoQApu.js} +5 -5
- package/dist/{vue-ui-tiremarks-BJnh0GBj.js → vue-ui-tiremarks-CFVl_w7d.js} +7 -7
- package/dist/{vue-ui-tiremarks-Cf04zARl.cjs → vue-ui-tiremarks-_d9WOe-N.cjs} +1 -1
- package/dist/vue-ui-treemap-BaQFfbqL.cjs +1 -0
- package/dist/{vue-ui-treemap-BD546LBi.js → vue-ui-treemap-BtjPxOzu.js} +108 -108
- package/dist/{vue-ui-vertical-bar-D3QKHHnS.cjs → vue-ui-vertical-bar-BcjM9qCI.cjs} +3 -3
- package/dist/{vue-ui-vertical-bar-E5CTb1Bd.js → vue-ui-vertical-bar-xnQDjCLE.js} +54 -54
- package/dist/{vue-ui-waffle-BAJIMbZK.js → vue-ui-waffle-BMFtG4mh.js} +99 -99
- package/dist/vue-ui-waffle-DGarEDP5.cjs +1 -0
- package/dist/{vue-ui-wheel-CPPLUSFq.js → vue-ui-wheel-DIr8JQt0.js} +7 -7
- package/dist/{vue-ui-wheel-Dy_B7BTG.cjs → vue-ui-wheel-DLFWUmdm.cjs} +1 -1
- package/dist/vue-ui-word-cloud-CDQ4rkP-.cjs +1 -0
- package/dist/{vue-ui-word-cloud-BVZcDY7m.js → vue-ui-word-cloud-CrSkUMkN.js} +81 -81
- package/dist/{vue-ui-xy-tB-6IP2y.js → vue-ui-xy-DPT3SYuU.js} +815 -818
- package/dist/vue-ui-xy-DfnDyl8o.cjs +3 -0
- package/dist/{vue-ui-xy-canvas-DFUfTZwz.js → vue-ui-xy-canvas-C3iMSkvP.js} +35 -35
- package/dist/{vue-ui-xy-canvas-BSZTrqci.cjs → vue-ui-xy-canvas-DEyhDtC-.cjs} +3 -3
- package/package.json +1 -1
- package/dist/vue-ui-age-pyramid-BdseHKUc.cjs +0 -1
- package/dist/vue-ui-donut-BP7yj2DU.cjs +0 -1
- package/dist/vue-ui-donut-evolution-Cz8uFJp8.cjs +0 -1
- package/dist/vue-ui-dumbbell-CYqHCr2S.cjs +0 -9
- package/dist/vue-ui-flow-HeRCplGL.cjs +0 -1
- package/dist/vue-ui-funnel-DxniWNkD.cjs +0 -1
- package/dist/vue-ui-galaxy-BDA64dud.cjs +0 -1
- package/dist/vue-ui-heatmap-CbKgGLtN.cjs +0 -1
- package/dist/vue-ui-history-plot-BoMdvItE.cjs +0 -1
- package/dist/vue-ui-molecule-CeoDnPXB.cjs +0 -1
- package/dist/vue-ui-mood-radar-BwOqQUuT.cjs +0 -1
- package/dist/vue-ui-quadrant-BXQVOvpY.cjs +0 -1
- package/dist/vue-ui-quick-chart-dLItYwM_.cjs +0 -15
- package/dist/vue-ui-radar-BuNtocmn.cjs +0 -1
- package/dist/vue-ui-scatter-DTy3yPVu.cjs +0 -1
- package/dist/vue-ui-strip-plot-f7vejZht.cjs +0 -1
- package/dist/vue-ui-treemap-D0vi4bv4.cjs +0 -1
- package/dist/vue-ui-waffle-BL0e3Yeq.cjs +0 -1
- package/dist/vue-ui-word-cloud-BPoAoeWZ.cjs +0 -1
- package/dist/vue-ui-xy-D4hRtHAi.cjs +0 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),u=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),u=require("./index-1HOIfTy2.cjs"),c=require("./useResponsive-BJ7DTGpm.cjs"),ot=require("./Tooltip-CL7aSMgq.cjs"),rt=require("./Legend-CY6wjCYY.cjs"),nt=require("./Title-C10173bN.cjs"),ut=require("./Slicer-CnNbe-dl.cjs"),Ee=require("./usePrinter-i-j4CdEi.cjs"),st=require("./vue-ui-accordion-Cd6GaDwU.cjs"),it=require("./DataTable-BmKl4AAb.cjs"),ct=require("./vue-ui-skeleton-CLiDRcQX.cjs"),Ne=require("./useNestedProp-BFNnjpX-.cjs"),vt=require("./PenAndPaper--xHLJRME.cjs"),dt=require("./useUserOptionState-BgepsfED.cjs"),ht=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),yt=["id"],ft=["onClick"],gt={key:2,class:"vue-data-ui-watermark"},pt=["innerHTML"],mt={__name:"vue-ui-xy-canvas",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},emits:["selectLegend"],setup(re,{expose:Be,emit:De}){const p=re,{vue_ui_xy_canvas:Fe}=u.useConfig(),Z=l.ref(u.createUid()),N=l.ref(null),S=l.ref(null),B=l.ref(null),i=l.ref(null),g=l.ref(1),T=l.ref(1),H=l.ref(!1),y=l.ref(null),V=l.ref(""),ne=l.ref(null),C=l.ref([]),O=l.ref(1),M=l.ref(!0),z=l.ref(!0),G=l.ref(null),ue=l.ref(0),se=l.ref(0),U=l.ref(!1),ie=l.ref(null),ce=l.ref(null),ve=l.ref(null),de=l.ref(null),j=l.ref(0),J=l.ref(0),K=l.ref(0),Q=l.computed(()=>!!p.dataset&&p.dataset.length),Ae=l.useSlots();l.onMounted(()=>{Ae["chart-background"]&&console.warn("VueUiXyCanvas does not support the #chart-background slot.")});const t=l.computed({get:()=>fe(),set:e=>e}),{userOptionsVisible:ee,setUserOptionsVisibility:he,keepUserOptionState:ye}=dt.useUserOptionState({config:t.value});function fe(){const e=Ne.useNestedProp({userConfig:p.config,defaultConfig:Fe});let a={};return e.theme?a={...Ne.useNestedProp({userConfig:u.themes.vue_ui_xy_canvas[e.theme]||p.config,defaultConfig:e}),customPalette:u.themePalettes[e.theme]||u.palette}:a=e,p.config&&u.hasDeepProperty(p.config,"style.chart.scale.min")?a.style.chart.scale.min=p.config.style.chart.scale.min:a.style.chart.scale.min=null,p.config&&u.hasDeepProperty(p.config,"style.chart.scale.max")?a.style.chart.scale.max=p.config.style.chart.scale.max:a.style.chart.scale.max=null,p.config&&u.hasDeepProperty(p.config,"style.chart.zoom.startIndex")?a.style.chart.zoom.startIndex=p.config.style.chart.zoom.startIndex:a.style.chart.zoom.startIndex=null,p.config&&u.hasDeepProperty(p.config,"style.chart.zoom.endIndex")?a.style.chart.zoom.endIndex=p.config.style.chart.zoom.endIndex:a.style.chart.zoom.endIndex=null,a}l.watch(()=>p.config,e=>{t.value=fe(),ee.value=!t.value.showOnChartHover,le(),j.value+=1,J.value+=1,K.value+=1,s.value.showTable=t.value.table.show,s.value.showDataLabels=t.value.style.chart.dataLabels.show,s.value.stacked=t.value.style.chart.stacked,s.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0}),l.watch(()=>p.dataset,()=>{le(),j.value+=1,J.value+=1,K.value+=1},{deep:!0});const ge=l.ref(t.value.style.chart.aspectRatio),{isPrinting:pe,isImaging:me,generatePdf:be,generateImage:xe}=Ee.usePrinter({elementId:`xy_canvas_${Z.value}`,fileName:t.value.style.chart.title.text||"vue-ui-xy-canvas"}),s=l.ref({showTable:t.value.table.show,showDataLabels:t.value.style.chart.dataLabels.show,stacked:t.value.style.chart.stacked,showTooltip:t.value.style.chart.tooltip.show});function He(e){U.value=e,se.value+=1}const ke=l.computed(()=>u.convertCustomPalette(t.value.customPalette)),w=l.computed(()=>R.value?Math.max(...R.value.filter((e,a)=>!C.value.includes(e.absoluteIndex)).map(e=>e.series.length)):0),o=l.computed(()=>{const e=g.value-g.value*(t.value.style.chart.paddingProportions.left+t.value.style.chart.paddingProportions.right);return{canvasWidth:g.value,canvasHeight:T.value,left:g.value*t.value.style.chart.paddingProportions.left,top:T.value*t.value.style.chart.paddingProportions.top,right:g.value-g.value*t.value.style.chart.paddingProportions.right,bottom:T.value-T.value*t.value.style.chart.paddingProportions.bottom,width:e,height:T.value-T.value*(t.value.style.chart.paddingProportions.top+t.value.style.chart.paddingProportions.bottom),slot:e/(n.value.end-n.value.start)}});function Le(e,a){return e/a}function Ve({hasAutoScale:e,series:a,min:r,max:d,scale:h,yOffset:m,individualHeight:v,stackIndex:b=null}){return a.map((L,oe)=>{const $=h.min<0?Math.abs(h.min):0,I=Le(L+$,$+h.max);let P,D;e&&(P=Math.abs(h.min),D=Le(L+P,h.max+P));let F=0;return b===null?F=o.value.bottom-o.value.height*(e?D:I):F=o.value.bottom-m-v*(e?D:I),{x:o.value.left+o.value.slot*oe+o.value.slot/2,y:F,value:L}})}const x=l.computed(()=>{const e=t.value.style.chart.scale.min!==null?t.value.style.chart.scale.min:Math.min(...R.value.filter((v,b)=>!C.value.includes(v.absoluteIndex)).flatMap(v=>v.series.slice(n.value.start,n.value.end))),a=t.value.style.chart.scale.max!==null?t.value.style.chart.scale.max:Math.max(...R.value.filter((v,b)=>!C.value.includes(v.absoluteIndex)).flatMap(v=>v.series.slice(n.value.start,n.value.end))),r=u.calculateNiceScale(e<0?e:0,a===e?e+1<0?0:e+1:a<0?0:a,t.value.style.chart.scale.ticks),d=r.min<0?Math.abs(r.min):0,h=o.value.bottom-o.value.height*(d/(r.max+d)),m=r.ticks.map(v=>({y:o.value.bottom-o.value.height*((v+d)/(r.max+d)),x:o.value.left-8,value:v}));return{absoluteMin:d,max:a,min:e,scale:r,yLabels:m,zero:h}}),Ue=l.computed(()=>f.value.map(e=>`
|
|
2
2
|
<div style="display:flex;flex-direction:row;gap:6px;align-items:center;">
|
|
3
3
|
<svg viewBox="0 0 10 10" height="12" width="12">
|
|
4
4
|
<circle cx="5" cy="5" r="5" fill="${e.color}"/>
|
|
5
5
|
</svg>
|
|
6
6
|
<span>${e.name?e.name+": ":""}</span>
|
|
7
|
-
<span>${u.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.series[
|
|
7
|
+
<span>${u.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.series[y.value],u.dataLabel({p:e.prefix||"",v:e.series[y.value],s:e.suffix||"",r:e.rounding||0}),{datapoint:e,seriesIndex:y.value})}</span>
|
|
8
8
|
</div>
|
|
9
|
-
`)),R=l.computed(()=>p.dataset.map((e,a)=>({...e,series:u.largestTriangleThreeBucketsArray({data:u.sanitizeArray(e.series),threshold:t.value.downsample.threshold}),absoluteIndex:a,color:u.convertColorToHex(e.color||ke.value[a]||u.palette[a]||u.palette[a%u.palette.length])})));l.watch(w,e=>{e&&Ce()});const y=l.computed(()=>u.assignStackRatios(R.value.filter((e,a)=>!C.value.includes(e.absoluteIndex))).map((e,a)=>({...e,series:e.series.slice(n.value.start,n.value.end)})).map((e,a)=>{let r=[null,void 0].includes(e.scaleMin)?Math.min(...e.series)||0:e.scaleMin,d=[null,void 0].includes(e.scaleMax)?Math.max(...e.series)||1:e.scaleMax;r===d&&(r=r>=0?d-1:r,d=d>=0?d:r+1);const m={ratios:e.series.filter(A=>![null,void 0].includes(A)).map(A=>(A-r)/(d-r)),valueMin:r,valueMax:d},v=e.scaleSteps||t.value.style.chart.scale.ticks;let b;e.autoScaling?b=u.calculateNiceScale(m.valueMin,m.valueMax,v):b=u.calculateNiceScale(m.valueMin<0?m.valueMin:0,m.valueMax<=0?0:m.valueMax,v);const L=s.value.stacked?o.value.height*(1-e.cumulatedStackRatio):0,oe=s.value.stacked?o.value.height/t.value.style.chart.stackGap:0,$=s.value.stacked?o.value.height*e.stackRatio-oe:o.value.height,I=b.min<0?Math.abs(b.min):0;let P;e.autoScaling&&s.value.stacked&&d<=0?P=o.value.bottom-L-$:P=o.value.bottom-L-$*(I/(b.max+I));const F=b.ticks.map((A,at)=>({y:o.value.bottom-L-$*(at/(b.ticks.length-1)),x:o.value.left-8,value:A})),D=Ve({hasAutoScale:s.value.stacked&&e.autoScaling,series:e.series,min:s.value.stacked?r:x.value.min,max:s.value.stacked?d:x.value.max,scale:s.value.stacked?b:x.value.scale,yOffset:L,individualHeight:$,stackIndex:s.value.stacked?a:null});return{...e,coordinatesLine:D,min:r,max:d,localScale:b,localZero:P,localMin:I,localYLabels:F,yOffset:L,individualHeight:$}})),n=l.ref({start:0,end:w.value});function Ce(){we()}const E=l.ref(null);async function we(){(t.value.style.chart.zoom.startIndex!==null||t.value.style.chart.zoom.endIndex!==null)&&E.value?(t.value.style.chart.zoom.startIndex!==null&&(await l.nextTick(),await l.nextTick(),E.value&&E.value.setStartValue(t.value.style.chart.zoom.startIndex)),t.value.style.chart.zoom.endIndex!==null&&(await l.nextTick(),await l.nextTick(),E.value&&E.value.setEndValue(_e(t.value.style.chart.zoom.endIndex+1)))):(n.value={start:0,end:w.value},ue.value+=1)}function _e(e){const a=w.value;return e>a?a:e<0||t.value.style.chart.zoom.startIndex!==null&&e<t.value.style.chart.zoom.startIndex?t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex+1:1:e}const qe=l.computed(()=>y.value.filter(e=>["line","plot",void 0].includes(e.type))),k=l.computed(()=>y.value.filter(e=>e.type==="bar"));function We(){if(!S.value)return;const e=B.value.offsetWidth,a=B.value.offsetHeight;S.value.width=e*O.value*2,S.value.height=a*O.value*2,g.value=e*O.value*2,T.value=a*O.value*2,i.value.scale(O.value,O.value),te()}function Xe(){if(i.value.clearRect(0,0,1e4,1e4),i.value.fillStyle=t.value.style.chart.backgroundColor,i.value.fillRect(0,0,o.value.canvasWidth,o.value.canvasHeight),s.value.stacked)t.value.style.chart.grid.y.verticalLines.show&&n.value.end-n.value.start<t.value.style.chart.grid.y.verticalLines.hideUnderXLength?y.value.forEach(e=>{for(let a=0;a<n.value.end-n.value.start+1;a+=1)c.line(i.value,[{x:o.value.left+o.value.slot*a,y:o.value.bottom-e.yOffset-e.individualHeight},{x:o.value.left+o.value.slot*a,y:o.value.bottom-e.yOffset}],{color:t.value.style.chart.grid.y.verticalLines.color})}):t.value.style.chart.grid.y.verticalLines.show&&n.value.end-n.value.start>=t.value.style.chart.grid.y.verticalLines.hideUnderXLength&&y.value.forEach(e=>{for(let a=n.value.start;a<n.value.end;a+=1)a%Math.floor((n.value.end-n.value.start)/t.value.style.chart.grid.y.timeLabels.modulo)===0&&c.line(i.value,[{x:o.value.left+o.value.slot*(a-n.value.start)+o.value.slot/2,y:o.value.bottom-e.yOffset-e.individualHeight},{x:o.value.left+o.value.slot*(a-n.value.start)+o.value.slot/2,y:o.value.bottom-e.yOffset}],{color:t.value.style.chart.grid.y.verticalLines.color})}),t.value.style.chart.grid.x.horizontalLines.show&&(t.value.style.chart.grid.x.horizontalLines.alternate?y.value.forEach(e=>{e.localYLabels.forEach((a,r)=>{r<e.localYLabels.length-1&&c.rect(i.value,[{x:o.value.left,y:a.y},{x:o.value.right,y:a.y},{x:o.value.right,y:e.localYLabels[r+1].y},{x:o.value.left,y:e.localYLabels[r+1].y}],{fillColor:r%2===0?"transparent":u.setOpacity(t.value.style.chart.grid.x.horizontalLines.color,t.value.style.chart.grid.x.horizontalLines.opacity),strokeColor:"transparent"})})}):y.value.forEach(e=>{e.localYLabels.slice(n.value.start,n.value.end).forEach(a=>{c.line(i.value,[{x:o.value.left,y:a.y},{x:o.value.right,y:a.y}],{color:t.value.style.chart.grid.x.horizontalLines.color})})})),t.value.style.chart.grid.zeroLine.show&&y.value.forEach(e=>{c.line(i.value,[{x:o.value.left,y:e.localZero},{x:o.value.right,y:e.localZero}],{color:t.value.style.chart.grid.zeroLine.color,lineDash:t.value.style.chart.grid.zeroLine.dashed?[10,10]:[0,0]})}),t.value.style.chart.grid.y.axisLabels.show&&y.value.forEach(e=>{c.line(i.value,[{x:o.value.left,y:o.value.bottom-e.yOffset},{x:o.value.left,y:o.value.bottom-e.yOffset-e.individualHeight}],{color:e.color}),c.line(i.value,[{x:o.value.right,y:o.value.bottom-e.yOffset},{x:o.value.right,y:o.value.bottom-e.yOffset-e.individualHeight}],{color:e.color}),e.localYLabels.forEach((a,r)=>{c.text(i.value,u.applyDataLabel(t.value.style.chart.dataLabels.formatter,a.value,u.dataLabel({p:e.prefix||t.value.style.chart.grid.y.axisLabels.prefix||"",v:a.value,s:e.suffix||t.value.style.chart.grid.y.axisLabels.suffix||"",r:e.rounding||t.value.style.chart.grid.y.axisLabels.rounding||0}),{datapoint:a,seriesIndex:r}),a.x+t.value.style.chart.grid.y.axisLabels.offsetX,a.y,{align:"right",font:`${Math.round(g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:e.color})})}),y.value.forEach(e=>{c.text(i.value,e.name,g.value/35,o.value.bottom-e.yOffset-e.individualHeight/2,{align:"center",rotation:-90,color:e.color,font:`${Math.round(g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`})});else{if(t.value.style.chart.grid.y.verticalLines.show&&n.value.end-n.value.start<t.value.style.chart.grid.y.verticalLines.hideUnderXLength)for(let e=0;e<n.value.end-n.value.start+1;e+=1)c.line(i.value,[{x:o.value.left+o.value.slot*e,y:o.value.top},{x:o.value.left+o.value.slot*e,y:o.value.bottom}],{color:t.value.style.chart.grid.y.verticalLines.color});else if(t.value.style.chart.grid.y.verticalLines.show&&n.value.end-n.value.start>=t.value.style.chart.grid.y.verticalLines.hideUnderXLength)for(let e=n.value.start;e<n.value.end;e+=1)e%Math.floor((n.value.end-n.value.start)/t.value.style.chart.grid.y.timeLabels.modulo)===0&&c.line(i.value,[{x:o.value.left+o.value.slot*(e-n.value.start)+o.value.slot/2,y:o.value.top},{x:o.value.left+o.value.slot*(e-n.value.start)+o.value.slot/2,y:o.value.bottom}],{color:t.value.style.chart.grid.y.verticalLines.color});t.value.style.chart.grid.x.horizontalLines.show&&(t.value.style.chart.grid.x.horizontalLines.alternate?x.value.yLabels.forEach((e,a)=>{a<x.value.yLabels.length-1&&c.rect(i.value,[{x:o.value.left,y:e.y},{x:o.value.right,y:e.y},{x:o.value.right,y:x.value.yLabels[a+1].y},{x:o.value.left,y:x.value.yLabels[a+1].y}],{fillColor:a%2===0?"transparent":u.setOpacity(t.value.style.chart.grid.x.horizontalLines.color,t.value.style.chart.grid.x.horizontalLines.opacity),strokeColor:"transparent"})}):x.value.yLabels.forEach(e=>{c.line(i.value,[{x:o.value.left,y:e.y},{x:o.value.right,y:e.y}],{color:t.value.style.chart.grid.x.horizontalLines.color})})),t.value.style.chart.grid.y.showAxis&&c.line(i.value,[{x:o.value.left,y:o.value.top},{x:o.value.left,y:o.value.bottom}],{color:t.value.style.chart.grid.y.axisColor,lineWidth:t.value.style.chart.grid.y.axisThickness}),t.value.style.chart.grid.x.showAxis&&c.line(i.value,[{x:o.value.left,y:o.value.bottom},{x:o.value.right,y:o.value.bottom}],{color:t.value.style.chart.grid.x.axisColor,lineWidth:t.value.style.chart.grid.x.axisThickness}),t.value.style.chart.grid.zeroLine.show&&c.line(i.value,[{x:o.value.left,y:x.value.zero},{x:o.value.right,y:x.value.zero}],{color:t.value.style.chart.grid.zeroLine.color,lineDash:t.value.style.chart.grid.zeroLine.dashed?[10,10]:[0,0]}),t.value.style.chart.grid.y.axisLabels.show&&x.value.yLabels.forEach((e,a)=>{c.text(i.value,u.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.value,u.dataLabel({p:t.value.style.chart.grid.y.axisLabels.prefix||"",v:e.value,s:t.value.style.chart.grid.y.axisLabels.suffix||"",r:t.value.style.chart.grid.y.axisLabels.rounding||0}),{datapoint:e,seriesIndex:a}),e.x+t.value.style.chart.grid.y.axisLabels.offsetX,e.y,{align:"right",font:`${Math.round(g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.grid.y.axisLabels.color})})}t.value.style.chart.grid.y.axisName&&c.text(i.value,t.value.style.chart.grid.y.axisName,g.value-g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio*1.2,o.value.bottom-o.value.height/2,{font:`${Math.round(g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.color,align:"center",rotation:90}),t.value.style.chart.grid.x.axisName&&c.text(i.value,t.value.style.chart.grid.x.axisName,g.value/2,T.value,{font:`${Math.round(g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.color,align:"center"})}function Ye(e){for(let a=0;a<e.coordinatesLine.length;a+=1){const r=(f.value===a?g.value/150:t.value.style.chart.line.plots.show?g.value/200:0)*t.value.style.chart.line.plots.radiusRatio;c.circle(i.value,{x:e.coordinatesLine[a].x,y:e.coordinatesLine[a].y},r,{color:t.value.style.chart.backgroundColor,fillStyle:e.color,strokeColor:"transparent"})}}function Ze(e){for(let a=0;a<e.coordinatesLine.length;a+=1)c.text(i.value,u.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.coordinatesLine[a].value,u.dataLabel({p:e.prefix||"",v:e.coordinatesLine[a].value,s:e.suffix||"",r:e.rounding||0}),{datapoint:e.coordinatesLine[a],seriesIndex:a}),e.coordinatesLine[a].x,e.coordinatesLine[a].y+t.value.style.chart.dataLabels.offsetY,{align:"center",font:`${Math.round(g.value/40*t.value.style.chart.dataLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.dataLabels.useSerieColor?e.color:t.value.style.chart.dataLabels.color,strokeColor:t.value.style.chart.backgroundColor,lineWidth:.8})}function Ge(){for(let e=n.value.start;e<n.value.end;e+=1)(n.value.end-n.value.start<t.value.style.chart.grid.y.timeLabels.modulo||n.value.end-n.value.start>=t.value.style.chart.grid.y.timeLabels.modulo&&(e%Math.floor((n.value.end-n.value.start)/t.value.style.chart.grid.y.timeLabels.modulo)===0||e===f.value+n.value.start))&&c.text(i.value,t.value.style.chart.grid.y.timeLabels.values[e]||e+1,o.value.left+o.value.slot*(e-n.value.start)+o.value.slot/2,o.value.bottom+g.value/t.value.style.chart.grid.y.timeLabels.offsetY,{align:t.value.style.chart.grid.y.timeLabels.rotation===0?"center":t.value.style.chart.grid.y.timeLabels.rotation>0?"left":"right",font:`${Math.round(g.value/40*t.value.style.chart.grid.y.timeLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:u.setOpacity(t.value.style.chart.grid.y.timeLabels.color,f.value!==null?f.value+n.value.start===e?100:20:100),rotation:t.value.style.chart.grid.y.timeLabels.rotation})}function Se(){c.line(i.value,[{x:o.value.left+o.value.slot*f.value+o.value.slot/2,y:o.value.top},{x:o.value.left+o.value.slot*f.value+o.value.slot/2,y:o.value.bottom}],{color:t.value.style.chart.selector.color,lineDash:t.value.style.chart.selector.dashed?[8,8]:[0,0],lineWidth:2,linceCap:"round"})}function je(){k.value.forEach((e,a)=>{for(let r=0;r<e.coordinatesLine.length;r+=1)c.rect(i.value,[{x:o.value.left+o.value.slot*r+o.value.slot/10+(s.value.stacked?0:o.value.slot/k.value.length*a-(a===0?0:o.value.slot/(5*k.value.length)*a)),y:s.value.stacked?e.localZero:x.value.zero},{x:o.value.left+o.value.slot*r+o.value.slot/10+(s.value.stacked?0:o.value.slot/k.value.length*a-(a===0?0:o.value.slot/(5*k.value.length)*a))+o.value.slot*.8/(s.value.stacked?1:k.value.length),y:s.value.stacked?e.localZero:x.value.zero},{x:o.value.left+o.value.slot*r+o.value.slot/10+(s.value.stacked?0:o.value.slot/k.value.length*a-(a===0?0:o.value.slot/(5*k.value.length)*a))+o.value.slot*.8/(s.value.stacked?1:k.value.length),y:e.coordinatesLine[r].y},{x:o.value.left+o.value.slot*r+o.value.slot/10+(s.value.stacked?0:o.value.slot/k.value.length*a-(a===0?0:o.value.slot/(5*k.value.length)*a)),y:e.coordinatesLine[r].y}],{strokeColor:t.value.style.chart.backgroundColor,gradient:{type:"linear",start:{x:e.coordinatesLine[r].x,y:e.coordinatesLine[r].y},end:{x:e.coordinatesLine[r].x,y:s.value.stacked?e.localZero:x.value.zero},stops:[{offset:0,color:e.color},{offset:1,color:u.lightenHexColor(e.color,.5)}]}}),s.value.showDataLabels&&[!0,void 0].includes(e.dataLabels)&&c.text(i.value,u.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.coordinatesLine[r].value,u.dataLabel({p:e.prefix||"",v:e.coordinatesLine[r].value,s:e.suffix||"",r:e.rounding||0}),{datapoint:e.coordinatesLine[r],seriesIndex:r}),o.value.left+o.value.slot*r+o.value.slot/10+(s.value.stacked?0:o.value.slot/k.value.length*a-(a===0?0:o.value.slot/(5*k.value.length)*a))+o.value.slot*.4/(s.value.stacked?1:k.value.length),(e.coordinatesLine[r].value<0?s.value.stacked?e.localZero:x.value.zero:e.coordinatesLine[r].y)+t.value.style.chart.dataLabels.offsetY,{align:"center",font:`${Math.round(g.value/40*t.value.style.chart.dataLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.dataLabels.useSerieColor?e.color:t.value.style.chart.dataLabels.color,strokeColor:t.value.style.chart.backgroundColor,lineWidth:.8})})}function Je(e){e.useArea?s.value.stacked?c.polygon(i.value,[{x:e.coordinatesLine[0].x,y:e.localZero},...e.coordinatesLine,{x:e.coordinatesLine.at(-1).x,y:e.localZero}],{fillColor:u.setOpacity(e.color,t.value.style.chart.area.opacity),strokeColor:"transparent"}):c.polygon(i.value,[{x:e.coordinatesLine[0].x,y:x.value.zero},...e.coordinatesLine,{x:e.coordinatesLine.at(-1).x,y:x.value.zero}],{fillColor:u.setOpacity(e.color,t.value.style.chart.area.opacity),strokeColor:"transparent"}):c.line(i.value,e.coordinatesLine,{color:e.color,lineWidth:3})}function Ke(){y.value.forEach((e,a)=>{c.line(i.value,[{x:o.value.left,y:o.value.bottom-e.yOffset},{x:o.value.right,y:o.value.bottom-e.yOffset}],{color:t.value.style.chart.grid.x.horizontalLines.color,lineWidth:1})})}function te(){Xe(),M.value?(z.value&&f.value!==null&&t.value.style.chart.selector.show&&Se(),je(),s.value.stacked&&t.value.style.chart.grid.x.showAxis&&Ke(),qe.value.forEach(e=>{(e.type==="line"||!e.type)&&Je(e),z.value&&(Ye(e),s.value.showDataLabels&&[!0,void 0].includes(e.dataLabels)&&Ze(e))}),G.value=c.cloneCanvas(S.value)):(G.value&&(i.value.clearRect(0,0,1e4,1e4),i.value.drawImage(G.value,0,0)),z.value&&f.value!==null&&t.value.style.chart.selector.show&&Se(),z.value&&f.value!==null&&y.value.forEach(e=>{if(e.type==="line"||!e.type||e.type==="plot"){if(!e.coordinatesLine[f.value])return;e.coordinatesLine[f.value].x!==void 0&&e.coordinatesLine[f.value].y!==void 0&&c.circle(i.value,{x:e.coordinatesLine[f.value].x,y:e.coordinatesLine[f.value].y},g.value/150*t.value.style.chart.line.plots.radiusRatio,{color:t.value.style.chart.backgroundColor,fillStyle:e.color,strokeColor:"transparent"})}})),t.value.style.chart.grid.y.timeLabels.show&&Ge(),M.value=!1}const _=c.debounce(()=>{z.value=!0,We()},w.value>200?10:1,!z.value);function Qe(e){const{left:a}=S.value.getBoundingClientRect(),r=e.clientX-a;if(r*2<o.value.left||r*2>o.value.right){H.value=!1,f.value=null;return}const d=r*2-o.value.left;if(f.value=Math.floor(d/o.value.slot),H.value=!0,!z.value)return;let h="";const m=t.value.style.chart.tooltip.customFormat;u.isFunction(m)&&u.functionReturnsString(()=>m({seriesIndex:f.value,datapoint:y.value.map(v=>({shape:v.shape||null,name:v.name,color:v.color,type:v.type||"line",value:v.series.find((b,L)=>L===f.value)})),series:y.value,config:t.value}))?V.value=m({seriesIndex:f.value,datapoint:y.value.map(v=>({shape:v.shape||null,name:v.name,color:v.color,type:v.type||"line",value:v.series.find((b,L)=>L===f.value)})),series:y.value,config:t.value}):(t.value.style.chart.grid.y.timeLabels.values.slice(n.value.start,n.value.end)[f.value]&&(h+=`<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${t.value.style.chart.tooltip.borderColor}; width:100%">${t.value.style.chart.grid.y.timeLabels.values.slice(n.value.start,n.value.end)[f.value]}</div>`),h+=Ue.value.join(""),V.value=h),z.value=!1}l.watch(()=>f.value,e=>{_()}),l.watch(()=>n.value,e=>{M.value=!0,te()},{deep:!0}),l.watch(()=>s.value.showDataLabels,e=>{M.value=!0,te()}),l.watch(()=>s.value.stacked,e=>{M.value=!0,z.value=!0,_()});function et(){H.value=!1,f.value=null,V.value=""}const q=l.ref(null),W=l.ref(null);l.onMounted(()=>{le()});function le(){if(u.objectIsEmpty(p.dataset)?u.error({componentName:"VueUiXyCanvas",type:"dataset"}):S.value&&(i.value=S.value.getContext("2d",{willReadFrequently:!0})),t.value.responsive){const e=c.throttle(()=>{const{width:a,height:r}=c.useResponsive({chart:N.value,title:t.value.style.chart.title.text?ie.value:null,legend:t.value.style.chart.legend.show?ce.value:null,slicer:t.value.style.chart.zoom.show&&w.value>1?ve.value:null,source:de.value});requestAnimationFrame(()=>{ge.value=`${a} / ${r}`})});q.value=new ResizeObserver(e),q.value.observe(N.value.parentNode)}W.value=new ResizeObserver(e=>{for(const a of e)a.contentBoxSize&&B.value&&(M.value=!0,_())}),W.value.observe(B.value),we()}l.onBeforeUnmount(()=>{W.value&&W.value.disconnect(),q.value&&q.value.disconnect()});function ze(e){Fe("selectLegend",y.value.find(a=>a.absoluteIndex===e)),C.value.includes(e)?C.value=C.value.filter(a=>a!==e):C.value.push(e),M.value=!0,_()}const $e=l.computed(()=>R.value.map((e,a)=>({...e,name:e.name,color:u.convertColorToHex(e.color)||ke.value[a]||u.palette[a]||u.palette[a%u.palette.length],shape:e.shape||"circle",prefix:e.prefix||"",suffix:e.suffix||"",rounding:e.rounding||0})).map(e=>({...e,opacity:C.value.includes(e.absoluteIndex)?.5:1,segregate:()=>ze(e.absoluteIndex),isSegregated:C.value.includes(e.absoluteIndex)}))),tt=l.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":""})),X=l.computed(()=>{const e=[""].concat(y.value.map(h=>h.name)).concat(' <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>');let a=[];for(let h=0;h<w.value;h+=1){const m=y.value.map(v=>v.series[h]??0).reduce((v,b)=>v+b,0);a.push([t.value.style.chart.grid.y.timeLabels.values.slice(n.value.start,n.value.end)[h]??h+1].concat(y.value.map(v=>(v.series[h]??0).toFixed(t.value.table.rounding))).concat((m??0).toFixed(t.value.table.rounding)))}const r={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},d=[t.value.table.columnNames.period].concat(y.value.map(h=>h.name)).concat(t.value.table.columnNames.total);return{head:e,body:a.slice(0,n.value.end-n.value.start),config:r,colNames:d}}),Te=l.computed(()=>{if(y.value.length===0)return{head:[],body:[],config:{},columnNames:[]};const e=y.value.map(r=>({label:r.name,color:r.color,type:r.type})),a=[];for(let r=n.value.start;r<n.value.end;r+=1){const d=[t.value.style.chart.grid.y.timeLabels.values[r]||r+1];y.value.forEach(h=>{d.push(Number((h.series[r]||0).toFixed(t.value.table.rounding)))}),a.push(d)}return{head:e,body:a}});function Ie(){const e=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],a=["",...Te.value.head.map(m=>m.label)],r=Te.value.body,d=e.concat([a]).concat(r),h=u.createCsvContent(d);u.downloadCsv({csvContent:h,title:t.value.style.chart.title.text||"vue-ui-xy-canvas"})}function lt(){return y.value}function Pe(){s.value.showTable=!s.value.showTable}function Me(){s.value.showDataLabels=!s.value.showDataLabels}function Oe(){s.value.stacked=!s.value.stacked}function Re(){s.value.showTooltip=!s.value.showTooltip}const Y=l.ref(!1);function ae(){Y.value=!Y.value}return Be({getData:lt,generateCsv:Ie,generatePdf:be,generateImage:xe,toggleTable:Pe,toggleLabels:Me,toggleStack:Oe,toggleTooltip:Re,toggleAnnotator:ae}),(e,a)=>(l.openBlock(),l.createElementBlock("div",{style:l.normalizeStyle(`width:100%; position:relative; ${t.value.responsive?"height: 100%":""}`),ref_key:"xy",ref:N,id:`xy_canvas_${Z.value}`,class:l.normalizeClass(`vue-ui-donut ${U.value?"vue-data-ui-wrapper-fullscreen":""}`),onMouseenter:a[5]||(a[5]=()=>l.unref(he)(!0)),onMouseleave:a[6]||(a[6]=()=>l.unref(he)(!1))},[t.value.style.chart.title.text?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:ie,style:l.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};`)},[(l.openBlock(),l.createBlock(nt._sfc_main,{key:`title_${j.value}`,config:{title:{cy:"xy-canvas-title",...t.value.style.chart.title},subtitle:{cy:"xy-canvas-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):l.createCommentVNode("",!0),t.value.userOptions.show&&Q.value&&(l.unref(fe)||l.unref(ee))?(l.openBlock(),l.createBlock(Ee.UserOptions,{ref:"details",key:`user_option_${se.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:l.unref(pe),isImaging:l.unref(me),uid:Z.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasLabel:t.value.userOptions.buttons.labels,hasStack:re.dataset.length>1&&t.value.userOptions.buttons.stack,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasTable:n.value.end-n.value.start<200&&t.value.userOptions.buttons.table,isFullscreen:U.value,isTooltip:s.value.showTooltip,isStacked:s.value.stacked,titles:{...t.value.userOptions.buttonTitles},chartElement:N.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:Y.value,onToggleFullscreen:He,onGeneratePdf:l.unref(be),onGenerateCsv:Ie,onGenerateImage:l.unref(xe),onToggleTable:Pe,onToggleLabels:Me,onToggleStack:Oe,onToggleTooltip:Re,onToggleAnnotator:ae,style:l.normalizeStyle({visibility:l.unref(fe)?l.unref(ee)?"visible":"hidden":"visible"})},l.createSlots({_:2},[e.$slots.optionTooltip?{name:"optionTooltip",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,e.$slots.optionPdf?{name:"optionPdf",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,e.$slots.optionCsv?{name:"optionCsv",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,e.$slots.optionImg?{name:"optionImg",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,e.$slots.optionTable?{name:"optionTable",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,e.$slots.optionLabels?{name:"optionLabels",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,e.$slots.optionStack?{name:"optionStack",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionStack",{},void 0,!0)]),key:"6"}:void 0,e.$slots.optionFullscreen?{name:"optionFullscreen",fn:l.withCtx(({toggleFullscreen:r,isFullscreen:d})=>[l.renderSlot(e.$slots,"optionFullscreen",l.normalizeProps(l.guardReactiveProps({toggleFullscreen:r,isFullscreen:d})),void 0,!0)]),key:"7"}:void 0,e.$slots.optionAnnotator?{name:"optionAnnotator",fn:l.withCtx(({toggleAnnotator:r,isAnnotator:d})=>[l.renderSlot(e.$slots,"optionAnnotator",l.normalizeProps(l.guardReactiveProps({toggleAnnotator:r,isAnnotator:d})),void 0,!0)]),key:"8"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasLabel","hasStack","hasFullscreen","hasTable","isFullscreen","isTooltip","isStacked","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:"vue-ui-xy-canvas",style:l.normalizeStyle(`position: relative; aspect-ratio: ${ge.value}`),ref_key:"container",ref:B},[Q.value?(l.openBlock(),l.createElementBlock("canvas",{key:0,ref_key:"canvas",ref:S,style:{width:"100%",height:"100%"},onMousemove:a[0]||(a[0]=r=>Qe(r)),onMouseleave:et},null,544)):(l.openBlock(),l.createBlock(ct.default,{key:1,config:{type:"line",style:{backgroundColor:t.value.style.chart.backgroundColor,line:{axis:{color:"#CCCCCC"},path:{color:"#CCCCCC",strokeWidth:.5}}}}},null,8,["config"])),l.createVNode(ot._sfc_main,{show:s.value.showTooltip&&H.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,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:S.value,content:V.value,isFullscreen:U.value,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,isCustom:l.unref(u.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":l.withCtx(()=>[l.renderSlot(e.$slots,"tooltip-before",l.normalizeProps(l.guardReactiveProps({...ne.value})),void 0,!0)]),"tooltip-after":l.withCtx(()=>[l.renderSlot(e.$slots,"tooltip-after",l.normalizeProps(l.guardReactiveProps({...ne.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","position","offsetY","parent","content","isFullscreen","backgroundOpacity","isCustom"])],4),l.createElementVNode("div",{ref_key:"chartSlicer",ref:ve,style:l.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor}`),"data-html2canvas-ignore":""},[t.value.style.chart.zoom.show&&w.value>1?(l.openBlock(),l.createBlock(ut.Slicer,{ref_key:"slicerComponent",ref:E,key:`slicer_${ue.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.grid.y.timeLabels.values[n.value.start]?t.value.style.chart.grid.y.timeLabels.values[n.value.start]:"",labelRight:t.value.style.chart.grid.y.timeLabels.values[n.value.end-1]?t.value.style.chart.grid.y.timeLabels.values[n.value.end-1]:"",textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,max:w.value,min:0,valueStart:n.value.start,valueEnd:n.value.end,start:n.value.start,"onUpdate:start":a[1]||(a[1]=r=>n.value.start=r),end:n.value.end,"onUpdate:end":a[2]||(a[2]=r=>n.value.end=r),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:w.value,enableRangeHandles:t.value.style.chart.zoom.enableRangeHandles,enableSelectionDrag:t.value.style.chart.zoom.enableSelectionDrag,onReset:Ce},{"reset-action":l.withCtx(({reset:r})=>[l.renderSlot(e.$slots,"reset-action",l.normalizeProps(l.guardReactiveProps({reset:r})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end","refreshStartPoint","refreshEndPoint","enableRangeHandles","enableSelectionDrag"])):l.createCommentVNode("",!0)],4),l.createElementVNode("div",{ref_key:"chartLegend",ref:ce},[t.value.style.chart.legend.show&&Q.value?(l.openBlock(),l.createBlock(rt.Legend,{legendSet:$e.value,config:tt.value,key:`legend_${K.value}`,onClickMarker:a[3]||(a[3]=({i:r})=>ze(r))},{item:l.withCtx(({legend:r,index:d})=>[l.createElementVNode("div",{onClick:h=>r.segregate(),style:l.normalizeStyle(`opacity:${C.value.includes(d)?.5:1}`)},l.toDisplayString(r.name),13,yt)]),_:1},8,["legendSet","config"])):l.renderSlot(e.$slots,"legend",{key:1,legend:$e.value},void 0,!0)],512),e.$slots.watermark?(l.openBlock(),l.createElementBlock("div",gt,[l.renderSlot(e.$slots,"watermark",l.normalizeProps(l.guardReactiveProps({isPrinting:l.unref(pe)||l.unref(me)})),void 0,!0)])):l.createCommentVNode("",!0),e.$slots.source?(l.openBlock(),l.createElementBlock("div",{key:3,ref_key:"source",ref:de,dir:"auto"},[l.renderSlot(e.$slots,"source",{},void 0,!0)],512)):l.createCommentVNode("",!0),n.value.end-n.value.start<200?(l.openBlock(),l.createBlock(st.default,{key:4,hideDetails:"",config:{open:s.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:l.withCtx(()=>[(l.openBlock(),l.createBlock(it.DataTable,{key:`table_${J.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:a[4]||(a[4]=r=>s.value.showTable=!1)},{th:l.withCtx(({th:r})=>[l.createElementVNode("div",{innerHTML:r},null,8,pt)]),td:l.withCtx(({td:r})=>[l.createTextVNode(l.toDisplayString(r),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):l.createCommentVNode("",!0),t.value.userOptions.buttons.annotator&&y.value.length?(l.openBlock(),l.createBlock(vt.PenAndPaper,{key:5,parent:N.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:Y.value,onClose:ae},null,8,["parent","backgroundColor","color","active"])):l.createCommentVNode("",!0)],46,ft))}},bt=ht._export_sfc(mt,[["__scopeId","data-v-0d7dcce5"]]);exports.default=bt;
|
|
9
|
+
`)),R=l.computed(()=>p.dataset.map((e,a)=>({...e,series:u.largestTriangleThreeBucketsArray({data:u.sanitizeArray(e.series),threshold:t.value.downsample.threshold}),absoluteIndex:a,color:u.convertColorToHex(e.color||ke.value[a]||u.palette[a]||u.palette[a%u.palette.length])})));l.watch(w,e=>{e&&Ce()});const f=l.computed(()=>u.assignStackRatios(R.value.filter((e,a)=>!C.value.includes(e.absoluteIndex))).map((e,a)=>({...e,series:e.series.slice(n.value.start,n.value.end)})).map((e,a)=>{let r=[null,void 0].includes(e.scaleMin)?Math.min(...e.series)||0:e.scaleMin,d=[null,void 0].includes(e.scaleMax)?Math.max(...e.series)||1:e.scaleMax;r===d&&(r=r>=0?d-1:r,d=d>=0?d:r+1);const m={ratios:e.series.filter(A=>![null,void 0].includes(A)).map(A=>(A-r)/(d-r)),valueMin:r,valueMax:d},v=e.scaleSteps||t.value.style.chart.scale.ticks;let b;e.autoScaling?b=u.calculateNiceScale(m.valueMin,m.valueMax,v):b=u.calculateNiceScale(m.valueMin<0?m.valueMin:0,m.valueMax<=0?0:m.valueMax,v);const L=s.value.stacked?o.value.height*(1-e.cumulatedStackRatio):0,oe=s.value.stacked?o.value.height/t.value.style.chart.stackGap:0,$=s.value.stacked?o.value.height*e.stackRatio-oe:o.value.height,I=b.min<0?Math.abs(b.min):0;let P;e.autoScaling&&s.value.stacked&&d<=0?P=o.value.bottom-L-$:P=o.value.bottom-L-$*(I/(b.max+I));const D=b.ticks.map((A,at)=>({y:o.value.bottom-L-$*(at/(b.ticks.length-1)),x:o.value.left-8,value:A})),F=Ve({hasAutoScale:s.value.stacked&&e.autoScaling,series:e.series,min:s.value.stacked?r:x.value.min,max:s.value.stacked?d:x.value.max,scale:s.value.stacked?b:x.value.scale,yOffset:L,individualHeight:$,stackIndex:s.value.stacked?a:null});return{...e,coordinatesLine:F,min:r,max:d,localScale:b,localZero:P,localMin:I,localYLabels:D,yOffset:L,individualHeight:$}})),n=l.ref({start:0,end:w.value});function Ce(){we()}const E=l.ref(null);async function we(){(t.value.style.chart.zoom.startIndex!==null||t.value.style.chart.zoom.endIndex!==null)&&E.value?(t.value.style.chart.zoom.startIndex!==null&&(await l.nextTick(),await l.nextTick(),E.value&&E.value.setStartValue(t.value.style.chart.zoom.startIndex)),t.value.style.chart.zoom.endIndex!==null&&(await l.nextTick(),await l.nextTick(),E.value&&E.value.setEndValue(_e(t.value.style.chart.zoom.endIndex+1)))):(n.value={start:0,end:w.value},ue.value+=1)}function _e(e){const a=w.value;return e>a?a:e<0||t.value.style.chart.zoom.startIndex!==null&&e<t.value.style.chart.zoom.startIndex?t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex+1:1:e}const qe=l.computed(()=>f.value.filter(e=>["line","plot",void 0].includes(e.type))),k=l.computed(()=>f.value.filter(e=>e.type==="bar"));function We(){if(!S.value)return;const e=B.value.offsetWidth,a=B.value.offsetHeight;S.value.width=e*O.value*2,S.value.height=a*O.value*2,g.value=e*O.value*2,T.value=a*O.value*2,i.value.scale(O.value,O.value),te()}function Xe(){if(i.value.clearRect(0,0,1e4,1e4),i.value.fillStyle=t.value.style.chart.backgroundColor,i.value.fillRect(0,0,o.value.canvasWidth,o.value.canvasHeight),s.value.stacked)t.value.style.chart.grid.y.verticalLines.show&&n.value.end-n.value.start<t.value.style.chart.grid.y.verticalLines.hideUnderXLength?f.value.forEach(e=>{for(let a=0;a<n.value.end-n.value.start+1;a+=1)c.line(i.value,[{x:o.value.left+o.value.slot*a,y:o.value.bottom-e.yOffset-e.individualHeight},{x:o.value.left+o.value.slot*a,y:o.value.bottom-e.yOffset}],{color:t.value.style.chart.grid.y.verticalLines.color})}):t.value.style.chart.grid.y.verticalLines.show&&n.value.end-n.value.start>=t.value.style.chart.grid.y.verticalLines.hideUnderXLength&&f.value.forEach(e=>{for(let a=n.value.start;a<n.value.end;a+=1)a%Math.floor((n.value.end-n.value.start)/t.value.style.chart.grid.y.timeLabels.modulo)===0&&c.line(i.value,[{x:o.value.left+o.value.slot*(a-n.value.start)+o.value.slot/2,y:o.value.bottom-e.yOffset-e.individualHeight},{x:o.value.left+o.value.slot*(a-n.value.start)+o.value.slot/2,y:o.value.bottom-e.yOffset}],{color:t.value.style.chart.grid.y.verticalLines.color})}),t.value.style.chart.grid.x.horizontalLines.show&&(t.value.style.chart.grid.x.horizontalLines.alternate?f.value.forEach(e=>{e.localYLabels.forEach((a,r)=>{r<e.localYLabels.length-1&&c.rect(i.value,[{x:o.value.left,y:a.y},{x:o.value.right,y:a.y},{x:o.value.right,y:e.localYLabels[r+1].y},{x:o.value.left,y:e.localYLabels[r+1].y}],{fillColor:r%2===0?"transparent":u.setOpacity(t.value.style.chart.grid.x.horizontalLines.color,t.value.style.chart.grid.x.horizontalLines.opacity),strokeColor:"transparent"})})}):f.value.forEach(e=>{e.localYLabels.slice(n.value.start,n.value.end).forEach(a=>{c.line(i.value,[{x:o.value.left,y:a.y},{x:o.value.right,y:a.y}],{color:t.value.style.chart.grid.x.horizontalLines.color})})})),t.value.style.chart.grid.zeroLine.show&&f.value.forEach(e=>{c.line(i.value,[{x:o.value.left,y:e.localZero},{x:o.value.right,y:e.localZero}],{color:t.value.style.chart.grid.zeroLine.color,lineDash:t.value.style.chart.grid.zeroLine.dashed?[10,10]:[0,0]})}),t.value.style.chart.grid.y.axisLabels.show&&f.value.forEach(e=>{c.line(i.value,[{x:o.value.left,y:o.value.bottom-e.yOffset},{x:o.value.left,y:o.value.bottom-e.yOffset-e.individualHeight}],{color:e.color}),c.line(i.value,[{x:o.value.right,y:o.value.bottom-e.yOffset},{x:o.value.right,y:o.value.bottom-e.yOffset-e.individualHeight}],{color:e.color}),e.localYLabels.forEach((a,r)=>{c.text(i.value,u.applyDataLabel(t.value.style.chart.dataLabels.formatter,a.value,u.dataLabel({p:e.prefix||t.value.style.chart.grid.y.axisLabels.prefix||"",v:a.value,s:e.suffix||t.value.style.chart.grid.y.axisLabels.suffix||"",r:e.rounding||t.value.style.chart.grid.y.axisLabels.rounding||0}),{datapoint:a,seriesIndex:r}),a.x+t.value.style.chart.grid.y.axisLabels.offsetX,a.y,{align:"right",font:`${Math.round(g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:e.color})})}),f.value.forEach(e=>{c.text(i.value,e.name,g.value/35,o.value.bottom-e.yOffset-e.individualHeight/2,{align:"center",rotation:-90,color:e.color,font:`${Math.round(g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`})});else{if(t.value.style.chart.grid.y.verticalLines.show&&n.value.end-n.value.start<t.value.style.chart.grid.y.verticalLines.hideUnderXLength)for(let e=0;e<n.value.end-n.value.start+1;e+=1)c.line(i.value,[{x:o.value.left+o.value.slot*e,y:o.value.top},{x:o.value.left+o.value.slot*e,y:o.value.bottom}],{color:t.value.style.chart.grid.y.verticalLines.color});else if(t.value.style.chart.grid.y.verticalLines.show&&n.value.end-n.value.start>=t.value.style.chart.grid.y.verticalLines.hideUnderXLength)for(let e=n.value.start;e<n.value.end;e+=1)e%Math.floor((n.value.end-n.value.start)/t.value.style.chart.grid.y.timeLabels.modulo)===0&&c.line(i.value,[{x:o.value.left+o.value.slot*(e-n.value.start)+o.value.slot/2,y:o.value.top},{x:o.value.left+o.value.slot*(e-n.value.start)+o.value.slot/2,y:o.value.bottom}],{color:t.value.style.chart.grid.y.verticalLines.color});t.value.style.chart.grid.x.horizontalLines.show&&(t.value.style.chart.grid.x.horizontalLines.alternate?x.value.yLabels.forEach((e,a)=>{a<x.value.yLabels.length-1&&c.rect(i.value,[{x:o.value.left,y:e.y},{x:o.value.right,y:e.y},{x:o.value.right,y:x.value.yLabels[a+1].y},{x:o.value.left,y:x.value.yLabels[a+1].y}],{fillColor:a%2===0?"transparent":u.setOpacity(t.value.style.chart.grid.x.horizontalLines.color,t.value.style.chart.grid.x.horizontalLines.opacity),strokeColor:"transparent"})}):x.value.yLabels.forEach(e=>{c.line(i.value,[{x:o.value.left,y:e.y},{x:o.value.right,y:e.y}],{color:t.value.style.chart.grid.x.horizontalLines.color})})),t.value.style.chart.grid.y.showAxis&&c.line(i.value,[{x:o.value.left,y:o.value.top},{x:o.value.left,y:o.value.bottom}],{color:t.value.style.chart.grid.y.axisColor,lineWidth:t.value.style.chart.grid.y.axisThickness}),t.value.style.chart.grid.x.showAxis&&c.line(i.value,[{x:o.value.left,y:o.value.bottom},{x:o.value.right,y:o.value.bottom}],{color:t.value.style.chart.grid.x.axisColor,lineWidth:t.value.style.chart.grid.x.axisThickness}),t.value.style.chart.grid.zeroLine.show&&c.line(i.value,[{x:o.value.left,y:x.value.zero},{x:o.value.right,y:x.value.zero}],{color:t.value.style.chart.grid.zeroLine.color,lineDash:t.value.style.chart.grid.zeroLine.dashed?[10,10]:[0,0]}),t.value.style.chart.grid.y.axisLabels.show&&x.value.yLabels.forEach((e,a)=>{c.text(i.value,u.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.value,u.dataLabel({p:t.value.style.chart.grid.y.axisLabels.prefix||"",v:e.value,s:t.value.style.chart.grid.y.axisLabels.suffix||"",r:t.value.style.chart.grid.y.axisLabels.rounding||0}),{datapoint:e,seriesIndex:a}),e.x+t.value.style.chart.grid.y.axisLabels.offsetX,e.y,{align:"right",font:`${Math.round(g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.grid.y.axisLabels.color})})}t.value.style.chart.grid.y.axisName&&c.text(i.value,t.value.style.chart.grid.y.axisName,g.value-g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio*1.2,o.value.bottom-o.value.height/2,{font:`${Math.round(g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.color,align:"center",rotation:90}),t.value.style.chart.grid.x.axisName&&c.text(i.value,t.value.style.chart.grid.x.axisName,g.value/2,T.value,{font:`${Math.round(g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.color,align:"center"})}function Ye(e){for(let a=0;a<e.coordinatesLine.length;a+=1){const r=(y.value===a?g.value/150:t.value.style.chart.line.plots.show?g.value/200:0)*t.value.style.chart.line.plots.radiusRatio;c.circle(i.value,{x:e.coordinatesLine[a].x,y:e.coordinatesLine[a].y},r,{color:t.value.style.chart.backgroundColor,fillStyle:e.color,strokeColor:"transparent"})}}function Ze(e){for(let a=0;a<e.coordinatesLine.length;a+=1)c.text(i.value,u.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.coordinatesLine[a].value,u.dataLabel({p:e.prefix||"",v:e.coordinatesLine[a].value,s:e.suffix||"",r:e.rounding||0}),{datapoint:e.coordinatesLine[a],seriesIndex:a}),e.coordinatesLine[a].x,e.coordinatesLine[a].y+t.value.style.chart.dataLabels.offsetY,{align:"center",font:`${Math.round(g.value/40*t.value.style.chart.dataLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.dataLabels.useSerieColor?e.color:t.value.style.chart.dataLabels.color,strokeColor:t.value.style.chart.backgroundColor,lineWidth:.8})}function Ge(){for(let e=n.value.start;e<n.value.end;e+=1)(n.value.end-n.value.start<t.value.style.chart.grid.y.timeLabels.modulo||n.value.end-n.value.start>=t.value.style.chart.grid.y.timeLabels.modulo&&(e%Math.floor((n.value.end-n.value.start)/t.value.style.chart.grid.y.timeLabels.modulo)===0||e===y.value+n.value.start))&&c.text(i.value,t.value.style.chart.grid.y.timeLabels.values[e]||e+1,o.value.left+o.value.slot*(e-n.value.start)+o.value.slot/2,o.value.bottom+g.value/t.value.style.chart.grid.y.timeLabels.offsetY,{align:t.value.style.chart.grid.y.timeLabels.rotation===0?"center":t.value.style.chart.grid.y.timeLabels.rotation>0?"left":"right",font:`${Math.round(g.value/40*t.value.style.chart.grid.y.timeLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:u.setOpacity(t.value.style.chart.grid.y.timeLabels.color,y.value!==null?y.value+n.value.start===e?100:20:100),rotation:t.value.style.chart.grid.y.timeLabels.rotation})}function Se(){c.line(i.value,[{x:o.value.left+o.value.slot*y.value+o.value.slot/2,y:o.value.top},{x:o.value.left+o.value.slot*y.value+o.value.slot/2,y:o.value.bottom}],{color:t.value.style.chart.selector.color,lineDash:t.value.style.chart.selector.dashed?[8,8]:[0,0],lineWidth:2,linceCap:"round"})}function je(){k.value.forEach((e,a)=>{for(let r=0;r<e.coordinatesLine.length;r+=1)c.rect(i.value,[{x:o.value.left+o.value.slot*r+o.value.slot/10+(s.value.stacked?0:o.value.slot/k.value.length*a-(a===0?0:o.value.slot/(5*k.value.length)*a)),y:s.value.stacked?e.localZero:x.value.zero},{x:o.value.left+o.value.slot*r+o.value.slot/10+(s.value.stacked?0:o.value.slot/k.value.length*a-(a===0?0:o.value.slot/(5*k.value.length)*a))+o.value.slot*.8/(s.value.stacked?1:k.value.length),y:s.value.stacked?e.localZero:x.value.zero},{x:o.value.left+o.value.slot*r+o.value.slot/10+(s.value.stacked?0:o.value.slot/k.value.length*a-(a===0?0:o.value.slot/(5*k.value.length)*a))+o.value.slot*.8/(s.value.stacked?1:k.value.length),y:e.coordinatesLine[r].y},{x:o.value.left+o.value.slot*r+o.value.slot/10+(s.value.stacked?0:o.value.slot/k.value.length*a-(a===0?0:o.value.slot/(5*k.value.length)*a)),y:e.coordinatesLine[r].y}],{strokeColor:t.value.style.chart.backgroundColor,gradient:{type:"linear",start:{x:e.coordinatesLine[r].x,y:e.coordinatesLine[r].y},end:{x:e.coordinatesLine[r].x,y:s.value.stacked?e.localZero:x.value.zero},stops:[{offset:0,color:e.color},{offset:1,color:u.lightenHexColor(e.color,.5)}]}}),s.value.showDataLabels&&[!0,void 0].includes(e.dataLabels)&&c.text(i.value,u.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.coordinatesLine[r].value,u.dataLabel({p:e.prefix||"",v:e.coordinatesLine[r].value,s:e.suffix||"",r:e.rounding||0}),{datapoint:e.coordinatesLine[r],seriesIndex:r}),o.value.left+o.value.slot*r+o.value.slot/10+(s.value.stacked?0:o.value.slot/k.value.length*a-(a===0?0:o.value.slot/(5*k.value.length)*a))+o.value.slot*.4/(s.value.stacked?1:k.value.length),(e.coordinatesLine[r].value<0?s.value.stacked?e.localZero:x.value.zero:e.coordinatesLine[r].y)+t.value.style.chart.dataLabels.offsetY,{align:"center",font:`${Math.round(g.value/40*t.value.style.chart.dataLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.dataLabels.useSerieColor?e.color:t.value.style.chart.dataLabels.color,strokeColor:t.value.style.chart.backgroundColor,lineWidth:.8})})}function Je(e){e.useArea?s.value.stacked?c.polygon(i.value,[{x:e.coordinatesLine[0].x,y:e.localZero},...e.coordinatesLine,{x:e.coordinatesLine.at(-1).x,y:e.localZero}],{fillColor:u.setOpacity(e.color,t.value.style.chart.area.opacity),strokeColor:"transparent"}):c.polygon(i.value,[{x:e.coordinatesLine[0].x,y:x.value.zero},...e.coordinatesLine,{x:e.coordinatesLine.at(-1).x,y:x.value.zero}],{fillColor:u.setOpacity(e.color,t.value.style.chart.area.opacity),strokeColor:"transparent"}):c.line(i.value,e.coordinatesLine,{color:e.color,lineWidth:3})}function Ke(){f.value.forEach((e,a)=>{c.line(i.value,[{x:o.value.left,y:o.value.bottom-e.yOffset},{x:o.value.right,y:o.value.bottom-e.yOffset}],{color:t.value.style.chart.grid.x.horizontalLines.color,lineWidth:1})})}function te(){Xe(),M.value?(z.value&&y.value!==null&&t.value.style.chart.selector.show&&Se(),je(),s.value.stacked&&t.value.style.chart.grid.x.showAxis&&Ke(),qe.value.forEach(e=>{(e.type==="line"||!e.type)&&Je(e),z.value&&(Ye(e),s.value.showDataLabels&&[!0,void 0].includes(e.dataLabels)&&Ze(e))}),G.value=c.cloneCanvas(S.value)):(G.value&&(i.value.clearRect(0,0,1e4,1e4),i.value.drawImage(G.value,0,0)),z.value&&y.value!==null&&t.value.style.chart.selector.show&&Se(),z.value&&y.value!==null&&f.value.forEach(e=>{if(e.type==="line"||!e.type||e.type==="plot"){if(!e.coordinatesLine[y.value])return;e.coordinatesLine[y.value].x!==void 0&&e.coordinatesLine[y.value].y!==void 0&&c.circle(i.value,{x:e.coordinatesLine[y.value].x,y:e.coordinatesLine[y.value].y},g.value/150*t.value.style.chart.line.plots.radiusRatio,{color:t.value.style.chart.backgroundColor,fillStyle:e.color,strokeColor:"transparent"})}})),t.value.style.chart.grid.y.timeLabels.show&&Ge(),M.value=!1}const _=c.debounce(()=>{z.value=!0,We()},w.value>200?10:1,!z.value);function Qe(e){const{left:a}=S.value.getBoundingClientRect(),r=e.clientX-a;if(r*2<o.value.left||r*2>o.value.right){H.value=!1,y.value=null;return}const d=r*2-o.value.left;if(y.value=Math.floor(d/o.value.slot),H.value=!0,!z.value)return;let h="";const m=t.value.style.chart.tooltip.customFormat;u.isFunction(m)&&u.functionReturnsString(()=>m({seriesIndex:y.value,datapoint:f.value.map(v=>({shape:v.shape||null,name:v.name,color:v.color,type:v.type||"line",value:v.series.find((b,L)=>L===y.value)})),series:f.value,config:t.value}))?V.value=m({seriesIndex:y.value,datapoint:f.value.map(v=>({shape:v.shape||null,name:v.name,color:v.color,type:v.type||"line",value:v.series.find((b,L)=>L===y.value)})),series:f.value,config:t.value}):(t.value.style.chart.grid.y.timeLabels.values.slice(n.value.start,n.value.end)[y.value]&&(h+=`<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${t.value.style.chart.tooltip.borderColor}; width:100%">${t.value.style.chart.grid.y.timeLabels.values.slice(n.value.start,n.value.end)[y.value]}</div>`),h+=Ue.value.join(""),V.value=h),z.value=!1}l.watch(()=>y.value,e=>{_()}),l.watch(()=>n.value,e=>{M.value=!0,te()},{deep:!0}),l.watch(()=>s.value.showDataLabels,e=>{M.value=!0,te()}),l.watch(()=>s.value.stacked,e=>{M.value=!0,z.value=!0,_()});function et(){H.value=!1,y.value=null,V.value=""}const q=l.ref(null),W=l.ref(null);l.onMounted(()=>{le()});function le(){if(u.objectIsEmpty(p.dataset)?u.error({componentName:"VueUiXyCanvas",type:"dataset"}):S.value&&(i.value=S.value.getContext("2d",{willReadFrequently:!0})),t.value.responsive){const e=c.throttle(()=>{const{width:a,height:r}=c.useResponsive({chart:N.value,title:t.value.style.chart.title.text?ie.value:null,legend:t.value.style.chart.legend.show?ce.value:null,slicer:t.value.style.chart.zoom.show&&w.value>1?ve.value:null,source:de.value});requestAnimationFrame(()=>{ge.value=`${a} / ${r}`})});q.value=new ResizeObserver(e),q.value.observe(N.value.parentNode)}W.value=new ResizeObserver(e=>{for(const a of e)a.contentBoxSize&&B.value&&(M.value=!0,_())}),W.value.observe(B.value),we()}l.onBeforeUnmount(()=>{W.value&&W.value.disconnect(),q.value&&q.value.disconnect()});function ze(e){De("selectLegend",f.value.find(a=>a.absoluteIndex===e)),C.value.includes(e)?C.value=C.value.filter(a=>a!==e):C.value.push(e),M.value=!0,_()}const $e=l.computed(()=>R.value.map((e,a)=>({...e,name:e.name,color:u.convertColorToHex(e.color)||ke.value[a]||u.palette[a]||u.palette[a%u.palette.length],shape:e.shape||"circle",prefix:e.prefix||"",suffix:e.suffix||"",rounding:e.rounding||0})).map(e=>({...e,opacity:C.value.includes(e.absoluteIndex)?.5:1,segregate:()=>ze(e.absoluteIndex),isSegregated:C.value.includes(e.absoluteIndex)}))),tt=l.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":""})),X=l.computed(()=>{const e=[""].concat(f.value.map(h=>h.name)).concat(' <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>');let a=[];for(let h=0;h<w.value;h+=1){const m=f.value.map(v=>v.series[h]??0).reduce((v,b)=>v+b,0);a.push([t.value.style.chart.grid.y.timeLabels.values.slice(n.value.start,n.value.end)[h]??h+1].concat(f.value.map(v=>(v.series[h]??0).toFixed(t.value.table.rounding))).concat((m??0).toFixed(t.value.table.rounding)))}const r={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},d=[t.value.table.columnNames.period].concat(f.value.map(h=>h.name)).concat(t.value.table.columnNames.total);return{head:e,body:a.slice(0,n.value.end-n.value.start),config:r,colNames:d}}),Te=l.computed(()=>{if(f.value.length===0)return{head:[],body:[],config:{},columnNames:[]};const e=f.value.map(r=>({label:r.name,color:r.color,type:r.type})),a=[];for(let r=n.value.start;r<n.value.end;r+=1){const d=[t.value.style.chart.grid.y.timeLabels.values[r]||r+1];f.value.forEach(h=>{d.push(Number((h.series[r]||0).toFixed(t.value.table.rounding)))}),a.push(d)}return{head:e,body:a}});function Ie(){const e=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],a=["",...Te.value.head.map(m=>m.label)],r=Te.value.body,d=e.concat([a]).concat(r),h=u.createCsvContent(d);u.downloadCsv({csvContent:h,title:t.value.style.chart.title.text||"vue-ui-xy-canvas"})}function lt(){return f.value}function Pe(){s.value.showTable=!s.value.showTable}function Me(){s.value.showDataLabels=!s.value.showDataLabels}function Oe(){s.value.stacked=!s.value.stacked}function Re(){s.value.showTooltip=!s.value.showTooltip}const Y=l.ref(!1);function ae(){Y.value=!Y.value}return Be({getData:lt,generateCsv:Ie,generatePdf:be,generateImage:xe,toggleTable:Pe,toggleLabels:Me,toggleStack:Oe,toggleTooltip:Re,toggleAnnotator:ae}),(e,a)=>(l.openBlock(),l.createElementBlock("div",{style:l.normalizeStyle(`width:100%; position:relative; ${t.value.responsive?"height: 100%":""}`),ref_key:"xy",ref:N,id:`xy_canvas_${Z.value}`,class:l.normalizeClass(`vue-ui-donut ${U.value?"vue-data-ui-wrapper-fullscreen":""}`),onMouseenter:a[5]||(a[5]=()=>l.unref(he)(!0)),onMouseleave:a[6]||(a[6]=()=>l.unref(he)(!1))},[t.value.style.chart.title.text?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:ie,style:l.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};`)},[(l.openBlock(),l.createBlock(nt._sfc_main,{key:`title_${j.value}`,config:{title:{cy:"xy-canvas-title",...t.value.style.chart.title},subtitle:{cy:"xy-canvas-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):l.createCommentVNode("",!0),t.value.userOptions.show&&Q.value&&(l.unref(ye)||l.unref(ee))?(l.openBlock(),l.createBlock(Ee.UserOptions,{ref:"details",key:`user_option_${se.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:l.unref(pe),isImaging:l.unref(me),uid:Z.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasLabel:t.value.userOptions.buttons.labels,hasStack:re.dataset.length>1&&t.value.userOptions.buttons.stack,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasTable:n.value.end-n.value.start<200&&t.value.userOptions.buttons.table,isFullscreen:U.value,isTooltip:s.value.showTooltip,isStacked:s.value.stacked,titles:{...t.value.userOptions.buttonTitles},chartElement:N.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:Y.value,onToggleFullscreen:He,onGeneratePdf:l.unref(be),onGenerateCsv:Ie,onGenerateImage:l.unref(xe),onToggleTable:Pe,onToggleLabels:Me,onToggleStack:Oe,onToggleTooltip:Re,onToggleAnnotator:ae,style:l.normalizeStyle({visibility:l.unref(ye)?l.unref(ee)?"visible":"hidden":"visible"})},l.createSlots({_:2},[e.$slots.optionTooltip?{name:"optionTooltip",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,e.$slots.optionPdf?{name:"optionPdf",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,e.$slots.optionCsv?{name:"optionCsv",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,e.$slots.optionImg?{name:"optionImg",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,e.$slots.optionTable?{name:"optionTable",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,e.$slots.optionLabels?{name:"optionLabels",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,e.$slots.optionStack?{name:"optionStack",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionStack",{},void 0,!0)]),key:"6"}:void 0,e.$slots.optionFullscreen?{name:"optionFullscreen",fn:l.withCtx(({toggleFullscreen:r,isFullscreen:d})=>[l.renderSlot(e.$slots,"optionFullscreen",l.normalizeProps(l.guardReactiveProps({toggleFullscreen:r,isFullscreen:d})),void 0,!0)]),key:"7"}:void 0,e.$slots.optionAnnotator?{name:"optionAnnotator",fn:l.withCtx(({toggleAnnotator:r,isAnnotator:d})=>[l.renderSlot(e.$slots,"optionAnnotator",l.normalizeProps(l.guardReactiveProps({toggleAnnotator:r,isAnnotator:d})),void 0,!0)]),key:"8"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasLabel","hasStack","hasFullscreen","hasTable","isFullscreen","isTooltip","isStacked","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:"vue-ui-xy-canvas",style:l.normalizeStyle(`position: relative; aspect-ratio: ${ge.value}`),ref_key:"container",ref:B},[Q.value?(l.openBlock(),l.createElementBlock("canvas",{key:0,ref_key:"canvas",ref:S,style:{width:"100%",height:"100%"},onMousemove:a[0]||(a[0]=r=>Qe(r)),onMouseleave:et},null,544)):(l.openBlock(),l.createBlock(ct.default,{key:1,config:{type:"line",style:{backgroundColor:t.value.style.chart.backgroundColor,line:{axis:{color:"#CCCCCC"},path:{color:"#CCCCCC",strokeWidth:.5}}}}},null,8,["config"])),l.createVNode(ot._sfc_main,{show:s.value.showTooltip&&H.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,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:S.value,content:V.value,isFullscreen:U.value,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,isCustom:l.unref(u.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":l.withCtx(()=>[l.renderSlot(e.$slots,"tooltip-before",l.normalizeProps(l.guardReactiveProps({...ne.value})),void 0,!0)]),"tooltip-after":l.withCtx(()=>[l.renderSlot(e.$slots,"tooltip-after",l.normalizeProps(l.guardReactiveProps({...ne.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","position","offsetY","parent","content","isFullscreen","backgroundOpacity","isCustom"])],4),l.createElementVNode("div",{ref_key:"chartSlicer",ref:ve,style:l.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor}`),"data-html2canvas-ignore":""},[t.value.style.chart.zoom.show&&w.value>1?(l.openBlock(),l.createBlock(ut.Slicer,{ref_key:"slicerComponent",ref:E,key:`slicer_${ue.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.grid.y.timeLabels.values[n.value.start]?t.value.style.chart.grid.y.timeLabels.values[n.value.start]:"",labelRight:t.value.style.chart.grid.y.timeLabels.values[n.value.end-1]?t.value.style.chart.grid.y.timeLabels.values[n.value.end-1]:"",textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,max:w.value,min:0,valueStart:n.value.start,valueEnd:n.value.end,start:n.value.start,"onUpdate:start":a[1]||(a[1]=r=>n.value.start=r),end:n.value.end,"onUpdate:end":a[2]||(a[2]=r=>n.value.end=r),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:w.value,enableRangeHandles:t.value.style.chart.zoom.enableRangeHandles,enableSelectionDrag:t.value.style.chart.zoom.enableSelectionDrag,onReset:Ce},{"reset-action":l.withCtx(({reset:r})=>[l.renderSlot(e.$slots,"reset-action",l.normalizeProps(l.guardReactiveProps({reset:r})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end","refreshStartPoint","refreshEndPoint","enableRangeHandles","enableSelectionDrag"])):l.createCommentVNode("",!0)],4),l.createElementVNode("div",{ref_key:"chartLegend",ref:ce},[t.value.style.chart.legend.show&&Q.value?(l.openBlock(),l.createBlock(rt.Legend,{legendSet:$e.value,config:tt.value,key:`legend_${K.value}`,onClickMarker:a[3]||(a[3]=({i:r})=>ze(r))},{item:l.withCtx(({legend:r,index:d})=>[l.createElementVNode("div",{onClick:h=>r.segregate(),style:l.normalizeStyle(`opacity:${C.value.includes(d)?.5:1}`)},l.toDisplayString(r.name),13,ft)]),_:1},8,["legendSet","config"])):l.renderSlot(e.$slots,"legend",{key:1,legend:$e.value},void 0,!0)],512),e.$slots.watermark?(l.openBlock(),l.createElementBlock("div",gt,[l.renderSlot(e.$slots,"watermark",l.normalizeProps(l.guardReactiveProps({isPrinting:l.unref(pe)||l.unref(me)})),void 0,!0)])):l.createCommentVNode("",!0),e.$slots.source?(l.openBlock(),l.createElementBlock("div",{key:3,ref_key:"source",ref:de,dir:"auto"},[l.renderSlot(e.$slots,"source",{},void 0,!0)],512)):l.createCommentVNode("",!0),n.value.end-n.value.start<200?(l.openBlock(),l.createBlock(st.default,{key:4,hideDetails:"",config:{open:s.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:l.withCtx(()=>[(l.openBlock(),l.createBlock(it.DataTable,{key:`table_${J.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:a[4]||(a[4]=r=>s.value.showTable=!1)},{th:l.withCtx(({th:r})=>[l.createElementVNode("div",{innerHTML:r},null,8,pt)]),td:l.withCtx(({td:r})=>[l.createTextVNode(l.toDisplayString(r),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):l.createCommentVNode("",!0),t.value.userOptions.buttons.annotator&&f.value.length?(l.openBlock(),l.createBlock(vt.PenAndPaper,{key:5,parent:N.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:Y.value,onClose:ae},null,8,["parent","backgroundColor","color","active"])):l.createCommentVNode("",!0)],46,yt))}},bt=ht._export_sfc(mt,[["__scopeId","data-v-45e3ad69"]]);exports.default=bt;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-COIn1phv.cjs"),X=require("./useResponsive-BJ7DTGpm.cjs"),re=require("./Title-DJUxOiaO.cjs"),Y=require("./usePrinter-CXXfgFFN.cjs"),ie=require("./Tooltip-C5QuW94e.cjs"),ne=require("./DataTable-1PQD-SFb.cjs"),ue=require("./vue-ui-skeleton-BIqMxXV7.cjs"),de=require("./vue-ui-accordion-CGlnNTr8.cjs"),J=require("./useNestedProp-CbMuGGl3.cjs"),ce=require("./PackageVersion-BjfedMsH.cjs"),ve=require("./PenAndPaper-nqRtAh6J.cjs"),ye=require("./useUserOptionState-BgepsfED.cjs"),he=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),fe=["id"],pe=["xmlns","viewBox"],ge=["x","y","width","height"],be=["id"],me=["stop-color"],xe=["stop-color"],ke=["id"],we=["stop-color"],Ce=["stop-color"],Ne=["x","y","width","height","fill","rx"],_e=["x","y","width","height","fill","rx"],Le=["x","y","width","height","fill","rx"],Se=["x","y","width","height","fill","rx"],Te={key:0},Be=["x","y","fill","font-size","font-weight"],Ae=["x","y","fill","font-size","font-weight"],$e={key:1},Ee=["x","y","font-size","fill","font-weight"],Ve={key:2},ze={key:0},Pe=["x1","x2","y1","y2","stroke","stroke-width"],Oe=["x1","x2","y1","y2","stroke","stroke-width"],Fe=["x1","x2","y1","y2","stroke","stroke-width"],Ie=["x","y","font-size","fill","font-weight"],De=["x1","x2","y1","y2","stroke","stroke-width"],Me=["x","y","font-size","fill","font-weight"],Re=["x","y","font-size","fill","font-weight"],qe=["x","y","width","height","fill","onMouseover"],Ue={key:5,class:"vue-data-ui-watermark"},Ge={__name:"vue-ui-age-pyramid",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(T,{expose:K}){const u=T,{vue_ui_age_pyramid:Q}=r.useConfig(),m=e.computed(()=>!!u.dataset&&u.dataset.length),c=e.ref(r.createUid()),Z=e.ref(null),C=e.ref(!1),N=e.ref(""),x=e.ref(null),B=e.ref(0),y=e.ref(null),A=e.ref(null),$=e.ref(null),E=e.ref(null),V=e.ref(0),z=e.ref(0),t=e.computed({get:()=>F(),set:l=>l}),{userOptionsVisible:_,setUserOptionsVisibility:P,keepUserOptionState:O}=ye.useUserOptionState({config:t.value});function F(){const l=J.useNestedProp({userConfig:u.config,defaultConfig:Q});return l.theme?{...J.useNestedProp({userConfig:r.themes.vue_ui_age_pyramid[l.theme]||u.config,defaultConfig:l})}:l}e.watch(()=>u.config,l=>{t.value=F(),_.value=!t.value.showOnChartHover,D(),V.value+=1,z.value+=1},{deep:!0});const I=e.ref(null);e.onMounted(()=>{D()});function D(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiAgePyramid",type:"dataset"}),t.value.responsive){const l=X.throttle(()=>{const{width:i,height:o}=X.useResponsive({chart:y.value,title:t.value.style.title.text?A.value:null,source:$.value,noTitle:E.value});requestAnimationFrame(()=>{d.value.width=i,d.value.height=o})});I.value=new ResizeObserver(l),I.value.observe(y.value.parentNode)}}const{isPrinting:M,isImaging:R,generatePdf:q,generateImage:U}=Y.usePrinter({elementId:`vue-ui-age-pyramid_${c.value}`,fileName:t.value.style.title.text||"vue-ui-age-pyramid"}),ee=e.computed(()=>t.value.userOptions.show&&!t.value.style.title.text),v=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.tooltip.show}),d=e.ref({height:t.value.style.height,width:t.value.style.width}),s=e.computed(()=>{const l=d.value.width-t.value.style.layout.padding.right-t.value.style.layout.padding.left,i=t.value.style.layout.padding.left,o=d.value.width-t.value.style.layout.padding.right;return{top:t.value.style.layout.padding.top,left:i,right:o,bottom:d.value.height-t.value.style.layout.padding.bottom,width:l,height:d.value.height-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom,centerX:t.value.style.layout.padding.left+l/2,leftChart:{width:l/2-t.value.style.layout.centerSlit.width,right:i+l/2-t.value.style.layout.centerSlit.width},rightChart:{width:l/2-t.value.style.layout.centerSlit.width,left:i+l/2+t.value.style.layout.centerSlit.width}}}),te=e.computed(()=>u.dataset.map(l=>t.value.style.layout.dataLabels.yAxis.display==="age"?l[1]:l[0])),h=e.computed(()=>{const l=le(b.value/5),i=[],o=[];for(let a=0;a<=5;a+=1){const n=l*a,j=l*(a-5);i.push({value:n,x:s.value.left+s.value.width/2+t.value.style.layout.centerSlit.width+n/b.value*s.value.leftChart.width}),o.push({value:Math.abs(j),x:s.value.left+s.value.width/2+j/b.value*s.value.leftChart.width-t.value.style.layout.centerSlit.width})}return{right:i,left:o}});function le(l){if(l===0)return 0;const o=10**Math.floor(Math.log10(Math.abs(l)));let a;return l<0,a=Math.round(l/o)*o,a}const b=e.computed(()=>Math.max(...u.dataset.flatMap(l=>l.slice(-2).map(i=>r.checkNaN(i))))),f=e.computed(()=>u.dataset.length),oe=e.computed(()=>u.dataset.map(l=>({segment:l[0],age:l[1],left:{value:l[2],proportionToMax:l[2]/b.value},right:{value:l[3],proportionToMax:l[3]/b.value}}))),p=e.computed(()=>oe.value.map((l,i)=>{const o=s.value.top+s.value.height/f.value*i,a=s.value.height/f.value-t.value.style.layout.bars.gap;return{segment:l.segment,age:l.age,left:{...l.left,y:o,color:t.value.style.layout.bars.left.color,x:s.value.leftChart.right-l.left.proportionToMax*s.value.leftChart.width,width:r.checkNaN(l.left.proportionToMax*s.value.leftChart.width),height:a},right:{...l.right,y:o,color:t.value.style.layout.bars.right.color,x:s.value.rightChart.left,width:r.checkNaN(l.right.proportionToMax*s.value.rightChart.width),height:a}}})),L=e.ref(null);function ae(l,i){x.value=l,L.value={datapoint:i,seriesIndex:l,series:p.value,config:t.value};const o=t.value.style.tooltip.customFormat;if(r.isFunction(o)&&r.functionReturnsString(()=>o({seriesIndex:l,datapoint:{segment:i[0],index:i[1],left:i[2],right:i[3]},series:p.value,config:t.value})))N.value=o({seriesIndex:l,datapoint:{segment:i[0],index:i[1],left:i[2],right:i[3]},series:p.value,config:t.value});else{let a="";const n=p.value[l];a+=`<div><b>${n.segment}</b></div>`,a+=`<div>${t.value.translations.age}: ${r.applyDataLabel(t.value.style.layout.dataLabels.yAxis.formatter,r.checkNaN(n.age),r.dataLabel({v:r.checkNaN(n.age)}),{datapoint:i,seriesIndex:l})}</div>`,a+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${t.value.style.tooltip.borderColor}">`,a+='<div style="display:flex; flex-direction:row;gap:12px">',a+=`<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${t.value.style.layout.bars.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${t.value.style.layout.bars.gradient.show?`url(#age_pyramid_left_${c.value})`:t.value.style.layout.bars.left.color}"/></svg><div>${t.value.translations.female}</div><div><b>${r.applyDataLabel(t.value.style.layout.dataLabels.xAxis.formatter,r.checkNaN(n.left.value),r.dataLabel({v:r.checkNaN(n.left.value)}),{datapoint:i,seriesIndex:l})}</b></div></div>`,a+=`<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${t.value.style.layout.bars.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${t.value.style.layout.bars.gradient.show?`url(#age_pyramid_right_${c.value})`:t.value.style.layout.bars.right.color}"/></svg><div>${t.value.translations.male}</div><div><b>${r.applyDataLabel(t.value.style.layout.dataLabels.xAxis.formatter,r.checkNaN(n.right.value),r.dataLabel({v:r.checkNaN(n.right.value)}),{datapoint:i,seriesIndex:l})}</b></div></div>`,a+="</div>",a+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${t.value.style.tooltip.borderColor}"><div>${t.value.translations.total}</div><div><b>${r.applyDataLabel(t.value.style.layout.dataLabels.xAxis.formatter,r.checkNaN(n.right.value)+r.checkNaN(n.left.value),r.dataLabel({v:r.checkNaN(n.right.value)+r.checkNaN(n.left.value)}),{datapoint:i,seriesIndex:l})}</b></div></div>`,a+="</div>",N.value=`<div>${a}</div>`}C.value=!0}function G(){e.nextTick(()=>{const l=[t.value.translations.year,t.value.translations.age,t.value.translations.female,t.value.translations.male,t.value.translations.total],i=u.dataset.map(n=>[n[0],n[1],n[2],n[3],n[2]+n[3]]),o=[[t.value.style.title.text],[t.value.style.title.subtitle.text],[[""],[""],[""]]].concat([l]).concat(i),a=r.createCsvContent(o);r.downloadCsv({csvContent:a,title:t.value.style.title.text||"vue-ui-heatmap"})})}const k=e.computed(()=>{const l=[t.value.translations.year,t.value.translations.age,t.value.translations.female,t.value.translations.male,t.value.translations.total],i=u.dataset.map(a=>[a[0],a[1],a[2].toLocaleString(),a[3].toLocaleString(),(a[2]+a[3]).toLocaleString()]),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{head:l,body:i,config:o,colNames:l}}),g=e.ref(!1);function se(l){g.value=l,B.value+=1}function H(){v.value.showTable=!v.value.showTable}function W(){v.value.showTooltip=!v.value.showTooltip}const w=e.ref(!1);function S(){w.value=!w.value}return K({generatePdf:q,generateCsv:G,generateImage:U,toggleTable:H,toggleTooltip:W,toggleAnnotator:S}),(l,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-age-pyramid ${g.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"agePyramid",ref:y,id:`vue-ui-age-pyramid_${c.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.backgroundColor};${t.value.responsive?"height:100%":""}`),onMouseenter:i[2]||(i[2]=()=>e.unref(P)(!0)),onMouseleave:i[3]||(i[3]=()=>e.unref(P)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ve.PenAndPaper,{key:0,parent:y.value,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,active:w.value,onClose:S},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ee.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:E,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:A,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(re._sfc_main,{key:`title_${V.value}`,config:{title:{cy:"pyramid-div-title",...t.value.style.title},subtitle:{cy:"pyramid-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&m.value&&(e.unref(O)||e.unref(_))?(e.openBlock(),e.createBlock(Y.UserOptions,{ref_key:"details",ref:Z,key:`user_options_${B.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isImaging:e.unref(R),isPrinting:e.unref(M),uid:c.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:g.value,isTooltip:v.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:y.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:se,onGeneratePdf:e.unref(q),onGenerateCsv:G,onGenerateImage:e.unref(U),onToggleTable:H,onToggleTooltip:W,onToggleAnnotator:S,style:e.normalizeStyle({visibility:e.unref(O)?e.unref(_)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:a})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:a})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:a})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:a})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":g.value,"vue-data-ui-fulscreen--off":!g.value}),viewBox:`0 0 ${d.value.width<=0?10:d.value.width} ${d.value.height<=0?10:d.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.color}`)},[e.createVNode(ce._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:s.value.left,y:s.value.top,width:s.value.width,height:s.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,ge)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`age_pyramid_left_${c.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.bars.left.color},null,8,me),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.setOpacity)(e.unref(r.shiftHue)(t.value.style.layout.bars.left.color,t.value.style.layout.bars.gradient.shiftHue),100-t.value.style.layout.bars.gradient.intensity)},null,8,xe)],8,be),e.createElementVNode("linearGradient",{id:`age_pyramid_right_${c.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.setOpacity)(e.unref(r.shiftHue)(t.value.style.layout.bars.right.color,t.value.style.layout.bars.gradient.shiftHue),100-t.value.style.layout.bars.gradient.intensity)},null,8,we),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.layout.bars.right.color},null,8,Ce)],8,ke)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(o,a)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:o.left.x,y:o.left.y,width:e.unref(r.checkNaN)(o.left.width<=0?1e-4:o.left.width),height:o.left.height<=0?1e-4:o.left.height,fill:t.value.style.layout.bars.gradient.underlayer,rx:t.value.style.layout.bars.borderRadius},null,8,Ne),e.createElementVNode("rect",{x:o.left.x,y:o.left.y,width:o.left.width<=0?1e-4:o.left.width,height:o.left.height<=0?1e-4:o.left.height,fill:t.value.style.layout.bars.gradient.show?`url(#age_pyramid_left_${c.value})`:o.left.color,rx:t.value.style.layout.bars.borderRadius},null,8,_e),e.createElementVNode("rect",{x:o.right.x,y:o.right.y,width:o.right.width<=0?1e-4:o.right.width,height:o.right.height<=0?1e-4:o.right.height,fill:t.value.style.layout.bars.gradient.underlayer,rx:t.value.style.layout.bars.borderRadius},null,8,Le),e.createElementVNode("rect",{x:o.right.x,y:o.right.y,width:o.right.width<=0?1e-4:o.right.width,height:o.right.height<=0?1e-4:o.right.height,fill:t.value.style.layout.bars.gradient.show?`url(#age_pyramid_right_${c.value})`:o.right.color,rx:t.value.style.layout.bars.borderRadius},null,8,Se)]))),256)),e.createElementVNode("g",null,[t.value.style.layout.dataLabels.sideTitles.show?(e.openBlock(),e.createElementBlock("g",Te,[e.createElementVNode("text",{x:s.value.left,y:s.value.top+t.value.style.layout.dataLabels.sideTitles.offsetY,fill:t.value.style.layout.dataLabels.sideTitles.useSideColor?t.value.style.layout.bars.left.color:t.value.style.layout.dataLabels.sideTitles.color,"font-size":t.value.style.layout.dataLabels.sideTitles.fontSize,"text-anchor":"start","font-weight":t.value.style.layout.dataLabels.sideTitles.bold?"bold":"normal"},e.toDisplayString(t.value.translations.female),9,Be),e.createElementVNode("text",{x:s.value.right,y:s.value.top+t.value.style.layout.dataLabels.sideTitles.offsetY,fill:t.value.style.layout.dataLabels.sideTitles.useSideColor?t.value.style.layout.bars.right.color:t.value.style.layout.dataLabels.sideTitles.color,"font-size":t.value.style.layout.dataLabels.sideTitles.fontSize,"text-anchor":"end","font-weight":t.value.style.layout.dataLabels.sideTitles.bold?"bold":"normal"},e.toDisplayString(t.value.translations.male),9,Ae)])):e.createCommentVNode("",!0),t.value.style.layout.dataLabels.yAxis.show?(e.openBlock(),e.createElementBlock("g",$e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,(o,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[a%t.value.style.layout.dataLabels.yAxis.showEvery===0?(e.openBlock(),e.createElementBlock("text",{key:0,x:s.value.centerX,y:s.value.top+s.value.height/f.value*a+t.value.style.layout.dataLabels.yAxis.fontSize/3,"text-anchor":"middle","font-size":t.value.style.layout.dataLabels.yAxis.fontSize,fill:t.value.style.layout.dataLabels.yAxis.color,"font-weight":t.value.style.layout.dataLabels.yAxis.bold?"bold":"normal"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.layout.dataLabels.yAxis.formatter,o,e.unref(r.dataLabel)({v:o}),{datapoint:o,seriesIndex:a})),9,Ee)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0),t.value.style.layout.dataLabels.xAxis.show?(e.openBlock(),e.createElementBlock("g",Ve,[t.value.style.layout.grid.show?(e.openBlock(),e.createElementBlock("g",ze,[e.createElementVNode("line",{x1:h.value.right[0].x,x2:h.value.right.at(-1).x,y1:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,y2:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Pe),e.createElementVNode("line",{x1:h.value.left[0].x,x2:h.value.left.at(-1).x,y1:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,y2:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Oe)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.right,(o,a)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.layout.grid.show?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x,y1:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,y2:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/4,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Fe)):e.createCommentVNode("",!0),e.createElementVNode("text",{x:o.x,y:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize*2,"font-size":t.value.style.layout.dataLabels.xAxis.fontSize,fill:t.value.style.layout.dataLabels.xAxis.color,"text-anchor":"middle","font-weight":t.value.style.layout.dataLabels.xAxis.bold?"bold":"normal"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.layout.dataLabels.xAxis.formatter,o.value/t.value.style.layout.dataLabels.xAxis.scale,e.unref(r.dataLabel)({v:o.value/t.value.style.layout.dataLabels.xAxis.scale}),{datapoint:o,seriesIndex:a})),9,Ie)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.left,(o,a)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.layout.grid.show?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x,y1:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,y2:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/4,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,De)):e.createCommentVNode("",!0),e.createElementVNode("text",{x:o.x,y:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize*2,"font-size":t.value.style.layout.dataLabels.xAxis.fontSize,fill:t.value.style.layout.dataLabels.xAxis.color,"text-anchor":"middle","font-weight":t.value.style.layout.dataLabels.xAxis.bold?"bold":"normal"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.layout.dataLabels.xAxis.formatter,o.value/t.value.style.layout.dataLabels.xAxis.scale,e.unref(r.dataLabel)({v:o.value/t.value.style.layout.dataLabels.xAxis.scale}),{datapoint:o,seriesIndex:a})),9,Me)]))),256)),e.createElementVNode("text",{x:s.value.right,y:d.value.height,"text-anchor":"end","font-size":t.value.style.layout.dataLabels.xAxis.fontSize,fill:t.value.style.layout.dataLabels.xAxis.color,"font-weight":t.value.style.layout.dataLabels.xAxis.bold?"bold":"normal"},e.toDisplayString(t.value.style.layout.dataLabels.xAxis.translation),9,Re)])):e.createCommentVNode("",!0)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.dataset,(o,a)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:s.value.left,y:s.value.top+s.value.height/f.value*a-t.value.style.layout.bars.gap/2,width:s.value.width<=0?1e-4:s.value.width,height:s.value.height/f.value<=0?1e-4:s.value.height/f.value,fill:x.value!==null&&x.value===a?e.unref(r.setOpacity)(t.value.style.highlighter.color,t.value.style.highlighter.opacity):"transparent",onMouseover:n=>ae(a,o),onMouseleave:i[0]||(i[0]=n=>{x.value=null,C.value=!1})},null,40,qe)]))),256)),e.renderSlot(l.$slots,"svg",{svg:d.value},void 0,!0)],14,pe)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ue,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(M)||e.unref(R)})),void 0,!0)])):e.createCommentVNode("",!0),m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ue.default,{key:6,config:{type:"pyramid",style:{backgroundColor:t.value.style.backgroundColor,pyramid:{color:"#CCCCCC"}}}},null,8,["config"])),e.renderSlot(l.$slots,"legend",{legend:p.value},void 0,!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:$,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ie._sfc_main,{show:v.value.showTooltip&&C.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,fontSize:t.value.style.tooltip.fontSize,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,offsetY:t.value.style.tooltip.offsetY,parent:y.value,content:N.value,isFullscreen:g.value,isCustom:t.value.style.tooltip.customFormat&&typeof t.value.style.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...L.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...L.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),m.value?(e.openBlock(),e.createBlock(de.default,{key:8,hideDetails:"",config:{open:v.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color},head:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(ne.DataTable,{key:`table_${z.value}`,colNames:k.value.colNames,head:k.value.head,body:k.value.body,config:k.value.config,title:`${t.value.style.title.text}${t.value.style.title.subtitle.text?` : ${t.value.style.title.subtitle.text}`:""}`,onClose:i[1]||(i[1]=o=>v.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createTextVNode(e.toDisplayString(o),1)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,fe))}},He=he._export_sfc(Ge,[["__scopeId","data-v-71fdf5af"]]);exports.default=He;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-COIn1phv.cjs"),we=require("./useResponsive-BJ7DTGpm.cjs"),ze=require("./Title-DJUxOiaO.cjs"),Ce=require("./usePrinter-CXXfgFFN.cjs"),Te=require("./DataTable-1PQD-SFb.cjs"),Xe=require("./Tooltip-C5QuW94e.cjs"),De=require("./Legend-BJ2Wbqut.cjs"),Me=require("./vue-ui-skeleton-BIqMxXV7.cjs"),Ye=require("./vue-ui-accordion-CGlnNTr8.cjs"),Be=require("./useNestedProp-CbMuGGl3.cjs"),Ae=require("./PackageVersion-BjfedMsH.cjs"),Ie=require("./PenAndPaper-nqRtAh6J.cjs"),qe=require("./useUserOptionState-BgepsfED.cjs"),Re=require("./Shape-Boa32JEn.cjs"),Ge=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ue=V=>(e.pushScopeId("data-v-d4293347"),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});requestAnimationFrame(()=>{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-d4293347"]]);exports.default=rl;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-COIn1phv.cjs"),ze=require("./Title-DJUxOiaO.cjs"),me=require("./usePrinter-CXXfgFFN.cjs"),Ve=require("./DataTable-1PQD-SFb.cjs"),Ae=require("./Legend-BJ2Wbqut.cjs"),$e=require("./vue-ui-skeleton-BIqMxXV7.cjs"),De=require("./Slicer-D6QLMg5N.cjs"),Fe=require("./vue-ui-accordion-CGlnNTr8.cjs"),fe=require("./useNestedProp-CbMuGGl3.cjs"),Pe=require("./PackageVersion-BjfedMsH.cjs"),Ie=require("./PenAndPaper-nqRtAh6J.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,9 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-COIn1phv.cjs"),K=require("./useResponsive-BJ7DTGpm.cjs"),ce=require("./Title-DJUxOiaO.cjs"),Q=require("./usePrinter-CXXfgFFN.cjs"),de=require("./DataTable-1PQD-SFb.cjs"),ve=require("./vue-ui-skeleton-BIqMxXV7.cjs"),he=require("./Legend-BJ2Wbqut.cjs"),ye=require("./vue-ui-accordion-CGlnNTr8.cjs"),ee=require("./useNestedProp-CbMuGGl3.cjs"),fe=require("./PackageVersion-BjfedMsH.cjs"),me=require("./PenAndPaper-nqRtAh6J.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});requestAnimationFrame(()=>{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
|
-
${l.startX},${l.y+t.value.style.chart.plots.radius/2}
|
|
3
|
-
C ${l.centerX},${l.y} ${l.centerX},${l.y}
|
|
4
|
-
${l.endX},${l.y+t.value.style.chart.plots.radius/2}
|
|
5
|
-
L ${l.endX},${l.y-t.value.style.chart.plots.radius/2}
|
|
6
|
-
C ${l.centerX},${l.y} ${l.centerX},${l.y}
|
|
7
|
-
${l.startX},${l.y-t.value.style.chart.plots.radius/2}
|
|
8
|
-
Z
|
|
9
|
-
`,fill:l.endX>l.startX?`url(#grad_positive_${d.value})`:`url(#grad_negative_${d.value})`},null,8,We)])):(e.openBlock(),e.createElementBlock("g",je,[e.createElementVNode("rect",{x:l.endX>l.startX?l.startX:l.endX,y:l.y-t.value.style.chart.plots.link.strokeWidth/2,height:t.value.style.chart.plots.link.strokeWidth,width:Math.abs(l.endX-l.startX),fill:l.endX>l.startX?`url(#grad_positive_${d.value})`:`url(#grad_negative_${d.value})`},null,8,Ye)])),e.createElementVNode("circle",{cx:l.startX,cy:l.y,r:t.value.style.chart.plots.radius,fill:t.value.style.chart.plots.gradient.show?`url(#start_grad_${d.value})`:t.value.style.chart.plots.startColor,stroke:t.value.style.chart.plots.stroke,"stroke-width":t.value.style.chart.plots.strokeWidth},null,8,Ze),e.createElementVNode("circle",{cx:l.endX,cy:l.y,r:t.value.style.chart.plots.radius,fill:t.value.style.chart.plots.gradient.show?`url(#end_grad_${d.value})`:t.value.style.chart.plots.endColor,stroke:t.value.style.chart.plots.stroke,"stroke-width":t.value.style.chart.plots.strokeWidth},null,8,Je),t.value.style.chart.labels.startLabels.show?(e.openBlock(),e.createElementBlock("g",Ke,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(u,h)=>(e.openBlock(),e.createElementBlock("text",{x:u.startX,y:o.value.top+(h+1)*c.value-t.value.style.chart.labels.startLabels.fontSize/3+t.value.style.chart.labels.startLabels.offsetY,fill:t.value.style.chart.labels.startLabels.useStartColor?t.value.style.chart.plots.startColor:t.value.style.chart.labels.startLabels.color,"font-size":t.value.style.chart.labels.startLabels.fontSize,"text-anchor":"middle"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.labels.formatter,u.start,e.unref(s.dataLabel)({p:t.value.style.chart.labels.prefix,v:u.start,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.startLabels.rounding}),{datapoint:u,seriesIndex:h})),9,Qe))),256))])):e.createCommentVNode("",!0),t.value.style.chart.labels.endLabels.show?(e.openBlock(),e.createElementBlock("g",et,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(u,h)=>(e.openBlock(),e.createElementBlock("text",{x:u.endX,y:o.value.top+h*c.value+t.value.style.chart.labels.endLabels.fontSize+t.value.style.chart.labels.endLabels.offsetY,fill:t.value.style.chart.labels.endLabels.useEndColor?t.value.style.chart.plots.endColor:t.value.style.chart.labels.endLabels.color,"font-size":t.value.style.chart.labels.endLabels.fontSize,"text-anchor":"middle"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.labels.formatter,u.end,e.unref(s.dataLabel)({p:t.value.style.chart.labels.prefix,v:u.end,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.endLabels.rounding}),{datapoint:u,seriesIndex:h})),9,tt))),256))])):e.createCommentVNode("",!0)]))),256)),e.renderSlot(a.$slots,"svg",{svg:o.value},void 0,!0)],14,ke)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",lt,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(q)||e.unref(H)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ve.default,{key:6,config:{type:"dumbbell",style:{backgroundColor:t.value.style.chart.backgroundColor,dumbbell:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:A},[t.value.style.chart.legend.show&&b.value?(e.openBlock(),e.createBlock(he.Legend,{key:`legend_${O.value}`,legendSet:Y.value,config:se.value},{item:e.withCtx(({legend:l})=>[e.createElementVNode("div",{style:e.normalizeStyle(`display:flex;align-items:center;gap:4px;font-size:${t.value.style.chart.legend.fontSize}px`)},[(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(s.XMLNS),viewBox:"0 0 20 20",height:t.value.style.chart.legend.fontSize,width:t.value.style.chart.legend.fontSize},[e.createElementVNode("circle",{cx:10,cy:10,r:9,fill:l.color},null,8,ot)],8,at)),e.createTextVNode(" "+e.toDisplayString(l.name),1)],4)]),_:1},8,["legendSet","config"])):e.renderSlot(a.$slots,"legend",{key:1,legend:Y.value},void 0,!0)],512),a.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:P,dir:"auto"},[e.renderSlot(a.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createBlock(ye.default,{key:8,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(de.DataTable,{key:`table_${D.value}`,colNames:w.value.colNames,head:w.value.head,body:w.value.body,config:w.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:n[0]||(n[0]=l=>_.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,rt)]),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,ge))}},nt=pe._export_sfc(st,[["__scopeId","data-v-9ee799af"]]);exports.default=nt;
|