vue-data-ui
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
2 lines (1 loc) • 37.6 kB
JavaScript
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-CBRI5uwl.cjs"),Be=require("./useResponsive-N8jl0-aC.cjs"),Pe=require("./Title-BP4K_GLE.cjs"),_e=require("./usePrinter-C1Rlqzcj.cjs"),Oe=require("./Tooltip-KXn1rQhr.cjs"),De=require("./Legend-j3YoAtEf.cjs"),Ce=require("./Shape-BF6K6die.cjs"),Fe=require("./DataTable-Be-eTBzq.cjs"),We=require("./vue-ui-skeleton-CM4wEsYA.cjs"),qe=require("./vue-ui-accordion-C5C3XQ8f.cjs"),Ne=require("./useNestedProp-0jJvFRhK.cjs"),Ie=require("./PackageVersion-D_gJvbGU.cjs"),Xe=require("./PenAndPaper-DWG9pfri.cjs"),Re=require("./useUserOptionState-BgepsfED.cjs"),Ye=require("./useChartAccessibility-Cm7nkzTG.cjs"),je=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ue=["id"],Ge=["xmlns","viewBox"],He=["width","height"],Je={key:1},Ke=["x1","x2","y1","y2","stroke","stroke-width"],Qe=["x1","x2","y1","y2","stroke","stroke-width"],Ze={key:2},et=["points","fill","stroke-width","stroke-dasharray","stroke"],tt={key:0},lt=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],at={key:1},ot={key:3},st=["id"],rt=["stop-color"],nt=["stop-color"],ut=["id"],it=["stop-color"],ct=["stop-color"],yt=["x","y","width","height","fill","stroke","stroke-width","rx"],vt=["x","y","height","width","fill","stroke","stroke-width","rx"],dt={key:0},pt=["d","stroke","stroke-width"],ht=["d","stroke","stroke-width"],ft=["d","stroke","stroke-width"],mt=["d","stroke","stroke-width"],gt={key:4,style:{"pointer-events":"none !important"}},kt=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],xt=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],bt=["x","y","font-size","fill","font-weight","text-anchor"],wt=["x","y","font-size","fill","font-weight"],Bt=["cx","cy","r","fill","stroke","stroke-width"],_t=["cx","cy","r","fill","stroke","stroke-width"],Ct=["x","y","font-size","fill","font-weight","text-anchor"],Nt={key:5},St=["x","y","font-size","fill"],Mt=["x","y","font-size","fill"],$t=["id","transform","font-size","font-weight","fill"],Et={key:6},zt=["x","y","font-size","fill"],Lt=["x","y","font-size","fill"],Vt=["font-size","font-weight","fill","x","y"],At=["id"],Tt=["x","y","width","height"],Pt={key:7},Ot=["x1","x2","y1","y2","stroke-dasharray","stroke","stroke-width","clip-path"],Dt=["x","y","fill","font-size","font-weight"],Ft={key:5,class:"vue-data-ui-watermark"},Wt=["onClick"],qt={key:0,style:{width:"100%",display:"flex","align-items":"center","justify-content":"center"}},It={viewBox:"0 0 20 20",height:"20",width:"20",style:{overflow:"hidden",background:"transparent"}},Xt={key:0},Rt=["innerHTML"],Yt={__name:"vue-ui-scatter",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(Se,{expose:Me}){const{vue_ui_scatter:$e}=s.useConfig(),N=Se,P=e.computed(()=>!!N.dataset&&N.dataset.length),k=e.ref(s.createUid()),Ee=e.ref(null),I=e.ref(!1),X=e.ref(""),K=e.ref(0),T=e.ref(null),Q=e.ref(null),Z=e.ref(null),ee=e.ref(null),te=e.ref(null),le=e.ref(0),ae=e.ref(0),oe=e.ref(0),t=e.computed({get:()=>ue(),set:l=>l}),{userOptionsVisible:R,setUserOptionsVisibility:se,keepUserOptionState:re}=Re.useUserOptionState({config:t.value}),{svgRef:ne}=Ye.useChartAccessibility({config:t.value.style.title});function ue(){const l=Ne.useNestedProp({userConfig:N.config,defaultConfig:$e});return l.theme?{...Ne.useNestedProp({userConfig:s.themes.vue_ui_scatter[l.theme]||N.config,defaultConfig:l}),customPalette:s.themePalettes[l.theme]||s.palette}:l}e.watch(()=>N.config,l=>{t.value=ue(),R.value=!t.value.userOptions.showOnChartHover,ie(),le.value+=1,ae.value+=1,oe.value+=1,B.value.showTable=t.value.table.show,B.value.showTooltip=t.value.style.tooltip.show},{deep:!0});const O=e.ref(null);e.onMounted(()=>{ie()});function ie(){if(s.objectIsEmpty(N.dataset)&&s.error({componentName:"VueUiScatter",type:"dataset"}),t.value.responsive){const l=Be.throttle(()=>{const{width:n,height:a}=Be.useResponsive({chart:T.value,title:t.value.style.title.text?Q.value:null,legend:t.value.style.legend.show?Z.value:null,source:ee.value,noTitle:te.value});requestAnimationFrame(()=>{h.value.width=n,h.value.height=a})});O.value=new ResizeObserver(l),O.value.observe(T.value.parentNode)}}e.onBeforeUnmount(()=>{O.value&&O.value.disconnect()});const{isPrinting:ce,isImaging:ye,generatePdf:ve,generateImage:de}=_e.usePrinter({elementId:`vue-ui-scatter_${k.value}`,fileName:t.value.style.title.text||"vue-ui-scatter"}),ze=e.computed(()=>t.value.userOptions.show&&!t.value.style.title.text),pe=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),B=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.tooltip.show}),h=e.ref({height:t.value.style.layout.height,width:t.value.style.layout.width}),D=e.computed(()=>t.value.style.layout.marginalBars.show?t.value.style.layout.marginalBars.size+t.value.style.layout.marginalBars.offset:0),u=e.computed(()=>({top:t.value.style.layout.padding.top+D.value,right:h.value.width-t.value.style.layout.padding.right-D.value,bottom:h.value.height-t.value.style.layout.padding.bottom,left:t.value.style.layout.padding.left,height:h.value.height-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom-D.value,width:h.value.width-t.value.style.layout.padding.left-t.value.style.layout.padding.right-D.value})),y=e.computed(()=>{N.dataset.forEach((o,i)=>{s.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["values"]}).forEach(f=>{s.error({componentName:"VueUiScatter",type:"datasetSerieAttribute",property:f,index:i})}),o.values&&o.values.forEach((f,E)=>{s.getMissingDatasetAttributes({datasetObject:f,requiredAttributes:["x","y"]}).forEach(A=>{s.error({componentName:"VueUiScatter",type:"datasetSerieAttribute",property:`values.${A}`,index:`${i} - ${E}`})})})});const l=Math.min(...$.value.filter(o=>!p.value.includes(o.id)).flatMap(o=>o.values.map(i=>i.x))),n=Math.max(...$.value.filter(o=>!p.value.includes(o.id)).flatMap(o=>o.values.map(i=>i.x))),a=Math.min(...$.value.filter(o=>!p.value.includes(o.id)).flatMap(o=>o.values.map(i=>i.y))),r=Math.max(...$.value.filter(o=>!p.value.includes(o.id)).flatMap(o=>o.values.map(i=>i.y)));return{xMin:l>=0?0:l,xMax:n,yMin:a>=0?0:a,yMax:r}}),v=e.computed(()=>({x:u.value.left+Math.abs(y.value.xMin)/(y.value.xMax+Math.abs(y.value.xMin))*u.value.width,y:u.value.bottom-Math.abs(y.value.yMin)/(y.value.yMax+Math.abs(y.value.yMin))*u.value.height})),$=e.computed(()=>N.dataset.map((l,n)=>{const a=`cluster_${k.value}_${n}`;return{...l,values:s.largestTriangleThreeBuckets({data:l.values,threshold:t.value.downsample.threshold}),id:a,color:l.color?l.color:pe.value[n]||s.palette[n]||s.palette[n%s.palette.length],opacity:p.value.includes(a)?.5:1,shape:l.shape??"circle",segregate:()=>ke(a),isSegregated:p.value.includes(a)}})),Le=e.computed(()=>({cy:"scatter-div-legend",backgroundColor:t.value.style.legend.backgroundColor,color:t.value.style.legend.color,fontSize:t.value.style.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.legend.bold?"bold":""})),Y=e.computed(()=>$.value.map((l,n)=>({...l,plots:l.values.map(a=>({x:u.value.left+(a.x+Math.abs(y.value.xMin))/(y.value.xMax+Math.abs(y.value.xMin))*u.value.width,y:u.value.bottom-(a.y+Math.abs(y.value.yMin))/(y.value.yMax+Math.abs(y.value.yMin))*u.value.height,v:{...a,name:a.name||""},clusterName:l.name,color:l.color?l.color:pe.value[n]||s.palette[n]||s.palette[n%s.palette.length],id:`plot_${k.value}_${Math.random()}`,weight:a.weight??t.value.style.layout.plots.radius}))})).filter(l=>!p.value.includes(l.id))),x=e.computed(()=>Y.value.map(l=>{const n=l.plots.reduce((d,z)=>d+z.x,0)/l.plots.length,a=l.plots.reduce((d,z)=>d+z.y,0)/l.plots.length;let r=0,o=0,i=0;for(const d of l.plots)r+=(d.x-n)*(d.y-a),o+=(d.x-n)**2,i+=(d.y-a)**2;const f=r/Math.sqrt(o*i),E=f*(Math.sqrt(i)/Math.sqrt(o)),A=a-E*n,C={x1:u.value.left,x2:u.value.right,y1:E*u.value.left+A,y2:E*u.value.right+A,coefficient:f},g=(C.y2-C.y1)/(C.x2-C.x1),w=C.y1-g*C.x1,S=Math.min(h.value.width-t.value.style.layout.padding.right,Math.max(t.value.style.layout.padding.left,(u.value.top-w)/g)),q={x:S,y:g*S+w<=t.value.style.layout.padding.top?u.value.top:g*S+w};return{...l,correlation:C,label:q,plots:l.plots.map(d=>{const z=(d.x+g*d.y-g*w)/(1+Math.pow(g,2)),G=(g*d.x+Math.pow(g,2)*d.y+w)/(1+Math.pow(g,2)),m=Math.sqrt(Math.pow(d.x-z,2)+Math.pow(d.y-G,2));return{...d,deviation:m,shape:l.shape,color:l.color}})}})),he=e.computed(()=>Math.max(...x.value.flatMap(l=>l.plots.map(n=>Math.abs(n.deviation)))));function Ve(){return x.value}function fe(l,n){const a=Array.isArray(l)?l.flatMap(m=>m.plots.map(L=>({x:L.x,y:L.y}))):l.plots.map(m=>({x:m.x,y:m.y}));let r=1/0,o=-1/0,i=1/0,f=-1/0;a.forEach(({x:m,y:L})=>{r=Math.min(r,m),o=Math.max(o,m),i=Math.min(i,L),f=Math.max(f,L)});const E=o-r,A=f-i,C=E/n,g=A/n,w=Array(n).fill(0),S=Array(n).fill(0);a.forEach(({x:m,y:L})=>{const H=Math.floor((m-r)/C),J=Math.floor((L-i)/g);w[H]||(w[H]=0),S[J]||(S[J]=0),w[H]+=1,S[J]+=1});const q=[],d=[];for(let m=0;m<n;m+=1)q.push(r+(m+.5)*C),d.push(i+(m+.5)*g);const z=Math.max(...w),G=Math.max(...S);return{x:w,y:S,avgX:q,avgY:d,maxX:z,maxY:G}}const M=e.computed(()=>t.value.style.layout.marginalBars.tranches),b=e.computed(()=>fe(Y.value,M.value)),Ae=e.computed(()=>{const l=u.value.top-t.value.style.layout.marginalBars.offset,n=u.value.right+t.value.style.layout.marginalBars.offset;return Y.value.map(a=>{const r=fe(a,M.value);return{coords:r,dX:s.createSmoothPath(r.avgX.map((o,i)=>({x:o,y:l-r.x[i]/r.maxX*t.value.style.layout.marginalBars.size}))),dY:s.createSmoothPathVertical(r.avgY.map((o,i)=>({y:o,x:n+t.value.style.layout.marginalBars.size*r.y[i]/r.maxY}))),color:a.color,id:a.id}})}),_=e.ref(void 0),c=e.ref(null),j=e.ref(null);function me(l,n){_.value=l.id,c.value=l;let a="";j.value={datapoint:l,seriesIndex:n,series:x.value,config:t.value};const r=t.value.style.tooltip.customFormat;s.isFunction(r)&&s.functionReturnsString(()=>r({datapoint:l,seriesIndex:n,series:x.value,config:t.value}))?X.value=r({datapoint:l,seriesIndex:n,series:x.value,config:t.value}):(l.clusterName&&(a+=`<div style="display:flex;gap:3px;align-items:center">${l.clusterName}</div>`),l.v.name&&(a+=`<div>${l.v.name}</div>`),a+=`<div style="text-align:left;margin-top:6px;padding-top:6px;border-top:1px solid ${t.value.style.tooltip.borderColor}">`,a+=`<div>${t.value.style.layout.dataLabels.xAxis.name}: <b>${isNaN(l.v.x)?"-":s.applyDataLabel(t.value.style.layout.plots.selectors.labels.x.formatter,l.v.x,s.dataLabel({p:t.value.style.tooltip.prefix,v:l.v.x,s:t.value.style.tooltip.suffix,r:t.value.style.tooltip.roundingValue}),{datapoint:l,seriesIndex:n})}</b></div>`,a+=`<div>${t.value.style.layout.dataLabels.yAxis.name}: <b>${isNaN(l.v.y)?"-":s.applyDataLabel(t.value.style.layout.plots.selectors.labels.y.formatter,l.v.y,s.dataLabel({p:t.value.style.tooltip.prefix,v:l.v.y,s:t.value.style.tooltip.suffix,r:t.value.style.tooltip.roundingValue}),{datapoint:l,seriesIndex:n})}</b></div>`,a+=`${t.value.style.layout.plots.deviation.translation}: <b>${s.dataLabel({v:l.deviation,r:t.value.style.layout.plots.deviation.roundingValue})}</b>`,a+="</div>",X.value=`<div>${a}</div>`),I.value=!0}function ge(){I.value=!1,_.value=void 0,c.value=null}const p=e.ref([]);function ke(l){p.value.includes(l)?p.value=p.value.filter(n=>n!==l):p.value.length<N.dataset.length-1&&p.value.push(l)}function xe(){e.nextTick(()=>{const l=["",t.value.table.translations.correlationCoefficient,t.value.table.translations.nbrPlots,`${t.value.style.layout.dataLabels.xAxis.name} ${t.value.table.translations.average}`,`${t.value.style.layout.dataLabels.yAxis.name} ${t.value.table.translations.average}`],n=x.value.map(o=>[o.name,o.correlation.coefficient,o.plots.length,o.plots.map(i=>i.v.x).reduce((i,f)=>i+f,0)/o.plots.length,o.plots.map(i=>i.v.y).reduce((i,f)=>i+f,0)/o.plots.length]),a=[[t.value.style.title.text],[t.value.style.title.subtitle.text],[[""],[""],[""]]].concat([l]).concat(n),r=s.createCsvContent(a);s.downloadCsv({csvContent:r,title:t.value.style.title.text||"vue-ui-heatmap"})})}const F=e.computed(()=>{const l=[t.value.table.translations.series,t.value.table.translations.correlationCoefficient,t.value.table.translations.nbrPlots,`${t.value.style.layout.dataLabels.xAxis.name} ${t.value.table.translations.average}`,`${t.value.style.layout.dataLabels.yAxis.name} ${t.value.table.translations.average}`],n=x.value.map(r=>[{shape:r.shape,content:r.name,color:r.color},Number((r.correlation.coefficient??0).toFixed(t.value.table.td.roundingValue)).toLocaleString(),r.plots.length.toLocaleString(),Number((r.plots.map(o=>o.v.x??0).reduce((o,i)=>o+i,0)/r.plots.length).toFixed(t.value.table.td.roundingAverage)).toLocaleString(),Number((r.plots.map(o=>o.v.y??0).reduce((o,i)=>o+i,0)/r.plots.length).toFixed(t.value.table.td.roundingAverage)).toLocaleString()]),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{head:l,body:n,config:a,colNames:l}}),V=e.ref(!1);function Te(l){V.value=l,K.value+=1}function be(){B.value.showTable=!B.value.showTable}function we(){B.value.showTooltip=!B.value.showTooltip}const W=e.ref(!1);function U(){W.value=!W.value}return Me({getData:Ve,generatePdf:ve,generateCsv:xe,generateImage:de,toggleTable:be,toggleTooltip:we,toggleAnnotator:U}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-scatter ${V.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"scatterChart",ref:T,id:`vue-ui-scatter_${k.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.backgroundColor};${t.value.responsive?"height: 100%":""}`),onMouseenter:n[2]||(n[2]=()=>e.unref(se)(!0)),onMouseleave:n[3]||(n[3]=()=>e.unref(se)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Xe.PenAndPaper,{key:0,svgRef:e.unref(ne),backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,active:W.value,onClose:U},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),ze.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:te,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:Q,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(Pe._sfc_main,{key:`title_${le.value}`,config:{title:{cy:"scatter-div-title",...t.value.style.title},subtitle:{cy:"scatter-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&P.value&&(e.unref(re)||e.unref(R))?(e.openBlock(),e.createBlock(_e.UserOptions,{ref_key:"details",ref:Ee,key:`user_options_${K.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isImaging:e.unref(ye),isPrinting:e.unref(ce),uid:k.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:B.value.showTooltip,isFullscreen:V.value,titles:{...t.value.userOptions.buttonTitles},chartElement:T.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:W.value,onToggleFullscreen:Te,onGeneratePdf:e.unref(ve),onGenerateCsv:xe,onGenerateImage:e.unref(de),onToggleTable:be,onToggleTooltip:we,onToggleAnnotator:U,style:e.normalizeStyle({visibility:e.unref(re)?e.unref(R)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:a,color:r})=>[e.renderSlot(l.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:a,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:a,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"6"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:r})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:r})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),P.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:ne,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":V.value,"vue-data-ui-fulscreen--off":!V.value}),viewBox:`0 0 ${h.value.width<=0?10:h.value.width} ${h.value.height<=0?10:h.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.color}`)},[e.createVNode(Ie._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:h.value.width<=0?10:h.value.width,height:h.value.height<=0?10:h.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,He)):e.createCommentVNode("",!0),t.value.style.layout.axis.show?(e.openBlock(),e.createElementBlock("g",Je,[e.createElementVNode("line",{x1:v.value.x,x2:v.value.x,y1:u.value.top,y2:u.value.bottom,stroke:t.value.style.layout.axis.stroke,"stroke-width":t.value.style.layout.axis.strokeWidth,"stroke-linecap":"round"},null,8,Ke),e.createElementVNode("line",{x1:u.value.left,x2:u.value.right,y1:v.value.y,y2:v.value.y,stroke:t.value.style.layout.axis.stroke,"stroke-width":t.value.style.layout.axis.strokeWidth,"stroke-linecap":"round"},null,8,Qe)])):e.createCommentVNode("",!0),t.value.style.layout.plots.giftWrap.show?(e.openBlock(),e.createElementBlock("g",Ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(a,r)=>(e.openBlock(),e.createElementBlock("g",null,[a.plots.length>2?(e.openBlock(),e.createElementBlock("polygon",{key:0,points:e.unref(s.giftWrap)({series:a.plots}),fill:e.unref(s.setOpacity)(a.color,t.value.style.layout.plots.giftWrap.fillOpacity*100),"stroke-width":t.value.style.layout.plots.giftWrap.strokeWidth,"stroke-dasharray":t.value.style.layout.plots.giftWrap.strokeDasharray,stroke:a.color,"stroke-linejoin":"round","stroke-linecap":"round"},null,8,et)):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(a,r)=>(e.openBlock(),e.createElementBlock("g",null,[!a.shape||a.shape==="circle"?(e.openBlock(),e.createElementBlock("g",tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(o,i)=>(e.openBlock(),e.createElementBlock("circle",{cx:o.x,cy:o.y,r:_.value&&_.value===o.id?o.weight*2:o.weight,fill:e.unref(s.setOpacity)(a.color,t.value.style.layout.plots.opacity*100),stroke:t.value.style.layout.plots.stroke,"stroke-width":t.value.style.layout.plots.strokeWidth,onMouseover:f=>me(o,r),onMouseleave:ge,style:e.normalizeStyle(`opacity:${_.value&&_.value===o.id?1:t.value.style.layout.plots.significance.useDistanceOpacity?1-Math.abs(o.deviation)/he.value:t.value.style.layout.plots.significance.show&&Math.abs(o.deviation)>t.value.style.layout.plots.significance.deviationThreshold?t.value.style.layout.plots.significance.opacity:1}`)},null,44,lt))),256))])):(e.openBlock(),e.createElementBlock("g",at,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(o,i)=>(e.openBlock(),e.createBlock(Ce._sfc_main,{plot:{x:o.x,y:o.y},radius:_.value&&_.value===o.id?o.weight*2:o.weight,shape:a.shape,color:e.unref(s.setOpacity)(a.color,t.value.style.layout.plots.opacity*100),stroke:t.value.style.layout.plots.stroke,strokeWidth:t.value.style.layout.plots.strokeWidth,onMouseover:f=>me(o,r),onMouseleave:ge,style:e.normalizeStyle(`opacity:${_.value&&_.value===o.id?1:t.value.style.layout.plots.significance.useDistanceOpacity?1-Math.abs(o.deviation)/he.value:t.value.style.layout.plots.significance.show&&Math.abs(o.deviation)>t.value.style.layout.plots.significance.deviationThreshold?t.value.style.layout.plots.significance.opacity:1}`)},null,8,["plot","radius","shape","color","stroke","strokeWidth","onMouseover","style"]))),256))]))]))),256)),t.value.style.layout.marginalBars.show?(e.openBlock(),e.createElementBlock("g",ot,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`marginal_x_${k.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.marginalBars.fill},null,8,rt),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.backgroundColor},null,8,nt)],8,st),e.createElementVNode("linearGradient",{id:`marginal_y_${k.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.backgroundColor},null,8,it),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.layout.marginalBars.fill},null,8,ct)],8,ut)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.x,(a,r)=>(e.openBlock(),e.createElementBlock("g",null,[a&&b.value.avgX[r]?(e.openBlock(),e.createElementBlock("rect",{key:0,x:b.value.avgX[r]-u.value.width/M.value/2,y:u.value.top-t.value.style.layout.marginalBars.offset-a/b.value.maxX*t.value.style.layout.marginalBars.size,width:u.value.width/M.value<=0?1e-4:u.value.width/M.value,height:a/b.value.maxX*t.value.style.layout.marginalBars.size<=0?1e-4:a/b.value.maxX*t.value.style.layout.marginalBars.size,fill:t.value.style.layout.marginalBars.useGradient?`url(#marginal_x_${k.value})`:t.value.style.layout.marginalBars.fill,style:e.normalizeStyle(`opacity:${t.value.style.layout.marginalBars.opacity}`),stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.marginalBars.strokeWidth,rx:t.value.style.layout.marginalBars.borderRadius},null,12,yt)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.y,(a,r)=>(e.openBlock(),e.createElementBlock("g",null,[a&&b.value.avgY[r]?(e.openBlock(),e.createElementBlock("rect",{key:0,x:u.value.right+t.value.style.layout.marginalBars.offset,y:b.value.avgY[r]-u.value.height/M.value/2,height:u.value.height/M.value<=0?1e-4:u.value.height/M.value,width:a/b.value.maxY*t.value.style.layout.marginalBars.size<=0?1e-4:a/b.value.maxY*t.value.style.layout.marginalBars.size,fill:t.value.style.layout.marginalBars.useGradient?`url(#marginal_y_${k.value})`:t.value.style.layout.marginalBars.fill,style:e.normalizeStyle(`opacity:${t.value.style.layout.marginalBars.opacity}`),stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.marginalBars.strokeWidth,rx:t.value.style.layout.marginalBars.borderRadius},null,12,vt)):e.createCommentVNode("",!0)]))),256)),t.value.style.layout.marginalBars.showLines?(e.openBlock(),e.createElementBlock("g",dt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.value,a=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[p.value.includes(a.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${a.dX}`,stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.marginalBars.linesStrokeWidth+1,"stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,pt)),p.value.includes(a.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${a.dX}`,stroke:a.color,"stroke-width":t.value.style.layout.marginalBars.linesStrokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,ht)),p.value.includes(a.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("path",{key:2,d:`M ${a.dY}`,stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.marginalBars.linesStrokeWidth+1,"stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,ft)),p.value.includes(a.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("path",{key:3,d:`M ${a.dY}`,stroke:a.color,"stroke-width":t.value.style.layout.marginalBars.linesStrokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,mt))],64))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),c.value&&t.value.style.layout.plots.selectors.show?(e.openBlock(),e.createElementBlock("g",gt,[e.createElementVNode("line",{x1:v.value.x,x2:c.value.x,y1:c.value.y,y2:c.value.y,stroke:t.value.style.layout.plots.selectors.stroke,"stroke-width":t.value.style.layout.plots.selectors.strokeWidth,"stroke-dasharray":t.value.style.layout.plots.selectors.strokeDasharray,"stroke-linecap":"round",class:"line-pointer"},null,8,kt),e.createElementVNode("line",{x1:c.value.x,x2:c.value.x,y1:v.value.y,y2:c.value.y,stroke:t.value.style.layout.plots.selectors.stroke,"stroke-width":t.value.style.layout.plots.selectors.strokeWidth,"stroke-dasharray":t.value.style.layout.plots.selectors.strokeDasharray,"stroke-linecap":"round",class:"line-pointer"},null,8,xt),e.createElementVNode("text",{x:v.value.x+(c.value.x>v.value.x?-6:6),y:c.value.y+t.value.style.layout.plots.selectors.labels.fontSize/3,"font-size":t.value.style.layout.plots.selectors.labels.fontSize,fill:t.value.style.layout.plots.selectors.labels.color,"font-weight":t.value.style.layout.plots.selectors.labels.bold?"bold":"normal","text-anchor":c.value.x>v.value.x?"end":"start"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.layout.plots.selectors.labels.y.formatter,e.unref(s.checkNaN)(c.value.v.y),e.unref(s.dataLabel)({p:t.value.style.layout.plots.selectors.labels.prefix,v:e.unref(s.checkNaN)(c.value.v.y),s:t.value.style.layout.plots.selectors.labels.suffix,r:t.value.style.layout.plots.selectors.labels.rounding}),{datapoint:c.value})),9,bt),e.createElementVNode("text",{x:c.value.x,y:v.value.y+(c.value.y>v.value.y?-6:t.value.style.layout.plots.selectors.labels.fontSize+6),"font-size":t.value.style.layout.plots.selectors.labels.fontSize,fill:t.value.style.layout.plots.selectors.labels.color,"font-weight":t.value.style.layout.plots.selectors.labels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.layout.plots.selectors.labels.y.formatter,e.unref(s.checkNaN)(c.value.v.x),e.unref(s.dataLabel)({p:t.value.style.layout.plots.selectors.labels.prefix,v:e.unref(s.checkNaN)(c.value.v.x),s:t.value.style.layout.plots.selectors.labels.suffix,r:t.value.style.layout.plots.selectors.labels.rounding}),{datapoint:c.value})),9,wt),e.createElementVNode("circle",{cx:v.value.x,cy:c.value.y,r:t.value.style.layout.plots.selectors.markers.radius,fill:t.value.style.layout.plots.selectors.markers.fill,stroke:t.value.style.layout.plots.selectors.markers.stroke,"stroke-width":t.value.style.layout.plots.selectors.markers.strokeWidth,class:"line-pointer"},null,8,Bt),e.createElementVNode("circle",{cx:c.value.x,cy:v.value.y,r:t.value.style.layout.plots.selectors.markers.radius,fill:t.value.style.layout.plots.selectors.markers.fill,stroke:t.value.style.layout.plots.selectors.markers.stroke,"stroke-width":t.value.style.layout.plots.selectors.markers.strokeWidth,class:"line-pointer"},null,8,_t),t.value.style.layout.plots.selectors.labels.showName?(e.openBlock(),e.createElementBlock("text",{key:0,x:c.value.x,y:c.value.y+(c.value.y<v.value.y?-t.value.style.layout.plots.selectors.labels.fontSize/2:t.value.style.layout.plots.selectors.labels.fontSize),"font-size":t.value.style.layout.plots.selectors.labels.fontSize,fill:t.value.style.layout.plots.selectors.labels.color,"font-weight":t.value.style.layout.plots.selectors.labels.bold?"bold":"normal","text-anchor":c.value.x<u.value.left+100?"start":c.value.x>u.value.right-100?"end":c.value.x>v.value.x?"start":"end"},e.toDisplayString(c.value.v.name),9,Ct)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.layout.dataLabels.xAxis.show?(e.openBlock(),e.createElementBlock("g",Nt,[e.createElementVNode("text",{x:u.value.left-5,y:v.value.y+t.value.style.layout.dataLabels.xAxis.fontSize/3,"text-anchor":"end","font-size":t.value.style.layout.dataLabels.xAxis.fontSize,fill:t.value.style.layout.dataLabels.xAxis.color},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.layout.plots.selectors.labels.x.formatter,e.unref(s.checkNaN)(y.value.xMin),e.unref(s.dataLabel)({p:t.value.style.layout.plots.selectors.labels.prefix,v:e.unref(s.checkNaN)(y.value.xMin),s:t.value.style.layout.plots.selectors.labels.suffix,r:t.value.style.layout.dataLabels.xAxis.rounding}))),9,St),e.createElementVNode("text",{x:u.value.right+3,y:v.value.y+t.value.style.layout.dataLabels.xAxis.fontSize/3,"text-anchor":"start","font-size":t.value.style.layout.dataLabels.xAxis.fontSize,fill:t.value.style.layout.dataLabels.xAxis.color},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.layout.plots.selectors.labels.x.formatter,e.unref(s.checkNaN)(y.value.xMax),e.unref(s.dataLabel)({p:t.value.style.layout.plots.selectors.labels.prefix,v:e.unref(s.checkNaN)(y.value.xMax),s:t.value.style.layout.plots.selectors.labels.suffix,r:t.value.style.layout.dataLabels.xAxis.rounding}))),9,Mt),e.createElementVNode("text",{id:`vue-ui-scatter-xAxis-label-${k.value}`,transform:`translate(${t.value.style.layout.dataLabels.xAxis.fontSize*2}, ${u.value.top+u.value.height/2}), rotate(-90)`,"text-anchor":"middle","font-size":t.value.style.layout.dataLabels.xAxis.fontSize,"font-weight":t.value.style.layout.dataLabels.xAxis.bold?"bold":"normal",fill:t.value.style.layout.dataLabels.xAxis.color},e.toDisplayString(t.value.style.layout.dataLabels.xAxis.name),9,$t)])):e.createCommentVNode("",!0),t.value.style.layout.dataLabels.yAxis.show?(e.openBlock(),e.createElementBlock("g",Et,[e.createElementVNode("text",{x:v.value.x,y:u.value.bottom+t.value.style.layout.dataLabels.yAxis.fontSize+3,"text-anchor":"middle","font-size":t.value.style.layout.dataLabels.yAxis.fontSize,fill:t.value.style.layout.dataLabels.yAxis.color},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.layout.plots.selectors.labels.y.formatter,e.unref(s.checkNaN)(y.value.yMin),e.unref(s.dataLabel)({p:t.value.style.layout.plots.selectors.labels.prefix,v:e.unref(s.checkNaN)(y.value.yMin),s:t.value.style.layout.plots.selectors.labels.suffix,r:t.value.style.layout.dataLabels.yAxis.rounding}))),9,zt),e.createElementVNode("text",{x:v.value.x,y:u.value.top-t.value.style.layout.dataLabels.yAxis.fontSize/2,"text-anchor":"middle","font-size":t.value.style.layout.dataLabels.yAxis.fontSize,fill:t.value.style.layout.dataLabels.yAxis.color},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.layout.plots.selectors.labels.y.formatter,e.unref(s.checkNaN)(y.value.yMax),e.unref(s.dataLabel)({p:t.value.style.layout.plots.selectors.labels.prefix,v:e.unref(s.checkNaN)(y.value.yMax),s:t.value.style.layout.plots.selectors.labels.suffix,r:t.value.style.layout.dataLabels.yAxis.rounding}))),9,Lt),e.createElementVNode("text",{"text-anchor":"middle","font-size":t.value.style.layout.dataLabels.yAxis.fontSize,"font-weight":t.value.style.layout.dataLabels.yAxis.bold?"bold":"normal",fill:t.value.style.layout.dataLabels.yAxis.color,x:u.value.left+u.value.width/2,y:u.value.bottom+8+t.value.style.layout.dataLabels.yAxis.fontSize*2},e.toDisplayString(t.value.style.layout.dataLabels.yAxis.name),9,Vt)])):e.createCommentVNode("",!0),e.createElementVNode("clipPath",{id:`clip_path_${k.value}`},[e.createElementVNode("rect",{x:u.value.left,y:u.value.top,width:u.value.width<=0?1e-4:u.value.width,height:u.value.height<=0?1e-4:u.value.height},null,8,Tt)],8,At),t.value.style.layout.correlation.show?(e.openBlock(),e.createElementBlock("g",Pt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(a,r)=>(e.openBlock(),e.createElementBlock("line",{x1:a.correlation.x1,x2:a.correlation.x2,y1:a.correlation.y1,y2:a.correlation.y2,"stroke-dasharray":t.value.style.layout.correlation.strokeDasharray,stroke:a.color,"stroke-width":t.value.style.layout.correlation.strokeWidth,"clip-path":`url(#clip_path_${k.value})`},null,8,Ot))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(a,r)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.layout.correlation.label.show?(e.openBlock(),e.createElementBlock("text",{key:0,x:a.label.x,y:a.label.y,fill:t.value.style.layout.correlation.label.useSerieColor?a.color:t.value.style.layout.correlation.label.color,"font-size":t.value.style.layout.correlation.label.fontSize,"font-weight":t.value.style.layout.correlation.label.bold?"bold":"normal"},e.toDisplayString(e.unref(s.dataLabel)({v:e.unref(s.checkNaN)(a.correlation.coefficient),r:t.value.style.layout.correlation.label.roundingValue})),9,Dt)):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:h.value},void 0,!0)],14,Ge)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ft,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(ce)||e.unref(ye)})),void 0,!0)])):e.createCommentVNode("",!0),P.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(We.default,{key:6,config:{type:"quadrant",style:{backgroundColor:t.value.style.backgroundColor,quadrant:{grid:{color:t.value.style.layout.axis.stroke},plots:{color:t.value.style.layout.axis.stroke,radius:1}}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:Z},[t.value.style.legend.show?(e.openBlock(),e.createBlock(De.Legend,{key:`legend_${oe.value}`,legendSet:$.value,config:Le.value,onClickMarker:n[0]||(n[0]=({legend:a})=>ke(a.id))},{item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:r=>a.segregate(),style:e.normalizeStyle(`opacity:${p.value.includes(a.id)?.5:1}`)},e.toDisplayString(a.name),13,Wt)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:$.value},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:ee,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Oe._sfc_main,{show:B.value.showTooltip&&I.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,fontSize:t.value.style.tooltip.fontSize,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,offsetY:t.value.style.tooltip.offsetY,parent:T.value,content:X.value,isFullscreen:V.value,isCustom:t.value.style.tooltip.customFormat&&typeof t.value.style.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),default:e.withCtx(()=>[t.value.style.tooltip.showShape?(e.openBlock(),e.createElementBlock("div",qt,[(e.openBlock(),e.createElementBlock("svg",It,[e.createVNode(Ce._sfc_main,{shape:c.value.shape,color:c.value.color,plot:{x:10,y:10},radius:7},null,8,["shape","color"])]))])):e.createCommentVNode("",!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),P.value?(e.openBlock(),e.createBlock(qe.default,{key:8,hideDetails:"",config:{open:B.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color},head:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Fe.DataTable,{key:`table_${ae.value}`,colNames:F.value.colNames,head:F.value.head,body:F.value.body,config:F.value.config,title:`${t.value.style.title.text}${t.value.style.title.subtitle.text?` : ${t.value.style.title.subtitle.text}`:""}`,onClose:n[1]||(n[1]=a=>B.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createTextVNode(e.toDisplayString(a),1)]),td:e.withCtx(({td:a})=>[a.shape?(e.openBlock(),e.createElementBlock("div",Xt,[e.createElementVNode("span",null,e.toDisplayString(a.content),1)])):(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:a},null,8,Rt))]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Ue))}},jt=je._export_sfc(Yt,[["__scopeId","data-v-fef2b0c8"]]);exports.default=jt;
;