vue-data-ui
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
3 lines (2 loc) • 22 kB
JavaScript
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-CtzlfT2i.cjs"),oe=require("./useResponsive-N8jl0-aC.cjs"),Ce=require("./Title-BGQhFU2C.cjs"),ae=require("./usePrinter-LlH3giBA.cjs"),we=require("./Tooltip-CnSZ7sO1.cjs"),$e=require("./DataTable-DhEDo7W6.cjs"),Ne=require("./Legend-2PWaf6Bj.cjs"),Te=require("./vue-ui-skeleton-MFudy6Nx.cjs"),xe=require("./vue-ui-accordion-tUPDXqYS.cjs"),re=require("./useNestedProp-B5jFEsaz.cjs"),Se=require("./PackageVersion-DdCp9lqS.cjs"),Be=require("./PenAndPaper-4dibNTrE.cjs"),_e=require("./useUserOptionState-BgepsfED.cjs"),Pe=require("./Shape-Ba8jxKwR.cjs"),Ve=require("./useChartAccessibility-Cm7nkzTG.cjs"),Le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ee=["id"],Oe=["xmlns","viewBox"],Ie=["width","height"],Ae=["id"],ze=["stop-color"],Fe=["stop-color"],Re={key:1},qe=["stroke","cx","cy","r","fill"],Me=["stroke","stroke-width","cx","cy","r","fill"],Ue=["stroke","stroke-width","cx","cy","r","fill"],De=["cx","cy","r","onMouseenter"],We={key:5,class:"vue-data-ui-watermark"},He=["onClick"],Ge={key:0},je={key:1},Xe=["innerHTML"],Ye={__name:"vue-ui-rings",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(ne,{expose:se,emit:ue}){const{vue_ui_rings:ie}=n.useConfig(),ce=e.useSlots(),p=ne,b=e.ref(!1),$=e.computed(()=>!!p.dataset&&p.dataset.length),g=e.ref(n.createUid()),de=e.ref(null),N=e.ref(!1),_=e.ref(""),m=e.ref(null),O=e.ref(0),C=e.ref(null),I=e.ref(null),A=e.ref(null),z=e.ref(null),F=e.ref(null),R=e.ref(0),q=e.ref(0),M=e.ref(0),t=e.computed({get:()=>H(),set:l=>l}),{userOptionsVisible:P,setUserOptionsVisibility:U,keepUserOptionState:D}=_e.useUserOptionState({config:t.value}),{svgRef:W}=Ve.useChartAccessibility({config:t.value.style.chart.title});function H(){const l=re.useNestedProp({userConfig:p.config,defaultConfig:ie});return l.theme?{...re.useNestedProp({userConfig:n.themes.vue_ui_rings[l.theme]||p.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}e.watch(()=>p.config,l=>{t.value=H(),P.value=!t.value.userOptions.showOnChartHover,G(),R.value+=1,q.value+=1,M.value+=1,h.value.showTable=t.value.table.show,h.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0});const T=e.ref(null);e.onMounted(()=>{G()});function G(){if(n.objectIsEmpty(p.dataset)?n.error({componentName:"VueUiRings",type:"dataset"}):p.dataset.forEach((l,a)=>{l.values.length||n.error({componentName:"VueUiRings",type:"dataset"}),n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{n.error({componentName:"VueUiRings",type:"datasetSerieAttribute",property:o,index:a})})}),t.value.responsive){const l=oe.throttle(()=>{const{width:a,height:o}=oe.useResponsive({chart:C.value,title:t.value.style.chart.title.text?I.value:null,legend:t.value.style.chart.legend.show?A.value:null,source:z.value,noTitle:F.value});requestAnimationFrame(()=>{s.value.width=a,s.value.height=o})});T.value=new ResizeObserver(l),T.value.observe(C.value.parentNode)}setTimeout(()=>{b.value=!0},600)}e.onBeforeUnmount(()=>{T.value&&T.value.disconnect()});const{isPrinting:j,isImaging:X,generatePdf:Y,generateImage:J}=ae.usePrinter({elementId:`rings_${g.value}`,fileName:t.value.style.chart.title.text||"vue-ui-rings"}),ve=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),K=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),h=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),s=e.ref({height:360,width:360}),pe=e.computed(()=>Math.min(s.value.height,s.value.width)),he=ue,d=e.ref([]);function V(l){d.value.includes(l)?d.value=d.value.filter(a=>a!==l):d.value.push(l),he("selectLegend",c.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const fe=e.computed(()=>Math.max(...x.value.filter(l=>!d.value.includes(l.uid)).map(({value:l})=>l)));function Q(l){return l/fe.value}const x=e.computed(()=>p.dataset.map(({values:l,name:a,color:o=null},r)=>{const u=n.sanitizeArray(l).reduce((v,w)=>v+w,0);return{name:a,color:o||n.convertColorToHex(o)||K.value[r]||n.palette[r]||n.palette[r%n.palette.length],value:u,proportion:u/p.dataset.map(v=>(v.values||[]).reduce((w,ke)=>w+ke,0)).reduce((v,w)=>v+w,0),uid:n.createUid(),absoluteIndex:r}})),Z=e.computed(()=>x.value.map(l=>({...l,shape:"circle",opacity:d.value.includes(l.uid)?.5:1,segregate:()=>V(l.uid),isSegregated:d.value.includes(l.uid)})).toSorted((l,a)=>a.value-l.value)),ge=e.computed(()=>({cy:"rings-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":""})),f=e.computed(()=>x.value.filter(l=>!d.value.includes(l.uid)).map(({value:l})=>l).reduce((l,a)=>l+a,0)),c=e.computed(()=>x.value.filter(l=>!d.value.includes(l.uid)).map(({name:l,value:a,color:o=null,uid:r,absoluteIndex:u},v)=>({absoluteIndex:u,uid:r,name:l,color:o||n.convertColorToHex(o)||K.value[v]||n.palette[v]||n.palette[v%n.palette.length],value:a,proportion:Q(a),percentage:a/f.value*100,strokeWidth:t.value.style.chart.layout.rings.strokeWidth*Q(a)})).toSorted((l,a)=>a.value-l.value));function me(){return c.value.map(({name:l,color:a,value:o,absoluteValues:r,percentage:u})=>({name:l,color:a,value:o,absoluteValues:r,percentage:u}))}const i=e.computed(()=>pe.value-t.value.style.chart.layout.rings.strokeWidth*2),L=e.ref(null);function ye(l,a){if(d.value.length===p.dataset.length)return;L.value={datapoint:a,seriesIndex:l,series:c.value,config:t.value},m.value=l;const o=c.value[l],r=t.value.style.chart.tooltip.customFormat;if(n.isFunction(r)&&n.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:c.value,config:t.value})))_.value=r({seriesIndex:l,datapoint:a,series:c.value,config:t.value});else{let u="";u+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,u+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 60 60" height="14" width="14"><circle cx="30" cy="30" r="30" stroke="none" fill="${o.color}" />${ce.pattern?`<circle cx="30" cy="30" r="30" stroke="none" fill="url(#pattern_${g.value}_${a.absoluteIndex})" />`:""}</svg>`,t.value.style.chart.tooltip.showValue&&(u+=`<b>${n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:a,seriesIndex:l})}
</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?u+=`<span>(${n.dataLabel({v:o.value/f.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})})</span></div>`:u+=`<b>${n.dataLabel({v:o.value/f.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`),_.value=u}N.value=!0}const y=e.computed(()=>{const l=c.value.map(o=>({name:o.name,color:o.color})),a=c.value.map(o=>o.value);return{head:l,body:a}}),S=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:f.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],a=y.value.head.map((u,v)=>[{color:u.color,name:u.name},n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:y.value.body[v],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),isNaN(y.value.body[v]/f.value)?"-":(y.value.body[v]/f.value*100).toFixed(t.value.table.td.roundingPercentage)+"%"]),o={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},r=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:a,config:o,colNames:r}});function ee(){e.nextTick(()=>{const l=y.value.head.map((r,u)=>[[r.name],[y.value.body[u]],[isNaN(y.value.body[u]/f.value)?"-":y.value.body[u]/f.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=n.createCsvContent(a);n.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-rings"})})}const k=e.ref(!1);function be(l){k.value=l,O.value+=1}function te(){h.value.showTable=!h.value.showTable}function le(){h.value.showTooltip=!h.value.showTooltip}const B=e.ref(!1);function E(){B.value=!B.value}return se({getData:me,generatePdf:Y,generateCsv:ee,generateImage:J,toggleTable:te,toggleTooltip:le,toggleAnnotator:E}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"ringsChart",ref:C,class:e.normalizeClass(`vue-ui-rings ${k.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};text-align:center;width:100%;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`),id:`rings_${g.value}`,onMouseleave:a[3]||(a[3]=o=>{m.value=null,N.value=!1,e.unref(U)(!1)}),onMouseenter:a[4]||(a[4]=()=>e.unref(U)(!0))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Be.PenAndPaper,{key:0,svgRef:e.unref(W),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:E},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),ve.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:F,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:I,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(Ce._sfc_main,{key:`title_${R.value}`,config:{title:{cy:"rings-div-title",...t.value.style.chart.title},subtitle:{cy:"rings-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&$.value&&(e.unref(D)||e.unref(P))?(e.openBlock(),e.createBlock(ae.UserOptions,{ref_key:"details",ref:de,key:`user_options_${O.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(j),isImaging:e.unref(X),uid:g.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:h.value.showTooltip,isFullscreen:k.value,titles:{...t.value.userOptions.buttonTitles},chartElement:C.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:be,onGeneratePdf:e.unref(Y),onGenerateCsv:ee,onGenerateImage:e.unref(J),onToggleTable:te,onToggleTooltip:le,onToggleAnnotator:E,style:e.normalizeStyle({visibility:e.unref(D)?e.unref(P)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:o,color:r})=>[e.renderSlot(l.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:o,color:r})),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:o,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:r})),void 0,!0)]),key:"6"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:r})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:r})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:W,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value}),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Se._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:s.value.width<=0?10:s.value.width,height:s.value.height<=0?10:s.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,Ie)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"30%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${g.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(o.color,.05),100-t.value.style.chart.layout.rings.gradient.intensity)},null,8,ze),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,Fe)],8,Ae))),256))]),l.$slots.pattern?(e.openBlock(),e.createElementBlock("g",Re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,o=>(e.openBlock(),e.createElementBlock("defs",null,[e.renderSlot(l.$slots,"pattern",e.mergeProps({ref_for:!0},{seriesIndex:o.absoluteIndex,patternId:`pattern_${g.value}_${o.absoluteIndex}`}),void 0,!0)]))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("circle",{class:e.normalizeClass({"vue-ui-rings-item":b.value&&t.value.useCssAnimation,"vue-rings-item-onload":!b.value&&t.value.useCssAnimation,"vue-ui-rings-opacity":m.value!==null&&m.value!==r}),style:e.normalizeStyle(`animation-delay:${r*100}ms`),stroke:t.value.style.chart.layout.rings.stroke,cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+i.value*c.value[0].proportion/2-i.value*o.proportion/2-2*(r+1),r:e.unref(n.checkNaN)(i.value*o.proportion/2*.9<=0?1e-4:i.value*o.proportion/2*.9),fill:t.value.style.chart.layout.rings.gradient.underlayerColor},null,14,qe),e.createElementVNode("circle",{class:e.normalizeClass({"vue-ui-rings-item":b.value&&t.value.useCssAnimation,"vue-rings-item-onload":!b.value&&t.value.useCssAnimation,"vue-ui-rings-shadow":t.value.style.chart.layout.rings.useShadow,"vue-ui-rings-blur":m.value!==null&&m.value!==r}),style:e.normalizeStyle(`animation-delay:${r*100}ms`),stroke:t.value.style.chart.layout.rings.stroke,"stroke-width":o.strokeWidth<.5?.5:o.strokeWidth,cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+i.value*c.value[0].proportion/2-i.value*o.proportion/2-2*(r+1),r:e.unref(n.checkNaN)(i.value*o.proportion/2*.9<=0?1e-4:i.value*o.proportion/2*.9),fill:t.value.style.chart.layout.rings.gradient.show?`url(#gradient_${g.value}_${r})`:o.color},null,14,Me),l.$slots.pattern?(e.openBlock(),e.createElementBlock("circle",{key:0,class:e.normalizeClass({"vue-ui-rings-item":b.value&&t.value.useCssAnimation,"vue-rings-item-onload":!b.value&&t.value.useCssAnimation,"vue-ui-rings-shadow":t.value.style.chart.layout.rings.useShadow,"vue-ui-rings-blur":m.value!==null&&m.value!==r}),style:e.normalizeStyle(`animation-delay:${r*100}ms`),stroke:t.value.style.chart.layout.rings.stroke,"stroke-width":o.strokeWidth<.5?.5:o.strokeWidth,cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+i.value*c.value[0].proportion/2-i.value*o.proportion/2-2*(r+1),r:e.unref(n.checkNaN)(i.value*o.proportion/2*.9<=0?1e-4:i.value*o.proportion/2*.9),fill:`url(#pattern_${g.value}_${o.absoluteIndex})`},null,14,Ue)):e.createCommentVNode("",!0),e.createElementVNode("circle",{stroke:"none",cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+i.value*c.value[0].proportion/2-i.value*o.proportion/2-2*(r+1),r:e.unref(n.checkNaN)(i.value*o.proportion/2*.9<=0?1e-4:i.value*o.proportion/2*.9),fill:"transparent",onMouseenter:u=>ye(r,o),onMouseleave:a[0]||(a[0]=u=>{m.value=null,N.value=!1})},null,40,De)]))),256)),e.renderSlot(l.$slots,"svg",{svg:s.value},void 0,!0)],14,Oe)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",We,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(j)||e.unref(X)})),void 0,!0)])):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Te.default,{key:6,config:{type:"rings",style:{backgroundColor:t.value.style.chart.backgroundColor,rings:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:A},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Ne.Legend,{key:`legend_${M.value}`,legendSet:Z.value,config:ge.value,onClickMarker:a[1]||(a[1]=({legend:o})=>V(o.uid))},e.createSlots({item:e.withCtx(({legend:o,index:r})=>[e.createElementVNode("div",{onClick:u=>V(o.uid),style:e.normalizeStyle(`opacity:${d.value.includes(o.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:o,seriesIndex:r}))+" ",1),d.value.includes(o.uid)?(e.openBlock(),e.createElementBlock("span",je," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Ge," ("+e.toDisplayString(isNaN(o.value/f.value)?"-":e.unref(n.dataLabel)({v:o.value/f.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,He)]),_:2},[l.$slots.pattern?{name:"legend-pattern",fn:e.withCtx(({legend:o,index:r})=>[e.createVNode(Pe._sfc_main,{shape:o.shape,radius:30,stroke:"none",plot:{x:30,y:30},fill:`url(#pattern_${g.value}_${r})`},null,8,["shape","fill"])]),key:"0"}:void 0]),1032,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:Z.value},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:z,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(we._sfc_main,{show:h.value.showTooltip&&N.value&&d.value.length<p.dataset.length,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:C.value,content:_.value,isFullscreen:k.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...L.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...L.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),$.value?(e.openBlock(),e.createBlock(xe.default,{key:8,hideDetails:"",config:{open:h.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_${q.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[2]||(a[2]=o=>h.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Xe)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Ee))}},Je=Le._export_sfc(Ye,[["__scopeId","data-v-380bda50"]]);exports.default=Je;
;