vue-data-ui 2.3.25 → 2.3.27
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/README.md +13 -7
- package/dist/{Arrow-01eXaB81.cjs → Arrow-HROOtfWV.cjs} +1 -1
- package/dist/{Arrow-zObQ2VxA.js → Arrow-O38M_J_k.js} +1 -1
- package/dist/{BaseIcon-BkdELEYE.cjs → BaseIcon-CiO8gP9x.cjs} +1 -1
- package/dist/{BaseIcon-CHBghp3_.js → BaseIcon-D8FXGup9.js} +4 -3
- package/dist/{DataTable-D_2ZW2eI.cjs → DataTable-C6HTLT7L.cjs} +1 -1
- package/dist/{DataTable-Dytj5HQM.js → DataTable-EqeVt-K-.js} +2 -2
- package/dist/{Legend-Ct8LnAy4.js → Legend-8eVERYMn.js} +1 -1
- package/dist/{Legend-tvvMRnbi.cjs → Legend-C_lBCmBu.cjs} +1 -1
- package/dist/{Shape-dvRttq7z.cjs → Shape-D8RdmYWq.cjs} +1 -1
- package/dist/{Shape-qo5jcJq9.js → Shape-DvcgW6uK.js} +1 -1
- package/dist/{Slicer-DcjEg-ZZ.cjs → Slicer-BvYL7yVK.cjs} +1 -1
- package/dist/{Slicer-BNgHaM2_.js → Slicer-CH_5wnFM.js} +1 -1
- package/dist/{Title-CSQdI1EY.cjs → Title-B9iq63n1.cjs} +1 -1
- package/dist/{Title-BcNPXpKX.js → Title-C3Ez1ceq.js} +1 -1
- package/dist/{Tooltip-etzDGo1Y.js → Tooltip-7SRMoiu-.js} +1 -1
- package/dist/{Tooltip-B-laoopT.cjs → Tooltip-DcDEanxk.cjs} +1 -1
- package/dist/documentation/installation.md +3 -2
- package/dist/index-BQOxn6SH.cjs +4 -0
- package/dist/{index-BE6fhUyH.js → index-DiWO-_ca.js} +874 -537
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +169 -33
- package/dist/types/vue-data-ui.d.ts +169 -33
- package/dist/{useNestedProp-B_z4-n52.cjs → useNestedProp-BtqgWTf9.cjs} +1 -1
- package/dist/{useNestedProp-BcjRW6BJ.js → useNestedProp-DNX5EefQ.js} +1 -1
- package/dist/{usePrinter-CdIphKpF.js → usePrinter-BD40aUzH.js} +1 -1
- package/dist/{usePrinter-hyuaFHQj.cjs → usePrinter-Q1J--baX.cjs} +1 -1
- package/dist/{vue-data-ui-DH3---6Y.js → vue-data-ui-GHpxkf8a.js} +64 -62
- package/dist/vue-data-ui-yd5q4Ura.cjs +9 -0
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +37 -36
- package/dist/{vue-ui-3d-bar-CPpeRsrz.js → vue-ui-3d-bar-CAmoj5dT.js} +7 -7
- package/dist/{vue-ui-3d-bar-ddx9_3_T.cjs → vue-ui-3d-bar-DkJ4c3HQ.cjs} +1 -1
- package/dist/{vue-ui-accordion-Dmz7RUKz.js → vue-ui-accordion-CiNdgRO9.js} +3 -3
- package/dist/{vue-ui-accordion-CvZhABQM.cjs → vue-ui-accordion-ogVvFfQy.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-DiOdrFIV.js → vue-ui-age-pyramid-BrTpbEha.js} +8 -8
- package/dist/{vue-ui-age-pyramid-BieAbkr7.cjs → vue-ui-age-pyramid-CkKVbbl8.cjs} +1 -1
- package/dist/{vue-ui-annotator-KClMRKPi.js → vue-ui-annotator-B9IqZ-Hy.js} +1 -1
- package/dist/{vue-ui-annotator-CugE3IpZ.cjs → vue-ui-annotator-QbetAXoj.cjs} +1 -1
- package/dist/{vue-ui-candlestick-DErkX5mF.cjs → vue-ui-candlestick-BvRwlc3d.cjs} +1 -1
- package/dist/{vue-ui-candlestick-D9MajMEG.js → vue-ui-candlestick-XjjwFaDO.js} +9 -9
- package/dist/{vue-ui-carousel-table-CsCEcaWp.cjs → vue-ui-carousel-table-DtxcnSEp.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-CLwi79Ly.js → vue-ui-carousel-table-KYENY5gp.js} +4 -4
- package/dist/{vue-ui-chestnut-BTvQSTQi.cjs → vue-ui-chestnut-C7gFvKLJ.cjs} +1 -1
- package/dist/{vue-ui-chestnut-BnmDdakJ.js → vue-ui-chestnut-DfIcguJd.js} +6 -6
- package/dist/{vue-ui-cursor-KjKhIKTP.js → vue-ui-cursor-C4pJe90O.js} +2 -2
- package/dist/{vue-ui-cursor-Dj8pAXbc.cjs → vue-ui-cursor-COS_MXr8.cjs} +1 -1
- package/dist/{vue-ui-dashboard-Dm-rDSRt.js → vue-ui-dashboard-B_NUnxEF.js} +2 -2
- package/dist/{vue-ui-dashboard-BTpiCLaT.cjs → vue-ui-dashboard-DNOjWStr.cjs} +1 -1
- package/dist/{vue-ui-digits-BVVOQfoO.cjs → vue-ui-digits-Vx5prxaT.cjs} +1 -1
- package/dist/{vue-ui-digits-WgEKLYdq.js → vue-ui-digits-uufqLbRt.js} +2 -2
- package/dist/{vue-ui-donut-BjHWw_Mw.js → vue-ui-donut-C33U3e8H.js} +9 -9
- package/dist/{vue-ui-donut-DvDqj2od.cjs → vue-ui-donut-CeHnjIGu.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-CWBsLGUw.js → vue-ui-donut-evolution-IzfAVo5I.js} +9 -9
- package/dist/{vue-ui-donut-evolution-C0TW-uGR.cjs → vue-ui-donut-evolution-hHfvz1Yd.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-BlsLMdW8.js → vue-ui-dumbbell-KvrVLLw6.js} +8 -8
- package/dist/{vue-ui-dumbbell-Uhw6rKrw.cjs → vue-ui-dumbbell-z_Ck4W33.cjs} +1 -1
- package/dist/{vue-ui-flow-KijZNPzD.js → vue-ui-flow-BjMikE9b.js} +7 -7
- package/dist/{vue-ui-flow-fnDs0_mH.cjs → vue-ui-flow-Dg4dkrcd.cjs} +1 -1
- package/dist/{vue-ui-galaxy-BBiGsB2G.cjs → vue-ui-galaxy-B8EoId23.cjs} +1 -1
- package/dist/{vue-ui-galaxy-_y9H-beS.js → vue-ui-galaxy-BdgveN18.js} +9 -9
- package/dist/{vue-ui-gauge-CGgQqTqT.js → vue-ui-gauge-D01FLnNz.js} +5 -5
- package/dist/{vue-ui-gauge-Bv4YKgIj.cjs → vue-ui-gauge-D8pokfoA.cjs} +1 -1
- package/dist/{vue-ui-gizmo-DFWR7qEg.cjs → vue-ui-gizmo-8lKc8m8b.cjs} +1 -1
- package/dist/{vue-ui-gizmo-DjAFk58g.js → vue-ui-gizmo-Cp-EftjP.js} +2 -2
- package/dist/{vue-ui-heatmap-D1AMro3o.js → vue-ui-heatmap-BEsvmj5R.js} +8 -8
- package/dist/{vue-ui-heatmap-B5McL3SD.cjs → vue-ui-heatmap-DvpvKq3Q.cjs} +1 -1
- package/dist/{vue-ui-kpi-BW2na3Yu.js → vue-ui-kpi-D6rVKouk.js} +2 -2
- package/dist/{vue-ui-kpi-Bb7xdAFU.cjs → vue-ui-kpi-PWurAGxE.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-22dagCEY.cjs → vue-ui-mini-loader-BsypWozL.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-CKZ-PEf5.js → vue-ui-mini-loader-YV68i0nk.js} +2 -2
- package/dist/{vue-ui-molecule-BK8HPWvg.js → vue-ui-molecule-BWYCf3Km.js} +9 -9
- package/dist/{vue-ui-molecule-CWpBfXyk.cjs → vue-ui-molecule-Bx3fXHnw.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-BZE6rvtb.cjs → vue-ui-mood-radar-C6devC4e.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-CXq465Aj.js → vue-ui-mood-radar-DsZozq6x.js} +9 -9
- package/dist/{vue-ui-nested-donuts-Ca-b8_P3.cjs → vue-ui-nested-donuts-BtT3VsSf.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-BSYKxbNL.js → vue-ui-nested-donuts-qaViBhR3.js} +9 -9
- package/dist/{vue-ui-onion-CMv38G-g.js → vue-ui-onion-0iFsjuLM.js} +9 -9
- package/dist/{vue-ui-onion-DvRn35KQ.cjs → vue-ui-onion-9ATTDUpw.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-C50SGcJo.cjs → vue-ui-parallel-coordinate-plot-BkZOKTIS.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-DBZUno5l.js → vue-ui-parallel-coordinate-plot-DxDFs1Lb.js} +10 -10
- package/dist/{vue-ui-quadrant-CJo9jqLm.cjs → vue-ui-quadrant-DD4H_Dhk.cjs} +1 -1
- package/dist/{vue-ui-quadrant-C-jh3Grv.js → vue-ui-quadrant-Tw7SKMbQ.js} +10 -10
- package/dist/{vue-ui-quick-chart-BvTLEmD_.js → vue-ui-quick-chart-CpFHKtpm.js} +6 -6
- package/dist/{vue-ui-quick-chart-BJ6lIxf6.cjs → vue-ui-quick-chart-D1udOl47.cjs} +1 -1
- package/dist/{vue-ui-radar-CWgrIgHA.cjs → vue-ui-radar-CZmJDj3q.cjs} +1 -1
- package/dist/{vue-ui-radar-Kh4Qt05I.js → vue-ui-radar-D5FV2IDm.js} +10 -10
- package/dist/{vue-ui-rating-DJsfvOxZ.cjs → vue-ui-rating-DTWIh_CV.cjs} +1 -1
- package/dist/{vue-ui-rating-D7AkYGtK.js → vue-ui-rating-Dds9tjxd.js} +2 -2
- package/dist/{vue-ui-relation-circle-CXQ9FHnG.js → vue-ui-relation-circle-B2p8F7-L.js} +5 -5
- package/dist/{vue-ui-relation-circle-DRquG6N9.cjs → vue-ui-relation-circle-Cu9lKkX3.cjs} +1 -1
- package/dist/{vue-ui-rings-BuuiGgkQ.js → vue-ui-rings-BKzCFSx-.js} +9 -9
- package/dist/{vue-ui-rings-DAuDNTak.cjs → vue-ui-rings-DN7XmhKZ.cjs} +1 -1
- package/dist/{vue-ui-scatter-Ba_1vbfG.js → vue-ui-scatter-CwV9l1P7.js} +10 -10
- package/dist/{vue-ui-scatter-Db1WHHMt.cjs → vue-ui-scatter-DJlC5mz4.cjs} +1 -1
- package/dist/{vue-ui-screenshot-rDwd1nNP.js → vue-ui-screenshot-Bo6i-aRF.js} +1 -1
- package/dist/{vue-ui-screenshot-BgvHfkel.cjs → vue-ui-screenshot-CnPWz57l.cjs} +1 -1
- package/dist/{vue-ui-skeleton-Df1qBO2k.cjs → vue-ui-skeleton-CcrGR_Vh.cjs} +1 -1
- package/dist/{vue-ui-skeleton-DZk__alb.js → vue-ui-skeleton-CeNL0kH-.js} +2 -2
- package/dist/{vue-ui-smiley-KQFOL39h.cjs → vue-ui-smiley-BBcmwq4z.cjs} +1 -1
- package/dist/{vue-ui-smiley-BPebp5hG.js → vue-ui-smiley-BGMzw-SW.js} +2 -2
- package/dist/{vue-ui-spark-trend-CSdQHPuY.js → vue-ui-spark-trend-CSC9zmt7.js} +4 -4
- package/dist/{vue-ui-spark-trend-Cr2Coq5M.cjs → vue-ui-spark-trend-DlvTlA9z.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-EhBZgeio.js → vue-ui-sparkbar-0CNZluKs.js} +3 -3
- package/dist/{vue-ui-sparkbar-BIdS6UA_.cjs → vue-ui-sparkbar-Di-BPkJ0.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-DFlQ-olI.cjs → vue-ui-sparkgauge-B5g5nxUh.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-DTUDMW-e.js → vue-ui-sparkgauge-DJPt0cLe.js} +3 -3
- package/dist/{vue-ui-sparkhistogram-_zChXZnF.cjs → vue-ui-sparkhistogram-BhkYmR4U.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-CJZN2ZKW.js → vue-ui-sparkhistogram-DpvQcFls.js} +4 -4
- package/dist/{vue-ui-sparkline-IWbHN7-r.cjs → vue-ui-sparkline-Bw3y-88R.cjs} +1 -1
- package/dist/{vue-ui-sparkline-B0OAXqfq.js → vue-ui-sparkline-CDSg9rhl.js} +3 -3
- package/dist/{vue-ui-sparkstackbar-C6tBsD3M.cjs → vue-ui-sparkstackbar-Ckcir2dk.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-wPYlidft.js → vue-ui-sparkstackbar-DveNwcVx.js} +3 -3
- package/dist/vue-ui-stackbar-CZUsUeZ_.js +750 -0
- package/dist/vue-ui-stackbar-jNWFgXiA.cjs +15 -0
- package/dist/{vue-ui-strip-plot-BAcR2Zug.cjs → vue-ui-strip-plot-CzHFNhr3.cjs} +1 -1
- package/dist/{vue-ui-strip-plot-Bm0JThi4.js → vue-ui-strip-plot-lVVqtsNc.js} +9 -9
- package/dist/{vue-ui-table-6ZR-bgMx.js → vue-ui-table-8hNkBy1z.js} +1 -1
- package/dist/{vue-ui-table-heatmap-bJUl4rY6.js → vue-ui-table-heatmap-BAPA4nvf.js} +4 -4
- package/dist/{vue-ui-table-heatmap-B2Xe1T4D.cjs → vue-ui-table-heatmap-HgHQKSax.cjs} +1 -1
- package/dist/{vue-ui-table-B0FlP2RX.cjs → vue-ui-table-qtBWpg0m.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-Dxinc_iR.js → vue-ui-table-sparkline-DZY_23mg.js} +5 -5
- package/dist/{vue-ui-table-sparkline-DgZQmNaq.cjs → vue-ui-table-sparkline-Q8y6tloS.cjs} +1 -1
- package/dist/{vue-ui-thermometer-BN1harXD.cjs → vue-ui-thermometer-Cbu9jVvC.cjs} +1 -1
- package/dist/{vue-ui-thermometer-Nb1pgJ04.js → vue-ui-thermometer-CcH1qmLq.js} +5 -5
- package/dist/{vue-ui-timer-_44ECu7b.cjs → vue-ui-timer-C52mSn4m.cjs} +1 -1
- package/dist/{vue-ui-timer-C17OoYkC.js → vue-ui-timer-DJfYr02u.js} +4 -4
- package/dist/{vue-ui-tiremarks-lbnWHaOP.js → vue-ui-tiremarks-CcLcd5oA.js} +5 -5
- package/dist/{vue-ui-tiremarks-BSMuOb-Z.cjs → vue-ui-tiremarks-dNuNMt_R.cjs} +1 -1
- package/dist/{vue-ui-treemap-CbdnMlBb.js → vue-ui-treemap-BOz94BVK.js} +9 -9
- package/dist/{vue-ui-treemap-DinP2PhP.cjs → vue-ui-treemap-orjA7Y0U.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-B7cKvp6J.cjs → vue-ui-vertical-bar-BHIt5cjc.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-B9HnpW6M.js → vue-ui-vertical-bar-BquCm_UG.js} +9 -9
- package/dist/{vue-ui-waffle-70I35yZY.js → vue-ui-waffle-CNlp7RTS.js} +254 -250
- package/dist/vue-ui-waffle-Dv8pXiYm.cjs +1 -0
- package/dist/{vue-ui-wheel-DZbEyD4l.cjs → vue-ui-wheel-BVjbh4oM.cjs} +1 -1
- package/dist/{vue-ui-wheel-C8YTOjwd.js → vue-ui-wheel-DMRiVkhu.js} +5 -5
- package/dist/{vue-ui-word-cloud-Don3Oz-A.js → vue-ui-word-cloud-CHRE8f_k.js} +6 -6
- package/dist/{vue-ui-word-cloud-DkJyoTg9.cjs → vue-ui-word-cloud-CZum_IjT.cjs} +1 -1
- package/dist/{vue-ui-xy-DkBLRZ6y.cjs → vue-ui-xy-BOoG4xg8.cjs} +1 -1
- package/dist/{vue-ui-xy-XJp90Tih.js → vue-ui-xy-CsFr8tix.js} +12 -12
- package/dist/{vue-ui-xy-canvas-Do2LgfMo.cjs → vue-ui-xy-canvas-BHa3-phi.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-CsPcJxOA.js → vue-ui-xy-canvas-Bb2Z3E-7.js} +10 -10
- package/package.json +2 -1
- package/dist/index-BFH7X8WG.cjs +0 -4
- package/dist/vue-data-ui-dbgbgXfB.cjs +0 -9
- package/dist/vue-ui-waffle-BaqQnh1w.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-BQOxn6SH.cjs"),ae=require("./useResponsive-B3TrDDIG.cjs"),be=require("./Title-B9iq63n1.cjs"),oe=require("./usePrinter-Q1J--baX.cjs"),ke=require("./Tooltip-DcDEanxk.cjs"),we=require("./DataTable-C6HTLT7L.cjs"),xe=require("./Legend-C_lBCmBu.cjs"),Ce=require("./vue-ui-skeleton-CcrGR_Vh.cjs"),Be=require("./vue-ui-accordion-ogVvFfQy.cjs"),re=require("./useNestedProp-BtqgWTf9.cjs"),_e=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ue=S=>(e.pushScopeId("data-v-33939b0e"),S=S(),e.popScopeId(),S),Se=["id"],Ne=["xmlns","viewBox"],$e=["id"],Te=["stop-color"],Pe=["stop-color"],Ve=["id"],Ee=ue(()=>e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1)),Ie=ue(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),ze=[Ee,Ie],Fe=["x","y","height","width"],Le=["rx","x","y","height","width","stroke","stroke-width","filter"],Oe=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],De=["x","y","height","width","filter"],Ae={key:0},Me={key:1},qe={key:2},Re={key:3},Ue=["onMouseover","x","y","height","width"],je={key:3,class:"vue-data-ui-watermark"},Ge=["onClick"],We={key:0},He={key:1},Ye=["innerHTML"],Xe={__name:"vue-ui-waffle",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(S,{expose:ne,emit:se}){const p=S,{vue_ui_waffle:ie}=n.useConfig(),E=e.computed(()=>!!p.dataset&&p.dataset.length),m=e.ref(n.createUid()),ce=e.ref(null),L=e.ref(!1),O=e.ref(""),B=e.ref(null),q=e.ref(0),N=e.ref(null),R=e.ref(null),U=e.ref(null),t=e.computed(()=>{const l=re.useNestedProp({userConfig:p.config,defaultConfig:ie});return l.theme?{...re.useNestedProp({userConfig:n.themes.vue_ui_waffle[l.theme]||p.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}),I=e.ref(null);e.onMounted(()=>{if(n.objectIsEmpty(p.dataset)?n.error({componentName:"VueUiWaffle",type:"dataset"}):p.dataset.forEach((l,o)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=ae.throttle(()=>{const{width:o,height:a}=ae.useResponsive({chart:N.value,title:t.value.style.chart.title.text?R.value:null,legend:t.value.style.chart.legend.show?U.value:null});b.value.width=o,b.value.height=a,k.value.width=o,k.value.height=a});I.value=new ResizeObserver(l),I.value.observe(N.value.parentNode)}}),e.onBeforeUnmount(()=>{I.value&&I.value.disconnect()});const{isPrinting:j,isImaging:G,generatePdf:W,generateImage:H}=oe.usePrinter({elementId:`vue-ui-waffle_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-waffle"}),Y=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),y=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),b=e.ref({height:512,width:512}),k=e.ref({top:0,left:0,height:512,width:512}),w=e.computed(()=>(k.value.width-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),x=e.computed(()=>(k.value.height-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),$=e.computed(()=>k.value.width/t.value.style.chart.layout.grid.size),z=e.computed(()=>k.value.height/t.value.style.chart.layout.grid.size);function X(l){const o=t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.size,a=l.reduce((h,M)=>h+M,0),r=l.map(h=>h/a*o),u=r.map(Math.floor),s=r.map(h=>h%1);let v=o-u.reduce((h,M)=>h+M,0);for(;v>0;){let h=s.indexOf(Math.max(...s));u[h]+=1,s[h]=0,v-=1}return u}const J=e.computed(()=>p.dataset.map((l,o)=>({...l,color:n.convertColorToHex(l.color)||Y.value[o]||n.palette[o]||n.palette[o%n.palette.length],uid:`serie_${o}`,absoluteIndex:o}))),c=e.ref(J.value),de=e.computed(()=>{const l=c.value.filter((o,a)=>!d.value.includes(o.uid)).map((o,a)=>(o.values||[]).reduce((r,u)=>r+u,0));return X(l)}),ve=e.computed(()=>{const l=c.value.map((o,a)=>(o.values||[]).reduce((r,u)=>r+u));return X(l)}),T=e.computed(()=>(p.dataset.forEach((l,o)=>{[null,void 0].includes(l.values)&&n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:"values (number[])",index:o})}),c.value.filter((l,o)=>!d.value.includes(l.uid)).map((l,o)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,r)=>a+r,0),absoluteValues:l.values||[],proportion:de.value[o]})))),he=e.computed(()=>c.value.map((l,o)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,r)=>a+r,0),absoluteValues:l.values||[],proportion:ve.value[o]})));function pe(){return he.value.map(l=>({name:l.name,color:l.color,value:l.value,proportion:l.proportion}))}const fe=e.computed(()=>{let l=0;return T.value.map((o,a)=>{const r=l,u=r+o.proportion,s=[];for(let v=Math.floor(r);v<Math.floor(u);v+=1)s.push(v);return l=u,{...o,start:r,rects:s}})}),i=e.computed(()=>fe.value.flatMap((l,o)=>l.rects.map((a,r)=>({isFirst:r===0,isLongEnough:a.length>2,name:l.name,color:l.color,value:l.value,serieIndex:o,absoluteStartIndex:r<3,serieId:l.uid,...l}))).map((l,o)=>({...l,isAbsoluteFirst:o%t.value.style.chart.layout.grid.size===0}))),P=e.computed(()=>{const l=[];for(let o=0;o<t.value.style.chart.layout.grid.size;o+=1)for(let a=0;a<t.value.style.chart.layout.grid.size;a+=1)l.push({isStartOfLine:a===0,position:t.value.style.chart.layout.grid.vertical?o:a,x:(t.value.style.chart.layout.grid.vertical?o:a)*(w.value+t.value.style.chart.layout.grid.spaceBetween),y:(t.value.style.chart.layout.grid.vertical?a:o)*(x.value+t.value.style.chart.layout.grid.spaceBetween)+k.value.top});return l}),d=e.ref([]),C=e.ref(!1),K=e.ref(null),Q=e.ref(null);function Z(l){if(!t.value.useAnimation){d.value.includes(l)?d.value=d.value.filter(u=>u!==l):d.value.length<_.value.length-1&&_.value.length>1&&d.value.push(l);return}const o=J.value.find(u=>u.uid===l).values.reduce((u,s)=>u+s,0);let r=c.value.find(u=>u.uid===l).values.reduce((u,s)=>u+s,0);if(d.value.includes(l)){let s=function(){r>u?(cancelAnimationFrame(K.value),c.value=c.value.map((v,h)=>v.uid===l?{...v,values:[u]}:v),C.value=!1):(C.value=!0,r+=u*.025,c.value=c.value.map((v,h)=>v.uid===l?{...v,values:[r]}:v),K.value=requestAnimationFrame(s))};d.value=d.value.filter(v=>v!==l);const u=o;s()}else if(d.value.length<_.value.length-1&&_.value.length>1){let u=function(){r<.1?(cancelAnimationFrame(Q.value),d.value.push(l),c.value=c.value.map((s,v)=>s.uid===l?{...s,values:[0]}:s),C.value=!1):(C.value=!0,r/=1.5,c.value=c.value.map((s,v)=>s.uid===l?{...s,values:[r]}:s),Q.value=requestAnimationFrame(u))};u()}se("selectLegend",T.value.map(u=>({name:u.name,color:u.color,value:u.value,proportion:u.proportion/Math.pow(t.value.style.chart.layout.grid.size,2)})))}const _=e.computed(()=>c.value.map((l,o)=>({name:l.name,color:l.color||Y[o]||n.palette[o]||n.palette[o%n.palette.length],value:(l.values||[]).reduce((a,r)=>a+r,0),uid:l.uid,shape:"square"})).map((l,o)=>({...l,proportion:l.value/c.value.map(a=>(a.values||[]).reduce((r,u)=>r+u,0)).reduce((a,r)=>a+r,0),opacity:d.value.includes(l.uid)?.5:1,segregate:()=>Z(l.uid),isSegregated:d.value.includes(l.uid)}))),ye=e.computed(()=>({cy:"waffle-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),f=e.computed(()=>T.value.map(l=>l.value).reduce((l,o)=>l+o,0)),D=e.ref(null);function ge(l){if(d.value.length===p.dataset.length)return;const o=i.value[l];D.value={datapoint:o,seriesIndex:o.absoluteIndex,series:c.value,config:t.value},L.value=!0,B.value=i.value[l].serieIndex;const a=t.value.style.chart.tooltip.customFormat;if(n.isFunction(a)&&n.functionReturnsString(()=>a({seriesIndex:i.value[l].absoluteIndex,datapoint:o,series:c.value,config:t.value})))O.value=a({seriesIndex:i.value[l].absoluteIndex,datapoint:o,series:c.value,config:t.value});else{let r="";r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" rx="1" fill="${o.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(r+=`<b>${n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue})}</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?r+=`<span>(${(o.value/f.value*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%)</span></div>`:r+=`<b>${(o.value/f.value*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%</b></div>`),O.value=r}}const g=e.computed(()=>{const l=T.value.map(a=>({name:a.name,color:a.color})),o=T.value.map(a=>a.value);return{head:l,body:o}});function A(l){return t.value.useBlurOnHover&&![null,void 0].includes(B.value)&&B.value!==l?`url(#blur_${m.value})`:""}function ee(){e.nextTick(()=>{const l=g.value.head.map((r,u)=>[[r.name],[g.value.body[u]],[isNaN(g.value.body[u]/f.value)?"-":g.value.body[u]/f.value*100]]),o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),a=n.createCsvContent(o);n.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-waffle"})})}const F=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:f.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],o=g.value.head.map((u,s)=>[{color:u.color,name:u.name},n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:g.value.body[s],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),isNaN(g.value.body[s]/f.value)?"-":(g.value.body[s]/f.value*100).toFixed(t.value.table.td.roundingPercentage)+"%"]),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},shape:"square",breakpoint:t.value.table.responsiveBreakpoint},r=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:o,config:a,colNames:r}}),V=e.ref(!1);function me(l){V.value=l,q.value+=1}function te(){y.value.showTable=!y.value.showTable}function le(){y.value.showTooltip=!y.value.showTooltip}return ne({getData:pe,generatePdf:W,generateCsv:ee,generateImage:H,toggleTable:te,toggleTooltip:le}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-waffle ${V.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"waffleChart",ref:N,id:`vue-ui-waffle_${m.value}`,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};${t.value.responsive?"height: 100%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:R,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px`)},[e.createVNode(be._sfc_main,{config:{title:{cy:"waffle-title",...t.value.style.chart.title},subtitle:{cy:"waffle-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&E.value?(e.openBlock(),e.createBlock(oe.UserOptions,{ref_key:"details",ref:ce,key:`user_options_${q.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(j),isImaging:e.unref(G),uid:m.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:V.value,isTooltip:y.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:N.value,onToggleFullscreen:me,onGeneratePdf:e.unref(W),onGenerateCsv:ee,onGenerateImage:e.unref(H),onToggleTable:te,onToggleTooltip:le},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:a,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":V.value,"vue-data-ui-fulscreen--off":!V.value}),viewBox:`0 0 ${b.value.width<=0?10:b.value.width} ${b.value.height<=0?10:b.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(a,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${m.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(a.color,.05)}${e.unref(n.opacity)[100-t.value.style.chart.layout.rect.gradientIntensity]}`},null,8,Te),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Pe)],8,$e))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${m.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},ze,8,Ve)]),t.value.useCustomCells?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("foreignObject",{x:a.x,y:a.y,height:x.value<=0?1e-4:x.value,width:w.value<=0?1e-4:w.value,class:"vue-ui-waffle-custom-cell-foreignObject"},[e.renderSlot(l.$slots,"cell",e.normalizeProps(e.guardReactiveProps({cell:{...a,color:i.value[r].color,...i.value[r]},isSelected:[null,void 0].includes(B.value)?!0:i.value[r].serieIndex===B.value})),void 0,!0)],8,Fe))),256)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:x.value<=0?1e-4:x.value,width:w.value<=0?1e-4:w.value,fill:"white",stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:A(i.value[r].serieIndex)},null,8,Le))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:x.value<=0?1e-4:x.value,width:w.value<=0?1e-4:w.value,fill:t.value.style.chart.layout.rect.useGradient&&t.value.style.chart.layout.rect.gradientIntensity>0?`url(#gradient_${m.value}_${r})`:i.value[r].color,stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:A(i.value[r].serieIndex)},null,8,Oe))),256))],64)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[!C.value&&!t.value.style.chart.layout.grid.vertical&&t.value.style.chart.layout.labels.captions.show&&(i.value[r].isFirst&&a.position<t.value.style.chart.layout.grid.size-2||i.value[r].isAbsoluteFirst&&r%t.value.style.chart.layout.grid.size===0&&i.value[r].absoluteStartIndex)?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.x+t.value.style.chart.layout.labels.captions.offsetX+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.labels.captions.offsetY+t.value.style.chart.layout.grid.spaceBetween/2,height:z.value<=0?1e-4:z.value,width:$.value*t.value.style.chart.layout.grid.size<=0?1e-4:$.value*t.value.style.chart.layout.grid.size,filter:A(i.value[r].serieIndex)},[e.createElementVNode("div",{class:"vue-ui-waffle-caption",style:e.normalizeStyle(`height: 100%; width: 100%; font-size:${t.value.style.chart.layout.labels.captions.fontSize}px;display:flex;align-items:center;justify-content:flex-start;padding: 0 ${$.value/12}px;color:${e.unref(n.adaptColorToBackground)(i.value[r].color)};gap:2px`)},[t.value.style.chart.layout.labels.captions.showSerieName?(e.openBlock(),e.createElementBlock("span",Ae,e.toDisplayString(t.value.style.chart.layout.labels.captions.serieNameAbbreviation?e.unref(n.abbreviate)({source:i.value[r].name,length:t.value.style.chart.layout.labels.captions.serieNameMaxAbbreviationSize}):i.value[r].name)+": ",1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage?(e.openBlock(),e.createElementBlock("span",Me,e.toDisplayString(e.unref(n.dataLabel)({v:i.value[r].proportion,s:"%",r:t.value.style.chart.layout.labels.captions.roundingPercentage})),1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",qe," ("+e.toDisplayString(e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:i.value[r].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}))+") ",1)):e.createCommentVNode("",!0),!t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",Re,e.toDisplayString(e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:i.value[r].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue})),1)):e.createCommentVNode("",!0)],4)],8,De)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{onMouseover:u=>ge(r),onMouseleave:o[0]||(o[0]=u=>{L.value=!1,B.value=null}),x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:z.value<=0?1e-4:z.value,width:$.value<=0?1e-4:$.value,fill:"transparent",stroke:"none"},null,40,Ue))),256)),e.renderSlot(l.$slots,"svg",{svg:b.value},void 0,!0)],14,Ne)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",je,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(j)||e.unref(G)})),void 0,!0)])):e.createCommentVNode("",!0),E.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ce.default,{key:4,config:{type:"waffle",style:{backgroundColor:t.value.style.chart.backgroundColor,waffle:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:U},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(xe.Legend,{key:0,legendSet:_.value,config:ye.value,onClickMarker:o[1]||(o[1]=({legend:a})=>Z(a.uid))},{item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:r=>a.segregate(),style:e.normalizeStyle(`opacity:${d.value.includes(a.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:a.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue,isAnimating:C.value}))+" ",1),d.value.includes(a.uid)?(e.openBlock(),e.createElementBlock("span",He," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",We," ("+e.toDisplayString(isNaN(a.value/f.value)?"-":e.unref(n.dataLabel)({v:a.value/f.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage,isAnimating:C.value}))+") ",1))],12,Ge)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:_.value},void 0,!0)],512),e.createVNode(ke._sfc_main,{show:y.value.showTooltip&&L.value&&d.value.length<p.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:N.value,content:O.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function",fontSize:t.value.style.chart.tooltip.fontSize},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...D.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...D.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom","fontSize"]),E.value?(e.openBlock(),e.createBlock(Be.default,{key:5,hideDetails:"",config:{open:y.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(we.DataTable,{colNames:F.value.colNames,head:F.value.head,body:F.value.body,config:F.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[2]||(o[2]=a=>y.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,Ye)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name||a),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Se))}},Je=_e._export_sfc(Xe,[["__scopeId","data-v-33939b0e"]]);exports.default=Je;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-BQOxn6SH.cjs"),q=require("./Title-B9iq63n1.cjs"),P=require("./usePrinter-Q1J--baX.cjs"),B=require("./useResponsive-B3TrDDIG.cjs"),T=require("./vue-ui-skeleton-CcrGR_Vh.cjs"),S=require("./useNestedProp-BtqgWTf9.cjs"),U=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),G=["id"],L=["xmlns","viewBox"],R=["x1","x2","y1","y2","stroke","stroke-width","stroke-linecap"],X=["cx","cy","r","stroke","stroke-width"],j=["x","y","font-size","fill","font-weight"],H={key:3,class:"vue-data-ui-watermark"},Y={__name:"vue-ui-wheel",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(I,{expose:F}){const o=I,{vue_ui_wheel:N}=c.useConfig(),f=e.computed(()=>!!o.dataset&&Object.keys(o.dataset).length),y=e.ref(c.createUid()),z=e.ref(null),g=e.ref(0),d=e.ref(null),p=e.ref(null),t=e.computed(()=>{const l=S.useNestedProp({userConfig:o.config,defaultConfig:N});return l.theme?{...S.useNestedProp({userConfig:c.themes.vue_ui_wheel[l.theme]||o.config,defaultConfig:l})}:l}),{isPrinting:k,isImaging:w,generatePdf:C,generateImage:b}=P.usePrinter({elementId:y.value,fileName:t.value.style.chart.title.text||"vue-ui-wheel"}),n=e.ref({size:360,height:360,width:360}),m=e.ref(t.value.style.chart.layout.percentage.fontSize),r=e.computed(()=>({radius:Math.min(n.value.width,n.value.height)*.9/2,centerX:n.value.width/2,centerY:n.value.height/2}));function _(l,u=1){return{x:r.value.centerX+r.value.radius*Math.cos(29.85+l*Math.PI/180)*u,y:r.value.centerY+r.value.radius*Math.sin(29.85+l*Math.PI/180)*u}}const s=e.ref(t.value.style.chart.animation.use?0:o.dataset.percentage||0);e.watch(()=>o.dataset.percentage,()=>{s.value=e.ref(t.value.style.chart.animation.use?0:o.dataset.percentage||0),x()});const h=e.ref(null);e.onMounted(()=>{if(c.objectIsEmpty(o.dataset)&&c.error({componentName:"VueUiWheel",type:"dataset"}),x(),t.value.responsive){const l=B.throttle(()=>{const{width:u,height:a}=B.useResponsive({chart:d.value,title:t.value.style.chart.title.text?p.value:null});n.value.width=u,n.value.height=a,m.value=t.value.style.chart.layout.percentage.fontSize/360*Math.min(u,a)});h.value=new ResizeObserver(l),h.value.observe(d.value.parentNode)}}),e.onBeforeUnmount(()=>{h.value&&h.value.disconnect()});function x(){let l=0,u=t.value.style.chart.animation.speed,a=.005*t.value.style.chart.animation.acceleration;function i(){s.value+=u+l,l+=a,s.value<(o.dataset.percentage||0)?requestAnimationFrame(i):s.value=o.dataset.percentage||0}t.value.style.chart.animation.use&&(s.value=0,i())}const $=e.computed(()=>{const l=[];for(let a=0;a<100;a+=1){const i=s.value>a?t.value.style.chart.layout.wheel.ticks.activeColor:t.value.style.chart.layout.wheel.ticks.inactiveColor,{x:E,y:V}=_(n.value.size/100*a),{x:A,y:M}=_(n.value.size/100*a,.9);l.push({x1:E,y1:V,x2:A,y2:M,color:t.value.style.chart.layout.wheel.ticks.gradient.show?c.shiftHue(i,a/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):i})}return l}),v=e.ref(!1);function O(l){v.value=l,g.value+=1}return F({generatePdf:C,generateImage:b}),(l,u)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-wheel",ref_key:"wheelChart",ref:d,id:y.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%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:p,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px`)},[e.createVNode(q._sfc_main,{config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(P.UserOptions,{ref_key:"details",ref:z,key:`user_options_${g.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(k),isImaging:e.unref(w),uid:y.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:v.value,titles:{...t.value.userOptions.buttonTitles},chartElement:d.value,onToggleFullscreen:O,onGeneratePdf:e.unref(C),onGenerateImage:e.unref(b)},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:i})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:i})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(c.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":v.value,"vue-data-ui-fulscreen--off":!v.value}),viewBox:`0 0 ${n.value.width<=0?10:n.value.width} ${n.value.height<=0?10:n.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(a,i)=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2,stroke:a.color,"stroke-width":5/360*Math.min(n.value.width,n.value.height),"stroke-linecap":t.value.style.chart.layout.wheel.ticks.rounded?"round":"butt",class:e.normalizeClass({"vue-ui-tick-animated":t.value.style.chart.animation.use&&i<=s.value})},null,10,R))),256)),t.value.style.chart.layout.innerCircle.show?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:r.value.centerX,cy:r.value.centerY,r:r.value.radius*.8<=0?1e-4:r.value.radius*.8,stroke:t.value.style.chart.layout.innerCircle.stroke,"stroke-width":t.value.style.chart.layout.innerCircle.strokeWidth,fill:"none"},null,8,X)):e.createCommentVNode("",!0),t.value.style.chart.layout.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:1,x:r.value.centerX,y:r.value.centerY+m.value/3,"font-size":m.value,fill:t.value.style.chart.layout.wheel.ticks.gradient.show?e.unref(c.shiftHue)(t.value.style.chart.layout.wheel.ticks.activeColor,s.value/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.wheel.ticks.activeColor,"text-anchor":"middle","font-weight":t.value.style.chart.layout.percentage.bold?"bold":"normal",style:{"font-variant-numeric":"tabluar-nums"}},e.toDisplayString(Number(s.value.toFixed(t.value.style.chart.layout.percentage.rounding)).toLocaleString())+"% ",9,j)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:n.value},void 0,!0)],14,L)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",H,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(k)||e.unref(w)})),void 0,!0)])):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(T.default,{key:4,config:{type:"wheel",style:{backgroundColor:t.value.style.chart.backgroundColor,wheel:{color:"#CCCCCC"}}}},null,8,["config"]))],12,G))}},D=U._export_sfc(Y,[["__scopeId","data-v-1ea442b0"]]);exports.default=D;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { computed as p, ref as s, watch as W, onMounted as q, onBeforeUnmount as J, openBlock as r, createElementBlock as h, normalizeStyle as C, createVNode as K, createCommentVNode as d, createBlock as N, unref as v, createSlots as Q, withCtx as _, renderSlot as y, normalizeProps as A, guardReactiveProps as M, normalizeClass as U, Fragment as Z, renderList as ee, toDisplayString as te } from "vue";
|
|
2
|
-
import { u as ae, c as le, t as se, o as ne, e as oe, s as X, X as re } from "./index-
|
|
3
|
-
import { _ as ue } from "./Title-
|
|
4
|
-
import { u as ie, U as ce } from "./usePrinter-
|
|
2
|
+
import { u as ae, c as le, t as se, o as ne, e as oe, s as X, X as re } from "./index-DiWO-_ca.js";
|
|
3
|
+
import { _ as ue } from "./Title-C3Ez1ceq.js";
|
|
4
|
+
import { u as ie, U as ce } from "./usePrinter-BD40aUzH.js";
|
|
5
5
|
import { t as he, u as ve } from "./useResponsive-NZB-WLRF.js";
|
|
6
|
-
import de from "./vue-ui-skeleton-
|
|
7
|
-
import { u as B } from "./useNestedProp-
|
|
6
|
+
import de from "./vue-ui-skeleton-CeNL0kH-.js";
|
|
7
|
+
import { u as B } from "./useNestedProp-DNX5EefQ.js";
|
|
8
8
|
import { _ as ye } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
const fe = ["id"], ge = ["xmlns", "viewBox"], me = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-linecap"], pe = ["cx", "cy", "r", "stroke", "stroke-width"], ke = ["x", "y", "font-size", "fill", "font-weight"], we = {
|
|
10
10
|
key: 3,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { computed as F, ref as r, onMounted as fe, onBeforeUnmount as ge, watch as pe, openBlock as c, createElementBlock as h, normalizeStyle as N, createVNode as R, createCommentVNode as y, createBlock as j, unref as m, createSlots as be, withCtx as v, renderSlot as f, normalizeProps as H, guardReactiveProps as q, normalizeClass as Y, createElementVNode as J, Fragment as ye, renderList as we, toDisplayString as K, createTextVNode as Ce, nextTick as Q } from "vue";
|
|
2
|
-
import { u as ke, S as xe, c as Z, t as $e, a as _e, p as z, o as Te, e as ee, g as Pe, f as Fe, X as Ne, n as ze, q as Ie } from "./index-
|
|
3
|
-
import { _ as Se } from "./Title-
|
|
4
|
-
import { u as Oe, U as Me } from "./usePrinter-
|
|
2
|
+
import { u as ke, S as xe, c as Z, t as $e, a as _e, p as z, o as Te, e as ee, g as Pe, f as Fe, X as Ne, n as ze, q as Ie } from "./index-DiWO-_ca.js";
|
|
3
|
+
import { _ as Se } from "./Title-C3Ez1ceq.js";
|
|
4
|
+
import { u as Oe, U as Me } from "./usePrinter-BD40aUzH.js";
|
|
5
5
|
import { t as De, u as We } from "./useResponsive-NZB-WLRF.js";
|
|
6
|
-
import Ee from "./vue-ui-accordion-
|
|
7
|
-
import { D as Ae } from "./DataTable-
|
|
8
|
-
import { u as te } from "./useNestedProp-
|
|
6
|
+
import Ee from "./vue-ui-accordion-CiNdgRO9.js";
|
|
7
|
+
import { D as Ae } from "./DataTable-EqeVt-K-.js";
|
|
8
|
+
import { u as te } from "./useNestedProp-DNX5EefQ.js";
|
|
9
9
|
import { _ as Ve } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
10
|
const Be = ["id"], Ue = ["xmlns", "viewBox"], Ge = ["transform"], Le = ["fill", "font-weight", "x", "y", "font-size", "transform"], Xe = {
|
|
11
11
|
key: 3,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-BQOxn6SH.cjs"),Z=require("./Title-B9iq63n1.cjs"),M=require("./usePrinter-Q1J--baX.cjs"),D=require("./useResponsive-B3TrDDIG.cjs"),ee=require("./vue-ui-accordion-ogVvFfQy.cjs"),te=require("./DataTable-C6HTLT7L.cjs"),W=require("./useNestedProp-BtqgWTf9.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),le=["id"],ae=["xmlns","viewBox"],ne=["transform"],se=["fill","font-weight","x","y","font-size","transform"],re={key:3,class:"vue-data-ui-watermark"},ue=["innerHTML"],ie={__name:"vue-ui-word-cloud",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,String],default(){return[]}}},setup(q,{expose:A}){const c=q,{vue_ui_word_cloud:U}=s.useConfig(),f=e.computed({get(){return!!c.dataset&&c.dataset.length},set(o){return o}}),x=e.ref(typeof c.dataset=="string"?s.createWordCloudDatasetFromPlainText(c.dataset):c.dataset),$=e.ref(s.createUid()),T=e.ref(0),g=e.ref(null),S=e.ref(null),t=e.computed(()=>{const o=W.useNestedProp({userConfig:c.config,defaultConfig:U});return o.theme?{...W.useNestedProp({userConfig:s.themes.vue_ui_word_cloud[o.theme]||c.config,defaultConfig:o}),customPalette:s.themePalettes[o.theme]||s.palette}:o}),r=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,maxFontSize:t.value.style.chart.words.maxFontSize,minFontSize:t.value.style.chart.words.minFontSize}),p=e.ref(null);e.onMounted(()=>{if(s.objectIsEmpty(c.dataset)?s.error({componentName:"VueUiWordCloud",type:"dataset"}):x.value.forEach((o,a)=>{s.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(l=>{f.value=!1,s.error({componentName:"VueUiWordCloud",type:"datasetSerieAttribute",property:l,index:a})})}),t.value.responsive){const o=D.throttle(()=>{const{width:a,height:l}=D.useResponsive({chart:g.value,title:t.value.style.chart.title.text?S.value:null});r.value.width=a,r.value.height=l,e.nextTick(I)});p.value=new ResizeObserver(o),p.value.observe(g.value.parentNode)}}),e.onBeforeUnmount(()=>{p.value&&p.value.disconnect()});const{isPrinting:_,isImaging:z,generatePdf:F,generateImage:B}=M.usePrinter({elementId:`wordCloud_${$.value}`,fileName:t.value.style.chart.title.text||"vue-ui-word-cloud"}),y=e.ref({showTable:t.value.table.show});function G(o,a,l="Arial"){const n=document.createElement("canvas").getContext("2d");return n.font=`${a}px ${t.value.style.chart.words.bold?"bold":"normal"} ${l}`,{width:n.measureText(o).width+t.value.style.chart.words.proximity,height:a}}function L(o,a){return o.x<a.x+a.width&&o.x+o.width>a.x&&o.y<a.y+a.height&&o.y+o.height>a.y}function R(o,a,l){const u=[],n={x:-a/2,y:-l/2,width:a,height:l},i=0,v=0;return o.forEach(h=>{let P=!1;for(let w=0;w<Math.max(a,l)/2&&!P;w+=t.value.style.chart.words.packingWeight)for(let N=0;N<360&&!P;N+=t.value.style.chart.words.packingWeight){const V=N*Math.PI/180,H=i+w*Math.cos(V)-h.width/2,Y=v+w*Math.sin(V)-h.height/2,d={...h,x:H,y:Y},J=d.x>=n.x&&d.y>=n.y&&d.x+d.width<=n.x+n.width&&d.y+d.height<=n.y+n.height,K=u.some(Q=>L(d,Q));J&&!K&&(u.push(d),P=!0)}}),u}const m=e.ref([]);e.watch(()=>c.dataset,I,{immediate:!0});function I(){const o=x.value.map(n=>n.value),a=Math.max(...o),l=Math.min(...o),u=x.value.map((n,i)=>{const v=(n.value-l)/(a-l)*(r.value.maxFontSize-r.value.minFontSize)+r.value.minFontSize,h=G(n.name,v);return{...n,id:s.createUid(),fontSize:v,width:h.width,height:h.height,color:t.value.style.chart.words.usePalette?t.value.customPalette[i]||t.value.customPalette[i%t.value.customPalette.length]||s.palette[i]||s.palette[i%s.palette.length]:t.value.style.chart.words.color}});m.value=R(u,r.value.width,r.value.height).sort((n,i)=>i.fontSize-n.fontSize)}const b=e.computed(()=>{const o=m.value.map(l=>({name:l.name,color:l.color})),a=m.value.map(l=>l.value);return{head:o,body:a}});function E(){e.nextTick(()=>{const o=b.value.head.map((u,n)=>[[u.name],[b.value.body[n]]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],[t.value.table.columnNames.value]]].concat(o),l=s.createCsvContent(a);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-word-cloud"})})}const C=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value],a=b.value.head.map((n,i)=>{const v=s.dataLabel({p:t.value.table.td.prefix,v:b.value.body[i],s:t.value.table.td.suffix,r:t.value.table.td.roundingValue});return[{color:n.color,name:n.name},v]}),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],head:o,body:a,config:l}}),k=e.ref(!1);function X(o){k.value=o,T.value+=1}function j(){return m.value}function O(){y.value.showTable=!y.value.showTable}return A({getData:j,generateCsv:E,generatePdf:F,generateImage:B,toggleTable:O}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-word-cloud",ref_key:"wordCloudChart",ref:g,id:`wordCloud_${$.value}`,style:e.normalizeStyle(`width: 100%; font-family:${t.value.style.fontFamily};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:S,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(Z._sfc_main,{config:{title:{...t.value.style.chart.title},subtitle:{...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(M.UserOptions,{ref:"details",key:`user_option_${T.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(_),isImaging:e.unref(z),uid:$.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:k.value,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,onToggleFullscreen:X,onGeneratePdf:e.unref(F),onGenerateCsv:E,onGenerateImage:e.unref(B),onToggleTable:O},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:u})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:u})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:2,class:e.normalizeClass({"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value}),xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${r.value.width<=0?10:r.value.width} ${r.value.height<=0?10:r.value.height}`,style:e.normalizeStyle(`overflow:visible;background:${t.value.style.chart.backgroundColor};`)},[e.createElementVNode("g",{transform:`translate(${(r.value.width<=0?10:r.value.width)/2}, ${(r.value.height<=0?10:r.value.height)/2})`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,u)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(),e.createElementBlock("text",{fill:l.color,"font-weight":t.value.style.chart.words.bold?"bold":"normal",key:u,x:l.x,y:l.y,"font-size":l.fontSize,transform:`translate(${l.width/2}, ${l.height/2})`,style:e.normalizeStyle(`animation-delay:${u*t.value.animationDelayMs}ms !important`),class:e.normalizeClass({animated:t.value.useCssAnimation}),"text-anchor":"middle","dominant-baseline":"middle"},e.toDisplayString(l.name),15,se))]))),256))],8,ne),e.renderSlot(o.$slots,"svg",{svg:{height:r.value.height,width:r.value.width}},void 0,!0)],14,ae)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",re,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(_)||e.unref(z)})),void 0,!0)])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createBlock(ee.default,{key:4,hideDetails:"",config:{open:y.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(te.DataTable,{colNames:C.value.colNames,head:C.value.head,body:C.value.body,config:C.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[0]||(a[0]=l=>y.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,ue)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],12,le))}},ce=oe._export_sfc(ie,[["__scopeId","data-v-682aa7fb"]]);exports.default=ce;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./pdf-Cz3729tZ.cjs"),O=require("./usePrinter-hyuaFHQj.cjs"),d=require("./index-BFH7X8WG.cjs"),E=require("./DataTable-D_2ZW2eI.cjs"),z=require("./Title-CSQdI1EY.cjs"),G=require("./Tooltip-B-laoopT.cjs"),V=require("./Shape-dvRttq7z.cjs"),P=require("./BaseIcon-BkdELEYE.cjs"),T=require("./vue-ui-table-sparkline-DgZQmNaq.cjs"),M=require("./vue-ui-skeleton-Df1qBO2k.cjs"),R=require("./Slicer-DcjEg-ZZ.cjs"),D=require("./vue-ui-accordion-CvZhABQM.cjs"),B=require("./useNestedProp-B_z4-n52.cjs"),e=require("vue"),H=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Y=d.createUid(),q={name:"vue-ui-xy",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},components:{DataTable:E.DataTable,Shape:V._sfc_main,Title:z._sfc_main,Tooltip:G._sfc_main,UserOptions:O.UserOptions,BaseIcon:P.default,TableSparkline:T.default,Skeleton:M.default,Slicer:R.Slicer,Accordion:D.default},data(){this.dataset.forEach((n,m)=>{[null,void 0].includes(n.series)&&this.error({componentName:"VueUiXy",type:"datasetSerieAttribute",property:"series (number[])",index:m})});const r=Math.max(...this.dataset.map(n=>n.series.length)),o={start:0,end:r};return{themePalettes:d.themePalettes,themes:d.themes,slicerStep:0,selectedScale:null,CTX:null,CANVAS:null,opacity:d.opacity,useSafeValues:!0,palette:d.palette,height:600,width:1e3,viewBox:"0 0 1000 600",clientPosition:{x:0,y:0},canvasClientPosition:{x:0,y:0},icons:{line:"line",bar:"bar",plot:"plot"},isFullscreen:!1,isPrinting:!1,isImaging:!1,isTooltip:!1,mutableConfig:{dataLabels:{show:!0},showTooltip:!0,showTable:!1,isStacked:!1,useIndividualScale:!1},selectedSerieIndex:null,selectedRowIndex:null,segregatedSeries:[],uniqueId:d.createUid(),step:0,slicer:o,__to__:null,maxX:r,showSparklineTable:!0,segregateStep:0,sliderId:Y,fontSizes:{xAxis:18,yAxis:12,dataLabels:20,plotLabels:10},plotRadii:{plot:3,line:3}}},computed:{customPalette(){return this.convertCustomPalette(this.FINAL_CONFIG.customPalette)},backgroundColor(){return this.FINAL_CONFIG.chart.backgroundColor},slicerColor(){return this.FINAL_CONFIG.chart.zoom.color},allScales(){const r=this.lineSet.map(l=>({name:l.name,color:l.color,scale:l.individualScale,scaleYLabels:l.scaleYLabels,zero:l.zeroPosition,max:l.individualMax,scaleLabel:l.scaleLabel||"",id:l.id,yOffset:l.yOffset||0,individualHeight:l.individualHeight||this.drawingArea.height,autoScaleYLabels:l.autoScaleYLabels})),o=this.barSet.map(l=>({name:l.name,color:l.color,scale:l.individualScale,scaleYLabels:l.scaleYLabels,zero:l.zeroPosition,max:l.individualMax,scaleLabel:l.scaleLabel||"",id:l.id,yOffset:l.yOffset||0,individualHeight:l.individualHeight||this.drawingArea.height})),n=this.plotSet.map(l=>({name:l.name,color:l.color,scale:l.individualScale,scaleYLabels:l.scaleYLabels,zero:l.zeroPosition,max:l.individualMax,scaleLabel:l.scaleLabel||"",id:l.id,yOffset:l.yOffset||0,individualHeight:l.individualHeight||this.drawingArea.height})),m=[...r,...o,...n].flatMap(l=>l).length;return[...r,...o,...n].flatMap((l,t)=>({id:l.id,scaleLabel:l.scaleLabel,name:l.name,color:l.color,scale:l.scale,yOffset:l.yOffset,individualHeight:l.individualHeight,x:this.mutableConfig.isStacked?this.drawingArea.left:this.drawingArea.left/m*(t+1),yLabels:l.scaleYLabels||l.scale.ticks.map(g=>({y:g>=0?l.zero-l.individualHeight*(g/l.max):l.zero+l.individualHeight*Math.abs(g)/l.max,value:g}))}))},isDataset(){return!!this.dataset&&this.dataset.length},chartFont(){const r=document.getElementById(`vue-ui-xy_${this.uniqueId}`);return window.getComputedStyle(r,null).getPropertyValue("font-family")},FINAL_CONFIG:{get:function(){const r=d.useConfig().vue_ui_xy;if(!Object.keys(this.config||{}).length)return r;const o=this.useNestedProp({userConfig:this.config,defaultConfig:r});return o.theme?{...B.useNestedProp({userConfig:this.themes.vue_ui_xy[o.theme]||this.config,defaultConfig:o}),customPalette:this.themePalettes[o.theme]||this.palette}:o},set:function(r){return r}},hasHighlightArea(){return this.FINAL_CONFIG.chart.highlightArea&&this.FINAL_CONFIG.chart.highlightArea.show},highlightAreaSpan(){const{from:r,to:o}=this.FINAL_CONFIG.chart.highlightArea;return r===o?1:o<r?0:o-r+1},relativeZero(){return this.niceScale.min>=0?0:Math.abs(this.niceScale.min)},absoluteMax(){return this.niceScale.max+this.relativeZero},safeDataset(){return this.useSafeValues?this.dataset.map((r,o)=>({...r,series:r.series.map(n=>this.isSafeValue(n)?n:null).slice(this.slicer.start,this.slicer.end),color:this.convertColorToHex(r.color?r.color:this.customPalette[o]?this.customPalette[o]:this.palette[o]),id:`uniqueId_${o}`})):this.dataset},relativeDataset(){return this.safeDataset.map((r,o)=>({...r,series:r.series.map(n=>n+this.relativeZero),absoluteValues:r.series})).filter(r=>!this.segregatedSeries.includes(r.id))},tableSparklineDataset(){return this.relativeDataset.map(r=>{const o=r.absoluteValues.map(n=>[void 0,null].includes(n)?0:n);return{id:r.id,name:r.name,color:r.color,values:this.fillArray(this.maxSeries,o)}})},tableSparklineConfig(){return{responsiveBreakpoint:this.FINAL_CONFIG.table.responsiveBreakpoint,roundingValues:this.FINAL_CONFIG.table.rounding,showAverage:!1,showMedian:!1,showTotal:!1,fontFamily:this.FINAL_CONFIG.chart.fontFamily,colNames:JSON.parse(JSON.stringify(this.FINAL_CONFIG.chart.grid.labels.xAxisLabels.values)),thead:{backgroundColor:this.FINAL_CONFIG.table.th.backgroundColor,color:this.FINAL_CONFIG.table.th.color,outline:this.FINAL_CONFIG.table.th.outline},tbody:{backgroundColor:this.FINAL_CONFIG.table.td.backgroundColor,color:this.FINAL_CONFIG.table.td.color,outline:this.FINAL_CONFIG.table.td.outline},userOptions:{show:!1}}},absoluteDataset(){return this.safeDataset.map((r,o)=>({absoluteIndex:o,...r,series:r.series.map(n=>n+this.relativeZero),absoluteValues:r.series,segregate:()=>this.segregate(r),isSegregated:this.segregatedSeries.includes(r.id)}))},barSet(){return this.activeSeriesWithStackRatios.filter(r=>r.type==="bar").map((r,o)=>{this.checkAutoScaleError(r);const n=Math.min(...r.absoluteValues.filter(c=>![null,void 0].includes(c))),m=Math.max(...r.absoluteValues.filter(c=>![null,void 0].includes(c))),t={ratios:r.absoluteValues.filter(c=>![null,void 0].includes(c)).map(c=>(c-n)/(m-n)),valueMin:n,valueMax:m<0?0:m},g={max:r.scaleMax||Math.max(...r.absoluteValues)||1,min:r.scaleMin||Math.min(...r.absoluteValues.filter(c=>![void 0,null].includes(c)))>0?0:Math.min(...r.absoluteValues.filter(c=>![null,void 0].includes(c)))},I=r.scaleSteps||this.FINAL_CONFIG.chart.grid.labels.yAxis.commonScaleSteps,u=this.calculateNiceScale(g.min,g.max,I),f=this.calculateNiceScale(t.valueMin,t.valueMax,I),S=u.min>=0?0:Math.abs(u.min),_=0,y=u.max+S,C=f.max+Math.abs(_),N=this.mutableConfig.isStacked?this.drawingArea.height*(1-r.cumulatedStackRatio):0,F=this.mutableConfig.isStacked?this.drawingArea.height*r.stackRatio-this.FINAL_CONFIG.chart.grid.labels.yAxis.gap:this.drawingArea.height,a=this.drawingArea.bottom-N-F*S/y,s=this.drawingArea.bottom-N-F*_/C,i=this.absoluteDataset.filter(c=>c.type==="bar").filter(c=>!this.segregatedSeries.includes(c.id)).length,h=r.series.map((c,k)=>{const w=this.mutableConfig.useIndividualScale?(r.absoluteValues[k]+S)/y:this.ratioToMax(c),v=this.mutableConfig.useIndividualScale&&this.mutableConfig.isStacked?this.drawingArea.left+this.drawingArea.width/this.maxSeries*k:this.drawingArea.left+this.slot.bar*o+this.slot.bar*k*i-this.barSlot/2-o*this.barPeriodGap;return{yOffset:N,individualHeight:F,x:v,y:this.drawingArea.bottom-N-F*w,value:r.absoluteValues[k],zeroPosition:a,individualMax:y,comment:r.comments&&r.comments.slice(this.slicer.start,this.slicer.end)[k]||""}}),L=r.absoluteValues.map(c=>f.min>=0?(c-Math.abs(f.min))/(f.max-Math.abs(f.min)):(c+Math.abs(f.min))/(f.max+Math.abs(f.min))),A=r.series.map((c,k)=>{const w=this.mutableConfig.useIndividualScale&&this.mutableConfig.isStacked?this.drawingArea.left+this.drawingArea.width/this.maxSeries*k:this.drawingArea.left-this.slot.bar/2+this.slot.bar*o+this.slot.bar*k*this.absoluteDataset.filter(v=>v.type==="bar").filter(v=>!this.segregatedSeries.includes(v.id)).length;return{yOffset:N,individualHeight:F,x:w,y:this.drawingArea.bottom-N-(F*L[k]||0),value:r.absoluteValues[k],zeroPosition:a,individualMax:y,comment:r.comments&&r.comments.slice(this.slicer.start,this.slicer.end)[k]||""}}),b=u.ticks.map(c=>({y:c>=0?a-F*(c/y):a+F*Math.abs(c)/y,value:c})),x=f.ticks.map(c=>{const k=(c-f.min)/(f.max-f.min);return{y:c>=0?s-F*k:s+F*k,value:c}});return{...r,yOffset:N,autoScaleYLabels:x,individualHeight:F,scaleYLabels:r.autoScaling?x:b,individualScale:r.autoScaling?f:u,individualMax:r.autoScaling?C:y,zeroPosition:r.autoScaling?s:a,plots:r.autoScaling?A:h}})},activeSeriesLength(){return this.absoluteDataset.length},activeSeriesWithStackRatios(){return this.assignStackRatios(this.absoluteDataset.filter(r=>!this.segregatedSeries.includes(r.id)))},lineSet(){return this.activeSeriesWithStackRatios.filter(r=>r.type==="line").map(r=>{this.checkAutoScaleError(r);const o=Math.min(...r.absoluteValues.filter(c=>![void 0,null].includes(c))),n=Math.max(...r.absoluteValues.filter(c=>![void 0,null].includes(c)))||1,l={ratios:r.absoluteValues.filter(c=>![null,void 0].includes(c)).map(c=>(c-o)/(n-o)),valueMin:o,valueMax:n},t={max:r.scaleMax||Math.max(...r.absoluteValues)||1,min:r.scaleMin||(Math.min(...r.absoluteValues)>0?0:Math.min(...r.absoluteValues))},g=r.scaleSteps||this.FINAL_CONFIG.chart.grid.labels.yAxis.commonScaleSteps,I=this.calculateNiceScale(t.min,t.max,g),u=this.calculateNiceScale(l.valueMin,l.valueMax,g),f=I.min>=0?0:Math.abs(I.min),S=0,_=I.max+Math.abs(f),y=u.max+Math.abs(S),C=this.mutableConfig.isStacked?this.drawingArea.height*(1-r.cumulatedStackRatio):0,N=this.mutableConfig.isStacked?this.drawingArea.height*r.stackRatio-this.FINAL_CONFIG.chart.grid.labels.yAxis.gap:this.drawingArea.height,F=this.drawingArea.bottom-C-N*f/_,a=this.drawingArea.bottom-C-N*S/y,s=r.series.map((c,k)=>{const w=this.mutableConfig.useIndividualScale?(r.absoluteValues[k]+Math.abs(f))/_:this.ratioToMax(c);return{x:this.drawingArea.left+this.slot.line/2+this.slot.line*k,y:this.drawingArea.bottom-C-N*w,value:r.absoluteValues[k],comment:r.comments&&r.comments.slice(this.slicer.start,this.slicer.end)[k]||""}}),i=r.absoluteValues.map(c=>u.min>=0?(c-Math.abs(u.min))/(u.max-Math.abs(u.min)):(c+Math.abs(u.min))/(u.max+Math.abs(u.min))),h=r.series.map((c,k)=>{if(![void 0,null].includes(r.absoluteValues[k]))return{x:this.drawingArea.left+this.slot.line/2+this.slot.line*k,y:this.drawingArea.bottom-C-(N*i[k]||0),value:r.absoluteValues[k],comment:r.comments&&r.comments.slice(this.slicer.start,this.slicer.end)[k]||""}}),L=this.createSmoothPath(s),A=this.createSmoothPath(h),b=I.ticks.map(c=>({y:c>=0?F-N*(c/_):F+N*Math.abs(c)/_,value:c})),x=u.ticks.map(c=>{const k=(c-u.min)/(u.max-u.min);return{y:c>=0?a-N*k:a+N*k,value:c}});return{...r,yOffset:C,autoScaleYLabels:x,individualHeight:N,scaleYLabels:r.autoScaling?x:b,individualScale:r.autoScaling?u:I,individualMax:r.autoScaling?y:_,zeroPosition:r.autoScaling?a:F,curve:r.autoScaling?A:L,plots:r.autoScaling?h:s,area:r.useArea?this.mutableConfig.useIndividualScale?this.createIndividualArea(r.autoScaling?h:s,r.autoScaling?a:F):this.createArea(s):""}})},plotSet(){return this.activeSeriesWithStackRatios.filter(r=>r.type==="plot").map(r=>{this.checkAutoScaleError(r);const o=Math.min(...r.absoluteValues.filter(b=>![null,void 0].includes(b))),n=Math.max(...r.absoluteValues.filter(b=>![null,void 0].includes(b)))||1,l={ratios:r.absoluteValues.filter(b=>![null,void 0].includes(b)).map(b=>(b-o)/(n-o)),valueMin:o,valueMax:n},t={max:r.scaleMax||Math.max(...r.absoluteValues)||1,min:r.scaleMin||Math.min(...r.absoluteValues)>0?0:Math.min(...r.absoluteValues)},g=r.scaleSteps||this.FINAL_CONFIG.chart.grid.labels.yAxis.commonScaleSteps,I=this.calculateNiceScale(t.min,t.max,g),u=this.calculateNiceScale(l.valueMin,l.valueMax,g),f=I.min>=0?0:Math.abs(I.min),S=0,_=I.max+f,y=u.max+Math.abs(S),C=this.mutableConfig.isStacked?this.drawingArea.height*(1-r.cumulatedStackRatio):0,N=this.mutableConfig.isStacked?this.drawingArea.height*r.stackRatio-this.FINAL_CONFIG.chart.grid.labels.yAxis.gap:this.drawingArea.height,F=this.drawingArea.bottom-C-N*f/_,a=this.drawingArea.bottom-C-N*S/y,s=r.series.map((b,x)=>{const c=this.mutableConfig.useIndividualScale?(r.absoluteValues[x]+Math.abs(f))/_:this.ratioToMax(b);return{x:this.drawingArea.left+this.slot.plot/2+this.slot.plot*x,y:this.drawingArea.bottom-C-N*c,value:r.absoluteValues[x],comment:r.comments&&r.comments.slice(this.slicer.start,this.slicer.end)[x]||""}}),i=r.absoluteValues.map(b=>u.min>=0?(b-Math.abs(u.min))/(u.max-Math.abs(u.min)):(b+Math.abs(u.min))/(u.max+Math.abs(u.min))),h=r.series.map((b,x)=>({x:this.drawingArea.left+this.slot.plot/2+this.slot.plot*x,y:this.drawingArea.bottom-C-(N*i[x]||0),value:r.absoluteValues[x],comment:r.comments&&r.comments.slice(this.slicer.start,this.slicer.end)[x]||""})),L=I.ticks.map(b=>({y:b>=0?F-N*(b/_):F+N*Math.abs(b)/_,value:b})),A=u.ticks.map(b=>{const x=(b-u.min)/(u.max-u.min);return{y:b>=0?a-N*x:a+N*x,value:b}});return{...r,yOffset:C,autoScaleYLabels:A,individualHeight:N,scaleYLabels:r.autoScaling?A:L,individualScale:r.autoScaling?u:I,individualMax:r.autoScaling?y:_,zeroPosition:r.autoScaling?a:F,plots:r.autoScaling?h:s}})},drawingArea(){const r=this.mutableConfig.useIndividualScale&&this.FINAL_CONFIG.chart.grid.labels.show?this.absoluteDataset.filter(o=>!this.segregatedSeries.includes(o.id)).length*(this.mutableConfig.isStacked?0:this.FINAL_CONFIG.chart.grid.labels.yAxis.labelWidth):0;return{top:this.FINAL_CONFIG.chart.padding.top,right:this.width-this.FINAL_CONFIG.chart.padding.right,bottom:this.height-this.FINAL_CONFIG.chart.padding.bottom,left:this.FINAL_CONFIG.chart.padding.left+r,height:this.height-(this.FINAL_CONFIG.chart.padding.top+this.FINAL_CONFIG.chart.padding.bottom),width:this.width-(this.FINAL_CONFIG.chart.padding.right+this.FINAL_CONFIG.chart.padding.left+r)}},max(){return Math.max(...this.safeDataset.filter(r=>!this.segregatedSeries.includes(r.id)).map(r=>Math.max(...r.series)))},min(){const r=Math.min(...this.safeDataset.filter(o=>!this.segregatedSeries.includes(o.id)).map(o=>Math.min(...o.series)));return r>0?0:r},niceScale(){return this.calculateNiceScale(this.min,this.max<0?0:this.max,this.FINAL_CONFIG.chart.grid.labels.yAxis.commonScaleSteps)},maxSeries(){return this.slicer.end-this.slicer.start},timeLabels(){return this.FINAL_CONFIG.chart.grid.labels.xAxisLabels.values.slice(this.slicer.start,this.slicer.end)},slot(){return{bar:this.drawingArea.width/this.maxSeries/this.safeDataset.filter(r=>r.type==="bar").filter(r=>!this.segregatedSeries.includes(r.id)).length,plot:this.drawingArea.width/this.maxSeries,line:this.drawingArea.width/this.maxSeries}},barSlot(){const r=this.safeDataset.filter(o=>o.type==="bar").filter(o=>!this.segregatedSeries.includes(o.id)).length;return this.drawingArea.width/this.maxSeries/r-this.barPeriodGap*r},barPeriodGap(){return this.slot.line*this.FINAL_CONFIG.bar.periodGap},maxSlot(){return Math.max(...Object.values(this.slot).filter(r=>r!==1/0))},table(){if(this.safeDataset.length===0)return{head:[],body:[],config:{},columnNames:[]};const r=this.relativeDataset.map(n=>({label:n.name,color:n.color,type:n.type})),o=[];return this.timeLabels.forEach((n,m)=>{const l=[n];this.relativeDataset.forEach(t=>{l.push(this.canShowValue(t.absoluteValues[m])?Number(t.absoluteValues[m].toFixed(this.FINAL_CONFIG.table.rounding)):"")}),o.push(l)}),{head:r,body:o}},dataTable(){const r=[""].concat(this.relativeDataset.map(l=>l.name)).concat(' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>');let o=[];for(let l=0;l<this.maxSeries;l+=1){const t=this.relativeDataset.map(g=>g.absoluteValues[l]??0).reduce((g,I)=>g+I,0);o.push([this.timeLabels[l]??"-"].concat(this.relativeDataset.map(g=>(g.absoluteValues[l]??0).toFixed(this.FINAL_CONFIG.table.rounding))).concat((t??0).toFixed(this.FINAL_CONFIG.table.rounding)))}const n={th:{backgroundColor:this.FINAL_CONFIG.table.th.backgroundColor,color:this.FINAL_CONFIG.table.th.color,outline:this.FINAL_CONFIG.table.th.outline},td:{backgroundColor:this.FINAL_CONFIG.table.td.backgroundColor,color:this.FINAL_CONFIG.table.td.color,outline:this.FINAL_CONFIG.table.td.outline},breakpoint:this.FINAL_CONFIG.table.responsiveBreakpoint},m=[this.FINAL_CONFIG.table.columnNames.period].concat(this.relativeDataset.map(l=>l.name)).concat(this.FINAL_CONFIG.table.columnNames.total);return{head:r,body:o,config:n,colNames:m}},dataTooltipSlot(){return{datapoint:this.selectedSeries,seriesIndex:this.selectedSerieIndex,series:this.absoluteDataset,bars:this.barSet,lines:this.lineSet,plots:this.plotSet,config:this.FINAL_CONFIG}},selectedSeries(){return this.relativeDataset.map(r=>({shape:r.shape||null,name:r.name,color:r.color,type:r.type,value:r.absoluteValues.find((o,n)=>n===this.selectedSerieIndex),comments:r.comments||[]}))},tooltipContent(){let r="",o=this.selectedSeries.map(l=>l.value).filter(l=>this.isSafeValue(l)&&l!==null).reduce((l,t)=>Math.abs(l)+Math.abs(t),0);const n=this.timeLabels[this.selectedSerieIndex],m=this.FINAL_CONFIG.chart.tooltip.customFormat;return this.isFunction(m)&&this.functionReturnsString(()=>m({seriesIndex:this.selectedSerieIndex,datapoint:this.selectedSeries,series:this.absoluteDataset,bars:this.barSet,lines:this.lineSet,plots:this.plotSet,config:this.FINAL_CONFIG}))?m({seriesIndex:this.selectedSerieIndex,datapoint:this.selectedSeries,series:this.absoluteDataset,bars:this.barSet,lines:this.lineSet,plots:this.plotSet,config:this.FINAL_CONFIG}):(n&&(r+=`<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${this.FINAL_CONFIG.chart.tooltip.borderColor}; width:100%">${n}</div>`),this.selectedSeries.forEach(l=>{if(this.isSafeValue(l.value)){let t="",g="";switch(this.icons[l.type]){case"bar":t=`<svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" rx="1" stroke="none" height="12" width="12" fill="${l.color}" /></svg>`;break;case"line":!l.shape||!["star","triangle","square","diamond","pentagon","hexagon"].includes(l.shape)?g=`<circle cx="10" cy="8" r="4" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" fill="${l.color}" />`:l.shape==="triangle"?g=`<path d="${d.createPolygonPath({plot:{x:10,y:8},radius:4,sides:3,rotation:.52}).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" />`:l.shape==="square"?g=`<path d="${d.createPolygonPath({plot:{x:10,y:8},radius:4,sides:4,rotation:.8}).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" />`:l.shape==="diamond"?g=`<path d="${d.createPolygonPath({plot:{x:10,y:8},radius:4,sides:4,rotation:0}).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" />`:l.shape==="pentagon"?g=`<path d="${d.createPolygonPath({plot:{x:10,y:8},radius:4,sides:5,rotation:.95}).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" />`:l.shape==="hexagon"?g=`<path d="${d.createPolygonPath({plot:{x:10,y:8},radius:4,sides:6,rotation:0}).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" />`:l.shape==="star"&&(g=`<polygon stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" fill="${l.color}" points="${d.createStar({plot:{x:10,y:8},radius:4})}" />`),t=`<svg viewBox="0 0 20 12" height="14" width="20"><rect rx="3" x="0" y="6" stroke="none" height="4" width="20" fill="${l.color}" />${g}</svg>`;break;case"plot":if(!l.shape||!["star","triangle","square","diamond","pentagon","hexagon"].includes(l.shape)){t=`<svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" fill="${l.color}" /></svg>`;break}if(l.shape==="star"){t=`<svg viewBox="0 0 12 12" height="14" width="14"><polygon stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" fill="${l.color}" points="${d.createStar({plot:{x:6,y:6},radius:5})}" /></svg>`;break}if(l.shape==="triangle"){t=`<svg viewBox="0 0 12 12" height="14" width="14"><path d="${d.createPolygonPath({plot:{x:6,y:6},radius:6,sides:3,rotation:.52}).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;break}if(l.shape==="square"){t=`<svg viewBox="0 0 12 12" height="14" width="14"><path d="${d.createPolygonPath({plot:{x:6,y:6},radius:6,sides:4,rotation:.8}).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;break}if(l.shape==="diamond"){t=`<svg viewBox="0 0 12 12" height="14" width="14"><path d="${d.createPolygonPath({plot:{x:6,y:6},radius:5,sides:4,rotation:0}).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;break}if(l.shape==="pentagon"){t=`<svg viewBox="0 0 12 12" height="14" width="14"><path d="${d.createPolygonPath({plot:{x:6,y:6},radius:5,sides:5,rotation:.95}).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;break}if(l.shape==="hexagon"){t=`<svg viewBox="0 0 12 12" height="14" width="14"><path d="${d.createPolygonPath({plot:{x:6,y:6},radius:5,sides:6,rotation:0}).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;break}}r+=`<div style="display:flex;flex-direction:row; align-items:center;gap:3px;"><div style="width:20px">${t}</div> ${l.name}: <b>${this.FINAL_CONFIG.chart.tooltip.showValue?this.dataLabel({p:this.FINAL_CONFIG.chart.labels.prefix,v:l.value,s:this.FINAL_CONFIG.chart.labels.suffix,r:this.FINAL_CONFIG.chart.tooltip.roundingValue}):""}</b> ${this.FINAL_CONFIG.chart.tooltip.showPercentage?`(${this.checkNaN(Math.abs(l.value)/o*100).toFixed(this.FINAL_CONFIG.chart.tooltip.roundingPercentage)}%)`:""}</div>`,this.FINAL_CONFIG.chart.comments.showInTooltip&&l.comments.length&&l.comments.slice(this.slicer.start,this.slicer.end)[this.selectedSerieIndex]&&(r+=`<div class="vue-data-ui-tooltip-comment" style="background:${l.color}20; padding: 6px; margin-bottom: 6px; border-left: 1px solid ${l.color}">${l.comments.slice(this.slicer.start,this.slicer.end)[this.selectedSerieIndex]}</div>`)}}),`<div style="border-radius:4px;padding:12px;font-variant-numeric: tabular-nums;color:${this.FINAL_CONFIG.chart.tooltip.color}">${r}</div>`)},svg(){return{height:this.height,width:this.width}},yLabels(){return this.niceScale.ticks.map(r=>({y:r>=0?this.zero-this.drawingArea.height*this.ratioToMax(r):this.zero+this.drawingArea.height*this.ratioToMax(Math.abs(r)),value:r}))},zero(){return this.drawingArea.bottom-this.drawingArea.height*this.ratioToMax(this.relativeZero)}},mounted(){if(this.objectIsEmpty(this.dataset)?this.error({componentName:"VueUiXy",type:"dataset"}):this.dataset.forEach((r,o)=>{[null,void 0].includes(r.name)&&this.error({componentName:"VueUiXy",type:"datasetSerieAttribute",property:"name (string)",index:o})}),this.FINAL_CONFIG.showWarnings&&this.dataset.forEach(r=>{r.series.forEach((o,n)=>{this.isSafeValue(o)||console.warn(`SmartXY has detected an unsafe value in your dataset:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./pdf-Cz3729tZ.cjs"),O=require("./usePrinter-Q1J--baX.cjs"),d=require("./index-BQOxn6SH.cjs"),E=require("./DataTable-C6HTLT7L.cjs"),z=require("./Title-B9iq63n1.cjs"),G=require("./Tooltip-DcDEanxk.cjs"),V=require("./Shape-D8RdmYWq.cjs"),P=require("./BaseIcon-CiO8gP9x.cjs"),T=require("./vue-ui-table-sparkline-Q8y6tloS.cjs"),M=require("./vue-ui-skeleton-CcrGR_Vh.cjs"),R=require("./Slicer-BvYL7yVK.cjs"),D=require("./vue-ui-accordion-ogVvFfQy.cjs"),B=require("./useNestedProp-BtqgWTf9.cjs"),e=require("vue"),H=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Y=d.createUid(),q={name:"vue-ui-xy",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},components:{DataTable:E.DataTable,Shape:V._sfc_main,Title:z._sfc_main,Tooltip:G._sfc_main,UserOptions:O.UserOptions,BaseIcon:P.default,TableSparkline:T.default,Skeleton:M.default,Slicer:R.Slicer,Accordion:D.default},data(){this.dataset.forEach((n,m)=>{[null,void 0].includes(n.series)&&this.error({componentName:"VueUiXy",type:"datasetSerieAttribute",property:"series (number[])",index:m})});const r=Math.max(...this.dataset.map(n=>n.series.length)),o={start:0,end:r};return{themePalettes:d.themePalettes,themes:d.themes,slicerStep:0,selectedScale:null,CTX:null,CANVAS:null,opacity:d.opacity,useSafeValues:!0,palette:d.palette,height:600,width:1e3,viewBox:"0 0 1000 600",clientPosition:{x:0,y:0},canvasClientPosition:{x:0,y:0},icons:{line:"line",bar:"bar",plot:"plot"},isFullscreen:!1,isPrinting:!1,isImaging:!1,isTooltip:!1,mutableConfig:{dataLabels:{show:!0},showTooltip:!0,showTable:!1,isStacked:!1,useIndividualScale:!1},selectedSerieIndex:null,selectedRowIndex:null,segregatedSeries:[],uniqueId:d.createUid(),step:0,slicer:o,__to__:null,maxX:r,showSparklineTable:!0,segregateStep:0,sliderId:Y,fontSizes:{xAxis:18,yAxis:12,dataLabels:20,plotLabels:10},plotRadii:{plot:3,line:3}}},computed:{customPalette(){return this.convertCustomPalette(this.FINAL_CONFIG.customPalette)},backgroundColor(){return this.FINAL_CONFIG.chart.backgroundColor},slicerColor(){return this.FINAL_CONFIG.chart.zoom.color},allScales(){const r=this.lineSet.map(l=>({name:l.name,color:l.color,scale:l.individualScale,scaleYLabels:l.scaleYLabels,zero:l.zeroPosition,max:l.individualMax,scaleLabel:l.scaleLabel||"",id:l.id,yOffset:l.yOffset||0,individualHeight:l.individualHeight||this.drawingArea.height,autoScaleYLabels:l.autoScaleYLabels})),o=this.barSet.map(l=>({name:l.name,color:l.color,scale:l.individualScale,scaleYLabels:l.scaleYLabels,zero:l.zeroPosition,max:l.individualMax,scaleLabel:l.scaleLabel||"",id:l.id,yOffset:l.yOffset||0,individualHeight:l.individualHeight||this.drawingArea.height})),n=this.plotSet.map(l=>({name:l.name,color:l.color,scale:l.individualScale,scaleYLabels:l.scaleYLabels,zero:l.zeroPosition,max:l.individualMax,scaleLabel:l.scaleLabel||"",id:l.id,yOffset:l.yOffset||0,individualHeight:l.individualHeight||this.drawingArea.height})),m=[...r,...o,...n].flatMap(l=>l).length;return[...r,...o,...n].flatMap((l,t)=>({id:l.id,scaleLabel:l.scaleLabel,name:l.name,color:l.color,scale:l.scale,yOffset:l.yOffset,individualHeight:l.individualHeight,x:this.mutableConfig.isStacked?this.drawingArea.left:this.drawingArea.left/m*(t+1),yLabels:l.scaleYLabels||l.scale.ticks.map(g=>({y:g>=0?l.zero-l.individualHeight*(g/l.max):l.zero+l.individualHeight*Math.abs(g)/l.max,value:g}))}))},isDataset(){return!!this.dataset&&this.dataset.length},chartFont(){const r=document.getElementById(`vue-ui-xy_${this.uniqueId}`);return window.getComputedStyle(r,null).getPropertyValue("font-family")},FINAL_CONFIG:{get:function(){const r=d.useConfig().vue_ui_xy;if(!Object.keys(this.config||{}).length)return r;const o=this.useNestedProp({userConfig:this.config,defaultConfig:r});return o.theme?{...B.useNestedProp({userConfig:this.themes.vue_ui_xy[o.theme]||this.config,defaultConfig:o}),customPalette:this.themePalettes[o.theme]||this.palette}:o},set:function(r){return r}},hasHighlightArea(){return this.FINAL_CONFIG.chart.highlightArea&&this.FINAL_CONFIG.chart.highlightArea.show},highlightAreaSpan(){const{from:r,to:o}=this.FINAL_CONFIG.chart.highlightArea;return r===o?1:o<r?0:o-r+1},relativeZero(){return this.niceScale.min>=0?0:Math.abs(this.niceScale.min)},absoluteMax(){return this.niceScale.max+this.relativeZero},safeDataset(){return this.useSafeValues?this.dataset.map((r,o)=>({...r,series:r.series.map(n=>this.isSafeValue(n)?n:null).slice(this.slicer.start,this.slicer.end),color:this.convertColorToHex(r.color?r.color:this.customPalette[o]?this.customPalette[o]:this.palette[o]),id:`uniqueId_${o}`})):this.dataset},relativeDataset(){return this.safeDataset.map((r,o)=>({...r,series:r.series.map(n=>n+this.relativeZero),absoluteValues:r.series})).filter(r=>!this.segregatedSeries.includes(r.id))},tableSparklineDataset(){return this.relativeDataset.map(r=>{const o=r.absoluteValues.map(n=>[void 0,null].includes(n)?0:n);return{id:r.id,name:r.name,color:r.color,values:this.fillArray(this.maxSeries,o)}})},tableSparklineConfig(){return{responsiveBreakpoint:this.FINAL_CONFIG.table.responsiveBreakpoint,roundingValues:this.FINAL_CONFIG.table.rounding,showAverage:!1,showMedian:!1,showTotal:!1,fontFamily:this.FINAL_CONFIG.chart.fontFamily,colNames:JSON.parse(JSON.stringify(this.FINAL_CONFIG.chart.grid.labels.xAxisLabels.values)),thead:{backgroundColor:this.FINAL_CONFIG.table.th.backgroundColor,color:this.FINAL_CONFIG.table.th.color,outline:this.FINAL_CONFIG.table.th.outline},tbody:{backgroundColor:this.FINAL_CONFIG.table.td.backgroundColor,color:this.FINAL_CONFIG.table.td.color,outline:this.FINAL_CONFIG.table.td.outline},userOptions:{show:!1}}},absoluteDataset(){return this.safeDataset.map((r,o)=>({absoluteIndex:o,...r,series:r.series.map(n=>n+this.relativeZero),absoluteValues:r.series,segregate:()=>this.segregate(r),isSegregated:this.segregatedSeries.includes(r.id)}))},barSet(){return this.activeSeriesWithStackRatios.filter(r=>r.type==="bar").map((r,o)=>{this.checkAutoScaleError(r);const n=Math.min(...r.absoluteValues.filter(c=>![null,void 0].includes(c))),m=Math.max(...r.absoluteValues.filter(c=>![null,void 0].includes(c))),t={ratios:r.absoluteValues.filter(c=>![null,void 0].includes(c)).map(c=>(c-n)/(m-n)),valueMin:n,valueMax:m<0?0:m},g={max:r.scaleMax||Math.max(...r.absoluteValues)||1,min:r.scaleMin||Math.min(...r.absoluteValues.filter(c=>![void 0,null].includes(c)))>0?0:Math.min(...r.absoluteValues.filter(c=>![null,void 0].includes(c)))},I=r.scaleSteps||this.FINAL_CONFIG.chart.grid.labels.yAxis.commonScaleSteps,u=this.calculateNiceScale(g.min,g.max,I),f=this.calculateNiceScale(t.valueMin,t.valueMax,I),S=u.min>=0?0:Math.abs(u.min),_=0,y=u.max+S,C=f.max+Math.abs(_),N=this.mutableConfig.isStacked?this.drawingArea.height*(1-r.cumulatedStackRatio):0,F=this.mutableConfig.isStacked?this.drawingArea.height*r.stackRatio-this.FINAL_CONFIG.chart.grid.labels.yAxis.gap:this.drawingArea.height,a=this.drawingArea.bottom-N-F*S/y,s=this.drawingArea.bottom-N-F*_/C,i=this.absoluteDataset.filter(c=>c.type==="bar").filter(c=>!this.segregatedSeries.includes(c.id)).length,h=r.series.map((c,k)=>{const w=this.mutableConfig.useIndividualScale?(r.absoluteValues[k]+S)/y:this.ratioToMax(c),v=this.mutableConfig.useIndividualScale&&this.mutableConfig.isStacked?this.drawingArea.left+this.drawingArea.width/this.maxSeries*k:this.drawingArea.left+this.slot.bar*o+this.slot.bar*k*i-this.barSlot/2-o*this.barPeriodGap;return{yOffset:N,individualHeight:F,x:v,y:this.drawingArea.bottom-N-F*w,value:r.absoluteValues[k],zeroPosition:a,individualMax:y,comment:r.comments&&r.comments.slice(this.slicer.start,this.slicer.end)[k]||""}}),L=r.absoluteValues.map(c=>f.min>=0?(c-Math.abs(f.min))/(f.max-Math.abs(f.min)):(c+Math.abs(f.min))/(f.max+Math.abs(f.min))),A=r.series.map((c,k)=>{const w=this.mutableConfig.useIndividualScale&&this.mutableConfig.isStacked?this.drawingArea.left+this.drawingArea.width/this.maxSeries*k:this.drawingArea.left-this.slot.bar/2+this.slot.bar*o+this.slot.bar*k*this.absoluteDataset.filter(v=>v.type==="bar").filter(v=>!this.segregatedSeries.includes(v.id)).length;return{yOffset:N,individualHeight:F,x:w,y:this.drawingArea.bottom-N-(F*L[k]||0),value:r.absoluteValues[k],zeroPosition:a,individualMax:y,comment:r.comments&&r.comments.slice(this.slicer.start,this.slicer.end)[k]||""}}),b=u.ticks.map(c=>({y:c>=0?a-F*(c/y):a+F*Math.abs(c)/y,value:c})),x=f.ticks.map(c=>{const k=(c-f.min)/(f.max-f.min);return{y:c>=0?s-F*k:s+F*k,value:c}});return{...r,yOffset:N,autoScaleYLabels:x,individualHeight:F,scaleYLabels:r.autoScaling?x:b,individualScale:r.autoScaling?f:u,individualMax:r.autoScaling?C:y,zeroPosition:r.autoScaling?s:a,plots:r.autoScaling?A:h}})},activeSeriesLength(){return this.absoluteDataset.length},activeSeriesWithStackRatios(){return this.assignStackRatios(this.absoluteDataset.filter(r=>!this.segregatedSeries.includes(r.id)))},lineSet(){return this.activeSeriesWithStackRatios.filter(r=>r.type==="line").map(r=>{this.checkAutoScaleError(r);const o=Math.min(...r.absoluteValues.filter(c=>![void 0,null].includes(c))),n=Math.max(...r.absoluteValues.filter(c=>![void 0,null].includes(c)))||1,l={ratios:r.absoluteValues.filter(c=>![null,void 0].includes(c)).map(c=>(c-o)/(n-o)),valueMin:o,valueMax:n},t={max:r.scaleMax||Math.max(...r.absoluteValues)||1,min:r.scaleMin||(Math.min(...r.absoluteValues)>0?0:Math.min(...r.absoluteValues))},g=r.scaleSteps||this.FINAL_CONFIG.chart.grid.labels.yAxis.commonScaleSteps,I=this.calculateNiceScale(t.min,t.max,g),u=this.calculateNiceScale(l.valueMin,l.valueMax,g),f=I.min>=0?0:Math.abs(I.min),S=0,_=I.max+Math.abs(f),y=u.max+Math.abs(S),C=this.mutableConfig.isStacked?this.drawingArea.height*(1-r.cumulatedStackRatio):0,N=this.mutableConfig.isStacked?this.drawingArea.height*r.stackRatio-this.FINAL_CONFIG.chart.grid.labels.yAxis.gap:this.drawingArea.height,F=this.drawingArea.bottom-C-N*f/_,a=this.drawingArea.bottom-C-N*S/y,s=r.series.map((c,k)=>{const w=this.mutableConfig.useIndividualScale?(r.absoluteValues[k]+Math.abs(f))/_:this.ratioToMax(c);return{x:this.drawingArea.left+this.slot.line/2+this.slot.line*k,y:this.drawingArea.bottom-C-N*w,value:r.absoluteValues[k],comment:r.comments&&r.comments.slice(this.slicer.start,this.slicer.end)[k]||""}}),i=r.absoluteValues.map(c=>u.min>=0?(c-Math.abs(u.min))/(u.max-Math.abs(u.min)):(c+Math.abs(u.min))/(u.max+Math.abs(u.min))),h=r.series.map((c,k)=>{if(![void 0,null].includes(r.absoluteValues[k]))return{x:this.drawingArea.left+this.slot.line/2+this.slot.line*k,y:this.drawingArea.bottom-C-(N*i[k]||0),value:r.absoluteValues[k],comment:r.comments&&r.comments.slice(this.slicer.start,this.slicer.end)[k]||""}}),L=this.createSmoothPath(s),A=this.createSmoothPath(h),b=I.ticks.map(c=>({y:c>=0?F-N*(c/_):F+N*Math.abs(c)/_,value:c})),x=u.ticks.map(c=>{const k=(c-u.min)/(u.max-u.min);return{y:c>=0?a-N*k:a+N*k,value:c}});return{...r,yOffset:C,autoScaleYLabels:x,individualHeight:N,scaleYLabels:r.autoScaling?x:b,individualScale:r.autoScaling?u:I,individualMax:r.autoScaling?y:_,zeroPosition:r.autoScaling?a:F,curve:r.autoScaling?A:L,plots:r.autoScaling?h:s,area:r.useArea?this.mutableConfig.useIndividualScale?this.createIndividualArea(r.autoScaling?h:s,r.autoScaling?a:F):this.createArea(s):""}})},plotSet(){return this.activeSeriesWithStackRatios.filter(r=>r.type==="plot").map(r=>{this.checkAutoScaleError(r);const o=Math.min(...r.absoluteValues.filter(b=>![null,void 0].includes(b))),n=Math.max(...r.absoluteValues.filter(b=>![null,void 0].includes(b)))||1,l={ratios:r.absoluteValues.filter(b=>![null,void 0].includes(b)).map(b=>(b-o)/(n-o)),valueMin:o,valueMax:n},t={max:r.scaleMax||Math.max(...r.absoluteValues)||1,min:r.scaleMin||Math.min(...r.absoluteValues)>0?0:Math.min(...r.absoluteValues)},g=r.scaleSteps||this.FINAL_CONFIG.chart.grid.labels.yAxis.commonScaleSteps,I=this.calculateNiceScale(t.min,t.max,g),u=this.calculateNiceScale(l.valueMin,l.valueMax,g),f=I.min>=0?0:Math.abs(I.min),S=0,_=I.max+f,y=u.max+Math.abs(S),C=this.mutableConfig.isStacked?this.drawingArea.height*(1-r.cumulatedStackRatio):0,N=this.mutableConfig.isStacked?this.drawingArea.height*r.stackRatio-this.FINAL_CONFIG.chart.grid.labels.yAxis.gap:this.drawingArea.height,F=this.drawingArea.bottom-C-N*f/_,a=this.drawingArea.bottom-C-N*S/y,s=r.series.map((b,x)=>{const c=this.mutableConfig.useIndividualScale?(r.absoluteValues[x]+Math.abs(f))/_:this.ratioToMax(b);return{x:this.drawingArea.left+this.slot.plot/2+this.slot.plot*x,y:this.drawingArea.bottom-C-N*c,value:r.absoluteValues[x],comment:r.comments&&r.comments.slice(this.slicer.start,this.slicer.end)[x]||""}}),i=r.absoluteValues.map(b=>u.min>=0?(b-Math.abs(u.min))/(u.max-Math.abs(u.min)):(b+Math.abs(u.min))/(u.max+Math.abs(u.min))),h=r.series.map((b,x)=>({x:this.drawingArea.left+this.slot.plot/2+this.slot.plot*x,y:this.drawingArea.bottom-C-(N*i[x]||0),value:r.absoluteValues[x],comment:r.comments&&r.comments.slice(this.slicer.start,this.slicer.end)[x]||""})),L=I.ticks.map(b=>({y:b>=0?F-N*(b/_):F+N*Math.abs(b)/_,value:b})),A=u.ticks.map(b=>{const x=(b-u.min)/(u.max-u.min);return{y:b>=0?a-N*x:a+N*x,value:b}});return{...r,yOffset:C,autoScaleYLabels:A,individualHeight:N,scaleYLabels:r.autoScaling?A:L,individualScale:r.autoScaling?u:I,individualMax:r.autoScaling?y:_,zeroPosition:r.autoScaling?a:F,plots:r.autoScaling?h:s}})},drawingArea(){const r=this.mutableConfig.useIndividualScale&&this.FINAL_CONFIG.chart.grid.labels.show?this.absoluteDataset.filter(o=>!this.segregatedSeries.includes(o.id)).length*(this.mutableConfig.isStacked?0:this.FINAL_CONFIG.chart.grid.labels.yAxis.labelWidth):0;return{top:this.FINAL_CONFIG.chart.padding.top,right:this.width-this.FINAL_CONFIG.chart.padding.right,bottom:this.height-this.FINAL_CONFIG.chart.padding.bottom,left:this.FINAL_CONFIG.chart.padding.left+r,height:this.height-(this.FINAL_CONFIG.chart.padding.top+this.FINAL_CONFIG.chart.padding.bottom),width:this.width-(this.FINAL_CONFIG.chart.padding.right+this.FINAL_CONFIG.chart.padding.left+r)}},max(){return Math.max(...this.safeDataset.filter(r=>!this.segregatedSeries.includes(r.id)).map(r=>Math.max(...r.series)))},min(){const r=Math.min(...this.safeDataset.filter(o=>!this.segregatedSeries.includes(o.id)).map(o=>Math.min(...o.series)));return r>0?0:r},niceScale(){return this.calculateNiceScale(this.min,this.max<0?0:this.max,this.FINAL_CONFIG.chart.grid.labels.yAxis.commonScaleSteps)},maxSeries(){return this.slicer.end-this.slicer.start},timeLabels(){return this.FINAL_CONFIG.chart.grid.labels.xAxisLabels.values.slice(this.slicer.start,this.slicer.end)},slot(){return{bar:this.drawingArea.width/this.maxSeries/this.safeDataset.filter(r=>r.type==="bar").filter(r=>!this.segregatedSeries.includes(r.id)).length,plot:this.drawingArea.width/this.maxSeries,line:this.drawingArea.width/this.maxSeries}},barSlot(){const r=this.safeDataset.filter(o=>o.type==="bar").filter(o=>!this.segregatedSeries.includes(o.id)).length;return this.drawingArea.width/this.maxSeries/r-this.barPeriodGap*r},barPeriodGap(){return this.slot.line*this.FINAL_CONFIG.bar.periodGap},maxSlot(){return Math.max(...Object.values(this.slot).filter(r=>r!==1/0))},table(){if(this.safeDataset.length===0)return{head:[],body:[],config:{},columnNames:[]};const r=this.relativeDataset.map(n=>({label:n.name,color:n.color,type:n.type})),o=[];return this.timeLabels.forEach((n,m)=>{const l=[n];this.relativeDataset.forEach(t=>{l.push(this.canShowValue(t.absoluteValues[m])?Number(t.absoluteValues[m].toFixed(this.FINAL_CONFIG.table.rounding)):"")}),o.push(l)}),{head:r,body:o}},dataTable(){const r=[""].concat(this.relativeDataset.map(l=>l.name)).concat(' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>');let o=[];for(let l=0;l<this.maxSeries;l+=1){const t=this.relativeDataset.map(g=>g.absoluteValues[l]??0).reduce((g,I)=>g+I,0);o.push([this.timeLabels[l]??"-"].concat(this.relativeDataset.map(g=>(g.absoluteValues[l]??0).toFixed(this.FINAL_CONFIG.table.rounding))).concat((t??0).toFixed(this.FINAL_CONFIG.table.rounding)))}const n={th:{backgroundColor:this.FINAL_CONFIG.table.th.backgroundColor,color:this.FINAL_CONFIG.table.th.color,outline:this.FINAL_CONFIG.table.th.outline},td:{backgroundColor:this.FINAL_CONFIG.table.td.backgroundColor,color:this.FINAL_CONFIG.table.td.color,outline:this.FINAL_CONFIG.table.td.outline},breakpoint:this.FINAL_CONFIG.table.responsiveBreakpoint},m=[this.FINAL_CONFIG.table.columnNames.period].concat(this.relativeDataset.map(l=>l.name)).concat(this.FINAL_CONFIG.table.columnNames.total);return{head:r,body:o,config:n,colNames:m}},dataTooltipSlot(){return{datapoint:this.selectedSeries,seriesIndex:this.selectedSerieIndex,series:this.absoluteDataset,bars:this.barSet,lines:this.lineSet,plots:this.plotSet,config:this.FINAL_CONFIG}},selectedSeries(){return this.relativeDataset.map(r=>({shape:r.shape||null,name:r.name,color:r.color,type:r.type,value:r.absoluteValues.find((o,n)=>n===this.selectedSerieIndex),comments:r.comments||[]}))},tooltipContent(){let r="",o=this.selectedSeries.map(l=>l.value).filter(l=>this.isSafeValue(l)&&l!==null).reduce((l,t)=>Math.abs(l)+Math.abs(t),0);const n=this.timeLabels[this.selectedSerieIndex],m=this.FINAL_CONFIG.chart.tooltip.customFormat;return this.isFunction(m)&&this.functionReturnsString(()=>m({seriesIndex:this.selectedSerieIndex,datapoint:this.selectedSeries,series:this.absoluteDataset,bars:this.barSet,lines:this.lineSet,plots:this.plotSet,config:this.FINAL_CONFIG}))?m({seriesIndex:this.selectedSerieIndex,datapoint:this.selectedSeries,series:this.absoluteDataset,bars:this.barSet,lines:this.lineSet,plots:this.plotSet,config:this.FINAL_CONFIG}):(n&&(r+=`<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${this.FINAL_CONFIG.chart.tooltip.borderColor}; width:100%">${n}</div>`),this.selectedSeries.forEach(l=>{if(this.isSafeValue(l.value)){let t="",g="";switch(this.icons[l.type]){case"bar":t=`<svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" rx="1" stroke="none" height="12" width="12" fill="${l.color}" /></svg>`;break;case"line":!l.shape||!["star","triangle","square","diamond","pentagon","hexagon"].includes(l.shape)?g=`<circle cx="10" cy="8" r="4" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" fill="${l.color}" />`:l.shape==="triangle"?g=`<path d="${d.createPolygonPath({plot:{x:10,y:8},radius:4,sides:3,rotation:.52}).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" />`:l.shape==="square"?g=`<path d="${d.createPolygonPath({plot:{x:10,y:8},radius:4,sides:4,rotation:.8}).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" />`:l.shape==="diamond"?g=`<path d="${d.createPolygonPath({plot:{x:10,y:8},radius:4,sides:4,rotation:0}).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" />`:l.shape==="pentagon"?g=`<path d="${d.createPolygonPath({plot:{x:10,y:8},radius:4,sides:5,rotation:.95}).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" />`:l.shape==="hexagon"?g=`<path d="${d.createPolygonPath({plot:{x:10,y:8},radius:4,sides:6,rotation:0}).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" />`:l.shape==="star"&&(g=`<polygon stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" fill="${l.color}" points="${d.createStar({plot:{x:10,y:8},radius:4})}" />`),t=`<svg viewBox="0 0 20 12" height="14" width="20"><rect rx="3" x="0" y="6" stroke="none" height="4" width="20" fill="${l.color}" />${g}</svg>`;break;case"plot":if(!l.shape||!["star","triangle","square","diamond","pentagon","hexagon"].includes(l.shape)){t=`<svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" fill="${l.color}" /></svg>`;break}if(l.shape==="star"){t=`<svg viewBox="0 0 12 12" height="14" width="14"><polygon stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" fill="${l.color}" points="${d.createStar({plot:{x:6,y:6},radius:5})}" /></svg>`;break}if(l.shape==="triangle"){t=`<svg viewBox="0 0 12 12" height="14" width="14"><path d="${d.createPolygonPath({plot:{x:6,y:6},radius:6,sides:3,rotation:.52}).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;break}if(l.shape==="square"){t=`<svg viewBox="0 0 12 12" height="14" width="14"><path d="${d.createPolygonPath({plot:{x:6,y:6},radius:6,sides:4,rotation:.8}).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;break}if(l.shape==="diamond"){t=`<svg viewBox="0 0 12 12" height="14" width="14"><path d="${d.createPolygonPath({plot:{x:6,y:6},radius:5,sides:4,rotation:0}).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;break}if(l.shape==="pentagon"){t=`<svg viewBox="0 0 12 12" height="14" width="14"><path d="${d.createPolygonPath({plot:{x:6,y:6},radius:5,sides:5,rotation:.95}).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;break}if(l.shape==="hexagon"){t=`<svg viewBox="0 0 12 12" height="14" width="14"><path d="${d.createPolygonPath({plot:{x:6,y:6},radius:5,sides:6,rotation:0}).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;break}}r+=`<div style="display:flex;flex-direction:row; align-items:center;gap:3px;"><div style="width:20px">${t}</div> ${l.name}: <b>${this.FINAL_CONFIG.chart.tooltip.showValue?this.dataLabel({p:this.FINAL_CONFIG.chart.labels.prefix,v:l.value,s:this.FINAL_CONFIG.chart.labels.suffix,r:this.FINAL_CONFIG.chart.tooltip.roundingValue}):""}</b> ${this.FINAL_CONFIG.chart.tooltip.showPercentage?`(${this.checkNaN(Math.abs(l.value)/o*100).toFixed(this.FINAL_CONFIG.chart.tooltip.roundingPercentage)}%)`:""}</div>`,this.FINAL_CONFIG.chart.comments.showInTooltip&&l.comments.length&&l.comments.slice(this.slicer.start,this.slicer.end)[this.selectedSerieIndex]&&(r+=`<div class="vue-data-ui-tooltip-comment" style="background:${l.color}20; padding: 6px; margin-bottom: 6px; border-left: 1px solid ${l.color}">${l.comments.slice(this.slicer.start,this.slicer.end)[this.selectedSerieIndex]}</div>`)}}),`<div style="border-radius:4px;padding:12px;font-variant-numeric: tabular-nums;color:${this.FINAL_CONFIG.chart.tooltip.color}">${r}</div>`)},svg(){return{height:this.height,width:this.width}},yLabels(){return this.niceScale.ticks.map(r=>({y:r>=0?this.zero-this.drawingArea.height*this.ratioToMax(r):this.zero+this.drawingArea.height*this.ratioToMax(Math.abs(r)),value:r}))},zero(){return this.drawingArea.bottom-this.drawingArea.height*this.ratioToMax(this.relativeZero)}},mounted(){if(this.objectIsEmpty(this.dataset)?this.error({componentName:"VueUiXy",type:"dataset"}):this.dataset.forEach((r,o)=>{[null,void 0].includes(r.name)&&this.error({componentName:"VueUiXy",type:"datasetSerieAttribute",property:"name (string)",index:o})}),this.FINAL_CONFIG.showWarnings&&this.dataset.forEach(r=>{r.series.forEach((o,n)=>{this.isSafeValue(o)||console.warn(`SmartXY has detected an unsafe value in your dataset:
|
|
2
2
|
-----> The serie '${r.name}' contains the value '${o}' at index ${n}.
|
|
3
3
|
'${o}' was converted to null to allow the chart to display.`)})}),document.addEventListener("mousemove",r=>{this.clientPosition={x:r.clientX,y:r.clientY}}),this.mutableConfig={dataLabels:{show:!0},showTooltip:this.FINAL_CONFIG.chart.tooltip.show===!0,showTable:this.FINAL_CONFIG.showTable===!0,isStacked:this.FINAL_CONFIG.chart.grid.labels.yAxis.stacked,useIndividualScale:this.FINAL_CONFIG.chart.grid.labels.yAxis.useIndividualScale},this.FINAL_CONFIG.responsive){const o=this.$refs.chart.parentNode,{height:n,width:m}=o.getBoundingClientRect();let l=null,t=0;this.FINAL_CONFIG.chart.title.show&&(l=this.$refs.chartTitle,t=l.getBoundingClientRect().height);let g=null,I=0;this.FINAL_CONFIG.chart.zoom.show&&this.maxX>6&&this.isDataset&&(g=this.$refs.chartSlicer.$el,I=g.getBoundingClientRect().height);let u=null,f=0;this.FINAL_CONFIG.chart.legend.show&&(u=this.$refs.chartLegend,f=u.getBoundingClientRect().height),this.height=n-t-f-I,this.width=m,this.viewBox=`0 0 ${this.width<0?10:this.width} ${this.height<0?10:this.height}`,this.convertSizes(),new ResizeObserver(_=>{for(const y of _)l&&(t=l.getBoundingClientRect().height),g&&(I=g.getBoundingClientRect().height),u&&(f=u.getBoundingClientRect().height),this.height=y.contentBoxSize[0].blockSize-t-f-I-24,this.width=y.contentBoxSize[0].inlineSize,this.viewBox=`0 0 ${this.width<0?10:this.width} ${this.height<0?10:this.height}`,this.convertSizes()}).observe(o)}else this.height=this.FINAL_CONFIG.chart.height,this.width=this.FINAL_CONFIG.chart.width,this.viewBox=`0 0 ${this.width} ${this.height}`,this.fontSizes.dataLabels=this.FINAL_CONFIG.chart.grid.labels.fontSize,this.fontSizes.yAxis=this.FINAL_CONFIG.chart.grid.labels.axis.fontSize,this.fontSizes.xAxis=this.FINAL_CONFIG.chart.grid.labels.xAxisLabels.fontSize,this.fontSizes.plotLabels=this.FINAL_CONFIG.chart.labels.fontSize,this.plotRadii.plot=this.FINAL_CONFIG.plot.radius,this.plotRadii.line=this.FINAL_CONFIG.line.radius},methods:{abbreviate:d.abbreviate,assignStackRatios:d.assignStackRatios,calculateNiceScale:d.calculateNiceScale,checkNaN:d.checkNaN,createSmoothPath:d.createSmoothPath,isSafeValue:d.isSafeValue,treeShake:d.treeShake,shiftHue:d.shiftHue,pdf:p.pdf,img:O.saveAsImage,convertColorToHex:d.convertColorToHex,convertConfigColors:d.convertConfigColors,convertCustomPalette:d.convertCustomPalette,downloadCsv:d.downloadCsv,createCsvContent:d.createCsvContent,adaptColorToBackground:d.adaptColorToBackground,calcLinearProgression:d.calcLinearProgression,useMouse:G.useMouse,closestDecimal:d.closestDecimal,dataLabel:d.dataLabel,isFunction:d.isFunction,functionReturnsString:d.functionReturnsString,error:d.error,objectIsEmpty:d.objectIsEmpty,createTSpans:d.createTSpans,useNestedProp:B.useNestedProp,translateSize:d.translateSize,convertSizes(){this.fontSizes.dataLabels=this.translateSize({relator:this.height,adjuster:400,source:this.FINAL_CONFIG.chart.grid.labels.fontSize,threshold:10,fallback:10}),this.fontSizes.yAxis=this.translateSize({relator:this.width,adjuster:1e3,source:this.FINAL_CONFIG.chart.grid.labels.axis.fontSize,threshold:10,fallback:10}),this.fontSizes.xAxis=this.translateSize({relator:this.width,adjuster:1e3,source:this.FINAL_CONFIG.chart.grid.labels.xAxisLabels.fontSize,threshold:10,fallback:10}),this.fontSizes.plotLabels=this.translateSize({relator:this.width,adjuster:800,source:this.FINAL_CONFIG.chart.labels.fontSize,threshold:10,fallback:10}),this.plotRadii.plot=this.translateSize({relator:this.width,adjuster:800,source:this.FINAL_CONFIG.plot.radius,threshold:1,fallback:1}),this.plotRadii.line=this.translateSize({relator:this.width,adjuster:800,source:this.FINAL_CONFIG.line.radius,threshold:1,fallback:1})},toggleStack(){this.mutableConfig.isStacked=!this.mutableConfig.isStacked,this.mutableConfig.isStacked?this.mutableConfig.useIndividualScale=!0:this.mutableConfig.useIndividualScale=this.FINAL_CONFIG.chart.grid.labels.yAxis.useIndividualScale},toggleTable(){this.mutableConfig.showTable=!this.mutableConfig.showTable},toggleLabels(){this.mutableConfig.dataLabels.show=!this.mutableConfig.dataLabels.show},toggleTooltip(){this.mutableConfig.showTooltip=!this.mutableConfig.showTooltip},checkAutoScaleError(r){r.autoScaling&&(this.FINAL_CONFIG.chart.grid.labels.yAxis.useIndividualScale||console.warn(`VueUiXy (datapoint: ${r.name}) : autoScaling only works when config.chart.grid.labels.yAxis.useIndividualScale is set to true`),this.FINAL_CONFIG.chart.grid.labels.yAxis.stacked||console.warn(`VueUiXy (datapoint: ${r.name}) : autoScaling only works when config.chart.grid.labels.yAxis.stacked is set to true`))},createArea(r){if(!r[0])return[-10,-10,"",-10,-10];const o={x:r[0].x,y:this.zero},n={x:r.at(-1).x,y:this.zero},m=[];return r.forEach(l=>{m.push(`${l.x},${l.y} `)}),[o.x,o.y,...m,n.x,n.y].toString()},createIndividualArea(r,o){if(!r[0])return[-10,-10,"",-10,-10];const n={x:r[0]?r[0].x:Math.min(...r.filter(t=>!!t).map(t=>t.x)),y:o},m={x:r.at(-1)?r.at(-1).x:Math.min(...r.filter(t=>!!t).map(t=>t.x)),y:o},l=[];return r.filter(t=>!!t).forEach(t=>{l.push(`${t.x},${t.y} `)}),[n.x,n.y,...l,m.x,m.y].toString()},createStar:d.createStar,createPolygonPath:d.createPolygonPath,fillArray(r,o){let n=Array(r).fill(0);for(let m=0;m<o.length&&m<r;m+=1)n[m]=o[m];return n},refreshSlicer(){this.slicer={start:0,end:Math.max(...this.dataset.map(r=>r.series.length))},this.slicerStep+=1},calcRectHeight(r){return r.value>=0?this.zero-r.y<=0?1e-5:this.zero-r.y:r.y-this.zero<=0?1e-5:r.y-this.zero},calcIndividualHeight(r){return r.value>=0?r.zeroPosition-r.y<=0?1e-5:r.zeroPosition-r.y:r.y-r.zeroPosition<=0?1e-5:r.zeroPosition-r.y},calcRectWidth(){return this.mutableConfig.useIndividualScale&&this.mutableConfig.isStacked?this.slot.line-this.drawingArea.width/this.maxSeries*.1:this.slot.bar},calcRectX(r){return this.mutableConfig.useIndividualScale&&this.mutableConfig.isStacked?r.x+this.drawingArea.width/this.maxSeries*.05:r.x+this.slot.bar/2},calcRectY(r){return r.value>=0?r.y:this.zero},calcIndividualRectY(r){return r.value>=0?r.y:r.zeroPosition},canShowValue(r){return![null,void 0,NaN].includes(r)},findClosestValue(r,o){let n=o[0],m=Math.abs(r-o[0]);for(let l=1;l<o.length;l+=1){const t=Math.abs(r-o[l]);t<m&&o[l]<r&&(n=o[l],m=t)}return n},ratioToMax(r){return r/this.absoluteMax},selectX(r){this.$emit("selectX",{dataset:this.relativeDataset.map(o=>({name:o.name,value:[null,void 0,NaN].includes(o.absoluteValues[r])?null:o.absoluteValues[r],color:o.color,type:o.type})),index:r,indexLabel:this.FINAL_CONFIG.chart.grid.labels.xAxisLabels.values[r]})},getData(){return this.absoluteDataset.map(r=>({values:r.absoluteValues,color:r.color,name:r.name,type:r.type}))},segregate(r){if(this.segregatedSeries.includes(r.id))this.segregatedSeries=this.segregatedSeries.filter(o=>o!==r.id);else{if(this.segregatedSeries.length+1===this.safeDataset.length)return;this.segregatedSeries.push(r.id)}this.$emit("selectLegend",this.relativeDataset.map(o=>({name:o.name,values:o.absoluteValues,color:o.color,type:o.type}))),this.segregateStep+=1},toggleTooltipVisibility(r,o=null){this.isTooltip=r,r?this.selectedSerieIndex=o:this.selectedSerieIndex=null},toggleFullscreen(r){this.isFullscreen=r,this.step+=1},showSpinnerPdf(){this.isPrinting=!0},generatePdf(){this.showSpinnerPdf(),clearTimeout(this.__to__),this.__to__=setTimeout(()=>{this.pdf({domElement:document.getElementById(`vue-ui-xy_${this.uniqueId}`),fileName:this.FINAL_CONFIG.chart.title.text||"vue-ui-xy"}).finally(()=>{this.isPrinting=!1})},100)},generateCsv(){const r=[[this.FINAL_CONFIG.chart.title.text],[this.FINAL_CONFIG.chart.title.subtitle.text],[""]],o=["",...this.table.head.map(t=>t.label)],n=this.table.body,m=r.concat([o]).concat(n),l=this.createCsvContent(m);this.downloadCsv({csvContent:l,title:this.FINAL_CONFIG.chart.title.text||"vue-ui-xy"})},showSpinnerImage(){this.isImaging=!0},generateImage(){this.showSpinnerImage(),clearTimeout(this.__to__),this.__to__=setTimeout(()=>{this.img({domElement:document.getElementById(`vue-ui-xy_${this.uniqueId}`),fileName:this.FINAL_CONFIG.chart.title.text||"vue-ui-xy",format:"png"}).finally(()=>{this.isImaging=!1})},100)}}},W=["id"],X=["viewBox"],U={key:0},Z={class:"vue-ui-xy-grid"},J=["stroke","x1","x2","y1","y2"],K=["stroke","x1","x2","y1","y2"],Q={key:1},j=["x1","x2","y1","y2","stroke"],$=["x1","x2","y1","y2","stroke"],ee=["x1","x2","y1","y2","stroke"],te={key:3},le=["x1","x2","y1","y2","stroke"],re=["id"],ae=["stop-color"],ie=["stop-color"],oe=["stop-color"],se=["id"],ne=["stop-color"],ce=["stop-color"],he=["stop-color"],de=["id"],ue=["stop-color"],me=["stop-color"],ge=["id"],Ne=["stop-color"],fe=["stop-color"],ke=["id"],be=["stop-color"],Ie=["stop-color"],Fe=["x","y","height","width","rx","fill","stroke","stroke-width"],_e=["width","x","y"],ye={key:0},xe=["id"],Ce=["fill"],Se=["x1","x2","y1","y2","stroke","marker-end"],Ae=["x","y","font-size","fill"],Le=["stroke","x1","x2","y1","y2"],we=["width","x","y"],ve={style:{width:"100%"}},Oe={key:0},Ge=["id"],Be=["fill"],pe=["x1","x2","y1","y2","stroke","marker-end"],Ee=["x","y","font-size","fill"],ze=["d","stroke","stroke-width","stroke-dasharray"],Ve={key:1},Pe=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Te={key:0},Me=["d","fill"],Re=["d","fill"],De=["d","stroke","stroke-width","stroke-dasharray"],He={key:2},Ye=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],qe=["width","x","y"],We={style:{width:"100%"}},Xe={key:3},Ue=["id"],Ze=["fill"],Je=["x1","x2","y1","y2","stroke","marker-end"],Ke=["x","y","font-size","fill"],Qe={key:2},je=["x","y","font-size","fill"],$e=["x","y","font-size","fill","font-weight"],et={key:3},tt=["x","y","font-size","fill"],lt=["x","y"],rt=["x","y"],at={key:4},it=["x","y","font-size","fill"],ot=["x","y"],st=["x","y"],nt={key:5},ct=["x","y","height","width","fill"],ht=["x","y","width"],dt=["y","width","height","fill"],ut=["x","y","width","height","fill"],mt=["x","y","font-size","fill","innerHTML"],gt=["x","y","font-size","fill","innerHTML"],Nt=["x","y","font-size","fill","innerHTML"],ft=["x","y","font-size","fill","innerHTML"],kt={key:6},bt=["x1","x2","y1","y2","stroke","stroke-width"],It=["fill","font-size","transform"],Ft=["x1","x2","y1","y2","stroke"],_t=["x","y","font-size","fill"],yt=["x1","x2","y1","y2","stroke"],xt=["x","y","font-size","fill"],Ct=["x","y","width","height","fill","onMouseenter"],St=["font-size","fill","transform"],At=["x","y","font-size","fill"],Lt={key:8},wt=["text-anchor","font-size","fill","transform"],vt=["x","y","height","width","fill","onMouseenter","onClick"],Ot={key:9},Gt=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Bt={key:10},pt=["x","y"],Et=["cx","cy","r","fill"],zt={key:3,class:"vue-data-ui-watermark"},Vt=["onClick"],Pt={key:0,viewBox:"0 0 20 12",height:"14",width:"20"},Tt=["fill"],Mt={key:1,viewBox:"0 0 12 12",height:"14",width:"14"},Rt=["fill"],Dt={key:7,ref:"chartLegend"},Ht={style:{display:"flex","flex-direction":"row",gap:"6px","align-items":"center","padding-left":"6px"},"data-html2canvas-ignore":""},Yt=["innerHTML"];function qt(r,o,n,m,l,t){const g=e.resolveComponent("Title"),I=e.resolveComponent("UserOptions"),u=e.resolveComponent("Shape"),f=e.resolveComponent("Skeleton"),S=e.resolveComponent("Slicer"),_=e.resolveComponent("Tooltip"),y=e.resolveComponent("BaseIcon"),C=e.resolveComponent("TableSparkline"),N=e.resolveComponent("DataTable"),F=e.resolveComponent("Accordion");return e.openBlock(),e.createElementBlock("div",{id:`vue-ui-xy_${l.uniqueId}`,class:e.normalizeClass(`vue-ui-xy ${l.isFullscreen?"vue-data-ui-wrapper-fullscreen":""} ${t.FINAL_CONFIG.useCssAnimation?"":"vue-ui-dna"}`),ref:"chart",style:e.normalizeStyle(`background:${t.FINAL_CONFIG.chart.backgroundColor}; color:${t.FINAL_CONFIG.chart.color};width:100%;${t.FINAL_CONFIG.chart.title.text?"":"padding-top:36px"};font-family:${t.FINAL_CONFIG.chart.fontFamily};${t.FINAL_CONFIG.responsive?"height: 100%":""}`)},[t.FINAL_CONFIG.chart.title.show?(e.openBlock(),e.createElementBlock("div",{key:0,ref:"chartTitle",class:"vue-ui-xy-title",style:e.normalizeStyle(`font-family:${t.FINAL_CONFIG.chart.fontFamily}`)},[e.createVNode(g,{config:{title:{cy:"xy-div-title",...t.FINAL_CONFIG.chart.title},subtitle:{cy:"xy-div-subtitle",...t.FINAL_CONFIG.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.FINAL_CONFIG.chart.userOptions.show&&t.isDataset?(e.openBlock(),e.createBlock(I,{ref:"defails",key:`user_options_${l.step}`,backgroundColor:t.FINAL_CONFIG.chart.backgroundColor,color:t.FINAL_CONFIG.chart.color,isPrinting:l.isPrinting,isImaging:l.isImaging,uid:l.uniqueId,hasTooltip:t.FINAL_CONFIG.chart.userOptions.buttons.tooltip&&t.FINAL_CONFIG.chart.tooltip.show,hasPdf:t.FINAL_CONFIG.chart.userOptions.buttons.pdf,hasXls:t.FINAL_CONFIG.chart.userOptions.buttons.csv,hasImg:t.FINAL_CONFIG.chart.userOptions.buttons.img,hasLabel:t.FINAL_CONFIG.chart.userOptions.buttons.labels,hasTable:t.FINAL_CONFIG.chart.userOptions.buttons.table,hasStack:n.dataset.length>1&&t.FINAL_CONFIG.chart.userOptions.buttons.stack,hasFullscreen:t.FINAL_CONFIG.chart.userOptions.buttons.fullscreen,isStacked:l.mutableConfig.isStacked,isFullscreen:l.isFullscreen,chartElement:r.$refs.chart,isTooltip:l.mutableConfig.showTooltip,titles:{...t.FINAL_CONFIG.chart.userOptions.buttonTitles},onToggleFullscreen:t.toggleFullscreen,onGeneratePdf:t.generatePdf,onGenerateCsv:t.generateCsv,onGenerateImage:t.generateImage,onToggleTable:t.toggleTable,onToggleLabels:t.toggleLabels,onToggleStack:t.toggleStack,onToggleTooltip:t.toggleTooltip},e.createSlots({_:2},[r.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,r.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,r.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,r.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,r.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,r.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,r.$slots.optionStack?{name:"optionStack",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"optionStack",{},void 0,!0)]),key:"6"}:void 0,r.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:s})=>[e.renderSlot(r.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:s})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasLabel","hasTable","hasStack","hasFullscreen","isStacked","isFullscreen","chartElement","isTooltip","titles","onToggleFullscreen","onGeneratePdf","onGenerateCsv","onGenerateImage","onToggleTable","onToggleLabels","onToggleStack","onToggleTooltip"])):e.createCommentVNode("",!0),t.isDataset?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([{"vue-data-ui-fullscreen--on":l.isFullscreen,"vue-data-ui-fulscreen--off":!l.isFullscreen},"vue-ui-xy-svg"]),width:"100%",viewBox:l.viewBox,style:e.normalizeStyle(`background:${t.FINAL_CONFIG.chart.backgroundColor}; color:${t.FINAL_CONFIG.chart.color}; font-family:${t.FINAL_CONFIG.chart.fontFamily}`)},[t.maxSeries>0?(e.openBlock(),e.createElementBlock("g",U,[e.createElementVNode("g",Z,[t.FINAL_CONFIG.chart.grid.labels.xAxis.showBaseline?(e.openBlock(),e.createElementBlock("line",{key:0,stroke:t.FINAL_CONFIG.chart.grid.stroke,"stroke-width":"1",x1:t.drawingArea.left,x2:t.drawingArea.right,y1:t.drawingArea.bottom,y2:t.drawingArea.bottom,"stroke-linecap":"round"},null,8,J)):e.createCommentVNode("",!0),l.mutableConfig.useIndividualScale?t.FINAL_CONFIG.chart.grid.showHorizontalLines?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(t.allScales,a=>(e.openBlock(),e.createElementBlock("g",null,[a.id===l.selectedScale&&a.yLabels.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(a.yLabels,s=>(e.openBlock(),e.createElementBlock("line",{x1:t.drawingArea.left,x2:t.drawingArea.right,y1:s.y,y2:s.y,stroke:a.color,"stroke-width":.5,"stroke-linecap":"round"},null,8,$))),256)):a.yLabels.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(a.yLabels,s=>(e.openBlock(),e.createElementBlock("line",{x1:t.drawingArea.left,x2:t.drawingArea.right,y1:s.y,y2:s.y,stroke:t.FINAL_CONFIG.chart.grid.stroke,"stroke-width":.5,"stroke-linecap":"round"},null,8,ee))),256)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.FINAL_CONFIG.chart.grid.labels.yAxis.showBaseline?(e.openBlock(),e.createElementBlock("line",{key:0,stroke:t.FINAL_CONFIG.chart.grid.stroke,"stroke-width":"1",x1:t.drawingArea.left,x2:t.drawingArea.left,y1:t.drawingArea.top,y2:t.drawingArea.bottom,"stroke-linecap":"round"},null,8,K)):e.createCommentVNode("",!0),t.FINAL_CONFIG.chart.grid.showHorizontalLines?(e.openBlock(),e.createElementBlock("g",Q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.yLabels,a=>(e.openBlock(),e.createElementBlock("line",{x1:t.drawingArea.left,x2:t.drawingArea.right,y1:a.y,y2:a.y,stroke:t.FINAL_CONFIG.chart.grid.stroke,"stroke-width":.5,"stroke-linecap":"round"},null,8,j))),256))])):e.createCommentVNode("",!0)],64)),t.FINAL_CONFIG.chart.grid.showVerticalLines?(e.openBlock(),e.createElementBlock("g",te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.maxSeries+1,(a,s)=>(e.openBlock(),e.createElementBlock("line",{key:`grid_vertical_line_${s}`,x1:t.drawingArea.width/t.maxSeries*s+t.drawingArea.left,x2:t.drawingArea.width/t.maxSeries*s+t.drawingArea.left,y1:t.drawingArea.top,y2:t.drawingArea.bottom,"stroke-width":"0.5",stroke:t.FINAL_CONFIG.chart.grid.stroke},null,8,le))),128))])):e.createCommentVNode("",!0)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.barSet,(a,s)=>(e.openBlock(),e.createElementBlock("defs",{key:`def_rect_${s}`},[e.createElementVNode("linearGradient",{id:`rectGradient_pos_${s}_${l.uniqueId}`,x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,ae),e.createElementVNode("stop",{offset:"62%","stop-color":`${t.shiftHue(a.color,.02)}DE`},null,8,ie),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.shiftHue(a.color,.05)}66`},null,8,oe)],8,re),e.createElementVNode("linearGradient",{id:`rectGradient_neg_${s}_${l.uniqueId}`,x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${t.shiftHue(a.color,.05)}66`},null,8,ne),e.createElementVNode("stop",{offset:"38%","stop-color":`${t.shiftHue(a.color,.02)}DE`},null,8,ce),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,he)],8,se)]))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.plotSet,(a,s)=>(e.openBlock(),e.createElementBlock("defs",{key:`def_plot_${s}`},[e.createElementVNode("radialGradient",{id:`plotGradient_${s}_${l.uniqueId}`,cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${t.shiftHue(a.color,.05)}`},null,8,ue),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,me)],8,de)]))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.lineSet,(a,s)=>(e.openBlock(),e.createElementBlock("defs",{key:`def_line_${s}`},[e.createElementVNode("radialGradient",{id:`lineGradient_${s}_${l.uniqueId}`,cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${t.shiftHue(a.color,.05)}`},null,8,Ne),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,fe)],8,ge),e.createElementVNode("linearGradient",{id:`areaGradient_${s}_${l.uniqueId}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${t.shiftHue(a.color,.03)}${l.opacity[t.FINAL_CONFIG.line.area.opacity]}`},null,8,be),e.createElementVNode("stop",{offset:"100%","stop-color":`${a.color}${l.opacity[t.FINAL_CONFIG.line.area.opacity]}`},null,8,Ie)],8,ke)]))),128)),t.barSet.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.barSet,(a,s)=>(e.openBlock(),e.createElementBlock("g",{key:`serie_bar_${s}`,class:e.normalizeClass(`serie_bar_${s}`),style:e.normalizeStyle(`opacity:${l.selectedScale?l.selectedScale===a.id?1:.2:1};transition:opacity 0.2s ease-in-out`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(i,h)=>(e.openBlock(),e.createElementBlock("g",{key:`bar_plot_${s}_${h}`},[t.canShowValue(i.value)?(e.openBlock(),e.createElementBlock("rect",{key:0,x:t.calcRectX(i),y:l.mutableConfig.useIndividualScale?t.calcIndividualRectY(i):t.calcRectY(i),height:l.mutableConfig.useIndividualScale?Math.abs(t.calcIndividualHeight(i)):Math.abs(t.calcRectHeight(i)),width:t.calcRectWidth()-(l.mutableConfig.useIndividualScale&&l.mutableConfig.isStacked?0:t.barPeriodGap)<0?1e-5:t.calcRectWidth()-(l.mutableConfig.useIndividualScale&&l.mutableConfig.isStacked?0:t.barPeriodGap),rx:t.FINAL_CONFIG.bar.borderRadius,fill:t.FINAL_CONFIG.bar.useGradient?i.value>=0?`url(#rectGradient_pos_${s}_${l.uniqueId})`:`url(#rectGradient_neg_${s}_${l.uniqueId})`:a.color,stroke:t.FINAL_CONFIG.bar.border.useSerieColor?a.color:t.FINAL_CONFIG.bar.border.stroke,"stroke-width":t.FINAL_CONFIG.bar.border.strokeWidth},null,8,Fe)):e.createCommentVNode("",!0),i.comment&&t.FINAL_CONFIG.chart.comments.show?(e.openBlock(),e.createElementBlock("foreignObject",{key:1,style:{overflow:"visible"},height:"12",width:(t.calcRectWidth()-(l.mutableConfig.useIndividualScale&&l.mutableConfig.isStacked?0:t.barPeriodGap)<0?1e-5:t.calcRectWidth()-(l.mutableConfig.useIndividualScale&&l.mutableConfig.isStacked?0:t.barPeriodGap)/2)+t.FINAL_CONFIG.chart.comments.width,x:t.calcRectX(i)-t.FINAL_CONFIG.chart.comments.width/2+t.FINAL_CONFIG.chart.comments.offsetX,y:i.y+t.FINAL_CONFIG.chart.comments.offsetY+6},[e.renderSlot(r.$slots,"plot-comment",{plot:{...i,color:a.color}},void 0,!0)],8,_e)):e.createCommentVNode("",!0)]))),128)),Object.hasOwn(a,"useProgression")&&a.useProgression===!0&&!isNaN(t.calcLinearProgression(a.plots).trend)?(e.openBlock(),e.createElementBlock("g",ye,[e.createElementVNode("defs",null,[e.createElementVNode("marker",{id:`bar_arrow_${s}`,markerWidth:7,markerHeight:7,refX:"0",refY:7/2,orient:"auto"},[e.createElementVNode("polygon",{points:`0 0, 7 ${7/2}, 0 7`,fill:a.color},null,8,Ce)],8,xe)]),a.plots.length>1?(e.openBlock(),e.createElementBlock("line",{key:0,x1:t.calcLinearProgression(a.plots).x1,x2:t.calcLinearProgression(a.plots).x2,y1:t.calcLinearProgression(a.plots).y1,y2:t.calcLinearProgression(a.plots).y2,"stroke-width":1,stroke:a.color,"stroke-dasharray":2,"marker-end":`url(#bar_arrow_${s})`},null,8,Se)):e.createCommentVNode("",!0),a.plots.length>1?(e.openBlock(),e.createElementBlock("text",{key:1,"text-anchor":"middle",x:t.calcLinearProgression(a.plots).x2,y:t.calcLinearProgression(a.plots).y2-6,"font-size":l.fontSizes.plotLabels,fill:a.color},e.toDisplayString(t.dataLabel({v:t.calcLinearProgression(a.plots).trend*100,s:"%",r:2})),9,Ae)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],6))),128)):e.createCommentVNode("",!0),!l.mutableConfig.useIndividualScale&&t.FINAL_CONFIG.chart.grid.labels.zeroLine.show?(e.openBlock(),e.createElementBlock("line",{key:1,stroke:t.FINAL_CONFIG.chart.grid.stroke,"stroke-width":"1",x1:t.drawingArea.left,x2:t.drawingArea.right,y1:t.zero,y2:t.zero,"stroke-linecap":"round"},null,8,Le)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.plotSet,(a,s)=>(e.openBlock(),e.createElementBlock("g",{key:`serie_plot_${s}`,class:e.normalizeClass(`serie_plot_${s}`),style:e.normalizeStyle(`opacity:${l.selectedScale?l.selectedScale===a.id?1:.2:1};transition:opacity 0.2s ease-in-out`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(i,h)=>(e.openBlock(),e.createElementBlock("g",{key:`circle_plot_${s}_${h}`},[t.canShowValue(i.value)?(e.openBlock(),e.createBlock(u,{key:0,shape:["triangle","square","diamond","pentagon","hexagon","star"].includes(a.shape)?a.shape:"circle",color:t.FINAL_CONFIG.plot.useGradient?`url(#plotGradient_${s}_${l.uniqueId})`:a.color,plot:{x:i.x,y:i.y},radius:l.selectedSerieIndex!==null&&l.selectedSerieIndex===h?(l.plotRadii.plot||6)*1.5:l.plotRadii.plot||6,stroke:t.FINAL_CONFIG.chart.backgroundColor,strokeWidth:.5},null,8,["shape","color","plot","radius","stroke"])):e.createCommentVNode("",!0),i.comment&&t.FINAL_CONFIG.chart.comments.show?(e.openBlock(),e.createElementBlock("foreignObject",{key:1,style:{overflow:"visible"},height:"12",width:t.FINAL_CONFIG.chart.comments.width,x:i.x-t.FINAL_CONFIG.chart.comments.width/2+t.FINAL_CONFIG.chart.comments.offsetX,y:i.y+t.FINAL_CONFIG.chart.comments.offsetY+6},[e.createElementVNode("div",ve,[e.renderSlot(r.$slots,"plot-comment",{plot:{...i,color:a.color}},void 0,!0)])],8,we)):e.createCommentVNode("",!0)]))),128)),Object.hasOwn(a,"useProgression")&&a.useProgression===!0&&!isNaN(t.calcLinearProgression(a.plots).trend)?(e.openBlock(),e.createElementBlock("g",Oe,[e.createElementVNode("defs",null,[e.createElementVNode("marker",{id:`plot_arrow_${s}`,markerWidth:7,markerHeight:7,refX:"0",refY:7/2,orient:"auto"},[e.createElementVNode("polygon",{points:`0 0, 7 ${7/2}, 0 7`,fill:a.color},null,8,Be)],8,Ge)]),a.plots.length>1?(e.openBlock(),e.createElementBlock("line",{key:0,x1:t.calcLinearProgression(a.plots).x1,x2:t.calcLinearProgression(a.plots).x2,y1:t.calcLinearProgression(a.plots).y1,y2:t.calcLinearProgression(a.plots).y2,"stroke-width":1,stroke:a.color,"stroke-dasharray":2,"marker-end":`url(#plot_arrow_${s})`},null,8,pe)):e.createCommentVNode("",!0),a.plots.length>1?(e.openBlock(),e.createElementBlock("text",{key:1,"text-anchor":"middle",x:t.calcLinearProgression(a.plots).x2,y:t.calcLinearProgression(a.plots).y2-6,"font-size":l.fontSizes.plotLabels,fill:a.color},e.toDisplayString(t.dataLabel({v:t.calcLinearProgression(a.plots).trend*100,s:"%",r:2})),9,Ee)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],6))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.lineSet,(a,s)=>(e.openBlock(),e.createElementBlock("g",{key:`serie_line_${s}`,class:e.normalizeClass(`serie_line_${s}`),style:e.normalizeStyle(`opacity:${l.selectedScale?l.selectedScale===a.id?1:.2:1};transition:opacity 0.2s ease-in-out`)},[a.smooth&&a.plots.length>1?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M${a.curve}`,stroke:t.FINAL_CONFIG.chart.backgroundColor,"stroke-width":t.FINAL_CONFIG.line.strokeWidth+1,"stroke-dasharray":a.dashed?t.FINAL_CONFIG.line.strokeWidth*2:0,fill:"none"},null,8,ze)):a.plots.length>1?(e.openBlock(),e.createElementBlock("g",Ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(i,h)=>(e.openBlock(),e.createElementBlock("g",{key:`line_${s}_${h}`},[i&&h<a.plots.length-1&&a.plots[h+1]&&t.canShowValue(i.value)&&t.canShowValue(a.plots[h+1].value)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:i.x,x2:a.plots[h+1].x,y1:i.y,y2:a.plots[h+1].y,stroke:t.FINAL_CONFIG.chart.backgroundColor,"stroke-width":t.FINAL_CONFIG.line.strokeWidth+1,"stroke-dasharray":a.dashed?t.FINAL_CONFIG.line.strokeWidth*2:0,"stroke-linejoin":"round","stroke-linecap":"round"},null,8,Pe)):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0)],6))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.lineSet,(a,s)=>(e.openBlock(),e.createElementBlock("g",{key:`serie_line_${s}`,class:e.normalizeClass(`serie_line_${s}`),style:e.normalizeStyle(`opacity:${l.selectedScale?l.selectedScale===a.id?1:.2:1};transition:opacity 0.2s ease-in-out`)},[a.useArea&&a.plots.length>1?(e.openBlock(),e.createElementBlock("g",Te,[a.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${a.plots[0]?a.plots[0].x:Math.min(...a.plots.filter(i=>!!i).map(i=>i.x))},${l.mutableConfig.isStacked?t.drawingArea.bottom-a.yOffset:t.drawingArea.bottom} ${a.curve} L ${a.plots.at(-1)?a.plots.at(-1).x:t.drawingArea.left+t.slot.line*s+t.slot.line/2},${l.mutableConfig.isStacked?t.drawingArea.bottom-a.yOffset:t.drawingArea.bottom} Z`,fill:t.FINAL_CONFIG.line.area.useGradient?`url(#areaGradient_${s}_${l.uniqueId})`:`${a.color}${l.opacity[t.FINAL_CONFIG.line.area.opacity]}`},null,8,Me)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${a.area}Z`,fill:t.FINAL_CONFIG.line.area.useGradient?`url(#areaGradient_${s}_${l.uniqueId})`:`${a.color}${l.opacity[t.FINAL_CONFIG.line.area.opacity]}`},null,8,Re))])):e.createCommentVNode("",!0),a.smooth&&a.plots.length>1?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${a.curve}`,stroke:a.color,"stroke-width":t.FINAL_CONFIG.line.strokeWidth,"stroke-dasharray":a.dashed?t.FINAL_CONFIG.line.strokeWidth*2:0,fill:"none"},null,8,De)):a.plots.length>1?(e.openBlock(),e.createElementBlock("g",He,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(i,h)=>(e.openBlock(),e.createElementBlock("g",{key:`line_${s}_${h}`},[i&&h<a.plots.length-1&&a.plots[h+1]&&t.canShowValue(i.value)&&t.canShowValue(a.plots[h+1].value)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:i.x,x2:a.plots[h+1].x,y1:i.y,y2:a.plots[h+1].y,stroke:a.color,"stroke-width":t.FINAL_CONFIG.line.strokeWidth,"stroke-dasharray":a.dashed?t.FINAL_CONFIG.line.strokeWidth*2:0,"stroke-linejoin":"round","stroke-linecap":"round"},null,8,Ye)):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(i,h)=>(e.openBlock(),e.createElementBlock("g",{key:`circle_line_${s}_${h}`},[i&&t.canShowValue(i.value)?(e.openBlock(),e.createBlock(u,{key:0,shape:["triangle","square","diamond","pentagon","hexagon","star"].includes(a.shape)?a.shape:"circle",color:t.FINAL_CONFIG.line.useGradient?`url(#lineGradient_${s}_${l.uniqueId})`:a.color,plot:{x:i.x,y:i.y},radius:l.selectedSerieIndex!==null&&l.selectedSerieIndex===h?(l.plotRadii.line||6)*1.5:l.plotRadii.line,stroke:t.FINAL_CONFIG.chart.backgroundColor,strokeWidth:.5},null,8,["shape","color","plot","radius","stroke"])):e.createCommentVNode("",!0),i.comment&&t.FINAL_CONFIG.chart.comments.show?(e.openBlock(),e.createElementBlock("foreignObject",{key:1,style:{overflow:"visible"},height:"12",width:t.FINAL_CONFIG.chart.comments.width,x:i.x-t.FINAL_CONFIG.chart.comments.width/2+t.FINAL_CONFIG.chart.comments.offsetX,y:i.y+t.FINAL_CONFIG.chart.comments.offsetY+6},[e.createElementVNode("div",We,[e.renderSlot(r.$slots,"plot-comment",{plot:{...i,color:a.color}},void 0,!0)])],8,qe)):e.createCommentVNode("",!0)]))),128)),Object.hasOwn(a,"useProgression")&&a.useProgression===!0&&!isNaN(t.calcLinearProgression(a.plots).trend)?(e.openBlock(),e.createElementBlock("g",Xe,[e.createElementVNode("defs",null,[e.createElementVNode("marker",{id:`line_arrow_${s}`,markerWidth:7,markerHeight:7,refX:"0",refY:7/2,orient:"auto"},[e.createElementVNode("polygon",{points:`0 0, 7 ${7/2}, 0 7`,fill:a.color},null,8,Ze)],8,Ue)]),a.plots.length>1?(e.openBlock(),e.createElementBlock("line",{key:0,x1:t.calcLinearProgression(a.plots).x1,x2:t.calcLinearProgression(a.plots).x2,y1:t.calcLinearProgression(a.plots).y1,y2:t.calcLinearProgression(a.plots).y2,"stroke-width":1,stroke:a.color,"stroke-dasharray":2,"marker-end":`url(#line_arrow_${s})`},null,8,Je)):e.createCommentVNode("",!0),a.plots.length>1?(e.openBlock(),e.createElementBlock("text",{key:1,"text-anchor":"middle",x:t.calcLinearProgression(a.plots).x2,y:t.calcLinearProgression(a.plots).y2-6,"font-size":l.fontSizes.plotLabels,fill:a.color},e.toDisplayString(t.dataLabel({v:t.calcLinearProgression(a.plots).trend*100,s:"%",r:2})),9,Ke)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],6))),128)),(t.FINAL_CONFIG.bar.labels.show||t.FINAL_CONFIG.bar.serieName.show)&&l.mutableConfig.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Qe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.barSet,(a,s)=>(e.openBlock(),e.createElementBlock("g",{key:`xLabel_bar_${s}`,class:e.normalizeClass(`xLabel_bar_${s}`),style:e.normalizeStyle(`opacity:${l.selectedScale?l.selectedScale===a.id?1:.2:1};transition:opacity 0.2s ease-in-out`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(i,h)=>(e.openBlock(),e.createElementBlock("g",{key:`xLabel_bar_${s}_${h}`},[i&&(!Object.hasOwn(a,"dataLabels")||a.dataLabels===!0)&&t.FINAL_CONFIG.bar.labels.show?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.mutableConfig.useIndividualScale&&l.mutableConfig.isStacked?i.x+t.slot.line/2:t.calcRectX(i)+t.calcRectWidth()/2-t.barPeriodGap/2,y:i.y+(i.value>0?t.FINAL_CONFIG.bar.labels.offsetY:-t.FINAL_CONFIG.bar.labels.offsetY*3),"text-anchor":"middle","font-size":l.fontSizes.plotLabels,fill:t.FINAL_CONFIG.bar.labels.color},e.toDisplayString(t.canShowValue(i.value)?t.dataLabel({p:t.FINAL_CONFIG.chart.labels.prefix,v:i.value,s:t.FINAL_CONFIG.chart.labels.suffix,r:t.FINAL_CONFIG.bar.labels.rounding}):""),9,je)):e.createCommentVNode("",!0),i&&t.FINAL_CONFIG.bar.serieName.show?(e.openBlock(),e.createElementBlock("text",{key:1,x:l.mutableConfig.useIndividualScale&&l.mutableConfig.isStacked?i.x+t.slot.line/2:i.x+t.calcRectWidth()*1.1,y:i.y+(i.value>0?t.FINAL_CONFIG.bar.serieName.offsetY:-t.FINAL_CONFIG.bar.serieName.offsetY*3),"text-anchor":"middle","font-size":l.fontSizes.plotLabels,fill:t.FINAL_CONFIG.bar.serieName.useSerieColor?a.color:t.FINAL_CONFIG.bar.serieName.color,"font-weight":t.FINAL_CONFIG.bar.serieName.bold?"bold":"normal"},e.toDisplayString(t.FINAL_CONFIG.bar.serieName.useAbbreviation?t.abbreviate({source:a.name,length:t.FINAL_CONFIG.bar.serieName.abbreviationSize}):a.name),9,$e)):e.createCommentVNode("",!0)]))),128))],6))),128))])):e.createCommentVNode("",!0),t.FINAL_CONFIG.plot.labels.show&&l.mutableConfig.dataLabels.show?(e.openBlock(),e.createElementBlock("g",et,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.plotSet,(a,s)=>(e.openBlock(),e.createElementBlock("g",{key:`xLabel_plot_${s}`,class:e.normalizeClass(`xLabel_plot_${s}`),style:e.normalizeStyle(`opacity:${l.selectedScale?l.selectedScale===a.id?1:.2:1};transition:opacity 0.2s ease-in-out`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(i,h)=>(e.openBlock(),e.createElementBlock("g",{key:`xLabel_plot_${s}_${h}`},[i&&!Object.hasOwn(a,"dataLabels")||a.dataLabels===!0?(e.openBlock(),e.createElementBlock("text",{key:0,x:i.x,y:i.y+t.FINAL_CONFIG.plot.labels.offsetY,"text-anchor":"middle","font-size":l.fontSizes.plotLabels,fill:t.FINAL_CONFIG.plot.labels.color},e.toDisplayString(t.canShowValue(i.value)?t.dataLabel({p:t.FINAL_CONFIG.chart.labels.prefix,v:i.value,s:t.FINAL_CONFIG.chart.labels.suffix,r:t.FINAL_CONFIG.plot.labels.rounding}):""),9,tt)):e.createCommentVNode("",!0),i&&h===0&&a.useTag&&a.useTag==="start"?(e.openBlock(),e.createElementBlock("foreignObject",{key:1,x:i.x,y:i.y-20,height:24,width:"150",style:{overflow:"visible"}},[e.createElementVNode("div",{style:e.normalizeStyle(`padding: 3px; background:${a.color}${l.opacity[80]};color:${t.adaptColorToBackground(a.color)};width:fit-content;font-size:${l.fontSizes.plotLabels}px;border-radius: 2px;`)},e.toDisplayString(a.name),5)],8,lt)):e.createCommentVNode("",!0),i&&h===a.plots.length-1&&a.useTag&&a.useTag==="end"?(e.openBlock(),e.createElementBlock("foreignObject",{key:2,x:i.x-a.name.length*(l.fontSizes.plotLabels/2),y:i.y-20,height:24,width:"150",style:{overflow:"visible"}},[e.createElementVNode("div",{style:e.normalizeStyle(`padding: 3px; background:${a.color}${l.opacity[80]};color:${t.adaptColorToBackground(a.color)};width:fit-content;font-size:${l.fontSizes.plotLabels}px;border-radius: 2px;`)},e.toDisplayString(a.name),5)],8,rt)):e.createCommentVNode("",!0)]))),128))],6))),128))])):e.createCommentVNode("",!0),t.FINAL_CONFIG.line.labels.show&&l.mutableConfig.dataLabels.show?(e.openBlock(),e.createElementBlock("g",at,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.lineSet,(a,s)=>(e.openBlock(),e.createElementBlock("g",{key:`xLabel_line_${s}`,class:e.normalizeClass(`xLabel_line_${s}`),style:e.normalizeStyle(`opacity:${l.selectedScale?l.selectedScale===a.id?1:.2:1};transition:opacity 0.2s ease-in-out`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(i,h)=>(e.openBlock(),e.createElementBlock("g",{key:`xLabel_line_${s}_${h}`},[i&&!Object.hasOwn(a,"dataLabels")||a.dataLabels===!0?(e.openBlock(),e.createElementBlock("text",{key:0,x:i.x,y:i.y+(i.value>0?t.FINAL_CONFIG.line.labels.offsetY:-t.FINAL_CONFIG.line.labels.offsetY*3),"text-anchor":"middle","font-size":l.fontSizes.plotLabels,fill:t.FINAL_CONFIG.line.labels.color},e.toDisplayString(t.canShowValue(i.value)?t.dataLabel({p:t.FINAL_CONFIG.chart.labels.prefix,v:i.value,s:t.FINAL_CONFIG.chart.labels.suffix,r:t.FINAL_CONFIG.line.labels.rounding}):""),9,it)):e.createCommentVNode("",!0),i&&h===0&&a.useTag&&a.useTag==="start"?(e.openBlock(),e.createElementBlock("foreignObject",{key:1,x:i.x,y:i.y-20,height:24,width:"150",style:{overflow:"visible"}},[e.createElementVNode("div",{style:e.normalizeStyle(`padding: 3px; background:${a.color}${l.opacity[80]};color:${t.adaptColorToBackground(a.color)};width:fit-content;font-size:${l.fontSizes.plotLabels}px;border-radius: 2px;`)},e.toDisplayString(a.name),5)],8,ot)):e.createCommentVNode("",!0),i&&h===a.plots.length-1&&a.useTag&&a.useTag==="end"?(e.openBlock(),e.createElementBlock("foreignObject",{key:2,x:i.x-a.name.length*(l.fontSizes.plotLabels/2),y:i.y-20,height:24,width:"150",style:{overflow:"visible"}},[e.createElementVNode("div",{style:e.normalizeStyle(`padding: 3px; background:${a.color}${l.opacity[80]};color:${t.adaptColorToBackground(a.color)};width:fit-content;font-size:${l.fontSizes.plotLabels}px;border-radius: 2px;`)},e.toDisplayString(a.name),5)],8,st)):e.createCommentVNode("",!0)]))),128))],6))),128))])):e.createCommentVNode("",!0),t.hasHighlightArea?(e.openBlock(),e.createElementBlock("g",nt,[e.createElementVNode("rect",{x:t.drawingArea.left+t.drawingArea.width/t.maxSeries*(t.FINAL_CONFIG.chart.highlightArea.from-l.slicer.start),y:t.drawingArea.top,height:t.drawingArea.height<0?10:t.drawingArea.height,width:t.drawingArea.width/t.maxSeries*t.highlightAreaSpan<0?1e-5:t.drawingArea.width/t.maxSeries*t.highlightAreaSpan,fill:`${t.FINAL_CONFIG.chart.highlightArea.color}${l.opacity[t.FINAL_CONFIG.chart.highlightArea.opacity]}`},null,8,ct),t.FINAL_CONFIG.chart.highlightArea.caption.text?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:t.drawingArea.left+t.drawingArea.width/t.maxSeries*(t.FINAL_CONFIG.chart.highlightArea.from-l.slicer.start)-(t.FINAL_CONFIG.chart.highlightArea.caption.width==="auto"?0:t.FINAL_CONFIG.chart.highlightArea.caption.width/2-t.drawingArea.width/t.maxSeries*t.highlightAreaSpan/2),y:t.drawingArea.top+t.FINAL_CONFIG.chart.highlightArea.caption.offsetY,style:{overflow:"visible"},height:"1",width:t.FINAL_CONFIG.chart.highlightArea.caption.width==="auto"?t.drawingArea.width/t.maxSeries*t.highlightAreaSpan:t.FINAL_CONFIG.chart.highlightArea.caption.width},[e.createElementVNode("div",{style:e.normalizeStyle(`padding:${t.FINAL_CONFIG.chart.highlightArea.caption.padding}px;text-align:${t.FINAL_CONFIG.chart.highlightArea.caption.textAlign};font-size:${t.FINAL_CONFIG.chart.highlightArea.caption.fontSize}px;color:${t.FINAL_CONFIG.chart.highlightArea.caption.color};font-weight:${t.FINAL_CONFIG.chart.highlightArea.caption.bold?"bold":"normal"}`)},e.toDisplayString(t.FINAL_CONFIG.chart.highlightArea.caption.text),5)],8,ht)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("g",null,[e.createElementVNode("rect",{x:0,y:t.drawingArea.top,width:t.FINAL_CONFIG.chart.padding.left-1,height:t.drawingArea.height<0?10:t.drawingArea.height,fill:t.FINAL_CONFIG.chart.backgroundColor},null,8,dt),e.createElementVNode("rect",{x:t.drawingArea.right+1,y:t.drawingArea.top,width:t.FINAL_CONFIG.chart.padding.right,height:t.drawingArea.height<0?10:t.drawingArea.height,fill:t.FINAL_CONFIG.chart.backgroundColor},null,8,ut)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.lineSet,(a,s)=>(e.openBlock(),e.createElementBlock("g",{key:`xLabel_line_${s}`,class:e.normalizeClass(`xLabel_line_${s}`),style:e.normalizeStyle(`opacity:${l.selectedScale?l.selectedScale===a.id?1:.2:1};transition:opacity 0.2s ease-in-out`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(i,h)=>(e.openBlock(),e.createElementBlock("g",{key:`xLabel_line_${s}_${h}`},[i&&h===0&&a.showSerieName&&a.showSerieName==="start"?(e.openBlock(),e.createElementBlock("text",{key:0,x:i.x-l.fontSizes.plotLabels,y:i.y,"font-size":l.fontSizes.plotLabels,"text-anchor":"end",fill:a.color,innerHTML:t.createTSpans({content:a.name,fontSize:l.fontSizes.plotLabels,fill:a.color,x:i.x-l.fontSizes.plotLabels,y:i.y,maxWords:2})},null,8,mt)):e.createCommentVNode("",!0),i&&h===a.plots.length-1&&a.showSerieName&&a.showSerieName==="end"?(e.openBlock(),e.createElementBlock("text",{key:1,x:i.x+l.fontSizes.plotLabels,y:i.y,"font-size":l.fontSizes.plotLabels,"text-anchor":"start",fill:a.color,innerHTML:t.createTSpans({content:a.name,fontSize:l.fontSizes.plotLabels,fill:a.color,x:i.x+l.fontSizes.plotLabels,y:i.y,maxWords:2})},null,8,gt)):e.createCommentVNode("",!0)]))),128))],6))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.plotSet,(a,s)=>(e.openBlock(),e.createElementBlock("g",{key:`xLabel_plot_${s}`,class:e.normalizeClass(`xLabel_plot_${s}`),style:e.normalizeStyle(`opacity:${l.selectedScale?l.selectedScale===a.id?1:.2:1};transition:opacity 0.2s ease-in-out`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(i,h)=>(e.openBlock(),e.createElementBlock("g",{key:`xLabel_plot_${s}_${h}`},[i&&h===0&&a.showSerieName&&a.showSerieName==="start"?(e.openBlock(),e.createElementBlock("text",{key:0,x:i.x-l.fontSizes.plotLabels,y:i.y,"font-size":l.fontSizes.plotLabels,"text-anchor":"end",fill:a.color,innerHTML:t.createTSpans({content:a.name,fontSize:l.fontSizes.plotLabels,fill:a.color,x:i.x-l.fontSizes.plotLabels,y:i.y,maxWords:2})},null,8,Nt)):e.createCommentVNode("",!0),i&&h===a.plots.length-1&&a.showSerieName&&a.showSerieName==="end"?(e.openBlock(),e.createElementBlock("text",{key:1,x:i.x+l.fontSizes.plotLabels,y:i.y,"font-size":l.fontSizes.plotLabels,"text-anchor":"start",fill:a.color,innerHTML:t.createTSpans({content:a.name,fontSize:l.fontSizes.plotLabels,fill:a.color,x:i.x+l.fontSizes.plotLabels,y:i.y,maxWords:2})},null,8,ft)):e.createCommentVNode("",!0)]))),128))],6))),128)),t.FINAL_CONFIG.chart.grid.labels.show?(e.openBlock(),e.createElementBlock("g",kt,[l.mutableConfig.useIndividualScale?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.allScales,a=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("line",{x1:a.x,x2:a.x,y1:l.mutableConfig.isStacked?t.drawingArea.bottom-a.yOffset-a.individualHeight:t.drawingArea.top,y2:l.mutableConfig.isStacked?t.drawingArea.bottom-a.yOffset:t.drawingArea.bottom,stroke:a.color,"stroke-width":t.FINAL_CONFIG.chart.grid.stroke,"stroke-linecap":"round",style:e.normalizeStyle(`opacity:${l.selectedScale?l.selectedScale===a.id?1:.3:1};transition:opacity 0.2s ease-in-out`)},null,12,bt)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.allScales,a=>(e.openBlock(),e.createElementBlock("g",{style:e.normalizeStyle(`opacity:${l.selectedScale?l.selectedScale===a.id?1:.3:1};transition:opacity 0.2s ease-in-out`)},[e.createElementVNode("text",{fill:a.color,"font-size":l.fontSizes.dataLabels,"text-anchor":"middle",transform:`translate(${a.x-t.FINAL_CONFIG.chart.grid.labels.yAxis.labelWidth+5}, ${l.mutableConfig.isStacked?t.drawingArea.bottom-a.yOffset-a.individualHeight/2:t.drawingArea.top+t.drawingArea.height/2}) rotate(-90)`},e.toDisplayString(a.name)+" "+e.toDisplayString(a.scaleLabel?`- ${a.scaleLabel}`:""),9,It),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.yLabels,(s,i)=>(e.openBlock(),e.createElementBlock("line",{x1:a.x-3,x2:a.x,y1:s.y,y2:s.y,stroke:a.color,"stroke-width":1,"stroke-linecap":"round"},null,8,Ft))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.yLabels,(s,i)=>(e.openBlock(),e.createElementBlock("text",{x:a.x-5,y:s.y,"font-size":l.fontSizes.dataLabels,"text-anchor":"end",fill:a.color},e.toDisplayString(t.dataLabel({p:t.FINAL_CONFIG.chart.labels.prefix,v:s.value,s:t.FINAL_CONFIG.chart.labels.suffix,r:1})),9,_t))),256))],4))),256))],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.yLabels,(a,s)=>(e.openBlock(),e.createElementBlock("g",{key:`yLabel_${s}`},[t.canShowValue(a)&&a.value>=t.niceScale.min&&a.value<=t.niceScale.max?(e.openBlock(),e.createElementBlock("line",{key:0,x1:t.drawingArea.left,x2:t.drawingArea.left-5,y1:a.y,y2:a.y,stroke:t.FINAL_CONFIG.chart.grid.stroke,"stroke-width":"1","stroke-linecap":"round"},null,8,yt)):e.createCommentVNode("",!0),a.value>=t.niceScale.min&&a.value<=t.niceScale.max?(e.openBlock(),e.createElementBlock("text",{key:1,x:t.drawingArea.left-7,y:a.y+l.fontSizes.dataLabels/3,"font-size":l.fontSizes.dataLabels,"text-anchor":"end",fill:t.FINAL_CONFIG.chart.grid.labels.color},e.toDisplayString(t.canShowValue(a.value)?t.dataLabel({p:t.FINAL_CONFIG.chart.labels.prefix,v:a.value,s:t.FINAL_CONFIG.chart.labels.suffix,r:1}):""),9,xt)):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0),l.mutableConfig.useIndividualScale&&!l.mutableConfig.isStacked?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:7},e.renderList(t.allScales,a=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-t.FINAL_CONFIG.chart.grid.labels.yAxis.labelWidth,y:t.drawingArea.top,width:t.FINAL_CONFIG.chart.grid.labels.yAxis.labelWidth,height:t.drawingArea.height<0?10:t.drawingArea.height,fill:l.selectedScale===a.id?`${a.color}20`:"transparent",onMouseenter:s=>l.selectedScale=a.id,onMouseleave:o[0]||(o[0]=s=>l.selectedScale=null)},null,40,Ct))),256)):e.createCommentVNode("",!0),e.createElementVNode("g",null,[t.FINAL_CONFIG.chart.grid.labels.axis.yLabel&&!l.mutableConfig.useIndividualScale?(e.openBlock(),e.createElementBlock("text",{key:0,"font-size":l.fontSizes.yAxis,fill:t.FINAL_CONFIG.chart.grid.labels.color,transform:`translate(${l.fontSizes.yAxis+t.FINAL_CONFIG.chart.grid.labels.axis.yLabelOffsetX}, ${t.drawingArea.top+t.drawingArea.height/2}) rotate(-90)`,"text-anchor":"middle",style:{transition:"none"}},e.toDisplayString(t.FINAL_CONFIG.chart.grid.labels.axis.yLabel),9,St)):e.createCommentVNode("",!0),t.FINAL_CONFIG.chart.grid.labels.axis.xLabel?(e.openBlock(),e.createElementBlock("text",{key:1,"text-anchor":"middle",x:l.width/2,y:t.drawingArea.bottom+l.fontSizes.yAxis+l.fontSizes.xAxis*1.3+t.FINAL_CONFIG.chart.grid.labels.axis.xLabelOffsetY,"font-size":l.fontSizes.yAxis,fill:t.FINAL_CONFIG.chart.grid.labels.color},e.toDisplayString(t.FINAL_CONFIG.chart.grid.labels.axis.xLabel),9,At)):e.createCommentVNode("",!0)]),t.FINAL_CONFIG.chart.grid.labels.xAxisLabels.show?(e.openBlock(),e.createElementBlock("g",Lt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.timeLabels,(a,s)=>(e.openBlock(),e.createElementBlock("g",{key:`time_label_${s}`},[a&&!t.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyFirstAndLast&&!t.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyAtModulo||a&&t.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyFirstAndLast&&(s===0||s===t.timeLabels.length-1)&&!t.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyAtModulo||a&&t.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyFirstAndLast&&l.selectedSerieIndex===s&&!t.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyAtModulo||a&&!t.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyFirstAndLast&&t.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyAtModulo&&s%Math.floor((this.slicer.end-this.slicer.start)/t.FINAL_CONFIG.chart.grid.labels.xAxisLabels.modulo)===0?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":t.FINAL_CONFIG.chart.grid.labels.xAxisLabels.rotation>0?"start":t.FINAL_CONFIG.chart.grid.labels.xAxisLabels.rotation<0?"end":"middle","font-size":l.fontSizes.xAxis,fill:t.FINAL_CONFIG.chart.grid.labels.xAxisLabels.color,transform:`translate(${t.drawingArea.left+t.drawingArea.width/t.maxSeries*s+t.drawingArea.width/t.maxSeries/2}, ${t.drawingArea.bottom+l.fontSizes.xAxis*1.3+t.FINAL_CONFIG.chart.grid.labels.xAxisLabels.yOffset}), rotate(${t.FINAL_CONFIG.chart.grid.labels.xAxisLabels.rotation})`},e.toDisplayString(a||""),9,wt)):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.maxSeries,(a,s)=>(e.openBlock(),e.createElementBlock("g",{key:`tooltip_trap_${s}`},[e.createElementVNode("rect",{"data-cy-trap":"",x:t.drawingArea.left+t.drawingArea.width/t.maxSeries*s,y:t.drawingArea.top,height:t.drawingArea.height<0?10:t.drawingArea.height,width:t.drawingArea.width/t.maxSeries<0?1e-5:t.drawingArea.width/t.maxSeries,fill:l.selectedSerieIndex===s||l.selectedRowIndex===s?`${t.FINAL_CONFIG.chart.highlighter.color}${l.opacity[t.FINAL_CONFIG.chart.highlighter.opacity]}`:"transparent",onMouseenter:i=>t.toggleTooltipVisibility(!0,s),onMouseleave:o[1]||(o[1]=i=>t.toggleTooltipVisibility(!1)),onClick:i=>t.selectX(s)},null,40,vt)]))),128))]),t.FINAL_CONFIG.chart.highlighter.useLine&&![null,void 0].includes(l.selectedSerieIndex)?(e.openBlock(),e.createElementBlock("g",Ot,[e.createElementVNode("line",{x1:t.drawingArea.left+t.drawingArea.width/t.maxSeries*l.selectedSerieIndex+t.drawingArea.width/t.maxSeries/2,x2:t.drawingArea.left+t.drawingArea.width/t.maxSeries*l.selectedSerieIndex+t.drawingArea.width/t.maxSeries/2,y1:t.drawingArea.top,y2:t.drawingArea.bottom,stroke:t.FINAL_CONFIG.chart.highlighter.color,"stroke-width":t.FINAL_CONFIG.chart.highlighter.lineWidth,"stroke-dasharray":t.FINAL_CONFIG.chart.highlighter.lineDasharray,"stroke-linecap":"round",style:{transition:"none !important",animation:"none !important","pointer-events":"none"}},null,8,Gt)])):e.createCommentVNode("",!0),t.FINAL_CONFIG.chart.timeTag.show&&![null,void 0].includes(l.selectedSerieIndex)?(e.openBlock(),e.createElementBlock("g",Bt,[(e.openBlock(),e.createElementBlock("foreignObject",{x:t.drawingArea.left+t.drawingArea.width/t.maxSeries*l.selectedSerieIndex-100+t.drawingArea.width/t.maxSeries/2,y:t.drawingArea.bottom,width:"200",height:"40",style:{overflow:"visible !important"}},[e.createElementVNode("div",{class:"vue-ui-xy-time-tag",style:e.normalizeStyle(`width: fit-content;margin: 0 auto;text-align:center;padding:3px 12px;background:${t.FINAL_CONFIG.chart.timeTag.backgroundColor};color:${t.FINAL_CONFIG.chart.timeTag.color};font-size:${t.FINAL_CONFIG.chart.timeTag.fontSize}px`)},e.toDisplayString(t.timeLabels[l.selectedSerieIndex]||l.selectedSerieIndex),5)],8,pt)),e.createElementVNode("circle",{cx:t.drawingArea.left+t.drawingArea.width/t.maxSeries*l.selectedSerieIndex+t.drawingArea.width/t.maxSeries/2,cy:t.drawingArea.bottom,r:t.FINAL_CONFIG.chart.timeTag.circleMarker.radius,fill:t.FINAL_CONFIG.chart.timeTag.circleMarker.color},null,8,Et)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(r.$slots,"svg",{svg:t.svg},void 0,!0)],14,X)):e.createCommentVNode("",!0),r.$slots.watermark?(e.openBlock(),e.createElementBlock("div",zt,[e.renderSlot(r.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:l.isPrinting||l.isImaging})),void 0,!0)])):e.createCommentVNode("",!0),t.isDataset?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(f,{key:4,config:{type:"line",style:{backgroundColor:t.FINAL_CONFIG.chart.backgroundColor,line:{axis:{color:t.FINAL_CONFIG.chart.grid.stroke},path:{color:t.FINAL_CONFIG.chart.grid.stroke,strokeWidth:.5}}}}},null,8,["config"])),t.FINAL_CONFIG.chart.zoom.show&&l.maxX>6&&t.isDataset?(e.openBlock(),e.createBlock(S,{ref:"chartSlicer",key:`slicer_${l.slicerStep}`,background:t.FINAL_CONFIG.chart.zoom.color,fontSize:t.FINAL_CONFIG.chart.zoom.fontSize,useResetSlot:t.FINAL_CONFIG.chart.zoom.useResetSlot,labelLeft:t.FINAL_CONFIG.chart.grid.labels.xAxisLabels.values[l.slicer.start],labelRight:t.FINAL_CONFIG.chart.grid.labels.xAxisLabels.values[l.slicer.end-1],textColor:t.FINAL_CONFIG.chart.color,inputColor:t.FINAL_CONFIG.chart.zoom.color,selectColor:t.FINAL_CONFIG.chart.zoom.highlightColor,borderColor:t.FINAL_CONFIG.chart.backgroundColor,max:l.maxX,min:0,valueStart:l.slicer.start,valueEnd:l.slicer.end,start:l.slicer.start,"onUpdate:start":o[2]||(o[2]=a=>l.slicer.start=a),end:l.slicer.end,"onUpdate:end":o[3]||(o[3]=a=>l.slicer.end=a),onReset:t.refreshSlicer},{"reset-action":e.withCtx(({reset:a})=>[e.renderSlot(r.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:a})),void 0,!0)]),_:3},8,["background","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","borderColor","max","valueStart","valueEnd","start","end","onReset"])):e.createCommentVNode("",!0),t.FINAL_CONFIG.chart.legend.show?(e.openBlock(),e.createElementBlock("div",{key:6,ref:"chartLegend",class:"vue-ui-xy-legend",style:e.normalizeStyle(`font-size:${t.FINAL_CONFIG.chart.legend.fontSize}px`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.absoluteDataset,(a,s)=>(e.openBlock(),e.createElementBlock("div",{key:`div_legend_item_${s}`,onClick:i=>t.segregate(a),class:e.normalizeClass({"vue-ui-xy-legend-item":!0,"vue-ui-xy-legend-item-segregated":l.segregatedSeries.includes(a.id)})},[l.icons[a.type]==="line"?(e.openBlock(),e.createElementBlock("svg",Pt,[e.createElementVNode("rect",{x:"0",y:"7",rx:"3",stroke:"none",height:"4",width:"20",fill:a.color},null,8,Tt),e.createVNode(u,{plot:{x:10,y:9},radius:4,color:a.color,shape:["triangle","square","diamond","pentagon","hexagon","star"].includes(a.shape)?a.shape:"circle",stroke:t.FINAL_CONFIG.chart.backgroundColor,strokeWidth:1},null,8,["color","shape","stroke"])])):(e.openBlock(),e.createElementBlock("svg",Mt,[l.icons[a.type]==="bar"?(e.openBlock(),e.createElementBlock("rect",{key:0,x:"0",y:"0",rx:"1",height:"12",width:"12",stroke:"none",fill:a.color},null,8,Rt)):(e.openBlock(),e.createBlock(u,{key:1,plot:{x:6,y:6},radius:5,color:a.color,shape:["triangle","square","diamond","pentagon","hexagon","star"].includes(a.shape)?a.shape:"circle"},null,8,["color","shape"]))])),e.createElementVNode("span",{style:e.normalizeStyle(`color:${t.FINAL_CONFIG.chart.legend.color}`)},e.toDisplayString(a.name),5)],10,Vt))),128))],4)):(e.openBlock(),e.createElementBlock("div",Dt,[e.renderSlot(r.$slots,"legend",{legend:t.absoluteDataset},void 0,!0)],512)),e.createVNode(_,{show:l.mutableConfig.showTooltip&&l.isTooltip,backgroundColor:t.FINAL_CONFIG.chart.tooltip.backgroundColor,color:t.FINAL_CONFIG.chart.tooltip.color,fontSize:t.FINAL_CONFIG.chart.tooltip.fontSize,borderRadius:t.FINAL_CONFIG.chart.tooltip.borderRadius,borderColor:t.FINAL_CONFIG.chart.tooltip.borderColor,borderWidth:t.FINAL_CONFIG.chart.tooltip.borderWidth,backgroundOpacity:t.FINAL_CONFIG.chart.tooltip.backgroundOpacity,position:t.FINAL_CONFIG.chart.tooltip.position,offsetY:t.FINAL_CONFIG.chart.tooltip.offsetY,parent:r.$refs.chart,content:t.tooltipContent,isCustom:t.FINAL_CONFIG.chart.tooltip.customFormat&&typeof t.FINAL_CONFIG.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(r.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...t.dataTooltipSlot})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(r.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...t.dataTooltipSlot})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom"]),t.isDataset?(e.openBlock(),e.createBlock(F,{key:8,hideDetails:"",config:{open:l.mutableConfig.showTable,maxHeight:1e4,body:{backgroundColor:t.FINAL_CONFIG.chart.backgroundColor,color:t.FINAL_CONFIG.chart.color},head:{backgroundColor:t.FINAL_CONFIG.chart.backgroundColor,color:t.FINAL_CONFIG.chart.color}}},{content:e.withCtx(()=>[e.createElementVNode("div",{style:e.normalizeStyle(`${l.isPrinting?"":"max-height:400px"};overflow:auto;width:100%;margin-top:48px`)},[e.createElementVNode("div",Ht,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":o[4]||(o[4]=a=>l.showSparklineTable=a)},null,512),[[e.vModelCheckbox,l.showSparklineTable]]),e.createElementVNode("div",{onClick:o[5]||(o[5]=a=>l.showSparklineTable=!l.showSparklineTable),style:{cursor:"pointer"}},[e.createVNode(y,{name:"chartLine",size:20,stroke:t.FINAL_CONFIG.chart.color},null,8,["stroke"])])]),l.showSparklineTable?(e.openBlock(),e.createBlock(C,{key:`sparkline_${l.segregateStep}`,dataset:t.tableSparklineDataset,config:t.tableSparklineConfig},null,8,["dataset","config"])):(e.openBlock(),e.createBlock(N,{key:1,colNames:t.dataTable.colNames,head:t.dataTable.head,body:t.dataTable.body,config:t.dataTable.config,title:`${t.FINAL_CONFIG.chart.title.text}${t.FINAL_CONFIG.chart.title.subtitle.text?` : ${t.FINAL_CONFIG.chart.title.subtitle.text}`:""}`,onClose:o[6]||(o[6]=a=>l.mutableConfig.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a},null,8,Yt)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a),1)]),_:1},8,["colNames","head","body","config","title"]))],4)]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,W)}const Wt=H._export_sfc(q,[["render",qt],["__scopeId","data-v-3339c0a2"]]);exports.default=Wt;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { p as Z } from "./pdf-97UbtKC2.js";
|
|
2
|
-
import { U as J, s as K } from "./usePrinter-
|
|
3
|
-
import { c as U, a as Q, t as j, r as $, p as ee, u as te, O as X, I as M, E as le, T as ae, z as re, U as ie, L as se, V as oe, x as ne, s as ce, d as he, y as ue, b as de, q as ge, n as fe, C as be, R as Ie, W as me, f as Ne, v as _e, w as Fe, e as xe, o as ye, Y as Ae, B as Se } from "./index-
|
|
4
|
-
import { D as Le } from "./DataTable-
|
|
5
|
-
import { _ as Ce } from "./Title-
|
|
6
|
-
import { _ as ke, u as we } from "./Tooltip-
|
|
7
|
-
import { _ as Oe } from "./Shape-
|
|
8
|
-
import ve from "./BaseIcon-
|
|
9
|
-
import Ge from "./vue-ui-table-sparkline-
|
|
10
|
-
import ze from "./vue-ui-skeleton-
|
|
11
|
-
import { S as pe } from "./Slicer-
|
|
12
|
-
import Te from "./vue-ui-accordion-
|
|
13
|
-
import { u as q } from "./useNestedProp-
|
|
2
|
+
import { U as J, s as K } from "./usePrinter-BD40aUzH.js";
|
|
3
|
+
import { c as U, a as Q, t as j, r as $, p as ee, u as te, O as X, I as M, E as le, T as ae, z as re, U as ie, L as se, V as oe, x as ne, s as ce, d as he, y as ue, b as de, q as ge, n as fe, C as be, R as Ie, W as me, f as Ne, v as _e, w as Fe, e as xe, o as ye, Y as Ae, B as Se } from "./index-DiWO-_ca.js";
|
|
4
|
+
import { D as Le } from "./DataTable-EqeVt-K-.js";
|
|
5
|
+
import { _ as Ce } from "./Title-C3Ez1ceq.js";
|
|
6
|
+
import { _ as ke, u as we } from "./Tooltip-7SRMoiu-.js";
|
|
7
|
+
import { _ as Oe } from "./Shape-DvcgW6uK.js";
|
|
8
|
+
import ve from "./BaseIcon-D8FXGup9.js";
|
|
9
|
+
import Ge from "./vue-ui-table-sparkline-DZY_23mg.js";
|
|
10
|
+
import ze from "./vue-ui-skeleton-CeNL0kH-.js";
|
|
11
|
+
import { S as pe } from "./Slicer-CH_5wnFM.js";
|
|
12
|
+
import Te from "./vue-ui-accordion-CiNdgRO9.js";
|
|
13
|
+
import { u as q } from "./useNestedProp-DNX5EefQ.js";
|
|
14
14
|
import { resolveComponent as P, openBlock as r, createElementBlock as i, normalizeClass as T, normalizeStyle as S, createVNode as E, createCommentVNode as c, createBlock as V, createSlots as Me, withCtx as z, renderSlot as v, normalizeProps as Y, guardReactiveProps as W, createElementVNode as d, Fragment as I, renderList as m, toDisplayString as C, withDirectives as Pe, vModelCheckbox as Ve, createTextVNode as Re } from "vue";
|
|
15
15
|
import { _ as De } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
16
16
|
const He = U(), Be = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),s=require("./index-BQOxn6SH.cjs"),c=require("./useResponsive-B3TrDDIG.cjs"),qe=require("./Tooltip-DcDEanxk.cjs"),Ye=require("./Legend-C_lBCmBu.cjs"),Ue=require("./Title-B9iq63n1.cjs"),Xe=require("./Slicer-BvYL7yVK.cjs"),xe=require("./usePrinter-Q1J--baX.cjs"),Ae=require("./vue-ui-accordion-ogVvFfQy.cjs"),Ze=require("./DataTable-C6HTLT7L.cjs"),Ge=require("./vue-ui-skeleton-CcrGR_Vh.cjs"),ke=require("./useNestedProp-BtqgWTf9.cjs"),je=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Je=["id"],Ke=["onClick"],Qe={key:2,class:"vue-data-ui-watermark"},et=["innerHTML"],tt={__name:"vue-ui-xy-canvas",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},emits:["selectLegend"],setup(J,{expose:Le,emit:Ce}){const R=J,{vue_ui_xy_canvas:we}=s.useConfig(),U=l.ref(s.createUid()),D=l.ref(null),C=l.ref(null),E=l.ref(null),i=l.ref(null),g=l.ref(1),z=l.ref(1),_=l.ref(!1),f=l.ref(null),H=l.ref(""),K=l.ref(null),L=l.ref([]),N=l.ref(1),M=l.ref(!0),w=l.ref(!0),X=l.ref(null),Q=l.ref(0),ee=l.ref(0),A=l.ref(!1),te=l.ref(null),le=l.ref(null),ae=l.ref(null),Z=l.computed(()=>!!R.dataset&&R.dataset.length),t=l.computed(()=>{const e=ke.useNestedProp({userConfig:R.config,defaultConfig:we});return e.theme?{...ke.useNestedProp({userConfig:s.themes.vue_ui_xy_canvas[e.theme]||R.config,defaultConfig:e}),customPalette:s.themePalettes[e.theme]||s.palette}:e}),oe=l.ref(t.value.style.chart.aspectRatio),{isPrinting:re,isImaging:ue,generatePdf:ne,generateImage:se}=xe.usePrinter({elementId:`xy_canvas_${U.value}`,fileName:t.value.style.chart.title.text||"vue-ui-xy-canvas"}),n=l.ref({showTable:t.value.table.show,showDataLabels:t.value.style.chart.dataLabels.show,stacked:t.value.style.chart.stacked,showTooltip:t.value.style.chart.tooltip.show});function Se(e){A.value=e,ee.value+=1}const ie=l.computed(()=>s.convertCustomPalette(t.value.customPalette)),P=l.computed(()=>Math.max(...O.value.filter((e,o)=>!L.value.includes(e.absoluteIndex)).map(e=>e.series.length))),a=l.computed(()=>{const e=g.value-g.value*(t.value.style.chart.paddingProportions.left+t.value.style.chart.paddingProportions.right);return{canvasWidth:g.value,canvasHeight:z.value,left:g.value*t.value.style.chart.paddingProportions.left,top:z.value*t.value.style.chart.paddingProportions.top,right:g.value-g.value*t.value.style.chart.paddingProportions.right,bottom:z.value-z.value*t.value.style.chart.paddingProportions.bottom,width:e,height:z.value-z.value*(t.value.style.chart.paddingProportions.top+t.value.style.chart.paddingProportions.bottom),slot:e/(u.value.end-u.value.start)}});function ve(e,o){return e/o}function ze({hasAutoScale:e,series:o,min:r,max:d,scale:h,yOffset:p,individualHeight:v,stackIndex:m=null}){return o.map((k,j)=>{const S=h.min<0?Math.abs(h.min):0,$=ve(k+S,S+h.max);let T,F;e&&(T=Math.abs(h.min),F=ve(k+T,h.max+T));let I=0;return m===null?I=a.value.bottom-a.value.height*(e?F:$):I=a.value.bottom-p-v*(e?F:$),{x:a.value.left+a.value.slot*j+a.value.slot/2,y:I,value:k}})}const b=l.computed(()=>{const e=Math.min(...O.value.filter((v,m)=>!L.value.includes(v.absoluteIndex)).flatMap(v=>v.series.slice(u.value.start,u.value.end))),o=Math.max(...O.value.filter((v,m)=>!L.value.includes(v.absoluteIndex)).flatMap(v=>v.series.slice(u.value.start,u.value.end))),r=s.calculateNiceScale(e<0?e:0,o===e?e+1<0?0:e+1:o<0?0:o,t.value.style.chart.scale.ticks),d=r.min<0?Math.abs(r.min):0,h=a.value.bottom-a.value.height*(d/(r.max+d)),p=r.ticks.map(v=>({y:a.value.bottom-a.value.height*((v+d)/(r.max+d)),x:a.value.left-8,value:v}));return{absoluteMin:d,max:o,min:e,scale:r,yLabels:p,zero:h}}),$e=l.computed(()=>y.value.map(e=>`
|
|
2
2
|
<div style="display:flex;flex-direction:row;gap:6px;align-items:center;">
|
|
3
3
|
<svg viewBox="0 0 10 10" height="12" width="12">
|
|
4
4
|
<circle cx="5" cy="5" r="5" fill="${e.color}"/>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { ref as c, computed as b, watch as ue, onMounted as da, onBeforeUnmount as ha, openBlock as T, createElementBlock as re, normalizeStyle as U, normalizeClass as ya, createVNode as he, createCommentVNode as A, createBlock as Z, unref as E, createSlots as fa, withCtx as m, renderSlot as k, normalizeProps as G, guardReactiveProps as V, createElementVNode as j, toDisplayString as He, createTextVNode as ga } from "vue";
|
|
2
|
-
import { u as pa, c as ba, t as ma, a as xa, p as N, b as La, z as ye, f as q, d as We, T as ka, o as Ca, e as wa, v as Ye, w as Sa, n as za, q as $a, r as J, l as Ta } from "./index-
|
|
2
|
+
import { u as pa, c as ba, t as ma, a as xa, p as N, b as La, z as ye, f as q, d as We, T as ka, o as Ca, e as wa, v as Ye, w as Sa, n as za, q as $a, r as J, l as Ta } from "./index-DiWO-_ca.js";
|
|
3
3
|
import { d as Ma, c as Ra, a as Be, t as Oa, l as C, r as fe, b as P, p as Xe, u as Pa } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as Ia } from "./Tooltip-
|
|
5
|
-
import { L as Fa } from "./Legend-
|
|
6
|
-
import { _ as Ea } from "./Title-
|
|
7
|
-
import { S as Na } from "./Slicer-
|
|
8
|
-
import { u as _a, U as Da } from "./usePrinter-
|
|
9
|
-
import Ha from "./vue-ui-accordion-
|
|
10
|
-
import { D as Wa } from "./DataTable-
|
|
11
|
-
import Ya from "./vue-ui-skeleton-
|
|
12
|
-
import { u as Ue } from "./useNestedProp-
|
|
4
|
+
import { _ as Ia } from "./Tooltip-7SRMoiu-.js";
|
|
5
|
+
import { L as Fa } from "./Legend-8eVERYMn.js";
|
|
6
|
+
import { _ as Ea } from "./Title-C3Ez1ceq.js";
|
|
7
|
+
import { S as Na } from "./Slicer-CH_5wnFM.js";
|
|
8
|
+
import { u as _a, U as Da } from "./usePrinter-BD40aUzH.js";
|
|
9
|
+
import Ha from "./vue-ui-accordion-CiNdgRO9.js";
|
|
10
|
+
import { D as Wa } from "./DataTable-EqeVt-K-.js";
|
|
11
|
+
import Ya from "./vue-ui-skeleton-CeNL0kH-.js";
|
|
12
|
+
import { u as Ue } from "./useNestedProp-DNX5EefQ.js";
|
|
13
13
|
import { _ as Ba } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
14
|
const Xa = ["id"], Ua = ["onClick"], Aa = {
|
|
15
15
|
key: 2,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-data-ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "2.3.
|
|
4
|
+
"version": "2.3.27",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "A user-empowering data visualization Vue 3 components library for eloquent data storytelling",
|
|
7
7
|
"keywords": [
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"smiley",
|
|
40
40
|
"sparkbar",
|
|
41
41
|
"sparkline",
|
|
42
|
+
"stackbar",
|
|
42
43
|
"table heatmap",
|
|
43
44
|
"table",
|
|
44
45
|
"thermometer",
|