vue-data-ui-hq
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
10 lines (9 loc) • 24.9 kB
JavaScript
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-ZfICPrrM.cjs"),K=require("./useResponsive-BJ7DTGpm.cjs"),ce=require("./Title-FbHK83tB.cjs"),Q=require("./usePrinter-B-gh2f22.cjs"),de=require("./DataTable-CC6dPSer.cjs"),fe=require("./vue-ui-skeleton-Bvmpr51u.cjs"),he=require("./Legend-HgHPyA_4.cjs"),ye=require("./vue-ui-accordion-Dp6uTsJi.cjs"),ee=require("./useNestedProp-C14rfl0j.cjs"),me=require("./PackageVersion-D3dK8oA3.cjs"),be=require("./PenAndPaper-PL3bp4ud.cjs"),pe=require("./useUserOptionState-BgepsfED.cjs"),ge=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ve=["id"],ke=["xmlns","viewBox"],_e=["x","y","width","height"],xe={key:1},Ce=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],we={key:2},Be=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Ne=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Ee={key:3},$e=["x","y","font-size","fill","font-weight"],Le=["x","y","font-size","fill"],Se={key:4},Ve=["x","y","font-size","fill","font-weight"],ze=["id"],Ae=["stop-color"],Pe=["stop-color"],Te=["stop-color"],Xe=["id"],De=["stop-color"],Oe=["stop-color"],Fe=["stop-color"],Me=["id"],Ge=["stop-color"],Ie=["stop-color"],qe=["id"],He=["stop-color"],Ue=["stop-color"],Re={key:0},We=["d","fill"],je={key:1},Ye=["x","y","height","width","fill"],Ze=["cx","cy","r","fill","stroke","stroke-width"],Je=["cx","cy","r","fill","stroke","stroke-width"],Ke={key:2},Qe=["x","y","fill","font-size"],et={key:3},tt=["x","y","fill","font-size"],rt={key:5,class:"vue-data-ui-watermark"},lt=["xmlns","height","width"],nt=["fill"],ot=["innerHTML"],at={__name:"vue-ui-dumbbell",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(te,{expose:re,emit:ut}){const{vue_ui_dumbbell:le}=a.useConfig(),y=te,p=e.computed({get(){return!!y.dataset&&y.dataset.length},set(l){return l}}),d=e.ref(a.createUid()),V=e.ref(0),g=e.ref(null),z=e.ref(null),A=e.ref(null),P=e.ref(null),T=e.ref(null),X=e.ref(0),D=e.ref(0),O=e.ref(0),t=e.computed({get:()=>G(),set:l=>l}),{userOptionsVisible:E,setUserOptionsVisibility:F,keepUserOptionState:M}=pe.useUserOptionState({config:t.value});function G(){const l=ee.useNestedProp({userConfig:y.config,defaultConfig:le});return l.theme?{...ee.useNestedProp({userConfig:a.themes.vue_ui_dumbbell[l.theme]||y.config,defaultConfig:l})}:l}e.watch(()=>y.config,l=>{t.value=G(),E.value=!t.value.showOnChartHover,I(),X.value+=1,D.value+=1,O.value+=1,c.value=t.value.style.chart.rowHeight,v.value=t.value.style.chart.width},{deep:!0}),e.watch(()=>y.dataset,l=>{j()},{deep:!0});const _=e.ref(null);e.onMounted(()=>{I()});function I(){if(a.objectIsEmpty(y.dataset)?a.error({componentName:"VueUiDumbbell",type:"dataset"}):y.dataset.forEach((l,s)=>{a.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","start","end"]}).forEach(r=>{p.value=!1,a.error({componentName:"VueUiDumbbell",type:"datasetSerieAttribute",property:r,index:s})})}),t.value.responsive){const l=K.throttle(()=>{const{width:s,height:r}=K.useResponsive({chart:g.value,title:t.value.style.chart.title.text?z.value:null,legend:t.value.style.chart.legend.show?A.value:null,source:P.value,noTitle:T.value});v.value=s,c.value=r/y.dataset.length,f.value=C()});_.value=new ResizeObserver(l),_.value.observe(g.value.parentNode)}}e.onBeforeUnmount(()=>{_.value&&_.value.disconnect()});const{isPrinting:q,isImaging:H,generatePdf:U,generateImage:R}=Q.usePrinter({elementId:`dumbbell_${d.value}`,fileName:t.value.style.chart.title.text||"vue-ui-dumbbell"}),ne=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),x=e.ref({showTable:t.value.table.show}),m=e.computed(()=>y.dataset.map((l,s)=>({...l,start:a.checkNaN(l.start),end:a.checkNaN(l.end),id:a.createUid()}))),$=e.computed(()=>({max:Math.max(...m.value.flatMap(l=>[l.start,l.end])),min:Math.min(...m.value.flatMap(l=>[l.start,l.end]))})),i=e.computed(()=>a.calculateNiceScale($.value.min<0?$.value.min:0,$.value.max,t.value.style.chart.grid.scaleSteps)),c=e.ref(t.value.style.chart.rowHeight),v=e.ref(t.value.style.chart.width),n=e.computed(()=>{const l=c.value,s=t.value.style.chart.padding.left+t.value.style.chart.padding.right+v.value,r=t.value.style.chart.padding.top+t.value.style.chart.padding.bottom+l*y.dataset.length,o=i.value.ticks.length*(v.value/i.value.ticks.length);return{left:t.value.style.chart.padding.left,right:s-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,bottom:r-t.value.style.chart.padding.bottom,width:v.value,height:l*y.dataset.length,rowHeight:l,absoluteHeight:r,absoluteWidth:s,widthPlotReference:o}});function C(){return m.value.map((l,s)=>{const r=n.value.left+(l.start+Math.abs(i.value.min))/(i.value.max+Math.abs(i.value.min))*n.value.widthPlotReference,o=n.value.left+(l.end+Math.abs(i.value.min))/(i.value.max+Math.abs(i.value.min))*n.value.widthPlotReference,u=r+(o-r)/2;return{...l,startX:r,endX:o,centerX:u,y:n.value.top+s*c.value+c.value/2,endVal:l.start}})}const f=e.ref([]),W=e.ref(null),oe=e.computed(()=>m.value.map(l=>l.end).reduce((l,s)=>l+s,0));e.onMounted(()=>{j()});function j(){f.value=C();let l=f.value.map(r=>r.start).reduce((r,o)=>r+o,0);function s(){const r=m.value.map(o=>o.end-o.start);l>=oe.value?(cancelAnimationFrame(W.value),f.value=C()):(f.value=f.value.map((o,u)=>{o.endVal+=r[u]*(t.value.animationSpeed/100);const h=n.value.left+(o.start+Math.abs(i.value.min))/(i.value.max+Math.abs(i.value.min))*n.value.widthPlotReference,N=n.value.left+(o.endVal+Math.abs(i.value.min))/(i.value.max+Math.abs(i.value.min))*n.value.widthPlotReference,S=h+(N-h)/2;return{...o,startX:h,endX:N,centerX:S,y:n.value.top+u*c.value+c.value/2,endVal:o.endVal}}),l=f.value.map(o=>o.endVal).reduce((o,u)=>o+u,0),W.value=requestAnimationFrame(s))}t.value.useAnimation?s():f.value=C()}const Y=e.computed(()=>[{name:t.value.style.chart.legend.labelStart,color:t.value.style.chart.plots.gradient.show?`url(#start_grad_${d.value})`:t.value.style.chart.plots.startColor},{name:t.value.style.chart.legend.labelEnd,color:t.value.style.chart.plots.gradient.show?`url(#end_grad_${d.value})`:t.value.style.chart.plots.endColor}]),ae=e.computed(()=>({cy:"donut-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,paddingTop:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),b=e.computed(()=>{const l=f.value.map(r=>({name:r.name})),s=f.value.map(r=>({start:r.start,end:r.end}));return{head:l,body:s}}),w=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],s=b.value.head.map((u,h)=>{const N=a.dataLabel({p:t.value.style.chart.labels.prefix,v:b.value.body[h].start,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),S=a.dataLabel({p:t.value.style.chart.labels.prefix,v:b.value.body[h].end,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),ie=a.dataLabel({v:100*(b.value.body[h].end/b.value.body[h].start-1),s:"%",r:t.value.table.td.roundingPercentage});return[{name:u.name},N,S,ie]}),r={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.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],head:l,body:s,config:r}});function Z(){e.nextTick(()=>{const l=b.value.head.map((o,u)=>[[o.name],[b.value.body[u].start],[b.value.body[u].end]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.start],[t.value.table.columnNames.end]]].concat(l),r=a.createCsvContent(s);a.downloadCsv({csvContent:r,title:t.value.style.chart.title.text||"vue-ui-dumbbell"})})}const k=e.ref(!1);function se(l){k.value=l,V.value+=1}function ue(){return f.value}function J(){x.value.showTable=!x.value.showTable}const B=e.ref(!1);function L(){B.value=!B.value}return re({getData:ue,generatePdf:U,generateCsv:Z,generateImage:R,toggleTable:J,toggleAnnotator:L}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dumbbellChart",ref:g,class:e.normalizeClass(`vue-ui-dumbbell ${e.unref(k)?"vue-data-ui-wrapper-fullscreen":""}`),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%":""}`),id:`dumbbell_${e.unref(d)}`,onMouseenter:s[1]||(s[1]=()=>e.unref(F)(!0)),onMouseleave:s[2]||(s[2]=()=>e.unref(F)(!1))},[e.unref(t).userOptions.buttons.annotator?(e.openBlock(),e.createBlock(be.PenAndPaper,{key:0,parent:e.unref(g),backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color,active:e.unref(B),onClose:L},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),e.unref(ne)?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:T,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:z,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ce._sfc_main,{key:`title_${e.unref(X)}`,config:{title:{cy:"donut-div-title",...e.unref(t).style.chart.title},subtitle:{cy:"donut-div-subtitle",...e.unref(t).style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),e.unref(t).userOptions.show&&e.unref(p)&&(e.unref(M)||e.unref(E))?(e.openBlock(),e.createBlock(Q.UserOptions,{ref:"details",key:`user_option_${e.unref(V)}`,backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color,isPrinting:e.unref(q),isImaging:e.unref(H),uid:e.unref(d),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(k),titles:{...e.unref(t).userOptions.buttonTitles},chartElement:e.unref(g),position:e.unref(t).userOptions.position,hasAnnotator:e.unref(t).userOptions.buttons.annotator,isAnnotation:e.unref(B),onToggleFullscreen:se,onGeneratePdf:e.unref(U),onGenerateCsv:Z,onGenerateImage:e.unref(R),onToggleTable:J,onToggleAnnotator:L,style:e.normalizeStyle({visibility:e.unref(M)?e.unref(E)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:r,isFullscreen:o})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:r,isFullscreen:o})),void 0,!0)]),key:"4"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:r,isAnnotator:o})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:r,isAnnotator:o})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","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(k),"vue-data-ui-fulscreen--off":!e.unref(k)}),viewBox:`0 0 ${e.unref(n).absoluteWidth<=0?10:e.unref(n).absoluteWidth} ${e.unref(n).absoluteHeight<=0?10:e.unref(n).absoluteHeight}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${e.unref(t).style.chart.color}`)},[e.createVNode(me._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:e.unref(n).left,y:e.unref(n).top,width:e.unref(n).width,height:e.unref(n).height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,_e)):e.createCommentVNode("",!0),e.unref(t).style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i).ticks,(r,o)=>(e.openBlock(),e.createElementBlock("line",{x1:e.unref(n).left+o*e.unref(n).width/(e.unref(i).ticks.length-1),x2:e.unref(n).left+o*e.unref(n).width/(e.unref(i).ticks.length-1),y1:e.unref(n).top,y2:e.unref(n).bottom,stroke:e.unref(t).style.chart.grid.verticalGrid.stroke,"stroke-width":e.unref(t).style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":e.unref(t).style.chart.grid.verticalGrid.strokeDasharray},null,8,Ce))),256))])):e.createCommentVNode("",!0),e.unref(t).style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",we,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),(r,o)=>(e.openBlock(),e.createElementBlock("line",{x1:e.unref(n).left,x2:e.unref(n).right,y1:e.unref(n).top+o*e.unref(c),y2:e.unref(n).top+o*e.unref(c),stroke:e.unref(t).style.chart.grid.horizontalGrid.stroke,"stroke-width":e.unref(t).style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":e.unref(t).style.chart.grid.horizontalGrid.strokeDasharray},null,8,Be))),256)),e.createElementVNode("line",{x1:e.unref(n).left,x2:e.unref(n).right,y1:e.unref(n).bottom,y2:e.unref(n).bottom,stroke:e.unref(t).style.chart.grid.horizontalGrid.stroke,"stroke-width":e.unref(t).style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":e.unref(t).style.chart.grid.horizontalGrid.strokeDasharray},null,8,Ne)])):e.createCommentVNode("",!0),e.unref(t).style.chart.labels.yAxisLabels.show?(e.openBlock(),e.createElementBlock("g",Ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),(r,o)=>(e.openBlock(),e.createElementBlock("text",{x:e.unref(n).left-6+e.unref(t).style.chart.labels.yAxisLabels.offsetX,y:e.unref(n).top+o*e.unref(c)+(e.unref(t).style.chart.labels.yAxisLabels.showProgression?e.unref(c)/3:e.unref(c)/2)+e.unref(t).style.chart.labels.yAxisLabels.fontSize/3,"font-size":e.unref(t).style.chart.labels.yAxisLabels.fontSize,fill:e.unref(t).style.chart.labels.yAxisLabels.color,"font-weight":e.unref(t).style.chart.labels.yAxisLabels.bold?"bold":"normal","text-anchor":"end"},e.toDisplayString(r.name),9,$e))),256)),e.unref(t).style.chart.labels.yAxisLabels.showProgression?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(m),(r,o)=>(e.openBlock(),e.createElementBlock("text",{x:e.unref(n).left-6+e.unref(t).style.chart.labels.yAxisLabels.offsetX,y:e.unref(n).top+o*e.unref(c)+e.unref(c)/1.3+e.unref(t).style.chart.labels.yAxisLabels.fontSize/3,"font-size":e.unref(t).style.chart.labels.yAxisLabels.fontSize,fill:e.unref(t).style.chart.labels.yAxisLabels.color,"text-anchor":"end"},e.toDisplayString(e.unref(a.dataLabel)({v:100*(r.end/r.start-1),s:"%",r:e.unref(t).style.chart.labels.yAxisLabels.rounding})),9,Le))),256)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.unref(t).style.chart.labels.xAxisLabels.show?(e.openBlock(),e.createElementBlock("g",Se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i).ticks,(r,o)=>(e.openBlock(),e.createElementBlock("text",{x:e.unref(n).left+o*(e.unref(n).width/(e.unref(i).ticks.length-1)),y:e.unref(n).bottom+e.unref(t).style.chart.labels.xAxisLabels.fontSize+e.unref(t).style.chart.labels.xAxisLabels.offsetY,"font-size":e.unref(t).style.chart.labels.xAxisLabels.fontSize,fill:e.unref(t).style.chart.labels.xAxisLabels.color,"font-weight":e.unref(t).style.chart.labels.xAxisLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(e.unref(a.applyDataLabel)(e.unref(t).style.chart.labels.formatter,r,e.unref(a.dataLabel)({p:e.unref(t).style.chart.labels.prefix,v:r,s:e.unref(t).style.chart.labels.suffix,r:e.unref(t).style.chart.labels.xAxisLabels.rounding}),{datapoint:r,seriesIndex:o})),9,Ve))),256))])):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`start_grad_${e.unref(d)}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(a.lightenHexColor)(e.unref(t).style.chart.plots.startColor,e.unref(t).style.chart.plots.gradient.intensity/100)},null,8,Ae),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(a.darkenHexColor)(e.unref(t).style.chart.plots.startColor,.1)},null,8,Pe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(t).style.chart.plots.startColor},null,8,Te)],8,ze),e.createElementVNode("radialGradient",{id:`end_grad_${e.unref(d)}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(a.lightenHexColor)(e.unref(t).style.chart.plots.endColor,e.unref(t).style.chart.plots.gradient.intensity/100)},null,8,De),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(a.darkenHexColor)(e.unref(t).style.chart.plots.endColor,.1)},null,8,Oe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(t).style.chart.plots.endColor},null,8,Fe)],8,Xe)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f),(r,o)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`grad_positive_${e.unref(d)}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(t).style.chart.plots.startColor},null,8,Ge),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(t).style.chart.plots.endColor},null,8,Ie)],8,Me),e.createElementVNode("linearGradient",{id:`grad_negative_${e.unref(d)}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(t).style.chart.plots.endColor},null,8,He),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(t).style.chart.plots.startColor},null,8,Ue)],8,qe)]),e.unref(t).style.chart.plots.link.type==="curved"?(e.openBlock(),e.createElementBlock("g",Re,[e.createElementVNode("path",{d:`M
${r.startX},${r.y+e.unref(t).style.chart.plots.radius/2}
C ${r.centerX},${r.y} ${r.centerX},${r.y}
${r.endX},${r.y+e.unref(t).style.chart.plots.radius/2}
L ${r.endX},${r.y-e.unref(t).style.chart.plots.radius/2}
C ${r.centerX},${r.y} ${r.centerX},${r.y}
${r.startX},${r.y-e.unref(t).style.chart.plots.radius/2}
Z
`,fill:r.endX>r.startX?`url(#grad_positive_${e.unref(d)})`:`url(#grad_negative_${e.unref(d)})`},null,8,We)])):(e.openBlock(),e.createElementBlock("g",je,[e.createElementVNode("rect",{x:r.endX>r.startX?r.startX:r.endX,y:r.y-e.unref(t).style.chart.plots.link.strokeWidth/2,height:e.unref(t).style.chart.plots.link.strokeWidth,width:Math.abs(r.endX-r.startX),fill:r.endX>r.startX?`url(#grad_positive_${e.unref(d)})`:`url(#grad_negative_${e.unref(d)})`},null,8,Ye)])),e.createElementVNode("circle",{cx:r.startX,cy:r.y,r:e.unref(t).style.chart.plots.radius,fill:e.unref(t).style.chart.plots.gradient.show?`url(#start_grad_${e.unref(d)})`:e.unref(t).style.chart.plots.startColor,stroke:e.unref(t).style.chart.plots.stroke,"stroke-width":e.unref(t).style.chart.plots.strokeWidth},null,8,Ze),e.createElementVNode("circle",{cx:r.endX,cy:r.y,r:e.unref(t).style.chart.plots.radius,fill:e.unref(t).style.chart.plots.gradient.show?`url(#end_grad_${e.unref(d)})`:e.unref(t).style.chart.plots.endColor,stroke:e.unref(t).style.chart.plots.stroke,"stroke-width":e.unref(t).style.chart.plots.strokeWidth},null,8,Je),e.unref(t).style.chart.labels.startLabels.show?(e.openBlock(),e.createElementBlock("g",Ke,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f),(u,h)=>(e.openBlock(),e.createElementBlock("text",{x:u.startX,y:e.unref(n).top+(h+1)*e.unref(c)-e.unref(t).style.chart.labels.startLabels.fontSize/3+e.unref(t).style.chart.labels.startLabels.offsetY,fill:e.unref(t).style.chart.labels.startLabels.useStartColor?e.unref(t).style.chart.plots.startColor:e.unref(t).style.chart.labels.startLabels.color,"font-size":e.unref(t).style.chart.labels.startLabels.fontSize,"text-anchor":"middle"},e.toDisplayString(e.unref(a.applyDataLabel)(e.unref(t).style.chart.labels.formatter,u.start,e.unref(a.dataLabel)({p:e.unref(t).style.chart.labels.prefix,v:u.start,s:e.unref(t).style.chart.labels.suffix,r:e.unref(t).style.chart.labels.startLabels.rounding}),{datapoint:u,seriesIndex:h})),9,Qe))),256))])):e.createCommentVNode("",!0),e.unref(t).style.chart.labels.endLabels.show?(e.openBlock(),e.createElementBlock("g",et,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f),(u,h)=>(e.openBlock(),e.createElementBlock("text",{x:u.endX,y:e.unref(n).top+h*e.unref(c)+e.unref(t).style.chart.labels.endLabels.fontSize+e.unref(t).style.chart.labels.endLabels.offsetY,fill:e.unref(t).style.chart.labels.endLabels.useEndColor?e.unref(t).style.chart.plots.endColor:e.unref(t).style.chart.labels.endLabels.color,"font-size":e.unref(t).style.chart.labels.endLabels.fontSize,"text-anchor":"middle"},e.toDisplayString(e.unref(a.applyDataLabel)(e.unref(t).style.chart.labels.formatter,u.end,e.unref(a.dataLabel)({p:e.unref(t).style.chart.labels.prefix,v:u.end,s:e.unref(t).style.chart.labels.suffix,r:e.unref(t).style.chart.labels.endLabels.rounding}),{datapoint:u,seriesIndex:h})),9,tt))),256))])):e.createCommentVNode("",!0)]))),256)),e.renderSlot(l.$slots,"svg",{svg:e.unref(n)},void 0,!0)],14,ke)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",rt,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(q)||e.unref(H)})),void 0,!0)])):e.createCommentVNode("",!0),e.unref(p)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(fe.default,{key:6,config:{type:"dumbbell",style:{backgroundColor:e.unref(t).style.chart.backgroundColor,dumbbell:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:A},[e.unref(t).style.chart.legend.show&&e.unref(p)?(e.openBlock(),e.createBlock(he.Legend,{key:`legend_${e.unref(O)}`,legendSet:e.unref(Y),config:e.unref(ae)},{item:e.withCtx(({legend:r})=>[e.createElementVNode("div",{style:e.normalizeStyle(`display:flex;align-items:center;gap:4px;font-size:${e.unref(t).style.chart.legend.fontSize}px`)},[(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(a.XMLNS),viewBox:"0 0 20 20",height:e.unref(t).style.chart.legend.fontSize,width:e.unref(t).style.chart.legend.fontSize},[e.createElementVNode("circle",{cx:10,cy:10,r:9,fill:r.color},null,8,nt)],8,lt)),e.createTextVNode(" "+e.toDisplayString(r.name),1)],4)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:e.unref(Y)},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:P,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.unref(p)?(e.openBlock(),e.createBlock(ye.default,{key:8,hideDetails:"",config:{open:e.unref(x).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(D)}`,colNames:e.unref(w).colNames,head:e.unref(w).head,body:e.unref(w).body,config:e.unref(w).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:s[0]||(s[0]=r=>e.unref(x).showTable=!1)},{th:e.withCtx(({th:r})=>[e.createElementVNode("div",{innerHTML:r,style:{display:"flex","align-items":"center"}},null,8,ot)]),td:e.withCtx(({td:r})=>[e.createTextVNode(e.toDisplayString(r.name||r),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,ve))}},st=ge._export_sfc(at,[["__scopeId","data-v-11bf02e1"]]);exports.default=st;
;