vue-data-ui-hq
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
2 lines (1 loc) • 27.7 kB
JavaScript
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-ZfICPrrM.cjs"),ve=require("./useResponsive-BJ7DTGpm.cjs"),Ie=require("./Title-FbHK83tB.cjs"),ye=require("./usePrinter-B-gh2f22.cjs"),ze=require("./Tooltip-C7TJODUx.cjs"),Fe=require("./DataTable-CC6dPSer.cjs"),Oe=require("./Legend-HgHPyA_4.cjs"),Ae=require("./vue-ui-skeleton-Bvmpr51u.cjs"),De=require("./vue-ui-accordion-Dp6uTsJi.cjs"),ge=require("./useNestedProp-C14rfl0j.cjs"),Me=require("./PackageVersion-D3dK8oA3.cjs"),qe=require("./PenAndPaper-PL3bp4ud.cjs"),Ue=require("./useUserOptionState-BgepsfED.cjs"),Re=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),je=["id"],Ge=["xmlns","viewBox"],We=["id"],He=["stop-color"],Ye=["stop-color"],Xe=["id"],Je=["x","y","height","width"],Ke=["height","width"],Qe=["rx","x","y","height","width","stroke","stroke-width","filter"],Ze=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],et=["x","y","height","width","filter"],tt={key:0},rt={key:1},lt={key:2},ot={key:3},at=["onMouseover","x","y","height","width"],nt={key:5,class:"vue-data-ui-watermark"},ut=["onClick"],st={key:0},it={key:1},ct=["innerHTML"],ft={__name:"vue-ui-waffle",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(me,{expose:be,emit:ke}){const{vue_ui_waffle:we}=u.useConfig(),p=me,Ce=e.useSlots();e.onMounted(()=>{Ce["chart-background"]&&console.warn("VueUiWaffle does not support the #chart-background slot.")});const V=e.computed(()=>!!p.dataset&&p.dataset.length),b=e.ref(u.createUid()),xe=e.ref(null),F=e.ref(!1),O=e.ref(""),B=e.ref(null),R=e.ref(0),S=e.ref(null),j=e.ref(null),G=e.ref(null),W=e.ref(null),H=e.ref(null),Y=e.ref(0),X=e.ref(0),J=e.ref(0),t=e.computed({get:()=>Z(),set:r=>r}),{userOptionsVisible:A,setUserOptionsVisibility:K,keepUserOptionState:Q}=Ue.useUserOptionState({config:t.value});function Z(){const r=ge.useNestedProp({userConfig:p.config,defaultConfig:we});return r.theme?{...ge.useNestedProp({userConfig:u.themes.vue_ui_waffle[r.theme]||p.config,defaultConfig:r}),customPalette:u.themePalettes[r.theme]||u.palette}:r}e.watch(()=>p.config,r=>{t.value=Z(),A.value=!t.value.showOnChartHover,ee(),Y.value+=1,X.value+=1,J.value+=1},{deep:!0});const P=e.ref(null);function ee(){if(u.objectIsEmpty(p.dataset)?u.error({componentName:"VueUiWaffle",type:"dataset"}):p.dataset.forEach((r,o)=>{u.getMissingDatasetAttributes({datasetObject:r,requiredAttributes:["name","values"]}).forEach(l=>{u.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:l,index:o})})}),t.value.responsive){const r=ve.throttle(()=>{const{width:o,height:l}=ve.useResponsive({chart:S.value,title:t.value.style.chart.title.text?j.value:null,legend:t.value.style.chart.legend.show?G.value:null,source:W.value,noTitle:H.value});k.value.width=o,k.value.height=l,v.value.width=o,v.value.height=l});P.value=new ResizeObserver(r),P.value.observe(S.value.parentNode)}}e.onMounted(()=>{ee()}),e.onBeforeUnmount(()=>{P.value&&P.value.disconnect()});const{isPrinting:te,isImaging:re,generatePdf:le,generateImage:oe}=ye.usePrinter({elementId:`vue-ui-waffle_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-waffle"}),Be=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),ae=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),m=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),k=e.ref({height:512,width:512}),v=e.ref({top:0,left:0,height:512,width:512}),w=e.computed(()=>(v.value.width-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),C=e.computed(()=>(v.value.height-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),$=e.computed(()=>v.value.width/t.value.style.chart.layout.grid.size),E=e.computed(()=>v.value.height/t.value.style.chart.layout.grid.size);function ne(r){const o=t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.size,l=r.reduce((h,U)=>h+U,0),a=r.map(h=>h/l*o),n=a.map(Math.floor),i=a.map(h=>h%1);let d=o-n.reduce((h,U)=>h+U,0);for(;d>0;){let h=i.indexOf(Math.max(...i));n[h]+=1,i[h]=0,d-=1}return n}function ue(){return p.dataset.map((r,o)=>({...r,color:u.convertColorToHex(r.color)||ae.value[o]||u.palette[o]||u.palette[o%u.palette.length],uid:`serie_${o}`,absoluteIndex:o}))}const se=e.computed(()=>ue()),c=e.ref(se.value);e.watch(()=>p.dataset,r=>{c.value=ue()},{deep:!0});const Se=e.computed(()=>{const r=c.value.filter((o,l)=>!f.value.includes(o.uid)).map((o,l)=>(o.values||[]).reduce((a,n)=>a+n,0));return ne(r)}),Ne=e.computed(()=>{const r=c.value.map((o,l)=>(o.values||[]).reduce((a,n)=>a+n));return ne(r)}),T=e.computed(()=>(p.dataset.forEach((r,o)=>{[null,void 0].includes(r.values)&&u.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:"values (number[])",index:o})}),c.value.filter((r,o)=>!f.value.includes(r.uid)).map((r,o)=>({absoluteIndex:r.absoluteIndex,uid:r.uid,name:r.name,color:r.color,value:(r.values||[]).reduce((l,a)=>l+a,0),absoluteValues:r.values||[],proportion:Se.value[o]})))),_e=e.computed(()=>c.value.map((r,o)=>({absoluteIndex:r.absoluteIndex,uid:r.uid,name:r.name,color:r.color,value:(r.values||[]).reduce((l,a)=>l+a,0),absoluteValues:r.values||[],proportion:Ne.value[o]})));function $e(){return _e.value.map(r=>({name:r.name,color:r.color,value:r.value,proportion:r.proportion}))}const Te=e.computed(()=>{let r=0;return T.value.map((o,l)=>{const a=r,n=a+o.proportion,i=[];for(let d=Math.floor(a);d<Math.floor(n);d+=1)i.push(d);return r=n,{...o,start:a,rects:i}})}),s=e.computed(()=>Te.value.flatMap((r,o)=>r.rects.map((l,a)=>({isFirst:a===0,isLongEnough:l.length>2,name:r.name,color:r.color,value:r.value,serieIndex:o,absoluteStartIndex:a<3,serieId:r.uid,...r}))).map((r,o)=>({...r,isAbsoluteFirst:o%t.value.style.chart.layout.grid.size===0}))),L=e.computed(()=>{const r=[];for(let o=0;o<t.value.style.chart.layout.grid.size;o+=1)for(let l=0;l<t.value.style.chart.layout.grid.size;l+=1)r.push({isStartOfLine:l===0,position:t.value.style.chart.layout.grid.vertical?o:l,x:(t.value.style.chart.layout.grid.vertical?o:l)*(w.value+t.value.style.chart.layout.grid.spaceBetween),y:(t.value.style.chart.layout.grid.vertical?l:o)*(C.value+t.value.style.chart.layout.grid.spaceBetween)+v.value.top});return r}),f=e.ref([]),x=e.ref(!1),ie=e.ref(null),ce=e.ref(null);function fe(r){if(!t.value.useAnimation){f.value.includes(r)?f.value=f.value.filter(n=>n!==r):f.value.length<N.value.length-1&&N.value.length>1&&f.value.push(r);return}const o=se.value.find(n=>n.uid===r).values.reduce((n,i)=>n+i,0),l=c.value.find(n=>n.uid===r).values.reduce((n,i)=>n+i,0);let a=l;if(f.value.includes(r)){let i=function(){a>n?(cancelAnimationFrame(ie.value),c.value=c.value.map((d,h)=>d.uid===r?{...d,values:[n]}:d),x.value=!1):(x.value=!0,a+=n*.025,c.value=c.value.map((d,h)=>d.uid===r?{...d,values:[a]}:d),ie.value=requestAnimationFrame(i))};f.value=f.value.filter(d=>d!==r);const n=o;i()}else if(f.value.length<N.value.length-1&&N.value.length>1){let n=function(){a<l/100?(cancelAnimationFrame(ce.value),f.value.push(r),c.value=c.value.map((i,d)=>i.uid===r?{...i,values:[0]}:i),x.value=!1):(x.value=!0,a/=1.15,c.value=c.value.map(i=>i.uid===r?{...i,values:[a]}:i),ce.value=requestAnimationFrame(n))};n()}Pe("selectLegend",T.value.map(n=>({name:n.name,color:n.color,value:n.value,proportion:n.proportion/Math.pow(t.value.style.chart.layout.grid.size,2)})))}const N=e.computed(()=>c.value.map((r,o)=>({name:r.name,color:r.color||ae[o]||u.palette[o]||u.palette[o%u.palette.length],value:(r.values||[]).reduce((l,a)=>l+a,0),uid:r.uid,shape:"square"})).map(r=>({...r,proportion:r.value/c.value.map(o=>(o.values||[]).reduce((l,a)=>l+a,0)).reduce((o,l)=>o+l,0),opacity:f.value.includes(r.uid)?.5:1,segregate:()=>fe(r.uid),isSegregated:f.value.includes(r.uid)}))),Le=e.computed(()=>({cy:"waffle-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":""})),y=e.computed(()=>T.value.map(r=>r.value).reduce((r,o)=>r+o,0)),D=e.ref(null);function Ve(r){if(f.value.length===p.dataset.length)return;const o=s.value[r];D.value={datapoint:o,seriesIndex:o.absoluteIndex,series:c.value,config:t.value},F.value=!0,B.value=s.value[r].serieIndex;const l=t.value.style.chart.tooltip.customFormat;if(u.isFunction(l)&&u.functionReturnsString(()=>l({seriesIndex:s.value[r].absoluteIndex,datapoint:o,series:c.value,config:t.value})))O.value=l({seriesIndex:s.value[r].absoluteIndex,datapoint:o,series:c.value,config:t.value});else{let a="";if(a+=`<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>`,a+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" rx="1" fill="${o.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(a+=`<b>${u.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,u.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:o,seriesIndex:s.value[r].absoluteIndex,series:c.value})}</b>`),t.value.style.chart.tooltip.showPercentage){const n=u.dataLabel({v:o.value/y.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage});t.value.style.chart.tooltip.showValue?a+=`<span>(${n})</span></div>`:a+=`<b>${n}%</b></div>`}O.value=a}}const Pe=ke,g=e.computed(()=>{const r=T.value.map(l=>({name:l.name,color:l.color})),o=T.value.map(l=>l.value);return{head:r,body:o}});function M(r){return t.value.useBlurOnHover&&![null,void 0].includes(B.value)&&B.value!==r?`url(#blur_${b.value})`:""}function de(){e.nextTick(()=>{const r=g.value.head.map((a,n)=>[[a.name],[g.value.body[n]],[isNaN(g.value.body[n]/y.value)?"-":g.value.body[n]/y.value*100]]),o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(r),l=u.createCsvContent(o);u.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-waffle"})})}const I=e.computed(()=>{const r=[' <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>',u.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,y.value,u.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:y.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),"100%"],o=g.value.head.map((n,i)=>[{color:n.color,name:n.name},u.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,g.value.body[i],u.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:g.value.body[i],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),isNaN(g.value.body[i]/y.value)?"-":u.dataLabel({v:g.value.body[i]/y.value*100,s:"%",r:t.value.table.td.roundingPercentage})]),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},shape:"square",breakpoint:t.value.table.responsiveBreakpoint},a=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:r,body:o,config:l,colNames:a}}),_=e.ref(!1);function Ee(r){_.value=r,R.value+=1}function pe(){m.value.showTable=!m.value.showTable}function he(){m.value.showTooltip=!m.value.showTooltip}const z=e.ref(!1);function q(){z.value=!z.value}return be({getData:$e,generatePdf:le,generateCsv:de,generateImage:oe,toggleTable:pe,toggleTooltip:he,toggleAnnotator:q}),(r,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-waffle ${e.unref(_)?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"waffleChart",ref:S,id:`vue-ui-waffle_${e.unref(b)}`,style:e.normalizeStyle(`font-family:${e.unref(t).style.fontFamily};width:100%; text-align:center;background:${e.unref(t).style.chart.backgroundColor};${e.unref(t).responsive?"height: 100%":""}`),onMouseenter:o[3]||(o[3]=()=>e.unref(K)(!0)),onMouseleave:o[4]||(o[4]=()=>e.unref(K)(!1))},[e.unref(t).userOptions.buttons.annotator?(e.openBlock(),e.createBlock(qe.PenAndPaper,{key:0,parent:e.unref(S),backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color,active:e.unref(z),onClose:q},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),e.unref(Be)?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:H,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:j,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(Ie._sfc_main,{key:`title_${e.unref(Y)}`,config:{title:{cy:"waffle-title",...e.unref(t).style.chart.title},subtitle:{cy:"waffle-subtitle",...e.unref(t).style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),e.unref(t).userOptions.show&&e.unref(V)&&(e.unref(Q)||e.unref(A))?(e.openBlock(),e.createBlock(ye.UserOptions,{ref_key:"details",ref:xe,key:`user_options_${e.unref(R)}`,backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color,isPrinting:e.unref(te),isImaging:e.unref(re),uid:e.unref(b),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(_),isTooltip:e.unref(m).showTooltip,titles:{...e.unref(t).userOptions.buttonTitles},chartElement:e.unref(S),position:e.unref(t).userOptions.position,hasAnnotator:e.unref(t).userOptions.buttons.annotator,isAnnotation:e.unref(z),onToggleFullscreen:Ee,onGeneratePdf:e.unref(le),onGenerateCsv:de,onGenerateImage:e.unref(oe),onToggleTable:pe,onToggleTooltip:he,onToggleAnnotator:q,style:e.normalizeStyle({visibility:e.unref(Q)?e.unref(A)?"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:l,isFullscreen:a})=>[e.renderSlot(r.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:a})),void 0,!0)]),key:"5"}:void 0,r.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:a})=>[e.renderSlot(r.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:a})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),e.unref(V)?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(u.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":e.unref(_),"vue-data-ui-fulscreen--off":!e.unref(_)}),viewBox:`0 0 ${e.unref(k).width<=0?10:e.unref(k).width} ${e.unref(k).height<=0?10:e.unref(k).height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${e.unref(t).style.chart.color}`)},[e.createVNode(Me._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),(l,a)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${e.unref(b)}_${a}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(u.setOpacity)(e.unref(u.shiftHue)(l.color,.05),100-e.unref(t).style.chart.layout.rect.gradientIntensity)},null,8,He),e.createElementVNode("stop",{offset:"100%","stop-color":l.color},null,8,Ye)],8,We))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${e.unref(b)}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},o[5]||(o[5]=[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1),e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)]),8,Xe)]),e.unref(t).useCustomCells&&e.unref(s).length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(L),(l,a)=>(e.openBlock(),e.createElementBlock("foreignObject",{x:l.x,y:l.y,height:e.unref(C)<=0?1e-4:e.unref(C),width:e.unref(w)<=0?1e-4:e.unref(w),class:"vue-ui-waffle-custom-cell-foreignObject"},[e.renderSlot(r.$slots,"cell",e.mergeProps({ref_for:!0},{cell:{...l,color:e.unref(s)[a].color,...e.unref(s)[a]},isSelected:[null,void 0].includes(e.unref(B))?!0:e.unref(s)[a].serieIndex===e.unref(B)}),void 0,!0)],8,Je))),256)):e.createCommentVNode("",!0),!e.unref(s).length&&!e.unref(t).useCustomCells?(e.openBlock(),e.createElementBlock("rect",{key:1,x:12,y:12,height:e.unref(v).height-24,width:e.unref(v).width-24,rx:3,fill:"none",stroke:"black"},null,8,Ke)):e.unref(s).length&&!e.unref(t).useCustomCells?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(L),(l,a)=>(e.openBlock(),e.createElementBlock("rect",{rx:e.unref(t).style.chart.layout.rect.rounded?e.unref(t).style.chart.layout.rect.rounding:0,x:l.x+e.unref(t).style.chart.layout.grid.spaceBetween/2,y:l.y+e.unref(t).style.chart.layout.grid.spaceBetween/2,height:e.unref(C)<=0?1e-4:e.unref(C),width:e.unref(w)<=0?1e-4:e.unref(w),fill:"white",stroke:e.unref(t).style.chart.layout.rect.stroke,"stroke-width":e.unref(t).style.chart.layout.rect.strokeWidth,filter:M(e.unref(s)[a].serieIndex)},null,8,Qe))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(L),(l,a)=>(e.openBlock(),e.createElementBlock("rect",{rx:e.unref(t).style.chart.layout.rect.rounded?e.unref(t).style.chart.layout.rect.rounding:0,x:l.x+e.unref(t).style.chart.layout.grid.spaceBetween/2,y:l.y+e.unref(t).style.chart.layout.grid.spaceBetween/2,height:e.unref(C)<=0?1e-4:e.unref(C),width:e.unref(w)<=0?1e-4:e.unref(w),fill:e.unref(t).style.chart.layout.rect.useGradient&&e.unref(t).style.chart.layout.rect.gradientIntensity>0?`url(#gradient_${e.unref(b)}_${a})`:e.unref(s)[a].color,stroke:e.unref(t).style.chart.layout.rect.stroke,"stroke-width":e.unref(t).style.chart.layout.rect.strokeWidth,filter:M(e.unref(s)[a].serieIndex)},null,8,Ze))),256))],64)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(L),(l,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(s).length&&!e.unref(x)&&!e.unref(t).style.chart.layout.grid.vertical&&e.unref(t).style.chart.layout.labels.captions.show&&(e.unref(s)[a].isFirst&&l.position<e.unref(t).style.chart.layout.grid.size-2||e.unref(s)[a].isAbsoluteFirst&&a%e.unref(t).style.chart.layout.grid.size===0&&e.unref(s)[a].absoluteStartIndex)?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:l.x+e.unref(t).style.chart.layout.labels.captions.offsetX+e.unref(t).style.chart.layout.grid.spaceBetween/2,y:l.y+e.unref(t).style.chart.layout.labels.captions.offsetY+e.unref(t).style.chart.layout.grid.spaceBetween/2,height:e.unref(E)<=0?1e-4:e.unref(E),width:e.unref($)*e.unref(t).style.chart.layout.grid.size<=0?1e-4:e.unref($)*e.unref(t).style.chart.layout.grid.size,filter:M(e.unref(s)[a].serieIndex)},[e.createElementVNode("div",{class:"vue-ui-waffle-caption",style:e.normalizeStyle(`height: 100%; width: 100%; font-size:${e.unref(t).style.chart.layout.labels.captions.fontSize}px;display:flex;align-items:center;justify-content:flex-start;padding: 0 ${e.unref($)/12}px;color:${e.unref(u.adaptColorToBackground)(e.unref(s)[a].color)};gap:2px`)},[e.unref(t).style.chart.layout.labels.captions.showSerieName?(e.openBlock(),e.createElementBlock("span",tt,e.toDisplayString(e.unref(t).style.chart.layout.labels.captions.serieNameAbbreviation?e.unref(u.abbreviate)({source:e.unref(s)[a].name,length:e.unref(t).style.chart.layout.labels.captions.serieNameMaxAbbreviationSize}):e.unref(s)[a].name)+": ",1)):e.createCommentVNode("",!0),e.unref(t).style.chart.layout.labels.captions.showPercentage?(e.openBlock(),e.createElementBlock("span",rt,e.toDisplayString(e.unref(u.dataLabel)({v:e.unref(s)[a].proportion,s:"%",r:e.unref(t).style.chart.layout.labels.captions.roundingPercentage})),1)):e.createCommentVNode("",!0),e.unref(t).style.chart.layout.labels.captions.showPercentage&&e.unref(t).style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",lt," ("+e.toDisplayString(e.unref(u.applyDataLabel)(e.unref(t).style.chart.layout.labels.dataLabels.formatter,e.unref(s)[a].value,e.unref(u.dataLabel)({p:e.unref(t).style.chart.layout.labels.dataLabels.prefix,v:e.unref(s)[a].value,s:e.unref(t).style.chart.layout.labels.dataLabels.suffix,r:e.unref(t).style.chart.layout.labels.captions.roundingValue}),{datapoint:e.unref(s)[a],position:l}))+") ",1)):e.createCommentVNode("",!0),!e.unref(t).style.chart.layout.labels.captions.showPercentage&&e.unref(t).style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",ot,e.toDisplayString(e.unref(u.applyDataLabel)(e.unref(t).style.chart.layout.labels.dataLabels.formatter,e.unref(s)[a].value,e.unref(u.dataLabel)({p:e.unref(t).style.chart.layout.labels.dataLabels.prefix,v:e.unref(s)[a].value,s:e.unref(t).style.chart.layout.labels.dataLabels.suffix,r:e.unref(t).style.chart.layout.labels.captions.roundingValue}),{datapoint:e.unref(s)[a],position:l})),1)):e.createCommentVNode("",!0)],4)],8,et)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(L),(l,a)=>(e.openBlock(),e.createElementBlock("rect",{onMouseover:n=>Ve(a),onMouseleave:o[0]||(o[0]=n=>{F.value=!1,B.value=null}),x:l.x+e.unref(t).style.chart.layout.grid.spaceBetween/2,y:l.y+e.unref(t).style.chart.layout.grid.spaceBetween/2,height:e.unref(E)<=0?1e-4:e.unref(E),width:e.unref($)<=0?1e-4:e.unref($),fill:"transparent",stroke:"none"},null,40,at))),256)),e.renderSlot(r.$slots,"svg",{svg:e.unref(k)},void 0,!0)],14,Ge)):e.createCommentVNode("",!0),r.$slots.watermark?(e.openBlock(),e.createElementBlock("div",nt,[e.renderSlot(r.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(te)||e.unref(re)})),void 0,!0)])):e.createCommentVNode("",!0),e.unref(V)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ae.default,{key:6,config:{type:"waffle",style:{backgroundColor:e.unref(t).style.chart.backgroundColor,waffle:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:G},[e.unref(t).style.chart.legend.show?(e.openBlock(),e.createBlock(Oe.Legend,{key:`legend_${e.unref(J)}`,legendSet:e.unref(N),config:e.unref(Le),onClickMarker:o[1]||(o[1]=({legend:l})=>fe(l.uid))},{item:e.withCtx(({legend:l})=>[e.createElementVNode("div",{onClick:a=>l.segregate(),style:e.normalizeStyle(`opacity:${e.unref(f).includes(l.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(u.applyDataLabel)(e.unref(t).style.chart.layout.labels.dataLabels.formatter,l.value,e.unref(u.dataLabel)({p:e.unref(t).style.chart.layout.labels.dataLabels.prefix,v:l.value,s:e.unref(t).style.chart.layout.labels.dataLabels.suffix,r:e.unref(t).style.chart.legend.roundingValue,isAnimating:e.unref(x)}),{datapoint:l}))+" ",1),e.unref(f).includes(l.uid)?(e.openBlock(),e.createElementBlock("span",it," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",st," ("+e.toDisplayString(isNaN(l.value/e.unref(y))?"-":e.unref(u.dataLabel)({v:l.value/e.unref(y)*100,s:"%",r:e.unref(t).style.chart.legend.roundingPercentage,isAnimating:e.unref(x)}))+") ",1))],12,ut)]),_:1},8,["legendSet","config"])):e.renderSlot(r.$slots,"legend",{key:1,legend:e.unref(N)},void 0,!0)],512),r.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:W,dir:"auto"},[e.renderSlot(r.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ze._sfc_main,{show:e.unref(m).showTooltip&&e.unref(F)&&e.unref(f).length<p.dataset.length,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,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(S),content:e.unref(O),isCustom:e.unref(t).style.chart.tooltip.customFormat&&typeof e.unref(t).style.chart.tooltip.customFormat=="function",fontSize:e.unref(t).style.chart.tooltip.fontSize,isFullscreen:e.unref(_)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(r.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...e.unref(D)})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(r.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...e.unref(D)})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom","fontSize","isFullscreen"]),e.unref(V)?(e.openBlock(),e.createBlock(De.default,{key:8,hideDetails:"",config:{open:e.unref(m).showTable,maxHeight:1e4,body:{backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color},head:{backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Fe.DataTable,{key:`table_${e.unref(X)}`,colNames:e.unref(I).colNames,head:e.unref(I).head,body:e.unref(I).body,config:e.unref(I).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:o[2]||(o[2]=l=>e.unref(m).showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,ct)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,je))}},dt=Re._export_sfc(ft,[["__scopeId","data-v-fe02d91c"]]);exports.default=dt;
;