vue-data-ui
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
2 lines (1 loc) • 35 kB
JavaScript
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-CtzlfT2i.cjs"),De=require("./Title-BGQhFU2C.cjs"),pe=require("./usePrinter-LlH3giBA.cjs"),Fe=require("./DataTable-DhEDo7W6.cjs"),Pe=require("./Legend-2PWaf6Bj.cjs"),Ie=require("./vue-ui-skeleton-MFudy6Nx.cjs"),Oe=require("./Slicer-rJxCx_c3.cjs"),Te=require("./vue-ui-accordion-tUPDXqYS.cjs"),ke=require("./useNestedProp-B5jFEsaz.cjs"),He=require("./PackageVersion-DdCp9lqS.cjs"),Re=require("./PenAndPaper-4dibNTrE.cjs"),Me=require("./useUserOptionState-BgepsfED.cjs"),Ue=require("./useChartAccessibility-Cm7nkzTG.cjs"),qe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),We=["id"],Xe=["xmlns","viewBox"],Ge=["x","y","width","height"],je=["id"],Ye=["stop-color"],Ke=["stop-color"],Ze=["id"],Je=["stop-color"],Qe=["stop-color"],et=["stop-color"],tt={key:1},lt=["x1","x2","y1","y2","stroke","stroke-width"],ot=["x1","x2","y1","y2","stroke","stroke-width"],at={key:0},nt=["x1","x2","y1","y2","stroke","stroke-width"],ut=["x1","x2","y1","y2","stroke","stroke-width"],rt=["x","y","font-size","fill","font-weight"],st=["text-anchor","font-size","fill","transform"],ct=["x1","y1","x2","y2","stroke","stroke-width"],it={key:1},dt=["cx","cy","r","fill"],vt={key:0},ht={key:0},yt=["d","stroke"],mt=["text-anchor","x","y","fill"],ft=["cx","cy","r","fill"],gt={key:0},pt=["cx","cy","fill"],kt={key:1},bt=["d","fill","stroke"],xt={key:2},Bt=["d","fill","stroke"],Ct=["x","y","font-size","fill"],_t=["x","y","width","fill","onClick"],Et=["x","y","width","height","onMouseenter","onClick"],Nt={key:4,"data-cy-zoom":"",class:"vue-ui-donut-evolution-dialog"},wt=["x","y","width","height","fill"],St=["x1","y1","x2","y2","stroke"],Lt=["x1","y2","x2","y1","stroke"],zt=["cx","cy","r"],Vt=["d","stroke"],At=["cx","cy","r","fill"],$t=["d","fill","stroke"],Dt={class:"vue-ui-donut-evolution-focus"},Ft=["text-anchor","x","y","fill"],Pt=["cx","cy","r","fill"],It=["cx","cy","r","fill"],Ot=["x","y","fill"],Tt=["x","y","font-size","fill"],Ht={key:5,class:"vue-data-ui-watermark"},Rt=["onClick"],Mt={key:0},Ut={key:1},qt={key:9,ref:"source",dir:"auto"},Wt={key:0},Xt={key:1},Gt={__name:"vue-ui-donut-evolution",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(be,{expose:xe,emit:Be}){const{vue_ui_donut_evolution:Ce}=r.useConfig(),y=be,$=e.computed(()=>!!y.dataset&&y.dataset.length),i=e.ref({start:0,end:Math.max(...y.dataset.map(o=>o.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(_e(t.value.style.chart.zoom.endIndex+1)))):(i.value={start:0,end:E.value},Y.value+=1)}function _e(o){const a=E.value;return o>a?a: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(()=>{X()});function X(){r.objectIsEmpty(y.dataset)?r.error({componentName:"VueUiDonutEvolution",type:"dataset"}):y.dataset.length&&y.dataset.forEach((o,a)=>{r.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","values"]}).forEach(l=>{r.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:l,index:a})})}),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),Ee=e.ref(null),j=e.ref(0),Y=e.ref(0),K=e.ref(0),Z=e.ref(0),J=e.ref(0),Q=Be,t=e.computed({get:()=>oe(),set:o=>o}),{userOptionsVisible:I,setUserOptionsVisibility:ee,keepUserOptionState:te}=Me.useUserOptionState({config:t.value}),{svgRef:le}=Ue.useChartAccessibility({config:t.value.style.chart.title});function oe(){const o=ke.useNestedProp({userConfig:y.config,defaultConfig:Ce});let a={};return o.theme?a={...ke.useNestedProp({userConfig:r.themes.vue_ui_donut_evolution[o.theme]||y.config,defaultConfig:o}),customPalette:r.themePalettes[o.theme]||r.palette}:a=o,y.config&&r.hasDeepProperty(y.config,"style.chart.zoom.startIndex")?a.style.chart.zoom.startIndex=y.config.style.chart.zoom.startIndex:a.style.chart.zoom.startIndex=null,y.config&&r.hasDeepProperty(y.config,"style.chart.zoom.endIndex")?a.style.chart.zoom.endIndex=y.config.style.chart.zoom.endIndex:a.style.chart.zoom.endIndex=null,a}e.watch(()=>y.config,o=>{t.value=oe(),I.value=!t.value.userOptions.showOnChartHover,X(),K.value+=1,Z.value+=1,J.value+=1,z.value.showTable=t.value.table.show},{deep:!0}),e.watch(()=>y.dataset,o=>{q()},{deep:!0});const{isPrinting:ae,isImaging:ne,generatePdf:ue,generateImage:re}=pe.usePrinter({elementId:_.value,fileName:t.value.style.chart.title.text||"vue-ui-donut-evolution"}),Ne=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),we=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 o=t.value.style.chart.layout.height,a=t.value.style.chart.layout.width,l=o-u.value.top-u.value.bottom,s=a-u.value.left-u.value.right;return{absoluteHeight:o,absoluteWidth:a,centerX:u.value.left+s/2,centerY:u.value.top+l/2,height:l,width:s}}),C=e.computed(()=>(y.dataset.forEach((o,a)=>{[null,void 0].includes(o.name)&&r.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:"name",index:a}),[null,void 0].includes(o.values)&&r.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:"values",index:a})}),y.dataset.map((o,a)=>({...o,values:r.sanitizeArray(o.values),color:r.convertColorToHex(o.color)||we.value[a]||r.palette[a]||r.palette[a%r.palette.length],length:(o.values||[]).length,uid:r.createUid()})))),V=e.computed(()=>C.value.filter(o=>!m.value.includes(o.uid)).map(o=>({...o,values:o.values.filter((a,l)=>l>=i.value.start&&l<=i.value.end)}))),E=e.computed(()=>Math.max(...V.value.map(o=>o.length))),g=e.computed(()=>c.value.width/(i.value.end-i.value.start)),f=e.computed(()=>{const o=[];for(let n=0;n<i.value.end-i.value.start;n+=1){const v=V.value.map(B=>B.values[n]??null),d=v.filter(B=>[void 0,null].includes(B)).length===v.length,x=v.reduce((B,p)=>B+p,0),U=v.map(B=>B/x),L=u.value.left+g.value*n+g.value/2;o.push({index:n,percentages:U,subtotal:d||x<0?null:x,values:v,x:L})}const a=0,l=Math.max(...o.map(n=>n.subtotal)),s=o.length===1?l*2:l;return o.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=o.length>4?d*2:d*2>g.value/2*.7?g.value/2*.7:d*2,B=c.value.absoluteHeight-u.value.bottom-c.value.height*n.subtotal/r.calculateNiceScale(a,s,t.value.style.chart.layout.grid.yAxis.dataLabels.steps).max;return{...n,y:B,radius:x,activeRadius:U,hoverRadius:L,donut:r.makeDonut({series:V.value.map((p,ge)=>({color:p.color,name:p.name,value:p.values[v]??0}))},n.x,B,x,x,1.99999,2,1,360,105.25,x/2),donutHover:r.makeDonut({series:V.value.map((p,ge)=>({color:p.color,name:p.name,value:p.values[v]??0}))},n.x,B,L,L,1.99999,2,1,360,105.25,L/2),donutFocus:r.makeDonut({series:V.value.map((p,ge)=>({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(o,a,l){return r.applyDataLabel(t.value.style.chart.layout.dataLabels.formatter,o,r.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:a,index:l})}const O=e.computed(()=>({max:Math.max(...f.value.map(o=>o.subtotal)),min:0})),w=e.computed(()=>{const o=f.value.length===1?O.value.max*2:O.value.max;return r.calculateNiceScale(O.value.min,o,t.value.style.chart.layout.grid.yAxis.dataLabels.steps)});function Se(o){return o/w.value.max}const Le=e.computed(()=>w.value.ticks.map(o=>({y:c.value.absoluteHeight-u.value.bottom-c.value.height*Se(o),value:o})));function se(o,a){return isNaN(o.value/r.sumByAttribute(a,"value"))?0:(o.value/r.sumByAttribute(a,"value")*100).toFixed(0)+"%"}function ce(){k.value||(h.value=null,P.value=null)}function ze(o){k.value||(h.value=o.index,P.value=o)}const T=e.ref(null);function H(o,a){o.subtotal&&(P.value=null,h.value=null,k.value=!0,b.value=o,[null,void 0].includes(a)||(T.value=a))}function ie(){b.value=null,k.value=!1,T.value=null}const de=e.computed(()=>C.value.map((o,a)=>({name:o.name,value:o.values.slice(i.value.start,i.value.end).reduce((l,s)=>l+s,0),shape:"circle",uid:o.uid,color:o.color})).sort((o,a)=>a.value-o.value).map(o=>({...o,opacity:m.value.includes(o.uid)?.5:1,segregate:()=>R(o.uid),isSegregated:m.value.includes(o.uid)}))),ve=e.computed(()=>f.value.map(o=>o.subtotal).reduce((o,a)=>o+a,0)),Ve=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 R(o){if(m.value.includes(o))m.value=m.value.filter(a=>a!==o),Q("selectLegend",null);else{if(m.value.length===C.value.length-1)return;m.value.push(o),Q("selectLegend",C.value.find(a=>a.uid===o))}b.value&&H(f.value.find((a,l)=>l===T.value))}const S=e.computed(()=>{const o=[""].concat(C.value.filter(n=>!m.value.includes(n.uid)).map(n=>({name:n.name,color:n.color}))).concat(["Σ"]);let a=[];for(let n=0;n<E.value;n+=1){const v=C.value.filter(d=>!m.value.includes(d.uid)).map(d=>d.values[n]??0).reduce((d,x)=>d+x,0);a.push([t.value.style.chart.layout.grid.xAxis.dataLabels.values[n]??"-"].concat(C.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(C.value.filter(n=>!m.value.includes(n.uid)).map(n=>n.name)).concat(t.value.table.columnNames.total);return{head:o,body:a,config:l,colNames:s}});function Ae(){return C.value}function he(){e.nextTick(()=>{const o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],a=[...S.value.head.map(v=>v.name??v)],l=[...S.value.body.map(v=>v.map(d=>d.value??d))],s=o.concat([a]).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 $e(o){A.value=o,j.value+=1}function ye(){z.value.showTable=!z.value.showTable}const F=e.ref(!1);function M(){F.value=!F.value}function me(o){return o.proportion*100>t.value.style.chart.donuts.hover.hideLabelsUnderValue}function fe(o){return o.proportion*100>t.value.style.chart.donuts.zoom.hideLabelsUnderValue}return xe({getData:Ae,generatePdf:ue,generateCsv:he,generateImage:re,toggleTable:ye,toggleAnnotator:M}),(o,a)=>(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:a[4]||(a[4]=()=>e.unref(ee)(!0)),onMouseleave:a[5]||(a[5]=()=>e.unref(ee)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Re.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),Ne.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:Ee,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(De._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(pe.UserOptions,{ref:"details",key:`user_options_${j.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(ae),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:$e,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},[o.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:l,color:s})=>[e.renderSlot(o.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:l,color:s})),void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:s})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:s})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:s})=>[e.renderSlot(o.$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(He._sfc_main),o.$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(o.$slots,"chart-background",{},void 0,!0)],8,Ge)):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,Ye),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,Ke)],8,je),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,Je),e.createElementVNode("stop",{offset:"77%","stop-color":e.unref(r.setOpacity)("#FFFFFF",30)},null,8,Qe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.setOpacity)(e.unref(r.convertColorToHex)(t.value.style.chart.backgroundColor),0)},null,8,et)],8,Ze)]),t.value.style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",tt,[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,lt),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,ot),t.value.style.chart.layout.grid.showVerticalLines?(e.openBlock(),e.createElementBlock("g",at,[(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,nt))),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(Le.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,ut)):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,rt)):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,st)):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,ct)):e.createCommentVNode("",!0),l.subtotal!==null?(e.openBlock(),e.createElementBlock("g",it,[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,dt)):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",vt,[h.value!==null&&h.value===s?(e.openBlock(),e.createElementBlock("g",ht,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donutHover,n=>(e.openBlock(),e.createElementBlock("g",null,[me(n)?(e.openBlock(),e.createElementBlock("path",{key:0,d:e.unref(r.calcNutArrowPath)(n,{x:n.center.endX,y:n.center.endY},12,12,{x:l.x,y:l.y},!1,20),stroke:n.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,yt)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donutHover,(n,v)=>(e.openBlock(),e.createElementBlock("g",null,[me(n)?(e.openBlock(),e.createElementBlock("text",{key:0,"data-cy-hover-label":"","text-anchor":e.unref(r.calcMarkerOffsetX)(n,!0,0).anchor,x:e.unref(r.calcMarkerOffsetX)(n,!0,9).x,y:e.unref(r.calcMarkerOffsetY)(n,14,10),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,mt)):e.createCommentVNode("",!0)]))),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,ft)])])):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",gt,[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,pt)):h.value!==null&&h.value===s?(e.openBlock(),e.createElementBlock("g",kt,[(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,bt))),256))])):(e.openBlock(),e.createElementBlock("g",xt,[(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,Ct)):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=>H(l,s),class:e.normalizeClass({"donut-hover":h.value===l.index&&l.subtotal})},null,10,_t))),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=>ze(l),onMouseleave:ce,onClick:n=>H(l,s),class:e.normalizeClass({"donut-hover":h.value===l.index&&l.subtotal})},null,42,Et))),256)),k.value?(e.openBlock(),e.createElementBlock("g",Nt,[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,wt),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,St),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,Lt),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,zt),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.donutFocus,l=>(e.openBlock(),e.createElementBlock("g",null,[fe(l)?(e.openBlock(),e.createElementBlock("path",{key:0,"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,Vt)):e.createCommentVNode("",!0)]))),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,At),(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,$t))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.donutFocus,(l,s)=>(e.openBlock(),e.createElementBlock("g",Dt,[fe(l)?(e.openBlock(),e.createElementBlock("text",{key:0,"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,Ft)):e.createCommentVNode("",!0)]))),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,Pt),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,It),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,Ot),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,Tt)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:c.value},void 0,!0)],14,Xe)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ht,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(ae)||e.unref(ne)})),void 0,!0)])):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ie.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(Oe.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":a[0]||(a[0]=l=>i.value.start=l),end:i.value.end,"onUpdate:end":a[1]||(a[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(o.$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(Pe.Legend,{key:`legend_${J.value}`,legendSet:de.value,config:Ve.value,onClickMarker:a[2]||(a[2]=({legend:l})=>R(l.uid))},{item:e.withCtx(({legend:l,index:s})=>[e.createElementVNode("div",{onClick:n=>R(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",Ut," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Mt," ("+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,Rt)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"legend",{legend:de.value},void 0,!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",qt,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createBlock(Te.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(Fe.DataTable,{key:`table_${Z.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:a[3]||(a[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",Wt,"-")):(e.openBlock(),e.createElementBlock("b",Xt,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,We))}},jt=qe._export_sfc(Gt,[["__scopeId","data-v-0880a0ca"]]);exports.default=jt;
;