UNPKG

vue-data-ui

Version:

A user-empowering data visualization Vue 3 components library for eloquent data storytelling

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