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