UNPKG

vue-data-ui

Version:

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

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