vue-data-ui 2.3.23 → 2.3.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Arrow-BOSHa3Ag.cjs → Arrow-01eXaB81.cjs} +1 -1
- package/dist/{Arrow-DxXzMXB1.js → Arrow-zObQ2VxA.js} +1 -1
- package/dist/{BaseIcon-C-k_mqXL.cjs → BaseIcon-BkdELEYE.cjs} +1 -1
- package/dist/{BaseIcon-DuMfKUDs.js → BaseIcon-CHBghp3_.js} +1 -1
- package/dist/{DataTable-CHXdpx94.cjs → DataTable-D_2ZW2eI.cjs} +1 -1
- package/dist/{DataTable-DKHF_NH2.js → DataTable-Dytj5HQM.js} +2 -2
- package/dist/{Legend-BqqpwXbu.js → Legend-Ct8LnAy4.js} +1 -1
- package/dist/{Legend-BwrzHxLy.cjs → Legend-tvvMRnbi.cjs} +1 -1
- package/dist/{Shape-DW18-C9f.cjs → Shape-dvRttq7z.cjs} +1 -1
- package/dist/{Shape-Ccky9omb.js → Shape-qo5jcJq9.js} +1 -1
- package/dist/{Slicer-BDsv196Y.js → Slicer-BNgHaM2_.js} +1 -1
- package/dist/{Slicer-xKlzke1v.cjs → Slicer-DcjEg-ZZ.cjs} +1 -1
- package/dist/{Title-Bx2ibobQ.js → Title-BcNPXpKX.js} +1 -1
- package/dist/{Title-DxNugmhI.cjs → Title-CSQdI1EY.cjs} +1 -1
- package/dist/{Tooltip-BC2Wlz7P.cjs → Tooltip-B-laoopT.cjs} +1 -1
- package/dist/{Tooltip-DOEMrisX.js → Tooltip-etzDGo1Y.js} +1 -1
- package/dist/{index-BvjCO-wv.js → index-BE6fhUyH.js} +1 -1
- package/dist/{index-oufiZvaS.cjs → index-BFH7X8WG.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-CmTItGss.cjs → useNestedProp-B_z4-n52.cjs} +1 -1
- package/dist/{useNestedProp-2KJaYPfM.js → useNestedProp-BcjRW6BJ.js} +1 -1
- package/dist/{usePrinter-CaKXrCiB.js → usePrinter-CdIphKpF.js} +1 -1
- package/dist/{usePrinter-Cc8ufBvU.cjs → usePrinter-hyuaFHQj.cjs} +1 -1
- package/dist/{vue-data-ui-DnlOZVL-.js → vue-data-ui-DH3---6Y.js} +56 -56
- package/dist/{vue-data-ui-D5LrE3dP.cjs → vue-data-ui-dbgbgXfB.cjs} +1 -1
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-qegO2SzJ.js → vue-ui-3d-bar-CPpeRsrz.js} +7 -7
- package/dist/{vue-ui-3d-bar-Cma1NB-u.cjs → vue-ui-3d-bar-ddx9_3_T.cjs} +1 -1
- package/dist/{vue-ui-accordion-DiR0dVog.cjs → vue-ui-accordion-CvZhABQM.cjs} +1 -1
- package/dist/{vue-ui-accordion-q-bLDiD3.js → vue-ui-accordion-Dmz7RUKz.js} +3 -3
- package/dist/{vue-ui-age-pyramid-xk6Gt1LJ.cjs → vue-ui-age-pyramid-BieAbkr7.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-vQvy7rWY.js → vue-ui-age-pyramid-DiOdrFIV.js} +8 -8
- package/dist/{vue-ui-annotator-LwO1PGoN.cjs → vue-ui-annotator-CugE3IpZ.cjs} +1 -1
- package/dist/{vue-ui-annotator-BYT8v1SY.js → vue-ui-annotator-KClMRKPi.js} +1 -1
- package/dist/{vue-ui-candlestick-zvv6_kwp.js → vue-ui-candlestick-D9MajMEG.js} +9 -9
- package/dist/{vue-ui-candlestick-CmM0kwJR.cjs → vue-ui-candlestick-DErkX5mF.cjs} +1 -1
- package/dist/vue-ui-carousel-table-CLwi79Ly.js +346 -0
- package/dist/vue-ui-carousel-table-CsCEcaWp.cjs +1 -0
- package/dist/{vue-ui-chestnut-4MvRD28_.cjs → vue-ui-chestnut-BTvQSTQi.cjs} +1 -1
- package/dist/{vue-ui-chestnut-A9asY_42.js → vue-ui-chestnut-BnmDdakJ.js} +6 -6
- package/dist/{vue-ui-cursor-DusWgM7W.cjs → vue-ui-cursor-Dj8pAXbc.cjs} +1 -1
- package/dist/{vue-ui-cursor-CPPPIH2W.js → vue-ui-cursor-KjKhIKTP.js} +2 -2
- package/dist/{vue-ui-dashboard-ZTzEd521.cjs → vue-ui-dashboard-BTpiCLaT.cjs} +1 -1
- package/dist/{vue-ui-dashboard-CuQ81BKN.js → vue-ui-dashboard-Dm-rDSRt.js} +2 -2
- package/dist/{vue-ui-digits-DlupvOo-.cjs → vue-ui-digits-BVVOQfoO.cjs} +1 -1
- package/dist/{vue-ui-digits-Czkbi2AR.js → vue-ui-digits-WgEKLYdq.js} +2 -2
- package/dist/{vue-ui-donut-Cis7kzDB.js → vue-ui-donut-BjHWw_Mw.js} +9 -9
- package/dist/{vue-ui-donut-DA5YfWlL.cjs → vue-ui-donut-DvDqj2od.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-BigmUCTm.cjs → vue-ui-donut-evolution-C0TW-uGR.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-D2I4ZD5a.js → vue-ui-donut-evolution-CWBsLGUw.js} +9 -9
- package/dist/{vue-ui-dumbbell-fdV94xQB.js → vue-ui-dumbbell-BlsLMdW8.js} +8 -8
- package/dist/{vue-ui-dumbbell-D8ZSCX0H.cjs → vue-ui-dumbbell-Uhw6rKrw.cjs} +1 -1
- package/dist/{vue-ui-flow-C1PVwgKX.js → vue-ui-flow-KijZNPzD.js} +7 -7
- package/dist/{vue-ui-flow-CH6PmIBT.cjs → vue-ui-flow-fnDs0_mH.cjs} +1 -1
- package/dist/{vue-ui-galaxy-IFmqHh3R.cjs → vue-ui-galaxy-BBiGsB2G.cjs} +1 -1
- package/dist/{vue-ui-galaxy-DzWOfvyj.js → vue-ui-galaxy-_y9H-beS.js} +9 -9
- package/dist/{vue-ui-gauge-Bbda2H3b.cjs → vue-ui-gauge-Bv4YKgIj.cjs} +1 -1
- package/dist/{vue-ui-gauge-CeGa1oMf.js → vue-ui-gauge-CGgQqTqT.js} +5 -5
- package/dist/{vue-ui-gizmo-DyJngE0E.cjs → vue-ui-gizmo-DFWR7qEg.cjs} +1 -1
- package/dist/{vue-ui-gizmo-BILyJylm.js → vue-ui-gizmo-DjAFk58g.js} +2 -2
- package/dist/{vue-ui-heatmap-Dp68UbGB.cjs → vue-ui-heatmap-B5McL3SD.cjs} +1 -1
- package/dist/{vue-ui-heatmap-DRk0VXaJ.js → vue-ui-heatmap-D1AMro3o.js} +8 -8
- package/dist/vue-ui-kpi-BW2na3Yu.js +58 -0
- package/dist/vue-ui-kpi-Bb7xdAFU.cjs +1 -0
- package/dist/{vue-ui-mini-loader-CXiMb5pi.cjs → vue-ui-mini-loader-22dagCEY.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-DLXv9Seq.js → vue-ui-mini-loader-CKZ-PEf5.js} +2 -2
- package/dist/{vue-ui-molecule-JlPbVJ8I.js → vue-ui-molecule-BK8HPWvg.js} +9 -9
- package/dist/{vue-ui-molecule-DOwGWqSR.cjs → vue-ui-molecule-CWpBfXyk.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-BF3WqcyN.cjs → vue-ui-mood-radar-BZE6rvtb.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-C3Boyr96.js → vue-ui-mood-radar-CXq465Aj.js} +9 -9
- package/dist/{vue-ui-nested-donuts-C9CFBzvj.js → vue-ui-nested-donuts-BSYKxbNL.js} +9 -9
- package/dist/{vue-ui-nested-donuts-DkGXmwTg.cjs → vue-ui-nested-donuts-Ca-b8_P3.cjs} +1 -1
- package/dist/{vue-ui-onion-BqzUINBq.js → vue-ui-onion-CMv38G-g.js} +9 -9
- package/dist/{vue-ui-onion-COYhqrEx.cjs → vue-ui-onion-DvRn35KQ.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-BE8Bf0MQ.cjs → vue-ui-parallel-coordinate-plot-C50SGcJo.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-DtXx6zpM.js → vue-ui-parallel-coordinate-plot-DBZUno5l.js} +10 -10
- package/dist/{vue-ui-quadrant-Cr2jm-2w.js → vue-ui-quadrant-C-jh3Grv.js} +10 -10
- package/dist/{vue-ui-quadrant-g34Ky2Hq.cjs → vue-ui-quadrant-CJo9jqLm.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-BEXF1YLk.cjs → vue-ui-quick-chart-BJ6lIxf6.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-gurflOrc.js → vue-ui-quick-chart-BvTLEmD_.js} +6 -6
- package/dist/{vue-ui-radar-B77sXFJD.cjs → vue-ui-radar-CWgrIgHA.cjs} +1 -1
- package/dist/{vue-ui-radar-DGXj7kOe.js → vue-ui-radar-Kh4Qt05I.js} +10 -10
- package/dist/{vue-ui-rating-D2wmEDux.js → vue-ui-rating-D7AkYGtK.js} +2 -2
- package/dist/{vue-ui-rating-J4wpjGDw.cjs → vue-ui-rating-DJsfvOxZ.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-8hDVUqzX.js → vue-ui-relation-circle-CXQ9FHnG.js} +5 -5
- package/dist/{vue-ui-relation-circle-CkO4PvuL.cjs → vue-ui-relation-circle-DRquG6N9.cjs} +1 -1
- package/dist/{vue-ui-rings-Bs4I_DFj.js → vue-ui-rings-BuuiGgkQ.js} +9 -9
- package/dist/{vue-ui-rings-Bt4lsykR.cjs → vue-ui-rings-DAuDNTak.cjs} +1 -1
- package/dist/{vue-ui-scatter-BcuxFe_0.js → vue-ui-scatter-Ba_1vbfG.js} +10 -10
- package/dist/{vue-ui-scatter-pnVV0nUg.cjs → vue-ui-scatter-Db1WHHMt.cjs} +1 -1
- package/dist/{vue-ui-screenshot-Q4jzniKW.cjs → vue-ui-screenshot-BgvHfkel.cjs} +1 -1
- package/dist/{vue-ui-screenshot-CkunIVDh.js → vue-ui-screenshot-rDwd1nNP.js} +1 -1
- package/dist/{vue-ui-skeleton-jYHncdu5.js → vue-ui-skeleton-DZk__alb.js} +2 -2
- package/dist/{vue-ui-skeleton-Fsru0dbb.cjs → vue-ui-skeleton-Df1qBO2k.cjs} +1 -1
- package/dist/{vue-ui-smiley-B3gIeKih.js → vue-ui-smiley-BPebp5hG.js} +2 -2
- package/dist/{vue-ui-smiley-Bd3lgUj_.cjs → vue-ui-smiley-KQFOL39h.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-CgEi2LBP.js → vue-ui-spark-trend-CSdQHPuY.js} +4 -4
- package/dist/{vue-ui-spark-trend-DfD8Q9Zl.cjs → vue-ui-spark-trend-Cr2Coq5M.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-BCmLvKvU.cjs → vue-ui-sparkbar-BIdS6UA_.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-Bu_TX-tQ.js → vue-ui-sparkbar-EhBZgeio.js} +3 -3
- package/dist/{vue-ui-sparkgauge-C_DSQGId.cjs → vue-ui-sparkgauge-DFlQ-olI.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-Cml4o6Bs.js → vue-ui-sparkgauge-DTUDMW-e.js} +3 -3
- package/dist/{vue-ui-sparkhistogram-BsyOeGbq.js → vue-ui-sparkhistogram-CJZN2ZKW.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-BZDofxtq.cjs → vue-ui-sparkhistogram-_zChXZnF.cjs} +1 -1
- package/dist/{vue-ui-sparkline-DOsWIDug.js → vue-ui-sparkline-B0OAXqfq.js} +3 -3
- package/dist/{vue-ui-sparkline-twqIgYC3.cjs → vue-ui-sparkline-IWbHN7-r.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-DTgoeXjb.cjs → vue-ui-sparkstackbar-C6tBsD3M.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-DeWgfL12.js → vue-ui-sparkstackbar-wPYlidft.js} +3 -3
- package/dist/{vue-ui-strip-plot-BV27VHWB.cjs → vue-ui-strip-plot-BAcR2Zug.cjs} +1 -1
- package/dist/{vue-ui-strip-plot-Ci-hICkJ.js → vue-ui-strip-plot-Bm0JThi4.js} +9 -9
- package/dist/{vue-ui-table-R_KFQoq4.js → vue-ui-table-6ZR-bgMx.js} +1 -1
- package/dist/{vue-ui-table-Bd9ddVGy.cjs → vue-ui-table-B0FlP2RX.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-CPOETxT8.cjs → vue-ui-table-heatmap-B2Xe1T4D.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-TYLCpM_Y.js → vue-ui-table-heatmap-bJUl4rY6.js} +4 -4
- package/dist/{vue-ui-table-sparkline-H_qcrFc0.cjs → vue-ui-table-sparkline-DgZQmNaq.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-B-qJP3Yr.js → vue-ui-table-sparkline-Dxinc_iR.js} +5 -5
- package/dist/{vue-ui-thermometer-CBybvctJ.cjs → vue-ui-thermometer-BN1harXD.cjs} +1 -1
- package/dist/{vue-ui-thermometer-fV6P7B8U.js → vue-ui-thermometer-Nb1pgJ04.js} +5 -5
- package/dist/{vue-ui-timer-CU-tJV53.js → vue-ui-timer-C17OoYkC.js} +4 -4
- package/dist/{vue-ui-timer-CwQteT9E.cjs → vue-ui-timer-_44ECu7b.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-Ba1Er97s.cjs → vue-ui-tiremarks-BSMuOb-Z.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-Dxy0W8kp.js → vue-ui-tiremarks-lbnWHaOP.js} +5 -5
- package/dist/{vue-ui-treemap-CFqf6BUd.js → vue-ui-treemap-CbdnMlBb.js} +9 -9
- package/dist/{vue-ui-treemap-CpPqA91r.cjs → vue-ui-treemap-DinP2PhP.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-Px2OPOQp.cjs → vue-ui-vertical-bar-B7cKvp6J.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-CpIgWUoF.js → vue-ui-vertical-bar-B9HnpW6M.js} +9 -9
- package/dist/{vue-ui-waffle-DbR7pPaP.js → vue-ui-waffle-70I35yZY.js} +9 -9
- package/dist/{vue-ui-waffle-BEOhRYhC.cjs → vue-ui-waffle-BaqQnh1w.cjs} +1 -1
- package/dist/{vue-ui-wheel-BkbAV9mu.js → vue-ui-wheel-C8YTOjwd.js} +5 -5
- package/dist/{vue-ui-wheel-C4H-fBbx.cjs → vue-ui-wheel-DZbEyD4l.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-B8vX27Pz.cjs → vue-ui-word-cloud-DkJyoTg9.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-704bFMO3.js → vue-ui-word-cloud-Don3Oz-A.js} +6 -6
- package/dist/{vue-ui-xy-B8qzx04X.cjs → vue-ui-xy-DkBLRZ6y.cjs} +1 -1
- package/dist/{vue-ui-xy-kFskWWiT.js → vue-ui-xy-XJp90Tih.js} +12 -12
- package/dist/{vue-ui-xy-canvas-CJO0hp3z.js → vue-ui-xy-canvas-CsPcJxOA.js} +10 -10
- package/dist/{vue-ui-xy-canvas-BVhRHPYN.cjs → vue-ui-xy-canvas-Do2LgfMo.cjs} +1 -1
- package/package.json +1 -1
- package/dist/vue-ui-carousel-table-FMfXIF7s.cjs +0 -1
- package/dist/vue-ui-carousel-table-S3daEHYR.js +0 -330
- package/dist/vue-ui-kpi-Mbre-_3M.cjs +0 -1
- package/dist/vue-ui-kpi-u5GBFKBR.js +0 -54
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-oufiZvaS.cjs"),U=require("./useResponsive-B3TrDDIG.cjs"),se=require("./Title-DxNugmhI.cjs"),X=require("./usePrinter-Cc8ufBvU.cjs"),ie=require("./Legend-BwrzHxLy.cjs"),ce=require("./DataTable-CHXdpx94.cjs"),de=require("./Tooltip-BC2Wlz7P.cjs"),ve=require("./vue-ui-skeleton-Fsru0dbb.cjs"),he=require("./vue-ui-accordion-DiR0dVog.cjs"),G=require("./useNestedProp-CmTItGss.cjs"),ge=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),pe=["id"],fe=["xmlns","viewBox"],me=["cx","cy","r","stroke","stroke-width","stroke-dasharray","stroke-dashoffset"],ye=["cx","cy","r","stroke","stroke-width","stroke-dasharray","stroke-dashoffset"],be=["id"],ke=["stdDeviation"],we=["filter"],Ce=["cx","cy","r","stroke-width","stroke-dasharray","stroke-dashoffset"],$e=["cx","cy","r","stroke-width","stroke-dasharray","stroke-dashoffset","onMouseenter"],xe={key:1},Be=["onMouseenter"],Te=["x","y","font-size","fill","font-weight"],Se={key:3,class:"vue-data-ui-watermark"},Pe=["onClick"],_e=["innerHTML"],Ne={__name:"vue-ui-onion",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(H,{expose:W,emit:j}){const p=H,{vue_ui_onion:J}=u.useConfig(),w=e.computed(()=>!!p.dataset&&p.dataset.length),m=e.ref(u.createUid()),K=e.ref(null),O=e.ref(0),C=e.ref(!1),B=e.ref(""),c=e.ref([]),y=e.ref(null),V=e.ref(null),E=e.ref(null),t=e.computed(()=>{const a=G.useNestedProp({userConfig:p.config,defaultConfig:J});return a.theme?{...G.useNestedProp({userConfig:u.themes.vue_ui_onion[a.theme]||p.config,defaultConfig:a}),customPalette:u.themePalettes[a.theme]||u.palette}:a}),{isPrinting:I,isImaging:M,generatePdf:R,generateImage:z}=X.usePrinter({elementId:`vue-ui-onion_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-onion"}),Q=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),g=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),n=e.ref({height:512,width:512,padding:{top:64,left:64,right:64,bottom:64},minRadius:64}),$=e.ref(null);e.onMounted(()=>{if(u.objectIsEmpty(p.dataset)&&u.error({componentName:"VueUiOnion",type:"dataset"}),t.value.responsive){const r=U.throttle(()=>{const{width:l,height:o}=U.useResponsive({chart:y.value,title:t.value.style.chart.title.text?V.value:null,legend:t.value.style.chart.legend.show?E.value:null});n.value.width=l,n.value.height=o,n.value.padding.top=Math.max(l,o)*.125,n.value.padding.right=Math.max(l,o)*.125,n.value.padding.bottom=Math.max(l,o)*.125,n.value.padding.left=Math.max(l,o)*.125,n.value.minRadius=Math.min(l,o)*.125});$.value=new ResizeObserver(r),$.value.observe(y.value.parentNode)}}),e.onBeforeUnmount(()=>{$.value&&$.value.disconnect()});const s=e.computed(()=>({top:n.value.padding.top,left:n.value.padding.left,right:n.value.width-n.value.padding.right,bottom:n.value.height-n.value.padding.bottom,centerX:n.value.width/2,centerY:n.value.height/2,width:n.value.width-n.value.padding.right-n.value.padding.left,height:n.value.height-n.value.padding.bottom-n.value.padding.top,minRadius:n.value.minRadius,maxRadius:Math.min(n.value.width,n.value.height)-n.value.padding.top*2})),i=e.computed(()=>(p.dataset.forEach((a,r)=>{[null,void 0].includes(a.name)&&u.error({componentName:"VueUiOnion",type:"datasetSerieAttribute",property:"name",index:r}),[void 0].includes(a.percentage)&&u.error({componentName:"VueUiOnion",type:"datasetSerieAttribute",property:"percentage",index:r})}),p.dataset.map((a,r)=>{const l=`onion_serie_${r}_${m.value}`;return{...a,percentage:a.percentage||0,targetPercentage:a.percentage||0,color:u.convertColorToHex(a.color)||Q.value[r]||u.palette[r],id:l,shape:"circle",opacity:c.value.includes(l)?.5:1,absoluteIndex:r,segregate:()=>D(l),isSegregated:c.value.includes(l)}}))),b=e.ref(i.value),Z=e.computed(()=>t.value.useStartAnimation),ee=e.ref(null),te=e.computed(()=>Math.max(...i.value.map(a=>a.percentage))),T=e.ref(!1);e.watch(()=>i.value,le,{immediate:!0});function le(){if(Z.value&&!T.value){let r=function(){a>=te.value?(cancelAnimationFrame(ee.value),b.value=i.value,T.value=!0):(b.value=i.value.map(l=>({...l,percentage:a<l.targetPercentage?a:l.targetPercentage})),a+=1,requestAnimationFrame(r),T.value=!0)};b.value=i.value.map(l=>({...l,percentage:0}));let a=0;r()}else b.value=i.value}const ae=e.computed(()=>({cy:"onion-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":""})),oe=e.computed(()=>i.value.filter(a=>!c.value.includes(a.id)).length),f=e.computed(()=>{const a=Math.min(s.value.width,s.value.height)/2/i.value.length;return{gutter:(a>t.value.style.chart.layout.maxThickness?t.value.style.chart.layout.maxThickness:a)*t.value.style.chart.layout.gutter.width,track:(a>t.value.style.chart.layout.maxThickness?t.value.style.chart.layout.maxThickness:a)*t.value.style.chart.layout.track.width}}),d=e.computed(()=>b.value.filter(a=>!c.value.includes(a.id)).map((a,r)=>{const l=(s.value.maxRadius-f.value.track)/oe.value/2*(1+r),o=s.value.centerY-l;return{percentage:a.percentage||0,...a,labelY:o,radius:l,path:re(l,a.percentage||0)}}));function re(a,r){const l=a*(1.5+(r/100>.3333333333333333?0:1-r/100))*Math.PI,o=a*1.5*Math.PI;return{bgDashArray:`${o} ${o}`,bgDashOffset:o-r/100*o,dashArray:`${l} ${l}`,dashOffset:l-r/100*l,fullOffset:0,active:`M${s.value.centerX},${s.value.centerY} A ${a},${a} 0 0 0 ${s.value.right},${s.value.top}`}}function D(a){c.value.includes(a)?c.value=c.value.filter(r=>r!==a):c.value.push(a),j("selectLegend",d.value)}function ne(){return d.value}const S=e.computed(()=>{const a=[t.value.table.translations.serie,t.value.table.translations.percentage,t.value.table.translations.value],r=d.value.map(l=>[l.name,l.percentage,l.value]);return{head:a,body:r}}),x=e.computed(()=>{const a=S.value.head,r=d.value.map(o=>[`<span style="color:${o.color}">⬤</span> ${o.name}`,`${Number(o.percentage??0).toFixed(t.value.table.td.roundingPercentage).toLocaleString()}%`,`${o.prefix||""}${[null,void 0,NaN,"NaN"].includes(o.value)?"-":o.value.toFixed(t.value.table.td.roundingValue).toLocaleString()}${o.suffix||""}`]),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{head:a,body:r,config:l,colNames:a}});function L(){e.nextTick(()=>{const a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],r=S.value.head,l=S.value.body,o=a.concat([r]).concat(l),h=u.createCsvContent(o);u.downloadCsv({csvContent:h,title:t.value.style.chart.title.text||"vue-ui-onion"})})}const v=e.ref(void 0),k=e.ref(!1);function ue(a){k.value=a,O.value+=1}const P=e.ref(null);function A({datapoint:a,seriesIndex:r,show:l=!0}){const o=a.absoluteIndex;v.value=r,P.value={datapoint:a,seriesIndex:o,series:i.value,config:t.value},C.value=l;let h="";const _=t.value.style.chart.tooltip.customFormat;if(u.isFunction(_)&&u.functionReturnsString(()=>_({seriesIndex:o,datapoint:a,series:i.value,config:t.value})))B.value=_({seriesIndex:o,datapoint:a,series:i.value,config:t.value});else{const N=t.value.style.chart.tooltip.showPercentage,F=t.value.style.chart.tooltip.showValue;h+=`<div style="width: 100%; border-bottom: 1px solid ${t.value.style.chart.tooltip.borderColor}; padding-bottom: 6px;margin-bottom:3px;display:flex;flex-direction:row;gap:3px;align-items:center"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${a.color}"/></svg><span></span>${a.name}</span></div>`,h+=`<div style="width:100%;text-align:left;"><b>${N?u.dataLabel({p:"",v:a.percentage,s:"%",r:t.value.style.chart.tooltip.roundingPercentage}):""}</b> ${N&&F?"(":""}${F?u.dataLabel({p:a.prefix||"",v:a.value,s:a.suffix||"",r:t.value.style.chart.tooltip.roundingValue}):""}${N&&F?")":""}</div>`,B.value=`<div>${h}</div>`}}function q(){g.value.showTable=!g.value.showTable}function Y(){g.value.showTooltip=!g.value.showTooltip}return W({getData:ne,generatePdf:R,generateCsv:L,generateImage:z,toggleTable:q,toggleTooltip:Y}),(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-onion ${k.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"onionChart",ref:y,id:`vue-ui-onion_${m.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:V,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor}`)},[e.createVNode(se._sfc_main,{config:{title:{cy:"onion-div-title",...t.value.style.chart.title},subtitle:{cy:"onion-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&w.value?(e.openBlock(),e.createBlock(X.UserOptions,{ref_key:"details",ref:K,key:`user_options${O.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(M),isPrinting:e.unref(I),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:k.value,isTooltip:g.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:y.value,onToggleFullscreen:ue,onGeneratePdf:e.unref(R),onGenerateCsv:L,onGenerateImage:e.unref(z),onToggleTable:q,onToggleTooltip:Y},e.createSlots({_:2},[a.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:o})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:o})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),w.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(u.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value}),viewBox:`0 0 ${n.value.width<=0?1e-4:n.value.width} ${n.value.height<=0?1e-4: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(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("circle",{cx:s.value.centerX,cy:s.value.centerY,r:l.radius<=0?1e-4:l.radius,stroke:t.value.style.chart.layout.gutter.color,"stroke-width":f.value.gutter,fill:"none","stroke-dasharray":l.path.bgDashArray,"stroke-dashoffset":l.path.fullOffset,"stroke-linecap":"round",class:e.normalizeClass({"vue-ui-onion-path":!0,"vue-ui-onion-blur":t.value.useBlurOnHover&&![null,void 0].includes(v.value)&&v.value!==o}),style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,10,me))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("circle",{cx:s.value.centerX,cy:s.value.centerY,r:l.radius<0?1e-4:l.radius,stroke:`${l.color}`,"stroke-width":f.value.track,fill:"none","stroke-dasharray":l.path.dashArray,"stroke-dashoffset":l.path.dashOffset,class:e.normalizeClass({"vue-ui-onion-path":!0,"vue-ui-onion-blur":t.value.useBlurOnHover&&![null,void 0].includes(v.value)&&v.value!==o}),"stroke-linecap":"round",style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,10,ye))),256)),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${m.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.gradientIntensity},null,8,ke)],8,be)]),t.value.style.chart.useGradient?(e.openBlock(),e.createElementBlock("g",{key:0,filter:`url(#blur_${m.value})`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("circle",{cx:s.value.centerX,cy:s.value.centerY,r:l.radius<=0?1e-4:l.radius,stroke:"white","stroke-width":f.value.track/3,fill:"none","stroke-linecap":"round","stroke-dasharray":l.path.dashArray,"stroke-dashoffset":l.path.dashOffset,style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,8,Ce))),256))],8,we)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("circle",{"data-cy-trap":"",cx:s.value.centerX,cy:s.value.centerY,r:l.radius<=0?1e-4:l.radius,stroke:"transparent","stroke-width":Math.max(f.value.track,f.value.gutter),fill:"none","stroke-dasharray":l.path.bgDashArray,"stroke-dashoffset":l.path.fullOffset,"stroke-linecap":"round",class:"vue-ui-onion-path",style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"},onMouseenter:h=>A({datapoint:l,show:!0,seriesIndex:o}),onMouseleave:r[0]||(r[0]=h=>{v.value=void 0,C.value=!1})},null,40,$e))),256)),t.value.style.chart.layout.labels.show?(e.openBlock(),e.createElementBlock("g",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("g",{onMouseenter:h=>A({datapoint:l,show:!0,seriesIndex:o}),onMouseleave:r[1]||(r[1]=h=>{v.value=void 0,C.value=!1})},[c.value.includes(l.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("text",{key:0,x:n.value.width/2-f.value.gutter*.8+t.value.style.chart.layout.labels.offsetX,y:l.labelY+t.value.style.chart.layout.labels.offsetY,"text-anchor":"end","font-size":t.value.style.chart.layout.labels.fontSize,fill:t.value.useBlurOnHover&&![null,void 0].includes(v.value)&&v.value===o?l.color:t.value.style.chart.layout.labels.color,"font-weight":t.value.style.chart.layout.labels.bold?"bold":"normal"},e.toDisplayString(l.name?l.name+": ":"")+" "+e.toDisplayString(t.value.style.chart.layout.labels.percentage.show?`${(l.percentage||0).toFixed(t.value.style.chart.layout.labels.roundingPercentage)}%`:"")+" "+e.toDisplayString(!t.value.style.chart.layout.labels.percentage.show&&t.value.style.chart.layout.labels.value.show?` : ${l.value?`${l.prefix||""}${l.value.toFixed(t.value.style.chart.layout.labels.roundingValue)}${l.suffix||""}`:""}`:`${t.value.style.chart.layout.labels.value.show&&l.value?`(${l.prefix||""}${l.value.toFixed(t.value.style.chart.layout.labels.roundingValue)}${l.suffix||""})`:""}`),9,Te))],40,Be))),256))])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:n.value},void 0,!0)],14,fe)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Se,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(I)||e.unref(M)})),void 0,!0)])):e.createCommentVNode("",!0),w.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ve.default,{key:4,config:{type:"onion",style:{backgroundColor:t.value.style.chart.backgroundColor,onion:{color:t.value.style.chart.layout.gutter.color}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:E},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(ie.Legend,{key:0,legendSet:i.value,config:ae.value,onClickMarker:r[2]||(r[2]=({legend:l})=>D(l.id))},{item:e.withCtx(({legend:l})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:o=>l.segregate(),style:e.normalizeStyle(`opacity:${c.value.includes(l.id)?.5:1}`)},e.toDisplayString(l.name?l.name+": ":"")+" "+e.toDisplayString((l.percentage||0).toFixed(t.value.style.chart.legend.roundingPercentage))+"% ",13,Pe)]),_:1},8,["legendSet","config"])):e.renderSlot(a.$slots,"legend",{key:1,legend:i.value},void 0,!0)],512),e.createVNode(de._sfc_main,{show:g.value.showTooltip&&C.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:y.value,content:B.value,isCustom:e.unref(u.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...P.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...P.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),w.value?(e.openBlock(),e.createBlock(he.default,{key:5,hideDetails:"",config:{open:g.value.showTable,maxHeight:1e4,head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ce.DataTable,{colNames:x.value.colNames,head:x.value.head,body:x.value.body,config:x.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:r[3]||(r[3]=l=>g.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l),1)]),td:e.withCtx(({td:l})=>[e.createElementVNode("div",{innerHTML:l},null,8,_e)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,pe))}},Fe=ge._export_sfc(Ne,[["__scopeId","data-v-d5bc0216"]]);exports.default=Fe;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-BFH7X8WG.cjs"),U=require("./useResponsive-B3TrDDIG.cjs"),se=require("./Title-CSQdI1EY.cjs"),X=require("./usePrinter-hyuaFHQj.cjs"),ie=require("./Legend-tvvMRnbi.cjs"),ce=require("./DataTable-D_2ZW2eI.cjs"),de=require("./Tooltip-B-laoopT.cjs"),ve=require("./vue-ui-skeleton-Df1qBO2k.cjs"),he=require("./vue-ui-accordion-CvZhABQM.cjs"),G=require("./useNestedProp-B_z4-n52.cjs"),ge=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),pe=["id"],fe=["xmlns","viewBox"],me=["cx","cy","r","stroke","stroke-width","stroke-dasharray","stroke-dashoffset"],ye=["cx","cy","r","stroke","stroke-width","stroke-dasharray","stroke-dashoffset"],be=["id"],ke=["stdDeviation"],we=["filter"],Ce=["cx","cy","r","stroke-width","stroke-dasharray","stroke-dashoffset"],$e=["cx","cy","r","stroke-width","stroke-dasharray","stroke-dashoffset","onMouseenter"],xe={key:1},Be=["onMouseenter"],Te=["x","y","font-size","fill","font-weight"],Se={key:3,class:"vue-data-ui-watermark"},Pe=["onClick"],_e=["innerHTML"],Ne={__name:"vue-ui-onion",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(H,{expose:W,emit:j}){const p=H,{vue_ui_onion:J}=u.useConfig(),w=e.computed(()=>!!p.dataset&&p.dataset.length),m=e.ref(u.createUid()),K=e.ref(null),O=e.ref(0),C=e.ref(!1),B=e.ref(""),c=e.ref([]),y=e.ref(null),V=e.ref(null),E=e.ref(null),t=e.computed(()=>{const a=G.useNestedProp({userConfig:p.config,defaultConfig:J});return a.theme?{...G.useNestedProp({userConfig:u.themes.vue_ui_onion[a.theme]||p.config,defaultConfig:a}),customPalette:u.themePalettes[a.theme]||u.palette}:a}),{isPrinting:I,isImaging:M,generatePdf:R,generateImage:z}=X.usePrinter({elementId:`vue-ui-onion_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-onion"}),Q=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),g=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),n=e.ref({height:512,width:512,padding:{top:64,left:64,right:64,bottom:64},minRadius:64}),$=e.ref(null);e.onMounted(()=>{if(u.objectIsEmpty(p.dataset)&&u.error({componentName:"VueUiOnion",type:"dataset"}),t.value.responsive){const r=U.throttle(()=>{const{width:l,height:o}=U.useResponsive({chart:y.value,title:t.value.style.chart.title.text?V.value:null,legend:t.value.style.chart.legend.show?E.value:null});n.value.width=l,n.value.height=o,n.value.padding.top=Math.max(l,o)*.125,n.value.padding.right=Math.max(l,o)*.125,n.value.padding.bottom=Math.max(l,o)*.125,n.value.padding.left=Math.max(l,o)*.125,n.value.minRadius=Math.min(l,o)*.125});$.value=new ResizeObserver(r),$.value.observe(y.value.parentNode)}}),e.onBeforeUnmount(()=>{$.value&&$.value.disconnect()});const s=e.computed(()=>({top:n.value.padding.top,left:n.value.padding.left,right:n.value.width-n.value.padding.right,bottom:n.value.height-n.value.padding.bottom,centerX:n.value.width/2,centerY:n.value.height/2,width:n.value.width-n.value.padding.right-n.value.padding.left,height:n.value.height-n.value.padding.bottom-n.value.padding.top,minRadius:n.value.minRadius,maxRadius:Math.min(n.value.width,n.value.height)-n.value.padding.top*2})),i=e.computed(()=>(p.dataset.forEach((a,r)=>{[null,void 0].includes(a.name)&&u.error({componentName:"VueUiOnion",type:"datasetSerieAttribute",property:"name",index:r}),[void 0].includes(a.percentage)&&u.error({componentName:"VueUiOnion",type:"datasetSerieAttribute",property:"percentage",index:r})}),p.dataset.map((a,r)=>{const l=`onion_serie_${r}_${m.value}`;return{...a,percentage:a.percentage||0,targetPercentage:a.percentage||0,color:u.convertColorToHex(a.color)||Q.value[r]||u.palette[r],id:l,shape:"circle",opacity:c.value.includes(l)?.5:1,absoluteIndex:r,segregate:()=>D(l),isSegregated:c.value.includes(l)}}))),b=e.ref(i.value),Z=e.computed(()=>t.value.useStartAnimation),ee=e.ref(null),te=e.computed(()=>Math.max(...i.value.map(a=>a.percentage))),T=e.ref(!1);e.watch(()=>i.value,le,{immediate:!0});function le(){if(Z.value&&!T.value){let r=function(){a>=te.value?(cancelAnimationFrame(ee.value),b.value=i.value,T.value=!0):(b.value=i.value.map(l=>({...l,percentage:a<l.targetPercentage?a:l.targetPercentage})),a+=1,requestAnimationFrame(r),T.value=!0)};b.value=i.value.map(l=>({...l,percentage:0}));let a=0;r()}else b.value=i.value}const ae=e.computed(()=>({cy:"onion-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":""})),oe=e.computed(()=>i.value.filter(a=>!c.value.includes(a.id)).length),f=e.computed(()=>{const a=Math.min(s.value.width,s.value.height)/2/i.value.length;return{gutter:(a>t.value.style.chart.layout.maxThickness?t.value.style.chart.layout.maxThickness:a)*t.value.style.chart.layout.gutter.width,track:(a>t.value.style.chart.layout.maxThickness?t.value.style.chart.layout.maxThickness:a)*t.value.style.chart.layout.track.width}}),d=e.computed(()=>b.value.filter(a=>!c.value.includes(a.id)).map((a,r)=>{const l=(s.value.maxRadius-f.value.track)/oe.value/2*(1+r),o=s.value.centerY-l;return{percentage:a.percentage||0,...a,labelY:o,radius:l,path:re(l,a.percentage||0)}}));function re(a,r){const l=a*(1.5+(r/100>.3333333333333333?0:1-r/100))*Math.PI,o=a*1.5*Math.PI;return{bgDashArray:`${o} ${o}`,bgDashOffset:o-r/100*o,dashArray:`${l} ${l}`,dashOffset:l-r/100*l,fullOffset:0,active:`M${s.value.centerX},${s.value.centerY} A ${a},${a} 0 0 0 ${s.value.right},${s.value.top}`}}function D(a){c.value.includes(a)?c.value=c.value.filter(r=>r!==a):c.value.push(a),j("selectLegend",d.value)}function ne(){return d.value}const S=e.computed(()=>{const a=[t.value.table.translations.serie,t.value.table.translations.percentage,t.value.table.translations.value],r=d.value.map(l=>[l.name,l.percentage,l.value]);return{head:a,body:r}}),x=e.computed(()=>{const a=S.value.head,r=d.value.map(o=>[`<span style="color:${o.color}">⬤</span> ${o.name}`,`${Number(o.percentage??0).toFixed(t.value.table.td.roundingPercentage).toLocaleString()}%`,`${o.prefix||""}${[null,void 0,NaN,"NaN"].includes(o.value)?"-":o.value.toFixed(t.value.table.td.roundingValue).toLocaleString()}${o.suffix||""}`]),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{head:a,body:r,config:l,colNames:a}});function L(){e.nextTick(()=>{const a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],r=S.value.head,l=S.value.body,o=a.concat([r]).concat(l),h=u.createCsvContent(o);u.downloadCsv({csvContent:h,title:t.value.style.chart.title.text||"vue-ui-onion"})})}const v=e.ref(void 0),k=e.ref(!1);function ue(a){k.value=a,O.value+=1}const P=e.ref(null);function A({datapoint:a,seriesIndex:r,show:l=!0}){const o=a.absoluteIndex;v.value=r,P.value={datapoint:a,seriesIndex:o,series:i.value,config:t.value},C.value=l;let h="";const _=t.value.style.chart.tooltip.customFormat;if(u.isFunction(_)&&u.functionReturnsString(()=>_({seriesIndex:o,datapoint:a,series:i.value,config:t.value})))B.value=_({seriesIndex:o,datapoint:a,series:i.value,config:t.value});else{const N=t.value.style.chart.tooltip.showPercentage,F=t.value.style.chart.tooltip.showValue;h+=`<div style="width: 100%; border-bottom: 1px solid ${t.value.style.chart.tooltip.borderColor}; padding-bottom: 6px;margin-bottom:3px;display:flex;flex-direction:row;gap:3px;align-items:center"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${a.color}"/></svg><span></span>${a.name}</span></div>`,h+=`<div style="width:100%;text-align:left;"><b>${N?u.dataLabel({p:"",v:a.percentage,s:"%",r:t.value.style.chart.tooltip.roundingPercentage}):""}</b> ${N&&F?"(":""}${F?u.dataLabel({p:a.prefix||"",v:a.value,s:a.suffix||"",r:t.value.style.chart.tooltip.roundingValue}):""}${N&&F?")":""}</div>`,B.value=`<div>${h}</div>`}}function q(){g.value.showTable=!g.value.showTable}function Y(){g.value.showTooltip=!g.value.showTooltip}return W({getData:ne,generatePdf:R,generateCsv:L,generateImage:z,toggleTable:q,toggleTooltip:Y}),(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-onion ${k.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"onionChart",ref:y,id:`vue-ui-onion_${m.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:V,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor}`)},[e.createVNode(se._sfc_main,{config:{title:{cy:"onion-div-title",...t.value.style.chart.title},subtitle:{cy:"onion-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&w.value?(e.openBlock(),e.createBlock(X.UserOptions,{ref_key:"details",ref:K,key:`user_options${O.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(M),isPrinting:e.unref(I),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:k.value,isTooltip:g.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:y.value,onToggleFullscreen:ue,onGeneratePdf:e.unref(R),onGenerateCsv:L,onGenerateImage:e.unref(z),onToggleTable:q,onToggleTooltip:Y},e.createSlots({_:2},[a.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:o})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:o})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),w.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(u.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value}),viewBox:`0 0 ${n.value.width<=0?1e-4:n.value.width} ${n.value.height<=0?1e-4: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(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("circle",{cx:s.value.centerX,cy:s.value.centerY,r:l.radius<=0?1e-4:l.radius,stroke:t.value.style.chart.layout.gutter.color,"stroke-width":f.value.gutter,fill:"none","stroke-dasharray":l.path.bgDashArray,"stroke-dashoffset":l.path.fullOffset,"stroke-linecap":"round",class:e.normalizeClass({"vue-ui-onion-path":!0,"vue-ui-onion-blur":t.value.useBlurOnHover&&![null,void 0].includes(v.value)&&v.value!==o}),style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,10,me))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("circle",{cx:s.value.centerX,cy:s.value.centerY,r:l.radius<0?1e-4:l.radius,stroke:`${l.color}`,"stroke-width":f.value.track,fill:"none","stroke-dasharray":l.path.dashArray,"stroke-dashoffset":l.path.dashOffset,class:e.normalizeClass({"vue-ui-onion-path":!0,"vue-ui-onion-blur":t.value.useBlurOnHover&&![null,void 0].includes(v.value)&&v.value!==o}),"stroke-linecap":"round",style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,10,ye))),256)),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${m.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.gradientIntensity},null,8,ke)],8,be)]),t.value.style.chart.useGradient?(e.openBlock(),e.createElementBlock("g",{key:0,filter:`url(#blur_${m.value})`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("circle",{cx:s.value.centerX,cy:s.value.centerY,r:l.radius<=0?1e-4:l.radius,stroke:"white","stroke-width":f.value.track/3,fill:"none","stroke-linecap":"round","stroke-dasharray":l.path.dashArray,"stroke-dashoffset":l.path.dashOffset,style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,8,Ce))),256))],8,we)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("circle",{"data-cy-trap":"",cx:s.value.centerX,cy:s.value.centerY,r:l.radius<=0?1e-4:l.radius,stroke:"transparent","stroke-width":Math.max(f.value.track,f.value.gutter),fill:"none","stroke-dasharray":l.path.bgDashArray,"stroke-dashoffset":l.path.fullOffset,"stroke-linecap":"round",class:"vue-ui-onion-path",style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"},onMouseenter:h=>A({datapoint:l,show:!0,seriesIndex:o}),onMouseleave:r[0]||(r[0]=h=>{v.value=void 0,C.value=!1})},null,40,$e))),256)),t.value.style.chart.layout.labels.show?(e.openBlock(),e.createElementBlock("g",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("g",{onMouseenter:h=>A({datapoint:l,show:!0,seriesIndex:o}),onMouseleave:r[1]||(r[1]=h=>{v.value=void 0,C.value=!1})},[c.value.includes(l.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("text",{key:0,x:n.value.width/2-f.value.gutter*.8+t.value.style.chart.layout.labels.offsetX,y:l.labelY+t.value.style.chart.layout.labels.offsetY,"text-anchor":"end","font-size":t.value.style.chart.layout.labels.fontSize,fill:t.value.useBlurOnHover&&![null,void 0].includes(v.value)&&v.value===o?l.color:t.value.style.chart.layout.labels.color,"font-weight":t.value.style.chart.layout.labels.bold?"bold":"normal"},e.toDisplayString(l.name?l.name+": ":"")+" "+e.toDisplayString(t.value.style.chart.layout.labels.percentage.show?`${(l.percentage||0).toFixed(t.value.style.chart.layout.labels.roundingPercentage)}%`:"")+" "+e.toDisplayString(!t.value.style.chart.layout.labels.percentage.show&&t.value.style.chart.layout.labels.value.show?` : ${l.value?`${l.prefix||""}${l.value.toFixed(t.value.style.chart.layout.labels.roundingValue)}${l.suffix||""}`:""}`:`${t.value.style.chart.layout.labels.value.show&&l.value?`(${l.prefix||""}${l.value.toFixed(t.value.style.chart.layout.labels.roundingValue)}${l.suffix||""})`:""}`),9,Te))],40,Be))),256))])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:n.value},void 0,!0)],14,fe)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Se,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(I)||e.unref(M)})),void 0,!0)])):e.createCommentVNode("",!0),w.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ve.default,{key:4,config:{type:"onion",style:{backgroundColor:t.value.style.chart.backgroundColor,onion:{color:t.value.style.chart.layout.gutter.color}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:E},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(ie.Legend,{key:0,legendSet:i.value,config:ae.value,onClickMarker:r[2]||(r[2]=({legend:l})=>D(l.id))},{item:e.withCtx(({legend:l})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:o=>l.segregate(),style:e.normalizeStyle(`opacity:${c.value.includes(l.id)?.5:1}`)},e.toDisplayString(l.name?l.name+": ":"")+" "+e.toDisplayString((l.percentage||0).toFixed(t.value.style.chart.legend.roundingPercentage))+"% ",13,Pe)]),_:1},8,["legendSet","config"])):e.renderSlot(a.$slots,"legend",{key:1,legend:i.value},void 0,!0)],512),e.createVNode(de._sfc_main,{show:g.value.showTooltip&&C.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:y.value,content:B.value,isCustom:e.unref(u.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...P.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...P.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),w.value?(e.openBlock(),e.createBlock(he.default,{key:5,hideDetails:"",config:{open:g.value.showTable,maxHeight:1e4,head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ce.DataTable,{colNames:x.value.colNames,head:x.value.head,body:x.value.body,config:x.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:r[3]||(r[3]=l=>g.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l),1)]),td:e.withCtx(({td:l})=>[e.createElementVNode("div",{innerHTML:l},null,8,_e)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,pe))}},Fe=ge._export_sfc(Ne,[["__scopeId","data-v-d5bc0216"]]);exports.default=Fe;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-BFH7X8WG.cjs"),K=require("./useResponsive-B3TrDDIG.cjs"),de=require("./Title-CSQdI1EY.cjs"),ve=require("./Legend-tvvMRnbi.cjs"),he=require("./Tooltip-B-laoopT.cjs"),pe=require("./Shape-dvRttq7z.cjs"),Q=require("./usePrinter-hyuaFHQj.cjs"),me=require("./DataTable-D_2ZW2eI.cjs"),ye=require("./vue-ui-accordion-CvZhABQM.cjs"),fe=require("./vue-ui-skeleton-Df1qBO2k.cjs"),Z=require("./useNestedProp-B_z4-n52.cjs"),ge=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),be=["id"],ke=["xmlns","viewBox"],xe={style:{"pointer-events":"none"}},Ce=["x1","x2","y1","y2","stroke","stroke-width"],we=["x","y","fill","font-size","font-weight"],Be=["x1","x2","y1","y2","stroke","stroke-width"],$e=["x","y","fill","font-size","font-weight"],ze={key:0},Se=["x","y","font-size","fill"],Ne=["width","x","y"],Te={style:{width:"100%"}},Fe=["x","y","fill","font-weight","font-size","onMouseenter"],_e=["d","stroke","stroke-width","onMouseenter"],Pe={key:3,class:"vue-data-ui-watermark"},Me=["onClick"],Ae=["innerHTML"],Ee={__name:"vue-ui-parallel-coordinate-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(ee,{expose:te,emit:A}){const k=ee,{vue_ui_parallel_coordinate_plot:le}=i.useConfig(),x=e.computed({get(){return!!k.dataset&&k.dataset.length},set(l){return l}}),E=e.ref(0),w=e.ref(null),L=e.ref(null),I=e.ref(null),N=e.ref(i.createUid()),B=e.ref(!1);function ae(l){B.value=l,E.value+=1}const t=e.computed(()=>{const l=Z.useNestedProp({userConfig:k.config,defaultConfig:le});return l.theme?{...Z.useNestedProp({userConfig:i.themes.vue_ui_parallel_coordinate_plot[l.theme]||k.config,defaultConfig:l}),customPalette:i.themePalettes[l.theme]||i.palette}:l}),z=e.ref(null);e.onMounted(()=>{if(i.objectIsEmpty(k.dataset)?i.error({componentName:"VueUiParallelCoordinatePlot",type:"dataset"}):k.dataset.forEach((l,o)=>{i.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{x.value=!1,i.error({componentName:"VueUiParallelCoordinatePlot",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=K.throttle(()=>{const{width:o,height:a}=K.useResponsive({chart:w.value,title:t.value.style.chart.title.text?L.value:null,legend:t.value.style.chart.legend.show?I.value:null});c.value.width=o,c.value.height=a,c.value.plotSize=i.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.plots.radius,threshold:2,fallback:2}),c.value.ticksFontSize=i.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.yAxis.labels.ticks.fontSize,threshold:10,fallback:10}),c.value.datapointFontSize=i.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.yAxis.labels.datapoints.fontSize,threshold:10,fallback:10}),c.value.axisNameFontSize=i.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.yAxis.labels.axisNamesFontSize,threshold:12,fallback:12})});z.value=new ResizeObserver(l),z.value.observe(w.value.parentNode)}}),e.onBeforeUnmount(()=>{z.value&&z.value.disconnect()});const{isPrinting:V,isImaging:D,generatePdf:O,generateImage:q}=Q.usePrinter({elementId:`pcp_${N.value}`,fileName:t.value.style.chart.title.text||"vue-ui-parallel-coordinate-plot"}),c=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width,plotSize:t.value.style.chart.plots.radius,ticksFontSize:t.value.style.chart.yAxis.labels.ticks.fontSize,datapointFontSize:t.value.style.chart.yAxis.labels.datapoints.fontSize,axisNameFontSize:t.value.style.chart.yAxis.labels.axisNamesFontSize}),d=e.computed(()=>{const{top:l,right:o,bottom:a,left:n}=t.value.style.chart.padding,r=c.value.height,s=c.value.width;return{chartHeight:r,chartWidth:s,height:r-l-a,width:s-n-o,top:l,left:n,right:s-o,bottom:r-a}}),oe=e.computed(()=>i.convertCustomPalette(t.value.customPalette)),p=e.ref({dataLabels:{show:t.value.style.chart.yAxis.labels.datapoints.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),f=e.ref([]);function R(l){f.value.includes(l)?f.value=f.value.filter(o=>o!==l):f.value.push(l)}const b=e.computed(()=>k.dataset.map((l,o)=>{const a=i.convertColorToHex(l.color)||oe.value[o]||i.palette[o]||i.palette[o%i.palette.length];return{...l,series:l.series.map(n=>({...n,id:i.createUid(),color:a})),seriesIndex:o,color:a,id:i.createUid(),shape:l.shape||"circle"}})),ne=e.computed(()=>b.value.map(l=>({...l,opacity:f.value.includes(l.id)?.5:1,segregate:()=>R(l.id),isSegregated:f.value.includes(l.id)}))),se=e.computed(()=>({cy:"pcp-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":""})),U=e.computed(()=>Math.max(...b.value.filter(l=>!f.value.includes(l.id)).map(l=>Math.max(...l.series.flatMap(o=>o.values.length))))),y=e.computed(()=>d.value.width/U.value),T=e.computed(()=>b.value.filter(l=>!f.value.includes(l.id))),h=e.computed(()=>{let l=[];for(let o=0;o<U.value;o+=1){const a=Math.min(...T.value.flatMap(m=>m.series.map(S=>S.values[o]||0)||0)),n=Math.max(...T.value.flatMap(m=>m.series.map(S=>S.values[o]||0)||0)),r=n===a?a/4:a,s=n===a?n*2:n,u=i.calculateNiceScale(r,s,t.value.style.chart.yAxis.scaleTicks),g=u.ticks.map((m,S)=>{const ue=u.min<0?m+Math.abs(u.min):m-Math.abs(u.min),ce=u.min<0?u.max+Math.abs(u.min):u.max-Math.abs(u.min);return{y:d.value.bottom-d.value.height*(ue/ce),x:d.value.left+y.value*o+y.value/2,value:m}});l.push({scale:u,ticks:g,name:t.value.style.chart.yAxis.labels.axisNames[o]||`Y-${o+1}`})}return l}),F=e.computed(()=>T.value.map((l,o)=>({...l,series:l.series.map((a,n)=>({...a,datapoints:a.values.map((r,s)=>{const u=h.value[s].scale.min<0?(r||0)+Math.abs(h.value[s].scale.min):(r||0)-Math.abs(h.value[s].scale.min),g=h.value[s].scale.min<0?h.value[s].scale.max+Math.abs(h.value[s].scale.min):h.value[s].scale.max-Math.abs(h.value[s].scale.min);return{name:a.name,seriesName:l.name,axisIndex:s,datapointIndex:n,seriesIndex:o,value:r||0,x:d.value.left+y.value*s+y.value/2,y:d.value.bottom-d.value.height*(u/g),comment:a.comments&&a.comments[s]||""}})}))})).map(l=>({...l,series:l.series.map(o=>{const a=i.createStraightPath(o.datapoints),n=i.createSmoothPath(o.datapoints,.12),r=i.getPathLengthFromCoordinates(t.value.style.chart.lines.smooth?`M ${n}`:`M ${a}`);return{...o,smoothPath:n,straightPath:a,pathLength:r}})})));function W({value:l,index:o}){return i.dataLabel({p:t.value.style.chart.yAxis.labels.prefixes[o]||"",v:l,s:t.value.style.chart.yAxis.labels.suffixes[o]||"",r:t.value.style.chart.yAxis.labels.roundings[o]||0})}const v=e.ref(null),_=e.ref(null),$=e.ref(!1),P=e.ref("");function M({shape:l,serieName:o,serie:a,relativeIndex:n,seriesIndex:r}){_.value={serie:a,relativeIndex:n,seriesIndex:r,series:b.value,scales:h.value},$.value=!0,v.value=a.id;let s="";const u=t.value.style.chart.tooltip.customFormat;i.isFunction(u)&&i.functionReturnsString(()=>u({serie:a,seriesIndex:a.seriesIndex,series:b.value,config:t.value,scales:h.value}))?P.value=u({serie:a,seriesIndex:a.seriesIndex,series:b.value,config:t.value,scales:h.value}):(s+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o?o+" - ":""}${a.name}</div>`,h.value.map(g=>g.name).forEach((g,m)=>{s+=`
|
|
2
2
|
<div class="vue-ui-tooltip-item" style="text-align:left">
|
|
3
3
|
<span>${g}: </span>
|
|
4
4
|
<span>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as y, ref as f, onMounted as Ie, onBeforeUnmount as Pe, openBlock as u, createElementBlock as i, normalizeClass as E, normalizeStyle as _, createVNode as J, createCommentVNode as g, createBlock as D, unref as T, createSlots as Ne, withCtx as b, renderSlot as x, normalizeProps as j, guardReactiveProps as R, Fragment as w, renderList as M, createElementVNode as F, toDisplayString as N, createTextVNode as Le } from "vue";
|
|
2
|
-
import { u as Se, c as Q, t as Oe, a as De, p as U, o as We, e as ye, g as Be, b as Ee, d as je, z as Re, K as Ue, L as Ve, M as Ge, X as He, v as fe, f as ge, w as Xe, n as Ye, q as qe, B as V } from "./index-
|
|
2
|
+
import { u as Se, c as Q, t as Oe, a as De, p as U, o as We, e as ye, g as Be, b as Ee, d as je, z as Re, K as Ue, L as Ve, M as Ge, X as He, v as fe, f as ge, w as Xe, n as Ye, q as qe, B as V } from "./index-BE6fhUyH.js";
|
|
3
3
|
import { t as Ke, u as Je } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as Qe } from "./Title-
|
|
5
|
-
import { L as Ze } from "./Legend-
|
|
6
|
-
import { _ as et } from "./Tooltip-
|
|
7
|
-
import { _ as tt } from "./Shape-
|
|
8
|
-
import { u as at, U as lt } from "./usePrinter-
|
|
9
|
-
import { D as ot } from "./DataTable-
|
|
10
|
-
import st from "./vue-ui-accordion-
|
|
11
|
-
import nt from "./vue-ui-skeleton-
|
|
12
|
-
import { u as be } from "./useNestedProp-
|
|
4
|
+
import { _ as Qe } from "./Title-BcNPXpKX.js";
|
|
5
|
+
import { L as Ze } from "./Legend-Ct8LnAy4.js";
|
|
6
|
+
import { _ as et } from "./Tooltip-etzDGo1Y.js";
|
|
7
|
+
import { _ as tt } from "./Shape-qo5jcJq9.js";
|
|
8
|
+
import { u as at, U as lt } from "./usePrinter-CdIphKpF.js";
|
|
9
|
+
import { D as ot } from "./DataTable-Dytj5HQM.js";
|
|
10
|
+
import st from "./vue-ui-accordion-Dmz7RUKz.js";
|
|
11
|
+
import nt from "./vue-ui-skeleton-DZk__alb.js";
|
|
12
|
+
import { u as be } from "./useNestedProp-BcjRW6BJ.js";
|
|
13
13
|
import { _ as ut } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
14
|
const it = ["id"], rt = ["xmlns", "viewBox"], ct = { style: { "pointer-events": "none" } }, vt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], dt = ["x", "y", "fill", "font-size", "font-weight"], ht = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], pt = ["x", "y", "fill", "font-size", "font-weight"], mt = { key: 0 }, yt = ["x", "y", "font-size", "fill"], ft = ["width", "x", "y"], gt = { style: { width: "100%" } }, bt = ["x", "y", "fill", "font-weight", "font-size", "onMouseenter"], xt = ["d", "stroke", "stroke-width", "onMouseenter"], kt = {
|
|
15
15
|
key: 3,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as g, ref as h, onMounted as Re, onBeforeUnmount as Ve, watch as He, openBlock as o, createElementBlock as i, normalizeClass as z, normalizeStyle as k, createVNode as Z, createCommentVNode as c, createBlock as D, unref as L, createSlots as Oe, withCtx as $, renderSlot as q, normalizeProps as K, guardReactiveProps as ee, createElementVNode as v, Fragment as _, renderList as W, toDisplayString as m, createTextVNode as Ie, nextTick as De } from "vue";
|
|
2
|
-
import { u as Ee, c as Se, t as Ue, a as Ge, p as se, o as Qe, e as P, b as Je, r as te, d as je, X as Ze, s as Ke, N as et, C as tt, v as lt, w as at, n as ut, q as ot } from "./index-
|
|
2
|
+
import { u as Ee, c as Se, t as Ue, a as Ge, p as se, o as Qe, e as P, b as Je, r as te, d as je, X as Ze, s as Ke, N as et, C as tt, v as lt, w as at, n as ut, q as ot } from "./index-BE6fhUyH.js";
|
|
3
3
|
import { t as st, u as rt } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as it } from "./Title-
|
|
5
|
-
import { u as nt, U as vt } from "./usePrinter-
|
|
6
|
-
import { _ as dt } from "./Tooltip-
|
|
7
|
-
import { _ as Ce } from "./Shape-
|
|
8
|
-
import { L as ct } from "./Legend-
|
|
9
|
-
import { D as ht } from "./DataTable-
|
|
10
|
-
import yt from "./vue-ui-skeleton-
|
|
11
|
-
import bt from "./vue-ui-accordion-
|
|
12
|
-
import { u as ze } from "./useNestedProp-
|
|
4
|
+
import { _ as it } from "./Title-BcNPXpKX.js";
|
|
5
|
+
import { u as nt, U as vt } from "./usePrinter-CdIphKpF.js";
|
|
6
|
+
import { _ as dt } from "./Tooltip-etzDGo1Y.js";
|
|
7
|
+
import { _ as Ce } from "./Shape-qo5jcJq9.js";
|
|
8
|
+
import { L as ct } from "./Legend-Ct8LnAy4.js";
|
|
9
|
+
import { D as ht } from "./DataTable-Dytj5HQM.js";
|
|
10
|
+
import yt from "./vue-ui-skeleton-DZk__alb.js";
|
|
11
|
+
import bt from "./vue-ui-accordion-Dmz7RUKz.js";
|
|
12
|
+
import { u as ze } from "./useNestedProp-BcjRW6BJ.js";
|
|
13
13
|
import { _ as ft } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
14
|
const pt = ["id"], gt = ["xmlns", "viewBox", "id"], mt = ["id"], xt = ["stop-color"], $t = ["stop-color"], kt = { key: 0 }, Lt = ["fill", "x", "y", "height", "width", "stroke-width", "stroke", "rx"], wt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], qt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], _t = { key: 1 }, St = ["points", "fill"], Ct = ["points", "fill"], zt = ["points", "fill"], Tt = ["points", "fill"], Wt = { key: 2 }, Xt = ["y", "fill", "font-size"], Yt = ["x", "y", "fill", "font-size"], Mt = ["x", "y", "fill", "font-size"], Nt = ["y", "fill", "font-size"], At = { key: 3 }, Bt = ["x", "y", "font-size", "fill"], Pt = ["x", "y", "font-size", "fill"], Ft = ["x", "y", "font-size", "fill"], Rt = ["id", "font-size", "transform", "fill"], Vt = ["id", "font-size", "transform", "fill"], Ht = ["id", "font-size", "transform", "fill"], Ot = { key: 4 }, It = ["fill", "points"], Dt = ["x", "y", "width", "height"], Et = ["x", "y", "width", "height"], Ut = ["x", "y", "width", "height"], Gt = ["x", "y", "width", "height"], Qt = { key: 0 }, Jt = ["x", "y", "font-size", "fill"], jt = { key: 0 }, Zt = ["x", "y", "onMouseover", "onClick"], Kt = {
|
|
15
15
|
key: 7,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-oufiZvaS.cjs"),se=require("./useResponsive-B3TrDDIG.cjs"),$e=require("./Title-DxNugmhI.cjs"),ie=require("./usePrinter-Cc8ufBvU.cjs"),Le=require("./Tooltip-BC2Wlz7P.cjs"),ce=require("./Shape-DW18-C9f.cjs"),Ce=require("./Legend-BwrzHxLy.cjs"),we=require("./DataTable-CHXdpx94.cjs"),Se=require("./vue-ui-skeleton-Fsru0dbb.cjs"),qe=require("./vue-ui-accordion-DiR0dVog.cjs"),ve=require("./useNestedProp-CmTItGss.cjs"),Be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),_e=["id"],ze=["xmlns","viewBox","id"],Ne=["id"],Ve=["stop-color"],Ee=["stop-color"],Te={key:0},We=["fill","x","y","height","width","stroke-width","stroke","rx"],Xe=["x1","y1","x2","y2","stroke","stroke-width"],Ye=["x1","y1","x2","y2","stroke","stroke-width"],Me={key:1},Fe=["points","fill"],Pe=["points","fill"],Ae=["points","fill"],Re=["points","fill"],De={key:2},He=["y","fill","font-size"],Oe=["x","y","fill","font-size"],Ie=["x","y","fill","font-size"],Ue=["y","fill","font-size"],Ge={key:3},Qe=["x","y","font-size","fill"],Je=["x","y","font-size","fill"],je=["x","y","font-size","fill"],Ze=["id","font-size","transform","fill"],Ke=["id","font-size","transform","fill"],et=["id","font-size","transform","fill"],tt={key:4},lt=["fill","points"],at=["x","y","width","height"],ot=["x","y","width","height"],ut=["x","y","width","height"],rt=["x","y","width","height"],nt={key:0},st=["x","y","font-size","fill"],it={key:0},ct=["x","y","onMouseover","onClick"],vt={key:7,class:"vue-ui-dna"},dt=["points","fill"],ht=["points","fill"],yt=["points","fill"],bt=["points","fill"],mt={key:8},ft=["x","y","font-size","fill","font-weight"],pt={key:9},gt=["x","y","fill"],xt=["x","y","fill"],kt=["x","y","fill"],$t=["x","y","fill"],Lt=["stroke","d"],Ct=["stroke","d"],wt={key:3,class:"vue-data-ui-watermark"},St=["onClick"],qt={key:0,height:"14",width:"14",viewBox:"0 0 20 20"},Bt=["innerHTML"],_t={__name:"vue-ui-quadrant",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectPlot","selectSide","selectLegend"],setup(de,{expose:he,emit:M}){const x=de,{vue_ui_quadrant:ye}=c.useConfig(),V=e.computed(()=>!!x.dataset&&x.dataset.length),p=e.ref(c.createUid()),be=e.ref(null),E=e.ref(!1),F=e.ref(""),R=e.ref(0),h=e.ref(!1),S=e.ref(null),D=e.ref(null),H=e.ref(null),l=e.computed(()=>{const a=ve.useNestedProp({userConfig:x.config,defaultConfig:ye});return a.theme?{...ve.useNestedProp({userConfig:c.themes.vue_ui_quadrant[a.theme]||x.config,defaultConfig:a}),customPalette:c.themePalettes[a.theme]||c.palette}:a}),T=e.ref(null);e.onMounted(()=>{if(c.objectIsEmpty(x.dataset)?c.error({componentName:"VueUiQuadrant",type:"dataset"}):x.dataset.forEach((a,u)=>{[null,void 0].includes(a.name)&&c.error({componentName:"VueUiQuadrant",type:"datasetSerieAttribute",property:"name",index:u}),[null,void 0].includes(a.series)?c.error({componentName:"VueUiQuadrant",type:"datasetSerieAttribute",property:"series",index:u}):a.series.forEach((o,r)=>{[null,void 0].includes(o.name)&&c.error({componentName:"VueUiQuadrant",type:"datasetSerieAttribute",property:"name",key:"series",index:r})})}),l.value.responsive){const a=se.throttle(()=>{const{width:u,height:o}=se.useResponsive({chart:S.value,title:l.value.style.chart.title.text?D.value:null,legend:l.value.style.chart.legend.show?H.value:null});y.value=48,t.value.height=o,t.value.usableHeight=o-y.value*2,t.value.width=u,t.value.usableWidth=u-y.value*2,t.value.top=y.value,t.value.left=y.value,t.value.right=u-y.value,t.value.bottom=o-y.value,t.value.centerX=u/2,t.value.centerY=o-o/2,t.value.padding=y.value});T.value=new ResizeObserver(a),T.value.observe(S.value.parentNode)}}),e.onBeforeUnmount(()=>{T.value&&T.value.disconnect()});const{isPrinting:O,isImaging:I,generatePdf:U,generateImage:G}=ie.usePrinter({elementId:`vue-ui-quadrant_${p.value}`,fileName:l.value.style.chart.title.text||"vue-ui-quadrant"}),Q=e.computed(()=>c.convertCustomPalette(l.value.customPalette)),m=e.ref({plotLabels:{show:l.value.style.chart.layout.labels.plotLabels.show},showTable:l.value.table.show,showTooltip:l.value.style.chart.tooltip.show}),y=e.ref(48),t=e.ref({height:l.value.style.chart.height,usableHeight:l.value.style.chart.height-y.value*2,width:l.value.style.chart.width,usableWidth:l.value.style.chart.width-y.value*2,top:y.value,left:y.value,right:l.value.style.chart.width-y.value,bottom:l.value.style.chart.height-y.value,centerX:l.value.style.chart.width/2,centerY:l.value.style.chart.height-l.value.style.chart.height/2,padding:y.value}),i=e.ref({...JSON.parse(JSON.stringify(t.value)),startX:0,startY:0});e.watch(()=>t.value,a=>{a&&(i.value={...JSON.parse(JSON.stringify(t.value)),startX:0,startY:0})},{deep:!0});const s=e.ref(null),C=e.computed(()=>{switch(s.value){case"TL":return{x:i.value.startX+i.value.width/2,y:i.value.height,text:l.value.style.chart.layout.labels.quadrantLabels.tl.text||"Top Left",fontSize:l.value.style.chart.layout.labels.quadrantLabels.tl.fontSize,fill:l.value.style.chart.layout.labels.quadrantLabels.tl.color,bold:l.value.style.chart.layout.labels.quadrantLabels.tl.bold};case"TR":return{x:i.value.startX+i.value.width/2,y:i.value.height,text:l.value.style.chart.layout.labels.quadrantLabels.tr.text||"Top Right",fontSize:l.value.style.chart.layout.labels.quadrantLabels.tr.fontSize,fill:l.value.style.chart.layout.labels.quadrantLabels.tr.color,bold:l.value.style.chart.layout.labels.quadrantLabels.tr.bold};case"BR":return{x:i.value.startX+i.value.width/2,y:i.value.height*1.678,text:l.value.style.chart.layout.labels.quadrantLabels.br.text||"Bottom Right",fontSize:l.value.style.chart.layout.labels.quadrantLabels.br.fontSize,fill:l.value.style.chart.layout.labels.quadrantLabels.br.color,bold:l.value.style.chart.layout.labels.quadrantLabels.br.bold};case"BL":return{x:i.value.startX+i.value.width/2,y:i.value.height*1.678,text:l.value.style.chart.layout.labels.quadrantLabels.bl.text||"Bottom Left",fontSize:l.value.style.chart.layout.labels.quadrantLabels.bl.fontSize,fill:l.value.style.chart.layout.labels.quadrantLabels.bl.color,bold:l.value.style.chart.layout.labels.quadrantLabels.bl.bold};default:return{x:0,y:0,text:"",fontSize:0,fill:"none",bold:!1}}}),me=e.ref(null),W=e.ref(!1);function q({targetX:a,targetY:u,targetW:o,targetH:r,side:n}){s.value&&z(n);const v={x:a-i.value.startX,y:u-i.value.startY,w:o-i.value.width,h:r-i.value.height},d=l.value.zoomAnimationFrames;let g=0;function ne(){W.value=!0,i.value.startX+=v.x/d,i.value.startY+=v.y/d,i.value.width+=v.w/d,i.value.height+=v.h/d,g+=1,g<d?me.value=requestAnimationFrame(ne):W.value=!1}ne()}function k(a){if(!W.value)if(h.value&&s.value===a)q({targetX:0,targetY:0,targetW:t.value.width,targetH:t.value.height}),s.value=null,h.value=!1;else{switch(s.value=a,a){case"TL":q({targetX:0,targetY:0,targetW:t.value.width/2+t.value.left,targetH:t.value.height/2+t.value.top,side:"tl"});break;case"TR":q({targetX:t.value.width/2-t.value.left,targetY:0,targetW:t.value.width/2+t.value.left,targetH:t.value.height/2+t.value.top,side:"tr"});break;case"BR":q({targetX:t.value.width/2-t.value.left,targetY:t.value.height/2-t.value.top,targetW:t.value.width/2+t.value.left,targetH:t.value.height/2+t.value.top,side:"br"});break;case"BL":q({targetX:0,targetY:t.value.height/2-t.value.top,targetW:t.value.width/2+t.value.left,targetH:t.value.height/2+t.value.top,side:"bl"});break;default:i.value.startX=0,i.value.startY=0,i.value.width=t.value.width,i.value.height=t.value.height;break}h.value=!0}}const fe=e.computed(()=>{const a=l.value.style.chart.layout.grid.graduations.steps,u=t.value.usableWidth/(a*2),o=t.value.top,r=[];for(let n=0;n<a;n+=1)r.push({x:t.value.padding+u*n,y:o+t.value.usableHeight*(n/a/2),height:t.value.usableHeight*(1-n/a),width:t.value.usableWidth*(1-n/a),opacity:c.opacity[Math.round((n+1)/a*20)]});return r}),$=e.computed(()=>{let a=l.value.style.chart.layout.grid.xAxis.max,u=l.value.style.chart.layout.grid.xAxis.min,o=l.value.style.chart.layout.grid.yAxis.max,r=l.value.style.chart.layout.grid.yAxis.min;return l.value.style.chart.layout.grid.xAxis.auto&&(a=Math.max(...w.value.flatMap(n=>n.series.map(v=>v.x))),u=Math.min(...w.value.flatMap(n=>n.series.map(v=>v.x)))),l.value.style.chart.layout.grid.yAxis.auto&&(o=Math.max(...w.value.flatMap(n=>n.series.map(v=>v.y))),r=Math.min(...w.value.flatMap(n=>n.series.map(v=>v.y)))),{x:{max:a,min:u},y:{max:o,min:r}}}),L=e.ref([]),w=e.computed(()=>x.dataset.map((a,u)=>({...a,id:`cat_${u}_${p.value}`,color:c.convertColorToHex(a.color)||Q.value[u]||c.palette[u]}))),pe=e.computed(()=>w.value.filter(a=>!L.value.includes(a.id))),ge=e.computed(()=>w.value.map((a,u)=>({...a,shape:a.shape||"circle",series:a.series.map(o=>({...o,x:J(o.x),y:j(o.y),xValue:o.x,yValue:o.y,quadrantSide:K({x:o.x,y:o.y}),categoryName:a.name,shape:a.shape,color:a.color}))}))),f=e.computed(()=>(x.dataset.forEach((a,u)=>{a.series.forEach((o,r)=>{[null,void 0].includes(o.x)&&c.error({componentName:"VueUiQuadrant",type:"datasetSerieAttribute",property:"x",key:"series",index:r}),[null,void 0].includes(o.y)&&c.error({componentName:"VueUiQuadrant",type:"datasetSerieAttribute",property:"y",key:"series",index:r})})}),pe.value.map((a,u)=>({...a,shape:a.shape||"circle",color:a.color||Q.value[u]||c.palette[u],series:a.series.map(o=>({...o,x:J(o.x),y:j(o.y),xValue:o.x,yValue:o.y,quadrantSide:K({x:o.x,y:o.y}),categoryName:a.name,shape:a.shape,color:a.color,uid:c.createUid()}))}))));function J(a){if(a>=0){const u=a/$.value.x.max;return t.value.centerX+t.value.usableWidth/2*u}else{const u=Math.abs(a)/Math.abs($.value.x.min);return t.value.centerX-t.value.usableWidth/2*u}}function j(a){if(a>=0){const u=a/$.value.y.max;return t.value.centerY+(1-t.value.usableHeight/2*u)}else{const u=Math.abs(a)/Math.abs($.value.y.min);return t.value.centerY-(1-t.value.usableHeight/2*u)}}const X=e.computed(()=>{const a=f.value.flatMap(d=>d.series.map(g=>({x:g.xValue,y:g.yValue,name:g.name,category:g.categoryName,quadrantSide:g.quadrantSide,sideName:l.value.style.chart.layout.labels.quadrantLabels[g.quadrantSide].text,color:d.color,shape:d.shape}))),u=l.value.style.chart.layout.grid.xAxis.name||"x",o=l.value.style.chart.layout.grid.yAxis.name||"y",r=[l.value.translations.category,l.value.translations.item,u,o,l.value.translations.side],n=a.map(d=>[d.category,d.name,d.x,d.y,d.sideName||d.quadrantSide]),v=a.map(d=>({shape:d.shape,color:d.color}));return{head:r,body:n,itsShapes:v,tableData:a}}),Y=e.computed(()=>{const a=X.value.head,u=X.value.tableData.map(r=>[{shape:r.shape,color:r.color,name:r.category},r.name,r.x,r.y,r.sideName||r.quadrantSide]),o={th:{backgroundColor:l.value.table.th.backgroundColor,color:l.value.table.th.color,outline:l.value.table.th.outline},td:{backgroundColor:l.value.table.td.backgroundColor,color:l.value.table.td.color,outline:l.value.table.td.outline},breakpoint:l.value.table.responsiveBreakpoint};return{head:a,body:u,config:o,colNames:a}});function P(a){L.value.includes(a)?L.value=L.value.filter(o=>o!==a):L.value.push(a);const u=le();M("selectLegend",u)}const Z=e.computed(()=>ge.value.map(a=>({name:a.name,shape:a.shape,color:a.color,id:a.id,opacity:L.value.includes(a.id)?.5:1,segregate:()=>P(a.id),isSegregated:L.value.includes(a.id)}))),xe=e.computed(()=>({cy:"quadrant-div-legend",backgroundColor:l.value.style.chart.legend.backgroundColor,color:l.value.style.chart.legend.color,fontSize:l.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:l.value.style.chart.legend.bold?"bold":""}));function K(a){switch(!0){case(a.x>=0&&a.y>=0):return"tr";case(a.x>=0&&a.y<0):return"br";case(a.x<0&&a.y<0):return"bl";case(a.x<0&&a.y>=0):return"tl";default:return""}}const B=e.ref(null),_=e.ref(null),A=e.ref(null);function ee(a,u,o){B.value=u.uid,_.value={color:a.color,shape:a.shape},A.value={datapoint:u,seriesIndex:o,series:f.value,config:l.value},E.value=!0;const r=l.value.style.chart.tooltip.customFormat;if(c.isFunction(r)&&c.functionReturnsString(()=>r({seriesIndex:o,datapoint:u,series:f.value,config:l.value})))F.value=r({seriesIndex:o,datapoint:u,series:f.value,config:l.value});else{let n="";u.quadrantSide&&(n+=`<div style="color:${l.value.style.chart.layout.labels.quadrantLabels[u.quadrantSide].color};font-weight:${l.value.style.chart.layout.labels.quadrantLabels[u.quadrantSide].bold?"bold":"400"}">${l.value.style.chart.layout.labels.quadrantLabels[u.quadrantSide].text}</div>`),n+=`<div>${a.name}</div>`,n+=`<div style="padding-bottom:6px;border-bottom:1px solid ${l.value.style.chart.tooltip.borderColor};margin-bottom:3px">${u.name}</div>`,n+=`<div>${l.value.style.chart.layout.grid.xAxis.name?l.value.style.chart.layout.grid.xAxis.name:"x"}: <b>${u.xValue.toFixed(l.value.style.chart.tooltip.roundingValue)}</b></div>`,n+=`<div>${l.value.style.chart.layout.grid.yAxis.name?l.value.style.chart.layout.grid.yAxis.name:"y"}: <b>${u.yValue.toFixed(l.value.style.chart.tooltip.roundingValue)}</b></div>`,F.value=`<div style="text-align:left;font-size:${l.value.style.chart.tooltip.fontSize}px">${n}</div>`}}function te(a,u){const o={category:a.name,shape:a.shape,itemName:u.name,x:u.xValue,y:u.yValue,quadrantSide:u.quadrantSide,sideName:l.value.style.chart.layout.labels.quadrantLabels[u.quadrantSide].text};M("selectPlot",o)}function z(a){if(!a)return;const u=f.value.flatMap(r=>r.series.filter(n=>n.quadrantSide===a).map(n=>({category:n.categoryName,itemName:n.name,x:n.xValue,y:n.yValue}))),o={quadrantSide:a,sideName:l.value.style.chart.layout.labels.quadrantLabels[a].text,items:[...u]};M("selectSide",o)}const b=e.computed(()=>({TL:{tl:{x:t.value.left+t.value.usableWidth/4-20,y:0,fill:l.value.style.chart.layout.labels.quadrantLabels.tl.color},tr:{x:t.value.left+t.value.usableWidth/4,y:0,fill:l.value.style.chart.layout.labels.quadrantLabels.tr.color},br:{x:t.value.left+t.value.usableWidth/4,y:20,fill:l.value.style.chart.layout.labels.quadrantLabels.br.color},bl:{x:t.value.left+t.value.usableWidth/4-20,y:20,fill:l.value.style.chart.layout.labels.quadrantLabels.bl.color},crosshairs:{horizontal:`M ${t.value.left+t.value.usableWidth/4-20},20 ${t.value.left+t.value.usableWidth/4+20},20`,vertical:`M ${t.value.left+t.value.usableWidth/4},0 ${t.value.left+t.value.usableWidth/4},40`}},TR:{tl:{x:t.value.centerX+t.value.usableWidth/4-20,y:0,fill:l.value.style.chart.layout.labels.quadrantLabels.tl.color},tr:{x:t.value.centerX+t.value.usableWidth/4,y:0,fill:l.value.style.chart.layout.labels.quadrantLabels.tr.color},br:{x:t.value.centerX+t.value.usableWidth/4,y:20,fill:l.value.style.chart.layout.labels.quadrantLabels.br.color},bl:{x:t.value.centerX+t.value.usableWidth/4-20,y:20,fill:l.value.style.chart.layout.labels.quadrantLabels.bl.color},crosshairs:{horizontal:`M ${t.value.centerX+t.value.usableWidth/4-20},20 ${t.value.centerX+t.value.usableWidth/4+20},20`,vertical:`M ${t.value.centerX+t.value.usableWidth/4},0 ${t.value.centerX+t.value.usableWidth/4},40`}},BR:{tl:{x:t.value.centerX+t.value.usableWidth/4-20,y:t.value.centerY-48,fill:l.value.style.chart.layout.labels.quadrantLabels.tl.color},tr:{x:t.value.centerX+t.value.usableWidth/4,y:t.value.centerY-48,fill:l.value.style.chart.layout.labels.quadrantLabels.tr.color},br:{x:t.value.centerX+t.value.usableWidth/4,y:t.value.centerY-28,fill:l.value.style.chart.layout.labels.quadrantLabels.br.color},bl:{x:t.value.centerX+t.value.usableWidth/4-20,y:t.value.centerY-28,fill:l.value.style.chart.layout.labels.quadrantLabels.bl.color},crosshairs:{horizontal:`M ${t.value.centerX+t.value.usableWidth/4-20},${t.value.centerY-28} ${t.value.centerX+t.value.usableWidth/4+20},${t.value.centerY-28}`,vertical:`M ${t.value.centerX+t.value.usableWidth/4},${t.value.centerY-48} ${t.value.centerX+t.value.usableWidth/4},${t.value.centerY-8}`}},BL:{tl:{x:t.value.left+t.value.usableWidth/4-20,y:t.value.centerY-48,fill:l.value.style.chart.layout.labels.quadrantLabels.tl.color},tr:{x:t.value.left+t.value.usableWidth/4,y:t.value.centerY-48,fill:l.value.style.chart.layout.labels.quadrantLabels.tr.color},br:{x:t.value.left+t.value.usableWidth/4,y:t.value.centerY-28,fill:l.value.style.chart.layout.labels.quadrantLabels.br.color},bl:{x:t.value.left+t.value.usableWidth/4-20,y:t.value.centerY-28,fill:l.value.style.chart.layout.labels.quadrantLabels.bl.color},crosshairs:{horizontal:`M ${t.value.left+t.value.usableWidth/4-20},${t.value.centerY-28} ${t.value.left+t.value.usableWidth/4+20},${t.value.centerY-28}`,vertical:`M ${t.value.left+t.value.usableWidth/4},${t.value.centerY-48} ${t.value.left+t.value.usableWidth/4},${t.value.centerY-8}`}}}));function le(){return f.value.map(a=>({color:a.color,name:a.name,shape:a.shape,series:a.series.map(u=>({name:u.name,x:u.xValue,y:u.yValue,quadrantSide:u.quadrantSide,sideName:l.value.style.chart.layout.labels.quadrantLabels[u.quadrantSide].text}))}))}function ae(){e.nextTick(()=>{const a=[[l.value.style.chart.title.text],[l.value.style.chart.title.subtitle.text],[""]],u=X.value.head,o=X.value.body,r=a.concat([u]).concat(o),n=c.createCsvContent(r);c.downloadCsv({csvContent:n,title:l.value.style.chart.title.text||"vue-ui-quadrant"})})}const N=e.ref(!1);function ke(a){N.value=a,R.value+=1}function oe(){m.value.showTable=!m.value.showTable}function ue(){m.value.plotLabels.show=!m.value.plotLabels.show}function re(){m.value.showTooltip=!m.value.showTooltip}return he({getData:le,generatePdf:U,generateCsv:ae,generateImage:G,toggleTable:oe,toggleLabels:ue,toggleTooltip:re}),(a,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-quadrant ${N.value?"vue-data-ui-wrapper-fullscreen":""} ${l.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"quadrantChart",ref:S,id:`vue-ui-quadrant_${p.value}`,style:e.normalizeStyle(`font-family:${l.value.style.fontFamily};width:100%; text-align:center;${l.value.style.chart.title.text?"":"padding-top: 36px"};background:${l.value.style.chart.backgroundColor};${l.value.responsive?"height: 100%":""}`)},[l.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:D,style:e.normalizeStyle(`width:100%;background:${l.value.style.chart.backgroundColor};padding-bottom:12px`)},[e.createVNode($e._sfc_main,{config:{title:{cy:"quadrant-title",...l.value.style.chart.title},subtitle:{cy:"quadrant-subtitle",...l.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),l.value.userOptions.show&&V.value?(e.openBlock(),e.createBlock(ie.UserOptions,{ref_key:"details",ref:be,key:`user_options_${R.value}`,backgroundColor:l.value.style.chart.backgroundColor,color:l.value.style.chart.color,isImaging:e.unref(I),isPrinting:e.unref(O),uid:p.value,hasTooltip:l.value.userOptions.buttons.tooltip&&l.value.style.chart.tooltip.show,hasPdf:l.value.userOptions.buttons.pdf,hasImg:l.value.userOptions.buttons.img,hasXls:l.value.userOptions.buttons.csv,hasTable:l.value.userOptions.buttons.table,hasLabel:l.value.userOptions.buttons.labels,hasFullscreen:l.value.userOptions.buttons.fullscreen,isFullscreen:N.value,isTooltip:m.value.showTooltip,titles:{...l.value.userOptions.buttonTitles},chartElement:S.value,onToggleFullscreen:ke,onGeneratePdf:e.unref(U),onGenerateCsv:ae,onGenerateImage:e.unref(G),onToggleTable:oe,onToggleLabels:ue,onToggleTooltip:re},e.createSlots({_:2},[a.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,a.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:r})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasLabel","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(c.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":N.value,"vue-data-ui-fulscreen--off":!N.value}),viewBox:`${i.value.startX} ${i.value.startY} ${i.value.width} ${i.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:${h.value?"hidden":"visible"};background:${l.value.style.chart.backgroundColor};color:${l.value.style.chart.color}`),id:`svg_${p.value}`},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(o,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`quadrant_gradient_${p.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(c.shiftHue)(o.color,.05)}${e.unref(c.opacity)[l.value.style.chart.layout.areas.opacity]}`},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":o.color+e.unref(c.opacity)[l.value.style.chart.layout.areas.opacity]},null,8,Ee)],8,Ne))),256))]),l.value.style.chart.layout.grid.graduations.show?(e.openBlock(),e.createElementBlock("g",Te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,o=>(e.openBlock(),e.createElementBlock("rect",{fill:l.value.style.chart.layout.grid.graduations.fill?`${l.value.style.chart.layout.grid.graduations.color}${o.opacity}`:"none",x:o.x,y:o.y,height:o.height<=0?.001:o.height,width:o.width<=0?.001:o.width,"stroke-width":l.value.style.chart.layout.grid.graduations.strokeWidth,stroke:l.value.style.chart.layout.grid.graduations.stroke,rx:l.value.style.chart.layout.grid.graduations.roundingForce},null,8,We))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:t.value.left,y1:t.value.centerY,x2:t.value.right,y2:t.value.centerY,stroke:l.value.style.chart.layout.grid.stroke,"stroke-width":l.value.style.chart.layout.grid.strokeWidth},null,8,Xe),e.createElementVNode("line",{x1:t.value.centerX,y1:t.value.top,x2:t.value.centerX,y2:t.value.bottom,stroke:l.value.style.chart.layout.grid.stroke,"stroke-width":l.value.style.chart.layout.grid.strokeWidth},null,8,Ye),l.value.style.chart.layout.grid.showArrows?(e.openBlock(),e.createElementBlock("g",Me,[e.createElementVNode("polygon",{points:`${t.value.right-8},${t.value.centerY-6} ${t.value.right},${t.value.centerY} ${t.value.right-8},${t.value.centerY+6}`,fill:l.value.style.chart.layout.grid.stroke,stroke:"none"},null,8,Fe),e.createElementVNode("polygon",{points:`${t.value.left+8},${t.value.centerY-6} ${t.value.left},${t.value.centerY} ${t.value.left+8},${t.value.centerY+6}`,fill:l.value.style.chart.layout.grid.stroke,stroke:"none"},null,8,Pe),e.createElementVNode("polygon",{points:`${t.value.centerX-6},${t.value.top+8} ${t.value.centerX},${t.value.top} ${t.value.centerX+6},${t.value.top+8}`,fill:l.value.style.chart.layout.grid.stroke,stroke:"none"},null,8,Ae),e.createElementVNode("polygon",{points:`${t.value.centerX-6},${t.value.bottom-8} ${t.value.centerX},${t.value.bottom} ${t.value.centerX+6},${t.value.bottom-8}`,fill:l.value.style.chart.layout.grid.stroke,stroke:"none"},null,8,Re)])):e.createCommentVNode("",!0),l.value.style.chart.layout.labels.quadrantLabels.show&&!h.value?(e.openBlock(),e.createElementBlock("g",De,[l.value.style.chart.layout.labels.quadrantLabels.tl.text?(e.openBlock(),e.createElementBlock("text",{key:0,x:0,y:t.value.top-t.value.padding/2,"text-anchor":"start",fill:l.value.style.chart.layout.labels.quadrantLabels.tl.color,"font-size":l.value.style.chart.layout.labels.quadrantLabels.tl.fontSize,style:e.normalizeStyle(`font-weight:${l.value.style.chart.layout.labels.quadrantLabels.tl.bold?"bold":""}`),onClick:u[0]||(u[0]=o=>z("tl"))},e.toDisplayString(l.value.style.chart.layout.labels.quadrantLabels.tl.text),13,He)):e.createCommentVNode("",!0),l.value.style.chart.layout.labels.quadrantLabels.tr.text?(e.openBlock(),e.createElementBlock("text",{key:1,x:t.value.width,y:t.value.top-t.value.padding/2,"text-anchor":"end",fill:l.value.style.chart.layout.labels.quadrantLabels.tr.color,"font-size":l.value.style.chart.layout.labels.quadrantLabels.tr.fontSize,style:e.normalizeStyle(`font-weight:${l.value.style.chart.layout.labels.quadrantLabels.tr.bold?"bold":""}`),onClick:u[1]||(u[1]=o=>z("tr"))},e.toDisplayString(l.value.style.chart.layout.labels.quadrantLabels.tr.text),13,Oe)):e.createCommentVNode("",!0),l.value.style.chart.layout.labels.quadrantLabels.br.text?(e.openBlock(),e.createElementBlock("text",{key:2,x:t.value.width,y:t.value.bottom+t.value.padding*.7,"text-anchor":"end",fill:l.value.style.chart.layout.labels.quadrantLabels.br.color,"font-size":l.value.style.chart.layout.labels.quadrantLabels.br.fontSize,style:e.normalizeStyle(`font-weight:${l.value.style.chart.layout.labels.quadrantLabels.br.bold?"bold":""}`),onClick:u[2]||(u[2]=o=>z("br"))},e.toDisplayString(l.value.style.chart.layout.labels.quadrantLabels.br.text),13,Ie)):e.createCommentVNode("",!0),l.value.style.chart.layout.labels.quadrantLabels.bl.text?(e.openBlock(),e.createElementBlock("text",{key:3,x:0,y:t.value.bottom+t.value.padding*.7,"text-anchor":"start",fill:l.value.style.chart.layout.labels.quadrantLabels.bl.color,"font-size":l.value.style.chart.layout.labels.quadrantLabels.bl.fontSize,style:e.normalizeStyle(`font-weight:${l.value.style.chart.layout.labels.quadrantLabels.bl.bold?"bold":""}`),onClick:u[3]||(u[3]=o=>z("bl"))},e.toDisplayString(l.value.style.chart.layout.labels.quadrantLabels.bl.text),13,Ue)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),l.value.style.chart.layout.labels.axisLabels.show?(e.openBlock(),e.createElementBlock("g",Ge,[e.createElementVNode("text",{x:t.value.centerX,y:t.value.top-t.value.padding/6,"text-anchor":"middle","font-size":l.value.style.chart.layout.labels.axisLabels.fontSize,fill:l.value.style.chart.layout.labels.axisLabels.color.positive},e.toDisplayString($.value.y.max),9,Qe),e.createElementVNode("text",{x:t.value.centerX,y:t.value.top-t.value.padding/2,"text-anchor":"middle","font-size":l.value.style.chart.layout.labels.axisLabels.fontSize,fill:l.value.style.chart.layout.labels.axisLabels.color.positive},e.toDisplayString(l.value.style.chart.layout.grid.yAxis.name),9,Je),e.createElementVNode("text",{x:t.value.centerX,y:t.value.bottom+t.value.padding*.35,"text-anchor":"middle","font-size":l.value.style.chart.layout.labels.axisLabels.fontSize,fill:l.value.style.chart.layout.labels.axisLabels.color.negative},e.toDisplayString($.value.y.min),9,je),e.createElementVNode("text",{id:`xLabelMin_${p.value}`,"text-anchor":"middle","font-size":l.value.style.chart.layout.labels.axisLabels.fontSize,transform:`translate(${t.value.padding-l.value.style.chart.layout.labels.axisLabels.fontSize}, ${t.value.height/2}), rotate(-90)`,fill:l.value.style.chart.layout.labels.axisLabels.color.negative},e.toDisplayString($.value.x.min),9,Ze),e.createElementVNode("text",{id:`xLabelMax_${p.value}`,"text-anchor":"middle","font-size":l.value.style.chart.layout.labels.axisLabels.fontSize,transform:`translate(${t.value.width-t.value.padding+l.value.style.chart.layout.labels.axisLabels.fontSize}, ${t.value.height/2}), rotate(90)`,fill:l.value.style.chart.layout.labels.axisLabels.color.positive},e.toDisplayString($.value.x.max),9,Ke),e.createElementVNode("text",{id:`xLabelMaxName_${p.value}`,"text-anchor":"middle","font-size":l.value.style.chart.layout.labels.axisLabels.fontSize,transform:`translate(${t.value.width-l.value.style.chart.layout.labels.axisLabels.fontSize}, ${t.value.height/2}), rotate(90)`,fill:l.value.style.chart.layout.labels.axisLabels.color.positive},e.toDisplayString(l.value.style.chart.layout.grid.xAxis.name),9,et)])):e.createCommentVNode("",!0),l.value.style.chart.layout.areas.show?(e.openBlock(),e.createElementBlock("g",tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(o,r)=>(e.openBlock(),e.createElementBlock("g",null,[o.series.length>2?(e.openBlock(),e.createElementBlock("polygon",{key:0,"data-cy-quadrant-area":"",fill:l.value.style.chart.layout.areas.useGradient?`url(#quadrant_gradient_${p.value}_${r})`:`${o.color}${e.unref(c.opacity)[l.value.style.chart.layout.areas.opacity]}`,points:e.unref(c.giftWrap)(o)},null,8,lt)):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),e.createElementVNode("g",null,[e.createElementVNode("rect",{onClick:u[4]||(u[4]=o=>k("TL")),x:t.value.left,y:t.value.top,width:t.value.usableWidth/2<=0?.001:t.value.usableWidth/2,height:t.value.usableHeight/2<=0?.001:t.value.usableHeight/2,fill:"transparent",class:e.normalizeClass({"vue-data-ui-zoom-plus":!h.value,"vue-data-ui-zoom-minus":h.value})},null,10,at),e.createElementVNode("rect",{onClick:u[5]||(u[5]=o=>k("TR")),x:t.value.centerX,y:t.value.top,width:t.value.usableWidth/2<=0?.001:t.value.usableWidth/2,height:t.value.usableHeight/2<=0?.001:t.value.usableHeight/2,fill:"transparent",class:e.normalizeClass({"vue-data-ui-zoom-plus":!h.value,"vue-data-ui-zoom-minus":h.value})},null,10,ot),e.createElementVNode("rect",{onClick:u[6]||(u[6]=o=>k("BR")),x:t.value.centerX,y:t.value.centerY,width:t.value.usableWidth/2<=0?.001:t.value.usableWidth/2,height:t.value.usableHeight/2<=0?.001:t.value.usableHeight/2,fill:"transparent",class:e.normalizeClass({"vue-data-ui-zoom-plus":!h.value,"vue-data-ui-zoom-minus":h.value})},null,10,ut),e.createElementVNode("rect",{onClick:u[7]||(u[7]=o=>k("BL")),x:t.value.left,y:t.value.centerY,width:t.value.usableWidth/2<=0?.001:t.value.usableWidth/2,height:t.value.usableHeight/2<=0?.001:t.value.usableHeight/2,fill:"transparent",class:e.normalizeClass({"vue-data-ui-zoom-plus":!h.value,"vue-data-ui-zoom-minus":h.value})},null,10,rt)]),l.value.style.chart.layout.labels.plotLabels.showAsTag?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[m.value.plotLabels.show?(e.openBlock(),e.createElementBlock("g",it,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(o,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.series,n=>(e.openBlock(),e.createElementBlock("foreignObject",{style:{overflow:"visible"},height:"10",width:"100",x:n.x-50,y:n.y-l.value.style.chart.layout.labels.plotLabels.fontSize,onMouseover:v=>ee(o,n,r),onMouseleave:u[9]||(u[9]=v=>{E.value=!1,B.value=null,_.value=null}),onClick:v=>te(o,n)},[e.createElementVNode("div",{style:e.normalizeStyle(`color:${e.unref(c.adaptColorToBackground)(o.color)};margin: 0 auto; font-size:${l.value.style.chart.layout.labels.plotLabels.fontSize}px; text-align:center;background:${o.color}; padding: 2px 4px; border-radius: 12px; height: ${l.value.style.chart.layout.labels.plotLabels.fontSize*1.5}px`)},e.toDisplayString(n.name),5)],40,ct))),256))],64))),256))])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(o,r)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.series,n=>(e.openBlock(),e.createBlock(ce._sfc_main,{color:o.color,isSelected:B.value&&n.uid===B.value,plot:n,radius:l.value.style.chart.layout.plots.radius/(h.value?1.5:1),shape:o.shape,stroke:l.value.style.chart.layout.plots.outline?l.value.style.chart.layout.plots.outlineColor:"none",strokeWidth:l.value.style.chart.layout.plots.outlineWidth,onMouseover:v=>ee(o,n,r),onMouseleave:u[8]||(u[8]=v=>{E.value=!1,B.value=null,_.value=null}),onClick:v=>te(o,n)},null,8,["color","isSelected","plot","radius","shape","stroke","strokeWidth","onMouseover","onClick"]))),256))]))),256)),m.value.plotLabels.show?(e.openBlock(),e.createElementBlock("g",nt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,o=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.series,r=>(e.openBlock(),e.createElementBlock("text",{x:r.x,y:r.y+l.value.style.chart.layout.labels.plotLabels.offsetY+l.value.style.chart.layout.plots.radius,"text-anchor":"middle","font-size":l.value.style.chart.layout.labels.plotLabels.fontSize/(h.value?1.5:1),fill:l.value.style.chart.layout.labels.plotLabels.color},e.toDisplayString(r.name),9,st))),256))]))),256))])):e.createCommentVNode("",!0)],64)),h.value?(e.openBlock(),e.createElementBlock("g",vt,[s.value==="TL"?(e.openBlock(),e.createElementBlock("polygon",{key:0,points:`${t.value.left-1},${t.value.centerY} ${t.value.centerX},${t.value.centerY} ${t.value.centerX},${t.value.top-1} ${t.value.right},${t.value.top-1} ${t.value.right},${t.value.bottom} ${t.value.left-1},${t.value.bottom} ${t.value.left-1},${t.value.centerY}`,fill:l.value.style.chart.backgroundColor,style:{opacity:"1"}},null,8,dt)):e.createCommentVNode("",!0),s.value==="TR"?(e.openBlock(),e.createElementBlock("polygon",{key:1,points:`${t.value.left},${t.value.top-1} ${t.value.centerX},${t.value.top-1} ${t.value.centerX},${t.value.centerY} ${t.value.right+1},${t.value.centerY} ${t.value.right+1},${t.value.bottom} ${t.value.left},${t.value.bottom} ${t.value.left},${t.value.top-1}`,fill:l.value.style.chart.backgroundColor,style:{opacity:"1"}},null,8,ht)):e.createCommentVNode("",!0),s.value==="BR"?(e.openBlock(),e.createElementBlock("polygon",{key:2,points:`${t.value.left},${t.value.top} ${t.value.right+1},${t.value.top} ${t.value.right+1},${t.value.centerY} ${t.value.centerX},${t.value.centerY} ${t.value.centerX},${t.value.bottom+1} ${t.value.left},${t.value.bottom+1} ${t.value.left},${t.value.top}`,fill:l.value.style.chart.backgroundColor,style:{opacity:"1"}},null,8,yt)):e.createCommentVNode("",!0),s.value==="BL"?(e.openBlock(),e.createElementBlock("polygon",{key:3,points:`${t.value.left-1},${t.value.top} ${t.value.right},${t.value.top} ${t.value.right},${t.value.bottom+1} ${t.value.centerX},${t.value.bottom+1} ${t.value.centerX},${t.value.centerY} ${t.value.left-1},${t.value.centerY} ${t.value.left-1},${t.value.top}`,fill:l.value.style.chart.backgroundColor,style:{opacity:"1"}},null,8,bt)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.value&&!W.value?(e.openBlock(),e.createElementBlock("g",mt,[e.createElementVNode("text",{x:C.value.x,y:C.value.y-C.value.fontSize/1.5,"font-size":C.value.fontSize/1.5,fill:C.value.fill,"text-anchor":"middle","font-weight":C.value.bold?"bold":"normal"},e.toDisplayString(C.value.text),9,ft)])):e.createCommentVNode("",!0),h.value&&s.value?(e.openBlock(),e.createElementBlock("g",pt,[e.createElementVNode("rect",{x:b.value[s.value].tl.x,y:b.value[s.value].tl.y,height:"20",width:"20",fill:b.value[s.value].tl.fill,style:e.normalizeStyle(`cursor: pointer; opacity: ${s.value==="TL"?1:.2}`),onClick:u[10]||(u[10]=o=>k("TL")),class:e.normalizeClass({"vue-ui-quadrant-mini-map-cell":!0,"vue-ui-quadrant-mini-map-cell-selectable":s.value!=="TL"})},null,14,gt),e.createElementVNode("rect",{x:b.value[s.value].tr.x,y:b.value[s.value].tr.y,height:"20",width:"20",fill:b.value[s.value].tr.fill,style:e.normalizeStyle(`cursor: pointer; opacity: ${s.value==="TR"?1:.2}`),onClick:u[11]||(u[11]=o=>k("TR")),class:e.normalizeClass({"vue-ui-quadrant-mini-map-cell":!0,"vue-ui-quadrant-mini-map-cell-selectable":s.value!=="TR"})},null,14,xt),e.createElementVNode("rect",{x:b.value[s.value].br.x,y:b.value[s.value].br.y,height:"20",width:"20",fill:b.value[s.value].br.fill,style:e.normalizeStyle(`cursor: pointer; opacity: ${s.value==="BR"?1:.2}`),onClick:u[12]||(u[12]=o=>k("BR")),class:e.normalizeClass({"vue-ui-quadrant-mini-map-cell":!0,"vue-ui-quadrant-mini-map-cell-selectable":s.value!=="BR"})},null,14,kt),e.createElementVNode("rect",{x:b.value[s.value].bl.x,y:b.value[s.value].bl.y,height:"20",width:"20",fill:b.value[s.value].bl.fill,style:e.normalizeStyle(`cursor: pointer; opacity: ${s.value==="BL"?1:.2}`),onClick:u[13]||(u[13]=o=>k("BL")),class:e.normalizeClass({"vue-ui-quadrant-mini-map-cell":!0,"vue-ui-quadrant-mini-map-cell-selectable":s.value!=="BL"})},null,14,$t),e.createElementVNode("path",{class:"vue-ui-quadrant-minimap-crosshairs",stroke:l.value.style.chart.backgroundColor,"stroke-width":1,d:b.value[s.value].crosshairs.horizontal},null,8,Lt),e.createElementVNode("path",{class:"vue-ui-quadrant-minimap-crosshairs",stroke:l.value.style.chart.backgroundColor,"stroke-width":1,d:b.value[s.value].crosshairs.vertical},null,8,Ct)])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:t.value},void 0,!0)],14,ze)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",wt,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(O)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Se.default,{key:4,config:{type:"quadrant",style:{backgroundColor:l.value.style.chart.backgroundColor,quadrant:{grid:{color:l.value.style.chart.layout.grid.stroke},plots:{color:l.value.style.chart.layout.grid.stroke,radius:1}}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:H},[l.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Ce.Legend,{key:0,legendSet:Z.value,config:xe.value,onClickMarker:u[14]||(u[14]=({legend:o})=>P(o.id))},{item:e.withCtx(({legend:o})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:r=>P(o.id),style:e.normalizeStyle(`opacity:${L.value.includes(o.id)?.5:1}`)},e.toDisplayString(o.name),13,St)]),_:1},8,["legendSet","config"])):e.renderSlot(a.$slots,"legend",{key:1,legend:Z.value},void 0,!0)],512),e.createVNode(Le._sfc_main,{show:m.value.showTooltip&&E.value,backgroundColor:l.value.style.chart.tooltip.backgroundColor,color:l.value.style.chart.tooltip.color,borderRadius:l.value.style.chart.tooltip.borderRadius,borderColor:l.value.style.chart.tooltip.borderColor,borderWidth:l.value.style.chart.tooltip.borderWidth,fontSize:l.value.style.chart.tooltip.fontSize,backgroundOpacity:l.value.style.chart.tooltip.backgroundOpacity,position:l.value.style.chart.tooltip.position,offsetY:l.value.style.chart.tooltip.offsetY,parent:S.value,content:F.value,isCustom:l.value.style.chart.tooltip.customFormat&&typeof l.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...A.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...A.value})),void 0,!0)]),default:e.withCtx(()=>[l.value.style.chart.tooltip.showShape?(e.openBlock(),e.createElementBlock("svg",qt,[e.createVNode(ce._sfc_main,{plot:{x:10,y:10},shape:_.value.shape,color:_.value.color,radius:8,stroke:l.value.style.chart.layout.plots.outline?l.value.style.chart.layout.plots.outlineColor:"none","stroke-width":l.value.style.chart.layout.plots.outlineWidth},null,8,["shape","color","stroke","stroke-width"])])):e.createCommentVNode("",!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),V.value?(e.openBlock(),e.createBlock(qe.default,{key:5,hideDetails:"",config:{open:m.value.showTable,maxHeight:1e4,body:{backgroundColor:l.value.style.chart.backgroundColor,color:l.value.style.chart.color},head:{backgroundColor:l.value.style.chart.backgroundColor,color:l.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(we.DataTable,{colNames:Y.value.colNames,head:Y.value.head,body:Y.value.body,config:Y.value.config,title:`${l.value.style.chart.title.text}${l.value.style.chart.title.subtitle.text?` : ${l.value.style.chart.title.subtitle.text}`:""}`,onClose:u[15]||(u[15]=o=>m.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createTextVNode(e.toDisplayString(o),1)]),td:e.withCtx(({td:o})=>[e.createElementVNode("div",{innerHTML:o.name||o},null,8,Bt)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,_e))}},zt=Be._export_sfc(_t,[["__scopeId","data-v-a3e0f3aa"]]);exports.default=zt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-BFH7X8WG.cjs"),se=require("./useResponsive-B3TrDDIG.cjs"),$e=require("./Title-CSQdI1EY.cjs"),ie=require("./usePrinter-hyuaFHQj.cjs"),Le=require("./Tooltip-B-laoopT.cjs"),ce=require("./Shape-dvRttq7z.cjs"),Ce=require("./Legend-tvvMRnbi.cjs"),we=require("./DataTable-D_2ZW2eI.cjs"),Se=require("./vue-ui-skeleton-Df1qBO2k.cjs"),qe=require("./vue-ui-accordion-CvZhABQM.cjs"),ve=require("./useNestedProp-B_z4-n52.cjs"),Be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),_e=["id"],ze=["xmlns","viewBox","id"],Ne=["id"],Ve=["stop-color"],Ee=["stop-color"],Te={key:0},We=["fill","x","y","height","width","stroke-width","stroke","rx"],Xe=["x1","y1","x2","y2","stroke","stroke-width"],Ye=["x1","y1","x2","y2","stroke","stroke-width"],Me={key:1},Fe=["points","fill"],Pe=["points","fill"],Ae=["points","fill"],Re=["points","fill"],De={key:2},He=["y","fill","font-size"],Oe=["x","y","fill","font-size"],Ie=["x","y","fill","font-size"],Ue=["y","fill","font-size"],Ge={key:3},Qe=["x","y","font-size","fill"],Je=["x","y","font-size","fill"],je=["x","y","font-size","fill"],Ze=["id","font-size","transform","fill"],Ke=["id","font-size","transform","fill"],et=["id","font-size","transform","fill"],tt={key:4},lt=["fill","points"],at=["x","y","width","height"],ot=["x","y","width","height"],ut=["x","y","width","height"],rt=["x","y","width","height"],nt={key:0},st=["x","y","font-size","fill"],it={key:0},ct=["x","y","onMouseover","onClick"],vt={key:7,class:"vue-ui-dna"},dt=["points","fill"],ht=["points","fill"],yt=["points","fill"],bt=["points","fill"],mt={key:8},ft=["x","y","font-size","fill","font-weight"],pt={key:9},gt=["x","y","fill"],xt=["x","y","fill"],kt=["x","y","fill"],$t=["x","y","fill"],Lt=["stroke","d"],Ct=["stroke","d"],wt={key:3,class:"vue-data-ui-watermark"},St=["onClick"],qt={key:0,height:"14",width:"14",viewBox:"0 0 20 20"},Bt=["innerHTML"],_t={__name:"vue-ui-quadrant",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectPlot","selectSide","selectLegend"],setup(de,{expose:he,emit:M}){const x=de,{vue_ui_quadrant:ye}=c.useConfig(),V=e.computed(()=>!!x.dataset&&x.dataset.length),p=e.ref(c.createUid()),be=e.ref(null),E=e.ref(!1),F=e.ref(""),R=e.ref(0),h=e.ref(!1),S=e.ref(null),D=e.ref(null),H=e.ref(null),l=e.computed(()=>{const a=ve.useNestedProp({userConfig:x.config,defaultConfig:ye});return a.theme?{...ve.useNestedProp({userConfig:c.themes.vue_ui_quadrant[a.theme]||x.config,defaultConfig:a}),customPalette:c.themePalettes[a.theme]||c.palette}:a}),T=e.ref(null);e.onMounted(()=>{if(c.objectIsEmpty(x.dataset)?c.error({componentName:"VueUiQuadrant",type:"dataset"}):x.dataset.forEach((a,u)=>{[null,void 0].includes(a.name)&&c.error({componentName:"VueUiQuadrant",type:"datasetSerieAttribute",property:"name",index:u}),[null,void 0].includes(a.series)?c.error({componentName:"VueUiQuadrant",type:"datasetSerieAttribute",property:"series",index:u}):a.series.forEach((o,r)=>{[null,void 0].includes(o.name)&&c.error({componentName:"VueUiQuadrant",type:"datasetSerieAttribute",property:"name",key:"series",index:r})})}),l.value.responsive){const a=se.throttle(()=>{const{width:u,height:o}=se.useResponsive({chart:S.value,title:l.value.style.chart.title.text?D.value:null,legend:l.value.style.chart.legend.show?H.value:null});y.value=48,t.value.height=o,t.value.usableHeight=o-y.value*2,t.value.width=u,t.value.usableWidth=u-y.value*2,t.value.top=y.value,t.value.left=y.value,t.value.right=u-y.value,t.value.bottom=o-y.value,t.value.centerX=u/2,t.value.centerY=o-o/2,t.value.padding=y.value});T.value=new ResizeObserver(a),T.value.observe(S.value.parentNode)}}),e.onBeforeUnmount(()=>{T.value&&T.value.disconnect()});const{isPrinting:O,isImaging:I,generatePdf:U,generateImage:G}=ie.usePrinter({elementId:`vue-ui-quadrant_${p.value}`,fileName:l.value.style.chart.title.text||"vue-ui-quadrant"}),Q=e.computed(()=>c.convertCustomPalette(l.value.customPalette)),m=e.ref({plotLabels:{show:l.value.style.chart.layout.labels.plotLabels.show},showTable:l.value.table.show,showTooltip:l.value.style.chart.tooltip.show}),y=e.ref(48),t=e.ref({height:l.value.style.chart.height,usableHeight:l.value.style.chart.height-y.value*2,width:l.value.style.chart.width,usableWidth:l.value.style.chart.width-y.value*2,top:y.value,left:y.value,right:l.value.style.chart.width-y.value,bottom:l.value.style.chart.height-y.value,centerX:l.value.style.chart.width/2,centerY:l.value.style.chart.height-l.value.style.chart.height/2,padding:y.value}),i=e.ref({...JSON.parse(JSON.stringify(t.value)),startX:0,startY:0});e.watch(()=>t.value,a=>{a&&(i.value={...JSON.parse(JSON.stringify(t.value)),startX:0,startY:0})},{deep:!0});const s=e.ref(null),C=e.computed(()=>{switch(s.value){case"TL":return{x:i.value.startX+i.value.width/2,y:i.value.height,text:l.value.style.chart.layout.labels.quadrantLabels.tl.text||"Top Left",fontSize:l.value.style.chart.layout.labels.quadrantLabels.tl.fontSize,fill:l.value.style.chart.layout.labels.quadrantLabels.tl.color,bold:l.value.style.chart.layout.labels.quadrantLabels.tl.bold};case"TR":return{x:i.value.startX+i.value.width/2,y:i.value.height,text:l.value.style.chart.layout.labels.quadrantLabels.tr.text||"Top Right",fontSize:l.value.style.chart.layout.labels.quadrantLabels.tr.fontSize,fill:l.value.style.chart.layout.labels.quadrantLabels.tr.color,bold:l.value.style.chart.layout.labels.quadrantLabels.tr.bold};case"BR":return{x:i.value.startX+i.value.width/2,y:i.value.height*1.678,text:l.value.style.chart.layout.labels.quadrantLabels.br.text||"Bottom Right",fontSize:l.value.style.chart.layout.labels.quadrantLabels.br.fontSize,fill:l.value.style.chart.layout.labels.quadrantLabels.br.color,bold:l.value.style.chart.layout.labels.quadrantLabels.br.bold};case"BL":return{x:i.value.startX+i.value.width/2,y:i.value.height*1.678,text:l.value.style.chart.layout.labels.quadrantLabels.bl.text||"Bottom Left",fontSize:l.value.style.chart.layout.labels.quadrantLabels.bl.fontSize,fill:l.value.style.chart.layout.labels.quadrantLabels.bl.color,bold:l.value.style.chart.layout.labels.quadrantLabels.bl.bold};default:return{x:0,y:0,text:"",fontSize:0,fill:"none",bold:!1}}}),me=e.ref(null),W=e.ref(!1);function q({targetX:a,targetY:u,targetW:o,targetH:r,side:n}){s.value&&z(n);const v={x:a-i.value.startX,y:u-i.value.startY,w:o-i.value.width,h:r-i.value.height},d=l.value.zoomAnimationFrames;let g=0;function ne(){W.value=!0,i.value.startX+=v.x/d,i.value.startY+=v.y/d,i.value.width+=v.w/d,i.value.height+=v.h/d,g+=1,g<d?me.value=requestAnimationFrame(ne):W.value=!1}ne()}function k(a){if(!W.value)if(h.value&&s.value===a)q({targetX:0,targetY:0,targetW:t.value.width,targetH:t.value.height}),s.value=null,h.value=!1;else{switch(s.value=a,a){case"TL":q({targetX:0,targetY:0,targetW:t.value.width/2+t.value.left,targetH:t.value.height/2+t.value.top,side:"tl"});break;case"TR":q({targetX:t.value.width/2-t.value.left,targetY:0,targetW:t.value.width/2+t.value.left,targetH:t.value.height/2+t.value.top,side:"tr"});break;case"BR":q({targetX:t.value.width/2-t.value.left,targetY:t.value.height/2-t.value.top,targetW:t.value.width/2+t.value.left,targetH:t.value.height/2+t.value.top,side:"br"});break;case"BL":q({targetX:0,targetY:t.value.height/2-t.value.top,targetW:t.value.width/2+t.value.left,targetH:t.value.height/2+t.value.top,side:"bl"});break;default:i.value.startX=0,i.value.startY=0,i.value.width=t.value.width,i.value.height=t.value.height;break}h.value=!0}}const fe=e.computed(()=>{const a=l.value.style.chart.layout.grid.graduations.steps,u=t.value.usableWidth/(a*2),o=t.value.top,r=[];for(let n=0;n<a;n+=1)r.push({x:t.value.padding+u*n,y:o+t.value.usableHeight*(n/a/2),height:t.value.usableHeight*(1-n/a),width:t.value.usableWidth*(1-n/a),opacity:c.opacity[Math.round((n+1)/a*20)]});return r}),$=e.computed(()=>{let a=l.value.style.chart.layout.grid.xAxis.max,u=l.value.style.chart.layout.grid.xAxis.min,o=l.value.style.chart.layout.grid.yAxis.max,r=l.value.style.chart.layout.grid.yAxis.min;return l.value.style.chart.layout.grid.xAxis.auto&&(a=Math.max(...w.value.flatMap(n=>n.series.map(v=>v.x))),u=Math.min(...w.value.flatMap(n=>n.series.map(v=>v.x)))),l.value.style.chart.layout.grid.yAxis.auto&&(o=Math.max(...w.value.flatMap(n=>n.series.map(v=>v.y))),r=Math.min(...w.value.flatMap(n=>n.series.map(v=>v.y)))),{x:{max:a,min:u},y:{max:o,min:r}}}),L=e.ref([]),w=e.computed(()=>x.dataset.map((a,u)=>({...a,id:`cat_${u}_${p.value}`,color:c.convertColorToHex(a.color)||Q.value[u]||c.palette[u]}))),pe=e.computed(()=>w.value.filter(a=>!L.value.includes(a.id))),ge=e.computed(()=>w.value.map((a,u)=>({...a,shape:a.shape||"circle",series:a.series.map(o=>({...o,x:J(o.x),y:j(o.y),xValue:o.x,yValue:o.y,quadrantSide:K({x:o.x,y:o.y}),categoryName:a.name,shape:a.shape,color:a.color}))}))),f=e.computed(()=>(x.dataset.forEach((a,u)=>{a.series.forEach((o,r)=>{[null,void 0].includes(o.x)&&c.error({componentName:"VueUiQuadrant",type:"datasetSerieAttribute",property:"x",key:"series",index:r}),[null,void 0].includes(o.y)&&c.error({componentName:"VueUiQuadrant",type:"datasetSerieAttribute",property:"y",key:"series",index:r})})}),pe.value.map((a,u)=>({...a,shape:a.shape||"circle",color:a.color||Q.value[u]||c.palette[u],series:a.series.map(o=>({...o,x:J(o.x),y:j(o.y),xValue:o.x,yValue:o.y,quadrantSide:K({x:o.x,y:o.y}),categoryName:a.name,shape:a.shape,color:a.color,uid:c.createUid()}))}))));function J(a){if(a>=0){const u=a/$.value.x.max;return t.value.centerX+t.value.usableWidth/2*u}else{const u=Math.abs(a)/Math.abs($.value.x.min);return t.value.centerX-t.value.usableWidth/2*u}}function j(a){if(a>=0){const u=a/$.value.y.max;return t.value.centerY+(1-t.value.usableHeight/2*u)}else{const u=Math.abs(a)/Math.abs($.value.y.min);return t.value.centerY-(1-t.value.usableHeight/2*u)}}const X=e.computed(()=>{const a=f.value.flatMap(d=>d.series.map(g=>({x:g.xValue,y:g.yValue,name:g.name,category:g.categoryName,quadrantSide:g.quadrantSide,sideName:l.value.style.chart.layout.labels.quadrantLabels[g.quadrantSide].text,color:d.color,shape:d.shape}))),u=l.value.style.chart.layout.grid.xAxis.name||"x",o=l.value.style.chart.layout.grid.yAxis.name||"y",r=[l.value.translations.category,l.value.translations.item,u,o,l.value.translations.side],n=a.map(d=>[d.category,d.name,d.x,d.y,d.sideName||d.quadrantSide]),v=a.map(d=>({shape:d.shape,color:d.color}));return{head:r,body:n,itsShapes:v,tableData:a}}),Y=e.computed(()=>{const a=X.value.head,u=X.value.tableData.map(r=>[{shape:r.shape,color:r.color,name:r.category},r.name,r.x,r.y,r.sideName||r.quadrantSide]),o={th:{backgroundColor:l.value.table.th.backgroundColor,color:l.value.table.th.color,outline:l.value.table.th.outline},td:{backgroundColor:l.value.table.td.backgroundColor,color:l.value.table.td.color,outline:l.value.table.td.outline},breakpoint:l.value.table.responsiveBreakpoint};return{head:a,body:u,config:o,colNames:a}});function P(a){L.value.includes(a)?L.value=L.value.filter(o=>o!==a):L.value.push(a);const u=le();M("selectLegend",u)}const Z=e.computed(()=>ge.value.map(a=>({name:a.name,shape:a.shape,color:a.color,id:a.id,opacity:L.value.includes(a.id)?.5:1,segregate:()=>P(a.id),isSegregated:L.value.includes(a.id)}))),xe=e.computed(()=>({cy:"quadrant-div-legend",backgroundColor:l.value.style.chart.legend.backgroundColor,color:l.value.style.chart.legend.color,fontSize:l.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:l.value.style.chart.legend.bold?"bold":""}));function K(a){switch(!0){case(a.x>=0&&a.y>=0):return"tr";case(a.x>=0&&a.y<0):return"br";case(a.x<0&&a.y<0):return"bl";case(a.x<0&&a.y>=0):return"tl";default:return""}}const B=e.ref(null),_=e.ref(null),A=e.ref(null);function ee(a,u,o){B.value=u.uid,_.value={color:a.color,shape:a.shape},A.value={datapoint:u,seriesIndex:o,series:f.value,config:l.value},E.value=!0;const r=l.value.style.chart.tooltip.customFormat;if(c.isFunction(r)&&c.functionReturnsString(()=>r({seriesIndex:o,datapoint:u,series:f.value,config:l.value})))F.value=r({seriesIndex:o,datapoint:u,series:f.value,config:l.value});else{let n="";u.quadrantSide&&(n+=`<div style="color:${l.value.style.chart.layout.labels.quadrantLabels[u.quadrantSide].color};font-weight:${l.value.style.chart.layout.labels.quadrantLabels[u.quadrantSide].bold?"bold":"400"}">${l.value.style.chart.layout.labels.quadrantLabels[u.quadrantSide].text}</div>`),n+=`<div>${a.name}</div>`,n+=`<div style="padding-bottom:6px;border-bottom:1px solid ${l.value.style.chart.tooltip.borderColor};margin-bottom:3px">${u.name}</div>`,n+=`<div>${l.value.style.chart.layout.grid.xAxis.name?l.value.style.chart.layout.grid.xAxis.name:"x"}: <b>${u.xValue.toFixed(l.value.style.chart.tooltip.roundingValue)}</b></div>`,n+=`<div>${l.value.style.chart.layout.grid.yAxis.name?l.value.style.chart.layout.grid.yAxis.name:"y"}: <b>${u.yValue.toFixed(l.value.style.chart.tooltip.roundingValue)}</b></div>`,F.value=`<div style="text-align:left;font-size:${l.value.style.chart.tooltip.fontSize}px">${n}</div>`}}function te(a,u){const o={category:a.name,shape:a.shape,itemName:u.name,x:u.xValue,y:u.yValue,quadrantSide:u.quadrantSide,sideName:l.value.style.chart.layout.labels.quadrantLabels[u.quadrantSide].text};M("selectPlot",o)}function z(a){if(!a)return;const u=f.value.flatMap(r=>r.series.filter(n=>n.quadrantSide===a).map(n=>({category:n.categoryName,itemName:n.name,x:n.xValue,y:n.yValue}))),o={quadrantSide:a,sideName:l.value.style.chart.layout.labels.quadrantLabels[a].text,items:[...u]};M("selectSide",o)}const b=e.computed(()=>({TL:{tl:{x:t.value.left+t.value.usableWidth/4-20,y:0,fill:l.value.style.chart.layout.labels.quadrantLabels.tl.color},tr:{x:t.value.left+t.value.usableWidth/4,y:0,fill:l.value.style.chart.layout.labels.quadrantLabels.tr.color},br:{x:t.value.left+t.value.usableWidth/4,y:20,fill:l.value.style.chart.layout.labels.quadrantLabels.br.color},bl:{x:t.value.left+t.value.usableWidth/4-20,y:20,fill:l.value.style.chart.layout.labels.quadrantLabels.bl.color},crosshairs:{horizontal:`M ${t.value.left+t.value.usableWidth/4-20},20 ${t.value.left+t.value.usableWidth/4+20},20`,vertical:`M ${t.value.left+t.value.usableWidth/4},0 ${t.value.left+t.value.usableWidth/4},40`}},TR:{tl:{x:t.value.centerX+t.value.usableWidth/4-20,y:0,fill:l.value.style.chart.layout.labels.quadrantLabels.tl.color},tr:{x:t.value.centerX+t.value.usableWidth/4,y:0,fill:l.value.style.chart.layout.labels.quadrantLabels.tr.color},br:{x:t.value.centerX+t.value.usableWidth/4,y:20,fill:l.value.style.chart.layout.labels.quadrantLabels.br.color},bl:{x:t.value.centerX+t.value.usableWidth/4-20,y:20,fill:l.value.style.chart.layout.labels.quadrantLabels.bl.color},crosshairs:{horizontal:`M ${t.value.centerX+t.value.usableWidth/4-20},20 ${t.value.centerX+t.value.usableWidth/4+20},20`,vertical:`M ${t.value.centerX+t.value.usableWidth/4},0 ${t.value.centerX+t.value.usableWidth/4},40`}},BR:{tl:{x:t.value.centerX+t.value.usableWidth/4-20,y:t.value.centerY-48,fill:l.value.style.chart.layout.labels.quadrantLabels.tl.color},tr:{x:t.value.centerX+t.value.usableWidth/4,y:t.value.centerY-48,fill:l.value.style.chart.layout.labels.quadrantLabels.tr.color},br:{x:t.value.centerX+t.value.usableWidth/4,y:t.value.centerY-28,fill:l.value.style.chart.layout.labels.quadrantLabels.br.color},bl:{x:t.value.centerX+t.value.usableWidth/4-20,y:t.value.centerY-28,fill:l.value.style.chart.layout.labels.quadrantLabels.bl.color},crosshairs:{horizontal:`M ${t.value.centerX+t.value.usableWidth/4-20},${t.value.centerY-28} ${t.value.centerX+t.value.usableWidth/4+20},${t.value.centerY-28}`,vertical:`M ${t.value.centerX+t.value.usableWidth/4},${t.value.centerY-48} ${t.value.centerX+t.value.usableWidth/4},${t.value.centerY-8}`}},BL:{tl:{x:t.value.left+t.value.usableWidth/4-20,y:t.value.centerY-48,fill:l.value.style.chart.layout.labels.quadrantLabels.tl.color},tr:{x:t.value.left+t.value.usableWidth/4,y:t.value.centerY-48,fill:l.value.style.chart.layout.labels.quadrantLabels.tr.color},br:{x:t.value.left+t.value.usableWidth/4,y:t.value.centerY-28,fill:l.value.style.chart.layout.labels.quadrantLabels.br.color},bl:{x:t.value.left+t.value.usableWidth/4-20,y:t.value.centerY-28,fill:l.value.style.chart.layout.labels.quadrantLabels.bl.color},crosshairs:{horizontal:`M ${t.value.left+t.value.usableWidth/4-20},${t.value.centerY-28} ${t.value.left+t.value.usableWidth/4+20},${t.value.centerY-28}`,vertical:`M ${t.value.left+t.value.usableWidth/4},${t.value.centerY-48} ${t.value.left+t.value.usableWidth/4},${t.value.centerY-8}`}}}));function le(){return f.value.map(a=>({color:a.color,name:a.name,shape:a.shape,series:a.series.map(u=>({name:u.name,x:u.xValue,y:u.yValue,quadrantSide:u.quadrantSide,sideName:l.value.style.chart.layout.labels.quadrantLabels[u.quadrantSide].text}))}))}function ae(){e.nextTick(()=>{const a=[[l.value.style.chart.title.text],[l.value.style.chart.title.subtitle.text],[""]],u=X.value.head,o=X.value.body,r=a.concat([u]).concat(o),n=c.createCsvContent(r);c.downloadCsv({csvContent:n,title:l.value.style.chart.title.text||"vue-ui-quadrant"})})}const N=e.ref(!1);function ke(a){N.value=a,R.value+=1}function oe(){m.value.showTable=!m.value.showTable}function ue(){m.value.plotLabels.show=!m.value.plotLabels.show}function re(){m.value.showTooltip=!m.value.showTooltip}return he({getData:le,generatePdf:U,generateCsv:ae,generateImage:G,toggleTable:oe,toggleLabels:ue,toggleTooltip:re}),(a,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-quadrant ${N.value?"vue-data-ui-wrapper-fullscreen":""} ${l.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"quadrantChart",ref:S,id:`vue-ui-quadrant_${p.value}`,style:e.normalizeStyle(`font-family:${l.value.style.fontFamily};width:100%; text-align:center;${l.value.style.chart.title.text?"":"padding-top: 36px"};background:${l.value.style.chart.backgroundColor};${l.value.responsive?"height: 100%":""}`)},[l.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:D,style:e.normalizeStyle(`width:100%;background:${l.value.style.chart.backgroundColor};padding-bottom:12px`)},[e.createVNode($e._sfc_main,{config:{title:{cy:"quadrant-title",...l.value.style.chart.title},subtitle:{cy:"quadrant-subtitle",...l.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),l.value.userOptions.show&&V.value?(e.openBlock(),e.createBlock(ie.UserOptions,{ref_key:"details",ref:be,key:`user_options_${R.value}`,backgroundColor:l.value.style.chart.backgroundColor,color:l.value.style.chart.color,isImaging:e.unref(I),isPrinting:e.unref(O),uid:p.value,hasTooltip:l.value.userOptions.buttons.tooltip&&l.value.style.chart.tooltip.show,hasPdf:l.value.userOptions.buttons.pdf,hasImg:l.value.userOptions.buttons.img,hasXls:l.value.userOptions.buttons.csv,hasTable:l.value.userOptions.buttons.table,hasLabel:l.value.userOptions.buttons.labels,hasFullscreen:l.value.userOptions.buttons.fullscreen,isFullscreen:N.value,isTooltip:m.value.showTooltip,titles:{...l.value.userOptions.buttonTitles},chartElement:S.value,onToggleFullscreen:ke,onGeneratePdf:e.unref(U),onGenerateCsv:ae,onGenerateImage:e.unref(G),onToggleTable:oe,onToggleLabels:ue,onToggleTooltip:re},e.createSlots({_:2},[a.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,a.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:r})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasLabel","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(c.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":N.value,"vue-data-ui-fulscreen--off":!N.value}),viewBox:`${i.value.startX} ${i.value.startY} ${i.value.width} ${i.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:${h.value?"hidden":"visible"};background:${l.value.style.chart.backgroundColor};color:${l.value.style.chart.color}`),id:`svg_${p.value}`},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(o,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`quadrant_gradient_${p.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(c.shiftHue)(o.color,.05)}${e.unref(c.opacity)[l.value.style.chart.layout.areas.opacity]}`},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":o.color+e.unref(c.opacity)[l.value.style.chart.layout.areas.opacity]},null,8,Ee)],8,Ne))),256))]),l.value.style.chart.layout.grid.graduations.show?(e.openBlock(),e.createElementBlock("g",Te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,o=>(e.openBlock(),e.createElementBlock("rect",{fill:l.value.style.chart.layout.grid.graduations.fill?`${l.value.style.chart.layout.grid.graduations.color}${o.opacity}`:"none",x:o.x,y:o.y,height:o.height<=0?.001:o.height,width:o.width<=0?.001:o.width,"stroke-width":l.value.style.chart.layout.grid.graduations.strokeWidth,stroke:l.value.style.chart.layout.grid.graduations.stroke,rx:l.value.style.chart.layout.grid.graduations.roundingForce},null,8,We))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:t.value.left,y1:t.value.centerY,x2:t.value.right,y2:t.value.centerY,stroke:l.value.style.chart.layout.grid.stroke,"stroke-width":l.value.style.chart.layout.grid.strokeWidth},null,8,Xe),e.createElementVNode("line",{x1:t.value.centerX,y1:t.value.top,x2:t.value.centerX,y2:t.value.bottom,stroke:l.value.style.chart.layout.grid.stroke,"stroke-width":l.value.style.chart.layout.grid.strokeWidth},null,8,Ye),l.value.style.chart.layout.grid.showArrows?(e.openBlock(),e.createElementBlock("g",Me,[e.createElementVNode("polygon",{points:`${t.value.right-8},${t.value.centerY-6} ${t.value.right},${t.value.centerY} ${t.value.right-8},${t.value.centerY+6}`,fill:l.value.style.chart.layout.grid.stroke,stroke:"none"},null,8,Fe),e.createElementVNode("polygon",{points:`${t.value.left+8},${t.value.centerY-6} ${t.value.left},${t.value.centerY} ${t.value.left+8},${t.value.centerY+6}`,fill:l.value.style.chart.layout.grid.stroke,stroke:"none"},null,8,Pe),e.createElementVNode("polygon",{points:`${t.value.centerX-6},${t.value.top+8} ${t.value.centerX},${t.value.top} ${t.value.centerX+6},${t.value.top+8}`,fill:l.value.style.chart.layout.grid.stroke,stroke:"none"},null,8,Ae),e.createElementVNode("polygon",{points:`${t.value.centerX-6},${t.value.bottom-8} ${t.value.centerX},${t.value.bottom} ${t.value.centerX+6},${t.value.bottom-8}`,fill:l.value.style.chart.layout.grid.stroke,stroke:"none"},null,8,Re)])):e.createCommentVNode("",!0),l.value.style.chart.layout.labels.quadrantLabels.show&&!h.value?(e.openBlock(),e.createElementBlock("g",De,[l.value.style.chart.layout.labels.quadrantLabels.tl.text?(e.openBlock(),e.createElementBlock("text",{key:0,x:0,y:t.value.top-t.value.padding/2,"text-anchor":"start",fill:l.value.style.chart.layout.labels.quadrantLabels.tl.color,"font-size":l.value.style.chart.layout.labels.quadrantLabels.tl.fontSize,style:e.normalizeStyle(`font-weight:${l.value.style.chart.layout.labels.quadrantLabels.tl.bold?"bold":""}`),onClick:u[0]||(u[0]=o=>z("tl"))},e.toDisplayString(l.value.style.chart.layout.labels.quadrantLabels.tl.text),13,He)):e.createCommentVNode("",!0),l.value.style.chart.layout.labels.quadrantLabels.tr.text?(e.openBlock(),e.createElementBlock("text",{key:1,x:t.value.width,y:t.value.top-t.value.padding/2,"text-anchor":"end",fill:l.value.style.chart.layout.labels.quadrantLabels.tr.color,"font-size":l.value.style.chart.layout.labels.quadrantLabels.tr.fontSize,style:e.normalizeStyle(`font-weight:${l.value.style.chart.layout.labels.quadrantLabels.tr.bold?"bold":""}`),onClick:u[1]||(u[1]=o=>z("tr"))},e.toDisplayString(l.value.style.chart.layout.labels.quadrantLabels.tr.text),13,Oe)):e.createCommentVNode("",!0),l.value.style.chart.layout.labels.quadrantLabels.br.text?(e.openBlock(),e.createElementBlock("text",{key:2,x:t.value.width,y:t.value.bottom+t.value.padding*.7,"text-anchor":"end",fill:l.value.style.chart.layout.labels.quadrantLabels.br.color,"font-size":l.value.style.chart.layout.labels.quadrantLabels.br.fontSize,style:e.normalizeStyle(`font-weight:${l.value.style.chart.layout.labels.quadrantLabels.br.bold?"bold":""}`),onClick:u[2]||(u[2]=o=>z("br"))},e.toDisplayString(l.value.style.chart.layout.labels.quadrantLabels.br.text),13,Ie)):e.createCommentVNode("",!0),l.value.style.chart.layout.labels.quadrantLabels.bl.text?(e.openBlock(),e.createElementBlock("text",{key:3,x:0,y:t.value.bottom+t.value.padding*.7,"text-anchor":"start",fill:l.value.style.chart.layout.labels.quadrantLabels.bl.color,"font-size":l.value.style.chart.layout.labels.quadrantLabels.bl.fontSize,style:e.normalizeStyle(`font-weight:${l.value.style.chart.layout.labels.quadrantLabels.bl.bold?"bold":""}`),onClick:u[3]||(u[3]=o=>z("bl"))},e.toDisplayString(l.value.style.chart.layout.labels.quadrantLabels.bl.text),13,Ue)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),l.value.style.chart.layout.labels.axisLabels.show?(e.openBlock(),e.createElementBlock("g",Ge,[e.createElementVNode("text",{x:t.value.centerX,y:t.value.top-t.value.padding/6,"text-anchor":"middle","font-size":l.value.style.chart.layout.labels.axisLabels.fontSize,fill:l.value.style.chart.layout.labels.axisLabels.color.positive},e.toDisplayString($.value.y.max),9,Qe),e.createElementVNode("text",{x:t.value.centerX,y:t.value.top-t.value.padding/2,"text-anchor":"middle","font-size":l.value.style.chart.layout.labels.axisLabels.fontSize,fill:l.value.style.chart.layout.labels.axisLabels.color.positive},e.toDisplayString(l.value.style.chart.layout.grid.yAxis.name),9,Je),e.createElementVNode("text",{x:t.value.centerX,y:t.value.bottom+t.value.padding*.35,"text-anchor":"middle","font-size":l.value.style.chart.layout.labels.axisLabels.fontSize,fill:l.value.style.chart.layout.labels.axisLabels.color.negative},e.toDisplayString($.value.y.min),9,je),e.createElementVNode("text",{id:`xLabelMin_${p.value}`,"text-anchor":"middle","font-size":l.value.style.chart.layout.labels.axisLabels.fontSize,transform:`translate(${t.value.padding-l.value.style.chart.layout.labels.axisLabels.fontSize}, ${t.value.height/2}), rotate(-90)`,fill:l.value.style.chart.layout.labels.axisLabels.color.negative},e.toDisplayString($.value.x.min),9,Ze),e.createElementVNode("text",{id:`xLabelMax_${p.value}`,"text-anchor":"middle","font-size":l.value.style.chart.layout.labels.axisLabels.fontSize,transform:`translate(${t.value.width-t.value.padding+l.value.style.chart.layout.labels.axisLabels.fontSize}, ${t.value.height/2}), rotate(90)`,fill:l.value.style.chart.layout.labels.axisLabels.color.positive},e.toDisplayString($.value.x.max),9,Ke),e.createElementVNode("text",{id:`xLabelMaxName_${p.value}`,"text-anchor":"middle","font-size":l.value.style.chart.layout.labels.axisLabels.fontSize,transform:`translate(${t.value.width-l.value.style.chart.layout.labels.axisLabels.fontSize}, ${t.value.height/2}), rotate(90)`,fill:l.value.style.chart.layout.labels.axisLabels.color.positive},e.toDisplayString(l.value.style.chart.layout.grid.xAxis.name),9,et)])):e.createCommentVNode("",!0),l.value.style.chart.layout.areas.show?(e.openBlock(),e.createElementBlock("g",tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(o,r)=>(e.openBlock(),e.createElementBlock("g",null,[o.series.length>2?(e.openBlock(),e.createElementBlock("polygon",{key:0,"data-cy-quadrant-area":"",fill:l.value.style.chart.layout.areas.useGradient?`url(#quadrant_gradient_${p.value}_${r})`:`${o.color}${e.unref(c.opacity)[l.value.style.chart.layout.areas.opacity]}`,points:e.unref(c.giftWrap)(o)},null,8,lt)):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),e.createElementVNode("g",null,[e.createElementVNode("rect",{onClick:u[4]||(u[4]=o=>k("TL")),x:t.value.left,y:t.value.top,width:t.value.usableWidth/2<=0?.001:t.value.usableWidth/2,height:t.value.usableHeight/2<=0?.001:t.value.usableHeight/2,fill:"transparent",class:e.normalizeClass({"vue-data-ui-zoom-plus":!h.value,"vue-data-ui-zoom-minus":h.value})},null,10,at),e.createElementVNode("rect",{onClick:u[5]||(u[5]=o=>k("TR")),x:t.value.centerX,y:t.value.top,width:t.value.usableWidth/2<=0?.001:t.value.usableWidth/2,height:t.value.usableHeight/2<=0?.001:t.value.usableHeight/2,fill:"transparent",class:e.normalizeClass({"vue-data-ui-zoom-plus":!h.value,"vue-data-ui-zoom-minus":h.value})},null,10,ot),e.createElementVNode("rect",{onClick:u[6]||(u[6]=o=>k("BR")),x:t.value.centerX,y:t.value.centerY,width:t.value.usableWidth/2<=0?.001:t.value.usableWidth/2,height:t.value.usableHeight/2<=0?.001:t.value.usableHeight/2,fill:"transparent",class:e.normalizeClass({"vue-data-ui-zoom-plus":!h.value,"vue-data-ui-zoom-minus":h.value})},null,10,ut),e.createElementVNode("rect",{onClick:u[7]||(u[7]=o=>k("BL")),x:t.value.left,y:t.value.centerY,width:t.value.usableWidth/2<=0?.001:t.value.usableWidth/2,height:t.value.usableHeight/2<=0?.001:t.value.usableHeight/2,fill:"transparent",class:e.normalizeClass({"vue-data-ui-zoom-plus":!h.value,"vue-data-ui-zoom-minus":h.value})},null,10,rt)]),l.value.style.chart.layout.labels.plotLabels.showAsTag?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[m.value.plotLabels.show?(e.openBlock(),e.createElementBlock("g",it,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(o,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.series,n=>(e.openBlock(),e.createElementBlock("foreignObject",{style:{overflow:"visible"},height:"10",width:"100",x:n.x-50,y:n.y-l.value.style.chart.layout.labels.plotLabels.fontSize,onMouseover:v=>ee(o,n,r),onMouseleave:u[9]||(u[9]=v=>{E.value=!1,B.value=null,_.value=null}),onClick:v=>te(o,n)},[e.createElementVNode("div",{style:e.normalizeStyle(`color:${e.unref(c.adaptColorToBackground)(o.color)};margin: 0 auto; font-size:${l.value.style.chart.layout.labels.plotLabels.fontSize}px; text-align:center;background:${o.color}; padding: 2px 4px; border-radius: 12px; height: ${l.value.style.chart.layout.labels.plotLabels.fontSize*1.5}px`)},e.toDisplayString(n.name),5)],40,ct))),256))],64))),256))])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(o,r)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.series,n=>(e.openBlock(),e.createBlock(ce._sfc_main,{color:o.color,isSelected:B.value&&n.uid===B.value,plot:n,radius:l.value.style.chart.layout.plots.radius/(h.value?1.5:1),shape:o.shape,stroke:l.value.style.chart.layout.plots.outline?l.value.style.chart.layout.plots.outlineColor:"none",strokeWidth:l.value.style.chart.layout.plots.outlineWidth,onMouseover:v=>ee(o,n,r),onMouseleave:u[8]||(u[8]=v=>{E.value=!1,B.value=null,_.value=null}),onClick:v=>te(o,n)},null,8,["color","isSelected","plot","radius","shape","stroke","strokeWidth","onMouseover","onClick"]))),256))]))),256)),m.value.plotLabels.show?(e.openBlock(),e.createElementBlock("g",nt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,o=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.series,r=>(e.openBlock(),e.createElementBlock("text",{x:r.x,y:r.y+l.value.style.chart.layout.labels.plotLabels.offsetY+l.value.style.chart.layout.plots.radius,"text-anchor":"middle","font-size":l.value.style.chart.layout.labels.plotLabels.fontSize/(h.value?1.5:1),fill:l.value.style.chart.layout.labels.plotLabels.color},e.toDisplayString(r.name),9,st))),256))]))),256))])):e.createCommentVNode("",!0)],64)),h.value?(e.openBlock(),e.createElementBlock("g",vt,[s.value==="TL"?(e.openBlock(),e.createElementBlock("polygon",{key:0,points:`${t.value.left-1},${t.value.centerY} ${t.value.centerX},${t.value.centerY} ${t.value.centerX},${t.value.top-1} ${t.value.right},${t.value.top-1} ${t.value.right},${t.value.bottom} ${t.value.left-1},${t.value.bottom} ${t.value.left-1},${t.value.centerY}`,fill:l.value.style.chart.backgroundColor,style:{opacity:"1"}},null,8,dt)):e.createCommentVNode("",!0),s.value==="TR"?(e.openBlock(),e.createElementBlock("polygon",{key:1,points:`${t.value.left},${t.value.top-1} ${t.value.centerX},${t.value.top-1} ${t.value.centerX},${t.value.centerY} ${t.value.right+1},${t.value.centerY} ${t.value.right+1},${t.value.bottom} ${t.value.left},${t.value.bottom} ${t.value.left},${t.value.top-1}`,fill:l.value.style.chart.backgroundColor,style:{opacity:"1"}},null,8,ht)):e.createCommentVNode("",!0),s.value==="BR"?(e.openBlock(),e.createElementBlock("polygon",{key:2,points:`${t.value.left},${t.value.top} ${t.value.right+1},${t.value.top} ${t.value.right+1},${t.value.centerY} ${t.value.centerX},${t.value.centerY} ${t.value.centerX},${t.value.bottom+1} ${t.value.left},${t.value.bottom+1} ${t.value.left},${t.value.top}`,fill:l.value.style.chart.backgroundColor,style:{opacity:"1"}},null,8,yt)):e.createCommentVNode("",!0),s.value==="BL"?(e.openBlock(),e.createElementBlock("polygon",{key:3,points:`${t.value.left-1},${t.value.top} ${t.value.right},${t.value.top} ${t.value.right},${t.value.bottom+1} ${t.value.centerX},${t.value.bottom+1} ${t.value.centerX},${t.value.centerY} ${t.value.left-1},${t.value.centerY} ${t.value.left-1},${t.value.top}`,fill:l.value.style.chart.backgroundColor,style:{opacity:"1"}},null,8,bt)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.value&&!W.value?(e.openBlock(),e.createElementBlock("g",mt,[e.createElementVNode("text",{x:C.value.x,y:C.value.y-C.value.fontSize/1.5,"font-size":C.value.fontSize/1.5,fill:C.value.fill,"text-anchor":"middle","font-weight":C.value.bold?"bold":"normal"},e.toDisplayString(C.value.text),9,ft)])):e.createCommentVNode("",!0),h.value&&s.value?(e.openBlock(),e.createElementBlock("g",pt,[e.createElementVNode("rect",{x:b.value[s.value].tl.x,y:b.value[s.value].tl.y,height:"20",width:"20",fill:b.value[s.value].tl.fill,style:e.normalizeStyle(`cursor: pointer; opacity: ${s.value==="TL"?1:.2}`),onClick:u[10]||(u[10]=o=>k("TL")),class:e.normalizeClass({"vue-ui-quadrant-mini-map-cell":!0,"vue-ui-quadrant-mini-map-cell-selectable":s.value!=="TL"})},null,14,gt),e.createElementVNode("rect",{x:b.value[s.value].tr.x,y:b.value[s.value].tr.y,height:"20",width:"20",fill:b.value[s.value].tr.fill,style:e.normalizeStyle(`cursor: pointer; opacity: ${s.value==="TR"?1:.2}`),onClick:u[11]||(u[11]=o=>k("TR")),class:e.normalizeClass({"vue-ui-quadrant-mini-map-cell":!0,"vue-ui-quadrant-mini-map-cell-selectable":s.value!=="TR"})},null,14,xt),e.createElementVNode("rect",{x:b.value[s.value].br.x,y:b.value[s.value].br.y,height:"20",width:"20",fill:b.value[s.value].br.fill,style:e.normalizeStyle(`cursor: pointer; opacity: ${s.value==="BR"?1:.2}`),onClick:u[12]||(u[12]=o=>k("BR")),class:e.normalizeClass({"vue-ui-quadrant-mini-map-cell":!0,"vue-ui-quadrant-mini-map-cell-selectable":s.value!=="BR"})},null,14,kt),e.createElementVNode("rect",{x:b.value[s.value].bl.x,y:b.value[s.value].bl.y,height:"20",width:"20",fill:b.value[s.value].bl.fill,style:e.normalizeStyle(`cursor: pointer; opacity: ${s.value==="BL"?1:.2}`),onClick:u[13]||(u[13]=o=>k("BL")),class:e.normalizeClass({"vue-ui-quadrant-mini-map-cell":!0,"vue-ui-quadrant-mini-map-cell-selectable":s.value!=="BL"})},null,14,$t),e.createElementVNode("path",{class:"vue-ui-quadrant-minimap-crosshairs",stroke:l.value.style.chart.backgroundColor,"stroke-width":1,d:b.value[s.value].crosshairs.horizontal},null,8,Lt),e.createElementVNode("path",{class:"vue-ui-quadrant-minimap-crosshairs",stroke:l.value.style.chart.backgroundColor,"stroke-width":1,d:b.value[s.value].crosshairs.vertical},null,8,Ct)])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:t.value},void 0,!0)],14,ze)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",wt,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(O)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Se.default,{key:4,config:{type:"quadrant",style:{backgroundColor:l.value.style.chart.backgroundColor,quadrant:{grid:{color:l.value.style.chart.layout.grid.stroke},plots:{color:l.value.style.chart.layout.grid.stroke,radius:1}}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:H},[l.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Ce.Legend,{key:0,legendSet:Z.value,config:xe.value,onClickMarker:u[14]||(u[14]=({legend:o})=>P(o.id))},{item:e.withCtx(({legend:o})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:r=>P(o.id),style:e.normalizeStyle(`opacity:${L.value.includes(o.id)?.5:1}`)},e.toDisplayString(o.name),13,St)]),_:1},8,["legendSet","config"])):e.renderSlot(a.$slots,"legend",{key:1,legend:Z.value},void 0,!0)],512),e.createVNode(Le._sfc_main,{show:m.value.showTooltip&&E.value,backgroundColor:l.value.style.chart.tooltip.backgroundColor,color:l.value.style.chart.tooltip.color,borderRadius:l.value.style.chart.tooltip.borderRadius,borderColor:l.value.style.chart.tooltip.borderColor,borderWidth:l.value.style.chart.tooltip.borderWidth,fontSize:l.value.style.chart.tooltip.fontSize,backgroundOpacity:l.value.style.chart.tooltip.backgroundOpacity,position:l.value.style.chart.tooltip.position,offsetY:l.value.style.chart.tooltip.offsetY,parent:S.value,content:F.value,isCustom:l.value.style.chart.tooltip.customFormat&&typeof l.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...A.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...A.value})),void 0,!0)]),default:e.withCtx(()=>[l.value.style.chart.tooltip.showShape?(e.openBlock(),e.createElementBlock("svg",qt,[e.createVNode(ce._sfc_main,{plot:{x:10,y:10},shape:_.value.shape,color:_.value.color,radius:8,stroke:l.value.style.chart.layout.plots.outline?l.value.style.chart.layout.plots.outlineColor:"none","stroke-width":l.value.style.chart.layout.plots.outlineWidth},null,8,["shape","color","stroke","stroke-width"])])):e.createCommentVNode("",!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),V.value?(e.openBlock(),e.createBlock(qe.default,{key:5,hideDetails:"",config:{open:m.value.showTable,maxHeight:1e4,body:{backgroundColor:l.value.style.chart.backgroundColor,color:l.value.style.chart.color},head:{backgroundColor:l.value.style.chart.backgroundColor,color:l.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(we.DataTable,{colNames:Y.value.colNames,head:Y.value.head,body:Y.value.body,config:Y.value.config,title:`${l.value.style.chart.title.text}${l.value.style.chart.title.subtitle.text?` : ${l.value.style.chart.title.subtitle.text}`:""}`,onClose:u[15]||(u[15]=o=>m.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createTextVNode(e.toDisplayString(o),1)]),td:e.withCtx(({td:o})=>[e.createElementVNode("div",{innerHTML:o.name||o},null,8,Bt)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,_e))}},zt=Be._export_sfc(_t,[["__scopeId","data-v-a3e0f3aa"]]);exports.default=zt;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),d=require("./index-oufiZvaS.cjs"),ke=require("./useResponsive-B3TrDDIG.cjs"),le=require("./BaseIcon-C-k_mqXL.cjs"),Ce=require("./Tooltip-BC2Wlz7P.cjs"),pe=require("./usePrinter-Cc8ufBvU.cjs"),ze=require("./Slicer-xKlzke1v.cjs"),ge=require("./useNestedProp-CmTItGss.cjs"),Ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),S={LINE:"LINE",BAR:"BAR",DONUT:"DONUT"},Fe=["SERIE","SERIES","DATA","VALUE","VALUES","NUM"];function Ve({dataset:r,barLineSwitch:b=6}){let h=null,A=null,N=0;if((typeof r=="number"||typeof r=="string")&&console.warn(`The provided dataset (${r}) is not sufficient to build a chart`),Y(r)&&(q(r)&&(r.length<b?h=S.BAR:h=S.LINE,A=r,N=r.length),ie(r))){if(!Pe(r))return console.warn("The objects in the dataset array have a different data structure. Either keys or value types are different."),!1;const D=Object.keys(r[0]),W=Object.values(r[0]);if(!D.some(w=>Te(w)))return console.warn("The data type of the dataset objects in the array must contain one of the following keys: DATA, SERIES, VALUE, VALUES, NUM. Casing is not important."),!1;ye(W,w=>typeof w=="number")&&(h=S.DONUT,A=r),ye(W,w=>Array.isArray(w)&&q(w))&&(xe(r)>b?h=S.LINE:h=S.BAR,N=xe(r),A=r.map(w=>({...w,data:Re(w,$=>q($))}))),r=r.map(w=>Se(w)),A=A.map(w=>Se(w))}return Y(r)&&[...new Set(r.flatMap(D=>Array.isArray(D)))][0],{dataset:r,type:h,usableDataset:A,maxSeriesLength:N}}function be(r){return!r||Y(r)&&!r.length}function Y(r){return Array.isArray(r)}function q(r){if(!Y(r)||be(r))return!1;const b=r.map(h=>Number(h));return![...new Set(b.flatMap(h=>typeof h=="number"&&!isNaN(h)))].includes(!1)}function ie(r){return!Y(r)||be(r)||!![...new Set(r.flatMap(h=>typeof h=="object"&&!Array.isArray(h)))].includes(!1)?!1:!r.map(h=>Object.keys(h).length>0).includes(!1)}function $e(r,b){const h=Object.keys(r).sort(),A=Object.keys(b).sort();if(h.length!==A.length)return!1;for(let N=0;N<h.length;N+=1){const V=h[N],I=A[N];if(V!==I||typeof r[V]!=typeof b[I])return!1}return!0}function Pe(r){if(r.length<=1)return!0;for(let b=0;b<r.length;b+=1)for(let h=b+1;h<r.length;h+=1)if(!$e(r[b],r[h]))return!1;return!0}function Te(r){return Fe.includes(r.toUpperCase())}function ye(r,b){let h=[];for(let A=0;A<r.length;A+=1)h.push(b(r[A]));return h.includes(!0)}function xe(r){return Math.max(...[...r].flatMap(b=>Object.values(b).filter(h=>q(h)).map(h=>h.length)))}function Re(r,b){return Object.values(r).filter(h=>b(h))[0]}function Se(r){const b={};for(let h in r)r.hasOwnProperty(h)&&(b[h.toUpperCase()]=r[h]);return b}const Be=r=>(e.pushScopeId("data-v-e62d13b6"),r=r(),e.popScopeId(),r),Oe=["id"],Ie=["xmlns","viewBox"],De=["id"],Me=["id"],Ue=Be(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),qe=["id"],We=["flood-color"],je={key:0,class:"donut-label-connectors"},Ge=["d","stroke","stroke-width","filter"],He=["cx","cy","r","fill"],Xe=["cx","cy","r","fill","filter"],Ye={class:"donut"},Ze=["d","fill","stroke","stroke-width","filter"],Je=["d","onMouseenter","onClick"],Ke={key:1,class:"donut-labels quick-animation"},Qe=["cx","cy","fill","filter"],et=["text-anchor","x","y","fill","font-size","filter"],tt=["text-anchor","x","y","fill","font-size","filter"],lt={key:2,class:"donut-hollow quick-animation"},at=["x","y","font-size","fill"],ot=["x","y","font-size","fill"],nt={key:0,class:"line-grid"},rt=["x1","x2","y1","y2","stroke","stroke-width"],it=["x1","x2","y1","y2","stroke","stroke-width"],ut={key:1,class:"line-axis"},st=["x1","x2","y1","y2","stroke","stroke-width"],ct=["x1","x2","y1","y2","stroke","stroke-width"],dt={key:2,class:"yLabels"},vt=["x1","x2","y1","y2","stroke","stroke-width"],mt=["x","y","font-size","fill"],ht={key:3,class:"periodLabels"},ft=["x1","x2","y1","y2","stroke","stroke-width"],kt=["font-size","text-anchor","fill","transform"],pt={class:"plots"},gt={class:"line-plot-series"},yt=["d","stroke","stroke-width"],xt=["d","stroke","stroke-width"],St=["d","stroke","stroke-width"],bt=["d","stroke","stroke-width"],Bt=["cx","cy","fill","stroke"],wt={key:4,class:"dataLabels"},Et=["font-size","fill","x","y"],_t={class:"tooltip-traps"},At=["x","y","height","width","fill","onMouseenter","onClick"],Lt={key:0,class:"line-grid"},Ct=["x1","x2","y1","y2","stroke","stroke-width"],zt=["x1","x2","y1","y2","stroke","stroke-width"],Nt={key:1,class:"line-axis"},Ft=["x1","x2","y1","y2","stroke","stroke-width"],Vt=["x1","x2","y1","y2","stroke","stroke-width"],$t={key:2,class:"yLabels"},Pt=["x1","x2","y1","y2","stroke","stroke-width"],Tt=["x","y","font-size","fill"],Rt={key:3,class:"periodLabels"},Ot=["x1","x2","y1","y2","stroke","stroke-width"],It=["font-size","text-anchor","transform","fill"],Dt={class:"plots"},Mt=["x","width","height","y","fill","stroke","stroke-width"],Ut=["to"],qt=["from","to"],Wt={key:4,class:"dataLabels"},jt=["x","y","font-size","fill"],Gt={class:"tooltip-traps"},Ht=["x","y","height","width","fill","onMouseenter","onClick"],Xt={key:3,class:"axis-labels"},Yt={key:0},Zt=["font-size","fill","x","y"],Jt={key:1},Kt=["font-size","fill","x","y"],Qt={key:2},el=["font-size","fill","transform"],tl={key:3},ll=["font-size","fill","transform"],al={key:2,class:"vue-data-ui-watermark"},ol=["onClick"],nl=["onClick"],rl=["onClick"],il={key:1,class:"vue-ui-quick-chart-not-processable"},ul=Be(()=>e.createElementVNode("span",null,"Dataset is not processable",-1)),sl={__name:"vue-ui-quick-chart",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,Object,String,Number],default(){return null}}},emits:["selectDatapoint","selectLegend"],setup(r,{expose:b,emit:h}){const A=r,{vue_ui_quick_chart:N}=d.useConfig(),V=e.ref(null),I=e.ref(null),D=e.ref(null),W=e.ref(null),w=e.ref(d.createUid()),$=e.ref(!1),j=e.ref(null),P=e.ref(""),F=e.ref(null),y=e.ref([]),ue=e.ref(0),ae=e.ref(0),t=e.computed(()=>{const i=ge.useNestedProp({userConfig:A.config,defaultConfig:N});return i.theme?{...ge.useNestedProp({userConfig:d.themes.vue_ui_quick_chart[i.theme]||A.config,defaultConfig:i}),customPalette:d.themePalettes[i.theme]||d.palette}:i}),G=e.computed(()=>d.convertCustomPalette(t.value.customPalette)),Z=e.computed(()=>{const i=Ve({dataset:A.dataset,barLineSwitch:t.value.chartIsBarUnderDatasetLength});return i||console.error("VueUiQuickChart : Dataset is not processable"),i}),x=e.ref(Z.value),we=e.computed(()=>!!x.value),E=e.computed(()=>x.value?x.value.type:null),{isPrinting:J,isImaging:K,generatePdf:se,generateImage:ce}=pe.usePrinter({elementId:`${E.value}_${w.value}`,fileName:t.value.title||E.value}),p=e.ref({width:t.value.width,height:t.value.height}),Q=e.ref({showTooltip:t.value.showTooltip}),ee=e.ref(null);e.onMounted(()=>{if(t.value.responsive){const i=ke.throttle(()=>{const{width:v,height:l}=ke.useResponsive({chart:V.value,title:t.value.title?I.value:null,legend:t.value.showLegend?D.value:null,slicer:[S.BAR,S.LINE].includes(E.value)&&t.value.zoomXy&&x.value.maxSeriesLength>1?W.value:null});p.value.width=v,p.value.height=l});ee.value=new ResizeObserver(i),ee.value.observe(V.value.parentNode)}}),e.onBeforeUnmount(()=>{ee.value&&ee.value.disconnect()});const Ee=e.computed(()=>{switch(E.value){case S.LINE:return`0 0 ${p.value.width<=0?10:p.value.width} ${p.value.height<=0?10:p.value.height}`;case S.BAR:return`0 0 ${p.value.width<=0?10:p.value.width} ${p.value.height<=0?10:p.value.height}`;case S.DONUT:return`0 0 ${p.value.width<=0?10:p.value.width} ${p.value.height<=0?10:p.value.height}`;default:return`0 0 ${p.value.width<=0?10:p.value.width} ${p.value.height<=0?10:p.value.height}`}});function de(i){return[...i].map(v=>v.value).reduce((v,l)=>v+l,0)}function H(i){return t.value.blurOnHover&&![null,void 0].includes(F.value)&&F.value!==i?`url(#blur_${w.value})`:""}function ve(i,v){y.value.includes(i)?y.value=y.value.filter(l=>l!==i):y.value.length<v&&y.value.push(i)}const me=e.ref(null),he=e.ref(null),te=e.ref(!1);function _e(i,v){te.value=!0;let l=i.value;if(y.value.includes(i.id)){let s=function(){l>n?(te.value=!1,cancelAnimationFrame(he.value),x.value={...x.value,dataset:x.value.dataset.map((m,L)=>i.id===`donut_${L}`?{...m,value:n,VALUE:n}:m)}):(l+=n*.025,x.value={...x.value,dataset:x.value.dataset.map((m,L)=>i.id===`donut_${L}`?{...m,value:l,VALUE:l}:m)},he.value=requestAnimationFrame(s))};y.value=y.value.filter(m=>m!==i.id);const n=Z.value.dataset.find((m,L)=>i.id===`donut_${L}`).VALUE;s()}else if(v.length>1){let n=function(){l<.1?(te.value=!1,cancelAnimationFrame(me.value),y.value.push(i.id),x.value={...x.value,dataset:x.value.dataset.map((s,m)=>i.id===`donut_${m}`?{...s,value:0,VALUE:0}:s)}):(l/=1.1,x.value={...x.value,dataset:x.value.dataset.map((s,m)=>i.id===`donut_${m}`?{...s,value:l,VALUE:l}:s)},me.value=requestAnimationFrame(n))};n()}}const B=e.computed(()=>{if(E.value!==S.DONUT)return null;const i=x.value.dataset.map((a,o)=>({...a,value:a.VALUE||a.DATA||a.SERIE||a.VALUES||a.NUM||0,name:a.NAME||a.DESCRIPTION||a.TITLE||a.LABEL||`Serie ${o}`,id:`donut_${o}`})).map((a,o)=>({...a,color:a.COLOR?d.convertColorToHex(a.COLOR):G.value[o+t.value.paletteStartIndex]||d.palette[o+t.value.paletteStartIndex]||d.palette[(o+t.value.paletteStartIndex)%d.palette.length],immutableValue:a.value}));function v(a,o){return isNaN(a.value/de(o))?0:(a.value/de(o)*100).toFixed(t.value.dataLabelRoundingPercentage)+"%"}function l(a){return a.proportion*100>t.value.donutHideLabelUnderPercentage}function n(a,o){const k=Z.value.dataset.find((_,z)=>`donut_${z}`===a).VALUE;return Math.abs(String(Number(k.toFixed(0))).length-String(Number(o.toFixed(0))).length)}function s({datapoint:a,seriesIndex:o}){j.value={datapoint:a,seriesIndex:o,config:t.value,dataset:i},F.value=a.id;const k=t.value.tooltipCustomFormat;if(d.isFunction(k)&&d.functionReturnsString(()=>k({datapoint:a,seriesIndex:o,series:i,config:t.value})))P.value=k({datapoint:a,seriesIndex:o,series:i,config:t.value});else{let f="";f+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${a.name}</div>`,f+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${a.color}"/></svg>`,f+=`<b>${d.dataLabel({p:t.value.valuePrefix,v:a.value,s:t.value.valueSuffix,r:t.value.dataLabelRoundingValue})}</b>`,f+=`<span>(${d.dataLabel({v:a.proportion*100,s:"%",r:t.value.dataLabelRoundingPercentage})})</span></div>`,P.value=`<div>${f}</div>`}$.value=!0}function m(){$.value=!1,F.value=null}const L={centerX:p.value.width/2,centerY:p.value.height/2},C=i.filter(a=>!y.value.includes(a.id)).map(a=>a.value||0).reduce((a,o)=>a+o,0),M=i.map((a,o)=>({...a,proportion:(a.value||0)/C,value:a.value||0,absoluteValue:Z.value.dataset.find((k,f)=>`donut_${f}`===a.id).VALUE})),T=p.value.width/2,U=p.value.height/2,R=p.value.height*t.value.donutRadiusRatio;return{dataset:M.filter(a=>!y.value.includes(a.id)),legend:M,drawingArea:L,displayArcPercentage:v,isArcBigEnough:l,useTooltip:s,killTooltip:m,getSpaces:n,total:C,cx:T,cy:U,radius:R,chart:d.makeDonut({series:i.filter(a=>!y.value.includes(a.id))},T,U,R,R,1.99999,2,1,360,105.25,p.value.height*t.value.donutThicknessRatio)}}),g=e.ref({start:0,end:x.value.maxSeriesLength});function Ae(){g.value={start:0,end:x.value.maxSeriesLength},ae.value+=1}const c=e.computed(()=>{if(E.value!==S.LINE)return null;const i={height:p.value.height,width:p.value.width},v={left:t.value.xyPaddingLeft,top:t.value.xyPaddingTop,right:i.width-t.value.xyPaddingRight,bottom:i.height-t.value.xyPaddingBottom,width:i.width-t.value.xyPaddingLeft-t.value.xyPaddingRight,height:i.height-t.value.xyPaddingTop-t.value.xyPaddingBottom};let l=[];q(x.value.dataset)&&(l=[{values:x.value.dataset.slice(g.value.start,g.value.end),absoluteIndices:x.value.dataset.map((a,o)=>o).slice(g.value.start,g.value.end),name:t.value.title,color:G.value[t.value.paletteStartIndex]||d.palette[t.value.paletteStartIndex],id:"line_0"}]),ie(x.value.dataset)&&(l=x.value.dataset.map((a,o)=>({...a,values:a.VALUE||a.DATA||a.SERIE||a.VALUES||a.NUM||0,name:a.NAME||a.DESCRIPTION||a.TITLE||a.LABEL||`Serie ${o}`,id:`line_${o}`})).map((a,o)=>({...a,color:a.COLOR?d.convertColorToHex(a.COLOR):G.value[o+t.value.paletteStartIndex]||d.palette[o+t.value.paletteStartIndex]||d.palette[(o+t.value.paletteStartIndex)%d.palette.length],values:a.values.slice(g.value.start,g.value.end),absoluteIndices:a.values.map((k,f)=>f).slice(g.value.start,g.value.end)})));const n={max:Math.max(...l.filter(a=>!y.value.includes(a.id)).flatMap(a=>a.values)),min:Math.min(...l.filter(a=>!y.value.includes(a.id)).flatMap(a=>a.values)),maxSeries:Math.max(...l.map(a=>a.values.length))},s=d.calculateNiceScale(n.min<0?n.min:0,n.max<0?0:n.max,t.value.xyScaleSegments),m=n.min<0?Math.abs(n.min):0,L=n.max<0?v.top:v.bottom-m/(s.max+m)*v.height,C=v.width/n.maxSeries,M=s.ticks.map(a=>({y:v.bottom-v.height*((a+m)/(s.max+m)),x:v.left-8,value:a})),T=l.map((a,o)=>({...a,coordinates:a.values.map((k,f)=>({x:v.left+C*(f+1)-C/2,y:v.bottom-(k+m)/(s.max+m)*v.height,value:k}))})).map(a=>{let o=[];return a.coordinates.forEach(k=>{o.push(`${k.x},${k.y} `)}),{...a,linePath:o.join(" ")}});function U(a){F.value=a;const o=l.map(f=>({...f,value:f.values[a],absoluteIndex:f.absoluteIndices[a]})).filter(f=>!y.value.includes(f.id));j.value={datapoint:o,seriesIndex:a,config:t.value,dataset:l};const k=t.value.tooltipCustomFormat;if(d.isFunction(k)&&d.functionReturnsString(()=>k({datapoint:o,seriesIndex:a,series:l,config:t.value})))P.value=k({datapoint:o,seriesIndex:a,series:l,config:t.value});else{let f="";t.value.xyPeriods[o[0].absoluteIndex]&&(f+=`<div style="border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${t.value.xyPeriods[o[0].absoluteIndex]}</div>`),o.forEach(_=>{f+=`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),d=require("./index-BFH7X8WG.cjs"),ke=require("./useResponsive-B3TrDDIG.cjs"),le=require("./BaseIcon-BkdELEYE.cjs"),Ce=require("./Tooltip-B-laoopT.cjs"),pe=require("./usePrinter-hyuaFHQj.cjs"),ze=require("./Slicer-DcjEg-ZZ.cjs"),ge=require("./useNestedProp-B_z4-n52.cjs"),Ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),S={LINE:"LINE",BAR:"BAR",DONUT:"DONUT"},Fe=["SERIE","SERIES","DATA","VALUE","VALUES","NUM"];function Ve({dataset:r,barLineSwitch:b=6}){let h=null,A=null,N=0;if((typeof r=="number"||typeof r=="string")&&console.warn(`The provided dataset (${r}) is not sufficient to build a chart`),Y(r)&&(q(r)&&(r.length<b?h=S.BAR:h=S.LINE,A=r,N=r.length),ie(r))){if(!Pe(r))return console.warn("The objects in the dataset array have a different data structure. Either keys or value types are different."),!1;const D=Object.keys(r[0]),W=Object.values(r[0]);if(!D.some(w=>Te(w)))return console.warn("The data type of the dataset objects in the array must contain one of the following keys: DATA, SERIES, VALUE, VALUES, NUM. Casing is not important."),!1;ye(W,w=>typeof w=="number")&&(h=S.DONUT,A=r),ye(W,w=>Array.isArray(w)&&q(w))&&(xe(r)>b?h=S.LINE:h=S.BAR,N=xe(r),A=r.map(w=>({...w,data:Re(w,$=>q($))}))),r=r.map(w=>Se(w)),A=A.map(w=>Se(w))}return Y(r)&&[...new Set(r.flatMap(D=>Array.isArray(D)))][0],{dataset:r,type:h,usableDataset:A,maxSeriesLength:N}}function be(r){return!r||Y(r)&&!r.length}function Y(r){return Array.isArray(r)}function q(r){if(!Y(r)||be(r))return!1;const b=r.map(h=>Number(h));return![...new Set(b.flatMap(h=>typeof h=="number"&&!isNaN(h)))].includes(!1)}function ie(r){return!Y(r)||be(r)||!![...new Set(r.flatMap(h=>typeof h=="object"&&!Array.isArray(h)))].includes(!1)?!1:!r.map(h=>Object.keys(h).length>0).includes(!1)}function $e(r,b){const h=Object.keys(r).sort(),A=Object.keys(b).sort();if(h.length!==A.length)return!1;for(let N=0;N<h.length;N+=1){const V=h[N],I=A[N];if(V!==I||typeof r[V]!=typeof b[I])return!1}return!0}function Pe(r){if(r.length<=1)return!0;for(let b=0;b<r.length;b+=1)for(let h=b+1;h<r.length;h+=1)if(!$e(r[b],r[h]))return!1;return!0}function Te(r){return Fe.includes(r.toUpperCase())}function ye(r,b){let h=[];for(let A=0;A<r.length;A+=1)h.push(b(r[A]));return h.includes(!0)}function xe(r){return Math.max(...[...r].flatMap(b=>Object.values(b).filter(h=>q(h)).map(h=>h.length)))}function Re(r,b){return Object.values(r).filter(h=>b(h))[0]}function Se(r){const b={};for(let h in r)r.hasOwnProperty(h)&&(b[h.toUpperCase()]=r[h]);return b}const Be=r=>(e.pushScopeId("data-v-e62d13b6"),r=r(),e.popScopeId(),r),Oe=["id"],Ie=["xmlns","viewBox"],De=["id"],Me=["id"],Ue=Be(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),qe=["id"],We=["flood-color"],je={key:0,class:"donut-label-connectors"},Ge=["d","stroke","stroke-width","filter"],He=["cx","cy","r","fill"],Xe=["cx","cy","r","fill","filter"],Ye={class:"donut"},Ze=["d","fill","stroke","stroke-width","filter"],Je=["d","onMouseenter","onClick"],Ke={key:1,class:"donut-labels quick-animation"},Qe=["cx","cy","fill","filter"],et=["text-anchor","x","y","fill","font-size","filter"],tt=["text-anchor","x","y","fill","font-size","filter"],lt={key:2,class:"donut-hollow quick-animation"},at=["x","y","font-size","fill"],ot=["x","y","font-size","fill"],nt={key:0,class:"line-grid"},rt=["x1","x2","y1","y2","stroke","stroke-width"],it=["x1","x2","y1","y2","stroke","stroke-width"],ut={key:1,class:"line-axis"},st=["x1","x2","y1","y2","stroke","stroke-width"],ct=["x1","x2","y1","y2","stroke","stroke-width"],dt={key:2,class:"yLabels"},vt=["x1","x2","y1","y2","stroke","stroke-width"],mt=["x","y","font-size","fill"],ht={key:3,class:"periodLabels"},ft=["x1","x2","y1","y2","stroke","stroke-width"],kt=["font-size","text-anchor","fill","transform"],pt={class:"plots"},gt={class:"line-plot-series"},yt=["d","stroke","stroke-width"],xt=["d","stroke","stroke-width"],St=["d","stroke","stroke-width"],bt=["d","stroke","stroke-width"],Bt=["cx","cy","fill","stroke"],wt={key:4,class:"dataLabels"},Et=["font-size","fill","x","y"],_t={class:"tooltip-traps"},At=["x","y","height","width","fill","onMouseenter","onClick"],Lt={key:0,class:"line-grid"},Ct=["x1","x2","y1","y2","stroke","stroke-width"],zt=["x1","x2","y1","y2","stroke","stroke-width"],Nt={key:1,class:"line-axis"},Ft=["x1","x2","y1","y2","stroke","stroke-width"],Vt=["x1","x2","y1","y2","stroke","stroke-width"],$t={key:2,class:"yLabels"},Pt=["x1","x2","y1","y2","stroke","stroke-width"],Tt=["x","y","font-size","fill"],Rt={key:3,class:"periodLabels"},Ot=["x1","x2","y1","y2","stroke","stroke-width"],It=["font-size","text-anchor","transform","fill"],Dt={class:"plots"},Mt=["x","width","height","y","fill","stroke","stroke-width"],Ut=["to"],qt=["from","to"],Wt={key:4,class:"dataLabels"},jt=["x","y","font-size","fill"],Gt={class:"tooltip-traps"},Ht=["x","y","height","width","fill","onMouseenter","onClick"],Xt={key:3,class:"axis-labels"},Yt={key:0},Zt=["font-size","fill","x","y"],Jt={key:1},Kt=["font-size","fill","x","y"],Qt={key:2},el=["font-size","fill","transform"],tl={key:3},ll=["font-size","fill","transform"],al={key:2,class:"vue-data-ui-watermark"},ol=["onClick"],nl=["onClick"],rl=["onClick"],il={key:1,class:"vue-ui-quick-chart-not-processable"},ul=Be(()=>e.createElementVNode("span",null,"Dataset is not processable",-1)),sl={__name:"vue-ui-quick-chart",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,Object,String,Number],default(){return null}}},emits:["selectDatapoint","selectLegend"],setup(r,{expose:b,emit:h}){const A=r,{vue_ui_quick_chart:N}=d.useConfig(),V=e.ref(null),I=e.ref(null),D=e.ref(null),W=e.ref(null),w=e.ref(d.createUid()),$=e.ref(!1),j=e.ref(null),P=e.ref(""),F=e.ref(null),y=e.ref([]),ue=e.ref(0),ae=e.ref(0),t=e.computed(()=>{const i=ge.useNestedProp({userConfig:A.config,defaultConfig:N});return i.theme?{...ge.useNestedProp({userConfig:d.themes.vue_ui_quick_chart[i.theme]||A.config,defaultConfig:i}),customPalette:d.themePalettes[i.theme]||d.palette}:i}),G=e.computed(()=>d.convertCustomPalette(t.value.customPalette)),Z=e.computed(()=>{const i=Ve({dataset:A.dataset,barLineSwitch:t.value.chartIsBarUnderDatasetLength});return i||console.error("VueUiQuickChart : Dataset is not processable"),i}),x=e.ref(Z.value),we=e.computed(()=>!!x.value),E=e.computed(()=>x.value?x.value.type:null),{isPrinting:J,isImaging:K,generatePdf:se,generateImage:ce}=pe.usePrinter({elementId:`${E.value}_${w.value}`,fileName:t.value.title||E.value}),p=e.ref({width:t.value.width,height:t.value.height}),Q=e.ref({showTooltip:t.value.showTooltip}),ee=e.ref(null);e.onMounted(()=>{if(t.value.responsive){const i=ke.throttle(()=>{const{width:v,height:l}=ke.useResponsive({chart:V.value,title:t.value.title?I.value:null,legend:t.value.showLegend?D.value:null,slicer:[S.BAR,S.LINE].includes(E.value)&&t.value.zoomXy&&x.value.maxSeriesLength>1?W.value:null});p.value.width=v,p.value.height=l});ee.value=new ResizeObserver(i),ee.value.observe(V.value.parentNode)}}),e.onBeforeUnmount(()=>{ee.value&&ee.value.disconnect()});const Ee=e.computed(()=>{switch(E.value){case S.LINE:return`0 0 ${p.value.width<=0?10:p.value.width} ${p.value.height<=0?10:p.value.height}`;case S.BAR:return`0 0 ${p.value.width<=0?10:p.value.width} ${p.value.height<=0?10:p.value.height}`;case S.DONUT:return`0 0 ${p.value.width<=0?10:p.value.width} ${p.value.height<=0?10:p.value.height}`;default:return`0 0 ${p.value.width<=0?10:p.value.width} ${p.value.height<=0?10:p.value.height}`}});function de(i){return[...i].map(v=>v.value).reduce((v,l)=>v+l,0)}function H(i){return t.value.blurOnHover&&![null,void 0].includes(F.value)&&F.value!==i?`url(#blur_${w.value})`:""}function ve(i,v){y.value.includes(i)?y.value=y.value.filter(l=>l!==i):y.value.length<v&&y.value.push(i)}const me=e.ref(null),he=e.ref(null),te=e.ref(!1);function _e(i,v){te.value=!0;let l=i.value;if(y.value.includes(i.id)){let s=function(){l>n?(te.value=!1,cancelAnimationFrame(he.value),x.value={...x.value,dataset:x.value.dataset.map((m,L)=>i.id===`donut_${L}`?{...m,value:n,VALUE:n}:m)}):(l+=n*.025,x.value={...x.value,dataset:x.value.dataset.map((m,L)=>i.id===`donut_${L}`?{...m,value:l,VALUE:l}:m)},he.value=requestAnimationFrame(s))};y.value=y.value.filter(m=>m!==i.id);const n=Z.value.dataset.find((m,L)=>i.id===`donut_${L}`).VALUE;s()}else if(v.length>1){let n=function(){l<.1?(te.value=!1,cancelAnimationFrame(me.value),y.value.push(i.id),x.value={...x.value,dataset:x.value.dataset.map((s,m)=>i.id===`donut_${m}`?{...s,value:0,VALUE:0}:s)}):(l/=1.1,x.value={...x.value,dataset:x.value.dataset.map((s,m)=>i.id===`donut_${m}`?{...s,value:l,VALUE:l}:s)},me.value=requestAnimationFrame(n))};n()}}const B=e.computed(()=>{if(E.value!==S.DONUT)return null;const i=x.value.dataset.map((a,o)=>({...a,value:a.VALUE||a.DATA||a.SERIE||a.VALUES||a.NUM||0,name:a.NAME||a.DESCRIPTION||a.TITLE||a.LABEL||`Serie ${o}`,id:`donut_${o}`})).map((a,o)=>({...a,color:a.COLOR?d.convertColorToHex(a.COLOR):G.value[o+t.value.paletteStartIndex]||d.palette[o+t.value.paletteStartIndex]||d.palette[(o+t.value.paletteStartIndex)%d.palette.length],immutableValue:a.value}));function v(a,o){return isNaN(a.value/de(o))?0:(a.value/de(o)*100).toFixed(t.value.dataLabelRoundingPercentage)+"%"}function l(a){return a.proportion*100>t.value.donutHideLabelUnderPercentage}function n(a,o){const k=Z.value.dataset.find((_,z)=>`donut_${z}`===a).VALUE;return Math.abs(String(Number(k.toFixed(0))).length-String(Number(o.toFixed(0))).length)}function s({datapoint:a,seriesIndex:o}){j.value={datapoint:a,seriesIndex:o,config:t.value,dataset:i},F.value=a.id;const k=t.value.tooltipCustomFormat;if(d.isFunction(k)&&d.functionReturnsString(()=>k({datapoint:a,seriesIndex:o,series:i,config:t.value})))P.value=k({datapoint:a,seriesIndex:o,series:i,config:t.value});else{let f="";f+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${a.name}</div>`,f+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${a.color}"/></svg>`,f+=`<b>${d.dataLabel({p:t.value.valuePrefix,v:a.value,s:t.value.valueSuffix,r:t.value.dataLabelRoundingValue})}</b>`,f+=`<span>(${d.dataLabel({v:a.proportion*100,s:"%",r:t.value.dataLabelRoundingPercentage})})</span></div>`,P.value=`<div>${f}</div>`}$.value=!0}function m(){$.value=!1,F.value=null}const L={centerX:p.value.width/2,centerY:p.value.height/2},C=i.filter(a=>!y.value.includes(a.id)).map(a=>a.value||0).reduce((a,o)=>a+o,0),M=i.map((a,o)=>({...a,proportion:(a.value||0)/C,value:a.value||0,absoluteValue:Z.value.dataset.find((k,f)=>`donut_${f}`===a.id).VALUE})),T=p.value.width/2,U=p.value.height/2,R=p.value.height*t.value.donutRadiusRatio;return{dataset:M.filter(a=>!y.value.includes(a.id)),legend:M,drawingArea:L,displayArcPercentage:v,isArcBigEnough:l,useTooltip:s,killTooltip:m,getSpaces:n,total:C,cx:T,cy:U,radius:R,chart:d.makeDonut({series:i.filter(a=>!y.value.includes(a.id))},T,U,R,R,1.99999,2,1,360,105.25,p.value.height*t.value.donutThicknessRatio)}}),g=e.ref({start:0,end:x.value.maxSeriesLength});function Ae(){g.value={start:0,end:x.value.maxSeriesLength},ae.value+=1}const c=e.computed(()=>{if(E.value!==S.LINE)return null;const i={height:p.value.height,width:p.value.width},v={left:t.value.xyPaddingLeft,top:t.value.xyPaddingTop,right:i.width-t.value.xyPaddingRight,bottom:i.height-t.value.xyPaddingBottom,width:i.width-t.value.xyPaddingLeft-t.value.xyPaddingRight,height:i.height-t.value.xyPaddingTop-t.value.xyPaddingBottom};let l=[];q(x.value.dataset)&&(l=[{values:x.value.dataset.slice(g.value.start,g.value.end),absoluteIndices:x.value.dataset.map((a,o)=>o).slice(g.value.start,g.value.end),name:t.value.title,color:G.value[t.value.paletteStartIndex]||d.palette[t.value.paletteStartIndex],id:"line_0"}]),ie(x.value.dataset)&&(l=x.value.dataset.map((a,o)=>({...a,values:a.VALUE||a.DATA||a.SERIE||a.VALUES||a.NUM||0,name:a.NAME||a.DESCRIPTION||a.TITLE||a.LABEL||`Serie ${o}`,id:`line_${o}`})).map((a,o)=>({...a,color:a.COLOR?d.convertColorToHex(a.COLOR):G.value[o+t.value.paletteStartIndex]||d.palette[o+t.value.paletteStartIndex]||d.palette[(o+t.value.paletteStartIndex)%d.palette.length],values:a.values.slice(g.value.start,g.value.end),absoluteIndices:a.values.map((k,f)=>f).slice(g.value.start,g.value.end)})));const n={max:Math.max(...l.filter(a=>!y.value.includes(a.id)).flatMap(a=>a.values)),min:Math.min(...l.filter(a=>!y.value.includes(a.id)).flatMap(a=>a.values)),maxSeries:Math.max(...l.map(a=>a.values.length))},s=d.calculateNiceScale(n.min<0?n.min:0,n.max<0?0:n.max,t.value.xyScaleSegments),m=n.min<0?Math.abs(n.min):0,L=n.max<0?v.top:v.bottom-m/(s.max+m)*v.height,C=v.width/n.maxSeries,M=s.ticks.map(a=>({y:v.bottom-v.height*((a+m)/(s.max+m)),x:v.left-8,value:a})),T=l.map((a,o)=>({...a,coordinates:a.values.map((k,f)=>({x:v.left+C*(f+1)-C/2,y:v.bottom-(k+m)/(s.max+m)*v.height,value:k}))})).map(a=>{let o=[];return a.coordinates.forEach(k=>{o.push(`${k.x},${k.y} `)}),{...a,linePath:o.join(" ")}});function U(a){F.value=a;const o=l.map(f=>({...f,value:f.values[a],absoluteIndex:f.absoluteIndices[a]})).filter(f=>!y.value.includes(f.id));j.value={datapoint:o,seriesIndex:a,config:t.value,dataset:l};const k=t.value.tooltipCustomFormat;if(d.isFunction(k)&&d.functionReturnsString(()=>k({datapoint:o,seriesIndex:a,series:l,config:t.value})))P.value=k({datapoint:o,seriesIndex:a,series:l,config:t.value});else{let f="";t.value.xyPeriods[o[0].absoluteIndex]&&(f+=`<div style="border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${t.value.xyPeriods[o[0].absoluteIndex]}</div>`),o.forEach(_=>{f+=`
|
|
2
2
|
<div style="display:flex; flex-wrap: wrap; align-items:center; gap:3px;">
|
|
3
3
|
<svg viewBox="0 0 12 12" height="14" width="12"><circle cx="6" cy="6" r="6" stroke="none" fill="${_.color}"/></svg>
|
|
4
4
|
<span>${_.name}:</span>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ref as P, computed as G, onMounted as Qe, onBeforeUnmount as et, openBlock as a, createElementBlock as l, normalizeClass as le, normalizeStyle as I, createBlock as Be, unref as _, createSlots as tt, withCtx as K, renderSlot as D, normalizeProps as H, guardReactiveProps as ve, createCommentVNode as x, toDisplayString as T, createElementVNode as S, Fragment as g, renderList as A, mergeProps as Le, createVNode as de, pushScopeId as at, popScopeId as lt } from "vue";
|
|
2
|
-
import { u as ot, c as ut, t as it, a as nt, p as M, b as rt, d as ze, m as st, z as Ue, X as vt, i as dt, j as ce, k as $e, f as B, L as De, v as ke, w as Ce } from "./index-
|
|
2
|
+
import { u as ot, c as ut, t as it, a as nt, p as M, b as rt, d as ze, m as st, z as Ue, X as vt, i as dt, j as ce, k as $e, f as B, L as De, v as ke, w as Ce } from "./index-BE6fhUyH.js";
|
|
3
3
|
import { t as ct, u as ht } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import be from "./BaseIcon-
|
|
5
|
-
import { _ as ft } from "./Tooltip-
|
|
6
|
-
import { u as gt, U as xt } from "./usePrinter-
|
|
7
|
-
import { S as yt } from "./Slicer-
|
|
8
|
-
import { u as Ve } from "./useNestedProp-
|
|
4
|
+
import be from "./BaseIcon-CHBghp3_.js";
|
|
5
|
+
import { _ as ft } from "./Tooltip-etzDGo1Y.js";
|
|
6
|
+
import { u as gt, U as xt } from "./usePrinter-CdIphKpF.js";
|
|
7
|
+
import { S as yt } from "./Slicer-BNgHaM2_.js";
|
|
8
|
+
import { u as Ve } from "./useNestedProp-BcjRW6BJ.js";
|
|
9
9
|
import { _ as pt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
10
|
const L = {
|
|
11
11
|
LINE: "LINE",
|