vue-data-ui 2.4.76 → 2.4.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Arrow-SYMRLSHC.js → Arrow-C7AmfY-d.js} +1 -1
- package/dist/{Arrow-BEL6nGJ5.cjs → Arrow-DbrjRMa6.cjs} +1 -1
- package/dist/{BaseIcon-Udj2sWh1.cjs → BaseIcon-CIjjPDqj.cjs} +1 -1
- package/dist/{BaseIcon-wfQ35Ioa.js → BaseIcon-Dzpk4O8L.js} +1 -1
- package/dist/{DataTable-CC3rD9iV.js → DataTable-DtRXoetj.js} +2 -2
- package/dist/{DataTable-RY8EUwF3.cjs → DataTable-wN-jvOfe.cjs} +1 -1
- package/dist/{Legend-CZrlsh2W.cjs → Legend-DqGE1lkA.cjs} +1 -1
- package/dist/{Legend-BBFx9L7u.js → Legend-RnRqBxiV.js} +2 -2
- package/dist/{PackageVersion-Cc8-1SRE.js → PackageVersion-CgJdp_Ki.js} +1 -1
- package/dist/{PackageVersion-C1zaH_aJ.cjs → PackageVersion-Dn-t7tbm.cjs} +1 -1
- package/dist/{PenAndPaper-BKX-8o1h.js → PenAndPaper-BTLEk55u.js} +3 -3
- package/dist/{PenAndPaper-Bv8oV7l0.cjs → PenAndPaper-DFXJJink.cjs} +1 -1
- package/dist/{Shape-CSj0rOyf.js → Shape-B1fqUhjt.js} +1 -1
- package/dist/{Shape-CuDuYYKF.cjs → Shape-D7IbPjU8.cjs} +1 -1
- package/dist/{Slicer-De-C8OB8.cjs → Slicer-8bCK41mN.cjs} +1 -1
- package/dist/{Slicer-4vVJHlL9.js → Slicer-GQf9ZyPj.js} +2 -2
- package/dist/{Title-m5N0oN0G.cjs → Title-D-6pIV0l.cjs} +1 -1
- package/dist/{Title-CmyP_ypC.js → Title-XYNHfYwN.js} +1 -1
- package/dist/{Tooltip-Dq7633oz.cjs → Tooltip-CNox4F8U.cjs} +1 -1
- package/dist/{Tooltip-Dz6sXvS2.js → Tooltip-DYRo59nq.js} +1 -1
- package/dist/{index-CpNLsWVB.js → index-B8Eaq54E.js} +1 -1
- package/dist/{index-CH3YkGpv.cjs → index-KJL8ra_6.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-2TBYsJKg.cjs → useNestedProp-Bu958azG.cjs} +1 -1
- package/dist/{useNestedProp-C14snYQ3.js → useNestedProp-Ka0R_Yqa.js} +1 -1
- package/dist/{usePrinter-D76t2otk.js → usePrinter-D83W2gfG.js} +1 -1
- package/dist/{usePrinter-A1_US3Dh.cjs → usePrinter-pDOF3CfL.cjs} +1 -1
- package/dist/{vue-data-ui-0qqDFsDV.js → vue-data-ui-DgmXnSUU.js} +60 -60
- package/dist/{vue-data-ui-C3B3pxcE.cjs → vue-data-ui-Ot5xYhbV.cjs} +1 -1
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-DsPyvRtf.cjs → vue-ui-3d-bar-CB0XzatQ.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-vXI86Ftg.js → vue-ui-3d-bar-CqiW8qFZ.js} +9 -9
- package/dist/{vue-ui-accordion-7RGF7sa1.js → vue-ui-accordion--5td7b94.js} +3 -3
- package/dist/{vue-ui-accordion-_LFrGkGx.cjs → vue-ui-accordion-4-dyMgJA.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-CotXvsaD.js → vue-ui-age-pyramid-Bsg0z9ei.js} +10 -10
- package/dist/{vue-ui-age-pyramid-ac5bW1yE.cjs → vue-ui-age-pyramid-DNseB8ej.cjs} +1 -1
- package/dist/{vue-ui-annotator-LO2QBLr-.cjs → vue-ui-annotator-CHjtF8NT.cjs} +1 -1
- package/dist/{vue-ui-annotator-C1RLefPu.js → vue-ui-annotator-obnYFvvq.js} +1 -1
- package/dist/{vue-ui-bullet-CngMCn0G.cjs → vue-ui-bullet-CNWHd7dO.cjs} +1 -1
- package/dist/{vue-ui-bullet-DZknfpTt.js → vue-ui-bullet-yKEVhE17.js} +8 -8
- package/dist/{vue-ui-candlestick-BIhS1XvX.js → vue-ui-candlestick-Cc-Ee4zv.js} +11 -11
- package/dist/{vue-ui-candlestick-BrHsZWBD.cjs → vue-ui-candlestick-VBq82rfW.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-DQOyjYrs.js → vue-ui-carousel-table-B6v1NycN.js} +4 -4
- package/dist/{vue-ui-carousel-table-CEYvDVp-.cjs → vue-ui-carousel-table-DLwVijSb.cjs} +1 -1
- package/dist/{vue-ui-chestnut-DOB6e1ur.js → vue-ui-chestnut-CekC1moT.js} +8 -8
- package/dist/{vue-ui-chestnut-Ck7UKhm3.cjs → vue-ui-chestnut-DHZbhIf_.cjs} +1 -1
- package/dist/{vue-ui-cursor-DbR8dGQz.cjs → vue-ui-cursor-Bz-jVx3a.cjs} +1 -1
- package/dist/{vue-ui-cursor-BaFPplLP.js → vue-ui-cursor-CISKzkNu.js} +2 -2
- package/dist/{vue-ui-dashboard-BiYrjIXc.cjs → vue-ui-dashboard-PAi8o4AC.cjs} +1 -1
- package/dist/{vue-ui-dashboard-CU1IswIu.js → vue-ui-dashboard-w7Ts26Xc.js} +2 -2
- package/dist/{vue-ui-digits-LLkWsjVe.cjs → vue-ui-digits-I_lj1m6d.cjs} +1 -1
- package/dist/{vue-ui-digits-Ccu0VX39.js → vue-ui-digits-kaBR5FUU.js} +2 -2
- package/dist/{vue-ui-donut-BZbOZXBY.js → vue-ui-donut-BVuaExCl.js} +111 -114
- package/dist/vue-ui-donut-dDpMdK4G.cjs +1 -0
- package/dist/{vue-ui-donut-evolution-BDBugP7m.cjs → vue-ui-donut-evolution-ChGao_WW.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-DtgcRiGo.js → vue-ui-donut-evolution-DAmX1OX-.js} +11 -11
- package/dist/{vue-ui-dumbbell-CeWOqVMa.js → vue-ui-dumbbell-CrQNRN_m.js} +10 -10
- package/dist/{vue-ui-dumbbell-Dg6X5Vj5.cjs → vue-ui-dumbbell-DsR4RQY9.cjs} +1 -1
- package/dist/{vue-ui-flow-CjG35xEC.js → vue-ui-flow-B0lCe4G8.js} +9 -9
- package/dist/{vue-ui-flow-CoAgjhdm.cjs → vue-ui-flow-Dhcvvzee.cjs} +1 -1
- package/dist/{vue-ui-funnel-hjZrLAhZ.cjs → vue-ui-funnel-Bu_wMJ98.cjs} +1 -1
- package/dist/{vue-ui-funnel-D8c4Gp8b.js → vue-ui-funnel-Cinv1hUx.js} +9 -9
- package/dist/{vue-ui-galaxy-2WU_lJvz.js → vue-ui-galaxy-BcwunIK3.js} +11 -11
- package/dist/{vue-ui-galaxy-DfTXwfQR.cjs → vue-ui-galaxy-zx6O9AuV.cjs} +1 -1
- package/dist/{vue-ui-gauge-Bj4H5esH.js → vue-ui-gauge-C4W4OAXQ.js} +7 -7
- package/dist/{vue-ui-gauge-C_IgZirr.cjs → vue-ui-gauge-Cb6sxoZI.cjs} +1 -1
- package/dist/{vue-ui-gizmo-CFUkIE1e.js → vue-ui-gizmo-D4VHyFmN.js} +3 -3
- package/dist/{vue-ui-gizmo-Dbsg9oG_.cjs → vue-ui-gizmo-DBSYx24z.cjs} +1 -1
- package/dist/{vue-ui-heatmap-Df4woeNc.js → vue-ui-heatmap-C3WHfifV.js} +10 -10
- package/dist/{vue-ui-heatmap-DECng1-9.cjs → vue-ui-heatmap-CBNt4Huo.cjs} +1 -1
- package/dist/{vue-ui-history-plot-C0X1_s96.cjs → vue-ui-history-plot-Dp8Llb3A.cjs} +1 -1
- package/dist/{vue-ui-history-plot-DHUuanXy.js → vue-ui-history-plot-dJp-Lai2.js} +11 -11
- package/dist/{vue-ui-kpi-d5eW2MQ3.js → vue-ui-kpi-B3XhowYx.js} +3 -3
- package/dist/{vue-ui-kpi-CGrN8rrL.cjs → vue-ui-kpi-Dnp8IUyb.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-C2-zQHTF.cjs → vue-ui-mini-loader-BgwhuEda.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-DRUBgzI9.js → vue-ui-mini-loader-Cca7PA4v.js} +2 -2
- package/dist/{vue-ui-molecule-Bst8lERC.cjs → vue-ui-molecule-B1AocG3H.cjs} +1 -1
- package/dist/{vue-ui-molecule-CqQBdd27.js → vue-ui-molecule-BcZNqWfD.js} +11 -11
- package/dist/{vue-ui-mood-radar-BM7pbHlc.cjs → vue-ui-mood-radar-Cn65TQEs.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-oB1S4QFm.js → vue-ui-mood-radar-HjLL0ZZ8.js} +11 -11
- package/dist/{vue-ui-nested-donuts-DdgoTSGG.js → vue-ui-nested-donuts-BIqySYG_.js} +11 -11
- package/dist/{vue-ui-nested-donuts-BUcrd4TR.cjs → vue-ui-nested-donuts-CymFt4B3.cjs} +1 -1
- package/dist/{vue-ui-onion-RimU8400.cjs → vue-ui-onion-BLMFR0GK.cjs} +1 -1
- package/dist/{vue-ui-onion-BD4CSF0A.js → vue-ui-onion-muCAMEG8.js} +11 -11
- package/dist/{vue-ui-parallel-coordinate-plot-CTUm9M3z.js → vue-ui-parallel-coordinate-plot-DYOlnKPw.js} +12 -12
- package/dist/{vue-ui-parallel-coordinate-plot-Cj8VtclE.cjs → vue-ui-parallel-coordinate-plot-i-hhfnwF.cjs} +1 -1
- package/dist/{vue-ui-quadrant-DjsY0y5B.cjs → vue-ui-quadrant-DJPOp1-A.cjs} +1 -1
- package/dist/{vue-ui-quadrant-DKrkCfAn.js → vue-ui-quadrant-TU5fWoEw.js} +12 -12
- package/dist/{vue-ui-quick-chart-Dy7EL7ta.cjs → vue-ui-quick-chart-CTJxOisL.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-BBCjtI-7.js → vue-ui-quick-chart-DzuUofFN.js} +9 -9
- package/dist/{vue-ui-radar-D5ufpNKc.js → vue-ui-radar-C0WA20R8.js} +12 -12
- package/dist/{vue-ui-radar-B3SwUPOg.cjs → vue-ui-radar-D4xX7TNQ.cjs} +1 -1
- package/dist/{vue-ui-rating-DzjVC24x.cjs → vue-ui-rating-C2JILb2g.cjs} +1 -1
- package/dist/{vue-ui-rating-D4G-LFWR.js → vue-ui-rating-DUcyhyrN.js} +2 -2
- package/dist/{vue-ui-relation-circle-WkD_rUnu.js → vue-ui-relation-circle-BYlIjbUK.js} +7 -7
- package/dist/{vue-ui-relation-circle-1pWCHVnC.cjs → vue-ui-relation-circle-D-Wxskec.cjs} +1 -1
- package/dist/{vue-ui-rings-CTYnhWv8.cjs → vue-ui-rings-CsXVOIn3.cjs} +1 -1
- package/dist/{vue-ui-rings-C8ty4dWD.js → vue-ui-rings-w4KQSfym.js} +12 -12
- package/dist/{vue-ui-scatter-BQVPLg6A.cjs → vue-ui-scatter--5Ob2lKM.cjs} +1 -1
- package/dist/{vue-ui-scatter-DfeNfnMl.js → vue-ui-scatter-CfgCA3Di.js} +12 -12
- package/dist/{vue-ui-screenshot-D03-LKwV.js → vue-ui-screenshot-BsD3ySuA.js} +1 -1
- package/dist/{vue-ui-screenshot-C7lsivHN.cjs → vue-ui-screenshot-UEVUHXWY.cjs} +1 -1
- package/dist/{vue-ui-skeleton-DwmP0u2B.cjs → vue-ui-skeleton-D_YCUi1y.cjs} +1 -1
- package/dist/{vue-ui-skeleton-CIp8lMA6.js → vue-ui-skeleton-DpadzgbS.js} +3 -3
- package/dist/{vue-ui-smiley-_J08wXf9.js → vue-ui-smiley-BHqeb-Ol.js} +2 -2
- package/dist/{vue-ui-smiley-Bp-UbI5r.cjs → vue-ui-smiley-C32dLhtP.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-UX4dEhft.cjs → vue-ui-spark-trend-Bt2wpc5C.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-iXsvKant.js → vue-ui-spark-trend-NAcB2zZ1.js} +5 -5
- package/dist/{vue-ui-sparkbar-JQ4SIcqX.js → vue-ui-sparkbar-BPpSxe5Z.js} +4 -4
- package/dist/{vue-ui-sparkbar-BJ_rGX_Y.cjs → vue-ui-sparkbar-CgoGRT0_.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-Ci5Jx-i_.js → vue-ui-sparkgauge-C1mW3KbZ.js} +4 -4
- package/dist/{vue-ui-sparkgauge-YQBQjjX1.cjs → vue-ui-sparkgauge-frN6uK_L.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-C5UeFik2.cjs → vue-ui-sparkhistogram-CqQY434G.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-D1VEZIa5.js → vue-ui-sparkhistogram-HgBi5OvP.js} +5 -5
- package/dist/{vue-ui-sparkline-CRFYizW3.js → vue-ui-sparkline-BABBXY2c.js} +4 -4
- package/dist/{vue-ui-sparkline-fF9WenrE.cjs → vue-ui-sparkline-XOa6LfX2.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-CynLB9us.cjs → vue-ui-sparkstackbar-B4Xduiv1.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-CWa5ELhE.js → vue-ui-sparkstackbar-Ch3JvFBq.js} +5 -5
- package/dist/{vue-ui-stackbar-jQdQH0Pu.cjs → vue-ui-stackbar-CH8tLDZq.cjs} +1 -1
- package/dist/{vue-ui-stackbar-DSammmJH.js → vue-ui-stackbar-JIEn0g7t.js} +13 -13
- package/dist/{vue-ui-strip-plot-yE9w6drR.cjs → vue-ui-strip-plot-BkWzm1mI.cjs} +1 -1
- package/dist/{vue-ui-strip-plot-PxONzaXd.js → vue-ui-strip-plot-RZu43QbP.js} +11 -11
- package/dist/{vue-ui-table-BskwuS44.js → vue-ui-table-CJ2gGmYi.js} +1 -1
- package/dist/{vue-ui-table-DG5RXhLE.cjs → vue-ui-table-CgtE4HWs.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-CzxnV1-0.js → vue-ui-table-heatmap-B_TfeHsa.js} +4 -4
- package/dist/{vue-ui-table-heatmap-D9W-4tm9.cjs → vue-ui-table-heatmap-DxTs_PZF.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-BlQy5f88.js → vue-ui-table-sparkline-DqMH7xbY.js} +5 -5
- package/dist/{vue-ui-table-sparkline-DT8VzRHY.cjs → vue-ui-table-sparkline-PA9L6AjE.cjs} +1 -1
- package/dist/{vue-ui-thermometer-CkJBESoa.cjs → vue-ui-thermometer-AwZdEG3j.cjs} +1 -1
- package/dist/{vue-ui-thermometer-BBvQ4tYx.js → vue-ui-thermometer-D7aR0elr.js} +7 -7
- package/dist/{vue-ui-timer-CNp59qFF.cjs → vue-ui-timer-C6fnDeD8.cjs} +1 -1
- package/dist/{vue-ui-timer-DFvFQF6d.js → vue-ui-timer-C9sO9AoQ.js} +5 -5
- package/dist/{vue-ui-tiremarks-Cf1637KV.cjs → vue-ui-tiremarks-Dje0I1vf.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-D4_LO9A5.js → vue-ui-tiremarks-KvOyYNVW.js} +7 -7
- package/dist/{vue-ui-treemap-CWoi0iKf.js → vue-ui-treemap-BPxLXNZ5.js} +11 -11
- package/dist/{vue-ui-treemap-Dnq85nnj.cjs → vue-ui-treemap-C2Vrj3tg.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-DgfIA9-H.js → vue-ui-vertical-bar-BAdSzbYU.js} +12 -12
- package/dist/{vue-ui-vertical-bar-pyVFnVaF.cjs → vue-ui-vertical-bar-_MWpPkwZ.cjs} +1 -1
- package/dist/{vue-ui-waffle-DQbEdVDN.js → vue-ui-waffle-CW1UVf-q.js} +12 -12
- package/dist/{vue-ui-waffle-DGeQNIVJ.cjs → vue-ui-waffle-DfJI5Lez.cjs} +1 -1
- package/dist/{vue-ui-wheel-Bhmjjfqi.cjs → vue-ui-wheel-CzZEsjmd.cjs} +1 -1
- package/dist/{vue-ui-wheel-B0vgQ4Ps.js → vue-ui-wheel-DAwYc7XY.js} +7 -7
- package/dist/{vue-ui-word-cloud-hcJsrwPF.cjs → vue-ui-word-cloud-BEyV6jMo.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-XrUyNMpH.js → vue-ui-word-cloud-BzfYkI08.js} +10 -10
- package/dist/vue-ui-xy-BolkwiXB.cjs +3 -0
- package/dist/{vue-ui-xy--QLh9NlZ.js → vue-ui-xy-CJYGMbMt.js} +610 -609
- package/dist/{vue-ui-xy-canvas-DO3kaKEf.cjs → vue-ui-xy-canvas-DkltjVWN.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-mtxLsToQ.js → vue-ui-xy-canvas-sB1dmJQc.js} +11 -11
- package/package.json +1 -1
- package/dist/vue-ui-donut-DzqE2EQ1.cjs +0 -1
- package/dist/vue-ui-xy-B8WkCl69.cjs +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-CH3YkGpv.cjs"),W=require("./useNestedProp-2TBYsJKg.cjs"),J=require("./usePrinter-A1_US3Dh.cjs"),se=require("./Title-m5N0oN0G.cjs"),ue=require("./PenAndPaper-Bv8oV7l0.cjs"),ie=require("./DataTable-RY8EUwF3.cjs"),ce=require("./vue-ui-accordion-_LFrGkGx.cjs"),K=require("./useResponsive-BJ7DTGpm.cjs"),ve=require("./vue-ui-skeleton-DwmP0u2B.cjs"),de=require("./useUserOptionState-BgepsfED.cjs"),he=require("./PackageVersion-C1zaH_aJ.cjs"),me=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),fe=["id"],pe=["xmlns","viewBox"],be=["width","height"],ye=["id"],ge=["stop-color"],ke=["stop-color"],Ce=["stop-color"],we=["stroke","stroke-width"],xe=["stroke","stroke-width"],Le=["x","y","font-size","fill","font-weight"],Be=["points","fill"],$e=["stroke","stroke-width","rx"],_e=["x","y","font-size","fill","font-weight"],Ne=["x","y","font-size","fill","font-weight"],Se={key:5,class:"vue-data-ui-watermark"},ze=["innerHTML"],Te={__name:"vue-ui-funnel",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(Q,{expose:Z}){const d=Q;e.useCssVars(a=>({"427f8ea6":re.value}));const{vue_ui_funnel:ee}=r.useConfig(),b=e.computed(()=>!!d.dataset&&d.dataset.length);e.onMounted(z);function z(){if(r.objectIsEmpty(d.dataset)?r.error({componentName:"VueUiFunnel",type:"dataset"}):d.dataset.forEach((a,o)=>{r.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","value"]}).forEach(l=>{b.value=!1,r.error({componentName:"VueUiFunnel",type:"datasetSerieAttribute",property:l,index:o})})}),t.value.responsive){const a=K.throttle(()=>{const{width:o,height:l}=K.useResponsive({chart:g.value,title:t.value.style.chart.title.text?O.value:null,source:V.value,noTitle:E.value});u.value.height=l,u.value.width=o,m.value=G(),i.value.circles=r.translateSize({relator:Math.min(o,l),adjuster:600,source:t.value.style.chart.circles.dataLabels.fontSize,threshold:10,fallback:10}),i.value.names=r.translateSize({relator:Math.min(o,l),adjuster:600,source:t.value.style.chart.bars.dataLabels.name.fontSize,threshold:10,fallback:10}),i.value.values=r.translateSize({relator:Math.min(o,l),adjuster:600,source:t.value.style.chart.bars.dataLabels.value.fontSize,threshold:10,fallback:10})});D.value=new ResizeObserver(a),D.value.observe(g.value.parentNode)}}const g=e.ref(null),k=e.ref(r.createUid()),T=e.ref(0),P=e.ref(0),A=e.ref(0),E=e.ref(null),V=e.ref(null),O=e.ref(null),D=e.ref(null),f=e.ref(!1);function F(){const a=W.useNestedProp({userConfig:d.config,defaultConfig:ee});return a.theme?{...W.useNestedProp({userConfig:r.themes.vue_ui_funnel[a.theme]||d.config,defaultConfig:a})}:a}const t=e.computed({get:()=>F(),set:a=>a}),{userOptionsVisible:_,setUserOptionsVisibility:I,keepUserOptionState:q}=de.useUserOptionState({config:t.value});e.watch(()=>d.config,a=>{t.value=F(),_.value=!t.value.showOnChartHover,z(),P.value+=1,A.value+=1,i.value.circles=t.value.style.chart.circles.dataLabels.fontSize,i.value.names=t.value.style.chart.bars.dataLabels.name.fontSize,i.value.values=t.value.style.chart.bars.dataLabels.value.fontSize},{deep:!0});const{isPrinting:M,isImaging:R,generatePdf:U,generateImage:j}=J.usePrinter({elementId:`funnel_${k.value}`,fileName:t.value.style.chart.title.text||"vue-ui-funnel"}),te=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),L=e.ref({showTable:t.value.table.show}),i=e.ref({circles:t.value.style.chart.circles.dataLabels.fontSize,names:t.value.style.chart.bars.dataLabels.name.fontSize,values:t.value.style.chart.bars.dataLabels.value.fontSize}),u=e.computed({get:()=>({height:t.value.style.chart.height,width:t.value.style.chart.width}),set:a=>a}),h=e.computed(()=>b.value?d.dataset.map((a,o)=>({...a,color:a.color?r.convertColorToHex(a.color):r.lightenHexColor(t.value.style.chart.bars.defaultColor,o/d.dataset.length)})):[]);setTimeout(()=>{f.value=!0},h.value.length*150);function G(){const a=t.value.style.chart.padding.left,o=t.value.style.chart.padding.top;return{left:a,top:o,right:u.value.width-t.value.style.chart.padding.right,bottom:u.value.height-t.value.style.chart.padding.bottom,width:u.value.width-a-t.value.style.chart.padding.right,height:u.value.height-o-t.value.style.chart.padding.bottom}}const m=e.ref(G()),y=e.computed(()=>m.value.height/d.dataset.length),p=e.computed(()=>y.value*t.value.style.chart.bars.gapRatio),H=e.computed(()=>m.value.width*t.value.style.chart.barCircleSpacingRatio),n=e.computed(()=>h.value.map((a,o)=>{const l=y.value-p.value,s=m.value.top+p.value/2*o+(y.value-p.value/2)*o+p.value/2,v=a.value/h.value[0].value,c=(m.value.width-l-H.value)*(a.value/h.value[0].value);return{...a,cx:m.value.left+l/2,cy:s+l/2,datapointIndex:o,fill:a.color,height:Math.max(l,0),proportion:v,r:Math.max(l/2,0),width:Math.max(c,0),x:m.value.left+l+H.value,y:s}})),ae=e.computed(()=>{const a=n.value.map(o=>`${o.x+o.width},${o.y+(y.value-p.value)/2}`);return`${n.value[0].x},${n.value[0].y+(y.value-p.value)/2} ${a.toString()} ${n.value.at(-1).x},${n.value.at(-1).y+(y.value-p.value)/2}`}),le=e.computed(()=>({x1:n.value[0].cx,y1:n.value[0].cy,x2:n.value.at(-1).cx,y2:n.value.at(-1).cy})),C=e.ref(!1);function oe(a){C.value=a,T.value+=1}const re=e.computed(()=>`${h.value.length*150}ms`),B=e.ref(!1);function N(){B.value=!B.value}function X(){L.value.showTable=!L.value.showTable}const w=e.computed(()=>{const a=h.value.map(l=>({name:l.name,color:l.color})),o=h.value.map(l=>l.value);return{head:a,body:o}}),$=e.computed(()=>{const a=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],o=w.value.head.map((v,c)=>{const x=r.applyDataLabel(t.value.style.chart.bars.dataLabels.value.formatter,w.value.body[c],r.dataLabel({p:t.value.style.chart.bars.dataLabels.value.prefix,v:w.value.body[c],s:t.value.style.chart.bars.dataLabels.value.suffix,r:t.value.table.td.roundingValue}),{datapoint:n.value[c]}),S=r.applyDataLabel(t.value.style.chart.circles.dataLabels.formatter,n.value[c].proportion*100,r.dataLabel({v:n.value[c].proportion*100,s:"%",r:t.value.table.td.roundingPercentage}),{datapoint:n.value[c]});return[{color:v.color,name:v.name},x,S]}),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:a,body:o,config:l}});function Y(){e.nextTick(()=>{const a=w.value.head.map((s,v)=>[[s.name],[w.value.body[v]],[n.value[v].proportion*100]]),o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value],["%"]]].concat(a),l=r.createCsvContent(o);r.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-funnel"})})}function ne(){return h.value}return Z({getData:ne,generatePdf:U,generateCsv:Y,generateImage:j,toggleTable:X,toggleAnnotator:N}),(a,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"funnelChart",ref:g,class:e.normalizeClass(`vue-ui-funnel ${C.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height:100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`funnel_${k.value}`,onMouseenter:o[1]||(o[1]=()=>e.unref(I)(!0)),onMouseleave:o[2]||(o[2]=()=>e.unref(I)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ue.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:N},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),te.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:E,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:O,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(se._sfc_main,{key:`title_${P.value}`,config:{title:{cy:"funnel-div-title",...t.value.style.chart.title},subtitle:{cy:"funnel-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value&&(e.unref(q)||e.unref(_))?(e.openBlock(),e.createBlock(J.UserOptions,{ref:"details",key:`user_option_${T.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(M),isImaging:e.unref(R),uid:k.value,hasTooltip:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasLabel:!1,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:C.value,chartElement:g.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleAnnotator:N,onToggleFullscreen:oe,onGeneratePdf:e.unref(U),onGenerateImage:e.unref(j),onToggleTable:X,onGenerateCsv:Y,style:e.normalizeStyle({visibility:e.unref(q)?e.unref(_)?"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:s})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:s})),void 0,!0)]),key:"4"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:s})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:s})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","chartElement","position","titles","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.value}),viewBox:`0 0 ${u.value.width<=0?10:u.value.width} ${u.value.height<=0?10:u.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(he._sfc_main),a.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:u.value.width<=0?10:u.value.width,height:u.value.height<=0?10:u.value.height,style:{pointerEvents:"none"}},[e.renderSlot(a.$slots,"chart-background",{},void 0,!0)],8,be)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`funnel_area_${k.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.backgroundColor,"stop-opacity":0},null,8,ge),e.createElementVNode("stop",{offset:"20%","stop-color":t.value.style.chart.area.color},null,8,ke),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.area.color},null,8,Ce)],8,ye)]),t.value.style.chart.circleLinks.show?(e.openBlock(),e.createElementBlock("line",e.mergeProps({key:1},le.value,{stroke:t.value.style.chart.circleLinks.color,"stroke-width":12*t.value.style.chart.circleLinks.widthRatio,"stroke-linecap":"round",class:{animated:t.value.useCssAnimation},style:{strokeDasharray:t.value.useCssAnimation?m.value.height:0,strokeDashoffset:t.value.useCssAnimation?m.value.height:0}}),null,16,we)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,({cx:l,cy:s,r:v,fill:c},x)=>(e.openBlock(),e.createElementBlock("circle",e.mergeProps({cx:l,cy:s,r:v,fill:c},{stroke:t.value.style.chart.circles.stroke,"stroke-width":t.value.style.chart.circles.strokeWidth,class:{animated:t.value.useCssAnimation&&!f.value},style:{animationDelay:`${150*x}ms`}}),null,16,xe))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(l,s)=>(e.openBlock(),e.createElementBlock("text",{x:l.cx,y:l.cy+i.value.circles/3+t.value.style.chart.circles.dataLabels.offsetY,"text-anchor":"middle","font-size":i.value.circles,fill:t.value.style.chart.circles.dataLabels.adaptColorToBackground?e.unref(r.adaptColorToBackground)(l.color):t.value.style.chart.circles.dataLabels.color,"font-weight":t.value.style.chart.circles.dataLabels.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.circles.dataLabels.formatter,l.proportion*100,e.unref(r.dataLabel)({v:l.proportion*100,s:"%",r:t.value.style.chart.circles.dataLabels.rounding}),{datapoint:l})),15,Le))),256)),t.value.style.chart.area.show?(e.openBlock(),e.createElementBlock("polygon",{key:2,points:ae.value,fill:`url(#funnel_area_${k.value})`,class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({transition:t.value.useCssAnimation?`all ${150*h.value.length}ms ease-in`:"none"})},null,14,Be)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,({x:l,y:s,height:v,width:c,fill:x},S)=>(e.openBlock(),e.createElementBlock("rect",e.mergeProps({x:l,y:s,height:v,width:c,fill:x},{stroke:t.value.style.chart.bars.stroke,"stroke-width":t.value.style.chart.bars.strokeWidth,rx:t.value.style.chart.bars.borderRadius,class:{animated:t.value.useCssAnimation&&!f.value},style:{animationDelay:`${150*S}ms`}}),null,16,$e))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("text",{x:l.x+l.width+t.value.style.chart.bars.dataLabels.name.offsetX+12,y:l.cy-i.value.names/2+t.value.style.chart.bars.dataLabels.name.offsetY,"text-anchor":"start","font-size":i.value.names,fill:t.value.style.chart.bars.dataLabels.name.color,"font-weight":t.value.style.chart.bars.dataLabels.name.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(l.name),15,_e),e.createElementVNode("text",{x:l.x+l.width+t.value.style.chart.bars.dataLabels.value.offsetX+12,y:l.cy+i.value.values+t.value.style.chart.bars.dataLabels.value.offsetY,"text-anchor":"start","font-size":i.value.values,fill:t.value.style.chart.bars.dataLabels.value.color,"font-weight":t.value.style.chart.bars.dataLabels.value.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.bars.dataLabels.value.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.bars.dataLabels.value.prefix,v:l.value,s:t.value.style.chart.bars.dataLabels.value.suffix,r:t.value.style.chart.bars.dataLabels.value.rounding}),{datapoint:l})),15,Ne)]))),256)),e.renderSlot(a.$slots,"svg",{svg:u.value},void 0,!0)],14,pe)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Se,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(M)||e.unref(R)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ve.default,{key:6,config:{type:"verticalBar",style:{backgroundColor:t.value.style.chart.backgroundColor,verticalBar:{axis:{color:"#CCCCCC"},color:"#CCCCCC"}}}},null,8,["config"])),a.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:V,dir:"auto"},[e.renderSlot(a.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createBlock(ce.default,{key:8,hideDetails:"",config:{open:L.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(ie.DataTable,{key:`table_${A.value}`,colNames:$.value.colNames,head:$.value.head,body:$.value.body,config:$.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:o[0]||(o[0]=l=>L.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,ze)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name?l.name:l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,fe))}},Pe=me._export_sfc(Te,[["__scopeId","data-v-bf9e380b"]]);exports.default=Pe;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-KJL8ra_6.cjs"),W=require("./useNestedProp-Bu958azG.cjs"),J=require("./usePrinter-pDOF3CfL.cjs"),se=require("./Title-D-6pIV0l.cjs"),ue=require("./PenAndPaper-DFXJJink.cjs"),ie=require("./DataTable-wN-jvOfe.cjs"),ce=require("./vue-ui-accordion-4-dyMgJA.cjs"),K=require("./useResponsive-BJ7DTGpm.cjs"),ve=require("./vue-ui-skeleton-D_YCUi1y.cjs"),de=require("./useUserOptionState-BgepsfED.cjs"),he=require("./PackageVersion-Dn-t7tbm.cjs"),me=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),fe=["id"],pe=["xmlns","viewBox"],be=["width","height"],ye=["id"],ge=["stop-color"],ke=["stop-color"],Ce=["stop-color"],we=["stroke","stroke-width"],xe=["stroke","stroke-width"],Le=["x","y","font-size","fill","font-weight"],Be=["points","fill"],$e=["stroke","stroke-width","rx"],_e=["x","y","font-size","fill","font-weight"],Ne=["x","y","font-size","fill","font-weight"],Se={key:5,class:"vue-data-ui-watermark"},ze=["innerHTML"],Te={__name:"vue-ui-funnel",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(Q,{expose:Z}){const d=Q;e.useCssVars(a=>({"427f8ea6":re.value}));const{vue_ui_funnel:ee}=r.useConfig(),b=e.computed(()=>!!d.dataset&&d.dataset.length);e.onMounted(z);function z(){if(r.objectIsEmpty(d.dataset)?r.error({componentName:"VueUiFunnel",type:"dataset"}):d.dataset.forEach((a,o)=>{r.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","value"]}).forEach(l=>{b.value=!1,r.error({componentName:"VueUiFunnel",type:"datasetSerieAttribute",property:l,index:o})})}),t.value.responsive){const a=K.throttle(()=>{const{width:o,height:l}=K.useResponsive({chart:g.value,title:t.value.style.chart.title.text?O.value:null,source:V.value,noTitle:E.value});u.value.height=l,u.value.width=o,m.value=G(),i.value.circles=r.translateSize({relator:Math.min(o,l),adjuster:600,source:t.value.style.chart.circles.dataLabels.fontSize,threshold:10,fallback:10}),i.value.names=r.translateSize({relator:Math.min(o,l),adjuster:600,source:t.value.style.chart.bars.dataLabels.name.fontSize,threshold:10,fallback:10}),i.value.values=r.translateSize({relator:Math.min(o,l),adjuster:600,source:t.value.style.chart.bars.dataLabels.value.fontSize,threshold:10,fallback:10})});D.value=new ResizeObserver(a),D.value.observe(g.value.parentNode)}}const g=e.ref(null),k=e.ref(r.createUid()),T=e.ref(0),P=e.ref(0),A=e.ref(0),E=e.ref(null),V=e.ref(null),O=e.ref(null),D=e.ref(null),f=e.ref(!1);function F(){const a=W.useNestedProp({userConfig:d.config,defaultConfig:ee});return a.theme?{...W.useNestedProp({userConfig:r.themes.vue_ui_funnel[a.theme]||d.config,defaultConfig:a})}:a}const t=e.computed({get:()=>F(),set:a=>a}),{userOptionsVisible:_,setUserOptionsVisibility:I,keepUserOptionState:q}=de.useUserOptionState({config:t.value});e.watch(()=>d.config,a=>{t.value=F(),_.value=!t.value.showOnChartHover,z(),P.value+=1,A.value+=1,i.value.circles=t.value.style.chart.circles.dataLabels.fontSize,i.value.names=t.value.style.chart.bars.dataLabels.name.fontSize,i.value.values=t.value.style.chart.bars.dataLabels.value.fontSize},{deep:!0});const{isPrinting:M,isImaging:R,generatePdf:U,generateImage:j}=J.usePrinter({elementId:`funnel_${k.value}`,fileName:t.value.style.chart.title.text||"vue-ui-funnel"}),te=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),L=e.ref({showTable:t.value.table.show}),i=e.ref({circles:t.value.style.chart.circles.dataLabels.fontSize,names:t.value.style.chart.bars.dataLabels.name.fontSize,values:t.value.style.chart.bars.dataLabels.value.fontSize}),u=e.computed({get:()=>({height:t.value.style.chart.height,width:t.value.style.chart.width}),set:a=>a}),h=e.computed(()=>b.value?d.dataset.map((a,o)=>({...a,color:a.color?r.convertColorToHex(a.color):r.lightenHexColor(t.value.style.chart.bars.defaultColor,o/d.dataset.length)})):[]);setTimeout(()=>{f.value=!0},h.value.length*150);function G(){const a=t.value.style.chart.padding.left,o=t.value.style.chart.padding.top;return{left:a,top:o,right:u.value.width-t.value.style.chart.padding.right,bottom:u.value.height-t.value.style.chart.padding.bottom,width:u.value.width-a-t.value.style.chart.padding.right,height:u.value.height-o-t.value.style.chart.padding.bottom}}const m=e.ref(G()),y=e.computed(()=>m.value.height/d.dataset.length),p=e.computed(()=>y.value*t.value.style.chart.bars.gapRatio),H=e.computed(()=>m.value.width*t.value.style.chart.barCircleSpacingRatio),n=e.computed(()=>h.value.map((a,o)=>{const l=y.value-p.value,s=m.value.top+p.value/2*o+(y.value-p.value/2)*o+p.value/2,v=a.value/h.value[0].value,c=(m.value.width-l-H.value)*(a.value/h.value[0].value);return{...a,cx:m.value.left+l/2,cy:s+l/2,datapointIndex:o,fill:a.color,height:Math.max(l,0),proportion:v,r:Math.max(l/2,0),width:Math.max(c,0),x:m.value.left+l+H.value,y:s}})),ae=e.computed(()=>{const a=n.value.map(o=>`${o.x+o.width},${o.y+(y.value-p.value)/2}`);return`${n.value[0].x},${n.value[0].y+(y.value-p.value)/2} ${a.toString()} ${n.value.at(-1).x},${n.value.at(-1).y+(y.value-p.value)/2}`}),le=e.computed(()=>({x1:n.value[0].cx,y1:n.value[0].cy,x2:n.value.at(-1).cx,y2:n.value.at(-1).cy})),C=e.ref(!1);function oe(a){C.value=a,T.value+=1}const re=e.computed(()=>`${h.value.length*150}ms`),B=e.ref(!1);function N(){B.value=!B.value}function X(){L.value.showTable=!L.value.showTable}const w=e.computed(()=>{const a=h.value.map(l=>({name:l.name,color:l.color})),o=h.value.map(l=>l.value);return{head:a,body:o}}),$=e.computed(()=>{const a=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],o=w.value.head.map((v,c)=>{const x=r.applyDataLabel(t.value.style.chart.bars.dataLabels.value.formatter,w.value.body[c],r.dataLabel({p:t.value.style.chart.bars.dataLabels.value.prefix,v:w.value.body[c],s:t.value.style.chart.bars.dataLabels.value.suffix,r:t.value.table.td.roundingValue}),{datapoint:n.value[c]}),S=r.applyDataLabel(t.value.style.chart.circles.dataLabels.formatter,n.value[c].proportion*100,r.dataLabel({v:n.value[c].proportion*100,s:"%",r:t.value.table.td.roundingPercentage}),{datapoint:n.value[c]});return[{color:v.color,name:v.name},x,S]}),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:a,body:o,config:l}});function Y(){e.nextTick(()=>{const a=w.value.head.map((s,v)=>[[s.name],[w.value.body[v]],[n.value[v].proportion*100]]),o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value],["%"]]].concat(a),l=r.createCsvContent(o);r.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-funnel"})})}function ne(){return h.value}return Z({getData:ne,generatePdf:U,generateCsv:Y,generateImage:j,toggleTable:X,toggleAnnotator:N}),(a,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"funnelChart",ref:g,class:e.normalizeClass(`vue-ui-funnel ${C.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height:100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`funnel_${k.value}`,onMouseenter:o[1]||(o[1]=()=>e.unref(I)(!0)),onMouseleave:o[2]||(o[2]=()=>e.unref(I)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ue.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:N},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),te.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:E,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:O,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(se._sfc_main,{key:`title_${P.value}`,config:{title:{cy:"funnel-div-title",...t.value.style.chart.title},subtitle:{cy:"funnel-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value&&(e.unref(q)||e.unref(_))?(e.openBlock(),e.createBlock(J.UserOptions,{ref:"details",key:`user_option_${T.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(M),isImaging:e.unref(R),uid:k.value,hasTooltip:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasLabel:!1,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:C.value,chartElement:g.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleAnnotator:N,onToggleFullscreen:oe,onGeneratePdf:e.unref(U),onGenerateImage:e.unref(j),onToggleTable:X,onGenerateCsv:Y,style:e.normalizeStyle({visibility:e.unref(q)?e.unref(_)?"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:s})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:s})),void 0,!0)]),key:"4"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:s})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:s})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","chartElement","position","titles","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.value}),viewBox:`0 0 ${u.value.width<=0?10:u.value.width} ${u.value.height<=0?10:u.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(he._sfc_main),a.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:u.value.width<=0?10:u.value.width,height:u.value.height<=0?10:u.value.height,style:{pointerEvents:"none"}},[e.renderSlot(a.$slots,"chart-background",{},void 0,!0)],8,be)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`funnel_area_${k.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.backgroundColor,"stop-opacity":0},null,8,ge),e.createElementVNode("stop",{offset:"20%","stop-color":t.value.style.chart.area.color},null,8,ke),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.area.color},null,8,Ce)],8,ye)]),t.value.style.chart.circleLinks.show?(e.openBlock(),e.createElementBlock("line",e.mergeProps({key:1},le.value,{stroke:t.value.style.chart.circleLinks.color,"stroke-width":12*t.value.style.chart.circleLinks.widthRatio,"stroke-linecap":"round",class:{animated:t.value.useCssAnimation},style:{strokeDasharray:t.value.useCssAnimation?m.value.height:0,strokeDashoffset:t.value.useCssAnimation?m.value.height:0}}),null,16,we)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,({cx:l,cy:s,r:v,fill:c},x)=>(e.openBlock(),e.createElementBlock("circle",e.mergeProps({cx:l,cy:s,r:v,fill:c},{stroke:t.value.style.chart.circles.stroke,"stroke-width":t.value.style.chart.circles.strokeWidth,class:{animated:t.value.useCssAnimation&&!f.value},style:{animationDelay:`${150*x}ms`}}),null,16,xe))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(l,s)=>(e.openBlock(),e.createElementBlock("text",{x:l.cx,y:l.cy+i.value.circles/3+t.value.style.chart.circles.dataLabels.offsetY,"text-anchor":"middle","font-size":i.value.circles,fill:t.value.style.chart.circles.dataLabels.adaptColorToBackground?e.unref(r.adaptColorToBackground)(l.color):t.value.style.chart.circles.dataLabels.color,"font-weight":t.value.style.chart.circles.dataLabels.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.circles.dataLabels.formatter,l.proportion*100,e.unref(r.dataLabel)({v:l.proportion*100,s:"%",r:t.value.style.chart.circles.dataLabels.rounding}),{datapoint:l})),15,Le))),256)),t.value.style.chart.area.show?(e.openBlock(),e.createElementBlock("polygon",{key:2,points:ae.value,fill:`url(#funnel_area_${k.value})`,class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({transition:t.value.useCssAnimation?`all ${150*h.value.length}ms ease-in`:"none"})},null,14,Be)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,({x:l,y:s,height:v,width:c,fill:x},S)=>(e.openBlock(),e.createElementBlock("rect",e.mergeProps({x:l,y:s,height:v,width:c,fill:x},{stroke:t.value.style.chart.bars.stroke,"stroke-width":t.value.style.chart.bars.strokeWidth,rx:t.value.style.chart.bars.borderRadius,class:{animated:t.value.useCssAnimation&&!f.value},style:{animationDelay:`${150*S}ms`}}),null,16,$e))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("text",{x:l.x+l.width+t.value.style.chart.bars.dataLabels.name.offsetX+12,y:l.cy-i.value.names/2+t.value.style.chart.bars.dataLabels.name.offsetY,"text-anchor":"start","font-size":i.value.names,fill:t.value.style.chart.bars.dataLabels.name.color,"font-weight":t.value.style.chart.bars.dataLabels.name.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(l.name),15,_e),e.createElementVNode("text",{x:l.x+l.width+t.value.style.chart.bars.dataLabels.value.offsetX+12,y:l.cy+i.value.values+t.value.style.chart.bars.dataLabels.value.offsetY,"text-anchor":"start","font-size":i.value.values,fill:t.value.style.chart.bars.dataLabels.value.color,"font-weight":t.value.style.chart.bars.dataLabels.value.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.bars.dataLabels.value.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.bars.dataLabels.value.prefix,v:l.value,s:t.value.style.chart.bars.dataLabels.value.suffix,r:t.value.style.chart.bars.dataLabels.value.rounding}),{datapoint:l})),15,Ne)]))),256)),e.renderSlot(a.$slots,"svg",{svg:u.value},void 0,!0)],14,pe)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Se,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(M)||e.unref(R)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ve.default,{key:6,config:{type:"verticalBar",style:{backgroundColor:t.value.style.chart.backgroundColor,verticalBar:{axis:{color:"#CCCCCC"},color:"#CCCCCC"}}}},null,8,["config"])),a.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:V,dir:"auto"},[e.renderSlot(a.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createBlock(ce.default,{key:8,hideDetails:"",config:{open:L.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(ie.DataTable,{key:`table_${A.value}`,colNames:$.value.colNames,head:$.value.head,body:$.value.body,config:$.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:o[0]||(o[0]=l=>L.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,ze)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name?l.name:l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,fe))}},Pe=me._export_sfc(Te,[["__scopeId","data-v-bf9e380b"]]);exports.default=Pe;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { useCssVars as _e, computed as v, onMounted as Le, ref as c, watch as Te, openBlock as s, createElementBlock as u, normalizeClass as T, normalizeStyle as x, unref as r, createBlock as A, createCommentVNode as f, createSlots as Ae, withCtx as k, renderSlot as y, normalizeProps as H, guardReactiveProps as X, createVNode as Ne, createElementVNode as C, mergeProps as Y, Fragment as M, renderList as V, toDisplayString as B, createTextVNode as Oe, nextTick as ze } from "vue";
|
|
2
|
-
import { u as Se, o as Pe, e as fe, g as Fe, c as De, d as Ie, l as Me, i as U, f as E, X as Ve, G as Be, t as Ue, q as Ee, r as Ge, F as q } from "./index-
|
|
3
|
-
import { u as be } from "./useNestedProp-
|
|
4
|
-
import { u as Re, U as je } from "./usePrinter-
|
|
5
|
-
import { _ as He } from "./Title-
|
|
6
|
-
import { P as Xe } from "./PenAndPaper-
|
|
7
|
-
import { D as Ye } from "./DataTable-
|
|
8
|
-
import qe from "./vue-ui-accordion
|
|
2
|
+
import { u as Se, o as Pe, e as fe, g as Fe, c as De, d as Ie, l as Me, i as U, f as E, X as Ve, G as Be, t as Ue, q as Ee, r as Ge, F as q } from "./index-B8Eaq54E.js";
|
|
3
|
+
import { u as be } from "./useNestedProp-Ka0R_Yqa.js";
|
|
4
|
+
import { u as Re, U as je } from "./usePrinter-D83W2gfG.js";
|
|
5
|
+
import { _ as He } from "./Title-XYNHfYwN.js";
|
|
6
|
+
import { P as Xe } from "./PenAndPaper-BTLEk55u.js";
|
|
7
|
+
import { D as Ye } from "./DataTable-DtRXoetj.js";
|
|
8
|
+
import qe from "./vue-ui-accordion--5td7b94.js";
|
|
9
9
|
import { t as We, u as Je } from "./useResponsive-CoxXLe23.js";
|
|
10
|
-
import Ke from "./vue-ui-skeleton-
|
|
10
|
+
import Ke from "./vue-ui-skeleton-DpadzgbS.js";
|
|
11
11
|
import { u as Qe } from "./useUserOptionState-BIvW1Kz7.js";
|
|
12
|
-
import { _ as Ze } from "./PackageVersion-
|
|
12
|
+
import { _ as Ze } from "./PackageVersion-CgJdp_Ki.js";
|
|
13
13
|
import { _ as et } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
14
|
const tt = ["id"], at = ["xmlns", "viewBox"], lt = ["width", "height"], st = ["id"], ot = ["stop-color"], nt = ["stop-color"], rt = ["stop-color"], ut = ["stroke", "stroke-width"], it = ["stroke", "stroke-width"], ct = ["x", "y", "font-size", "fill", "font-weight"], vt = ["points", "fill"], dt = ["stroke", "stroke-width", "rx"], ht = ["x", "y", "font-size", "fill", "font-weight"], ft = ["x", "y", "font-size", "fill", "font-weight"], bt = {
|
|
15
15
|
key: 5,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as h, onMounted as Le, ref as u, watch as Fe, openBlock as o, createElementBlock as n, normalizeClass as E, normalizeStyle as V, unref as i, createBlock as $, createCommentVNode as c, createSlots as Ie, withCtx as d, renderSlot as v, normalizeProps as O, guardReactiveProps as N, createVNode as ie, createElementVNode as _, Fragment as ce, renderList as ve, createTextVNode as de, toDisplayString as M, nextTick as Ae } from "vue";
|
|
2
|
-
import { u as Ee, o as Ve, e as he, g as Me, c as pe, t as De, a as Be, p as D, b as Ge, d as ze, J as ye, M as Ue, f as k, X as We, i as ge, x as fe, y as He, q as Xe, r as je } from "./index-
|
|
3
|
-
import { L as Re } from "./Legend-
|
|
4
|
-
import { _ as Ye } from "./Title-
|
|
5
|
-
import { _ as qe } from "./Tooltip-
|
|
6
|
-
import { D as Je } from "./DataTable-
|
|
7
|
-
import { u as Ke, U as Qe } from "./usePrinter-
|
|
8
|
-
import Ze from "./vue-ui-skeleton-
|
|
9
|
-
import et from "./vue-ui-accordion
|
|
10
|
-
import { u as be } from "./useNestedProp-
|
|
11
|
-
import { _ as tt } from "./PackageVersion-
|
|
12
|
-
import { P as lt } from "./PenAndPaper-
|
|
2
|
+
import { u as Ee, o as Ve, e as he, g as Me, c as pe, t as De, a as Be, p as D, b as Ge, d as ze, J as ye, M as Ue, f as k, X as We, i as ge, x as fe, y as He, q as Xe, r as je } from "./index-B8Eaq54E.js";
|
|
3
|
+
import { L as Re } from "./Legend-RnRqBxiV.js";
|
|
4
|
+
import { _ as Ye } from "./Title-XYNHfYwN.js";
|
|
5
|
+
import { _ as qe } from "./Tooltip-DYRo59nq.js";
|
|
6
|
+
import { D as Je } from "./DataTable-DtRXoetj.js";
|
|
7
|
+
import { u as Ke, U as Qe } from "./usePrinter-D83W2gfG.js";
|
|
8
|
+
import Ze from "./vue-ui-skeleton-DpadzgbS.js";
|
|
9
|
+
import et from "./vue-ui-accordion--5td7b94.js";
|
|
10
|
+
import { u as be } from "./useNestedProp-Ka0R_Yqa.js";
|
|
11
|
+
import { _ as tt } from "./PackageVersion-CgJdp_Ki.js";
|
|
12
|
+
import { P as lt } from "./PenAndPaper-BTLEk55u.js";
|
|
13
13
|
import { u as at } from "./useUserOptionState-BIvW1Kz7.js";
|
|
14
14
|
import { _ as ot } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
15
15
|
const st = ["id"], rt = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-CH3YkGpv.cjs"),ue=require("./Legend-CZrlsh2W.cjs"),ie=require("./Title-m5N0oN0G.cjs"),ce=require("./Tooltip-Dq7633oz.cjs"),de=require("./DataTable-RY8EUwF3.cjs"),X=require("./usePrinter-A1_US3Dh.cjs"),ve=require("./vue-ui-skeleton-DwmP0u2B.cjs"),pe=require("./vue-ui-accordion-_LFrGkGx.cjs"),Y=require("./useNestedProp-2TBYsJKg.cjs"),he=require("./PackageVersion-C1zaH_aJ.cjs"),fe=require("./PenAndPaper-Bv8oV7l0.cjs"),ye=require("./useUserOptionState-BgepsfED.cjs"),ge=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),me=["id"],be={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},ke={key:2,style:"width:100%;background:transparent;padding-bottom:24px"},Ce=["xmlns","viewBox"],we=["width","height"],xe=["id"],$e=["stdDeviation"],Be=["d","stroke","stroke-width"],Se=["d","stroke","stroke-width"],Ne=["filter"],Te=["d","stroke","stroke-width"],Pe=["d","stroke-width","onMouseenter","onClick"],_e={key:5,class:"vue-data-ui-watermark"},Ve=["onClick"],Ee={key:0},Le={key:1},Oe={key:8,ref:"source",dir:"auto"},Fe=["innerHTML"],Ae={__name:"vue-ui-galaxy",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(J,{expose:K,emit:_}){const i=J,{vue_ui_galaxy:Q}=r.useConfig(),k=e.computed(()=>!!i.dataset&&i.dataset.length);e.onMounted(()=>{V()});function V(){r.objectIsEmpty(i.dataset)?r.error({componentName:"VueUiGalaxy",type:"dataset"}):i.dataset.forEach((l,a)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{r.error({componentName:"VueUiGalaxy",type:"datasetSerieAttribute",property:o,index:a})})})}const g=e.ref(r.createUid()),C=e.ref(null),Z=e.ref(null),$=e.ref(!1),B=e.ref(""),c=e.ref(null),E=e.ref(0),L=e.ref(0),O=e.ref(0),F=e.ref(0),t=e.computed({get:()=>I(),set:l=>l}),{userOptionsVisible:S,setUserOptionsVisibility:A,keepUserOptionState:z}=ye.useUserOptionState({config:t.value});function I(){const l=Y.useNestedProp({userConfig:i.config,defaultConfig:Q});return l.theme?{...Y.useNestedProp({userConfig:r.themes.vue_ui_galaxy[l.theme]||i.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>i.config,l=>{t.value=I(),S.value=!t.value.showOnChartHover,V(),L.value+=1,O.value+=1,F.value+=1},{deep:!0});const{isPrinting:D,isImaging:q,generatePdf:M,generateImage:U}=X.usePrinter({elementId:`galaxy_${g.value}`,fileName:t.value.style.chart.title.text||"vue-ui-galaxy"}),ee=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),te=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),v=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),m=e.ref({height:180,width:250}),u=e.ref([]);function N(l){u.value.includes(l.id)?u.value=u.value.filter(a=>a!==l.id):u.value.push(l.id),_("selectLegend",b.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const h=e.computed(()=>i.dataset.map((l,a)=>({name:l.name,color:r.convertColorToHex(l.color)||te.value[a]||r.palette[a]||r.palette[a%r.palette.length],value:l.values?r.sanitizeArray(l.values).reduce((o,n)=>o+n,0):0,absoluteValues:r.sanitizeArray(l.values),id:r.createUid(),seriesIndex:a})).sort((l,a)=>a.value-l.value));function le(){return h.value.map(l=>({name:l.name,color:l.color,value:l.value}))}const d=e.computed(()=>h.value.filter(l=>!u.value.includes(l.id)).map(l=>l.value).reduce((l,a)=>l+a,0)),oe=e.ref(190),G=e.computed(()=>h.value.filter(l=>!u.value.includes(l.id))),b=e.computed(()=>{const l=[];for(let a=0;a<G.value.length;a+=1){const o=G.value[a];let n=o.value/d.value*oe.value;a>0&&l.length&&(n+=l[a-1].points),l.push({points:n,...o,seriesIndex:a,proportion:o.value/d.value,path:r.createSpiralPath({points:n,startX:115+t.value.style.chart.layout.arcs.offsetX,startY:90+t.value.style.chart.layout.arcs.offsetY})})}return l.filter((a,o)=>!u.value.includes(a.id)).toSorted((a,o)=>o.points-a.points)}),y=e.ref(!1);function ae(l){y.value=l,E.value+=1}const T=e.ref(null);function re({datapoint:l,_relativeIndex:a,seriesIndex:o,show:n=!1}){T.value={datapoint:l,seriesIndex:o,series:h.value,config:t.value},$.value=n,c.value=l.id;let s="";const f=t.value.style.chart.tooltip.customFormat;r.isFunction(f)&&r.functionReturnsString(()=>f({seriesIndex:o,datapoint:l,series:h.value,config:t.value}))?B.value=f({seriesIndex:o,datapoint:l,series:h.value,config:t.value}):(s+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,s+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,t.value.style.chart.tooltip.showValue&&(s+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,l.value,r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:o})}</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?s+=`<span>(${r.dataLabel({v:l.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})})</span></div>`:s+=`<b>${r.dataLabel({v:l.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`),B.value=`<div>${s}</div>`)}const W=e.computed(()=>h.value.map((l,a)=>({...l,proportion:(l.value||0)/i.dataset.map(o=>(o.values||[]).reduce((n,s)=>n+s,0)).reduce((o,n)=>o+n,0),opacity:u.value.includes(l.id)?.5:1,shape:l.shape||"circle",segregate:()=>N(l),isSegregated:u.value.includes(l.id)}))),ne=e.computed(()=>({cy:"galaxy-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),p=e.computed(()=>{const l=b.value.map(o=>({name:o.name,color:o.color})),a=b.value.map(o=>o.value);return{head:l,body:a}});function H(){e.nextTick(()=>{const l=p.value.head.map((n,s)=>[[n.name],[p.value.body[s]],[isNaN(p.value.body[s]/d.value)?"-":p.value.body[s]/d.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=r.createCsvContent(a);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-galaxy"})})}const w=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:d.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],a=p.value.head.map((s,f)=>{const se=r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:p.value.body[f],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue});return[{color:s.color,name:s.name},se,isNaN(p.value.body[f]/d.value)?"-":r.dataLabel({v:p.value.body[f]/d.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],head:l,body:a,config:o}});function R(){v.value.showTable=!v.value.showTable}function j(){v.value.showTooltip=!v.value.showTooltip}const x=e.ref(!1);function P(){x.value=!x.value}return K({getData:le,generatePdf:M,generateCsv:H,generateImage:U,toggleTable:R,toggleTooltip:j,toggleAnnotator:P}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"galaxyChart",ref:C,class:e.normalizeClass(`vue-ui-galaxy ${y.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`galaxy_${g.value}`,onMouseenter:a[3]||(a[3]=()=>e.unref(A)(!0)),onMouseleave:a[4]||(a[4]=()=>e.unref(A)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(fe.PenAndPaper,{key:0,parent:C.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:x.value,onClose:P},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ee.value?(e.openBlock(),e.createElementBlock("div",be,null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",ke,[(e.openBlock(),e.createBlock(ie._sfc_main,{key:`title_${L.value}`,config:{title:{cy:"galaxy-div-title",...t.value.style.chart.title},subtitle:{cy:"galaxy-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&k.value&&(e.unref(z)||e.unref(S))?(e.openBlock(),e.createBlock(X.UserOptions,{ref_key:"details",ref:Z,key:`user_option_${E.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(D),isImaging:e.unref(q),uid:g.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:v.value.showTooltip,isFullscreen:y.value,titles:{...t.value.userOptions.buttonTitles},chartElement:C.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:x.value,onToggleFullscreen:ae,onGeneratePdf:e.unref(M),onGenerateCsv:H,onGenerateImage:e.unref(U),onToggleTable:R,onToggleTooltip:j,onToggleAnnotator:P,style:e.normalizeStyle({visibility:e.unref(z)?e.unref(S)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":y.value,"vue-data-ui-fulscreen--off":!y.value}),viewBox:`0 0 ${m.value.width} ${m.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(he._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:m.value.width,height:m.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,we)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${g.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.layout.arcs.gradient.intensity},null,8,$e)],8,xe)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,o=>(e.openBlock(),e.createElementBlock("g",null,[o.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.path,fill:"none",stroke:t.value.style.chart.backgroundColor,"stroke-width":(t.value.style.chart.layout.arcs.strokeWidth+t.value.style.chart.layout.arcs.borderWidth)*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round"},null,8,Be)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:o.path,fill:"none",stroke:o.color,"stroke-width":t.value.style.chart.layout.arcs.strokeWidth*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round",class:e.normalizeClass(`${c.value&&c.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,Se)):e.createCommentVNode("",!0),o.value&&t.value.style.chart.layout.arcs.gradient.show?(e.openBlock(),e.createElementBlock("g",{key:2,filter:`url(#blur_${g.value})`},[e.createElementVNode("path",{d:o.path,fill:"none",stroke:t.value.style.chart.layout.arcs.gradient.color,"stroke-width":t.value.style.chart.layout.arcs.strokeWidth/2*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round",class:e.normalizeClass(`vue-ui-galaxy-gradient ${c.value&&c.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,Te)],8,Ne)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(o,n)=>(e.openBlock(),e.createElementBlock("g",null,[o.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.path,fill:"none",stroke:"transparent","stroke-width":t.value.style.chart.layout.arcs.strokeWidth+t.value.style.chart.layout.arcs.borderWidth,"stroke-linecap":"round",onMouseenter:s=>re({datapoint:o,relativeIndex:n,seriesIndex:o.seriesIndex,show:!0}),onMouseleave:a[0]||(a[0]=s=>{$.value=!1,c.value=null}),onClick:s=>_("selectDatapoint",o)},null,40,Pe)):e.createCommentVNode("",!0)]))),256)),e.renderSlot(l.$slots,"svg",{svg:m.value},void 0,!0)],14,Ce)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",_e,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(D)||e.unref(q)})),void 0,!0)])):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ve.default,{key:6,config:{type:"galaxy",style:{backgroundColor:t.value.style.chart.backgroundColor,galaxy:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(ue.Legend,{key:`legend_${F.value}`,legendSet:W.value,config:ne.value,onClickMarker:a[1]||(a[1]=({legend:o})=>N(o))},{item:e.withCtx(({legend:o,index:n})=>[e.createElementVNode("div",{onClick:s=>N(o),style:e.normalizeStyle(`opacity:${u.value.includes(o.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:o,seriesIndex:n}))+" ",1),u.value.includes(o.id)?(e.openBlock(),e.createElementBlock("span",Le," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Ee," ("+e.toDisplayString(isNaN(o.value/d.value)?"-":e.unref(r.dataLabel)({v:o.value/d.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,Ve)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:W.value},void 0,!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Oe,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ce._sfc_main,{show:v.value.showTooltip&&$.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:C.value,content:B.value,isFullscreen:y.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...T.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...T.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),k.value?(e.openBlock(),e.createBlock(pe.default,{key:9,hideDetails:"",config:{open:v.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(de.DataTable,{key:`table_${O.value}`,colNames: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:a[2]||(a[2]=o=>v.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Fe)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,me))}},ze=ge._export_sfc(Ae,[["__scopeId","data-v-ce1544eb"]]);exports.default=ze;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-KJL8ra_6.cjs"),ue=require("./Legend-DqGE1lkA.cjs"),ie=require("./Title-D-6pIV0l.cjs"),ce=require("./Tooltip-CNox4F8U.cjs"),de=require("./DataTable-wN-jvOfe.cjs"),X=require("./usePrinter-pDOF3CfL.cjs"),ve=require("./vue-ui-skeleton-D_YCUi1y.cjs"),pe=require("./vue-ui-accordion-4-dyMgJA.cjs"),Y=require("./useNestedProp-Bu958azG.cjs"),he=require("./PackageVersion-Dn-t7tbm.cjs"),fe=require("./PenAndPaper-DFXJJink.cjs"),ye=require("./useUserOptionState-BgepsfED.cjs"),ge=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),me=["id"],be={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},ke={key:2,style:"width:100%;background:transparent;padding-bottom:24px"},Ce=["xmlns","viewBox"],we=["width","height"],xe=["id"],$e=["stdDeviation"],Be=["d","stroke","stroke-width"],Se=["d","stroke","stroke-width"],Ne=["filter"],Te=["d","stroke","stroke-width"],Pe=["d","stroke-width","onMouseenter","onClick"],_e={key:5,class:"vue-data-ui-watermark"},Ve=["onClick"],Ee={key:0},Le={key:1},Oe={key:8,ref:"source",dir:"auto"},Fe=["innerHTML"],Ae={__name:"vue-ui-galaxy",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(J,{expose:K,emit:_}){const i=J,{vue_ui_galaxy:Q}=r.useConfig(),k=e.computed(()=>!!i.dataset&&i.dataset.length);e.onMounted(()=>{V()});function V(){r.objectIsEmpty(i.dataset)?r.error({componentName:"VueUiGalaxy",type:"dataset"}):i.dataset.forEach((l,a)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{r.error({componentName:"VueUiGalaxy",type:"datasetSerieAttribute",property:o,index:a})})})}const g=e.ref(r.createUid()),C=e.ref(null),Z=e.ref(null),$=e.ref(!1),B=e.ref(""),c=e.ref(null),E=e.ref(0),L=e.ref(0),O=e.ref(0),F=e.ref(0),t=e.computed({get:()=>I(),set:l=>l}),{userOptionsVisible:S,setUserOptionsVisibility:A,keepUserOptionState:z}=ye.useUserOptionState({config:t.value});function I(){const l=Y.useNestedProp({userConfig:i.config,defaultConfig:Q});return l.theme?{...Y.useNestedProp({userConfig:r.themes.vue_ui_galaxy[l.theme]||i.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>i.config,l=>{t.value=I(),S.value=!t.value.showOnChartHover,V(),L.value+=1,O.value+=1,F.value+=1},{deep:!0});const{isPrinting:D,isImaging:q,generatePdf:M,generateImage:U}=X.usePrinter({elementId:`galaxy_${g.value}`,fileName:t.value.style.chart.title.text||"vue-ui-galaxy"}),ee=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),te=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),v=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),m=e.ref({height:180,width:250}),u=e.ref([]);function N(l){u.value.includes(l.id)?u.value=u.value.filter(a=>a!==l.id):u.value.push(l.id),_("selectLegend",b.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const h=e.computed(()=>i.dataset.map((l,a)=>({name:l.name,color:r.convertColorToHex(l.color)||te.value[a]||r.palette[a]||r.palette[a%r.palette.length],value:l.values?r.sanitizeArray(l.values).reduce((o,n)=>o+n,0):0,absoluteValues:r.sanitizeArray(l.values),id:r.createUid(),seriesIndex:a})).sort((l,a)=>a.value-l.value));function le(){return h.value.map(l=>({name:l.name,color:l.color,value:l.value}))}const d=e.computed(()=>h.value.filter(l=>!u.value.includes(l.id)).map(l=>l.value).reduce((l,a)=>l+a,0)),oe=e.ref(190),G=e.computed(()=>h.value.filter(l=>!u.value.includes(l.id))),b=e.computed(()=>{const l=[];for(let a=0;a<G.value.length;a+=1){const o=G.value[a];let n=o.value/d.value*oe.value;a>0&&l.length&&(n+=l[a-1].points),l.push({points:n,...o,seriesIndex:a,proportion:o.value/d.value,path:r.createSpiralPath({points:n,startX:115+t.value.style.chart.layout.arcs.offsetX,startY:90+t.value.style.chart.layout.arcs.offsetY})})}return l.filter((a,o)=>!u.value.includes(a.id)).toSorted((a,o)=>o.points-a.points)}),y=e.ref(!1);function ae(l){y.value=l,E.value+=1}const T=e.ref(null);function re({datapoint:l,_relativeIndex:a,seriesIndex:o,show:n=!1}){T.value={datapoint:l,seriesIndex:o,series:h.value,config:t.value},$.value=n,c.value=l.id;let s="";const f=t.value.style.chart.tooltip.customFormat;r.isFunction(f)&&r.functionReturnsString(()=>f({seriesIndex:o,datapoint:l,series:h.value,config:t.value}))?B.value=f({seriesIndex:o,datapoint:l,series:h.value,config:t.value}):(s+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,s+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,t.value.style.chart.tooltip.showValue&&(s+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,l.value,r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:o})}</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?s+=`<span>(${r.dataLabel({v:l.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})})</span></div>`:s+=`<b>${r.dataLabel({v:l.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`),B.value=`<div>${s}</div>`)}const W=e.computed(()=>h.value.map((l,a)=>({...l,proportion:(l.value||0)/i.dataset.map(o=>(o.values||[]).reduce((n,s)=>n+s,0)).reduce((o,n)=>o+n,0),opacity:u.value.includes(l.id)?.5:1,shape:l.shape||"circle",segregate:()=>N(l),isSegregated:u.value.includes(l.id)}))),ne=e.computed(()=>({cy:"galaxy-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),p=e.computed(()=>{const l=b.value.map(o=>({name:o.name,color:o.color})),a=b.value.map(o=>o.value);return{head:l,body:a}});function H(){e.nextTick(()=>{const l=p.value.head.map((n,s)=>[[n.name],[p.value.body[s]],[isNaN(p.value.body[s]/d.value)?"-":p.value.body[s]/d.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=r.createCsvContent(a);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-galaxy"})})}const w=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:d.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],a=p.value.head.map((s,f)=>{const se=r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:p.value.body[f],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue});return[{color:s.color,name:s.name},se,isNaN(p.value.body[f]/d.value)?"-":r.dataLabel({v:p.value.body[f]/d.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],head:l,body:a,config:o}});function R(){v.value.showTable=!v.value.showTable}function j(){v.value.showTooltip=!v.value.showTooltip}const x=e.ref(!1);function P(){x.value=!x.value}return K({getData:le,generatePdf:M,generateCsv:H,generateImage:U,toggleTable:R,toggleTooltip:j,toggleAnnotator:P}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"galaxyChart",ref:C,class:e.normalizeClass(`vue-ui-galaxy ${y.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`galaxy_${g.value}`,onMouseenter:a[3]||(a[3]=()=>e.unref(A)(!0)),onMouseleave:a[4]||(a[4]=()=>e.unref(A)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(fe.PenAndPaper,{key:0,parent:C.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:x.value,onClose:P},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ee.value?(e.openBlock(),e.createElementBlock("div",be,null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",ke,[(e.openBlock(),e.createBlock(ie._sfc_main,{key:`title_${L.value}`,config:{title:{cy:"galaxy-div-title",...t.value.style.chart.title},subtitle:{cy:"galaxy-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&k.value&&(e.unref(z)||e.unref(S))?(e.openBlock(),e.createBlock(X.UserOptions,{ref_key:"details",ref:Z,key:`user_option_${E.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(D),isImaging:e.unref(q),uid:g.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:v.value.showTooltip,isFullscreen:y.value,titles:{...t.value.userOptions.buttonTitles},chartElement:C.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:x.value,onToggleFullscreen:ae,onGeneratePdf:e.unref(M),onGenerateCsv:H,onGenerateImage:e.unref(U),onToggleTable:R,onToggleTooltip:j,onToggleAnnotator:P,style:e.normalizeStyle({visibility:e.unref(z)?e.unref(S)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":y.value,"vue-data-ui-fulscreen--off":!y.value}),viewBox:`0 0 ${m.value.width} ${m.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(he._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:m.value.width,height:m.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,we)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${g.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.layout.arcs.gradient.intensity},null,8,$e)],8,xe)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,o=>(e.openBlock(),e.createElementBlock("g",null,[o.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.path,fill:"none",stroke:t.value.style.chart.backgroundColor,"stroke-width":(t.value.style.chart.layout.arcs.strokeWidth+t.value.style.chart.layout.arcs.borderWidth)*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round"},null,8,Be)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:o.path,fill:"none",stroke:o.color,"stroke-width":t.value.style.chart.layout.arcs.strokeWidth*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round",class:e.normalizeClass(`${c.value&&c.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,Se)):e.createCommentVNode("",!0),o.value&&t.value.style.chart.layout.arcs.gradient.show?(e.openBlock(),e.createElementBlock("g",{key:2,filter:`url(#blur_${g.value})`},[e.createElementVNode("path",{d:o.path,fill:"none",stroke:t.value.style.chart.layout.arcs.gradient.color,"stroke-width":t.value.style.chart.layout.arcs.strokeWidth/2*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round",class:e.normalizeClass(`vue-ui-galaxy-gradient ${c.value&&c.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,Te)],8,Ne)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(o,n)=>(e.openBlock(),e.createElementBlock("g",null,[o.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.path,fill:"none",stroke:"transparent","stroke-width":t.value.style.chart.layout.arcs.strokeWidth+t.value.style.chart.layout.arcs.borderWidth,"stroke-linecap":"round",onMouseenter:s=>re({datapoint:o,relativeIndex:n,seriesIndex:o.seriesIndex,show:!0}),onMouseleave:a[0]||(a[0]=s=>{$.value=!1,c.value=null}),onClick:s=>_("selectDatapoint",o)},null,40,Pe)):e.createCommentVNode("",!0)]))),256)),e.renderSlot(l.$slots,"svg",{svg:m.value},void 0,!0)],14,Ce)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",_e,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(D)||e.unref(q)})),void 0,!0)])):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ve.default,{key:6,config:{type:"galaxy",style:{backgroundColor:t.value.style.chart.backgroundColor,galaxy:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(ue.Legend,{key:`legend_${F.value}`,legendSet:W.value,config:ne.value,onClickMarker:a[1]||(a[1]=({legend:o})=>N(o))},{item:e.withCtx(({legend:o,index:n})=>[e.createElementVNode("div",{onClick:s=>N(o),style:e.normalizeStyle(`opacity:${u.value.includes(o.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:o,seriesIndex:n}))+" ",1),u.value.includes(o.id)?(e.openBlock(),e.createElementBlock("span",Le," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Ee," ("+e.toDisplayString(isNaN(o.value/d.value)?"-":e.unref(r.dataLabel)({v:o.value/d.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,Ve)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:W.value},void 0,!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Oe,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ce._sfc_main,{show:v.value.showTooltip&&$.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:C.value,content:B.value,isFullscreen:y.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...T.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...T.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),k.value?(e.openBlock(),e.createBlock(pe.default,{key:9,hideDetails:"",config:{open:v.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(de.DataTable,{key:`table_${O.value}`,colNames: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:a[2]||(a[2]=o=>v.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Fe)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,me))}},ze=ge._export_sfc(Ae,[["__scopeId","data-v-ce1544eb"]]);exports.default=ze;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { computed as f, ref as y, watch as me, onMounted as Ae, onBeforeUnmount as Re, openBlock as s, createElementBlock as u, normalizeClass as pe, normalizeStyle as B, unref as i, createBlock as R, createCommentVNode as c, withCtx as X, toDisplayString as C, createSlots as Ge, renderSlot as w, normalizeProps as G, guardReactiveProps as E, createVNode as Ee, createElementVNode as p, Fragment as k, renderList as S, mergeProps as U } from "vue";
|
|
2
|
-
import { u as Ue, c as We, t as je, a as Te, p as ge, b as Le, o as ke, d as De, e as W, g as be, m as V, I as $, X as Be, s as q, k as Ve, i as H, f as Z, F as J } from "./index-
|
|
2
|
+
import { u as Ue, c as We, t as je, a as Te, p as ge, b as Le, o as ke, d as De, e as W, g as be, m as V, I as $, X as Be, s as q, k as Ve, i as H, f as Z, F as J } from "./index-B8Eaq54E.js";
|
|
3
3
|
import { t as qe, u as He } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { u as Ze, U as Je } from "./usePrinter-
|
|
5
|
-
import Ke from "./vue-ui-skeleton-
|
|
6
|
-
import { _ as Qe } from "./Title-
|
|
7
|
-
import { u as _e } from "./useNestedProp-
|
|
8
|
-
import { _ as et } from "./PackageVersion-
|
|
9
|
-
import { P as tt } from "./PenAndPaper-
|
|
4
|
+
import { u as Ze, U as Je } from "./usePrinter-D83W2gfG.js";
|
|
5
|
+
import Ke from "./vue-ui-skeleton-DpadzgbS.js";
|
|
6
|
+
import { _ as Qe } from "./Title-XYNHfYwN.js";
|
|
7
|
+
import { u as _e } from "./useNestedProp-Ka0R_Yqa.js";
|
|
8
|
+
import { _ as et } from "./PackageVersion-CgJdp_Ki.js";
|
|
9
|
+
import { P as tt } from "./PenAndPaper-BTLEk55u.js";
|
|
10
10
|
import { u as at } from "./useUserOptionState-BIvW1Kz7.js";
|
|
11
11
|
import { _ as lt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
12
12
|
const rt = ["id"], st = { key: 0 }, ot = ["xmlns", "viewBox"], ut = ["width", "height"], nt = ["id"], it = ["stop-color"], ct = ["stop-color"], vt = ["stop-color"], ht = ["id"], dt = ["stdDeviation"], yt = { key: 1 }, ft = ["d", "fill", "stroke"], mt = ["d", "fill", "stroke"], pt = ["id", "d"], gt = ["fill", "font-size", "font-weight"], kt = ["href", "startOffset"], bt = ["x", "y", "text-anchor", "fill", "font-size", "font-weight"], _t = ["d", "filter"], xt = ["stroke", "stroke-width"], wt = ["stroke", "stroke-width"], St = ["stroke", "stroke-width"], $t = ["stroke", "stroke-width"], zt = { key: 7 }, Ft = ["x", "y", "text-anchor", "font-size", "font-weight", "fill"], Ct = ["x", "y", "font-size", "font-weight", "fill"], Ot = { key: 9 }, Mt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Pt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Nt = ["x1", "y1", "x2", "y2", "stroke-width", "filter"], Xt = { key: 10 }, It = ["d", "fill", "stroke", "stroke-width"], Yt = ["cx", "cy", "fill", "r", "stroke-width", "stroke"], At = ["x", "y", "font-size", "fill"], Rt = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-CH3YkGpv.cjs"),W=require("./useResponsive-BJ7DTGpm.cjs"),H=require("./usePrinter-A1_US3Dh.cjs"),ve=require("./vue-ui-skeleton-DwmP0u2B.cjs"),de=require("./Title-m5N0oN0G.cjs"),Z=require("./useNestedProp-2TBYsJKg.cjs"),he=require("./PackageVersion-C1zaH_aJ.cjs"),me=require("./PenAndPaper-Bv8oV7l0.cjs"),fe=require("./useUserOptionState-BgepsfED.cjs"),ye=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),pe=["id"],ke={key:0},ge=["xmlns","viewBox"],be=["width","height"],Se=["id"],Be=["stop-color"],_e=["stop-color"],xe=["stop-color"],we=["id"],Ce=["stdDeviation"],Ne={key:1},Fe=["d","fill","stroke"],Ee=["d","fill","stroke"],ze=["id","d"],$e=["fill","font-size","font-weight"],Pe=["href","startOffset"],Oe=["x","y","text-anchor","fill","font-size","font-weight"],Me=["d","filter"],Ve=["stroke","stroke-width"],Xe=["stroke","stroke-width"],Ie=["stroke","stroke-width"],Ye=["stroke","stroke-width"],Re={key:7},Ae=["x","y","text-anchor","font-size","font-weight","fill"],Le=["x","y","font-size","font-weight","fill"],De={key:9},Ge=["x1","y1","x2","y2","stroke","stroke-width"],je=["x1","y1","x2","y2","stroke","stroke-width"],qe=["x1","y1","x2","y2","stroke-width","filter"],Te={key:10},Ue=["d","fill","stroke","stroke-width"],We=["cx","cy","fill","r","stroke-width","stroke"],He=["x","y","font-size","fill"],Ze={key:5,class:"vue-data-ui-watermark"},Je={__name:"vue-ui-gauge",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(C,{expose:J}){const c=C,{vue_ui_gauge:K}=s.useConfig(),_=e.computed(()=>!!c.dataset&&Object.keys(c.dataset).length>0&&c.dataset.series&&c.dataset.series.length),m=e.ref(s.createUid()),Q=e.ref(null),z=e.ref(0),g=e.ref(null),$=e.ref(null),P=e.ref(null),O=e.ref(null),M=e.ref(null),V=e.ref(0),t=e.computed({get:()=>Y(),set:a=>a}),{userOptionsVisible:N,setUserOptionsVisibility:X,keepUserOptionState:I}=fe.useUserOptionState({config:t.value});e.watch(()=>c.config,a=>{t.value=Y(),N.value=!t.value.showOnChartHover,j(),V.value+=1},{deep:!0});function Y(){const a=Z.useNestedProp({userConfig:c.config,defaultConfig:K});return a.theme?{...Z.useNestedProp({userConfig:s.themes.vue_ui_gauge[a.theme]||c.config,defaultConfig:a}),customPalette:s.themePalettes[a.theme]||s.palette}:a}const{isPrinting:R,isImaging:A,generatePdf:L,generateImage:D}=H.usePrinter({elementId:`vue-ui-gauge_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-gauge"}),ee=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),te=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),p=e.computed(()=>{if(!_.value||s.objectIsEmpty(c.dataset.series||{}))return{value:0,series:[{from:0,to:0}]};const a=[];(c.dataset.series||[]).forEach(o=>{a.push(o.from||1e-7),a.push(o.to||1e-7)});const n=Math.max(...a);return{...c.dataset,series:(c.dataset.series||[]).map((o,r)=>({...o,color:s.convertColorToHex(o.color)||te.value[r]||s.palette[r],value:((o.to||0)-(o.from||0))/n*100}))}}),h=e.ref(512),l=e.ref({height:358.4,width:h.value,top:0,bottom:358.4,centerX:179.2,centerY:h.value/2,labelFontSize:18,legendFontSize:t.value.style.chart.legend.fontSize,pointerRadius:t.value.style.chart.layout.pointer.circle.radius,trackSize:t.value.style.chart.layout.track.size,pointerSize:t.value.style.chart.layout.pointer.size,pointerStrokeWidth:t.value.style.chart.layout.pointer.strokeWidth,markerOffset:t.value.style.chart.layout.markers.offsetY+3,segmentFontSize:t.value.style.chart.layout.segmentNames.fontSize}),b=e.ref(0),S=e.ref(0),d=e.ref(t.value.style.chart.animation.use?Math.min(...c.dataset.series.map(a=>a.from)):c.dataset.value);e.watch(()=>c.dataset.value,()=>{q(c.dataset.value)});const u=e.computed(()=>{const a=l.value.width/2,n=i.value.base,o=Math.PI*((d.value+0-S.value)/(b.value-S.value))+Math.PI;return{x1:a,y1:n,x2:a+i.value.pointerSize*l.value.pointerSize*.9*Math.cos(o),y2:n+i.value.pointerSize*l.value.pointerSize*.9*Math.sin(o)}}),G=e.computed(()=>{const a=l.value.width/2,n=i.value.base,o=Math.PI*((d.value+0-S.value)/(b.value-S.value))+Math.PI,r=a+i.value.pointerSize*l.value.pointerSize*.9*Math.cos(o),f=n+i.value.pointerSize*l.value.pointerSize*.9*Math.sin(o),y=l.value.pointerRadius,se=a+y*Math.cos(o+Math.PI/2),ue=n+y*Math.sin(o+Math.PI/2),ie=a+y*Math.cos(o-Math.PI/2),ce=n+y*Math.sin(o-Math.PI/2);return isNaN(r)?null:`M ${r},${f} ${se},${ue} ${ie},${ce} Z`}),F=e.computed(()=>{for(let a=0;a<p.value.series.length;a+=1){const{color:n,from:o,to:r}=p.value.series[a];if(d.value>=o&&d.value<=r)return n}return"#2D353C"}),x=e.ref(null);function j(){if(s.objectIsEmpty(c.dataset)?s.error({componentName:"VueUiGauge",type:"dataset"}):(s.getMissingDatasetAttributes({datasetObject:c.dataset,requiredAttributes:["value","series"]}).forEach(a=>{s.error({componentName:"VueUiGauge",type:"datasetAttribute",property:a})}),Object.hasOwn(c.dataset,"series")&&(c.dataset.series.length?c.dataset.series.forEach((a,n)=>{s.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["from","to"]}).forEach(o=>{s.error({componentName:"VueUiGauge",type:"datasetSerieAttribute",property:o,index:n})})}):s.error({componentName:"VueUiGauge",type:"datasetAttributeEmpty",property:"series"}))),q(c.dataset.value||0),t.value.responsive){const a=W.throttle(()=>{const{width:n,height:o}=W.useResponsive({chart:g.value,title:t.value.style.chart.title.text?$.value:null,legend:P.value,source:O.value,noTitle:M.value});l.value.width=n,l.value.height=o,l.value.centerX=n/2,l.value.centerY=h.value/2/358.4*o,l.value.bottom=o,l.value.labelFontSize=18/h.value*Math.min(o,n)<10?10:18/h.value*Math.min(o,n),l.value.legendFontSize=t.value.style.chart.legend.fontSize/h.value*Math.min(o,n)<14?14:t.value.style.chart.legend.fontSize/h.value*Math.min(o,n),l.value.pointerRadius=t.value.style.chart.layout.pointer.circle.radius/h.value*Math.min(o,n),l.value.trackSize=t.value.style.chart.layout.track.size/h.value*Math.min(o,n),l.value.pointerStrokeWidth=s.translateSize({relator:Math.min(n,o),adjuster:h.value,source:t.value.style.chart.layout.pointer.strokeWidth,threshold:2,fallback:2}),l.value.markerOffset=s.translateSize({relator:Math.max(n,o),adjuster:h.value,source:t.value.style.chart.layout.markers.offsetY+3,threshold:2,fallback:2}),l.value.segmentFontSize=s.translateSize({relator:Math.min(n,o),adjuster:h.value,source:t.value.style.chart.layout.segmentNames.fontSize,threshold:8,fallback:8})});x.value=new ResizeObserver(a),x.value.observe(g.value.parentNode)}}e.onMounted(()=>{j()}),e.onBeforeUnmount(()=>{x.value&&x.value.disconnect()});function q(a){const n=[];(p.value.series||[]).forEach(y=>{n.push(y.from||0),n.push(y.to||0)}),b.value=Math.max(...n),S.value=Math.min(...n);let o=t.value.style.chart.animation.speed;const r=Math.abs(a-d.value)/(o*60);function f(){d.value<a?d.value=Math.min(d.value+r,a):d.value>a&&(d.value=Math.max(d.value-r,a)),d.value!==a&&requestAnimationFrame(f)}f()}const i=e.computed(()=>{const a=t.value.responsive?Math.min(l.value.width,l.value.height):l.value.width,n=2.5/t.value.style.chart.layout.radiusRatio;return{arcs:a/n,gradients:a/(n*1.1),base:t.value.responsive?l.value.height/2:l.value.height*.7,ratingBase:t.value.responsive?l.value.height/2+l.value.height/4:l.value.height*.9,pointerSize:t.value.responsive?Math.min(l.value.width,l.value.height)/3:l.value.width/3.2}}),v=e.computed(()=>s.makeDonut({series:p.value.series},l.value.width/2,i.value.base,i.value.arcs,i.value.arcs,1,1,1,180,109.9495,40*l.value.trackSize)),ae=e.computed(()=>s.makeDonut({series:p.value.series},l.value.width/2,i.value.base,i.value.arcs*t.value.style.chart.layout.segmentNames.offsetRatio,i.value.arcs*t.value.style.chart.layout.segmentNames.offsetRatio,1,1,1,180,109.9495,40*l.value.trackSize)),k=e.computed(()=>v.value.map(a=>i.value.arcs*t.value.style.chart.layout.segmentNames.offsetRatio*(a.nameOffsetRatio||1))),T=e.computed(()=>{const{x:a,y:n}=s.offsetFromCenterPoint({initX:v.value[0].firstSeparator.x,initY:v.value[0].firstSeparator.y,centerX:u.value.x1,centerY:u.value.y1,offset:-t.value.style.chart.layout.segmentSeparators.offsetIn}),{x:o,y:r}=s.offsetFromCenterPoint({initX:v.value[0].startX,initY:v.value[0].startY,centerX:u.value.x1,centerY:u.value.y1,offset:t.value.style.chart.layout.segmentSeparators.offsetOut});return{x1:a,y1:n,x2:o,y2:r}}),U=e.computed(()=>v.value.map(a=>{const{x:n,y:o}=s.offsetFromCenterPoint({initX:a.separator.x,initY:a.separator.y,centerX:u.value.x1,centerY:u.value.y1,offset:-t.value.style.chart.layout.segmentSeparators.offsetIn}),{x:r,y:f}=s.offsetFromCenterPoint({initX:a.endX,initY:a.endY,centerX:u.value.x1,centerY:u.value.y1,offset:t.value.style.chart.layout.segmentSeparators.offsetOut});return{x1:n,y1:o,x2:r,y2:f}}));function oe(a){if(a.reduce((f,y)=>f+y,0)>100)throw new Error("Total % must not exceed 100");const o=50;let r=0;return a.map(f=>(r+=f,`${r/100*o-f/4}%`))}const le=e.computed(()=>oe(v.value.map(a=>a.proportion*100))),re=e.computed(()=>s.makeDonut({series:p.value.series},l.value.width/2,i.value.base,i.value.gradients,i.value.gradients,.95,1,1,180,110.02,2*l.value.trackSize)),B=e.ref(!1);function ne(a){B.value=a,z.value+=1}const w=e.ref(!1);function E(){w.value=!w.value}return J({generatePdf:L,generateImage:D,toggleAnnotator:E}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-gauge ${B.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"gaugeChart",ref:g,id:`vue-ui-gauge_${m.value}`,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%":""}`),onMouseenter:n[0]||(n[0]=()=>e.unref(X)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref(X)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(me.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:E},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ee.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:M,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:$,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(de._sfc_main,{key:`title_${V.value}`,config:{title:{cy:"gauge-div-title",...t.value.style.chart.title},subtitle:{cy:"gauge-div-subtitle",...t.value.style.chart.title.subtitle}}},{default:e.withCtx(()=>[t.value.translations.base&&C.dataset.base?(e.openBlock(),e.createElementBlock("span",ke,e.toDisplayString(t.value.translations.base)+": "+e.toDisplayString(C.dataset.base),1)):e.createCommentVNode("",!0)]),_:1},8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&_.value&&(e.unref(I)||e.unref(N))?(e.openBlock(),e.createBlock(H.UserOptions,{ref_key:"details",ref:Q,key:`user_options_${z.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(A),isPrinting:e.unref(R),uid:m.value,hasXls:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:B.value,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:ne,onGeneratePdf:e.unref(L),onGenerateImage:e.unref(D),onToggleAnnotator:E,style:e.normalizeStyle({visibility:e.unref(I)?e.unref(N)?"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.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:r})),void 0,!0)]),key:"2"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:r})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:r})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":B.value,"vue-data-ui-fulscreen--off":!B.value}),viewBox:`0 0 ${l.value.width<=0?10:l.value.width} ${l.value.height<=0?10:l.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:hidden !important;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(he._sfc_main),a.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:l.value.width<=0?10:l.value.width,height:l.value.height<=0?10:l.value.height,style:{pointerEvents:"none"}},[e.renderSlot(a.$slots,"chart-background",{},void 0,!0)],8,be)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`gradient_${m.value}`,cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(s.setOpacity)("#FFFFFF",1)},null,8,Be),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(s.setOpacity)("#FFFFFF",t.value.style.chart.layout.track.gradientIntensity)},null,8,_e),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(s.setOpacity)("#FFFFFF",1)},null,8,xe)],8,Se)]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${m.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.layout.track.gradientIntensity},null,8,Ce)],8,we)]),a.$slots.pattern?(e.openBlock(),e.createElementBlock("g",Ne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(o,r)=>(e.openBlock(),e.createElementBlock("defs",null,[e.renderSlot(a.$slots,"pattern",e.normalizeProps(e.guardReactiveProps({seriesIndex:r,patternId:`pattern_${m.value}_${r}`})),void 0,!0)]))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(o,r)=>(e.openBlock(),e.createElementBlock("path",{key:`arc_${r}`,d:o.arcSlice,fill:o.color,stroke:t.value.style.chart.backgroundColor,"stroke-linecap":"round"},null,8,Fe))),128)),a.$slots.pattern?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(v.value,(o,r)=>(e.openBlock(),e.createElementBlock("path",{key:`arc_${r}`,d:o.arcSlice,fill:`url(#pattern_${m.value}_${r})`,stroke:t.value.style.chart.backgroundColor,"stroke-linecap":"round"},null,8,Ee))),128)):e.createCommentVNode("",!0),t.value.style.chart.layout.segmentNames.show&&t.value.style.chart.layout.segmentNames.curved?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(o,r)=>(e.openBlock(),e.createElementBlock("path",{id:`curve_${m.value}_${r}`,d:`M ${u.value.x1},${u.value.y1} m -${k.value[r]},0 a ${k.value[r]},${k.value[r]} 0 1,1 ${2*k.value[r]},0 a ${k.value[r]},${k.value[r]} 0 1,1 -${2*k.value[r]},0`,fill:"transparent"},null,8,ze))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(o,r)=>(e.openBlock(),e.createElementBlock("text",{fill:t.value.style.chart.layout.segmentNames.useSerieColor?o.color:t.value.style.chart.layout.segmentNames.color,"font-size":l.value.segmentFontSize,"font-weight":t.value.style.chart.layout.segmentNames.bold?"bold":"normal","text-anchor":"middle"},[e.createElementVNode("textPath",{href:`#curve_${m.value}_${r}`,startOffset:le.value[r]},e.toDisplayString(o.name||""),9,Pe)],8,$e))),256))],64)):e.createCommentVNode("",!0),t.value.style.chart.layout.segmentNames.show&&!t.value.style.chart.layout.segmentNames.curved?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:4},e.renderList(ae.value,(o,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.center.endX,y:o.center.endY,"text-anchor":e.unref(s.calcMarkerOffsetX)(o,!1,12).anchor,fill:t.value.style.chart.layout.segmentNames.useSerieColor?o.color:t.value.style.chart.layout.segmentNames.color,"font-size":l.value.segmentFontSize,"font-weight":t.value.style.chart.layout.segmentNames.bold?"bold":"normal"},e.toDisplayString(o.name||""),9,Oe))),256)):e.createCommentVNode("",!0),t.value.style.chart.layout.track.useGradient?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:5},e.renderList(re.value,(o,r)=>(e.openBlock(),e.createElementBlock("path",{key:`arc_${r}`,d:o.arcSlice,fill:"#FFFFFF",stroke:"none","stroke-linecap":"round",filter:`url(#blur_${m.value})`},null,8,Me))),128)):e.createCommentVNode("",!0),t.value.style.chart.layout.segmentSeparators.show?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[e.createElementVNode("line",e.mergeProps(T.value,{stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.segmentSeparators.strokeWidth+2,"stroke-linecap":"round"}),null,16,Ve),e.createElementVNode("line",e.mergeProps(T.value,{stroke:t.value.style.chart.layout.segmentSeparators.stroke,"stroke-width":t.value.style.chart.layout.segmentSeparators.strokeWidth,"stroke-linecap":"round"}),null,16,Xe),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,o=>(e.openBlock(),e.createElementBlock("line",e.mergeProps(o,{stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.segmentSeparators.strokeWidth+2,"stroke-linecap":"round"}),null,16,Ie))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,o=>(e.openBlock(),e.createElementBlock("line",e.mergeProps(o,{stroke:t.value.style.chart.layout.segmentSeparators.stroke,"stroke-width":t.value.style.chart.layout.segmentSeparators.strokeWidth,"stroke-linecap":"round"}),null,16,Ye))),256))],64)):e.createCommentVNode("",!0),t.value.style.chart.layout.markers.show?(e.openBlock(),e.createElementBlock("g",Re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(o,r)=>(e.openBlock(),e.createElementBlock("text",{x:e.unref(s.offsetFromCenterPoint)({centerX:u.value.x1,centerY:i.value.base,initX:o.center.startX,initY:o.center.startY,offset:l.value.markerOffset}).x,y:e.unref(s.offsetFromCenterPoint)({centerX:u.value.x1,centerY:i.value.base,initX:o.center.startX,initY:o.center.startY,offset:l.value.markerOffset}).y,"text-anchor":o.center.startX<u.value.x1-5?"end":o.center.startX>u.value.x1+5?"start":"middle","font-size":l.value.labelFontSize*t.value.style.chart.layout.markers.fontSizeRatio,"font-weight":`${t.value.style.chart.layout.markers.bold?"bold":"normal"}`,fill:t.value.style.chart.layout.markers.color},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.layout.markers.formatter,o.from,e.unref(s.dataLabel)({p:t.value.style.chart.layout.markers.prefix,v:o.from,s:t.value.style.chart.layout.markers.suffix,r:t.value.style.chart.layout.markers.roundingValue}))),9,Ae))),256))])):e.createCommentVNode("",!0),t.value.style.chart.layout.markers.show?(e.openBlock(),e.createElementBlock("text",{key:8,x:e.unref(s.offsetFromCenterPoint)({centerX:l.value.width/2,centerY:i.value.base,initX:v.value.at(-1).endX,initY:v.value.at(-1).endY,offset:l.value.markerOffset}).x,y:e.unref(s.offsetFromCenterPoint)({centerX:l.value.width/2,centerY:i.value.base,initX:v.value.at(-1).endX,initY:v.value.at(-1).endY,offset:l.value.markerOffset}).y,"text-anchor":"start","font-size":l.value.labelFontSize*t.value.style.chart.layout.markers.fontSizeRatio,"font-weight":`${t.value.style.chart.layout.markers.bold?"bold":"normal"}`,fill:t.value.style.chart.layout.markers.color},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.layout.markers.formatter,b.value,e.unref(s.dataLabel)({p:t.value.style.chart.layout.markers.prefix,v:b.value,s:t.value.style.chart.layout.markers.suffix,r:t.value.style.chart.layout.markers.roundingValue}))),9,Le)):e.createCommentVNode("",!0),t.value.style.chart.layout.pointer.type==="rounded"?(e.openBlock(),e.createElementBlock("g",De,[isNaN(u.value.x2)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("line",{key:0,x1:u.value.x1,y1:u.value.y1,x2:u.value.x2,y2:u.value.y2,stroke:t.value.style.chart.layout.pointer.stroke,"stroke-width":l.value.pointerStrokeWidth,"stroke-linecap":"round"},null,8,Ge)),isNaN(u.value.x2)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("line",{key:1,x1:u.value.x1,y1:u.value.y1,x2:u.value.x2,y2:u.value.y2,stroke:t.value.style.chart.layout.pointer.useRatingColor?F.value:t.value.style.chart.layout.pointer.color,"stroke-linecap":"round","stroke-width":l.value.pointerStrokeWidth*.7},null,8,je)),!isNaN(u.value.x2)&&t.value.style.chart.layout.track.useGradient?(e.openBlock(),e.createElementBlock("line",{key:2,x1:u.value.x1,y1:u.value.y1,x2:u.value.x2,y2:u.value.y2,stroke:"white","stroke-linecap":"round","stroke-width":l.value.pointerStrokeWidth*.3,filter:`url(#blur_${m.value})`},null,8,qe)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("g",Te,[G.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:G.value,fill:t.value.style.chart.layout.pointer.useRatingColor?F.value:t.value.style.chart.layout.pointer.color,stroke:t.value.style.chart.layout.pointer.stroke,"stroke-width":t.value.style.chart.layout.pointer.circle.strokeWidth,"stroke-linejoin":"round"},null,8,Ue)):e.createCommentVNode("",!0)])),e.createElementVNode("circle",{cx:l.value.width/2,cy:i.value.base,fill:t.value.style.chart.layout.pointer.circle.color,r:l.value.pointerRadius<=0?1e-4:l.value.pointerRadius,"stroke-width":t.value.style.chart.layout.pointer.circle.strokeWidth,stroke:t.value.style.chart.layout.pointer.circle.stroke},null,8,We),t.value.style.chart.legend.show?(e.openBlock(),e.createElementBlock("text",{key:11,x:l.value.width/2,y:i.value.ratingBase,"text-anchor":"middle","font-size":l.value.legendFontSize,"font-weight":"bold",fill:t.value.style.chart.legend.useRatingColor?F.value:t.value.style.chart.legend.color},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.legend.formatter,d.value,e.unref(s.dataLabel)({p:t.value.style.chart.legend.prefix+(t.value.style.chart.legend.showPlusSymbol&&d.value>0?"+":""),v:d.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}))),9,He)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:l.value},void 0,!0)],14,ge)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ze,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(R)||e.unref(A)})),void 0,!0)])):e.createCommentVNode("",!0),_.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ve.default,{key:6,config:{type:"gauge",style:{backgroundColor:t.value.style.chart.backgroundColor,gauge:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:P},[e.renderSlot(a.$slots,"legend",{legend:p.value},void 0,!0)],512),a.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:O,dir:"auto"},[e.renderSlot(a.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],46,pe))}},Ke=ye._export_sfc(Je,[["__scopeId","data-v-42d2e011"]]);exports.default=Ke;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-KJL8ra_6.cjs"),W=require("./useResponsive-BJ7DTGpm.cjs"),H=require("./usePrinter-pDOF3CfL.cjs"),ve=require("./vue-ui-skeleton-D_YCUi1y.cjs"),de=require("./Title-D-6pIV0l.cjs"),Z=require("./useNestedProp-Bu958azG.cjs"),he=require("./PackageVersion-Dn-t7tbm.cjs"),me=require("./PenAndPaper-DFXJJink.cjs"),fe=require("./useUserOptionState-BgepsfED.cjs"),ye=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),pe=["id"],ke={key:0},ge=["xmlns","viewBox"],be=["width","height"],Se=["id"],Be=["stop-color"],_e=["stop-color"],xe=["stop-color"],we=["id"],Ce=["stdDeviation"],Ne={key:1},Fe=["d","fill","stroke"],Ee=["d","fill","stroke"],ze=["id","d"],$e=["fill","font-size","font-weight"],Pe=["href","startOffset"],Oe=["x","y","text-anchor","fill","font-size","font-weight"],Me=["d","filter"],Ve=["stroke","stroke-width"],Xe=["stroke","stroke-width"],Ie=["stroke","stroke-width"],Ye=["stroke","stroke-width"],Re={key:7},Ae=["x","y","text-anchor","font-size","font-weight","fill"],Le=["x","y","font-size","font-weight","fill"],De={key:9},Ge=["x1","y1","x2","y2","stroke","stroke-width"],je=["x1","y1","x2","y2","stroke","stroke-width"],qe=["x1","y1","x2","y2","stroke-width","filter"],Te={key:10},Ue=["d","fill","stroke","stroke-width"],We=["cx","cy","fill","r","stroke-width","stroke"],He=["x","y","font-size","fill"],Ze={key:5,class:"vue-data-ui-watermark"},Je={__name:"vue-ui-gauge",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(C,{expose:J}){const c=C,{vue_ui_gauge:K}=s.useConfig(),_=e.computed(()=>!!c.dataset&&Object.keys(c.dataset).length>0&&c.dataset.series&&c.dataset.series.length),m=e.ref(s.createUid()),Q=e.ref(null),z=e.ref(0),g=e.ref(null),$=e.ref(null),P=e.ref(null),O=e.ref(null),M=e.ref(null),V=e.ref(0),t=e.computed({get:()=>Y(),set:a=>a}),{userOptionsVisible:N,setUserOptionsVisibility:X,keepUserOptionState:I}=fe.useUserOptionState({config:t.value});e.watch(()=>c.config,a=>{t.value=Y(),N.value=!t.value.showOnChartHover,j(),V.value+=1},{deep:!0});function Y(){const a=Z.useNestedProp({userConfig:c.config,defaultConfig:K});return a.theme?{...Z.useNestedProp({userConfig:s.themes.vue_ui_gauge[a.theme]||c.config,defaultConfig:a}),customPalette:s.themePalettes[a.theme]||s.palette}:a}const{isPrinting:R,isImaging:A,generatePdf:L,generateImage:D}=H.usePrinter({elementId:`vue-ui-gauge_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-gauge"}),ee=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),te=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),p=e.computed(()=>{if(!_.value||s.objectIsEmpty(c.dataset.series||{}))return{value:0,series:[{from:0,to:0}]};const a=[];(c.dataset.series||[]).forEach(o=>{a.push(o.from||1e-7),a.push(o.to||1e-7)});const n=Math.max(...a);return{...c.dataset,series:(c.dataset.series||[]).map((o,r)=>({...o,color:s.convertColorToHex(o.color)||te.value[r]||s.palette[r],value:((o.to||0)-(o.from||0))/n*100}))}}),h=e.ref(512),l=e.ref({height:358.4,width:h.value,top:0,bottom:358.4,centerX:179.2,centerY:h.value/2,labelFontSize:18,legendFontSize:t.value.style.chart.legend.fontSize,pointerRadius:t.value.style.chart.layout.pointer.circle.radius,trackSize:t.value.style.chart.layout.track.size,pointerSize:t.value.style.chart.layout.pointer.size,pointerStrokeWidth:t.value.style.chart.layout.pointer.strokeWidth,markerOffset:t.value.style.chart.layout.markers.offsetY+3,segmentFontSize:t.value.style.chart.layout.segmentNames.fontSize}),b=e.ref(0),S=e.ref(0),d=e.ref(t.value.style.chart.animation.use?Math.min(...c.dataset.series.map(a=>a.from)):c.dataset.value);e.watch(()=>c.dataset.value,()=>{q(c.dataset.value)});const u=e.computed(()=>{const a=l.value.width/2,n=i.value.base,o=Math.PI*((d.value+0-S.value)/(b.value-S.value))+Math.PI;return{x1:a,y1:n,x2:a+i.value.pointerSize*l.value.pointerSize*.9*Math.cos(o),y2:n+i.value.pointerSize*l.value.pointerSize*.9*Math.sin(o)}}),G=e.computed(()=>{const a=l.value.width/2,n=i.value.base,o=Math.PI*((d.value+0-S.value)/(b.value-S.value))+Math.PI,r=a+i.value.pointerSize*l.value.pointerSize*.9*Math.cos(o),f=n+i.value.pointerSize*l.value.pointerSize*.9*Math.sin(o),y=l.value.pointerRadius,se=a+y*Math.cos(o+Math.PI/2),ue=n+y*Math.sin(o+Math.PI/2),ie=a+y*Math.cos(o-Math.PI/2),ce=n+y*Math.sin(o-Math.PI/2);return isNaN(r)?null:`M ${r},${f} ${se},${ue} ${ie},${ce} Z`}),F=e.computed(()=>{for(let a=0;a<p.value.series.length;a+=1){const{color:n,from:o,to:r}=p.value.series[a];if(d.value>=o&&d.value<=r)return n}return"#2D353C"}),x=e.ref(null);function j(){if(s.objectIsEmpty(c.dataset)?s.error({componentName:"VueUiGauge",type:"dataset"}):(s.getMissingDatasetAttributes({datasetObject:c.dataset,requiredAttributes:["value","series"]}).forEach(a=>{s.error({componentName:"VueUiGauge",type:"datasetAttribute",property:a})}),Object.hasOwn(c.dataset,"series")&&(c.dataset.series.length?c.dataset.series.forEach((a,n)=>{s.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["from","to"]}).forEach(o=>{s.error({componentName:"VueUiGauge",type:"datasetSerieAttribute",property:o,index:n})})}):s.error({componentName:"VueUiGauge",type:"datasetAttributeEmpty",property:"series"}))),q(c.dataset.value||0),t.value.responsive){const a=W.throttle(()=>{const{width:n,height:o}=W.useResponsive({chart:g.value,title:t.value.style.chart.title.text?$.value:null,legend:P.value,source:O.value,noTitle:M.value});l.value.width=n,l.value.height=o,l.value.centerX=n/2,l.value.centerY=h.value/2/358.4*o,l.value.bottom=o,l.value.labelFontSize=18/h.value*Math.min(o,n)<10?10:18/h.value*Math.min(o,n),l.value.legendFontSize=t.value.style.chart.legend.fontSize/h.value*Math.min(o,n)<14?14:t.value.style.chart.legend.fontSize/h.value*Math.min(o,n),l.value.pointerRadius=t.value.style.chart.layout.pointer.circle.radius/h.value*Math.min(o,n),l.value.trackSize=t.value.style.chart.layout.track.size/h.value*Math.min(o,n),l.value.pointerStrokeWidth=s.translateSize({relator:Math.min(n,o),adjuster:h.value,source:t.value.style.chart.layout.pointer.strokeWidth,threshold:2,fallback:2}),l.value.markerOffset=s.translateSize({relator:Math.max(n,o),adjuster:h.value,source:t.value.style.chart.layout.markers.offsetY+3,threshold:2,fallback:2}),l.value.segmentFontSize=s.translateSize({relator:Math.min(n,o),adjuster:h.value,source:t.value.style.chart.layout.segmentNames.fontSize,threshold:8,fallback:8})});x.value=new ResizeObserver(a),x.value.observe(g.value.parentNode)}}e.onMounted(()=>{j()}),e.onBeforeUnmount(()=>{x.value&&x.value.disconnect()});function q(a){const n=[];(p.value.series||[]).forEach(y=>{n.push(y.from||0),n.push(y.to||0)}),b.value=Math.max(...n),S.value=Math.min(...n);let o=t.value.style.chart.animation.speed;const r=Math.abs(a-d.value)/(o*60);function f(){d.value<a?d.value=Math.min(d.value+r,a):d.value>a&&(d.value=Math.max(d.value-r,a)),d.value!==a&&requestAnimationFrame(f)}f()}const i=e.computed(()=>{const a=t.value.responsive?Math.min(l.value.width,l.value.height):l.value.width,n=2.5/t.value.style.chart.layout.radiusRatio;return{arcs:a/n,gradients:a/(n*1.1),base:t.value.responsive?l.value.height/2:l.value.height*.7,ratingBase:t.value.responsive?l.value.height/2+l.value.height/4:l.value.height*.9,pointerSize:t.value.responsive?Math.min(l.value.width,l.value.height)/3:l.value.width/3.2}}),v=e.computed(()=>s.makeDonut({series:p.value.series},l.value.width/2,i.value.base,i.value.arcs,i.value.arcs,1,1,1,180,109.9495,40*l.value.trackSize)),ae=e.computed(()=>s.makeDonut({series:p.value.series},l.value.width/2,i.value.base,i.value.arcs*t.value.style.chart.layout.segmentNames.offsetRatio,i.value.arcs*t.value.style.chart.layout.segmentNames.offsetRatio,1,1,1,180,109.9495,40*l.value.trackSize)),k=e.computed(()=>v.value.map(a=>i.value.arcs*t.value.style.chart.layout.segmentNames.offsetRatio*(a.nameOffsetRatio||1))),T=e.computed(()=>{const{x:a,y:n}=s.offsetFromCenterPoint({initX:v.value[0].firstSeparator.x,initY:v.value[0].firstSeparator.y,centerX:u.value.x1,centerY:u.value.y1,offset:-t.value.style.chart.layout.segmentSeparators.offsetIn}),{x:o,y:r}=s.offsetFromCenterPoint({initX:v.value[0].startX,initY:v.value[0].startY,centerX:u.value.x1,centerY:u.value.y1,offset:t.value.style.chart.layout.segmentSeparators.offsetOut});return{x1:a,y1:n,x2:o,y2:r}}),U=e.computed(()=>v.value.map(a=>{const{x:n,y:o}=s.offsetFromCenterPoint({initX:a.separator.x,initY:a.separator.y,centerX:u.value.x1,centerY:u.value.y1,offset:-t.value.style.chart.layout.segmentSeparators.offsetIn}),{x:r,y:f}=s.offsetFromCenterPoint({initX:a.endX,initY:a.endY,centerX:u.value.x1,centerY:u.value.y1,offset:t.value.style.chart.layout.segmentSeparators.offsetOut});return{x1:n,y1:o,x2:r,y2:f}}));function oe(a){if(a.reduce((f,y)=>f+y,0)>100)throw new Error("Total % must not exceed 100");const o=50;let r=0;return a.map(f=>(r+=f,`${r/100*o-f/4}%`))}const le=e.computed(()=>oe(v.value.map(a=>a.proportion*100))),re=e.computed(()=>s.makeDonut({series:p.value.series},l.value.width/2,i.value.base,i.value.gradients,i.value.gradients,.95,1,1,180,110.02,2*l.value.trackSize)),B=e.ref(!1);function ne(a){B.value=a,z.value+=1}const w=e.ref(!1);function E(){w.value=!w.value}return J({generatePdf:L,generateImage:D,toggleAnnotator:E}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-gauge ${B.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"gaugeChart",ref:g,id:`vue-ui-gauge_${m.value}`,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%":""}`),onMouseenter:n[0]||(n[0]=()=>e.unref(X)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref(X)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(me.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:E},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ee.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:M,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:$,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(de._sfc_main,{key:`title_${V.value}`,config:{title:{cy:"gauge-div-title",...t.value.style.chart.title},subtitle:{cy:"gauge-div-subtitle",...t.value.style.chart.title.subtitle}}},{default:e.withCtx(()=>[t.value.translations.base&&C.dataset.base?(e.openBlock(),e.createElementBlock("span",ke,e.toDisplayString(t.value.translations.base)+": "+e.toDisplayString(C.dataset.base),1)):e.createCommentVNode("",!0)]),_:1},8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&_.value&&(e.unref(I)||e.unref(N))?(e.openBlock(),e.createBlock(H.UserOptions,{ref_key:"details",ref:Q,key:`user_options_${z.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(A),isPrinting:e.unref(R),uid:m.value,hasXls:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:B.value,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:ne,onGeneratePdf:e.unref(L),onGenerateImage:e.unref(D),onToggleAnnotator:E,style:e.normalizeStyle({visibility:e.unref(I)?e.unref(N)?"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.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:r})),void 0,!0)]),key:"2"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:r})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:r})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":B.value,"vue-data-ui-fulscreen--off":!B.value}),viewBox:`0 0 ${l.value.width<=0?10:l.value.width} ${l.value.height<=0?10:l.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:hidden !important;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(he._sfc_main),a.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:l.value.width<=0?10:l.value.width,height:l.value.height<=0?10:l.value.height,style:{pointerEvents:"none"}},[e.renderSlot(a.$slots,"chart-background",{},void 0,!0)],8,be)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`gradient_${m.value}`,cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(s.setOpacity)("#FFFFFF",1)},null,8,Be),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(s.setOpacity)("#FFFFFF",t.value.style.chart.layout.track.gradientIntensity)},null,8,_e),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(s.setOpacity)("#FFFFFF",1)},null,8,xe)],8,Se)]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${m.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.layout.track.gradientIntensity},null,8,Ce)],8,we)]),a.$slots.pattern?(e.openBlock(),e.createElementBlock("g",Ne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(o,r)=>(e.openBlock(),e.createElementBlock("defs",null,[e.renderSlot(a.$slots,"pattern",e.normalizeProps(e.guardReactiveProps({seriesIndex:r,patternId:`pattern_${m.value}_${r}`})),void 0,!0)]))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(o,r)=>(e.openBlock(),e.createElementBlock("path",{key:`arc_${r}`,d:o.arcSlice,fill:o.color,stroke:t.value.style.chart.backgroundColor,"stroke-linecap":"round"},null,8,Fe))),128)),a.$slots.pattern?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(v.value,(o,r)=>(e.openBlock(),e.createElementBlock("path",{key:`arc_${r}`,d:o.arcSlice,fill:`url(#pattern_${m.value}_${r})`,stroke:t.value.style.chart.backgroundColor,"stroke-linecap":"round"},null,8,Ee))),128)):e.createCommentVNode("",!0),t.value.style.chart.layout.segmentNames.show&&t.value.style.chart.layout.segmentNames.curved?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(o,r)=>(e.openBlock(),e.createElementBlock("path",{id:`curve_${m.value}_${r}`,d:`M ${u.value.x1},${u.value.y1} m -${k.value[r]},0 a ${k.value[r]},${k.value[r]} 0 1,1 ${2*k.value[r]},0 a ${k.value[r]},${k.value[r]} 0 1,1 -${2*k.value[r]},0`,fill:"transparent"},null,8,ze))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(o,r)=>(e.openBlock(),e.createElementBlock("text",{fill:t.value.style.chart.layout.segmentNames.useSerieColor?o.color:t.value.style.chart.layout.segmentNames.color,"font-size":l.value.segmentFontSize,"font-weight":t.value.style.chart.layout.segmentNames.bold?"bold":"normal","text-anchor":"middle"},[e.createElementVNode("textPath",{href:`#curve_${m.value}_${r}`,startOffset:le.value[r]},e.toDisplayString(o.name||""),9,Pe)],8,$e))),256))],64)):e.createCommentVNode("",!0),t.value.style.chart.layout.segmentNames.show&&!t.value.style.chart.layout.segmentNames.curved?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:4},e.renderList(ae.value,(o,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.center.endX,y:o.center.endY,"text-anchor":e.unref(s.calcMarkerOffsetX)(o,!1,12).anchor,fill:t.value.style.chart.layout.segmentNames.useSerieColor?o.color:t.value.style.chart.layout.segmentNames.color,"font-size":l.value.segmentFontSize,"font-weight":t.value.style.chart.layout.segmentNames.bold?"bold":"normal"},e.toDisplayString(o.name||""),9,Oe))),256)):e.createCommentVNode("",!0),t.value.style.chart.layout.track.useGradient?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:5},e.renderList(re.value,(o,r)=>(e.openBlock(),e.createElementBlock("path",{key:`arc_${r}`,d:o.arcSlice,fill:"#FFFFFF",stroke:"none","stroke-linecap":"round",filter:`url(#blur_${m.value})`},null,8,Me))),128)):e.createCommentVNode("",!0),t.value.style.chart.layout.segmentSeparators.show?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[e.createElementVNode("line",e.mergeProps(T.value,{stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.segmentSeparators.strokeWidth+2,"stroke-linecap":"round"}),null,16,Ve),e.createElementVNode("line",e.mergeProps(T.value,{stroke:t.value.style.chart.layout.segmentSeparators.stroke,"stroke-width":t.value.style.chart.layout.segmentSeparators.strokeWidth,"stroke-linecap":"round"}),null,16,Xe),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,o=>(e.openBlock(),e.createElementBlock("line",e.mergeProps(o,{stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.segmentSeparators.strokeWidth+2,"stroke-linecap":"round"}),null,16,Ie))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,o=>(e.openBlock(),e.createElementBlock("line",e.mergeProps(o,{stroke:t.value.style.chart.layout.segmentSeparators.stroke,"stroke-width":t.value.style.chart.layout.segmentSeparators.strokeWidth,"stroke-linecap":"round"}),null,16,Ye))),256))],64)):e.createCommentVNode("",!0),t.value.style.chart.layout.markers.show?(e.openBlock(),e.createElementBlock("g",Re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(o,r)=>(e.openBlock(),e.createElementBlock("text",{x:e.unref(s.offsetFromCenterPoint)({centerX:u.value.x1,centerY:i.value.base,initX:o.center.startX,initY:o.center.startY,offset:l.value.markerOffset}).x,y:e.unref(s.offsetFromCenterPoint)({centerX:u.value.x1,centerY:i.value.base,initX:o.center.startX,initY:o.center.startY,offset:l.value.markerOffset}).y,"text-anchor":o.center.startX<u.value.x1-5?"end":o.center.startX>u.value.x1+5?"start":"middle","font-size":l.value.labelFontSize*t.value.style.chart.layout.markers.fontSizeRatio,"font-weight":`${t.value.style.chart.layout.markers.bold?"bold":"normal"}`,fill:t.value.style.chart.layout.markers.color},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.layout.markers.formatter,o.from,e.unref(s.dataLabel)({p:t.value.style.chart.layout.markers.prefix,v:o.from,s:t.value.style.chart.layout.markers.suffix,r:t.value.style.chart.layout.markers.roundingValue}))),9,Ae))),256))])):e.createCommentVNode("",!0),t.value.style.chart.layout.markers.show?(e.openBlock(),e.createElementBlock("text",{key:8,x:e.unref(s.offsetFromCenterPoint)({centerX:l.value.width/2,centerY:i.value.base,initX:v.value.at(-1).endX,initY:v.value.at(-1).endY,offset:l.value.markerOffset}).x,y:e.unref(s.offsetFromCenterPoint)({centerX:l.value.width/2,centerY:i.value.base,initX:v.value.at(-1).endX,initY:v.value.at(-1).endY,offset:l.value.markerOffset}).y,"text-anchor":"start","font-size":l.value.labelFontSize*t.value.style.chart.layout.markers.fontSizeRatio,"font-weight":`${t.value.style.chart.layout.markers.bold?"bold":"normal"}`,fill:t.value.style.chart.layout.markers.color},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.layout.markers.formatter,b.value,e.unref(s.dataLabel)({p:t.value.style.chart.layout.markers.prefix,v:b.value,s:t.value.style.chart.layout.markers.suffix,r:t.value.style.chart.layout.markers.roundingValue}))),9,Le)):e.createCommentVNode("",!0),t.value.style.chart.layout.pointer.type==="rounded"?(e.openBlock(),e.createElementBlock("g",De,[isNaN(u.value.x2)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("line",{key:0,x1:u.value.x1,y1:u.value.y1,x2:u.value.x2,y2:u.value.y2,stroke:t.value.style.chart.layout.pointer.stroke,"stroke-width":l.value.pointerStrokeWidth,"stroke-linecap":"round"},null,8,Ge)),isNaN(u.value.x2)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("line",{key:1,x1:u.value.x1,y1:u.value.y1,x2:u.value.x2,y2:u.value.y2,stroke:t.value.style.chart.layout.pointer.useRatingColor?F.value:t.value.style.chart.layout.pointer.color,"stroke-linecap":"round","stroke-width":l.value.pointerStrokeWidth*.7},null,8,je)),!isNaN(u.value.x2)&&t.value.style.chart.layout.track.useGradient?(e.openBlock(),e.createElementBlock("line",{key:2,x1:u.value.x1,y1:u.value.y1,x2:u.value.x2,y2:u.value.y2,stroke:"white","stroke-linecap":"round","stroke-width":l.value.pointerStrokeWidth*.3,filter:`url(#blur_${m.value})`},null,8,qe)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("g",Te,[G.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:G.value,fill:t.value.style.chart.layout.pointer.useRatingColor?F.value:t.value.style.chart.layout.pointer.color,stroke:t.value.style.chart.layout.pointer.stroke,"stroke-width":t.value.style.chart.layout.pointer.circle.strokeWidth,"stroke-linejoin":"round"},null,8,Ue)):e.createCommentVNode("",!0)])),e.createElementVNode("circle",{cx:l.value.width/2,cy:i.value.base,fill:t.value.style.chart.layout.pointer.circle.color,r:l.value.pointerRadius<=0?1e-4:l.value.pointerRadius,"stroke-width":t.value.style.chart.layout.pointer.circle.strokeWidth,stroke:t.value.style.chart.layout.pointer.circle.stroke},null,8,We),t.value.style.chart.legend.show?(e.openBlock(),e.createElementBlock("text",{key:11,x:l.value.width/2,y:i.value.ratingBase,"text-anchor":"middle","font-size":l.value.legendFontSize,"font-weight":"bold",fill:t.value.style.chart.legend.useRatingColor?F.value:t.value.style.chart.legend.color},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.legend.formatter,d.value,e.unref(s.dataLabel)({p:t.value.style.chart.legend.prefix+(t.value.style.chart.legend.showPlusSymbol&&d.value>0?"+":""),v:d.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}))),9,He)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:l.value},void 0,!0)],14,ge)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ze,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(R)||e.unref(A)})),void 0,!0)])):e.createCommentVNode("",!0),_.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ve.default,{key:6,config:{type:"gauge",style:{backgroundColor:t.value.style.chart.backgroundColor,gauge:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:P},[e.renderSlot(a.$slots,"legend",{legend:p.value},void 0,!0)],512),a.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:O,dir:"auto"},[e.renderSlot(a.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],46,pe))}},Ke=ye._export_sfc(Je,[["__scopeId","data-v-42d2e011"]]);exports.default=Ke;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ref as b, useSlots as z, onMounted as g, computed as c, watch as G, openBlock as s, createElementBlock as a, normalizeStyle as L, createVNode as N, createElementVNode as t, createCommentVNode as r, Fragment as p, toDisplayString as y, unref as d } from "vue";
|
|
2
|
-
import { u as $, c as F, e as B, i as k, f as m } from "./index-
|
|
3
|
-
import { u as V } from "./useNestedProp-
|
|
4
|
-
import { _ as P } from "./PackageVersion-
|
|
2
|
+
import { u as $, c as F, e as B, i as k, f as m } from "./index-B8Eaq54E.js";
|
|
3
|
+
import { u as V } from "./useNestedProp-Ka0R_Yqa.js";
|
|
4
|
+
import { _ as P } from "./PackageVersion-CgJdp_Ki.js";
|
|
5
5
|
const U = ["viewBox", "width"], D = { key: 0 }, I = ["id"], M = ["stop-color"], S = ["stop-color"], E = ["stroke"], O = ["stroke"], A = ["width", "fill"], j = ["fill"], T = { key: 0 }, q = ["id"], H = /* @__PURE__ */ t("feGaussianBlur", {
|
|
6
6
|
in: "SourceGraphic",
|
|
7
7
|
stdDeviation: 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-KJL8ra_6.cjs"),k=require("./useNestedProp-Bu958azG.cjs"),_=require("./PackageVersion-Dn-t7tbm.cjs"),p=["viewBox","width"],g={key:0},v=["id"],y=["stop-color"],N=["stop-color"],C=["stroke"],V=["stroke"],w=["width","fill"],x=["fill"],B={key:0},E=["id"],b=e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:1},null,-1),L=[b],z=["stroke"],G=["stroke","stroke-dasharray","stroke-dashoffset"],F=["filter"],P=["stroke","stroke-dasharray","stroke-dashoffset"],$=["fill"],S={__name:"vue-ui-gizmo",props:{config:{type:Object,default(){return{}}},dataset:{type:Number,default:0}},setup(c){const o=c,{vue_ui_gizmo:f}=r.useConfig(),n=e.ref(r.createUid()),h=e.useSlots();e.onMounted(()=>{i()}),e.onMounted(()=>{h["chart-background"]&&console.warn("VueUiGizmo does not support the #chart-background slot.")});function i(){!o.dataset&&o.dataset!==0&&r.error({componentName:"VueUiGizmo",type:"dataset"}),o.dataset<0&&console.warn("VueUiGizmo: dataset cannot be negative.")}const t=e.computed({get:()=>d(),set:a=>a});function d(){return k.useNestedProp({userConfig:o.config,defaultConfig:f})}e.watch(()=>o.config,a=>{t.value=d(),i()},{deep:!0});const u=e.computed(()=>({battery:{width:t.value.showPercentage?140:80,height:50},gauge:{width:80,height:80}})[t.value.type]),l=e.computed(()=>{const s=2*Math.PI*35,m=s-o.dataset/100*s;return{dasharray:`${s} ${s}`,dashoffset:m}});return(a,s)=>(e.openBlock(),e.createElementBlock("svg",{class:"vue-ui-gizmo",viewBox:`0 0 ${u.value.width} ${u.value.height}`,width:t.value.size,style:e.normalizeStyle({background:"transparent",fontFamily:t.value.fontFamily})},[e.createVNode(_._sfc_main),t.value.useGradient?(e.openBlock(),e.createElementBlock("defs",g,[e.createElementVNode("linearGradient",{id:`gizmo_gradient_${n.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.gradientColor},null,8,y),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.color},null,8,N)],8,v)])):e.createCommentVNode("",!0),t.value.type==="battery"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("path",{d:"M 5 10 L 5 40 C 5 43 7 45 9 45 L 65 45 C 68 45 70 43 70 40 L 70 38 C 73 38 75 38 75 33 L 75 17 C 75 12 73 12 70 12 L 70 10 C 70 7 68 5 65 5 L 10 5 C 7 5 5 7 5 10",stroke:t.value.stroke,"stroke-width":2,fill:"none"},null,8,C),e.createElementVNode("path",{d:"M 70 16 L 70 34",stroke:t.value.stroke,"stroke-width":2,fill:"none",style:{opacity:"0.5"}},null,8,V),e.createElementVNode("rect",{x:10,y:10,height:30,width:55*(c.dataset/100),fill:t.value.useGradient?`url(#gizmo_gradient_${n.value})`:t.value.color,rx:2},null,8,w),t.value.showPercentage?(e.openBlock(),e.createElementBlock("text",{key:0,x:85,y:32,"text-anchor":"start","font-size":"20",fill:t.value.textColor},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.formatter,o.dataset,e.unref(r.dataLabel)({v:o.dataset,s:"%"}))),9,x)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.type==="gauge"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[t.value.useGradient?(e.openBlock(),e.createElementBlock("defs",B,[e.createElementVNode("filter",{id:`blur_${n.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},L,8,E)])):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:40,cy:40,r:35,stroke:t.value.stroke,"stroke-width":2*4,fill:"none"},null,8,z),e.createElementVNode("circle",{cx:40,cy:40,r:35,stroke:t.value.color,"stroke-width":2*4,"stroke-dasharray":l.value.dasharray,"stroke-dashoffset":l.value.dashoffset,"stroke-linecap":"round",fill:"none",style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,8,G),t.value.useGradient?(e.openBlock(),e.createElementBlock("g",{key:1,filter:`url(#blur_${n.value})`},[e.createElementVNode("circle",{cx:40,cy:40,r:35,stroke:t.value.gradientColor,"stroke-width":1,fill:"none","stroke-dasharray":l.value.dasharray,"stroke-dashoffset":l.value.dashoffset,style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,8,P)],8,F)):e.createCommentVNode("",!0),t.value.showPercentage?(e.openBlock(),e.createElementBlock("text",{key:2,x:40,y:47,"text-anchor":"middle","font-size":"20",fill:t.value.textColor},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.formatter,o.dataset,e.unref(r.dataLabel)({v:o.dataset,s:"%"}))),9,$)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],12,p))}};exports.default=S;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useCssVars as Ie, computed as h, ref as p, watch as $e, onMounted as Be, openBlock as o, createElementBlock as n, normalizeClass as K, normalizeStyle as w, unref as u, createBlock as G, createCommentVNode as c, createSlots as Re, withCtx as k, renderSlot as f, normalizeProps as U, guardReactiveProps as H, createVNode as se, Fragment as A, renderList as O, createElementVNode as i, toDisplayString as b, withKeys as Ee, createTextVNode as Ge, nextTick as Ue } from "vue";
|
|
2
|
-
import { u as He, o as Xe, e as Ce, c as ue, t as De, C as je, g as We, N as ne, X as Ye, G as ie, i as V, f as S, v as T, x as qe, y as Ke, q as Je, r as Qe } from "./index-
|
|
3
|
-
import { _ as Ze } from "./Title-
|
|
4
|
-
import { u as et, U as tt } from "./usePrinter-
|
|
5
|
-
import { _ as lt } from "./Tooltip-
|
|
6
|
-
import at from "./vue-ui-skeleton-
|
|
7
|
-
import ot from "./BaseIcon-
|
|
8
|
-
import st from "./vue-ui-accordion
|
|
9
|
-
import { u as Le } from "./useNestedProp-
|
|
10
|
-
import { _ as ut } from "./PackageVersion-
|
|
11
|
-
import { P as nt } from "./PenAndPaper-
|
|
2
|
+
import { u as He, o as Xe, e as Ce, c as ue, t as De, C as je, g as We, N as ne, X as Ye, G as ie, i as V, f as S, v as T, x as qe, y as Ke, q as Je, r as Qe } from "./index-B8Eaq54E.js";
|
|
3
|
+
import { _ as Ze } from "./Title-XYNHfYwN.js";
|
|
4
|
+
import { u as et, U as tt } from "./usePrinter-D83W2gfG.js";
|
|
5
|
+
import { _ as lt } from "./Tooltip-DYRo59nq.js";
|
|
6
|
+
import at from "./vue-ui-skeleton-DpadzgbS.js";
|
|
7
|
+
import ot from "./BaseIcon-Dzpk4O8L.js";
|
|
8
|
+
import st from "./vue-ui-accordion--5td7b94.js";
|
|
9
|
+
import { u as Le } from "./useNestedProp-Ka0R_Yqa.js";
|
|
10
|
+
import { _ as ut } from "./PackageVersion-CgJdp_Ki.js";
|
|
11
|
+
import { P as nt } from "./PenAndPaper-BTLEk55u.js";
|
|
12
12
|
import { u as it } from "./useUserOptionState-BIvW1Kz7.js";
|
|
13
13
|
import { _ as rt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
14
|
const vt = ["id"], dt = {
|