UNPKG

vue-data-ui-hq

Version:

A user-empowering data visualization Vue 3 components library for eloquent data storytelling

2 lines (1 loc) 34.9 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-ZfICPrrM.cjs"),Ve=require("./Title-FbHK83tB.cjs"),me=require("./usePrinter-B-gh2f22.cjs"),Ae=require("./DataTable-CC6dPSer.cjs"),$e=require("./Legend-HgHPyA_4.cjs"),Fe=require("./vue-ui-skeleton-Bvmpr51u.cjs"),De=require("./Slicer-CtTQxL9r.cjs"),Pe=require("./vue-ui-accordion-Dp6uTsJi.cjs"),ge=require("./useNestedProp-C14rfl0j.cjs"),Ie=require("./PackageVersion-D3dK8oA3.cjs"),Oe=require("./PenAndPaper-PL3bp4ud.cjs"),Te=require("./useUserOptionState-BgepsfED.cjs"),Me=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),He=["id"],Ue=["xmlns","viewBox"],qe=["x","y","width","height"],Re=["id"],We=["stop-color"],Xe=["stop-color"],Ge=["id"],je=["stop-color"],Ye=["stop-color"],Ke=["stop-color"],Je={key:1},Qe=["x1","x2","y1","y2","stroke","stroke-width"],Ze=["x1","x2","y1","y2","stroke","stroke-width"],et={key:0},tt=["x1","x2","y1","y2","stroke","stroke-width"],nt=["x1","x2","y1","y2","stroke","stroke-width"],ot=["x","y","font-size","fill","font-weight"],lt=["text-anchor","font-size","fill","transform"],rt=["x1","y1","x2","y2","stroke","stroke-width"],at={key:1},ut=["cx","cy","r","fill"],st={key:0},ct={key:0},it=["d","stroke"],dt=["text-anchor","x","y","fill"],ft=["cx","cy","r","fill"],ht={key:0},yt=["cx","cy","fill"],mt={key:1},gt=["d","fill","stroke"],vt={key:2},pt=["d","fill","stroke"],kt=["x","y","font-size","fill"],xt=["x","y","width","fill","onClick"],bt=["x","y","width","height","onMouseenter","onClick"],Bt={key:4,"data-cy-zoom":"",class:"vue-ui-donut-evolution-dialog"},Ct=["x","y","width","height","fill"],_t=["x1","y1","x2","y2","stroke"],Et=["x1","y2","x2","y1","stroke"],Nt=["cx","cy","r"],wt=["d","stroke"],St=["cx","cy","r","fill"],Lt=["d","fill","stroke"],zt={class:"vue-ui-donut-evolution-focus"},Vt=["text-anchor","x","y","fill"],At=["cx","cy","r","fill"],$t=["cx","cy","r","fill"],Ft=["x","y","fill"],Dt=["x","y","font-size","fill"],Pt={key:5,class:"vue-data-ui-watermark"},It=["onClick"],Ot={key:0},Tt={key:1},Mt={key:9,ref:"source",dir:"auto"},Ht={key:0},Ut={key:1},qt={__name:"vue-ui-donut-evolution",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(ve,{expose:pe,emit:ke}){const{vue_ui_donut_evolution:xe}=u.useConfig(),y=ve,A=e.computed(()=>!!y.dataset&&y.dataset.length),i=e.ref({start:0,end:Math.max(...y.dataset.map(o=>o.values.length))});function W(){X()}const N=e.ref(null);async function X(){(t.value.style.chart.zoom.startIndex!==null||t.value.style.chart.zoom.endIndex!==null)&&N.value?(t.value.style.chart.zoom.startIndex!==null&&(await e.nextTick(),await e.nextTick(),N.value&&N.value.setStartValue(t.value.style.chart.zoom.startIndex)),t.value.style.chart.zoom.endIndex!==null&&(await e.nextTick(),await e.nextTick(),N.value&&N.value.setEndValue(be(t.value.style.chart.zoom.endIndex+1)))):(i.value={start:0,end:E.value},Y.value+=1)}function be(o){const l=E.value;return o>l?l:o<0||t.value.style.chart.zoom.startIndex!==null&&o<t.value.style.chart.zoom.startIndex?t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex+1:1:o}e.onMounted(()=>{G()});function G(){u.objectIsEmpty(y.dataset)?u.error({componentName:"VueUiDonutEvolution",type:"dataset"}):y.dataset.length&&y.dataset.forEach((o,l)=>{u.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","values"]}).forEach(n=>{u.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:n,index:l})})}),X()}const _=e.ref(u.createUid()),m=e.ref([]),h=e.ref(null),P=e.ref(null),k=e.ref(!1),x=e.ref(null),I=e.ref(null),Be=e.ref(null),j=e.ref(0),Y=e.ref(0),K=e.ref(0),J=e.ref(0),Q=e.ref(0),Z=ke,t=e.computed({get:()=>ne(),set:o=>o}),{userOptionsVisible:O,setUserOptionsVisibility:ee,keepUserOptionState:te}=Te.useUserOptionState({config:t.value});function ne(){const o=ge.useNestedProp({userConfig:y.config,defaultConfig:xe});let l={};return o.theme?l={...ge.useNestedProp({userConfig:u.themes.vue_ui_donut_evolution[o.theme]||y.config,defaultConfig:o}),customPalette:u.themePalettes[o.theme]||u.palette}:l=o,y.config&&u.hasDeepProperty(y.config,"style.chart.zoom.startIndex")?l.style.chart.zoom.startIndex=y.config.style.chart.zoom.startIndex:l.style.chart.zoom.startIndex=null,y.config&&u.hasDeepProperty(y.config,"style.chart.zoom.endIndex")?l.style.chart.zoom.endIndex=y.config.style.chart.zoom.endIndex:l.style.chart.zoom.endIndex=null,l}e.watch(()=>y.config,o=>{t.value=ne(),O.value=!t.value.showOnChartHover,G(),K.value+=1,J.value+=1,Q.value+=1},{deep:!0}),e.watch(()=>y.dataset,o=>{W()},{deep:!0});const{isPrinting:oe,isImaging:le,generatePdf:re,generateImage:ae}=me.usePrinter({elementId:_.value,fileName:t.value.style.chart.title.text||"vue-ui-donut-evolution"}),Ce=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),_e=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),$=e.ref({showTable:t.value.table.show}),a=e.computed(()=>({top:t.value.style.chart.layout.padding.top,right:t.value.style.chart.layout.padding.right,bottom:t.value.style.chart.layout.padding.bottom,left:t.value.style.chart.layout.padding.left})),s=e.computed(()=>{const o=t.value.style.chart.layout.height,l=t.value.style.chart.layout.width,n=o-a.value.top-a.value.bottom,c=l-a.value.left-a.value.right;return{absoluteHeight:o,absoluteWidth:l,centerX:a.value.left+c/2,centerY:a.value.top+n/2,height:n,width:c}}),C=e.computed(()=>(y.dataset.forEach((o,l)=>{[null,void 0].includes(o.name)&&u.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:"name",index:l}),[null,void 0].includes(o.values)&&u.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:"values",index:l})}),y.dataset.map((o,l)=>({...o,values:u.sanitizeArray(o.values),color:u.convertColorToHex(o.color)||_e.value[l]||u.palette[l]||u.palette[l%u.palette.length],length:(o.values||[]).length,uid:u.createUid()})))),z=e.computed(()=>C.value.filter(o=>!m.value.includes(o.uid)).map(o=>({...o,values:o.values.filter((l,n)=>n>=i.value.start&&n<=i.value.end)}))),E=e.computed(()=>Math.max(...z.value.map(o=>o.length))),v=e.computed(()=>s.value.width/(i.value.end-i.value.start)),g=e.computed(()=>{const o=[];for(let r=0;r<i.value.end-i.value.start;r+=1){const f=z.value.map(B=>B.values[r]??null),d=f.filter(B=>[void 0,null].includes(B)).length===f.length,b=f.reduce((B,p)=>B+p,0),R=f.map(B=>B/b),L=a.value.left+v.value*r+v.value/2;o.push({index:r,percentages:R,subtotal:d||b<0?null:b,values:f,x:L})}const l=0,n=Math.max(...o.map(r=>r.subtotal)),c=o.length===1?n*2:n;return o.map((r,f)=>{const d=v.value/2*.7,b=d>s.value.width/16?s.value.width/16:d,R=h.value===r.index?s.value.width/16:b,L=o.length>4?d*2:d*2>v.value/2*.7?v.value/2*.7:d*2,B=s.value.absoluteHeight-a.value.bottom-s.value.height*r.subtotal/u.calculateNiceScale(l,c,t.value.style.chart.layout.grid.yAxis.dataLabels.steps).max;return{...r,y:B,radius:b,activeRadius:R,hoverRadius:L,donut:u.makeDonut({series:z.value.map((p,ye)=>({color:p.color,name:p.name,value:p.values[f]??0}))},r.x,B,b,b,1.99999,2,1,360,105.25,b/2),donutHover:u.makeDonut({series:z.value.map((p,ye)=>({color:p.color,name:p.name,value:p.values[f]??0}))},r.x,B,L,L,1.99999,2,1,360,105.25,L/2),donutFocus:u.makeDonut({series:z.value.map((p,ye)=>({color:p.color,name:p.name,value:p.values[f]??0}))},s.value.centerX,s.value.centerY,s.value.height/3.6,s.value.height/3.6,1.99999,2,1,360,105.25,s.value.height/6)}})});function F(o,l,n){return u.applyDataLabel(t.value.style.chart.layout.dataLabels.formatter,o,u.dataLabel({p:t.value.style.chart.layout.dataLabels.prefix,v:o,s:t.value.style.chart.layout.dataLabels.suffix,r:t.value.style.chart.layout.dataLabels.rounding}),{datapoint:l,index:n})}const T=e.computed(()=>({max:Math.max(...g.value.map(o=>o.subtotal)),min:0})),w=e.computed(()=>{const o=g.value.length===1?T.value.max*2:T.value.max;return u.calculateNiceScale(T.value.min,o,t.value.style.chart.layout.grid.yAxis.dataLabels.steps)});function Ee(o){return o/w.value.max}const Ne=e.computed(()=>w.value.ticks.map(o=>({y:s.value.absoluteHeight-a.value.bottom-s.value.height*Ee(o),value:o})));function ue(o,l){return isNaN(o.value/u.sumByAttribute(l,"value"))?0:(o.value/u.sumByAttribute(l,"value")*100).toFixed(0)+"%"}function se(){k.value||(h.value=null,P.value=null)}function we(o){k.value||(h.value=o.index,P.value=o)}const M=e.ref(null);function H(o,l){o.subtotal&&(P.value=null,h.value=null,k.value=!0,x.value=o,[null,void 0].includes(l)||(M.value=l))}function ce(){x.value=null,k.value=!1,M.value=null}const ie=e.computed(()=>C.value.map((o,l)=>({name:o.name,value:o.values.slice(i.value.start,i.value.end).reduce((n,c)=>n+c,0),shape:"circle",uid:o.uid,color:o.color})).sort((o,l)=>l.value-o.value).map(o=>({...o,opacity:m.value.includes(o.uid)?.5:1,segregate:()=>U(o.uid),isSegregated:m.value.includes(o.uid)}))),de=e.computed(()=>g.value.map(o=>o.subtotal).reduce((o,l)=>o+l,0)),Se=e.computed(()=>({cy:"donut-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":""}));function U(o){if(m.value.includes(o))m.value=m.value.filter(l=>l!==o),Z("selectLegend",null);else{if(m.value.length===C.value.length-1)return;m.value.push(o),Z("selectLegend",C.value.find(l=>l.uid===o))}x.value&&H(g.value.find((l,n)=>n===M.value))}const S=e.computed(()=>{const o=[""].concat(C.value.filter(r=>!m.value.includes(r.uid)).map(r=>({name:r.name,color:r.color}))).concat(["Σ"]);let l=[];for(let r=0;r<E.value;r+=1){const f=C.value.filter(d=>!m.value.includes(d.uid)).map(d=>d.values[r]??0).reduce((d,b)=>d+b,0);l.push([t.value.style.chart.layout.grid.xAxis.dataLabels.values[r]??"-"].concat(C.value.filter(d=>!m.value.includes(d.uid)).map(d=>({value:d.values[r]??0,percentage:d.values[r]?d.values[r]/f*100:0}))).concat([`${t.value.style.chart.layout.dataLabels.prefix}${Number(f.toFixed(t.value.table.td.roundingValue))}${t.value.style.chart.layout.dataLabels.suffix}`]))}const n={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},c=[t.value.table.columnNames.period].concat(C.value.filter(r=>!m.value.includes(r.uid)).map(r=>r.name)).concat(t.value.table.columnNames.total);return{head:o,body:l,config:n,colNames:c}});function Le(){return C.value}function fe(){e.nextTick(()=>{const o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],l=[...S.value.head.map(f=>f.name??f)],n=[...S.value.body.map(f=>f.map(d=>d.value??d))],c=o.concat([l]).concat(n),r=u.createCsvContent(c);u.downloadCsv({csvContent:r,title:t.value.style.chart.title.text||"vue-ui-donut-evolution"})})}const V=e.ref(!1);function ze(o){V.value=o,j.value+=1}function he(){$.value.showTable=!$.value.showTable}const D=e.ref(!1);function q(){D.value=!D.value}return pe({getData:Le,generatePdf:re,generateCsv:fe,generateImage:ae,toggleTable:he,toggleAnnotator:q}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"donutEvolutionChart",ref:I,class:e.normalizeClass(`vue-ui-donut-evolution ${e.unref(V)?"vue-data-ui-wrapper-fullscreen":""} ${e.unref(t).useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${e.unref(t).style.fontFamily};width:100%; text-align:center;background:${e.unref(t).style.chart.backgroundColor}`),id:e.unref(_),onMouseenter:l[4]||(l[4]=()=>e.unref(ee)(!0)),onMouseleave:l[5]||(l[5]=()=>e.unref(ee)(!1))},[e.unref(t).userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Oe.PenAndPaper,{key:0,parent:e.unref(I),backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color,active:e.unref(D),onClose:q},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),e.unref(Ce)?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:Be,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),e.unref(t).style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,style:"width:100%;background:transparent;padding-bottom:24px",onMouseleave:se},[(e.openBlock(),e.createBlock(Ve._sfc_main,{key:`title_${e.unref(K)}`,config:{title:{cy:"donut-evolution-div-title",...e.unref(t).style.chart.title},subtitle:{cy:"donut-evolution-div-subtitle",...e.unref(t).style.chart.title.subtitle}}},null,8,["config"]))],32)):e.createCommentVNode("",!0),e.unref(t).userOptions.show&&e.unref(A)&&(e.unref(te)||e.unref(O))?(e.openBlock(),e.createBlock(me.UserOptions,{ref:"details",key:`user_options_${e.unref(j)}`,backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color,isPrinting:e.unref(oe),isImaging:e.unref(le),uid:e.unref(_),hasPdf:e.unref(t).userOptions.buttons.pdf,hasImg:e.unref(t).userOptions.buttons.img,hasXls:e.unref(t).userOptions.buttons.csv,hasTable:e.unref(t).userOptions.buttons.table,hasFullscreen:e.unref(t).userOptions.buttons.fullscreen,isFullscreen:e.unref(V),titles:{...e.unref(t).userOptions.buttonTitles},chartElement:e.unref(I),position:e.unref(t).userOptions.position,hasAnnotator:e.unref(t).userOptions.buttons.annotator,isAnnotation:e.unref(D),onToggleFullscreen:ze,onGeneratePdf:e.unref(re),onGenerateCsv:fe,onGenerateImage:e.unref(ae),onToggleTable:he,onToggleAnnotator:q,style:e.normalizeStyle({visibility:e.unref(te)?e.unref(O)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:n,isFullscreen:c})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:n,isFullscreen:c})),void 0,!0)]),key:"4"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:n,isAnnotator:c})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:n,isAnnotator:c})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),e.unref(A)?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(u.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":e.unref(V),"vue-data-ui-fulscreen--off":!e.unref(V)}),viewBox:`0 0 ${e.unref(s).absoluteWidth} ${e.unref(s).absoluteHeight}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${e.unref(t).style.chart.color}`)},[e.createVNode(Ie._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:e.unref(a).left,y:e.unref(a).top,width:e.unref(s).width,height:e.unref(s).height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,qe)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`hover_${e.unref(_)}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(u.setOpacity)(e.unref(t).style.chart.backgroundColor,e.unref(t).style.chart.layout.highlighter.opacity)},null,8,We),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.setOpacity)(e.unref(t).style.chart.layout.highlighter.color,e.unref(t).style.chart.layout.highlighter.opacity)},null,8,Xe)],8,Re),e.createElementVNode("radialGradient",{id:`focus_${e.unref(_)}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(u.setOpacity)(e.unref(u.convertColorToHex)(e.unref(t).style.chart.backgroundColor),0)},null,8,je),e.createElementVNode("stop",{offset:"77%","stop-color":e.unref(u.setOpacity)("#FFFFFF",30)},null,8,Ye),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.setOpacity)(e.unref(u.convertColorToHex)(e.unref(t).style.chart.backgroundColor),0)},null,8,Ke)],8,Ge)]),e.unref(t).style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",Je,[e.createElementVNode("line",{x1:e.unref(a).left,x2:e.unref(a).left,y1:e.unref(a).top,y2:e.unref(a).top+e.unref(s).height,stroke:e.unref(t).style.chart.layout.grid.stroke,"stroke-width":e.unref(t).style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Qe),e.createElementVNode("line",{x1:e.unref(a).left,x2:e.unref(s).absoluteWidth-e.unref(a).right,y1:e.unref(s).absoluteHeight-e.unref(a).bottom,y2:e.unref(s).absoluteHeight-e.unref(a).bottom,stroke:e.unref(t).style.chart.layout.grid.stroke,"stroke-width":e.unref(t).style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Ze),e.unref(t).style.chart.layout.grid.showVerticalLines?(e.openBlock(),e.createElementBlock("g",et,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i).end-e.unref(i).start,(n,c)=>(e.openBlock(),e.createElementBlock("line",{x1:e.unref(a).left+(c+1)*e.unref(v),x2:e.unref(a).left+(c+1)*e.unref(v),y1:e.unref(a).top,y2:e.unref(s).absoluteHeight-e.unref(a).bottom,stroke:e.unref(t).style.chart.layout.grid.stroke,"stroke-width":e.unref(t).style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,tt))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.unref(t).style.chart.layout.grid.yAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",{key:2,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":e.unref(h)!==null||e.unref(k)})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Ne),(n,c)=>(e.openBlock(),e.createElementBlock("g",null,[n.value>=e.unref(w).min&&n.value<=e.unref(w).max?(e.openBlock(),e.createElementBlock("line",{key:0,x1:e.unref(a).left,x2:e.unref(a).left-5,y1:n.y,y2:n.y,stroke:e.unref(t).style.chart.layout.grid.stroke,"stroke-width":e.unref(t).style.chart.layout.grid.strokeWidth},null,8,nt)):e.createCommentVNode("",!0),n.value>=e.unref(w).min&&n.value<=e.unref(w).max?(e.openBlock(),e.createElementBlock("text",{key:1,x:e.unref(a).left-8+e.unref(t).style.chart.layout.grid.yAxis.dataLabels.offsetX,y:n.y+e.unref(t).style.chart.layout.grid.yAxis.dataLabels.fontSize/3,"font-size":e.unref(t).style.chart.layout.grid.yAxis.dataLabels.fontSize,"text-anchor":"end",fill:e.unref(t).style.chart.layout.grid.yAxis.dataLabels.color,"font-weight":e.unref(t).style.chart.layout.grid.yAxis.dataLabels.bold?"bold":"normal"},e.toDisplayString(e.unref(u.canShowValue)(n.value)?e.unref(u.applyDataLabel)(e.unref(t).style.chart.layout.dataLabels.formatter,n.value,e.unref(u.dataLabel)({p:e.unref(t).style.chart.layout.dataLabels.prefix,v:n.value,s:e.unref(t).style.chart.layout.dataLabels.suffix,r:e.unref(t).style.chart.layout.grid.yAxis.dataLabels.roundingValue}),{datapoint:n,seriesIndex:c}):""),9,ot)):e.createCommentVNode("",!0)]))),256))],2)):e.createCommentVNode("",!0),e.unref(t).style.chart.layout.grid.xAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":e.unref(k)})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i).end-e.unref(i).start,(n,c)=>(e.openBlock(),e.createElementBlock("g",null,[e.unref(t).style.chart.layout.grid.xAxis.dataLabels.showOnlyFirstAndLast&&(c===0||c===e.unref(E)-1)||!e.unref(t).style.chart.layout.grid.xAxis.dataLabels.showOnlyFirstAndLast?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":e.unref(t).style.chart.layout.grid.xAxis.dataLabels.rotation>0?"start":e.unref(t).style.chart.layout.grid.xAxis.dataLabels.rotation<0?"end":"middle","font-size":e.unref(t).style.chart.layout.grid.xAxis.dataLabels.fontSize,fill:e.unref(t).style.chart.layout.grid.xAxis.dataLabels.color,transform:`translate(${e.unref(a).left+e.unref(v)*c+e.unref(v)/2}, ${e.unref(t).style.chart.layout.grid.xAxis.dataLabels.offsetY+e.unref(s).absoluteHeight-e.unref(a).bottom+e.unref(t).style.chart.layout.grid.xAxis.dataLabels.fontSize*2}), rotate(${e.unref(t).style.chart.layout.grid.xAxis.dataLabels.rotation})`},e.toDisplayString(e.unref(t).style.chart.layout.grid.xAxis.dataLabels.values[Number(c)+Number(e.unref(i).start)]??""),9,lt)):e.createCommentVNode("",!0)]))),256))],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(n,c)=>(e.openBlock(),e.createElementBlock("g",null,[e.unref(t).style.chart.layout.line.show&&c<e.unref(g).length-1&&![n.subtotal,e.unref(g)[c+1].subtotal].includes(null)?(e.openBlock(),e.createElementBlock("line",{key:0,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":e.unref(h)!==null||e.unref(k)}),x1:n.x,y1:n.y,x2:e.unref(g)[c+1].x,y2:e.unref(g)[c+1].y,stroke:e.unref(t).style.chart.layout.line.stroke,"stroke-width":e.unref(t).style.chart.layout.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,10,rt)):e.createCommentVNode("",!0),n.subtotal!==null?(e.openBlock(),e.createElementBlock("g",at,[n.subtotal?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x,cy:n.y,r:n.activeRadius,fill:e.unref(t).style.chart.backgroundColor},null,8,ut)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(n,c)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":c!==e.unref(h)&&e.unref(h)!==null||e.unref(k)})},[n.subtotal?(e.openBlock(),e.createElementBlock("g",st,[e.unref(h)!==null&&e.unref(h)===c?(e.openBlock(),e.createElementBlock("g",ct,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.donutHover,r=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("path",{d:e.unref(u.calcNutArrowPath)(r,{x:r.center.endX,y:r.center.endY},12,12,{x:n.x,y:n.y},!0,20),stroke:r.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,it)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.donutHover,(r,f)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("text",{"data-cy-hover-label":"","text-anchor":e.unref(u.calcMarkerOffsetX)(r,!0,0).anchor,x:e.unref(u.calcMarkerOffsetX)(r,!0,3).x,y:e.unref(u.calcMarkerOffsetY)(r),fill:e.unref(t).style.chart.layout.grid.yAxis.dataLabels.color,"font-size":8,"font-weight":"bold"},e.toDisplayString(r.name)+": "+e.toDisplayString(ue(r,n.donut))+" ("+e.toDisplayString(r.value===null?"-":F(r.value,r,f))+") ",9,dt)]))),256)),e.createElementVNode("g",null,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:n.hoverRadius,fill:e.unref(t).style.chart.backgroundColor},null,8,ft)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(n,c)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":c!==e.unref(h)&&e.unref(h)!==null||e.unref(k)})},[n.subtotal!==null?(e.openBlock(),e.createElementBlock("g",ht,[n.subtotal===0?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x,cy:n.y,r:3,fill:e.unref(t).style.chart.color},null,8,yt)):e.unref(h)!==null&&e.unref(h)===c?(e.openBlock(),e.createElementBlock("g",mt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.donutHover,(r,f)=>(e.openBlock(),e.createElementBlock("path",{d:r.arcSlice,fill:`${r.color}`,"stroke-width":1,stroke:e.unref(t).style.chart.backgroundColor},null,8,gt))),256))])):(e.openBlock(),e.createElementBlock("g",vt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.donut,(r,f)=>(e.openBlock(),e.createElementBlock("path",{d:r.arcSlice,fill:`${r.color}`,"stroke-width":.5,stroke:e.unref(t).style.chart.backgroundColor},null,8,pt))),256))]))])):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(n,c)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":c!==e.unref(h)&&e.unref(h)!==null||e.unref(k)})},[n.subtotal!==null&&e.unref(t).style.chart.layout.dataLabels.show?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":"middle",x:n.x,y:e.unref(h)===n.index&&n.subtotal?n.y+e.unref(t).style.chart.layout.dataLabels.fontSize/3:n.y-n.radius-e.unref(t).style.chart.layout.dataLabels.fontSize+e.unref(t).style.chart.layout.dataLabels.offsetY,"font-size":e.unref(t).style.chart.layout.dataLabels.fontSize,"font-weight":"bold",fill:e.unref(t).style.chart.layout.dataLabels.color},e.toDisplayString(F(n.subtotal,n,c)),9,kt)):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(n,c)=>(e.openBlock(),e.createElementBlock("rect",{x:e.unref(a).left+c*e.unref(v),y:e.unref(s).absoluteHeight-e.unref(a).bottom-10,width:e.unref(v),height:10,fill:e.unref(h)===n.index?`url(#hover_${e.unref(_)})`:"transparent",onClick:r=>H(n,c),class:e.normalizeClass({"donut-hover":e.unref(h)===n.index&&n.subtotal})},null,10,xt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(n,c)=>(e.openBlock(),e.createElementBlock("rect",{"data-cy-trap":"",x:e.unref(a).left+c*e.unref(v),y:e.unref(a).top,width:e.unref(v),height:e.unref(s).height,fill:"transparent",onMouseenter:r=>we(n),onMouseleave:se,onClick:r=>H(n,c),class:e.normalizeClass({"donut-hover":e.unref(h)===n.index&&n.subtotal})},null,42,bt))),256)),e.unref(k)?(e.openBlock(),e.createElementBlock("g",Bt,[e.createElementVNode("rect",{rx:4,x:e.unref(a).left,y:e.unref(a).top,width:e.unref(s).width,height:e.unref(s).height,fill:e.unref(t).style.chart.backgroundColor,style:{filter:"drop-shadow(0 12px 12px rgba(0,0,0,0.3))"}},null,8,Ct),e.createElementVNode("line",{"data-html2canvas-ignore":"",x1:e.unref(s).absoluteWidth-e.unref(a).right-15,y1:e.unref(a).top+5,x2:e.unref(s).absoluteWidth-e.unref(a).right-4,y2:e.unref(a).top+15.5,"stroke-linecap":"round",stroke:e.unref(t).style.chart.color,"stroke-width":"1.5"},null,8,_t),e.createElementVNode("line",{"data-html2canvas-ignore":"",x1:e.unref(s).absoluteWidth-e.unref(a).right-15,y2:e.unref(a).top+5,x2:e.unref(s).absoluteWidth-e.unref(a).right-4,y1:e.unref(a).top+15.5,"stroke-linecap":"round",stroke:e.unref(t).style.chart.color,"stroke-width":"1.5"},null,8,Et),e.createElementVNode("circle",{"data-cy-close":"",onClick:ce,onKeypress:e.withKeys(ce,["enter"]),cx:e.unref(s).absoluteWidth-e.unref(a).right-e.unref(s).width/40,cy:e.unref(a).top+e.unref(s).height/30,r:e.unref(s).height/12,fill:"transparent",style:{cursor:"pointer"},tabindex:"0"},null,40,Nt),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(x).donutFocus,n=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("path",{"data-cy-zoom-donut":"",d:e.unref(u.calcNutArrowPath)(n,{x:e.unref(s).centerX,y:e.unref(s).centerY},12,12,!1,!1,15),stroke:n.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none",class:"vue-ui-donut-evolution-focus"},null,8,wt)]))),256)),e.createElementVNode("circle",{cx:e.unref(a).left+e.unref(s).width/2,cy:e.unref(a).top+e.unref(s).height/2,r:e.unref(s).height/7,fill:e.unref(t).style.chart.backgroundColor},null,8,St),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(x).donutFocus,(n,c)=>(e.openBlock(),e.createElementBlock("path",{d:n.arcSlice,fill:`${n.color}`,"stroke-width":1,stroke:e.unref(t).style.chart.backgroundColor,class:"vue-ui-donut-evolution-focus"},null,8,Lt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(x).donutFocus,(n,c)=>(e.openBlock(),e.createElementBlock("g",zt,[e.createElementVNode("text",{"text-anchor":e.unref(u.calcMarkerOffsetX)(n,!0,20).anchor,x:e.unref(u.calcMarkerOffsetX)(n,!0,10).x,y:e.unref(u.calcMarkerOffsetY)(n),fill:e.unref(t).style.chart.layout.grid.yAxis.dataLabels.color,"font-size":10,"font-weight":"bold"},e.toDisplayString(n.name)+": "+e.toDisplayString(ue(n,e.unref(x).donutFocus))+" ("+e.toDisplayString(n.value===null?"-":F(n.value,n,c))+") ",9,Vt)]))),256)),e.createElementVNode("circle",{cx:e.unref(a).left+e.unref(s).width/2,cy:e.unref(a).top+e.unref(s).height/2,r:e.unref(s).height/3.8,fill:`url(#focus_${e.unref(_)})`},null,8,At),e.createElementVNode("circle",{cx:e.unref(a).left+e.unref(s).width/2,cy:e.unref(a).top+e.unref(s).height/2,r:e.unref(s).height/7.7,fill:e.unref(t).style.chart.backgroundColor},null,8,$t),e.createElementVNode("text",{"text-anchor":"middle",x:e.unref(a).left+e.unref(s).width/2,y:e.unref(a).top+e.unref(s).height/2+14/3,"font-size":14,"font-weight":"bold",fill:e.unref(t).style.chart.layout.dataLabels.color,class:"vue-ui-donut-evolution-focus"},e.toDisplayString(F(e.unref(x).subtotal,e.unref(x),null)),9,Ft),e.unref(t).style.chart.layout.grid.xAxis.dataLabels.values[e.unref(x).index]?(e.openBlock(),e.createElementBlock("text",{key:0,x:e.unref(a).left+6,y:e.unref(a).top+e.unref(t).style.chart.layout.grid.xAxis.dataLabels.fontSize*2,"font-size":e.unref(t).style.chart.layout.grid.xAxis.dataLabels.fontSize*1.6,fill:e.unref(t).style.chart.layout.dataLabels.color},e.toDisplayString(e.unref(t).style.chart.layout.grid.xAxis.dataLabels.values[Number(e.unref(x).index)+Number(e.unref(i).start)]),9,Dt)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:e.unref(s)},void 0,!0)],14,Ue)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Pt,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(oe)||e.unref(le)})),void 0,!0)])):e.createCommentVNode("",!0),e.unref(A)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Fe.default,{key:6,config:{type:"donutEvolution",style:{backgroundColor:e.unref(t).style.chart.backgroundColor,donutEvolution:{axis:{color:"#CCCCCC"},donuts:{color:"#CCCCCC"}}}}},null,8,["config"])),e.unref(E)>1&&e.unref(t).style.chart.zoom.show?(e.openBlock(),e.createBlock(De.Slicer,{ref_key:"slicerComponent",ref:N,key:`slicer_${e.unref(Y)}`,background:e.unref(t).style.chart.zoom.color,borderColor:e.unref(t).style.chart.backgroundColor,fontSize:e.unref(t).style.chart.zoom.fontSize,useResetSlot:e.unref(t).style.chart.zoom.useResetSlot,labelLeft:e.unref(t).style.chart.layout.grid.xAxis.dataLabels.values[Number(e.unref(i).start)]||"",labelRight:e.unref(t).style.chart.layout.grid.xAxis.dataLabels.values[Number(e.unref(i).end)-1]||"",textColor:e.unref(t).style.chart.color,inputColor:e.unref(t).style.chart.zoom.color,selectColor:e.unref(t).style.chart.zoom.highlightColor,max:e.unref(E),min:0,valueStart:e.unref(i).start,valueEnd:e.unref(i).end,start:e.unref(i).start,"onUpdate:start":l[0]||(l[0]=n=>e.unref(i).start=n),end:e.unref(i).end,"onUpdate:end":l[1]||(l[1]=n=>e.unref(i).end=n),refreshStartPoint:e.unref(t).style.chart.zoom.startIndex!==null?e.unref(t).style.chart.zoom.startIndex:0,refreshEndPoint:e.unref(t).style.chart.zoom.endIndex!==null?e.unref(t).style.chart.zoom.endIndex+1:e.unref(E),onReset:W},{"reset-action":e.withCtx(({reset:n})=>[e.renderSlot(o.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:n})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end","refreshStartPoint","refreshEndPoint"])):e.createCommentVNode("",!0),e.unref(t).style.chart.legend.show?(e.openBlock(),e.createBlock($e.Legend,{key:`legend_${e.unref(Q)}`,legendSet:e.unref(ie),config:e.unref(Se),onClickMarker:l[2]||(l[2]=({legend:n})=>U(n.uid))},{item:e.withCtx(({legend:n,index:c})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:r=>U(n.uid),style:e.normalizeStyle(`opacity:${e.unref(m).includes(n.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(n.name)+": "+e.toDisplayString(e.unref(u.applyDataLabel)(e.unref(t).style.chart.layout.dataLabels.formatter,n.value,e.unref(u.dataLabel)({p:e.unref(t).style.chart.layout.dataLabels.prefix,v:n.value,s:e.unref(t).style.chart.layout.dataLabels.suffix,r:e.unref(t).style.chart.legend.roundingValue}),{datapoint:n,seriesIndex:c}))+" ",1),e.unref(m).includes(n.uid)?(e.openBlock(),e.createElementBlock("span",Tt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Ot," ("+e.toDisplayString(isNaN(n.value/e.unref(de))?"-":e.unref(u.dataLabel)({v:n.value/e.unref(de)*100,s:"%",r:e.unref(t).style.chart.legend.roundingPercentage}))+") ",1))],12,It)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"legend",{legend:e.unref(ie)},void 0,!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",Mt,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.unref(A)?(e.openBlock(),e.createBlock(Pe.default,{key:10,hideDetails:"",config:{open:e.unref($).showTable,maxHeight:1e4,body:{backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color},head:{backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Ae.DataTable,{key:`table_${e.unref(J)}`,colNames:e.unref(S).colNames,head:e.unref(S).head,body:e.unref(S).body,config:e.unref(S).config,title:`${e.unref(t).style.chart.title.text}${e.unref(t).style.chart.title.subtitle.text?` : ${e.unref(t).style.chart.title.subtitle.text}`:""}`,onClose:l[3]||(l[3]=n=>e.unref($).showTable=!1)},{th:e.withCtx(({th:n})=>[e.createTextVNode(e.toDisplayString(n.name??n),1)]),td:e.withCtx(({td:n})=>[n.value===null?(e.openBlock(),e.createElementBlock("span",Ht,"-")):(e.openBlock(),e.createElementBlock("b",Ut,e.toDisplayString(isNaN(n.value)?"":e.unref(t).style.chart.layout.dataLabels.prefix)+e.toDisplayString(!isNaN(n.value)&&n.value!==null?Number(n.value.toFixed(e.unref(t).table.td.roundingValue)).toLocaleString():n)+e.toDisplayString(isNaN(n.value)?"":e.unref(t).style.chart.layout.dataLabels.suffix),1)),e.createElementVNode("span",null,e.toDisplayString(n.percentage&&!isNaN(n.percentage)?`(${Number(n.percentage.toFixed(e.unref(t).table.td.roundingPercentage)).toLocaleString()}%)`:""),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,He))}},Rt=Me._export_sfc(qt,[["__scopeId","data-v-93f724ae"]]);exports.default=Rt;