vue-data-ui-hq
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
6 lines (5 loc) • 22.2 kB
JavaScript
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-ZfICPrrM.cjs"),re=require("./useResponsive-BJ7DTGpm.cjs"),Ce=require("./Title-FbHK83tB.cjs"),ne=require("./usePrinter-B-gh2f22.cjs"),$e=require("./Legend-HgHPyA_4.cjs"),xe=require("./DataTable-CC6dPSer.cjs"),Be=require("./Tooltip-C7TJODUx.cjs"),Te=require("./vue-ui-skeleton-Bvmpr51u.cjs"),Se=require("./vue-ui-accordion-Dp6uTsJi.cjs"),oe=require("./useNestedProp-C14rfl0j.cjs"),Pe=require("./PackageVersion-D3dK8oA3.cjs"),Oe=require("./PenAndPaper-PL3bp4ud.cjs"),Ne=require("./useUserOptionState-BgepsfED.cjs"),_e=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ve=["id"],Ee=["xmlns","viewBox"],Fe=["width","height"],Ae=["cx","cy","r","stroke","stroke-width","stroke-dasharray","stroke-dashoffset"],Ie=["cx","cy","r","stroke","stroke-width","stroke-dasharray","stroke-dashoffset"],Me=["id"],Le=["stdDeviation"],Re=["filter"],ze=["cx","cy","r","stroke-width","stroke-dasharray","stroke-dashoffset"],De=["cx","cy","r","stroke-width","stroke-dasharray","stroke-dashoffset","onMouseenter"],qe={key:2},Ue=["onMouseenter"],Ye=["x","y","font-size","fill","font-weight"],Xe={key:5,class:"vue-data-ui-watermark"},Ge=["onClick"],He=["innerHTML"],je={__name:"vue-ui-onion",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(le,{expose:ae,emit:ue}){const{vue_ui_onion:se}=u.useConfig(),p=le,C=e.computed(()=>!!p.dataset&&p.dataset.length),m=e.ref(u.createUid()),ie=e.ref(null),A=e.ref(0),$=e.ref(!1),S=e.ref(""),d=e.ref([]),y=e.ref(null),I=e.ref(null),M=e.ref(null),L=e.ref(null),R=e.ref(null),z=e.ref(0),D=e.ref(0),q=e.ref(0),t=e.computed({get:()=>X(),set:r=>r}),{userOptionsVisible:P,setUserOptionsVisibility:U,keepUserOptionState:Y}=Ne.useUserOptionState({config:t.value});function X(){const r=oe.useNestedProp({userConfig:p.config,defaultConfig:se});return r.theme?{...oe.useNestedProp({userConfig:u.themes.vue_ui_onion[r.theme]||p.config,defaultConfig:r}),customPalette:u.themePalettes[r.theme]||u.palette}:r}e.watch(()=>p.config,r=>{t.value=X(),P.value=!t.value.showOnChartHover,J(),z.value+=1,D.value+=1,q.value+=1},{deep:!0});const{isPrinting:G,isImaging:H,generatePdf:j,generateImage:W}=ne.usePrinter({elementId:`vue-ui-onion_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-onion"}),ce=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),de=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),g=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),a=e.ref({height:512,width:512,padding:{top:64,left:64,right:64,bottom:64},minRadius:64}),x=e.ref(null);e.onMounted(()=>{J()});function J(){if(u.objectIsEmpty(p.dataset)&&u.error({componentName:"VueUiOnion",type:"dataset"}),t.value.responsive){const l=re.throttle(()=>{const{width:n,height:o}=re.useResponsive({chart:y.value,title:t.value.style.chart.title.text?I.value:null,legend:t.value.style.chart.legend.show?M.value:null,source:L.value,noTitle:R.value});a.value.width=n,a.value.height=o,a.value.padding.top=Math.max(n,o)*.125,a.value.padding.right=Math.max(n,o)*.125,a.value.padding.bottom=Math.max(n,o)*.125,a.value.padding.left=Math.max(n,o)*.125,a.value.minRadius=Math.min(n,o)*.125});x.value=new ResizeObserver(l),x.value.observe(y.value.parentNode)}}e.onBeforeUnmount(()=>{x.value&&x.value.disconnect()});const s=e.computed(()=>({top:a.value.padding.top,left:a.value.padding.left,right:a.value.width-a.value.padding.right,bottom:a.value.height-a.value.padding.bottom,centerX:a.value.width/2,centerY:a.value.height/2,width:a.value.width-a.value.padding.right-a.value.padding.left,height:a.value.height-a.value.padding.bottom-a.value.padding.top,minRadius:a.value.minRadius,maxRadius:Math.min(a.value.width,a.value.height)-a.value.padding.top*2})),i=e.computed(()=>(p.dataset.forEach((r,l)=>{[null,void 0].includes(r.name)&&u.error({componentName:"VueUiOnion",type:"datasetSerieAttribute",property:"name",index:l}),[void 0].includes(r.percentage)&&u.error({componentName:"VueUiOnion",type:"datasetSerieAttribute",property:"percentage",index:l})}),p.dataset.map((r,l)=>{const n=`onion_serie_${l}_${m.value}`;return{...r,percentage:r.percentage||0,targetPercentage:r.percentage||0,color:u.convertColorToHex(r.color)||de.value[l]||u.palette[l],id:n,shape:"circle",opacity:d.value.includes(n)?.5:1,absoluteIndex:l,segregate:()=>K(n),isSegregated:d.value.includes(n)}}))),b=e.ref(i.value),fe=e.computed(()=>t.value.useStartAnimation),he=e.ref(null),pe=e.computed(()=>Math.max(...i.value.map(r=>r.percentage))),O=e.ref(!1);e.watch(()=>i.value,ge,{immediate:!0});function ge(){if(fe.value&&!O.value){let l=function(){r>=pe.value?(cancelAnimationFrame(he.value),b.value=i.value,O.value=!0):(b.value=i.value.map(n=>({...n,percentage:r<n.targetPercentage?r:n.targetPercentage})),r+=1,requestAnimationFrame(l),O.value=!0)};b.value=i.value.map(n=>({...n,percentage:0}));let r=0;l()}else b.value=i.value}const ve=e.computed(()=>({cy:"onion-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),me=e.computed(()=>i.value.filter(r=>!d.value.includes(r.id)).length),v=e.computed(()=>{const r=Math.min(s.value.width,s.value.height)/2/i.value.length;return{gutter:(r>t.value.style.chart.layout.maxThickness?t.value.style.chart.layout.maxThickness:r)*t.value.style.chart.layout.gutter.width,track:(r>t.value.style.chart.layout.maxThickness?t.value.style.chart.layout.maxThickness:r)*t.value.style.chart.layout.track.width}}),f=e.computed(()=>b.value.filter(r=>!d.value.includes(r.id)).map((r,l)=>{const n=(s.value.maxRadius-v.value.track)/me.value/2*(1+l),o=s.value.centerY-n;return{percentage:r.percentage||0,...r,labelY:o,radius:n,path:ye(n,r.percentage||0)}}));function ye(r,l){const n=2*Math.PI*r,o=n*.75,c=`${o} ${n}`,w=o*(1-l/100);return{bgDashArray:`${o} ${n}`,bgDashOffset:0,dashArray:c,dashOffset:w,fullOffset:0,active:`
M ${s.value.centerX},${s.value.centerY-r}
A ${r},${r} 0 1 1
${s.value.centerX+r*Math.cos(Math.PI*3/4)},${s.value.centerY+r*Math.sin(Math.PI*3/4)}
`.trim()}}const ke=ue;function K(r){d.value.includes(r)?d.value=d.value.filter(l=>l!==r):d.value.push(r),ke("selectLegend",f.value)}function be(){return f.value}const N=e.computed(()=>{const r=[t.value.table.translations.serie,t.value.table.translations.percentage,t.value.table.translations.value],l=f.value.map(n=>[n.name,n.percentage,n.value]);return{head:r,body:l}}),B=e.computed(()=>{const r=N.value.head,l=f.value.map(o=>[`<span style="color:${o.color}">⬤</span> ${o.name}`,`${Number(o.percentage??0).toFixed(t.value.table.td.roundingPercentage).toLocaleString()}%`,`${o.prefix||""}${[null,void 0,NaN,"NaN"].includes(o.value)?"-":o.value.toFixed(t.value.table.td.roundingValue).toLocaleString()}${o.suffix||""}`]),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};return{head:r,body:l,config:n,colNames:r}});function Q(){e.nextTick(()=>{const r=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],l=N.value.head,n=N.value.body,o=r.concat([l]).concat(n),c=u.createCsvContent(o);u.downloadCsv({csvContent:c,title:t.value.style.chart.title.text||"vue-ui-onion"})})}const h=e.ref(void 0),k=e.ref(!1);function we(r){k.value=r,A.value+=1}const _=e.ref(null);function Z({datapoint:r,seriesIndex:l,show:n=!0}){const o=r.absoluteIndex;h.value=l,_.value={datapoint:r,seriesIndex:o,series:i.value,config:t.value},$.value=n;let c="";const w=t.value.style.chart.tooltip.customFormat;if(u.isFunction(w)&&u.functionReturnsString(()=>w({seriesIndex:o,datapoint:r,series:i.value,config:t.value})))S.value=w({seriesIndex:o,datapoint:r,series:i.value,config:t.value});else{const E=t.value.style.chart.tooltip.showPercentage,F=t.value.style.chart.tooltip.showValue;c+=`<div style="width: 100%; border-bottom: 1px solid ${t.value.style.chart.tooltip.borderColor}; padding-bottom: 6px;margin-bottom:3px;display:flex;flex-direction:row;gap:3px;align-items:center"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${r.color}"/></svg><span></span>${r.name}</span></div>`,c+=`<div style="width:100%;text-align:left;"><b>${E?u.dataLabel({p:"",v:r.percentage,s:"%",r:t.value.style.chart.tooltip.roundingPercentage}):""}</b> ${E&&F?"(":""}${F?u.applyDataLabel(t.value.style.chart.layout.labels.value.formatter,r.value,u.dataLabel({p:r.prefix||"",v:r.value,s:r.suffix||"",r:t.value.style.chart.tooltip.roundingValue}),{datapoint:r,seriesIndex:l}):""}${E&&F?")":""}</div>`,S.value=`<div>${c}</div>`}}function ee(){g.value.showTable=!g.value.showTable}function te(){g.value.showTooltip=!g.value.showTooltip}const T=e.ref(!1);function V(){T.value=!T.value}return ae({getData:be,generatePdf:j,generateCsv:Q,generateImage:W,toggleTable:ee,toggleTooltip:te,toggleAnnotator:V}),(r,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-onion ${e.unref(k)?"vue-data-ui-wrapper-fullscreen":""} ${e.unref(t).useCssAnimation?"":"vue-ui-dna"}`),ref_key:"onionChart",ref:y,id:`vue-ui-onion_${e.unref(m)}`,style:e.normalizeStyle(`font-family:${e.unref(t).style.fontFamily};width:100%; ${e.unref(t).responsive?"height: 100%;":""} text-align:center;background:${e.unref(t).style.chart.backgroundColor}`),onMouseenter:l[4]||(l[4]=()=>e.unref(U)(!0)),onMouseleave:l[5]||(l[5]=()=>e.unref(U)(!1))},[e.unref(t).userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Oe.PenAndPaper,{key:0,parent:e.unref(y),backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color,active:e.unref(T),onClose:V},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),e.unref(ce)?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:R,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,ref_key:"chartTitle",ref:I,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(Ce._sfc_main,{key:`title_${e.unref(z)}`,config:{title:{cy:"onion-div-title",...e.unref(t).style.chart.title},subtitle:{cy:"onion-div-subtitle",...e.unref(t).style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),e.unref(t).userOptions.show&&e.unref(C)&&(e.unref(Y)||e.unref(P))?(e.openBlock(),e.createBlock(ne.UserOptions,{ref_key:"details",ref:ie,key:`user_options${e.unref(A)}`,backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color,isImaging:e.unref(H),isPrinting:e.unref(G),uid:e.unref(m),hasTooltip:e.unref(t).userOptions.buttons.tooltip&&e.unref(t).style.chart.tooltip.show,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(k),isTooltip:e.unref(g).showTooltip,titles:{...e.unref(t).userOptions.buttonTitles},chartElement:e.unref(y),position:e.unref(t).userOptions.position,hasAnnotator:e.unref(t).userOptions.buttons.annotator,isAnnotation:e.unref(T),onToggleFullscreen:we,onGeneratePdf:e.unref(j),onGenerateCsv:Q,onGenerateImage:e.unref(W),onToggleTable:ee,onToggleTooltip:te,onToggleAnnotator:V,style:e.normalizeStyle({visibility:e.unref(Y)?e.unref(P)?"visible":"hidden":"visible"})},e.createSlots({_:2},[r.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,r.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,r.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,r.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,r.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,r.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:n,isFullscreen:o})=>[e.renderSlot(r.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:n,isFullscreen:o})),void 0,!0)]),key:"5"}:void 0,r.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:n,isAnnotator:o})=>[e.renderSlot(r.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:n,isAnnotator:o})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),e.unref(C)?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(u.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":e.unref(k),"vue-data-ui-fulscreen--off":!e.unref(k)}),viewBox:`0 0 ${e.unref(a).width<=0?10:e.unref(a).width} ${e.unref(a).height<=0?10:e.unref(a).height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${e.unref(t).style.chart.color}`)},[e.createVNode(Pe._sfc_main),r.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:e.unref(a).width<=0?10:e.unref(a).width,height:e.unref(a).height<=0?10:e.unref(a).height,style:{pointerEvents:"none"}},[e.renderSlot(r.$slots,"chart-background",{},void 0,!0)],8,Fe)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f),(n,o)=>(e.openBlock(),e.createElementBlock("circle",{cx:e.unref(s).centerX,cy:e.unref(s).centerY,r:n.radius<=0?1e-4:n.radius,stroke:e.unref(t).style.chart.layout.gutter.color,"stroke-width":e.unref(v).gutter,fill:"none","stroke-dasharray":n.path.bgDashArray,"stroke-dashoffset":n.path.fullOffset,"stroke-linecap":"round",class:e.normalizeClass({"vue-ui-onion-path":!0,"vue-ui-onion-blur":e.unref(t).useBlurOnHover&&![null,void 0].includes(e.unref(h))&&e.unref(h)!==o}),style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,10,Ae))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f),(n,o)=>(e.openBlock(),e.createElementBlock("circle",{cx:e.unref(s).centerX,cy:e.unref(s).centerY,r:n.radius<0?1e-4:n.radius,stroke:`${n.color}`,"stroke-width":e.unref(v).track,fill:"none","stroke-dasharray":n.path.dashArray,"stroke-dashoffset":n.path.dashOffset,class:e.normalizeClass({"vue-ui-onion-path":!0,"vue-ui-onion-blur":e.unref(t).useBlurOnHover&&![null,void 0].includes(e.unref(h))&&e.unref(h)!==o}),"stroke-linecap":"round",style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,10,Ie))),256)),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${e.unref(m)}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/e.unref(t).style.chart.gradientIntensity},null,8,Le)],8,Me)]),e.unref(t).style.chart.useGradient?(e.openBlock(),e.createElementBlock("g",{key:1,filter:`url(#blur_${e.unref(m)})`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f),(n,o)=>(e.openBlock(),e.createElementBlock("circle",{cx:e.unref(s).centerX,cy:e.unref(s).centerY,r:n.radius<=0?1e-4:n.radius,stroke:"white","stroke-width":e.unref(v).track/3,fill:"none","stroke-linecap":"round","stroke-dasharray":n.path.dashArray,"stroke-dashoffset":n.path.dashOffset,style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,8,ze))),256))],8,Re)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f),(n,o)=>(e.openBlock(),e.createElementBlock("circle",{"data-cy-trap":"",cx:e.unref(s).centerX,cy:e.unref(s).centerY,r:n.radius<=0?1e-4:n.radius,stroke:"transparent","stroke-width":Math.max(e.unref(v).track,e.unref(v).gutter),fill:"none","stroke-dasharray":n.path.bgDashArray,"stroke-dashoffset":n.path.fullOffset,"stroke-linecap":"round",class:"vue-ui-onion-path",style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"},onMouseenter:c=>Z({datapoint:n,show:!0,seriesIndex:o}),onMouseleave:l[0]||(l[0]=c=>{h.value=void 0,$.value=!1})},null,40,De))),256)),e.unref(t).style.chart.layout.labels.show?(e.openBlock(),e.createElementBlock("g",qe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f),(n,o)=>(e.openBlock(),e.createElementBlock("g",{onMouseenter:c=>Z({datapoint:n,show:!0,seriesIndex:o}),onMouseleave:l[1]||(l[1]=c=>{h.value=void 0,$.value=!1})},[e.unref(d).includes(n.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("text",{key:0,x:e.unref(a).width/2-e.unref(v).gutter*.8+e.unref(t).style.chart.layout.labels.offsetX,y:n.labelY+e.unref(t).style.chart.layout.labels.offsetY,"text-anchor":"end","font-size":e.unref(t).style.chart.layout.labels.fontSize,fill:e.unref(t).useBlurOnHover&&![null,void 0].includes(e.unref(h))&&e.unref(h)===o?n.color:e.unref(t).style.chart.layout.labels.color,"font-weight":e.unref(t).style.chart.layout.labels.bold?"bold":"normal"},e.toDisplayString(n.name?n.name+": ":"")+" "+e.toDisplayString(e.unref(t).style.chart.layout.labels.percentage.show?e.unref(u.dataLabel)({v:n.percentage,s:"%",r:e.unref(t).style.chart.layout.labels.roundingPercentage}):"")+" "+e.toDisplayString(!e.unref(t).style.chart.layout.labels.percentage.show&&e.unref(t).style.chart.layout.labels.value.show?`: ${e.unref(u.applyDataLabel)(e.unref(t).style.chart.layout.labels.value.formatter,n.value,e.unref(u.dataLabel)({p:n.prefix||"",v:n.value||0,s:n.suffix||"",r:e.unref(t).style.chart.layout.labels.roundingValue}),{datapoint:n,seriesIndex:o})}`:`${e.unref(t).style.chart.layout.labels.value.show&&n.value?`(${e.unref(u.applyDataLabel)(e.unref(t).style.chart.layout.labels.value.formatter,n.value,e.unref(u.dataLabel)({p:n.prefix||"",v:n.value||0,s:n.suffix||"",r:e.unref(t).style.chart.layout.labels.roundingValue}),{datapoint:n,seriesIndex:o})})`:""}`),9,Ye))],40,Ue))),256))])):e.createCommentVNode("",!0),e.renderSlot(r.$slots,"svg",{svg:e.unref(a)},void 0,!0)],14,Ee)):e.createCommentVNode("",!0),r.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Xe,[e.renderSlot(r.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(G)||e.unref(H)})),void 0,!0)])):e.createCommentVNode("",!0),e.unref(C)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Te.default,{key:6,config:{type:"onion",style:{backgroundColor:e.unref(t).style.chart.backgroundColor,onion:{color:e.unref(t).style.chart.layout.gutter.color}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:M},[e.unref(t).style.chart.legend.show?(e.openBlock(),e.createBlock($e.Legend,{key:`legend_${e.unref(q)}`,legendSet:e.unref(i),config:e.unref(ve),onClickMarker:l[2]||(l[2]=({legend:n})=>K(n.id))},{item:e.withCtx(({legend:n})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:o=>n.segregate(),style:e.normalizeStyle(`opacity:${e.unref(d).includes(n.id)?.5:1}`)},e.toDisplayString(n.name?n.name+": ":"")+" "+e.toDisplayString((n.percentage||0).toFixed(e.unref(t).style.chart.legend.roundingPercentage))+"% ",13,Ge)]),_:1},8,["legendSet","config"])):e.renderSlot(r.$slots,"legend",{key:1,legend:e.unref(i)},void 0,!0)],512),r.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:L,dir:"auto"},[e.renderSlot(r.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Be._sfc_main,{show:e.unref(g).showTooltip&&e.unref($),backgroundColor:e.unref(t).style.chart.tooltip.backgroundColor,color:e.unref(t).style.chart.tooltip.color,borderRadius:e.unref(t).style.chart.tooltip.borderRadius,borderColor:e.unref(t).style.chart.tooltip.borderColor,borderWidth:e.unref(t).style.chart.tooltip.borderWidth,fontSize:e.unref(t).style.chart.tooltip.fontSize,backgroundOpacity:e.unref(t).style.chart.tooltip.backgroundOpacity,position:e.unref(t).style.chart.tooltip.position,offsetY:e.unref(t).style.chart.tooltip.offsetY,parent:e.unref(y),content:e.unref(S),isFullscreen:e.unref(k),isCustom:e.unref(u.isFunction)(e.unref(t).style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(r.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...e.unref(_)})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(r.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...e.unref(_)})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),e.unref(C)?(e.openBlock(),e.createBlock(Se.default,{key:8,hideDetails:"",config:{open:e.unref(g).showTable,maxHeight:1e4,head:{backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color},body:{backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(xe.DataTable,{key:`table_${e.unref(D)}`,colNames:e.unref(B).colNames,head:e.unref(B).head,body:e.unref(B).body,config:e.unref(B).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(g).showTable=!1)},{th:e.withCtx(({th:n})=>[e.createTextVNode(e.toDisplayString(n),1)]),td:e.withCtx(({td:n})=>[e.createElementVNode("div",{innerHTML:n},null,8,He)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Ve))}},We=_e._export_sfc(je,[["__scopeId","data-v-60ee16cc"]]);exports.default=We;
;