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