vue-data-ui 2.3.8 → 2.3.9
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-CS3h3CsG.js → Arrow-CyqlT0ih.js} +1 -1
- package/dist/{Arrow-DUJvJpMd.cjs → Arrow-Xy7TAWLU.cjs} +1 -1
- package/dist/{BaseIcon-ByV6y3w8.cjs → BaseIcon-DpzJwh5Z.cjs} +1 -1
- package/dist/{BaseIcon-CVk_WG9x.js → BaseIcon-vF6zgXvp.js} +1 -1
- package/dist/{DataTable-C4CMZu2s.cjs → DataTable-DZ7GOCVh.cjs} +1 -1
- package/dist/{DataTable-B-LJlgjS.js → DataTable-Dj8KLJHc.js} +2 -2
- package/dist/{Legend-DWBU0qDC.cjs → Legend-BNUo8JKO.cjs} +1 -1
- package/dist/{Legend-DVsCAbZS.js → Legend-MfrOhwon.js} +1 -1
- package/dist/{Shape-CcbBblwI.cjs → Shape-DBYznwuk.cjs} +1 -1
- package/dist/{Shape-w47nQzLj.js → Shape-fssaGSn1.js} +1 -1
- package/dist/{Slicer-CY-QTbH4.cjs → Slicer-B8qDEiI2.cjs} +1 -1
- package/dist/{Slicer-2MG0k2PP.js → Slicer-C2VIWW3F.js} +1 -1
- package/dist/{Title-D6zeMzr0.cjs → Title--kLbBq-N.cjs} +1 -1
- package/dist/{Title-D_FeWJsx.js → Title-DM6fKrUI.js} +1 -1
- package/dist/{Tooltip-BY94WbUk.js → Tooltip-CAmd4pzg.js} +1 -1
- package/dist/{Tooltip-2d9jRdHk.cjs → Tooltip-Dwh7A0L5.cjs} +1 -1
- package/dist/{index-BQbaKiSm.cjs → index-CSlObCMJ.cjs} +1 -1
- package/dist/{index-DLi6mPet.js → index-D0PI50d6.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-DmMzRJ1O.js → useNestedProp-BNV_Y29K.js} +1 -1
- package/dist/{useNestedProp-B6CpIX-3.cjs → useNestedProp-DUXlSjg2.cjs} +1 -1
- package/dist/{usePrinter-BANjHBXe.cjs → usePrinter-ClpmcbPy.cjs} +1 -1
- package/dist/{usePrinter-BnaEziDF.js → usePrinter-DJnJEVGy.js} +1 -1
- package/dist/{vue-data-ui-DWSz421j.cjs → vue-data-ui-B5epGKMS.cjs} +1 -1
- package/dist/{vue-data-ui-Br12h04t.js → vue-data-ui-DLhyTmG3.js} +55 -55
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-BFu2IXOP.cjs → vue-ui-3d-bar-Dv5Nu-Kz.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-CNpZvjQ1.js → vue-ui-3d-bar-JeMsTT6R.js} +7 -7
- package/dist/{vue-ui-accordion-DzCdp527.js → vue-ui-accordion-C1dTIdYg.js} +3 -3
- package/dist/{vue-ui-accordion-CHVCSgY3.cjs → vue-ui-accordion-IPISean4.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-CCezvPxx.js → vue-ui-age-pyramid-BPrB-Srk.js} +8 -8
- package/dist/{vue-ui-age-pyramid-DaUZgLYc.cjs → vue-ui-age-pyramid-ytOUpNe5.cjs} +1 -1
- package/dist/{vue-ui-annotator-CZ3Lk0Ky.cjs → vue-ui-annotator-Bp2ylQ-N.cjs} +1 -1
- package/dist/{vue-ui-annotator-QPK7ARtK.js → vue-ui-annotator-DpY8JI03.js} +1 -1
- package/dist/{vue-ui-candlestick-CaofVEg_.cjs → vue-ui-candlestick-BoDWcJYz.cjs} +1 -1
- package/dist/{vue-ui-candlestick-kh_Ft3mr.js → vue-ui-candlestick-D_KnLwpq.js} +9 -9
- package/dist/vue-ui-carousel-table-DWUmj6NW.js +330 -0
- package/dist/vue-ui-carousel-table-tPbrubLn.cjs +1 -0
- package/dist/{vue-ui-chestnut-joiWg5ii.cjs → vue-ui-chestnut-BltZicnq.cjs} +1 -1
- package/dist/{vue-ui-chestnut-BypPYKEQ.js → vue-ui-chestnut-gUPyB2F7.js} +6 -6
- package/dist/{vue-ui-cursor-CVwqSrVu.js → vue-ui-cursor-CBrYcHgg.js} +2 -2
- package/dist/{vue-ui-cursor-CaxdcYVa.cjs → vue-ui-cursor-Mi9mivGV.cjs} +1 -1
- package/dist/{vue-ui-dashboard-C7roqJdv.js → vue-ui-dashboard-BvJccz-l.js} +2 -2
- package/dist/{vue-ui-dashboard-B12glgQZ.cjs → vue-ui-dashboard-DKJRkuMC.cjs} +1 -1
- package/dist/{vue-ui-digits-DZBXECIq.js → vue-ui-digits-PvPOOZTT.js} +2 -2
- package/dist/{vue-ui-digits-BeGGrWds.cjs → vue-ui-digits-UvPWZIkN.cjs} +1 -1
- package/dist/{vue-ui-donut-DoMzPJHF.js → vue-ui-donut-CCnmksR_.js} +9 -9
- package/dist/{vue-ui-donut-diN8RiYm.cjs → vue-ui-donut-DBD9IyRA.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-CTgTqsih.cjs → vue-ui-donut-evolution-C2mbsaP5.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-CXT7c3_C.js → vue-ui-donut-evolution-DWz0XIkn.js} +9 -9
- package/dist/{vue-ui-dumbbell-B6th1M9b.cjs → vue-ui-dumbbell-CdQ1eQN_.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-1StMWJ5B.js → vue-ui-dumbbell-DnhWlDqn.js} +8 -8
- package/dist/{vue-ui-flow-Bux2O68S.cjs → vue-ui-flow-CXeTBawu.cjs} +1 -1
- package/dist/{vue-ui-flow-ynx-run3.js → vue-ui-flow-zTfYWLOo.js} +7 -7
- package/dist/{vue-ui-galaxy-D9QnmX0M.cjs → vue-ui-galaxy-Cr1TLsZ-.cjs} +1 -1
- package/dist/{vue-ui-galaxy-C7GEYMQB.js → vue-ui-galaxy-CviL0-9-.js} +9 -9
- package/dist/{vue-ui-gauge-DU8VU1m7.js → vue-ui-gauge-0wjKwTcJ.js} +4 -4
- package/dist/{vue-ui-gauge-DrgKJTGw.cjs → vue-ui-gauge-C8cqiuMs.cjs} +1 -1
- package/dist/{vue-ui-heatmap-BIBsrwjz.cjs → vue-ui-heatmap-BempgzJY.cjs} +1 -1
- package/dist/{vue-ui-heatmap-DUuN0fGR.js → vue-ui-heatmap-BjX35pDk.js} +8 -8
- package/dist/{vue-ui-kpi-CLEQSt4V.cjs → vue-ui-kpi-Cwoq-OQZ.cjs} +1 -1
- package/dist/{vue-ui-kpi-BoGsykfq.js → vue-ui-kpi-DKPUNPyD.js} +2 -2
- package/dist/{vue-ui-mini-loader-CIPfR_lB.cjs → vue-ui-mini-loader-DYmuLkr_.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-CNCZkUvI.js → vue-ui-mini-loader-umbgz-jE.js} +2 -2
- package/dist/{vue-ui-molecule-Da19KH5g.cjs → vue-ui-molecule-D04xU1nK.cjs} +1 -1
- package/dist/{vue-ui-molecule-Brw0qOjw.js → vue-ui-molecule-DnTFVeGw.js} +9 -9
- package/dist/{vue-ui-mood-radar-hIUOJ8Cd.js → vue-ui-mood-radar-BdsUM6EW.js} +9 -9
- package/dist/{vue-ui-mood-radar-BktJHBX_.cjs → vue-ui-mood-radar-wHCxSeNT.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-2GqE8lhb.cjs → vue-ui-nested-donuts--34k7AUI.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-DXZXCu5s.js → vue-ui-nested-donuts-CX_V9UIk.js} +9 -9
- package/dist/{vue-ui-onion-Bx2_3hmi.js → vue-ui-onion-C3scIn1m.js} +9 -9
- package/dist/{vue-ui-onion-DqnFyhwy.cjs → vue-ui-onion-ot5UiFnD.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-DgjecbC2.js → vue-ui-parallel-coordinate-plot-BrtFu6_R.js} +10 -10
- package/dist/{vue-ui-parallel-coordinate-plot-CIkVq6XI.cjs → vue-ui-parallel-coordinate-plot-CLYNauuG.cjs} +1 -1
- package/dist/{vue-ui-quadrant-DlSMixki.js → vue-ui-quadrant-CZQnq031.js} +10 -10
- package/dist/{vue-ui-quadrant-DUNTLV5w.cjs → vue-ui-quadrant-b3C38Y-z.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-_ysWkoF7.js → vue-ui-quick-chart-CQ_m8VuI.js} +6 -6
- package/dist/{vue-ui-quick-chart-CpdxM7qN.cjs → vue-ui-quick-chart-CS1XKyME.cjs} +1 -1
- package/dist/{vue-ui-radar-Fh5UQO5Z.js → vue-ui-radar-Bk_bQCIc.js} +10 -10
- package/dist/{vue-ui-radar-B8fTGb35.cjs → vue-ui-radar-ayBCV2nl.cjs} +1 -1
- package/dist/{vue-ui-rating-BTbg-bNd.cjs → vue-ui-rating-BNAFeqKV.cjs} +1 -1
- package/dist/{vue-ui-rating-CwV_45UQ.js → vue-ui-rating-CwmqAW6j.js} +2 -2
- package/dist/{vue-ui-relation-circle-B61AGVtF.js → vue-ui-relation-circle-B19oCBsQ.js} +5 -5
- package/dist/{vue-ui-relation-circle-BrHBPn8C.cjs → vue-ui-relation-circle-D__4tmLy.cjs} +1 -1
- package/dist/{vue-ui-rings-BSbFTwmB.cjs → vue-ui-rings-DWv1YjLY.cjs} +1 -1
- package/dist/{vue-ui-rings-DwtqKTGk.js → vue-ui-rings-Ekq8eld0.js} +9 -9
- package/dist/{vue-ui-scatter-CFXQQZQr.js → vue-ui-scatter-B5lq6TQb.js} +10 -10
- package/dist/{vue-ui-scatter-BdphtRDE.cjs → vue-ui-scatter-Djt3w_7K.cjs} +1 -1
- package/dist/{vue-ui-screenshot-ChP1r5WI.cjs → vue-ui-screenshot-BBTScesQ.cjs} +1 -1
- package/dist/{vue-ui-screenshot-CkI4Gtys.js → vue-ui-screenshot-BGEu-1aK.js} +1 -1
- package/dist/{vue-ui-skeleton-CmXMTbOC.js → vue-ui-skeleton-CDB2sB2S.js} +2 -2
- package/dist/{vue-ui-skeleton-DIm7kxhc.cjs → vue-ui-skeleton-aEAr9fnx.cjs} +1 -1
- package/dist/{vue-ui-smiley-BQJ6XX_L.js → vue-ui-smiley-5sY2rtTd.js} +2 -2
- package/dist/{vue-ui-smiley-BQ1_0eFh.cjs → vue-ui-smiley-pHCa1uHj.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-COUBPV4j.cjs → vue-ui-spark-trend-BLYjicGH.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-Dx4w74bw.js → vue-ui-spark-trend-C6U8pRYP.js} +4 -4
- package/dist/{vue-ui-sparkbar-CxKIVunV.js → vue-ui-sparkbar-DdEDQOc8.js} +3 -3
- package/dist/{vue-ui-sparkbar-Cdcndp7Q.cjs → vue-ui-sparkbar-e9mZh74f.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-BhVgI98W.js → vue-ui-sparkgauge-CV0OpVGr.js} +3 -3
- package/dist/{vue-ui-sparkgauge-Bd2F7zw1.cjs → vue-ui-sparkgauge-S9QibidM.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-CKw6tZnv.js → vue-ui-sparkhistogram-BCcYAQYV.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-B1Txwx4N.cjs → vue-ui-sparkhistogram-DVc-tjMC.cjs} +1 -1
- package/dist/{vue-ui-sparkline-CSEByr6z.js → vue-ui-sparkline-C6emienJ.js} +3 -3
- package/dist/{vue-ui-sparkline-CrXPLabK.cjs → vue-ui-sparkline-WkYNaf-r.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-CQLWpdxG.js → vue-ui-sparkstackbar-CptWawfp.js} +3 -3
- package/dist/{vue-ui-sparkstackbar-BfP1wyyg.cjs → vue-ui-sparkstackbar-oB0fsXWO.cjs} +1 -1
- package/dist/{vue-ui-strip-plot-N-_mlbwb.cjs → vue-ui-strip-plot-D30zeVfM.cjs} +1 -1
- package/dist/{vue-ui-strip-plot-DAJ0qjKU.js → vue-ui-strip-plot-Kb7Kk-C8.js} +9 -9
- package/dist/{vue-ui-table-DFe98urD.js → vue-ui-table-Dqyr1Go9.js} +1 -1
- package/dist/{vue-ui-table-t1jDOoJW.cjs → vue-ui-table-FUX1jbtH.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-oEi-vxRg.cjs → vue-ui-table-heatmap-Cqd_rPSG.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-DUonA4jJ.js → vue-ui-table-heatmap-DAWzPS1D.js} +4 -4
- package/dist/{vue-ui-table-sparkline-DKoH5PeD.cjs → vue-ui-table-sparkline-CWSL5RtX.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-BIY7GWik.js → vue-ui-table-sparkline-DgUpsNVO.js} +5 -5
- package/dist/{vue-ui-thermometer-ZgNA47Fv.cjs → vue-ui-thermometer-DDpxHZhQ.cjs} +1 -1
- package/dist/{vue-ui-thermometer-BiWx3ujG.js → vue-ui-thermometer-UZFTkdJs.js} +5 -5
- package/dist/{vue-ui-timer-BmThVcD0.cjs → vue-ui-timer-CXonfhMU.cjs} +1 -1
- package/dist/{vue-ui-timer-BFKnN8tS.js → vue-ui-timer-DCexI32t.js} +4 -4
- package/dist/{vue-ui-tiremarks-D9ClW4XX.cjs → vue-ui-tiremarks-DByzjHco.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-BO_X27nw.js → vue-ui-tiremarks-UtTUbZUt.js} +5 -5
- package/dist/{vue-ui-treemap-BVV-tfRq.cjs → vue-ui-treemap-BT9zMgOs.cjs} +1 -1
- package/dist/{vue-ui-treemap-Crrd_rpP.js → vue-ui-treemap-DpLJGsie.js} +9 -9
- package/dist/{vue-ui-vertical-bar-CyuImTrh.js → vue-ui-vertical-bar-B9poCwqT.js} +9 -9
- package/dist/{vue-ui-vertical-bar-k9KkT9mN.cjs → vue-ui-vertical-bar-BWWvfTkx.cjs} +1 -1
- package/dist/{vue-ui-waffle-CYSDDS3-.js → vue-ui-waffle-BGnyyHVp.js} +83 -83
- package/dist/{vue-ui-waffle-DenwQo8B.cjs → vue-ui-waffle-fRaiL6eW.cjs} +1 -1
- package/dist/{vue-ui-wheel-C8-f39P2.js → vue-ui-wheel-7JdR9vyK.js} +5 -5
- package/dist/{vue-ui-wheel-Cx7SBWWF.cjs → vue-ui-wheel-C0BVez2R.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-CMsakywD.cjs → vue-ui-word-cloud-CDDYvCP9.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-D9y9Iht6.js → vue-ui-word-cloud-S1x3FJQ6.js} +6 -6
- package/dist/{vue-ui-xy-Dhpahzod.js → vue-ui-xy-DBC1QS_G.js} +12 -12
- package/dist/{vue-ui-xy-BxCALt6U.cjs → vue-ui-xy-DMkykmZN.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-COwqkdZB.js → vue-ui-xy-canvas-1yb0nuDg.js} +10 -10
- package/dist/{vue-ui-xy-canvas-B_Fi2be0.cjs → vue-ui-xy-canvas-B4xzjjjm.cjs} +1 -1
- package/package.json +1 -1
- package/dist/vue-ui-carousel-table-Cti_GQvV.cjs +0 -1
- package/dist/vue-ui-carousel-table-CxTbe6SP.js +0 -314
|
@@ -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-CSlObCMJ.cjs"),Y=require("./useResponsive-B3TrDDIG.cjs"),de=require("./Title--kLbBq-N.cjs"),ve=require("./Legend-BNUo8JKO.cjs"),he=require("./Tooltip-Dwh7A0L5.cjs"),pe=require("./Shape-DBYznwuk.cjs"),J=require("./usePrinter-ClpmcbPy.cjs"),me=require("./DataTable-DZ7GOCVh.cjs"),ye=require("./vue-ui-accordion-IPISean4.cjs"),fe=require("./vue-ui-skeleton-aEAr9fnx.cjs"),K=require("./useNestedProp-DUXlSjg2.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"],Me=["onClick"],Ae=["innerHTML"],Pe={__name:"vue-ui-parallel-coordinate-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(Q,{expose:Z,emit:P}){const k=Q,{vue_ui_parallel_coordinate_plot:ee}=i.useConfig(),x=e.computed({get(){return!!k.dataset&&k.dataset.length},set(a){return a}}),L=e.ref(0),w=e.ref(null),E=e.ref(null),I=e.ref(null),N=e.ref(i.createUid()),B=e.ref(!1);function te(a){B.value=a,L.value+=1}const t=e.computed(()=>{const a=K.useNestedProp({userConfig:k.config,defaultConfig:ee});return a.theme?{...K.useNestedProp({userConfig:i.themes.vue_ui_parallel_coordinate_plot[a.theme]||k.config,defaultConfig:a}),customPalette:i.themePalettes[a.theme]||i.palette}:a}),z=e.ref(null);e.onMounted(()=>{if(i.objectIsEmpty(k.dataset)?i.error({componentName:"VueUiParallelCoordinatePlot",type:"dataset"}):k.dataset.forEach((a,o)=>{i.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","series"]}).forEach(l=>{x.value=!1,i.error({componentName:"VueUiParallelCoordinatePlot",type:"datasetSerieAttribute",property:l,index:o})})}),t.value.responsive){const a=Y.throttle(()=>{const{width:o,height:l}=Y.useResponsive({chart:w.value,title:t.value.style.chart.title.text?E.value:null,legend:t.value.style.chart.legend.show?I.value:null});c.value.width=o,c.value.height=l,c.value.plotSize=i.translateSize({relator:Math.min(o,l),adjuster:600,source:t.value.style.chart.plots.radius,threshold:2,fallback:2}),c.value.ticksFontSize=i.translateSize({relator:Math.min(o,l),adjuster:600,source:t.value.style.chart.yAxis.labels.ticks.fontSize,threshold:10,fallback:10}),c.value.datapointFontSize=i.translateSize({relator:Math.min(o,l),adjuster:600,source:t.value.style.chart.yAxis.labels.datapoints.fontSize,threshold:10,fallback:10}),c.value.axisNameFontSize=i.translateSize({relator:Math.min(o,l),adjuster:600,source:t.value.style.chart.yAxis.labels.axisNamesFontSize,threshold:12,fallback:12})});z.value=new ResizeObserver(a),z.value.observe(w.value.parentNode)}}),e.onBeforeUnmount(()=>{z.value&&z.value.disconnect()});const{isPrinting:le,isImaging:ae,generatePdf:V,generateImage:D}=J.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:a,right:o,bottom:l,left:n}=t.value.style.chart.padding,r=c.value.height,s=c.value.width;return{chartHeight:r,chartWidth:s,height:r-a-l,width:s-n-o,top:a,left:n,right:s-o,bottom:r-l}}),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 O(a){f.value.includes(a)?f.value=f.value.filter(o=>o!==a):f.value.push(a)}const b=e.computed(()=>k.dataset.map((a,o)=>{const l=i.convertColorToHex(a.color)||oe.value[o]||i.palette[o]||i.palette[o%i.palette.length];return{...a,series:a.series.map(n=>({...n,id:i.createUid(),color:l})),seriesIndex:o,color:l,id:i.createUid(),shape:a.shape||"circle"}})),ne=e.computed(()=>b.value.map(a=>({...a,opacity:f.value.includes(a.id)?.5:1,segregate:()=>O(a.id),isSegregated:f.value.includes(a.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":""})),q=e.computed(()=>Math.max(...b.value.filter(a=>!f.value.includes(a.id)).map(a=>Math.max(...a.series.flatMap(o=>o.values.length))))),y=e.computed(()=>d.value.width/q.value),T=e.computed(()=>b.value.filter(a=>!f.value.includes(a.id))),h=e.computed(()=>{let a=[];for(let o=0;o<q.value;o+=1){const l=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===l?l/4:l,s=n===l?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}});a.push({scale:u,ticks:g,name:t.value.style.chart.yAxis.labels.axisNames[o]||`Y-${o+1}`})}return a}),F=e.computed(()=>T.value.map((a,o)=>({...a,series:a.series.map((l,n)=>({...l,datapoints:l.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:l.name,seriesName:a.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:l.comments&&l.comments[s]||""}})}))})).map(a=>({...a,series:a.series.map(o=>{const l=i.createStraightPath(o.datapoints),n=i.createSmoothPath(o.datapoints,.12),r=i.getPathLengthFromCoordinates(t.value.style.chart.lines.smooth?`M ${n}`:`M ${l}`);return{...o,smoothPath:n,straightPath:l,pathLength:r}})})));function R({value:a,index:o}){return i.dataLabel({p:t.value.style.chart.yAxis.labels.prefixes[o]||"",v:a,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),M=e.ref("");function A({shape:a,serieName:o,serie:l,relativeIndex:n,seriesIndex:r}){_.value={serie:l,relativeIndex:n,seriesIndex:r,series:b.value,scales:h.value},$.value=!0,v.value=l.id;let s="";const u=t.value.style.chart.tooltip.customFormat;i.isFunction(u)&&i.functionReturnsString(()=>u({serie:l,seriesIndex:l.seriesIndex,series:b.value,config:t.value,scales:h.value}))?M.value=u({serie:l,seriesIndex:l.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+" - ":""}${l.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 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 _, createSlots as Oe, withCtx as $, renderSlot as S, normalizeProps as ue, guardReactiveProps as oe, createElementVNode as v, Fragment as w, renderList as W, toDisplayString as m, createTextVNode as Ie, nextTick as De } from "vue";
|
|
2
|
-
import { u as Ee, c as qe, t as Ue, a as Ge, p as se, o as Qe, e as F, b as Je, r as K, 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 qe, t as Ue, a as Ge, p as se, o as Qe, e as F, b as Je, r as K, 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-D0PI50d6.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 _e } 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 Se } from "./useNestedProp-
|
|
4
|
+
import { _ as it } from "./Title-DM6fKrUI.js";
|
|
5
|
+
import { u as nt, U as vt } from "./usePrinter-DJnJEVGy.js";
|
|
6
|
+
import { _ as dt } from "./Tooltip-CAmd4pzg.js";
|
|
7
|
+
import { _ as _e } from "./Shape-fssaGSn1.js";
|
|
8
|
+
import { L as ct } from "./Legend-MfrOhwon.js";
|
|
9
|
+
import { D as ht } from "./DataTable-Dj8KLJHc.js";
|
|
10
|
+
import yt from "./vue-ui-skeleton-CDB2sB2S.js";
|
|
11
|
+
import bt from "./vue-ui-accordion-C1dTIdYg.js";
|
|
12
|
+
import { u as Se } from "./useNestedProp-BNV_Y29K.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"], Ft = ["x", "y", "font-size", "fill"], Pt = ["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-BQbaKiSm.cjs"),re=require("./useResponsive-B3TrDDIG.cjs"),$e=require("./Title-D6zeMzr0.cjs"),ne=require("./usePrinter-BANjHBXe.cjs"),Le=require("./Tooltip-2d9jRdHk.cjs"),se=require("./Shape-CcbBblwI.cjs"),Ce=require("./Legend-DWBU0qDC.cjs"),we=require("./DataTable-C4CMZu2s.cjs"),Se=require("./vue-ui-skeleton-DIm7kxhc.cjs"),qe=require("./vue-ui-accordion-CHVCSgY3.cjs"),ie=require("./useNestedProp-B6CpIX-3.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=["onClick"],St={key:0,height:"14",width:"14",viewBox:"0 0 20 20"},qt=["innerHTML"],Bt={__name:"vue-ui-quadrant",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectPlot","selectSide","selectLegend"],setup(ce,{expose:ve,emit:M}){const x=ce,{vue_ui_quadrant:de}=c.useConfig(),V=e.computed(()=>!!x.dataset&&x.dataset.length),p=e.ref(c.createUid()),he=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=ie.useNestedProp({userConfig:x.config,defaultConfig:de});return a.theme?{...ie.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=re.throttle(()=>{const{width:u,height:o}=re.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:ye,isImaging:be,generatePdf:O,generateImage:I}=ne.usePrinter({elementId:`vue-ui-quadrant_${p.value}`,fileName:l.value.style.chart.title.text||"vue-ui-quadrant"}),U=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 ue(){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(ue):W.value=!1}ue()}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)||U.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:G(o.x),y:Q(o.y),xValue:o.x,yValue:o.y,quadrantSide:j({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||U.value[u]||c.palette[u],series:a.series.map(o=>({...o,x:G(o.x),y:Q(o.y),xValue:o.x,yValue:o.y,quadrantSide:j({x:o.x,y:o.y}),categoryName:a.name,shape:a.shape,color:a.color,uid:c.createUid()}))}))));function G(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 Q(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=ee();M("selectLegend",u)}const J=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 j(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 Z(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 K(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 ee(){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 te(){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 le(){m.value.showTable=!m.value.showTable}function ae(){m.value.plotLabels.show=!m.value.plotLabels.show}function oe(){m.value.showTooltip=!m.value.showTooltip}return ve({getData:ee,generatePdf:O,generateCsv:te,generateImage:I,toggleTable:le,toggleLabels:ae,toggleTooltip:oe}),(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(ne.UserOptions,{ref_key:"details",ref:he,key:`user_options_${R.value}`,backgroundColor:l.value.style.chart.backgroundColor,color:l.value.style.chart.color,isImaging:e.unref(be),isPrinting:e.unref(ye),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(O),onGenerateCsv:te,onGenerateImage:e.unref(I),onToggleTable:le,onToggleLabels:ae,onToggleTooltip:oe},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=>Z(o,n,r),onMouseleave:u[9]||(u[9]=v=>{E.value=!1,B.value=null,_.value=null}),onClick:v=>K(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(se._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=>Z(o,n,r),onMouseleave:u[8]||(u[8]=v=>{E.value=!1,B.value=null,_.value=null}),onClick:v=>K(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),V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Se.default,{key:3,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:J.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,wt)]),_:1},8,["legendSet","config"])):e.renderSlot(a.$slots,"legend",{key:1,legend:J.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,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",St,[e.createVNode(se._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","parent","content","isCustom"]),V.value?(e.openBlock(),e.createBlock(qe.default,{key:4,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,qt)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,_e))}},_t=Be._export_sfc(Bt,[["__scopeId","data-v-a556d197"]]);exports.default=_t;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-CSlObCMJ.cjs"),re=require("./useResponsive-B3TrDDIG.cjs"),$e=require("./Title--kLbBq-N.cjs"),ne=require("./usePrinter-ClpmcbPy.cjs"),Le=require("./Tooltip-Dwh7A0L5.cjs"),se=require("./Shape-DBYznwuk.cjs"),Ce=require("./Legend-BNUo8JKO.cjs"),we=require("./DataTable-DZ7GOCVh.cjs"),Se=require("./vue-ui-skeleton-aEAr9fnx.cjs"),qe=require("./vue-ui-accordion-IPISean4.cjs"),ie=require("./useNestedProp-DUXlSjg2.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=["onClick"],St={key:0,height:"14",width:"14",viewBox:"0 0 20 20"},qt=["innerHTML"],Bt={__name:"vue-ui-quadrant",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectPlot","selectSide","selectLegend"],setup(ce,{expose:ve,emit:M}){const x=ce,{vue_ui_quadrant:de}=c.useConfig(),V=e.computed(()=>!!x.dataset&&x.dataset.length),p=e.ref(c.createUid()),he=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=ie.useNestedProp({userConfig:x.config,defaultConfig:de});return a.theme?{...ie.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=re.throttle(()=>{const{width:u,height:o}=re.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:ye,isImaging:be,generatePdf:O,generateImage:I}=ne.usePrinter({elementId:`vue-ui-quadrant_${p.value}`,fileName:l.value.style.chart.title.text||"vue-ui-quadrant"}),U=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 ue(){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(ue):W.value=!1}ue()}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)||U.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:G(o.x),y:Q(o.y),xValue:o.x,yValue:o.y,quadrantSide:j({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||U.value[u]||c.palette[u],series:a.series.map(o=>({...o,x:G(o.x),y:Q(o.y),xValue:o.x,yValue:o.y,quadrantSide:j({x:o.x,y:o.y}),categoryName:a.name,shape:a.shape,color:a.color,uid:c.createUid()}))}))));function G(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 Q(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=ee();M("selectLegend",u)}const J=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 j(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 Z(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 K(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 ee(){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 te(){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 le(){m.value.showTable=!m.value.showTable}function ae(){m.value.plotLabels.show=!m.value.plotLabels.show}function oe(){m.value.showTooltip=!m.value.showTooltip}return ve({getData:ee,generatePdf:O,generateCsv:te,generateImage:I,toggleTable:le,toggleLabels:ae,toggleTooltip:oe}),(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(ne.UserOptions,{ref_key:"details",ref:he,key:`user_options_${R.value}`,backgroundColor:l.value.style.chart.backgroundColor,color:l.value.style.chart.color,isImaging:e.unref(be),isPrinting:e.unref(ye),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(O),onGenerateCsv:te,onGenerateImage:e.unref(I),onToggleTable:le,onToggleLabels:ae,onToggleTooltip:oe},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=>Z(o,n,r),onMouseleave:u[9]||(u[9]=v=>{E.value=!1,B.value=null,_.value=null}),onClick:v=>K(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(se._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=>Z(o,n,r),onMouseleave:u[8]||(u[8]=v=>{E.value=!1,B.value=null,_.value=null}),onClick:v=>K(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),V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Se.default,{key:3,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:J.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,wt)]),_:1},8,["legendSet","config"])):e.renderSlot(a.$slots,"legend",{key:1,legend:J.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,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",St,[e.createVNode(se._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","parent","content","isCustom"]),V.value?(e.openBlock(),e.createBlock(qe.default,{key:4,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,qt)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,_e))}},_t=Be._export_sfc(Bt,[["__scopeId","data-v-a556d197"]]);exports.default=_t;
|
|
@@ -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 J, renderSlot as q, normalizeProps as K, guardReactiveProps as ye, createCommentVNode as x, toDisplayString as T, createElementVNode as S, Fragment as g, renderList as A, mergeProps as Le, createVNode as ve, 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 de, k as $e, f as B, L as De, v as pe, 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 de, k as $e, f as B, L as De, v as pe, w as Ce } from "./index-D0PI50d6.js";
|
|
3
3
|
import { t as ct, u as ht } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import me 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 me from "./BaseIcon-vF6zgXvp.js";
|
|
5
|
+
import { _ as ft } from "./Tooltip-CAmd4pzg.js";
|
|
6
|
+
import { u as gt, U as xt } from "./usePrinter-DJnJEVGy.js";
|
|
7
|
+
import { S as yt } from "./Slicer-C2VIWW3F.js";
|
|
8
|
+
import { u as Ve } from "./useNestedProp-BNV_Y29K.js";
|
|
9
9
|
import { _ as pt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
10
|
const L = {
|
|
11
11
|
LINE: "LINE",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),d=require("./index-BQbaKiSm.cjs"),ke=require("./useResponsive-B3TrDDIG.cjs"),ee=require("./BaseIcon-ByV6y3w8.cjs"),Ce=require("./Tooltip-2d9jRdHk.cjs"),ge=require("./usePrinter-BANjHBXe.cjs"),ze=require("./Slicer-CY-QTbH4.cjs"),pe=require("./useNestedProp-B6CpIX-3.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-2223f1be"),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"],gt={class:"plots"},pt={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=["onClick"],ol=["onClick"],nl=["onClick"],rl={key:1,class:"vue-ui-quick-chart-not-processable"},il=Be(()=>e.createElementVNode("span",null,"Dataset is not processable",-1)),ul={__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),te=e.ref(0),t=e.computed(()=>{const i=pe.useNestedProp({userConfig:A.config,defaultConfig:N});return i.theme?{...pe.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:le,isImaging:ae,generatePdf:se,generateImage:ce}=ge.usePrinter({elementId:`${E.value}_${w.value}`,fileName:t.value.title||E.value}),g=e.ref({width:t.value.width,height:t.value.height}),J=e.ref({showTooltip:t.value.showTooltip}),K=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});g.value.width=v,g.value.height=l});K.value=new ResizeObserver(i),K.value.observe(V.value.parentNode)}}),e.onBeforeUnmount(()=>{K.value&&K.value.disconnect()});const Ee=e.computed(()=>{switch(E.value){case S.LINE:return`0 0 ${g.value.width<=0?10:g.value.width} ${g.value.height<=0?10:g.value.height}`;case S.BAR:return`0 0 ${g.value.width<=0?10:g.value.width} ${g.value.height<=0?10:g.value.height}`;case S.DONUT:return`0 0 ${g.value.width<=0?10:g.value.width} ${g.value.height<=0?10:g.value.height}`;default:return`0 0 ${g.value.width<=0?10:g.value.width} ${g.value.height<=0?10:g.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),Q=e.ref(!1);function _e(i,v){Q.value=!0;let l=i.value;if(y.value.includes(i.id)){let s=function(){l>n?(Q.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?(Q.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:g.value.width/2,centerY:g.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=g.value.width/2,U=g.value.height/2,R=g.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,g.value.height*t.value.donutThicknessRatio)}}),p=e.ref({start:0,end:x.value.maxSeriesLength});function Ae(){p.value={start:0,end:x.value.maxSeriesLength},te.value+=1}const c=e.computed(()=>{if(E.value!==S.LINE)return null;const i={height:g.value.height,width:g.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(p.value.start,p.value.end),absoluteIndices:x.value.dataset.map((a,o)=>o).slice(p.value.start,p.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(p.value.start,p.value.end),absoluteIndices:a.values.map((k,f)=>f).slice(p.value.start,p.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-CSlObCMJ.cjs"),ke=require("./useResponsive-B3TrDDIG.cjs"),ee=require("./BaseIcon-DpzJwh5Z.cjs"),Ce=require("./Tooltip-Dwh7A0L5.cjs"),ge=require("./usePrinter-ClpmcbPy.cjs"),ze=require("./Slicer-B8qDEiI2.cjs"),pe=require("./useNestedProp-DUXlSjg2.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-2223f1be"),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"],gt={class:"plots"},pt={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=["onClick"],ol=["onClick"],nl=["onClick"],rl={key:1,class:"vue-ui-quick-chart-not-processable"},il=Be(()=>e.createElementVNode("span",null,"Dataset is not processable",-1)),ul={__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),te=e.ref(0),t=e.computed(()=>{const i=pe.useNestedProp({userConfig:A.config,defaultConfig:N});return i.theme?{...pe.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:le,isImaging:ae,generatePdf:se,generateImage:ce}=ge.usePrinter({elementId:`${E.value}_${w.value}`,fileName:t.value.title||E.value}),g=e.ref({width:t.value.width,height:t.value.height}),J=e.ref({showTooltip:t.value.showTooltip}),K=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});g.value.width=v,g.value.height=l});K.value=new ResizeObserver(i),K.value.observe(V.value.parentNode)}}),e.onBeforeUnmount(()=>{K.value&&K.value.disconnect()});const Ee=e.computed(()=>{switch(E.value){case S.LINE:return`0 0 ${g.value.width<=0?10:g.value.width} ${g.value.height<=0?10:g.value.height}`;case S.BAR:return`0 0 ${g.value.width<=0?10:g.value.width} ${g.value.height<=0?10:g.value.height}`;case S.DONUT:return`0 0 ${g.value.width<=0?10:g.value.width} ${g.value.height<=0?10:g.value.height}`;default:return`0 0 ${g.value.width<=0?10:g.value.width} ${g.value.height<=0?10:g.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),Q=e.ref(!1);function _e(i,v){Q.value=!0;let l=i.value;if(y.value.includes(i.id)){let s=function(){l>n?(Q.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?(Q.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:g.value.width/2,centerY:g.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=g.value.width/2,U=g.value.height/2,R=g.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,g.value.height*t.value.donutThicknessRatio)}}),p=e.ref({start:0,end:x.value.maxSeriesLength});function Ae(){p.value={start:0,end:x.value.maxSeriesLength},te.value+=1}const c=e.computed(()=>{if(E.value!==S.LINE)return null;const i={height:g.value.height,width:g.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(p.value.start,p.value.end),absoluteIndices:x.value.dataset.map((a,o)=>o).slice(p.value.start,p.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(p.value.start,p.value.end),absoluteIndices:a.values.map((k,f)=>f).slice(p.value.start,p.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,15 +1,15 @@
|
|
|
1
1
|
import { computed as v, ref as i, onMounted as Ae, onBeforeUnmount as Se, openBlock as s, createElementBlock as n, normalizeClass as z, normalizeStyle as V, createVNode as E, createCommentVNode as p, createBlock as B, unref as y, createSlots as ze, withCtx as f, renderSlot as b, normalizeProps as J, guardReactiveProps as Y, createElementVNode as w, Fragment as $, renderList as x, toDisplayString as L, createTextVNode as de, nextTick as Le } from "vue";
|
|
2
|
-
import { u as Re, c as Me, t as Ue, a as Ve, p as P, o as Ee, e as N, b as Be, g as ve, d as he, I as ge, f as pe, X as De, s as Ge, r as K, J as ye, v as We, w as Xe, n as je, q as qe } from "./index-
|
|
2
|
+
import { u as Re, c as Me, t as Ue, a as Ve, p as P, o as Ee, e as N, b as Be, g as ve, d as he, I as ge, f as pe, X as De, s as Ge, r as K, J as ye, v as We, w as Xe, n as je, q as qe } from "./index-D0PI50d6.js";
|
|
3
3
|
import { t as He, u as Je } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as Ye } from "./Title-
|
|
5
|
-
import { u as Ke, U as Qe } from "./usePrinter-
|
|
6
|
-
import { _ as Ze } from "./Tooltip-
|
|
7
|
-
import et from "./vue-ui-sparkbar-
|
|
8
|
-
import { L as tt } from "./Legend-
|
|
9
|
-
import { D as at } from "./DataTable-
|
|
10
|
-
import ot from "./vue-ui-skeleton-
|
|
11
|
-
import lt from "./vue-ui-accordion-
|
|
12
|
-
import { u as fe } from "./useNestedProp-
|
|
4
|
+
import { _ as Ye } from "./Title-DM6fKrUI.js";
|
|
5
|
+
import { u as Ke, U as Qe } from "./usePrinter-DJnJEVGy.js";
|
|
6
|
+
import { _ as Ze } from "./Tooltip-CAmd4pzg.js";
|
|
7
|
+
import et from "./vue-ui-sparkbar-DdEDQOc8.js";
|
|
8
|
+
import { L as tt } from "./Legend-MfrOhwon.js";
|
|
9
|
+
import { D as at } from "./DataTable-Dj8KLJHc.js";
|
|
10
|
+
import ot from "./vue-ui-skeleton-CDB2sB2S.js";
|
|
11
|
+
import lt from "./vue-ui-accordion-C1dTIdYg.js";
|
|
12
|
+
import { u as fe } from "./useNestedProp-BNV_Y29K.js";
|
|
13
13
|
import { _ as rt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
14
|
const st = ["id"], nt = ["xmlns", "viewBox"], ut = ["id"], it = ["stop-color"], ct = ["stop-color"], dt = { key: 0 }, vt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], ht = { key: 0 }, gt = ["d", "stroke", "stroke-width"], pt = ["d", "stroke", "stroke-width"], yt = { key: 1 }, ft = ["x", "y", "text-anchor", "font-size", "fill", "onMouseenter"], mt = ["points", "stroke", "stroke-width"], bt = ["points", "stroke", "stroke-width", "fill"], kt = { key: 2 }, Ct = ["cx", "cy", "fill", "r", "stroke"], _t = ["onClick"], wt = {
|
|
15
15
|
key: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-BQbaKiSm.cjs"),H=require("./useResponsive-B3TrDDIG.cjs"),ie=require("./Title-D6zeMzr0.cjs"),X=require("./usePrinter-BANjHBXe.cjs"),ce=require("./Tooltip-2d9jRdHk.cjs"),de=require("./vue-ui-sparkbar-Cdcndp7Q.cjs"),ve=require("./Legend-DWBU0qDC.cjs"),pe=require("./DataTable-C4CMZu2s.cjs"),he=require("./vue-ui-skeleton-DIm7kxhc.cjs"),ge=require("./vue-ui-accordion-CHVCSgY3.cjs"),j=require("./useNestedProp-B6CpIX-3.cjs"),me=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ye=["id"],fe=["xmlns","viewBox"],ke=["id"],be=["stop-color"],Ce=["stop-color"],we={key:0},Be=["x1","y1","x2","y2","stroke","stroke-width"],_e={key:0},xe=["d","stroke","stroke-width"],$e=["d","stroke","stroke-width"],Pe={key:1},Te=["x","y","text-anchor","font-size","fill","onMouseenter"],Ne=["points","stroke","stroke-width"],Se=["points","stroke","stroke-width","fill"],Ee={key:2},Ve=["cx","cy","fill","r","stroke"],Fe=["onClick"],ze={key:0,style:{"max-width":"200px",margin:"0 auto"}},Oe={__name:"vue-ui-radar",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["selectLegend"],setup(Y,{expose:J,emit:K}){const d=Y,{vue_ui_radar:Q}=n.useConfig(),k=e.computed(()=>!!d.dataset&&Object.keys(d.dataset).length),m=e.ref(n.createUid()),Z=e.ref(null),$=e.ref(!1),P=e.ref(""),F=e.ref(0),b=e.ref(null),z=e.ref(null),O=e.ref(null),t=e.computed(()=>{const o=j.useNestedProp({userConfig:d.config,defaultConfig:Q});return o.theme?{...j.useNestedProp({userConfig:n.themes.vue_ui_radar[o.theme]||d.config,defaultConfig:o}),customPalette:n.themePalettes[o.theme]||n.palette}:o}),B=e.ref(null);e.onMounted(()=>{if(n.objectIsEmpty(d.dataset)&&n.error({componentName:"VueUiRadar",type:"dataset"}),t.value.responsive){const o=H.throttle(()=>{const{width:a,height:l}=H.useResponsive({chart:b.value,title:t.value.style.chart.title.text?z.value:null,legend:t.value.style.chart.legend.show?O.value:null});s.value.width=a,s.value.height=l});B.value=new ResizeObserver(o),B.value.observe(b.value.parentNode)}}),e.onBeforeUnmount(()=>{B.value&&B.value.disconnect()});const{isPrinting:ee,isImaging:te,generatePdf:A,generateImage:I}=X.usePrinter({elementId:`vue-ui-radar_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-radar"}),L=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),h=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),oe=e.computed(()=>({style:{backgroundColor:t.value.style.chart.tooltip.backgroundColor,animation:{show:t.value.style.chart.tooltip.animation.show,animationFrames:t.value.style.chart.tooltip.animation.animationFrames},labels:{fontSize:t.value.style.chart.tooltip.fontSize,name:{color:t.value.style.chart.tooltip.color}},gutter:{backgroundColor:"#CCCCCC",opacity:30}}})),s=e.ref({height:312,width:512}),i=e.ref([]),C=e.ref(null),y=e.ref(!1);function R(o){y.value=!0,i.value.includes(o)?(C.value=o,i.value=i.value.filter(a=>a!==o),setTimeout(()=>{y.value=!1,C.value=null},500)):(i.value.push(o),setTimeout(()=>{y.value=!1},500)),K("selectLegend",f.value.filter((a,l)=>!i.value.includes(l)).map(a=>({name:a.name,color:a.color,proportion:a.totalProportion})))}function ae(){return f.value.map(o=>({name:o.name,color:o.color,proportion:o.totalProportion}))}const v=e.computed(()=>[null,void 0].includes(d.dataset.categories)?(n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:"categories ({ name: string; prefix?: string; suffix?: string}[])"}),[]):(d.dataset.categories.length===0?n.error({componentName:"VueUiRadar",type:"datasetAttributeEmpty",property:"categories"}):d.dataset.categories.forEach((o,a)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name"]}).forEach(l=>{n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:`category.${l} at index ${a}`,index:a})})}),[null,void 0].includes(d.dataset.series)?n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:"series ({ name: string; values: number[]; color?: string; target: number}[])"}):d.dataset.series.forEach((o,a)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","values","target"]}).forEach(l=>{n.error({componentName:"VueUiRadar",type:"datasetSerieAttribute",key:"series",property:l,index:a})})}),d.dataset.categories.map((o,a)=>({name:o.name,categoryId:`radar_category_${m.value}_${a}`,color:n.convertColorToHex(o.color)||L.value[a]||n.palette[a]||n.palette[a%n.palette.length],prefix:o.prefix??"",suffix:o.suffix??""})))),p=e.computed(()=>k.value?d.dataset.series.map((o,a)=>({...o,color:n.convertColorToHex(o.color)||L.value[a]||n.palette[a]||n.palette[a%n.palette.length],serieId:`radar_serie_${m.value}_${a}`})):[]),M=e.computed(()=>Math.max(...p.value.flatMap(o=>o.values))),q=e.computed(()=>p.value.length),T=e.computed(()=>Math.min(s.value.width,s.value.height)/3),D=e.computed(()=>n.createPolygonPath({plot:{x:s.value.width/2,y:s.value.height/2},radius:T.value,sides:q.value,rotation:0})),le=e.computed(()=>{const o=[];for(let a=0;a<T.value;a+=T.value/t.value.style.chart.layout.grid.graduations)o.push(a);return o}),g=e.computed(()=>D.value.coordinates.map((o,a)=>{const l=p.value[a].values.map(r=>re({centerX:s.value.width/2,centerY:s.value.height/2,apexX:o.x,apexY:o.y,proportion:r/(p.value[a].target||M.value)}));return{...o,...p.value[a],plots:l}}));function N({x:o,y:a}){let l="middle";return o=Math.round(o),a=Math.round(a),o>s.value.width/2&&(o+=12,l="start"),o<s.value.width/2&&(o-=12,l="end"),a>s.value.height/2&&(a+=20),a<s.value.height/2&&(a-=12),a===s.value.height/2&&(a+=4),{x:o,y:a,anchor:l}}function re({centerX:o,centerY:a,apexX:l,apexY:r,proportion:u}){return{x:o+(l-o)*u,y:a+(r-a)*u}}const f=e.computed(()=>{const o=p.value.map((a,l)=>a.values.map(r=>r/(a.target||M.value)));return v.value.map((a,l)=>({...a,totalProportion:o.map(r=>r[l]).reduce((r,u)=>r+u,0)/p.value.length,shape:"circle",opacity:i.value.includes(l)?.5:1,segregate:()=>R(l),isSegregated:i.value.includes(l)}))}),ne=e.computed(()=>({cy:"radar-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":""})),_=e.computed(()=>{const o=[{name:t.value.translations.datapoint,color:""},{name:t.value.translations.target,color:""},...f.value],a=d.dataset.series.map(r=>[r.name,r.target,...r.values.map((u,c)=>`${n.dataLabel({p:v.value[c].prefix,v:u,s:v.value[c].suffix,r:t.value.table.td.roundingValue})} (${isNaN(u/r.target)?"":(u/r.target*100).toFixed(t.value.table.td.roundingPercentage)}%)`)]),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{head:o,body:a,config:l,colNames:o}}),x=e.ref(null),S=e.ref([]),E=e.ref(null);function ue(o,a){S.value=[],x.value=a,$.value=!0;let l="";E.value={datapoint:o,seriesIndex:a,series:{categories:v.value,datapoints:p.value,radar:g.value},config:t.value};const r=t.value.style.chart.tooltip.customFormat;if(n.isFunction(r)&&n.functionReturnsString(()=>r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:p.value,radar:g.value},config:t.value})))P.value=r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:p.value,radar:g.value},config:t.value});else{l+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`;for(let u=0;u<o.values.length;u+=1)i.value.includes(u)||S.value.push({name:v.value[u].name,value:o.values[u]/o.target*100,color:v.value[u].color,suffix:"%)",prefix:`${n.dataLabel({p:v.value[u].prefix??"",v:o.values[u],s:v.value[u].suffix??"",r:t.value.style.chart.tooltip.roundingValue})} (`,rounding:t.value.style.chart.tooltip.roundingPercentage});P.value=l}}function U(){e.nextTick(()=>{const o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],a=[[""],[t.value.translations.target],...f.value.flatMap(c=>[[c.name],["%"]])],l=d.dataset.series.map((c,Ie)=>[c.name,c.target,...c.values.flatMap(V=>[V,isNaN(V/c.target)?"":V/c.target*100])]),r=o.concat([a]).concat(l),u=n.createCsvContent(r);n.downloadCsv({csvContent:u,title:t.value.style.chart.title.text||"vue-ui-radar"})})}const w=e.ref(!1);function se(o){w.value=o,F.value+=1}function G(){h.value.showTable=!h.value.showTable}function W(){h.value.showTooltip=!h.value.showTooltip}return J({getData:ae,generatePdf:A,generateCsv:U,generateImage:I,toggleTable:G,toggleTooltip:W}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-radar ${w.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"radarChart",ref:b,id:`vue-ui-radar_${m.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:z,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px`)},[e.createVNode(ie._sfc_main,{config:{title:{cy:"radar-div-title",...t.value.style.chart.title},subtitle:{cy:"radar-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&k.value?(e.openBlock(),e.createBlock(X.UserOptions,{ref_key:"details",ref:Z,key:`user_options_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(te),isPrinting:e.unref(ee),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:w.value,isTooltip:h.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:b.value,onToggleFullscreen:se,onGeneratePdf:e.unref(A),onGenerateCsv:U,onGenerateImage:e.unref(I),onToggleTable:G,onToggleTooltip:W},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":w.value,"vue-data-ui-fulscreen--off":!w.value}),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`radar_gradient_${m.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(l.color,.05)}${e.unref(n.opacity)[t.value.style.chart.layout.dataPolygon.opacity]}`},null,8,be),e.createElementVNode("stop",{offset:"100%","stop-color":l.color+e.unref(n.opacity)[t.value.style.chart.layout.dataPolygon.opacity]},null,8,Ce)],8,ke))),256))]),t.value.style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",we,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,l=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.width/2,y1:s.value.height/2,x2:l.x,y2:l.y,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,Be))),256)),t.value.style.chart.layout.grid.graduations>0?(e.openBlock(),e.createElementBlock("g",_e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(le.value,l=>(e.openBlock(),e.createElementBlock("path",{d:e.unref(n.createPolygonPath)({plot:{x:s.value.width/2,y:s.value.height/2},radius:l,sides:q.value,rotation:0}).path,fill:"none",stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,xe))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("path",{d:D.value.path,fill:"none",stroke:t.value.style.chart.layout.outerPolygon.stroke,"stroke-width":t.value.style.chart.layout.outerPolygon.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round"},null,8,$e),t.value.style.chart.layout.labels.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:N(l).x,y:N(l).y,"text-anchor":N(l).anchor,"font-size":t.value.style.chart.layout.labels.dataLabels.fontSize,fill:t.value.style.chart.layout.labels.dataLabels.color,onMouseenter:u=>ue(l,r),onMouseleave:a[0]||(a[0]=u=>{$.value=!1,x.value=null})},e.toDisplayString(l.name),41,Te))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("g",null,[t.value.useCssAnimation||!t.value.useCssAnimation&&!i.value.includes(r)?(e.openBlock(),e.createElementBlock("polygon",{key:0,"data-cy-radar-path":"",points:e.unref(n.makePath)(g.value.map(u=>u.plots[r]),!1,!0),stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.dataPolygon.strokeWidth+1,fill:"none",class:e.normalizeClass({"animated-out":i.value.includes(r)&&t.value.useCssAnimation,"animated-in":y.value&&C.value===r&&t.value.useCssAnimation})},null,10,Ne)):e.createCommentVNode("",!0),t.value.useCssAnimation||!t.value.useCssAnimation&&!i.value.includes(r)?(e.openBlock(),e.createElementBlock("polygon",{key:1,"data-cy-radar-path":"",points:e.unref(n.makePath)(g.value.map(u=>u.plots[r]),!1,!0),stroke:l.color,"stroke-width":t.value.style.chart.layout.dataPolygon.strokeWidth,fill:t.value.style.chart.layout.dataPolygon.transparent?"transparent":t.value.style.chart.layout.dataPolygon.useGradient?`url(#radar_gradient_${m.value}_${r})`:l.color+e.unref(n.opacity)[t.value.style.chart.layout.dataPolygon.opacity],class:e.normalizeClass({"animated-out":i.value.includes(r)&&t.value.useCssAnimation,"animated-in":y.value&&C.value===r&&t.value.useCssAnimation})},null,10,Se)):e.createCommentVNode("",!0)])]))),256)),t.value.style.chart.layout.plots.show?(e.openBlock(),e.createElementBlock("g",Ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.plots,(u,c)=>(e.openBlock(),e.createElementBlock("circle",{cx:u.x,cy:u.y,fill:i.value.includes(c)?"transparent":v.value[c].color,r:x.value!==null&&x.value===r?t.value.style.chart.layout.plots.radius*1.6:t.value.style.chart.layout.plots.radius,stroke:i.value.includes(c)?"transparent":t.value.style.chart.backgroundColor,"stroke-width":.5,class:e.normalizeClass({"animated-out":i.value.includes(c)&&t.value.useCssAnimation,"animated-in":y.value&&C.value===c&&t.value.useCssAnimation})},null,10,Ve))),256))]))),256))])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:s.value},void 0,!0)],14,fe)):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(he.default,{key:3,config:{type:"radar",style:{backgroundColor:t.value.style.chart.backgroundColor,radar:{grid:{color:t.value.style.chart.layout.outerPolygon.stroke},shapes:{color:t.value.style.chart.layout.outerPolygon.stroke}}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:O},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(ve.Legend,{key:0,legendSet:f.value,config:ne.value,onClickMarker:a[1]||(a[1]=({i:l})=>R(l))},{item:e.withCtx(({legend:l,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:u=>l.segregate(),style:e.normalizeStyle(`opacity:${i.value.includes(r)?.5:1}`)},e.toDisplayString(l.name)+": "+e.toDisplayString((l.totalProportion*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"% ",13,Fe)]),_:1},8,["legendSet","config"])):e.renderSlot(o.$slots,"legend",{key:1,legend:f.value},void 0,!0)],512),e.createVNode(ce._sfc_main,{show:h.value.showTooltip&&$.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,fontSize:t.value.style.chart.tooltip.fontSize,parent:b.value,content:P.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...E.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[["function"].includes(typeof t.value.style.chart.tooltip.customFormat)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ze,[e.createVNode(de.default,{dataset:S.value,config:oe.value,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity},null,8,["dataset","config","backgroundOpacity"])])),e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...E.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","fontSize","parent","content","isCustom"]),k.value?(e.openBlock(),e.createBlock(ge.default,{key:4,hideDetails:"",config:{open:h.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(pe.DataTable,{colNames:_.value.colNames,head:_.value.head,body:_.value.body,config:_.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=l=>h.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l.name),1)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,ye))}},Ae=me._export_sfc(Oe,[["__scopeId","data-v-f89a8c0a"]]);exports.default=Ae;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-CSlObCMJ.cjs"),H=require("./useResponsive-B3TrDDIG.cjs"),ie=require("./Title--kLbBq-N.cjs"),X=require("./usePrinter-ClpmcbPy.cjs"),ce=require("./Tooltip-Dwh7A0L5.cjs"),de=require("./vue-ui-sparkbar-e9mZh74f.cjs"),ve=require("./Legend-BNUo8JKO.cjs"),pe=require("./DataTable-DZ7GOCVh.cjs"),he=require("./vue-ui-skeleton-aEAr9fnx.cjs"),ge=require("./vue-ui-accordion-IPISean4.cjs"),j=require("./useNestedProp-DUXlSjg2.cjs"),me=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ye=["id"],fe=["xmlns","viewBox"],ke=["id"],be=["stop-color"],Ce=["stop-color"],we={key:0},Be=["x1","y1","x2","y2","stroke","stroke-width"],_e={key:0},xe=["d","stroke","stroke-width"],$e=["d","stroke","stroke-width"],Pe={key:1},Te=["x","y","text-anchor","font-size","fill","onMouseenter"],Ne=["points","stroke","stroke-width"],Se=["points","stroke","stroke-width","fill"],Ee={key:2},Ve=["cx","cy","fill","r","stroke"],Fe=["onClick"],ze={key:0,style:{"max-width":"200px",margin:"0 auto"}},Oe={__name:"vue-ui-radar",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["selectLegend"],setup(Y,{expose:J,emit:K}){const d=Y,{vue_ui_radar:Q}=n.useConfig(),k=e.computed(()=>!!d.dataset&&Object.keys(d.dataset).length),m=e.ref(n.createUid()),Z=e.ref(null),$=e.ref(!1),P=e.ref(""),F=e.ref(0),b=e.ref(null),z=e.ref(null),O=e.ref(null),t=e.computed(()=>{const o=j.useNestedProp({userConfig:d.config,defaultConfig:Q});return o.theme?{...j.useNestedProp({userConfig:n.themes.vue_ui_radar[o.theme]||d.config,defaultConfig:o}),customPalette:n.themePalettes[o.theme]||n.palette}:o}),B=e.ref(null);e.onMounted(()=>{if(n.objectIsEmpty(d.dataset)&&n.error({componentName:"VueUiRadar",type:"dataset"}),t.value.responsive){const o=H.throttle(()=>{const{width:a,height:l}=H.useResponsive({chart:b.value,title:t.value.style.chart.title.text?z.value:null,legend:t.value.style.chart.legend.show?O.value:null});s.value.width=a,s.value.height=l});B.value=new ResizeObserver(o),B.value.observe(b.value.parentNode)}}),e.onBeforeUnmount(()=>{B.value&&B.value.disconnect()});const{isPrinting:ee,isImaging:te,generatePdf:A,generateImage:I}=X.usePrinter({elementId:`vue-ui-radar_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-radar"}),L=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),h=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),oe=e.computed(()=>({style:{backgroundColor:t.value.style.chart.tooltip.backgroundColor,animation:{show:t.value.style.chart.tooltip.animation.show,animationFrames:t.value.style.chart.tooltip.animation.animationFrames},labels:{fontSize:t.value.style.chart.tooltip.fontSize,name:{color:t.value.style.chart.tooltip.color}},gutter:{backgroundColor:"#CCCCCC",opacity:30}}})),s=e.ref({height:312,width:512}),i=e.ref([]),C=e.ref(null),y=e.ref(!1);function R(o){y.value=!0,i.value.includes(o)?(C.value=o,i.value=i.value.filter(a=>a!==o),setTimeout(()=>{y.value=!1,C.value=null},500)):(i.value.push(o),setTimeout(()=>{y.value=!1},500)),K("selectLegend",f.value.filter((a,l)=>!i.value.includes(l)).map(a=>({name:a.name,color:a.color,proportion:a.totalProportion})))}function ae(){return f.value.map(o=>({name:o.name,color:o.color,proportion:o.totalProportion}))}const v=e.computed(()=>[null,void 0].includes(d.dataset.categories)?(n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:"categories ({ name: string; prefix?: string; suffix?: string}[])"}),[]):(d.dataset.categories.length===0?n.error({componentName:"VueUiRadar",type:"datasetAttributeEmpty",property:"categories"}):d.dataset.categories.forEach((o,a)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name"]}).forEach(l=>{n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:`category.${l} at index ${a}`,index:a})})}),[null,void 0].includes(d.dataset.series)?n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:"series ({ name: string; values: number[]; color?: string; target: number}[])"}):d.dataset.series.forEach((o,a)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","values","target"]}).forEach(l=>{n.error({componentName:"VueUiRadar",type:"datasetSerieAttribute",key:"series",property:l,index:a})})}),d.dataset.categories.map((o,a)=>({name:o.name,categoryId:`radar_category_${m.value}_${a}`,color:n.convertColorToHex(o.color)||L.value[a]||n.palette[a]||n.palette[a%n.palette.length],prefix:o.prefix??"",suffix:o.suffix??""})))),p=e.computed(()=>k.value?d.dataset.series.map((o,a)=>({...o,color:n.convertColorToHex(o.color)||L.value[a]||n.palette[a]||n.palette[a%n.palette.length],serieId:`radar_serie_${m.value}_${a}`})):[]),M=e.computed(()=>Math.max(...p.value.flatMap(o=>o.values))),q=e.computed(()=>p.value.length),T=e.computed(()=>Math.min(s.value.width,s.value.height)/3),D=e.computed(()=>n.createPolygonPath({plot:{x:s.value.width/2,y:s.value.height/2},radius:T.value,sides:q.value,rotation:0})),le=e.computed(()=>{const o=[];for(let a=0;a<T.value;a+=T.value/t.value.style.chart.layout.grid.graduations)o.push(a);return o}),g=e.computed(()=>D.value.coordinates.map((o,a)=>{const l=p.value[a].values.map(r=>re({centerX:s.value.width/2,centerY:s.value.height/2,apexX:o.x,apexY:o.y,proportion:r/(p.value[a].target||M.value)}));return{...o,...p.value[a],plots:l}}));function N({x:o,y:a}){let l="middle";return o=Math.round(o),a=Math.round(a),o>s.value.width/2&&(o+=12,l="start"),o<s.value.width/2&&(o-=12,l="end"),a>s.value.height/2&&(a+=20),a<s.value.height/2&&(a-=12),a===s.value.height/2&&(a+=4),{x:o,y:a,anchor:l}}function re({centerX:o,centerY:a,apexX:l,apexY:r,proportion:u}){return{x:o+(l-o)*u,y:a+(r-a)*u}}const f=e.computed(()=>{const o=p.value.map((a,l)=>a.values.map(r=>r/(a.target||M.value)));return v.value.map((a,l)=>({...a,totalProportion:o.map(r=>r[l]).reduce((r,u)=>r+u,0)/p.value.length,shape:"circle",opacity:i.value.includes(l)?.5:1,segregate:()=>R(l),isSegregated:i.value.includes(l)}))}),ne=e.computed(()=>({cy:"radar-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":""})),_=e.computed(()=>{const o=[{name:t.value.translations.datapoint,color:""},{name:t.value.translations.target,color:""},...f.value],a=d.dataset.series.map(r=>[r.name,r.target,...r.values.map((u,c)=>`${n.dataLabel({p:v.value[c].prefix,v:u,s:v.value[c].suffix,r:t.value.table.td.roundingValue})} (${isNaN(u/r.target)?"":(u/r.target*100).toFixed(t.value.table.td.roundingPercentage)}%)`)]),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{head:o,body:a,config:l,colNames:o}}),x=e.ref(null),S=e.ref([]),E=e.ref(null);function ue(o,a){S.value=[],x.value=a,$.value=!0;let l="";E.value={datapoint:o,seriesIndex:a,series:{categories:v.value,datapoints:p.value,radar:g.value},config:t.value};const r=t.value.style.chart.tooltip.customFormat;if(n.isFunction(r)&&n.functionReturnsString(()=>r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:p.value,radar:g.value},config:t.value})))P.value=r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:p.value,radar:g.value},config:t.value});else{l+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`;for(let u=0;u<o.values.length;u+=1)i.value.includes(u)||S.value.push({name:v.value[u].name,value:o.values[u]/o.target*100,color:v.value[u].color,suffix:"%)",prefix:`${n.dataLabel({p:v.value[u].prefix??"",v:o.values[u],s:v.value[u].suffix??"",r:t.value.style.chart.tooltip.roundingValue})} (`,rounding:t.value.style.chart.tooltip.roundingPercentage});P.value=l}}function U(){e.nextTick(()=>{const o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],a=[[""],[t.value.translations.target],...f.value.flatMap(c=>[[c.name],["%"]])],l=d.dataset.series.map((c,Ie)=>[c.name,c.target,...c.values.flatMap(V=>[V,isNaN(V/c.target)?"":V/c.target*100])]),r=o.concat([a]).concat(l),u=n.createCsvContent(r);n.downloadCsv({csvContent:u,title:t.value.style.chart.title.text||"vue-ui-radar"})})}const w=e.ref(!1);function se(o){w.value=o,F.value+=1}function G(){h.value.showTable=!h.value.showTable}function W(){h.value.showTooltip=!h.value.showTooltip}return J({getData:ae,generatePdf:A,generateCsv:U,generateImage:I,toggleTable:G,toggleTooltip:W}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-radar ${w.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"radarChart",ref:b,id:`vue-ui-radar_${m.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:z,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px`)},[e.createVNode(ie._sfc_main,{config:{title:{cy:"radar-div-title",...t.value.style.chart.title},subtitle:{cy:"radar-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&k.value?(e.openBlock(),e.createBlock(X.UserOptions,{ref_key:"details",ref:Z,key:`user_options_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(te),isPrinting:e.unref(ee),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:w.value,isTooltip:h.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:b.value,onToggleFullscreen:se,onGeneratePdf:e.unref(A),onGenerateCsv:U,onGenerateImage:e.unref(I),onToggleTable:G,onToggleTooltip:W},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":w.value,"vue-data-ui-fulscreen--off":!w.value}),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`radar_gradient_${m.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(l.color,.05)}${e.unref(n.opacity)[t.value.style.chart.layout.dataPolygon.opacity]}`},null,8,be),e.createElementVNode("stop",{offset:"100%","stop-color":l.color+e.unref(n.opacity)[t.value.style.chart.layout.dataPolygon.opacity]},null,8,Ce)],8,ke))),256))]),t.value.style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",we,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,l=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.width/2,y1:s.value.height/2,x2:l.x,y2:l.y,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,Be))),256)),t.value.style.chart.layout.grid.graduations>0?(e.openBlock(),e.createElementBlock("g",_e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(le.value,l=>(e.openBlock(),e.createElementBlock("path",{d:e.unref(n.createPolygonPath)({plot:{x:s.value.width/2,y:s.value.height/2},radius:l,sides:q.value,rotation:0}).path,fill:"none",stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,xe))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("path",{d:D.value.path,fill:"none",stroke:t.value.style.chart.layout.outerPolygon.stroke,"stroke-width":t.value.style.chart.layout.outerPolygon.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round"},null,8,$e),t.value.style.chart.layout.labels.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:N(l).x,y:N(l).y,"text-anchor":N(l).anchor,"font-size":t.value.style.chart.layout.labels.dataLabels.fontSize,fill:t.value.style.chart.layout.labels.dataLabels.color,onMouseenter:u=>ue(l,r),onMouseleave:a[0]||(a[0]=u=>{$.value=!1,x.value=null})},e.toDisplayString(l.name),41,Te))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("g",null,[t.value.useCssAnimation||!t.value.useCssAnimation&&!i.value.includes(r)?(e.openBlock(),e.createElementBlock("polygon",{key:0,"data-cy-radar-path":"",points:e.unref(n.makePath)(g.value.map(u=>u.plots[r]),!1,!0),stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.dataPolygon.strokeWidth+1,fill:"none",class:e.normalizeClass({"animated-out":i.value.includes(r)&&t.value.useCssAnimation,"animated-in":y.value&&C.value===r&&t.value.useCssAnimation})},null,10,Ne)):e.createCommentVNode("",!0),t.value.useCssAnimation||!t.value.useCssAnimation&&!i.value.includes(r)?(e.openBlock(),e.createElementBlock("polygon",{key:1,"data-cy-radar-path":"",points:e.unref(n.makePath)(g.value.map(u=>u.plots[r]),!1,!0),stroke:l.color,"stroke-width":t.value.style.chart.layout.dataPolygon.strokeWidth,fill:t.value.style.chart.layout.dataPolygon.transparent?"transparent":t.value.style.chart.layout.dataPolygon.useGradient?`url(#radar_gradient_${m.value}_${r})`:l.color+e.unref(n.opacity)[t.value.style.chart.layout.dataPolygon.opacity],class:e.normalizeClass({"animated-out":i.value.includes(r)&&t.value.useCssAnimation,"animated-in":y.value&&C.value===r&&t.value.useCssAnimation})},null,10,Se)):e.createCommentVNode("",!0)])]))),256)),t.value.style.chart.layout.plots.show?(e.openBlock(),e.createElementBlock("g",Ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.plots,(u,c)=>(e.openBlock(),e.createElementBlock("circle",{cx:u.x,cy:u.y,fill:i.value.includes(c)?"transparent":v.value[c].color,r:x.value!==null&&x.value===r?t.value.style.chart.layout.plots.radius*1.6:t.value.style.chart.layout.plots.radius,stroke:i.value.includes(c)?"transparent":t.value.style.chart.backgroundColor,"stroke-width":.5,class:e.normalizeClass({"animated-out":i.value.includes(c)&&t.value.useCssAnimation,"animated-in":y.value&&C.value===c&&t.value.useCssAnimation})},null,10,Ve))),256))]))),256))])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:s.value},void 0,!0)],14,fe)):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(he.default,{key:3,config:{type:"radar",style:{backgroundColor:t.value.style.chart.backgroundColor,radar:{grid:{color:t.value.style.chart.layout.outerPolygon.stroke},shapes:{color:t.value.style.chart.layout.outerPolygon.stroke}}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:O},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(ve.Legend,{key:0,legendSet:f.value,config:ne.value,onClickMarker:a[1]||(a[1]=({i:l})=>R(l))},{item:e.withCtx(({legend:l,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:u=>l.segregate(),style:e.normalizeStyle(`opacity:${i.value.includes(r)?.5:1}`)},e.toDisplayString(l.name)+": "+e.toDisplayString((l.totalProportion*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"% ",13,Fe)]),_:1},8,["legendSet","config"])):e.renderSlot(o.$slots,"legend",{key:1,legend:f.value},void 0,!0)],512),e.createVNode(ce._sfc_main,{show:h.value.showTooltip&&$.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,fontSize:t.value.style.chart.tooltip.fontSize,parent:b.value,content:P.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...E.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[["function"].includes(typeof t.value.style.chart.tooltip.customFormat)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ze,[e.createVNode(de.default,{dataset:S.value,config:oe.value,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity},null,8,["dataset","config","backgroundOpacity"])])),e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...E.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","fontSize","parent","content","isCustom"]),k.value?(e.openBlock(),e.createBlock(ge.default,{key:4,hideDetails:"",config:{open:h.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(pe.DataTable,{colNames:_.value.colNames,head:_.value.head,body:_.value.body,config:_.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=l=>h.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l.name),1)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,ye))}},Ae=me._export_sfc(Oe,[["__scopeId","data-v-f89a8c0a"]]);exports.default=Ae;
|