vue-data-ui 2.3.3 → 2.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -15
- package/dist/Arrow-BSOdhAJO.cjs +1 -0
- package/dist/Arrow-BjDVSrfA.js +101 -0
- package/dist/BaseIcon-BoKtpbrI.cjs +1 -0
- package/dist/BaseIcon-vmmfWlyR.js +174 -0
- package/dist/DataTable-CaB7GIwQ.js +127 -0
- package/dist/DataTable-ssrNbONo.cjs +1 -0
- package/dist/Legend-DHpoRTAE.js +62 -0
- package/dist/Legend-Dl5IYoxK.cjs +1 -0
- package/dist/Shape-CQT4S7N-.js +107 -0
- package/dist/Shape-CaF4pvOn.cjs +1 -0
- package/dist/Slicer-Bdb1BlrC.js +156 -0
- package/dist/Slicer-QC8nTm24.cjs +1 -0
- package/dist/Title-BNPZwnkp.js +46 -0
- package/dist/Title-Cj_xubjI.cjs +1 -0
- package/dist/Tooltip-CdJ5hegk.cjs +1 -0
- package/dist/Tooltip-ZnJAz6dl.js +94 -0
- package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/documentation/installation.md +14 -13
- package/dist/html2canvas.esm-BA_v9SIU.cjs +22 -0
- package/dist/html2canvas.esm-d2sM-0Wm.js +4870 -0
- package/dist/index-BMCvLyab.js +10369 -0
- package/dist/index-BkomIE9L.cjs +4 -0
- package/dist/{index.es-ypwniJN8.js → index.es-YufTdp0y.js} +1 -1
- package/dist/{index.es-Dnua3tHc.cjs → index.es-uyeSCnWE.cjs} +1 -1
- package/dist/jspdf.es.min-C660YX78.js +8038 -0
- package/dist/jspdf.es.min-DLYY9DTT.cjs +243 -0
- package/dist/pdf-97UbtKC2.js +44 -0
- package/dist/pdf-Cz3729tZ.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +105 -5
- package/dist/types/vue-data-ui.d.ts +105 -5
- package/dist/useNestedProp-BMxXyPbW.cjs +1 -0
- package/dist/useNestedProp-CkP8xhG_.js +13 -0
- package/dist/usePrinter-BuuBz5JR.js +513 -0
- package/dist/usePrinter-r6uHYEcR.cjs +1 -0
- package/dist/useResponsive-B3TrDDIG.cjs +1 -0
- package/dist/useResponsive-NZB-WLRF.js +187 -0
- package/dist/vue-data-ui-Bc5U1cOP.cjs +9 -0
- package/dist/vue-data-ui-DxeO0iaC.js +254 -0
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +61 -59
- package/dist/vue-ui-3d-bar-32wM0tiX.js +1085 -0
- package/dist/vue-ui-3d-bar-CgB0fLQT.cjs +19 -0
- package/dist/vue-ui-accordion-CLlVxx3Q.js +77 -0
- package/dist/vue-ui-accordion-SXsobrUt.cjs +1 -0
- package/dist/vue-ui-age-pyramid-D_CY99xF.js +596 -0
- package/dist/vue-ui-age-pyramid-DqiwcOIr.cjs +1 -0
- package/dist/vue-ui-annotator-DvP-IxDm.js +2177 -0
- package/dist/vue-ui-annotator-mntqd3q_.cjs +371 -0
- package/dist/vue-ui-candlestick-C-5u3i-1.js +657 -0
- package/dist/vue-ui-candlestick-C_TvUQvH.cjs +2 -0
- package/dist/vue-ui-carousel-table-BCePqkuz.cjs +1 -0
- package/dist/vue-ui-carousel-table-CAqhsLVx.js +304 -0
- package/dist/vue-ui-chestnut-DhWlw2MD.cjs +6 -0
- package/dist/vue-ui-chestnut-DylSfYMB.js +1051 -0
- package/dist/vue-ui-cursor-B04HJQVl.cjs +1 -0
- package/dist/vue-ui-cursor-DTYEMgbU.js +229 -0
- package/dist/vue-ui-dashboard-Bd0-cmSZ.js +232 -0
- package/dist/vue-ui-dashboard-DFIYwP1s.cjs +1 -0
- package/dist/vue-ui-digits-CW5qNMIk.js +153 -0
- package/dist/vue-ui-digits-Ced5mBJZ.cjs +1 -0
- package/dist/vue-ui-donut-DIhhgvWp.cjs +1 -0
- package/dist/vue-ui-donut-EeVmrVJs.js +743 -0
- package/dist/vue-ui-donut-evolution-BN08Y2hy.js +799 -0
- package/dist/vue-ui-donut-evolution-Ct6KAzs-.cjs +1 -0
- package/dist/vue-ui-dumbbell-BMlxS1Nq.js +624 -0
- package/dist/vue-ui-dumbbell-pextarqH.cjs +9 -0
- package/dist/vue-ui-flow-BXVsbmyb.cjs +1 -0
- package/dist/vue-ui-flow-CHmkgfyb.js +454 -0
- package/dist/vue-ui-galaxy-D4xyd-J1.cjs +1 -0
- package/dist/vue-ui-galaxy-kiVOZOBz.js +485 -0
- package/dist/vue-ui-gauge-BcO-z97J.js +466 -0
- package/dist/vue-ui-gauge-DPFBsbFj.cjs +1 -0
- package/dist/vue-ui-heatmap-DBOKYaJz.cjs +1 -0
- package/dist/vue-ui-heatmap-DD-Bzddj.js +598 -0
- package/dist/vue-ui-kpi-BEgf5yDv.cjs +1 -0
- package/dist/vue-ui-kpi-BS0o7zb9.js +54 -0
- package/dist/vue-ui-mini-loader-Bm5EJxtG.cjs +1 -0
- package/dist/vue-ui-mini-loader-DJEvG6ju.js +131 -0
- package/dist/vue-ui-molecule-DdwnFEBJ.js +750 -0
- package/dist/vue-ui-molecule-DzUqcaxd.cjs +1 -0
- package/dist/vue-ui-mood-radar-B9Gczs_Z.js +548 -0
- package/dist/vue-ui-mood-radar-DbB7m4Ku.cjs +1 -0
- package/dist/vue-ui-nested-donuts-BSINf8hd.cjs +16 -0
- package/dist/vue-ui-nested-donuts-CVQ1CaXo.js +771 -0
- package/dist/vue-ui-onion-D3-6Tv4u.cjs +1 -0
- package/dist/vue-ui-onion-Ut75t7hB.js +554 -0
- package/dist/vue-ui-parallel-coordinate-plot-Bjo09ZTX.js +651 -0
- package/dist/vue-ui-parallel-coordinate-plot-CJGkoIgN.cjs +8 -0
- package/dist/vue-ui-quadrant-CzCvejGn.cjs +1 -0
- package/dist/vue-ui-quadrant-Du9PKvlO.js +1178 -0
- package/dist/vue-ui-quick-chart-BsxsPbjz.cjs +13 -0
- package/dist/vue-ui-quick-chart-u0cPmD3q.js +1310 -0
- package/dist/vue-ui-radar-CBrpuE5r.js +614 -0
- package/dist/vue-ui-radar-DIpCrj1h.cjs +1 -0
- package/dist/vue-ui-rating-CaeGGlCw.js +271 -0
- package/dist/vue-ui-rating-D8fJC8Yt.cjs +1 -0
- package/dist/vue-ui-relation-circle-5DNf880s.js +304 -0
- package/dist/vue-ui-relation-circle-Ky3nPk6S.cjs +1 -0
- package/dist/vue-ui-rings-CffZ4T2S.cjs +1 -0
- package/dist/vue-ui-rings-IE3IdNRF.js +510 -0
- package/dist/vue-ui-scatter-C4GCZm0V.js +874 -0
- package/dist/vue-ui-scatter-TsX5dW9l.cjs +1 -0
- package/dist/vue-ui-screenshot-Bl3oooKI.js +160 -0
- package/dist/vue-ui-screenshot-Bzpg6yof.cjs +3 -0
- package/dist/vue-ui-skeleton-BisWX1sO.js +2064 -0
- package/dist/vue-ui-skeleton-JmGp11-u.cjs +41 -0
- package/dist/vue-ui-smiley-BhSrt9f-.cjs +2 -0
- package/dist/vue-ui-smiley-Sth2pqG1.js +763 -0
- package/dist/vue-ui-spark-trend-C8NSz4l8.cjs +1 -0
- package/dist/vue-ui-spark-trend-DAqO0TW2.js +246 -0
- package/dist/vue-ui-sparkbar-B0zX7NU7.js +242 -0
- package/dist/vue-ui-sparkbar-hL1Q6ObK.cjs +1 -0
- package/dist/vue-ui-sparkgauge-CWR8zJnU.js +157 -0
- package/dist/vue-ui-sparkgauge-tbVqaLCK.cjs +1 -0
- package/dist/vue-ui-sparkhistogram-Dv-lml4g.cjs +1 -0
- package/dist/vue-ui-sparkhistogram-DxqCtDpw.js +244 -0
- package/dist/vue-ui-sparkline-B6pvaBY_.cjs +1 -0
- package/dist/vue-ui-sparkline-BpL1jn7F.js +333 -0
- package/dist/vue-ui-sparkstackbar-BzbuBNIV.js +244 -0
- package/dist/vue-ui-sparkstackbar-CQ2TEi4p.cjs +1 -0
- package/dist/vue-ui-strip-plot-DCC6F4VM.cjs +1 -0
- package/dist/vue-ui-strip-plot-DCcbD6UE.js +618 -0
- package/dist/vue-ui-table-CFqIWfxl.js +1430 -0
- package/dist/vue-ui-table-CseaFWgX.cjs +14 -0
- package/dist/vue-ui-table-heatmap-Bwut-V1D.cjs +1 -0
- package/dist/vue-ui-table-heatmap-Bz8KYDxr.js +237 -0
- package/dist/vue-ui-table-sparkline-CJBU3y8-.cjs +1 -0
- package/dist/vue-ui-table-sparkline-z29ND2lq.js +420 -0
- package/dist/vue-ui-thermometer-BNAITzJa.js +385 -0
- package/dist/vue-ui-thermometer-DM2IKhqN.cjs +1 -0
- package/dist/vue-ui-timer-DLfXuW8T.cjs +64 -0
- package/dist/vue-ui-timer-DV6lQVHU.js +453 -0
- package/dist/vue-ui-tiremarks-B1bd1jPf.cjs +1 -0
- package/dist/vue-ui-tiremarks-WyQPg7yo.js +249 -0
- package/dist/vue-ui-treemap-BZGmoDHb.cjs +1 -0
- package/dist/vue-ui-treemap-DKmBhzV-.js +722 -0
- package/dist/vue-ui-vertical-bar-Bi-0rRN3.cjs +4 -0
- package/dist/vue-ui-vertical-bar-C-ySfrhJ.js +737 -0
- package/dist/vue-ui-waffle-CGRWu-da.js +638 -0
- package/dist/vue-ui-waffle-VLYkR-YZ.cjs +1 -0
- package/dist/vue-ui-wheel-D2q5vy5V.cjs +1 -0
- package/dist/vue-ui-wheel-Pj9OPk9f.js +227 -0
- package/dist/vue-ui-word-cloud-8Vr-jo1p.js +346 -0
- package/dist/vue-ui-word-cloud-Ba4BjatU.cjs +1 -0
- package/dist/vue-ui-xy-C4QW5Lfl.cjs +3 -0
- package/dist/vue-ui-xy-canvas-Be-Da_0x.cjs +9 -0
- package/dist/vue-ui-xy-canvas-DnLWrf0e.js +1006 -0
- package/dist/vue-ui-xy-qToggEfh.js +2064 -0
- package/package.json +1 -1
- package/dist/index-BcMihqI4.cjs +0 -843
- package/dist/index-C7FeCQ7K.js +0 -57303
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-BkomIE9L.cjs"),q=require("./useResponsive-B3TrDDIG.cjs"),se=require("./Title-Cj_xubjI.cjs"),U=require("./usePrinter-r6uHYEcR.cjs"),ie=require("./Legend-Dl5IYoxK.cjs"),ce=require("./DataTable-ssrNbONo.cjs"),de=require("./Tooltip-CdJ5hegk.cjs"),ve=require("./vue-ui-skeleton-JmGp11-u.cjs"),he=require("./vue-ui-accordion-SXsobrUt.cjs"),X=require("./useNestedProp-BMxXyPbW.cjs"),ge=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),pe=["id"],fe=["xmlns","viewBox"],me=["cx","cy","r","stroke","stroke-width","stroke-dasharray","stroke-dashoffset"],ye=["cx","cy","r","stroke","stroke-width","stroke-dasharray","stroke-dashoffset"],be=["id"],ke=["stdDeviation"],we=["filter"],Ce=["cx","cy","r","stroke-width","stroke-dasharray","stroke-dashoffset"],xe=["cx","cy","r","stroke-width","stroke-dasharray","stroke-dashoffset","onMouseenter"],$e={key:1},Te=["onMouseenter"],Be=["x","y","font-size","fill","font-weight"],Se=["onClick"],_e=["innerHTML"],Pe={__name:"vue-ui-onion",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(G,{expose:Y,emit:H}){const p=G,{vue_ui_onion:W}=u.useConfig(),w=e.computed(()=>!!p.dataset&&p.dataset.length),m=e.ref(u.createUid()),j=e.ref(null),O=e.ref(0),C=e.ref(!1),T=e.ref(""),c=e.ref([]),y=e.ref(null),I=e.ref(null),V=e.ref(null),t=e.computed(()=>{const a=X.useNestedProp({userConfig:p.config,defaultConfig:W});return a.theme?{...X.useNestedProp({userConfig:u.themes.vue_ui_onion[a.theme]||p.config,defaultConfig:a}),customPalette:u.themePalettes[a.theme]||u.palette}:a}),{isPrinting:J,isImaging:K,generatePdf:E,generateImage:M}=U.usePrinter({elementId:`vue-ui-onion_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-onion"}),Q=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),g=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),n=e.ref({height:512,width:512,padding:{top:64,left:64,right:64,bottom:64},minRadius:64}),x=e.ref(null);e.onMounted(()=>{if(u.objectIsEmpty(p.dataset)&&u.error({componentName:"VueUiOnion",type:"dataset"}),t.value.responsive){const r=q.throttle(()=>{const{width:l,height:o}=q.useResponsive({chart:y.value,title:t.value.style.chart.title.text?I.value:null,legend:t.value.style.chart.legend.show?V.value:null});n.value.width=l,n.value.height=o,n.value.padding.top=Math.max(l,o)*.125,n.value.padding.right=Math.max(l,o)*.125,n.value.padding.bottom=Math.max(l,o)*.125,n.value.padding.left=Math.max(l,o)*.125,n.value.minRadius=Math.min(l,o)*.125});x.value=new ResizeObserver(r),x.value.observe(y.value.parentNode)}}),e.onBeforeUnmount(()=>{x.value&&x.value.disconnect()});const s=e.computed(()=>({top:n.value.padding.top,left:n.value.padding.left,right:n.value.width-n.value.padding.right,bottom:n.value.height-n.value.padding.bottom,centerX:n.value.width/2,centerY:n.value.height/2,width:n.value.width-n.value.padding.right-n.value.padding.left,height:n.value.height-n.value.padding.bottom-n.value.padding.top,minRadius:n.value.minRadius,maxRadius:Math.min(n.value.width,n.value.height)-n.value.padding.top*2})),i=e.computed(()=>(p.dataset.forEach((a,r)=>{[null,void 0].includes(a.name)&&u.error({componentName:"VueUiOnion",type:"datasetSerieAttribute",property:"name",index:r}),[void 0].includes(a.percentage)&&u.error({componentName:"VueUiOnion",type:"datasetSerieAttribute",property:"percentage",index:r})}),p.dataset.map((a,r)=>{const l=`onion_serie_${r}_${m.value}`;return{...a,percentage:a.percentage||0,targetPercentage:a.percentage||0,color:u.convertColorToHex(a.color)||Q.value[r]||u.palette[r],id:l,shape:"circle",opacity:c.value.includes(l)?.5:1,absoluteIndex:r,segregate:()=>R(l),isSegregated:c.value.includes(l)}}))),b=e.ref(i.value),Z=e.computed(()=>t.value.useStartAnimation),ee=e.ref(null),te=e.computed(()=>Math.max(...i.value.map(a=>a.percentage))),B=e.ref(!1);e.watch(()=>i.value,le,{immediate:!0});function le(){if(Z.value&&!B.value){let r=function(){a>=te.value?(cancelAnimationFrame(ee.value),b.value=i.value,B.value=!0):(b.value=i.value.map(l=>({...l,percentage:a<l.targetPercentage?a:l.targetPercentage})),a+=1,requestAnimationFrame(r),B.value=!0)};b.value=i.value.map(l=>({...l,percentage:0}));let a=0;r()}else b.value=i.value}const ae=e.computed(()=>({cy:"onion-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),oe=e.computed(()=>i.value.filter(a=>!c.value.includes(a.id)).length),f=e.computed(()=>{const a=Math.min(s.value.width,s.value.height)/2/i.value.length;return{gutter:(a>t.value.style.chart.layout.maxThickness?t.value.style.chart.layout.maxThickness:a)*t.value.style.chart.layout.gutter.width,track:(a>t.value.style.chart.layout.maxThickness?t.value.style.chart.layout.maxThickness:a)*t.value.style.chart.layout.track.width}}),d=e.computed(()=>b.value.filter(a=>!c.value.includes(a.id)).map((a,r)=>{const l=(s.value.maxRadius-f.value.track)/oe.value/2*(1+r),o=s.value.centerY-l;return{percentage:a.percentage||0,...a,labelY:o,radius:l,path:re(l,a.percentage||0)}}));function re(a,r){const l=a*(1.5+(r/100>.3333333333333333?0:1-r/100))*Math.PI,o=a*1.5*Math.PI;return{bgDashArray:`${o} ${o}`,bgDashOffset:o-r/100*o,dashArray:`${l} ${l}`,dashOffset:l-r/100*l,fullOffset:0,active:`M${s.value.centerX},${s.value.centerY} A ${a},${a} 0 0 0 ${s.value.right},${s.value.top}`}}function R(a){c.value.includes(a)?c.value=c.value.filter(r=>r!==a):c.value.push(a),H("selectLegend",d.value)}function ne(){return d.value}const S=e.computed(()=>{const a=[t.value.table.translations.serie,t.value.table.translations.percentage,t.value.table.translations.value],r=d.value.map(l=>[l.name,l.percentage,l.value]);return{head:a,body:r}}),$=e.computed(()=>{const a=S.value.head,r=d.value.map(o=>[`<span style="color:${o.color}">⬤</span> ${o.name}`,`${Number(o.percentage??0).toFixed(t.value.table.td.roundingPercentage).toLocaleString()}%`,`${o.prefix||""}${[null,void 0,NaN,"NaN"].includes(o.value)?"-":o.value.toFixed(t.value.table.td.roundingValue).toLocaleString()}${o.suffix||""}`]),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{head:a,body:r,config:l,colNames:a}});function z(){e.nextTick(()=>{const a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],r=S.value.head,l=S.value.body,o=a.concat([r]).concat(l),h=u.createCsvContent(o);u.downloadCsv({csvContent:h,title:t.value.style.chart.title.text||"vue-ui-onion"})})}const v=e.ref(void 0),k=e.ref(!1);function ue(a){k.value=a,O.value+=1}const _=e.ref(null);function D({datapoint:a,seriesIndex:r,show:l=!0}){const o=a.absoluteIndex;v.value=r,_.value={datapoint:a,seriesIndex:o,series:i.value,config:t.value},C.value=l;let h="";const P=t.value.style.chart.tooltip.customFormat;if(u.isFunction(P)&&u.functionReturnsString(()=>P({seriesIndex:o,datapoint:a,series:i.value,config:t.value})))T.value=P({seriesIndex:o,datapoint:a,series:i.value,config:t.value});else{const N=t.value.style.chart.tooltip.showPercentage,F=t.value.style.chart.tooltip.showValue;h+=`<div style="width: 100%; border-bottom: 1px solid ${t.value.style.chart.tooltip.borderColor}; padding-bottom: 6px;margin-bottom:3px;display:flex;flex-direction:row;gap:3px;align-items:center"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${a.color}"/></svg><span></span>${a.name}</span></div>`,h+=`<div style="width:100%;text-align:left;"><b>${N?u.dataLabel({p:"",v:a.percentage,s:"%",r:t.value.style.chart.tooltip.roundingPercentage}):""}</b> ${N&&F?"(":""}${F?u.dataLabel({p:a.prefix||"",v:a.value,s:a.suffix||"",r:t.value.style.chart.tooltip.roundingValue}):""}${N&&F?")":""}</div>`,T.value=`<div>${h}</div>`}}function L(){g.value.showTable=!g.value.showTable}function A(){g.value.showTooltip=!g.value.showTooltip}return Y({getData:ne,generatePdf:E,generateCsv:z,generateImage:M,toggleTable:L,toggleTooltip:A}),(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-onion ${k.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"onionChart",ref:y,id:`vue-ui-onion_${m.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:I,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor}`)},[e.createVNode(se._sfc_main,{config:{title:{cy:"onion-div-title",...t.value.style.chart.title},subtitle:{cy:"onion-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&w.value?(e.openBlock(),e.createBlock(U.UserOptions,{ref_key:"details",ref:j,key:`user_options${O.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(K),isPrinting:e.unref(J),uid:m.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:k.value,isTooltip:g.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:y.value,onToggleFullscreen:ue,onGeneratePdf:e.unref(E),onGenerateCsv:z,onGenerateImage:e.unref(M),onToggleTable:L,onToggleTooltip:A},e.createSlots({_:2},[a.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:o})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:o})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),w.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(u.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value}),viewBox:`0 0 ${n.value.width<=0?1e-4:n.value.width} ${n.value.height<=0?1e-4:n.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("circle",{cx:s.value.centerX,cy:s.value.centerY,r:l.radius<=0?1e-4:l.radius,stroke:t.value.style.chart.layout.gutter.color,"stroke-width":f.value.gutter,fill:"none","stroke-dasharray":l.path.bgDashArray,"stroke-dashoffset":l.path.fullOffset,"stroke-linecap":"round",class:e.normalizeClass({"vue-ui-onion-path":!0,"vue-ui-onion-blur":t.value.useBlurOnHover&&![null,void 0].includes(v.value)&&v.value!==o}),style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,10,me))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("circle",{cx:s.value.centerX,cy:s.value.centerY,r:l.radius<0?1e-4:l.radius,stroke:`${l.color}`,"stroke-width":f.value.track,fill:"none","stroke-dasharray":l.path.dashArray,"stroke-dashoffset":l.path.dashOffset,class:e.normalizeClass({"vue-ui-onion-path":!0,"vue-ui-onion-blur":t.value.useBlurOnHover&&![null,void 0].includes(v.value)&&v.value!==o}),"stroke-linecap":"round",style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,10,ye))),256)),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${m.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.gradientIntensity},null,8,ke)],8,be)]),t.value.style.chart.useGradient?(e.openBlock(),e.createElementBlock("g",{key:0,filter:`url(#blur_${m.value})`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("circle",{cx:s.value.centerX,cy:s.value.centerY,r:l.radius<=0?1e-4:l.radius,stroke:"white","stroke-width":f.value.track/3,fill:"none","stroke-linecap":"round","stroke-dasharray":l.path.dashArray,"stroke-dashoffset":l.path.dashOffset,style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,8,Ce))),256))],8,we)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("circle",{"data-cy-trap":"",cx:s.value.centerX,cy:s.value.centerY,r:l.radius<=0?1e-4:l.radius,stroke:"transparent","stroke-width":Math.max(f.value.track,f.value.gutter),fill:"none","stroke-dasharray":l.path.bgDashArray,"stroke-dashoffset":l.path.fullOffset,"stroke-linecap":"round",class:"vue-ui-onion-path",style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"},onMouseenter:h=>D({datapoint:l,show:!0,seriesIndex:o}),onMouseleave:r[0]||(r[0]=h=>{v.value=void 0,C.value=!1})},null,40,xe))),256)),t.value.style.chart.layout.labels.show?(e.openBlock(),e.createElementBlock("g",$e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("g",{onMouseenter:h=>D({datapoint:l,show:!0,seriesIndex:o}),onMouseleave:r[1]||(r[1]=h=>{v.value=void 0,C.value=!1})},[c.value.includes(l.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("text",{key:0,x:n.value.width/2-f.value.gutter*.8+t.value.style.chart.layout.labels.offsetX,y:l.labelY+t.value.style.chart.layout.labels.offsetY,"text-anchor":"end","font-size":t.value.style.chart.layout.labels.fontSize,fill:t.value.useBlurOnHover&&![null,void 0].includes(v.value)&&v.value===o?l.color:t.value.style.chart.layout.labels.color,"font-weight":t.value.style.chart.layout.labels.bold?"bold":"normal"},e.toDisplayString(l.name?l.name+": ":"")+" "+e.toDisplayString(t.value.style.chart.layout.labels.percentage.show?`${(l.percentage||0).toFixed(t.value.style.chart.layout.labels.roundingPercentage)}%`:"")+" "+e.toDisplayString(!t.value.style.chart.layout.labels.percentage.show&&t.value.style.chart.layout.labels.value.show?` : ${l.value?`${l.prefix||""}${l.value.toFixed(t.value.style.chart.layout.labels.roundingValue)}${l.suffix||""}`:""}`:`${t.value.style.chart.layout.labels.value.show&&l.value?`(${l.prefix||""}${l.value.toFixed(t.value.style.chart.layout.labels.roundingValue)}${l.suffix||""})`:""}`),9,Be))],40,Te))),256))])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:n.value},void 0,!0)],14,fe)):e.createCommentVNode("",!0),w.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ve.default,{key:3,config:{type:"onion",style:{backgroundColor:t.value.style.chart.backgroundColor,onion:{color:t.value.style.chart.layout.gutter.color}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:V},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(ie.Legend,{key:0,legendSet:i.value,config:ae.value,onClickMarker:r[2]||(r[2]=({legend:l})=>R(l.id))},{item:e.withCtx(({legend:l})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:o=>l.segregate(),style:e.normalizeStyle(`opacity:${c.value.includes(l.id)?.5:1}`)},e.toDisplayString(l.name?l.name+": ":"")+" "+e.toDisplayString((l.percentage||0).toFixed(t.value.style.chart.legend.roundingPercentage))+"% ",13,Se)]),_:1},8,["legendSet","config"])):e.renderSlot(a.$slots,"legend",{key:1,legend:i.value},void 0,!0)],512),e.createVNode(de._sfc_main,{show:g.value.showTooltip&&C.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,parent:y.value,content:T.value,isCustom:e.unref(u.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({..._.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({..._.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","parent","content","isCustom"]),w.value?(e.openBlock(),e.createBlock(he.default,{key:4,hideDetails:"",config:{open:g.value.showTable,maxHeight:1e4,head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ce.DataTable,{colNames:$.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:r[3]||(r[3]=l=>g.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l),1)]),td:e.withCtx(({td:l})=>[e.createElementVNode("div",{innerHTML:l},null,8,_e)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,pe))}},Ne=ge._export_sfc(Pe,[["__scopeId","data-v-2ee9d4d0"]]);exports.default=Ne;
|
|
@@ -0,0 +1,554 @@
|
|
|
1
|
+
import { computed as d, ref as n, onMounted as _e, onBeforeUnmount as Oe, watch as Pe, openBlock as u, createElementBlock as i, normalizeClass as A, normalizeStyle as D, createVNode as E, createCommentVNode as b, createBlock as L, unref as x, createSlots as Fe, withCtx as v, renderSlot as g, normalizeProps as H, guardReactiveProps as W, Fragment as F, renderList as I, createElementVNode as C, toDisplayString as T, createTextVNode as Ie, nextTick as Se } from "vue";
|
|
2
|
+
import { u as Me, c as Ne, t as Re, a as Ae, p as re, b as De, o as Le, e as j, d as ze, X as Be, v as ue, n as Ve, q as Xe, w as Ge, f as ne } from "./index-BMCvLyab.js";
|
|
3
|
+
import { t as Ue, u as Ye } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
+
import { _ as Ee } from "./Title-BNPZwnkp.js";
|
|
5
|
+
import { u as He, U as We } from "./usePrinter-BuuBz5JR.js";
|
|
6
|
+
import { L as je } from "./Legend-DHpoRTAE.js";
|
|
7
|
+
import { D as qe } from "./DataTable-CaB7GIwQ.js";
|
|
8
|
+
import { _ as Je } from "./Tooltip-ZnJAz6dl.js";
|
|
9
|
+
import Ke from "./vue-ui-skeleton-BisWX1sO.js";
|
|
10
|
+
import Qe from "./vue-ui-accordion-CLlVxx3Q.js";
|
|
11
|
+
import { u as se } from "./useNestedProp-CkP8xhG_.js";
|
|
12
|
+
import { _ as Ze } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
|
+
const et = ["id"], tt = ["xmlns", "viewBox"], at = ["cx", "cy", "r", "stroke", "stroke-width", "stroke-dasharray", "stroke-dashoffset"], lt = ["cx", "cy", "r", "stroke", "stroke-width", "stroke-dasharray", "stroke-dashoffset"], ot = ["id"], rt = ["stdDeviation"], ut = ["filter"], nt = ["cx", "cy", "r", "stroke-width", "stroke-dasharray", "stroke-dashoffset"], st = ["cx", "cy", "r", "stroke-width", "stroke-dasharray", "stroke-dashoffset", "onMouseenter"], it = { key: 1 }, ct = ["onMouseenter"], dt = ["x", "y", "font-size", "fill", "font-weight"], vt = ["onClick"], ht = ["innerHTML"], gt = {
|
|
14
|
+
__name: "vue-ui-onion",
|
|
15
|
+
props: {
|
|
16
|
+
config: {
|
|
17
|
+
type: Object,
|
|
18
|
+
default() {
|
|
19
|
+
return {};
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
dataset: {
|
|
23
|
+
type: Array,
|
|
24
|
+
default() {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
emits: ["selectLegend"],
|
|
30
|
+
setup(ie, { expose: ce, emit: de }) {
|
|
31
|
+
const k = ie, { vue_ui_onion: ve } = Me(), S = d(() => !!k.dataset && k.dataset.length), w = n(Ne()), he = n(null), q = n(0), M = n(!1), z = n(""), h = n([]), _ = n(null), J = n(null), K = n(null), e = d(() => {
|
|
32
|
+
const a = se({
|
|
33
|
+
userConfig: k.config,
|
|
34
|
+
defaultConfig: ve
|
|
35
|
+
});
|
|
36
|
+
return a.theme ? {
|
|
37
|
+
...se({
|
|
38
|
+
userConfig: Re.vue_ui_onion[a.theme] || k.config,
|
|
39
|
+
defaultConfig: a
|
|
40
|
+
}),
|
|
41
|
+
customPalette: Ae[a.theme] || re
|
|
42
|
+
} : a;
|
|
43
|
+
}), { isPrinting: ge, isImaging: fe, generatePdf: Q, generateImage: Z } = He({
|
|
44
|
+
elementId: `vue-ui-onion_${w.value}`,
|
|
45
|
+
fileName: e.value.style.chart.title.text || "vue-ui-onion"
|
|
46
|
+
}), pe = d(() => De(e.value.customPalette)), m = n({
|
|
47
|
+
showTable: e.value.table.show,
|
|
48
|
+
showTooltip: e.value.style.chart.tooltip.show
|
|
49
|
+
}), r = n({
|
|
50
|
+
height: 512,
|
|
51
|
+
width: 512,
|
|
52
|
+
padding: {
|
|
53
|
+
top: 64,
|
|
54
|
+
left: 64,
|
|
55
|
+
right: 64,
|
|
56
|
+
bottom: 64
|
|
57
|
+
},
|
|
58
|
+
minRadius: 64
|
|
59
|
+
}), N = n(null);
|
|
60
|
+
_e(() => {
|
|
61
|
+
if (Le(k.dataset) && j({
|
|
62
|
+
componentName: "VueUiOnion",
|
|
63
|
+
type: "dataset"
|
|
64
|
+
}), e.value.responsive) {
|
|
65
|
+
const o = Ue(() => {
|
|
66
|
+
const { width: t, height: l } = Ye({
|
|
67
|
+
chart: _.value,
|
|
68
|
+
title: e.value.style.chart.title.text ? J.value : null,
|
|
69
|
+
legend: e.value.style.chart.legend.show ? K.value : null
|
|
70
|
+
});
|
|
71
|
+
r.value.width = t, r.value.height = l, r.value.padding.top = Math.max(t, l) * 0.125, r.value.padding.right = Math.max(t, l) * 0.125, r.value.padding.bottom = Math.max(t, l) * 0.125, r.value.padding.left = Math.max(t, l) * 0.125, r.value.minRadius = Math.min(t, l) * 0.125;
|
|
72
|
+
});
|
|
73
|
+
N.value = new ResizeObserver(o), N.value.observe(_.value.parentNode);
|
|
74
|
+
}
|
|
75
|
+
}), Oe(() => {
|
|
76
|
+
N.value && N.value.disconnect();
|
|
77
|
+
});
|
|
78
|
+
const s = d(() => ({
|
|
79
|
+
top: r.value.padding.top,
|
|
80
|
+
left: r.value.padding.left,
|
|
81
|
+
right: r.value.width - r.value.padding.right,
|
|
82
|
+
bottom: r.value.height - r.value.padding.bottom,
|
|
83
|
+
centerX: r.value.width / 2,
|
|
84
|
+
centerY: r.value.height / 2,
|
|
85
|
+
width: r.value.width - r.value.padding.right - r.value.padding.left,
|
|
86
|
+
height: r.value.height - r.value.padding.bottom - r.value.padding.top,
|
|
87
|
+
minRadius: r.value.minRadius,
|
|
88
|
+
maxRadius: Math.min(r.value.width, r.value.height) - r.value.padding.top * 2
|
|
89
|
+
})), c = d(() => (k.dataset.forEach((a, o) => {
|
|
90
|
+
[null, void 0].includes(a.name) && j({
|
|
91
|
+
componentName: "VueUiOnion",
|
|
92
|
+
type: "datasetSerieAttribute",
|
|
93
|
+
property: "name",
|
|
94
|
+
index: o
|
|
95
|
+
}), [void 0].includes(a.percentage) && j({
|
|
96
|
+
componentName: "VueUiOnion",
|
|
97
|
+
type: "datasetSerieAttribute",
|
|
98
|
+
property: "percentage",
|
|
99
|
+
index: o
|
|
100
|
+
});
|
|
101
|
+
}), k.dataset.map((a, o) => {
|
|
102
|
+
const t = `onion_serie_${o}_${w.value}`;
|
|
103
|
+
return {
|
|
104
|
+
...a,
|
|
105
|
+
percentage: a.percentage || 0,
|
|
106
|
+
targetPercentage: a.percentage || 0,
|
|
107
|
+
color: ze(a.color) || pe.value[o] || re[o],
|
|
108
|
+
id: t,
|
|
109
|
+
shape: "circle",
|
|
110
|
+
opacity: h.value.includes(t) ? 0.5 : 1,
|
|
111
|
+
absoluteIndex: o,
|
|
112
|
+
segregate: () => ee(t),
|
|
113
|
+
isSegregated: h.value.includes(t)
|
|
114
|
+
};
|
|
115
|
+
}))), O = n(c.value), ye = d(() => e.value.useStartAnimation), me = n(null), be = d(() => Math.max(...c.value.map((a) => a.percentage))), B = n(!1);
|
|
116
|
+
Pe(() => c.value, ke, { immediate: !0 });
|
|
117
|
+
function ke() {
|
|
118
|
+
if (ye.value && !B.value) {
|
|
119
|
+
let o = function() {
|
|
120
|
+
a >= be.value ? (cancelAnimationFrame(me.value), O.value = c.value, B.value = !0) : (O.value = c.value.map((t) => ({
|
|
121
|
+
...t,
|
|
122
|
+
percentage: a < t.targetPercentage ? a : t.targetPercentage
|
|
123
|
+
})), a += 1, requestAnimationFrame(o), B.value = !0);
|
|
124
|
+
};
|
|
125
|
+
O.value = c.value.map((t) => ({
|
|
126
|
+
...t,
|
|
127
|
+
percentage: 0
|
|
128
|
+
}));
|
|
129
|
+
let a = 0;
|
|
130
|
+
o();
|
|
131
|
+
} else
|
|
132
|
+
O.value = c.value;
|
|
133
|
+
}
|
|
134
|
+
const $e = d(() => ({
|
|
135
|
+
cy: "onion-div-legend",
|
|
136
|
+
backgroundColor: e.value.style.chart.legend.backgroundColor,
|
|
137
|
+
color: e.value.style.chart.legend.color,
|
|
138
|
+
fontSize: e.value.style.chart.legend.fontSize,
|
|
139
|
+
paddingBottom: 12,
|
|
140
|
+
fontWeight: e.value.style.chart.legend.bold ? "bold" : ""
|
|
141
|
+
})), we = d(() => c.value.filter((a) => !h.value.includes(a.id)).length), $ = d(() => {
|
|
142
|
+
const a = Math.min(s.value.width, s.value.height) / 2 / c.value.length;
|
|
143
|
+
return {
|
|
144
|
+
gutter: (a > e.value.style.chart.layout.maxThickness ? e.value.style.chart.layout.maxThickness : a) * e.value.style.chart.layout.gutter.width,
|
|
145
|
+
track: (a > e.value.style.chart.layout.maxThickness ? e.value.style.chart.layout.maxThickness : a) * e.value.style.chart.layout.track.width
|
|
146
|
+
};
|
|
147
|
+
}), f = d(() => O.value.filter((a) => !h.value.includes(a.id)).map((a, o) => {
|
|
148
|
+
const t = (s.value.maxRadius - $.value.track) / we.value / 2 * (1 + o), l = s.value.centerY - t;
|
|
149
|
+
return {
|
|
150
|
+
percentage: a.percentage || 0,
|
|
151
|
+
...a,
|
|
152
|
+
labelY: l,
|
|
153
|
+
radius: t,
|
|
154
|
+
path: xe(t, a.percentage || 0)
|
|
155
|
+
};
|
|
156
|
+
}));
|
|
157
|
+
function xe(a, o) {
|
|
158
|
+
const t = a * (1.5 + (o / 100 > 0.3333333333333333 ? 0 : 1 - o / 100)) * Math.PI, l = a * 1.5 * Math.PI;
|
|
159
|
+
return {
|
|
160
|
+
bgDashArray: `${l} ${l}`,
|
|
161
|
+
bgDashOffset: l - o / 100 * l,
|
|
162
|
+
dashArray: `${t} ${t}`,
|
|
163
|
+
dashOffset: t - o / 100 * t,
|
|
164
|
+
fullOffset: 0,
|
|
165
|
+
active: `M${s.value.centerX},${s.value.centerY} A ${a},${a} 0 0 0 ${s.value.right},${s.value.top}`
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
function ee(a) {
|
|
169
|
+
h.value.includes(a) ? h.value = h.value.filter((o) => o !== a) : h.value.push(a), de("selectLegend", f.value);
|
|
170
|
+
}
|
|
171
|
+
function Ce() {
|
|
172
|
+
return f.value;
|
|
173
|
+
}
|
|
174
|
+
const V = d(() => {
|
|
175
|
+
const a = [e.value.table.translations.serie, e.value.table.translations.percentage, e.value.table.translations.value], o = f.value.map((t) => [
|
|
176
|
+
t.name,
|
|
177
|
+
t.percentage,
|
|
178
|
+
t.value
|
|
179
|
+
]);
|
|
180
|
+
return { head: a, body: o };
|
|
181
|
+
}), R = d(() => {
|
|
182
|
+
const a = V.value.head, o = f.value.map((l) => [
|
|
183
|
+
`<span style="color:${l.color}">⬤</span> ${l.name}`,
|
|
184
|
+
`${Number(l.percentage ?? 0).toFixed(e.value.table.td.roundingPercentage).toLocaleString()}%`,
|
|
185
|
+
`${l.prefix || ""}${[null, void 0, NaN, "NaN"].includes(l.value) ? "-" : l.value.toFixed(e.value.table.td.roundingValue).toLocaleString()}${l.suffix || ""}`
|
|
186
|
+
]), t = {
|
|
187
|
+
th: {
|
|
188
|
+
backgroundColor: e.value.table.th.backgroundColor,
|
|
189
|
+
color: e.value.table.th.color,
|
|
190
|
+
outline: e.value.table.th.outline
|
|
191
|
+
},
|
|
192
|
+
td: {
|
|
193
|
+
backgroundColor: e.value.table.td.backgroundColor,
|
|
194
|
+
color: e.value.table.td.color,
|
|
195
|
+
outline: e.value.table.td.outline
|
|
196
|
+
},
|
|
197
|
+
breakpoint: e.value.table.responsiveBreakpoint
|
|
198
|
+
};
|
|
199
|
+
return { head: a, body: o, config: t, colNames: a };
|
|
200
|
+
});
|
|
201
|
+
function te() {
|
|
202
|
+
Se(() => {
|
|
203
|
+
const a = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [""]], o = V.value.head, t = V.value.body, l = a.concat([o]).concat(t), y = Ve(l);
|
|
204
|
+
Xe({ csvContent: y, title: e.value.style.chart.title.text || "vue-ui-onion" });
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
const p = n(void 0), P = n(!1);
|
|
208
|
+
function Te(a) {
|
|
209
|
+
P.value = a, q.value += 1;
|
|
210
|
+
}
|
|
211
|
+
const X = n(null);
|
|
212
|
+
function ae({ datapoint: a, seriesIndex: o, show: t = !0 }) {
|
|
213
|
+
const l = a.absoluteIndex;
|
|
214
|
+
p.value = o, X.value = {
|
|
215
|
+
datapoint: a,
|
|
216
|
+
seriesIndex: l,
|
|
217
|
+
series: c.value,
|
|
218
|
+
config: e.value
|
|
219
|
+
}, M.value = t;
|
|
220
|
+
let y = "";
|
|
221
|
+
const G = e.value.style.chart.tooltip.customFormat;
|
|
222
|
+
if (ue(G) && Ge(() => G({
|
|
223
|
+
seriesIndex: l,
|
|
224
|
+
datapoint: a,
|
|
225
|
+
series: c.value,
|
|
226
|
+
config: e.value
|
|
227
|
+
})))
|
|
228
|
+
z.value = G({
|
|
229
|
+
seriesIndex: l,
|
|
230
|
+
datapoint: a,
|
|
231
|
+
series: c.value,
|
|
232
|
+
config: e.value
|
|
233
|
+
});
|
|
234
|
+
else {
|
|
235
|
+
const U = e.value.style.chart.tooltip.showPercentage, Y = e.value.style.chart.tooltip.showValue;
|
|
236
|
+
y += `<div style="width: 100%; border-bottom: 1px solid ${e.value.style.chart.tooltip.borderColor}; padding-bottom: 6px;margin-bottom:3px;display:flex;flex-direction:row;gap:3px;align-items:center"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${a.color}"/></svg><span></span>${a.name}</span></div>`, y += `<div style="width:100%;text-align:left;"><b>${U ? ne({ p: "", v: a.percentage, s: "%", r: e.value.style.chart.tooltip.roundingPercentage }) : ""}</b> ${U && Y ? "(" : ""}${Y ? ne({ p: a.prefix || "", v: a.value, s: a.suffix || "", r: e.value.style.chart.tooltip.roundingValue }) : ""}${U && Y ? ")" : ""}</div>`, z.value = `<div>${y}</div>`;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
function le() {
|
|
240
|
+
m.value.showTable = !m.value.showTable;
|
|
241
|
+
}
|
|
242
|
+
function oe() {
|
|
243
|
+
m.value.showTooltip = !m.value.showTooltip;
|
|
244
|
+
}
|
|
245
|
+
return ce({
|
|
246
|
+
getData: Ce,
|
|
247
|
+
generatePdf: Q,
|
|
248
|
+
generateCsv: te,
|
|
249
|
+
generateImage: Z,
|
|
250
|
+
toggleTable: le,
|
|
251
|
+
toggleTooltip: oe
|
|
252
|
+
}), (a, o) => (u(), i("div", {
|
|
253
|
+
class: A(`vue-ui-onion ${P.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.value.useCssAnimation ? "" : "vue-ui-dna"}`),
|
|
254
|
+
ref_key: "onionChart",
|
|
255
|
+
ref: _,
|
|
256
|
+
id: `vue-ui-onion_${w.value}`,
|
|
257
|
+
style: D(`font-family:${e.value.style.fontFamily};width:100%; ${e.value.responsive ? "height: 100%;" : ""} text-align:center;background:${e.value.style.chart.backgroundColor}`)
|
|
258
|
+
}, [
|
|
259
|
+
e.value.style.chart.title.text ? (u(), i("div", {
|
|
260
|
+
key: 0,
|
|
261
|
+
ref_key: "chartTitle",
|
|
262
|
+
ref: J,
|
|
263
|
+
style: D(`width:100%;background:${e.value.style.chart.backgroundColor}`)
|
|
264
|
+
}, [
|
|
265
|
+
E(Ee, {
|
|
266
|
+
config: {
|
|
267
|
+
title: {
|
|
268
|
+
cy: "onion-div-title",
|
|
269
|
+
...e.value.style.chart.title
|
|
270
|
+
},
|
|
271
|
+
subtitle: {
|
|
272
|
+
cy: "onion-div-subtitle",
|
|
273
|
+
...e.value.style.chart.title.subtitle
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}, null, 8, ["config"])
|
|
277
|
+
], 4)) : b("", !0),
|
|
278
|
+
e.value.userOptions.show && S.value ? (u(), L(We, {
|
|
279
|
+
ref_key: "details",
|
|
280
|
+
ref: he,
|
|
281
|
+
key: `user_options${q.value}`,
|
|
282
|
+
backgroundColor: e.value.style.chart.backgroundColor,
|
|
283
|
+
color: e.value.style.chart.color,
|
|
284
|
+
isImaging: x(fe),
|
|
285
|
+
isPrinting: x(ge),
|
|
286
|
+
uid: w.value,
|
|
287
|
+
hasTooltip: e.value.userOptions.buttons.tooltip && e.value.style.chart.tooltip.show,
|
|
288
|
+
hasPdf: e.value.userOptions.buttons.pdf,
|
|
289
|
+
hasImg: e.value.userOptions.buttons.img,
|
|
290
|
+
hasXls: e.value.userOptions.buttons.csv,
|
|
291
|
+
hasTable: e.value.userOptions.buttons.table,
|
|
292
|
+
hasFullscreen: e.value.userOptions.buttons.fullscreen,
|
|
293
|
+
isFullscreen: P.value,
|
|
294
|
+
isTooltip: m.value.showTooltip,
|
|
295
|
+
titles: { ...e.value.userOptions.buttonTitles },
|
|
296
|
+
chartElement: _.value,
|
|
297
|
+
onToggleFullscreen: Te,
|
|
298
|
+
onGeneratePdf: x(Q),
|
|
299
|
+
onGenerateCsv: te,
|
|
300
|
+
onGenerateImage: x(Z),
|
|
301
|
+
onToggleTable: le,
|
|
302
|
+
onToggleTooltip: oe
|
|
303
|
+
}, Fe({ _: 2 }, [
|
|
304
|
+
a.$slots.optionTooltip ? {
|
|
305
|
+
name: "optionTooltip",
|
|
306
|
+
fn: v(() => [
|
|
307
|
+
g(a.$slots, "optionTooltip", {}, void 0, !0)
|
|
308
|
+
]),
|
|
309
|
+
key: "0"
|
|
310
|
+
} : void 0,
|
|
311
|
+
a.$slots.optionPdf ? {
|
|
312
|
+
name: "optionPdf",
|
|
313
|
+
fn: v(() => [
|
|
314
|
+
g(a.$slots, "optionPdf", {}, void 0, !0)
|
|
315
|
+
]),
|
|
316
|
+
key: "1"
|
|
317
|
+
} : void 0,
|
|
318
|
+
a.$slots.optionCsv ? {
|
|
319
|
+
name: "optionCsv",
|
|
320
|
+
fn: v(() => [
|
|
321
|
+
g(a.$slots, "optionCsv", {}, void 0, !0)
|
|
322
|
+
]),
|
|
323
|
+
key: "2"
|
|
324
|
+
} : void 0,
|
|
325
|
+
a.$slots.optionImg ? {
|
|
326
|
+
name: "optionImg",
|
|
327
|
+
fn: v(() => [
|
|
328
|
+
g(a.$slots, "optionImg", {}, void 0, !0)
|
|
329
|
+
]),
|
|
330
|
+
key: "3"
|
|
331
|
+
} : void 0,
|
|
332
|
+
a.$slots.optionTable ? {
|
|
333
|
+
name: "optionTable",
|
|
334
|
+
fn: v(() => [
|
|
335
|
+
g(a.$slots, "optionTable", {}, void 0, !0)
|
|
336
|
+
]),
|
|
337
|
+
key: "4"
|
|
338
|
+
} : void 0,
|
|
339
|
+
a.$slots.optionFullscreen ? {
|
|
340
|
+
name: "optionFullscreen",
|
|
341
|
+
fn: v(({ toggleFullscreen: t, isFullscreen: l }) => [
|
|
342
|
+
g(a.$slots, "optionFullscreen", H(W({ toggleFullscreen: t, isFullscreen: l })), void 0, !0)
|
|
343
|
+
]),
|
|
344
|
+
key: "5"
|
|
345
|
+
} : void 0
|
|
346
|
+
]), 1032, ["backgroundColor", "color", "isImaging", "isPrinting", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasTable", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "onGeneratePdf", "onGenerateImage"])) : b("", !0),
|
|
347
|
+
S.value ? (u(), i("svg", {
|
|
348
|
+
key: 2,
|
|
349
|
+
xmlns: x(Be),
|
|
350
|
+
class: A({ "vue-data-ui-fullscreen--on": P.value, "vue-data-ui-fulscreen--off": !P.value }),
|
|
351
|
+
viewBox: `0 0 ${r.value.width <= 0 ? 1e-4 : r.value.width} ${r.value.height <= 0 ? 1e-4 : r.value.height}`,
|
|
352
|
+
style: D(`max-width:100%;overflow:visible;background:${e.value.style.chart.backgroundColor};color:${e.value.style.chart.color}`)
|
|
353
|
+
}, [
|
|
354
|
+
(u(!0), i(F, null, I(f.value, (t, l) => (u(), i("circle", {
|
|
355
|
+
cx: s.value.centerX,
|
|
356
|
+
cy: s.value.centerY,
|
|
357
|
+
r: t.radius <= 0 ? 1e-4 : t.radius,
|
|
358
|
+
stroke: e.value.style.chart.layout.gutter.color,
|
|
359
|
+
"stroke-width": $.value.gutter,
|
|
360
|
+
fill: "none",
|
|
361
|
+
"stroke-dasharray": t.path.bgDashArray,
|
|
362
|
+
"stroke-dashoffset": t.path.fullOffset,
|
|
363
|
+
"stroke-linecap": "round",
|
|
364
|
+
class: A({ "vue-ui-onion-path": !0, "vue-ui-onion-blur": e.value.useBlurOnHover && ![null, void 0].includes(p.value) && p.value !== l }),
|
|
365
|
+
style: { transform: "rotate(-90deg)", "transform-origin": "50% 50%" }
|
|
366
|
+
}, null, 10, at))), 256)),
|
|
367
|
+
(u(!0), i(F, null, I(f.value, (t, l) => (u(), i("circle", {
|
|
368
|
+
cx: s.value.centerX,
|
|
369
|
+
cy: s.value.centerY,
|
|
370
|
+
r: t.radius < 0 ? 1e-4 : t.radius,
|
|
371
|
+
stroke: `${t.color}`,
|
|
372
|
+
"stroke-width": $.value.track,
|
|
373
|
+
fill: "none",
|
|
374
|
+
"stroke-dasharray": t.path.dashArray,
|
|
375
|
+
"stroke-dashoffset": t.path.dashOffset,
|
|
376
|
+
class: A({ "vue-ui-onion-path": !0, "vue-ui-onion-blur": e.value.useBlurOnHover && ![null, void 0].includes(p.value) && p.value !== l }),
|
|
377
|
+
"stroke-linecap": "round",
|
|
378
|
+
style: { transform: "rotate(-90deg)", "transform-origin": "50% 50%" }
|
|
379
|
+
}, null, 10, lt))), 256)),
|
|
380
|
+
C("defs", null, [
|
|
381
|
+
C("filter", {
|
|
382
|
+
id: `blur_${w.value}`,
|
|
383
|
+
x: "-50%",
|
|
384
|
+
y: "-50%",
|
|
385
|
+
width: "200%",
|
|
386
|
+
height: "200%"
|
|
387
|
+
}, [
|
|
388
|
+
C("feGaussianBlur", {
|
|
389
|
+
in: "SourceGraphic",
|
|
390
|
+
stdDeviation: 100 / e.value.style.chart.gradientIntensity
|
|
391
|
+
}, null, 8, rt)
|
|
392
|
+
], 8, ot)
|
|
393
|
+
]),
|
|
394
|
+
e.value.style.chart.useGradient ? (u(), i("g", {
|
|
395
|
+
key: 0,
|
|
396
|
+
filter: `url(#blur_${w.value})`
|
|
397
|
+
}, [
|
|
398
|
+
(u(!0), i(F, null, I(f.value, (t, l) => (u(), i("circle", {
|
|
399
|
+
cx: s.value.centerX,
|
|
400
|
+
cy: s.value.centerY,
|
|
401
|
+
r: t.radius <= 0 ? 1e-4 : t.radius,
|
|
402
|
+
stroke: "white",
|
|
403
|
+
"stroke-width": $.value.track / 3,
|
|
404
|
+
fill: "none",
|
|
405
|
+
"stroke-linecap": "round",
|
|
406
|
+
"stroke-dasharray": t.path.dashArray,
|
|
407
|
+
"stroke-dashoffset": t.path.dashOffset,
|
|
408
|
+
style: { transform: "rotate(-90deg)", "transform-origin": "50% 50%" }
|
|
409
|
+
}, null, 8, nt))), 256))
|
|
410
|
+
], 8, ut)) : b("", !0),
|
|
411
|
+
(u(!0), i(F, null, I(f.value, (t, l) => (u(), i("circle", {
|
|
412
|
+
"data-cy-trap": "",
|
|
413
|
+
cx: s.value.centerX,
|
|
414
|
+
cy: s.value.centerY,
|
|
415
|
+
r: t.radius <= 0 ? 1e-4 : t.radius,
|
|
416
|
+
stroke: "transparent",
|
|
417
|
+
"stroke-width": Math.max($.value.track, $.value.gutter),
|
|
418
|
+
fill: "none",
|
|
419
|
+
"stroke-dasharray": t.path.bgDashArray,
|
|
420
|
+
"stroke-dashoffset": t.path.fullOffset,
|
|
421
|
+
"stroke-linecap": "round",
|
|
422
|
+
class: "vue-ui-onion-path",
|
|
423
|
+
style: { transform: "rotate(-90deg)", "transform-origin": "50% 50%" },
|
|
424
|
+
onMouseenter: (y) => ae({
|
|
425
|
+
datapoint: t,
|
|
426
|
+
show: !0,
|
|
427
|
+
seriesIndex: l
|
|
428
|
+
}),
|
|
429
|
+
onMouseleave: o[0] || (o[0] = (y) => {
|
|
430
|
+
p.value = void 0, M.value = !1;
|
|
431
|
+
})
|
|
432
|
+
}, null, 40, st))), 256)),
|
|
433
|
+
e.value.style.chart.layout.labels.show ? (u(), i("g", it, [
|
|
434
|
+
(u(!0), i(F, null, I(f.value, (t, l) => (u(), i("g", {
|
|
435
|
+
onMouseenter: (y) => ae({
|
|
436
|
+
datapoint: t,
|
|
437
|
+
show: !0,
|
|
438
|
+
seriesIndex: l
|
|
439
|
+
}),
|
|
440
|
+
onMouseleave: o[1] || (o[1] = (y) => {
|
|
441
|
+
p.value = void 0, M.value = !1;
|
|
442
|
+
})
|
|
443
|
+
}, [
|
|
444
|
+
h.value.includes(t.id) ? b("", !0) : (u(), i("text", {
|
|
445
|
+
key: 0,
|
|
446
|
+
x: r.value.width / 2 - $.value.gutter * 0.8 + e.value.style.chart.layout.labels.offsetX,
|
|
447
|
+
y: t.labelY + e.value.style.chart.layout.labels.offsetY,
|
|
448
|
+
"text-anchor": "end",
|
|
449
|
+
"font-size": e.value.style.chart.layout.labels.fontSize,
|
|
450
|
+
fill: e.value.useBlurOnHover && ![null, void 0].includes(p.value) && p.value === l ? t.color : e.value.style.chart.layout.labels.color,
|
|
451
|
+
"font-weight": e.value.style.chart.layout.labels.bold ? "bold" : "normal"
|
|
452
|
+
}, T(t.name ? t.name + ": " : "") + " " + T(e.value.style.chart.layout.labels.percentage.show ? `${(t.percentage || 0).toFixed(e.value.style.chart.layout.labels.roundingPercentage)}%` : "") + " " + T(!e.value.style.chart.layout.labels.percentage.show && e.value.style.chart.layout.labels.value.show ? ` : ${t.value ? `${t.prefix || ""}${t.value.toFixed(e.value.style.chart.layout.labels.roundingValue)}${t.suffix || ""}` : ""}` : `${e.value.style.chart.layout.labels.value.show && t.value ? `(${t.prefix || ""}${t.value.toFixed(e.value.style.chart.layout.labels.roundingValue)}${t.suffix || ""})` : ""}`), 9, dt))
|
|
453
|
+
], 40, ct))), 256))
|
|
454
|
+
])) : b("", !0),
|
|
455
|
+
g(a.$slots, "svg", { svg: r.value }, void 0, !0)
|
|
456
|
+
], 14, tt)) : b("", !0),
|
|
457
|
+
S.value ? b("", !0) : (u(), L(Ke, {
|
|
458
|
+
key: 3,
|
|
459
|
+
config: {
|
|
460
|
+
type: "onion",
|
|
461
|
+
style: {
|
|
462
|
+
backgroundColor: e.value.style.chart.backgroundColor,
|
|
463
|
+
onion: {
|
|
464
|
+
color: e.value.style.chart.layout.gutter.color
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}, null, 8, ["config"])),
|
|
469
|
+
C("div", {
|
|
470
|
+
ref_key: "chartLegend",
|
|
471
|
+
ref: K
|
|
472
|
+
}, [
|
|
473
|
+
e.value.style.chart.legend.show ? (u(), L(je, {
|
|
474
|
+
key: 0,
|
|
475
|
+
legendSet: c.value,
|
|
476
|
+
config: $e.value,
|
|
477
|
+
onClickMarker: o[2] || (o[2] = ({ legend: t }) => ee(t.id))
|
|
478
|
+
}, {
|
|
479
|
+
item: v(({ legend: t }) => [
|
|
480
|
+
C("div", {
|
|
481
|
+
"data-cy-legend-item": "",
|
|
482
|
+
onClick: (l) => t.segregate(),
|
|
483
|
+
style: D(`opacity:${h.value.includes(t.id) ? 0.5 : 1}`)
|
|
484
|
+
}, T(t.name ? t.name + ": " : "") + " " + T((t.percentage || 0).toFixed(e.value.style.chart.legend.roundingPercentage)) + "% ", 13, vt)
|
|
485
|
+
]),
|
|
486
|
+
_: 1
|
|
487
|
+
}, 8, ["legendSet", "config"])) : g(a.$slots, "legend", {
|
|
488
|
+
key: 1,
|
|
489
|
+
legend: c.value
|
|
490
|
+
}, void 0, !0)
|
|
491
|
+
], 512),
|
|
492
|
+
E(Je, {
|
|
493
|
+
show: m.value.showTooltip && M.value,
|
|
494
|
+
backgroundColor: e.value.style.chart.tooltip.backgroundColor,
|
|
495
|
+
color: e.value.style.chart.tooltip.color,
|
|
496
|
+
borderRadius: e.value.style.chart.tooltip.borderRadius,
|
|
497
|
+
borderColor: e.value.style.chart.tooltip.borderColor,
|
|
498
|
+
borderWidth: e.value.style.chart.tooltip.borderWidth,
|
|
499
|
+
fontSize: e.value.style.chart.tooltip.fontSize,
|
|
500
|
+
backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
|
|
501
|
+
parent: _.value,
|
|
502
|
+
content: z.value,
|
|
503
|
+
isCustom: x(ue)(e.value.style.chart.tooltip.customFormat)
|
|
504
|
+
}, {
|
|
505
|
+
"tooltip-before": v(() => [
|
|
506
|
+
g(a.$slots, "tooltip-before", H(W({ ...X.value })), void 0, !0)
|
|
507
|
+
]),
|
|
508
|
+
"tooltip-after": v(() => [
|
|
509
|
+
g(a.$slots, "tooltip-after", H(W({ ...X.value })), void 0, !0)
|
|
510
|
+
]),
|
|
511
|
+
_: 3
|
|
512
|
+
}, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "fontSize", "backgroundOpacity", "parent", "content", "isCustom"]),
|
|
513
|
+
S.value ? (u(), L(Qe, {
|
|
514
|
+
key: 4,
|
|
515
|
+
hideDetails: "",
|
|
516
|
+
config: {
|
|
517
|
+
open: m.value.showTable,
|
|
518
|
+
maxHeight: 1e4,
|
|
519
|
+
head: {
|
|
520
|
+
backgroundColor: e.value.style.chart.backgroundColor,
|
|
521
|
+
color: e.value.style.chart.color
|
|
522
|
+
},
|
|
523
|
+
body: {
|
|
524
|
+
backgroundColor: e.value.style.chart.backgroundColor,
|
|
525
|
+
color: e.value.style.chart.color
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}, {
|
|
529
|
+
content: v(() => [
|
|
530
|
+
E(qe, {
|
|
531
|
+
colNames: R.value.colNames,
|
|
532
|
+
head: R.value.head,
|
|
533
|
+
body: R.value.body,
|
|
534
|
+
config: R.value.config,
|
|
535
|
+
title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
|
|
536
|
+
onClose: o[3] || (o[3] = (t) => m.value.showTable = !1)
|
|
537
|
+
}, {
|
|
538
|
+
th: v(({ th: t }) => [
|
|
539
|
+
Ie(T(t), 1)
|
|
540
|
+
]),
|
|
541
|
+
td: v(({ td: t }) => [
|
|
542
|
+
C("div", { innerHTML: t }, null, 8, ht)
|
|
543
|
+
]),
|
|
544
|
+
_: 1
|
|
545
|
+
}, 8, ["colNames", "head", "body", "config", "title"])
|
|
546
|
+
]),
|
|
547
|
+
_: 1
|
|
548
|
+
}, 8, ["config"])) : b("", !0)
|
|
549
|
+
], 14, et));
|
|
550
|
+
}
|
|
551
|
+
}, Ot = /* @__PURE__ */ Ze(gt, [["__scopeId", "data-v-2ee9d4d0"]]);
|
|
552
|
+
export {
|
|
553
|
+
Ot as default
|
|
554
|
+
};
|