vue-data-ui-hq
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
2 lines (1 loc) • 23.6 kB
JavaScript
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-ZfICPrrM.cjs"),Le=require("./Title-FbHK83tB.cjs"),be=require("./usePrinter-B-gh2f22.cjs"),Ae=require("./Tooltip-C7TJODUx.cjs"),Fe=require("./Legend-HgHPyA_4.cjs"),Re=require("./vue-ui-skeleton-Bvmpr51u.cjs"),De=require("./DataTable-CC6dPSer.cjs"),Ie=require("./vue-ui-accordion-Dp6uTsJi.cjs"),ke=require("./useResponsive-BJ7DTGpm.cjs"),Ce=require("./useNestedProp-C14rfl0j.cjs"),qe=require("./PackageVersion-D3dK8oA3.cjs"),Me=require("./PenAndPaper-PL3bp4ud.cjs"),He=require("./useUserOptionState-BgepsfED.cjs"),Ue=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function we(l,c){const s=l.length;if(s===0)throw new Error(`Max aspect ratio cannot be computed: ${l} is an empty array`);{let d=1/0,u=-1/0,h=0;for(let p=0;p<s;p+=1){const v=l[p].normalizedValue;v<d&&(d=v),v>u&&(u=v),h+=v}return Math.max(c**2*u/h**2,h**2/(c**2*d))}}function xe(l){const{xOffset:c,yOffset:s,width:d,height:u}=l;return{x0:c,y0:s,x1:c+d,y1:s+u}}function We(l,c,s){if(l.length===0)return!0;{const d=l.concat(c),u=we(l,s),h=we(d,s);return u>=h}}function Ge(l){const c=[],s=l.length;for(let d=0;d<s;d+=1){const u=l[d],h=u.length;for(let f=0;f<h;f+=1)c.push(u[f])}return c}function je(l,c){const s={...c,children:l};return $e(s)}function Xe(l){return(l.x1-l.x0)*(l.y1-l.y0)}function Te(l,c){const{width:s,height:d,xOffset:u,yOffset:h}=Y(c),f=l.length,p=l.map(y=>y.normalizedValue||0).reduce((y,g)=>y+g,0),v=p/d,w=p/s;let C=u,x=h;const b=[];if(s>=d){for(let y=0;y<f;y+=1){const g=l[y],k=x+g.normalizedValue/v,B={x0:C,y0:x,x1:C+v,y1:k},T=Object.assign({},g,B);x=k,b.push(T)}return b}else{for(let y=0;y<f;y+=1){const g=l[y],k=C+g.normalizedValue/w,B={x0:C,y0:x,x1:k,y1:x+w},T=Object.assign({},g,B);C=k,b.push(T)}return b}}function Ye(l){const c=Y(l),s=c.width,d=c.height;return Math.min(s,d)}function Ze(l,c){const s=l.length,d=l.map(v=>v.value??0).reduce((v,w)=>v+w,0),u=c/d,h=[];let f,p;for(let v=0;v<s;v+=1)p=l[v],f=Object.assign({},p,{normalizedValue:p.value*(u||0)}),h.push(f);return h}function Y(l){const{x0:c,y0:s,x1:d,y1:u}=l;return{xOffset:c,yOffset:s,width:d-c,height:u-s}}function Je(l,c,s,d){let u=l,h=c,f=s,p=d;for(;;){const v=u.length;if(v===0){const b=Te(h,f);return p.concat(b)}const w=Ye(f),C=u[0],x=u.slice(1,v);if(We(h,C,w)){const b=h.concat(C);u=x,h=b,f=f,p=p}else{const b=h.length;let y=0;for(let T=0;T<b;T+=1)y+=h[T].normalizedValue;const g=Ke(f,y),k=Te(h,f),B=p.concat(k);u=u,h=[],f=g,p=B}}}function $e(l){if(typeof l.children>"u"||!l.children.length)return[l];{const c=Ze(l.children,Xe(l)),s=Je(c,[],l,[]),d=s.length,u=[];for(let f=0;f<d;f+=1)u.push($e(s[f]));return Ge(u)}}function Ke(l,c){const{width:s,height:d,xOffset:u,yOffset:h}=Y(l);if(s>=d){const f=c/d,p=s-f,v={xOffset:u+f,yOffset:h,width:p,height:d};return xe(v)}else{const f=c/s,p=d-f,v={xOffset:u,yOffset:h+f,width:s,height:p};return xe(v)}}const Qe=["id"],et=["xmlns","viewBox"],tt={key:0},ot=["id"],nt=["stop-color"],rt=["stop-color"],lt=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],at=["x","y","height","width"],ut={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},st={key:5,class:"vue-data-ui-watermark"},it=["onClick"],ct={key:0},dt={key:1},ft=["innerHTML"],ht={__name:"vue-ui-treemap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(l,{expose:c,emit:s}){const{vue_ui_treemap:d}=a.useConfig(),u=l,h=s,f=e.useSlots();e.onMounted(()=>{f["chart-background"]&&console.warn("VueUiTreemap does not support the #chart-background slot.")});const p=e.computed(()=>!!u.dataset&&u.dataset.length),v=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),w=e.ref(a.createUid()),C=e.ref(!1),x=e.ref(""),b=e.ref(!1),y=e.ref(0),g=e.ref([]),k=e.ref(null),B=e.ref(null),T=e.ref(null),Z=e.ref(null),J=e.ref(null),K=e.ref(0),Q=e.ref(0),ee=e.ref(0),t=e.computed({get:()=>ne(),set:o=>o}),{userOptionsVisible:U,setUserOptionsVisibility:te,keepUserOptionState:oe}=He.useUserOptionState({config:t.value});function ne(){const o=Ce.useNestedProp({userConfig:u.config,defaultConfig:d});return o.theme?{...Ce.useNestedProp({userConfig:a.themes.vue_ui_treemap[o.theme]||u.config,defaultConfig:o}),customPalette:a.themePalettes[o.theme]||a.palette}:o}e.watch(()=>u.config,o=>{t.value=ne(),U.value=!t.value.showOnChartHover,K.value+=1,Q.value+=1,ee.value+=1},{deep:!0});const{isPrinting:re,isImaging:le,generatePdf:ae,generateImage:ue}=be.usePrinter({elementId:`treemap_${w.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),Se=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),D=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),O=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),P=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),_=e.computed(()=>({bottom:P.value.height-t.value.style.chart.padding.bottom,height:P.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:P.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:P.value.height,vbWidth:P.value.width,width:P.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function se(o){o.forEach((r,n)=>{r.id=a.createUid(),r.color=a.convertColorToHex(r.color)||D.value[n]||a.palette[n]||a.palette[n%a.palette.length],r.children&&(r.children.forEach(i=>{i.parentId=r.id,i.color=r.color}),se(r.children))})}const V=e.ref(u.dataset),I=e.ref(null);e.onMounted(()=>{Ne()});function Ne(){if(a.objectIsEmpty(u.dataset)&&a.error({componentName:"VueUiTreemap",type:"dataset"}),se(V.value),t.value.responsive){const o=ke.throttle(()=>{const{width:r,height:n}=ke.useResponsive({chart:k.value,title:t.value.style.chart.title.text?B.value:null,legend:t.value.style.chart.legend.show?T.value:null,source:Z.value,noTitle:J.value});P.value.width=r,P.value.height=n});I.value=new ResizeObserver(o),I.value.observe(k.value.parentNode)}}e.onBeforeUnmount(()=>{I.value&&I.value.disconnect()});const W=e.ref(V.value),F=e.computed(()=>W.value.map((o,r)=>({...o,color:a.convertColorToHex(o.color)||D.value[r]||a.palette[r]||a.palette[r%a.palette.length]})).filter(o=>!g.value.includes(o.id))),L=e.computed(()=>V.value.filter(o=>!g.value.includes(o.id)).map(o=>o.value||0).reduce((o,r)=>o+r,0)),ie=e.computed({get(){let o=[...F.value];return t.value.style.chart.layout.sorted&&(o=[...F.value].sort((r,n)=>n.value-r.value)),o.map(r=>({...r}))},set(o){return o}});function ce(o,r){return o.value/r}function Be(o,r,n){const i=t.value.style.chart.layout.rects.colorRatio-ce(r,n);return a.lightenHexColor(o,i<0?0:i)}function de(o,r,n,i){return o.map((m,z)=>{const H=Be(a.convertColorToHex(r)||D.value[z]||a.palette[z]||a.palette[z%a.palette.length],m,i),Ee=ce(m,i);return{...m,color:H,proportion:Ee,parentName:n,children:m.children?de(m.children,H,m.name,i):void 0}})}const R=e.computed(()=>je(ie.value.map((o,r)=>{const n=o.children?o.children.reduce((i,m)=>i+m.value,0):o.value;return{value:o.value,id:o.id,children:o.children?de(o.children.sort((i,m)=>m.value-i.value),o.color,o.name,n):void 0,color:o.color,name:o.name}}),{x0:_.value.left*2,y0:_.value.top,x1:_.value.width,y1:_.value.height}));function fe({y0:o,y1:r}){return r-o<=0?1e-4:r-o}function he({x0:o,x1:r}){return r-o<=0?1e-4:r-o}function E(o){const r=t.value.style.chart.layout.labels.fontSize*(o.proportion*2>1?1:o.proportion*2);return r<t.value.style.chart.layout.labels.minFontSize?t.value.style.chart.layout.labels.minFontSize:r}function Oe(o){b.value=o,y.value+=1}const A=e.computed(()=>({startX:0,startY:0,width:_.value.vbWidth,height:_.value.vbHeight})),$=e.ref(!1);function G(o,r=V.value){for(const n of r){if(n.id===o)return n;if(n.children){const i=G(o,n.children);if(i)return i}}return null}function Pe(o){if($.value)h("selectDatapoint",void 0),W.value=V.value;else{if(h("selectDatapoint",o),!G(o.parentId))return;W.value=[G(o.parentId)]}$.value=!$.value}const S=e.ref(null),pe=e.computed(()=>V.value.map((o,r)=>({...o,color:a.convertColorToHex(o.color)||D.value[r]||a.palette[r]||a.palette[r%a.palette.length],shape:"square"})).sort((o,r)=>r.value-o.value).map((o,r)=>({...o,proportion:o.value/V.value.map(n=>n.value).reduce((n,i)=>n+i,0),opacity:g.value.includes(o.id)?.5:1}))),ze=e.computed(()=>({cy:"treemap-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function ve(o){$.value=!1,S.value=null,g.value.includes(o.id)?g.value=g.value.filter(r=>r!==o.id):g.value.length<u.dataset.length-1&&g.value.push(o.id),h("selectLegend",ie.value)}const j=e.ref(null);function _e({datapoint:o,seriesIndex:r}){S.value=o,j.value={datapoint:o,seriesIndex:r,config:t.value,series:F.value};const n=t.value.style.chart.tooltip.customFormat;if(a.isFunction(n)&&a.functionReturnsString(()=>n({seriesIndex:r,datapoint:o,series:F.value,config:t.value})))x.value=n({seriesIndex:r,datapoint:o,series:F.value,config:t.value});else{let i="";i+=`<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>`,i+=`<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" fill="${o.color}"/></svg>`,i+=`<b>${a.applyDataLabel(t.value.style.chart.layout.labels.formatter,o.value,a.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:o.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:o,seriesIndex:r})}</b>`,x.value=`<div>${i}</div>`}C.value=!0}const N=e.computed(()=>{const o=R.value.map(n=>({name:n.name,color:n.color})),r=R.value.map(n=>n.value);return{head:o,body:r}});function ge(){e.nextTick(()=>{const o=N.value.head.map((i,m)=>[[i.name],[N.value.body[m]],[isNaN(N.value.body[m]/L.value)?"-":N.value.body[m]/L.value*100]]),r=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(o),n=a.createCsvContent(r);a.downloadCsv({csvContent:n,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const q=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],r=N.value.head.map((m,z)=>{const H=a.applyDataLabel(t.value.style.chart.layout.labels.formatter,N.value.body[z],a.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:N.value.body[z],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:m.color,name:m.name,shape:"square"},H,isNaN(N.value.body[z]/L.value)?"-":a.dataLabel({v:N.value.body[z]/L.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),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{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:r,config:n}});function Ve(){return R.value}function me(){O.value.showTable=!O.value.showTable}function ye(){O.value.showTooltip=!O.value.showTooltip}const M=e.ref(!1);function X(){M.value=!M.value}return c({getData:Ve,generateCsv:ge,generateImage:ue,generatePdf:ae,toggleTable:me,toggleTooltip:ye,toggleAnnotator:X}),(o,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:k,class:e.normalizeClass(`vue-ui-treemap ${e.unref(b)?"vue-data-ui-wrapper-fullscreen":""} ${e.unref(t).useCssAnimation?"":"vue-ui-dna"}`),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}`),id:`treemap_${e.unref(w)}`,onMouseenter:r[3]||(r[3]=()=>e.unref(te)(!0)),onMouseleave:r[4]||(r[4]=()=>e.unref(te)(!1))},[e.unref(t).userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Me.PenAndPaper,{key:0,parent:e.unref(k),backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color,active:e.unref(M),onClose:X},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),e.unref(Se)?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:J,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:B,style:e.normalizeStyle(`width:100%;background:${e.unref(t).style.chart.backgroundColor};padding-bottom:6px`)},[(e.openBlock(),e.createBlock(Le._sfc_main,{key:`title_${e.unref(K)}`,config:{title:{cy:"treemap-div-title",...e.unref(t).style.chart.title},subtitle:{cy:"treemap-div-subtitle",...e.unref(t).style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),e.unref(t).userOptions.show&&e.unref(p)&&(e.unref(oe)||e.unref(U))?(e.openBlock(),e.createBlock(be.UserOptions,{ref:"details",key:`user_option_${e.unref(y)}`,backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color,isPrinting:e.unref(re),isImaging:e.unref(le),uid:e.unref(w),hasTooltip:e.unref(t).userOptions.buttons.tooltip&&e.unref(t).style.chart.tooltip.show,hasPdf:e.unref(t).userOptions.buttons.pdf,hasXls:e.unref(t).userOptions.buttons.csv,hasImg:e.unref(t).userOptions.buttons.img,hasTable:e.unref(t).userOptions.buttons.table,hasFullscreen:e.unref(t).userOptions.buttons.fullscreen,isFullscreen:e.unref(b),isTooltip:e.unref(O).showTooltip,titles:{...e.unref(t).userOptions.buttonTitles},chartElement:e.unref(k),position:e.unref(t).userOptions.position,hasAnnotator:e.unref(t).userOptions.buttons.annotator,isAnnotation:e.unref(M),onToggleFullscreen:Oe,onGeneratePdf:e.unref(ae),onGenerateCsv:ge,onGenerateImage:e.unref(ue),onToggleTable:me,onToggleTooltip:ye,onToggleAnnotator:X,style:e.normalizeStyle({visibility:e.unref(oe)?e.unref(U)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:n,isFullscreen:i})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:n,isFullscreen:i})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:n,isAnnotator:i})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:n,isAnnotator:i})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),e.unref(p)?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(a.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":e.unref(b),"vue-data-ui-fulscreen--off":!e.unref(b),"vue-data-ui-zoom-plus":!e.unref($),"vue-data-ui-zoom-minus":e.unref($)}),viewBox:`${e.unref(A).startX} ${e.unref(A).startY} ${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: hidden; background:transparent;color:${e.unref(t).style.chart.color}`)},[e.createVNode(qe._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(R),(n,i)=>(e.openBlock(),e.createElementBlock("g",null,[e.unref(t).style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",tt,[e.createElementVNode("radialGradient",{id:`tgrad_${n.id}`,gradientTransform:"translate(-1, -1.000001) scale(2, 2)"},[e.createElementVNode("stop",{offset:"18%","stop-color":n.color},null,8,nt),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.lightenHexColor)(n.color,e.unref(t).style.chart.layout.rects.gradient.intensity/100)},null,8,rt)],8,ot)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(R),(n,i)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:n.x0,y:n.y0,height:fe(n),width:he(n),fill:e.unref(v)?n.color:e.unref(t).style.chart.layout.rects.gradient.show?`url(#tgrad_${n.id})`:n.color,rx:e.unref(t).style.chart.layout.rects.borderRadius,stroke:e.unref(S)&&e.unref(S).id===n.id?e.unref(t).style.chart.layout.rects.selected.stroke:e.unref(t).style.chart.layout.rects.stroke,"stroke-width":e.unref(S)&&e.unref(S).id===n.id?e.unref(t).style.chart.layout.rects.selected.strokeWidth:e.unref(t).style.chart.layout.rects.strokeWidth,onClick:m=>Pe(n),onMouseenter:()=>_e({datapoint:n,seriesIndex:i}),onMouseleave:r[0]||(r[0]=m=>{S.value=null,C.value=!1}),style:e.normalizeStyle(`opacity:${e.unref(S)?e.unref(S).id===n.id?1:e.unref(t).style.chart.layout.rects.selected.unselectedOpacity:1}`),class:"vue-ui-treemap-rect"},null,44,lt),(e.openBlock(),e.createElementBlock("foreignObject",{x:n.x0,y:n.y0,height:fe(n),width:he(n),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",ut,[e.unref(t).style.chart.layout.labels.showDefaultLabels&&(n.proportion>e.unref(t).style.chart.layout.labels.hideUnderProportion||e.unref($))?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-treemap-cell-default",style:e.normalizeStyle(`width:calc(100% - ${E(n)/1.5}px);text-align:left;line-height:${E(n)<14?14:E(n)}px;padding:${E(n)/3}px; color:${e.unref(a.adaptColorToBackground)(n.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(n)}px;`)},e.toDisplayString(n.name),5),r[5]||(r[5]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(n)}px;`)},e.toDisplayString(e.unref(a.applyDataLabel)(e.unref(t).style.chart.layout.labels.formatter,n.value,e.unref(a.dataLabel)({p:e.unref(t).style.chart.layout.labels.prefix,v:n.value,s:e.unref(t).style.chart.layout.labels.suffix,r:e.unref(t).style.chart.layout.labels.rounding}),{datapoint:n})),5)],4)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"rect",e.mergeProps({ref_for:!0},{rect:n,shouldShow:n.proportion>e.unref(t).style.chart.layout.labels.hideUnderProportion||e.unref($),fontSize:E(n),isZoom:e.unref($),textColor:e.unref(a.adaptColorToBackground)(n.color)}),void 0,!0)])],8,at))]))),256)),e.renderSlot(o.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:e.unref(_),isZoom:e.unref($),rect:e.unref(S),config:e.unref(t)})),void 0,!0)],14,et)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",st,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(re)||e.unref(le)})),void 0,!0)])):e.createCommentVNode("",!0),e.unref(p)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Re.default,{key:6,config:{type:"treemap",style:{backgroundColor:e.unref(t).style.chart.backgroundColor,treemap:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:T},[e.unref(t).style.chart.legend.show?(e.openBlock(),e.createBlock(Fe.Legend,{key:`legend_${e.unref(ee)}`,legendSet:e.unref(pe),config:e.unref(ze),id:`treemap_legend_${e.unref(w)}`,onClickMarker:r[1]||(r[1]=({legend:n})=>ve(n))},{item:e.withCtx(({legend:n,index:i})=>[e.createElementVNode("div",{onClick:m=>ve(n),style:e.normalizeStyle(`opacity:${e.unref(g).includes(n.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(n.name)+": "+e.toDisplayString(e.unref(a.applyDataLabel)(e.unref(t).style.chart.layout.labels.formatter,n.value,e.unref(a.dataLabel)({p:e.unref(t).style.chart.layout.labels.prefix,v:n.value,s:e.unref(t).style.chart.layout.labels.suffix,r:e.unref(t).style.chart.legend.roundingValue}),{datapoint:n}))+" ",1),e.unref(g).includes(n.id)?(e.openBlock(),e.createElementBlock("span",dt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",ct," ("+e.toDisplayString(isNaN(n.value/e.unref(L))?"-":(n.value/e.unref(L)*100).toFixed(e.unref(t).style.chart.legend.roundingPercentage))+"%) ",1))],12,it)]),_:1},8,["legendSet","config","id"])):e.renderSlot(o.$slots,"legend",{key:1,legend:e.unref(pe)},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:Z,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Ae._sfc_main,{show:e.unref(O).showTooltip&&e.unref(C),backgroundColor:e.unref(t).style.chart.tooltip.backgroundColor,color:e.unref(t).style.chart.tooltip.color,fontSize:e.unref(t).style.chart.tooltip.fontSize,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(k),content:e.unref(x),isFullscreen:e.unref(b),isCustom:e.unref(a.isFunction)(e.unref(t).style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...e.unref(j)})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...e.unref(j)})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),e.unref(p)?(e.openBlock(),e.createBlock(Ie.default,{key:8,hideDetails:"",config:{open:e.unref(O).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(De.DataTable,{key:`table_${e.unref(Q)}`,colNames:e.unref(q).colNames,head:e.unref(q).head,body:e.unref(q).body,config:e.unref(q).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:r[2]||(r[2]=n=>e.unref(O).showTable=!1)},{th:e.withCtx(({th:n})=>[e.createElementVNode("div",{innerHTML:n,style:{display:"flex","align-items":"center"}},null,8,ft)]),td:e.withCtx(({td:n})=>[e.createTextVNode(e.toDisplayString(n.name||n),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Qe))}},pt=Ue._export_sfc(ht,[["__scopeId","data-v-ff62c229"]]);exports.default=pt;
;