UNPKG

vue-data-ui

Version:

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

2 lines (1 loc) • 34.8 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-B7zOq_yO.cjs"),je=require("./useUserOptionState-BgepsfED.cjs"),Je=require("./useChartAccessibility-Cm7nkzTG.cjs"),Be=require("./usePrinter-u4erwqXt.cjs"),Ee=require("./useResponsive-DQmBAoBf.cjs"),Se=require("./useNestedProp-DUH233CH.cjs"),Ke=require("./vue-ui-accordion-DkOSgEPp.cjs"),Qe=require("./BaseIcon-CObkWSlF.cjs"),$e=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ze=require("./DataTable-DypMcnH2.cjs"),et=require("./Legend-DUZ-tBhF.cjs"),tt=require("./PenAndPaper-CU0ABvzv.cjs"),lt=require("./Shape-x9QWqySR.cjs"),at=require("./vue-ui-skeleton-Br6xw2QW.cjs"),ot=require("./Title-LLvOAGEi.cjs"),rt=require("./vue-ui-xy-CHcCU9pB.cjs"),nt=["xmlns"],st={class:"modal-title"},it={class:"modal-body"},ut={__name:"BaseDraggableDialog",props:{backgroundColor:{type:String},color:{type:String},headerBg:{type:String},headerColor:{type:String}},emits:["close"],setup($,{expose:K,emit:Q}){e.useCssVars(i=>({b93256ca:$.color}));const Z=$,p=Q,b=e.ref(!1),V=e.ref(!1),r=e.reactive({left:window.innerWidth/2-200,top:window.innerHeight/2-120,width:400,height:400,dragging:!1,resizing:!1,dragOffsetX:0,dragOffsetY:0,pointerStartX:0,pointerStartY:0,resizeStartW:0,resizeStartH:0});function Y(){b.value=!0,e.nextTick(()=>{V.value||(r.left=Math.max(0,window.innerWidth/2-r.width/2),r.top=Math.max(0,window.innerHeight/2-r.height/2),V.value=!0)})}function O(){b.value=!1,p("close")}K({open:Y,close:O});const P=e.computed(()=>({position:"fixed",left:`${r.left}px`,top:`${r.top}px`,width:`${r.width}px`,height:`${r.height}px`,padding:0,border:"none",background:Z.backgroundColor,boxShadow:"0 4px 24px rgba(0,0,0,0.15)",zIndex:9999,overflow:"visible",borderRadius:"2px"}));function C(i){return i.touches&&i.touches.length?{x:i.touches[0].clientX,y:i.touches[0].clientY}:{x:i.clientX,y:i.clientY}}function F(i){var v;(v=i.preventDefault)==null||v.call(i),r.dragging=!0;const d=C(i);r.dragOffsetX=d.x-r.left,r.dragOffsetY=d.y-r.top,document.addEventListener("mousemove",A),document.addEventListener("mouseup",N),document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",N)}function A(i){var t;if(!r.dragging)return;(t=i.preventDefault)==null||t.call(i);const d=C(i);let v=d.x-r.dragOffsetX,w=d.y-r.dragOffsetY;v=Math.max(0,Math.min(v,window.innerWidth-r.width)),w=Math.max(0,Math.min(w,window.innerHeight-r.height)),r.left=v,r.top=w}function N(){r.dragging=!1,document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",N),document.removeEventListener("touchmove",A),document.removeEventListener("touchend",N)}function I(i){var v;(v=i.preventDefault)==null||v.call(i),r.resizing=!0;const d=C(i);r.pointerStartX=d.x,r.pointerStartY=d.y,r.resizeStartW=r.width,r.resizeStartH=r.height,document.addEventListener("mousemove",f),document.addEventListener("mouseup",E),document.addEventListener("touchmove",f,{passive:!1}),document.addEventListener("touchend",E)}function f(i){var t;if(!r.resizing)return;(t=i.preventDefault)==null||t.call(i);const d=C(i);let v=d.x-r.pointerStartX,w=d.y-r.pointerStartY;r.width=Math.max(240,r.resizeStartW+v),r.height=Math.max(400,r.resizeStartH+w)}function E(){r.resizing=!1,document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",E),document.removeEventListener("touchmove",f),document.removeEventListener("touchend",E)}function G(i){var v;(v=i.preventDefault)==null||v.call(i),r.resizing=!0;const d=C(i);r.pointerStartX=d.x,r.pointerStartY=d.y,r.resizeStartW=r.width,r.resizeStartH=r.height,r.resizeStartLeft=r.left,r.resizeStartTop=r.top,document.addEventListener("mousemove",z),document.addEventListener("mouseup",h),document.addEventListener("touchmove",z,{passive:!1}),document.addEventListener("touchend",h)}function z(i){var R;if(!r.resizing)return;(R=i.preventDefault)==null||R.call(i);const d=C(i);let v=d.x-r.pointerStartX,w=Math.min(Math.max(0,r.resizeStartLeft+v),r.resizeStartLeft+r.resizeStartW-240),t=r.resizeStartW-(w-r.resizeStartLeft),y=d.y-r.pointerStartY,X=Math.max(400,r.resizeStartH+y);r.left=w,r.width=t,r.height=X}function h(){r.resizing=!1,document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",h),document.removeEventListener("touchmove",z),document.removeEventListener("touchend",h)}return e.onUnmounted(()=>{N(),E(),h()}),(i,d)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[b.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"modal vue-ui-draggable-dialog",style:e.normalizeStyle(P.value),onClick:d[0]||(d[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"modal-header",style:e.normalizeStyle({backgroundColor:$.headerBg,color:$.headerColor})},[e.createElementVNode("span",{class:"drag-handle",onMousedown:e.withModifiers(F,["stop","prevent"]),onTouchstart:e.withModifiers(F,["stop","prevent"])},[(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(u.XMLNS),width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},d[1]||(d[1]=[e.createElementVNode("path",{d:"M5 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),e.createElementVNode("path",{d:"M5 15m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),e.createElementVNode("path",{d:"M12 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),e.createElementVNode("path",{d:"M12 15m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),e.createElementVNode("path",{d:"M19 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),e.createElementVNode("path",{d:"M19 15m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1)]),8,nt))],32),e.createElementVNode("span",st,[e.renderSlot(i.$slots,"title",{},void 0,!0)]),e.createElementVNode("button",{class:"close",onClick:O},[e.createVNode(Qe.default,{name:"close",stroke:$.headerColor},null,8,["stroke"])])],4),e.createElementVNode("div",it,[e.renderSlot(i.$slots,"default",{},void 0,!0)]),e.createElementVNode("div",{class:"resize-handle",onMousedown:e.withModifiers(I,["stop","prevent"]),onTouchstart:e.withModifiers(I,["stop","prevent"])},null,32),e.createElementVNode("div",{class:"resize-handle resize-handle-left",onMousedown:e.withModifiers(G,["stop","prevent"]),onTouchstart:e.withModifiers(G,["stop","prevent"])},null,32)],4)):e.createCommentVNode("",!0)]))}},ct=$e._export_sfc(ut,[["__scopeId","data-v-1344ad9f"]]),dt=["id"],ht=["xmlns","viewBox"],vt=["id"],mt=["stop-color"],ft=["stop-color"],pt=["stop-color"],gt=["stop-color"],yt=["id"],kt=["stop-color"],xt=["stop-color"],bt=["stop-color"],wt=["stop-color"],Ct={key:0},Bt=["fill","d"],Et=["stroke","stroke-width","d"],St=["fill","d"],$t=["stroke","stroke-dasharray","stroke-width","d"],At=["x1","y1","x2","y2","stroke","stroke-width","stroke-dasharray"],Nt=["cx","cy","stroke","stroke-width","r","fill"],zt=["x","y","font-size","font-weight","fill","text-decoration","onMouseenter","onClick"],Lt={key:0},Mt=["font-size","fill","font-weight","transform","text-anchor"],_t=["x","y","width","height","onMouseenter","onClick"],Vt=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Pt=["cx","cy","stroke","stroke-width","r","fill"],Tt=["x","y","text-anchor","font-size","fill"],Dt={key:5,class:"vue-data-ui-watermark"},Ot=["onClick"],Ft=["innerHTML"],It={__name:"vue-ui-ridgeline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint","selectX"],setup($,{expose:K,emit:Q}){const{vue_ui_ridgeline:Z}=u.useConfig(),p=$,b=e.computed({get(){return!!p.dataset&&p.dataset.length},set(a){return a}}),V=Q,r=e.ref(null),Y=e.ref(null),O=e.ref(null),P=e.ref(null),C=e.ref(null),F=e.ref(null),A=e.ref(0),N=e.ref(0),I=e.ref(0),f=e.ref(u.createUid()),E=e.ref(0),G=e.ref(0),z=e.ref(512),h=e.ref(null),i=e.ref(null),d=e.ref(null),v=e.ref(0);function w(){const a=Se.useNestedProp({userConfig:p.config,defaultConfig:Z});return a.theme?{...Se.useNestedProp({userConfig:u.themes.vue_ui_ridgeline[a.theme]||p.config,defaultConfig:a}),customPalette:u.themePalettes[a.theme]||u.palette}:a}const t=e.computed({get:()=>w(),set:a=>a}),y=e.ref(Math.min(t.value.style.chart.areas.height,t.value.style.chart.areas.rowHeight)),{userOptionsVisible:X,setUserOptionsVisibility:R,keepUserOptionState:ne}=je.useUserOptionState({config:t.value}),{svgRef:ee}=Je.useChartAccessibility({config:t.value.style.chart.title});e.onMounted(te),e.onBeforeUnmount(()=>{P.value&&P.value.disconnect()});function te(){if(u.objectIsEmpty(p.dataset)?u.error({componentName:"VueUiRidgeline",type:"dataset"}):p.dataset.forEach((a,s)=>{u.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","datapoints"]}).forEach(l=>{b.value=!1,u.error({componentName:"VueUiRidgeline",type:"datasetSerieAttribute",property:l,index:s})}),a.datapoints.length&&a.datapoints.forEach((l,n)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{b.value=!1,u.error({componentName:"VueUiRidgeline",type:"datasetSerieAttribute",property:`datapoint.${o}`,index:`${s}-${n}`})})})}),G.value=p.dataset.length,y.value=Math.min(t.value.style.chart.areas.height,t.value.style.chart.areas.rowHeight),t.value.responsive){const a=Ee.throttle(()=>{const{width:s,height:l}=Ee.useResponsive({chart:r.value,title:t.value.style.chart.title.text?Y.value:null,legend:t.value.style.chart.legend.show?O.value:null,source:C.value,noTitle:F.value,padding:t.value.style.chart.padding});requestAnimationFrame(()=>{z.value=s,y.value=l/p.dataset.length,v.value=l})});P.value=new ResizeObserver(a),P.value.observe(r.value.parentNode)}}const{isPrinting:se,isImaging:ie,generatePdf:ue,generateImage:ce}=Be.usePrinter({elementId:`vue-ui-ridgeline_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-ridgeline",options:t.value.userOptions.print}),Ae=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Ne=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),H=e.ref({showTable:t.value.table.show});e.watch(()=>p.config,a=>{t.value=w(),X.value=!t.value.userOptions.showOnChartHover,te(),A.value+=1,I.value+=1,y.value=Math.min(t.value.style.chart.areas.height,t.value.style.chart.areas.rowHeight),H.value.showTable=t.value.table.show},{deep:!0}),e.watch(()=>p.dataset,te,{deep:!0});const le=e.computed(()=>t.value.style.chart.areas.height/t.value.style.chart.areas.rowHeight);function de(a){S.value.includes(a)?S.value=S.value.filter(s=>s!==a):S.value.push(a),V("selectLegend",D.value)}const B=e.computed(()=>b.value?p.dataset.map((a,s)=>({...a,labelLen:Me(a.name,t.value.style.chart.yAxis.labels.fontSize),uid:u.createUid(),datapoints:a.datapoints.map((l,n)=>{const o=l.color?u.convertColorToHex(l.color):Ne.value[n]||u.palette[n]||u.palette[n%u.palette.length],c=u.slugify(l.name);return{...l,color:o,id:c}})})):[]),he=e.computed(()=>t.value.style.chart.padding.top+y.value*p.dataset.length+y.value*le.value),k=e.computed(()=>({fullHeight:m.value.padding.top+m.value.padding.bottom+m.value.height,top:m.value.padding.top,left:m.value.padding.left,right:m.value.width-m.value.padding.right,bottom:m.value.padding.top+m.value.height,width:m.value.width-(m.value.padding.left+m.value.padding.right)})),m=e.computed(()=>{const a=t.value.style.chart.padding;return{width:z.value,height:he.value,padding:a}}),T=e.computed(()=>{const a=Math.max(...B.value.map(c=>c.labelLen)),s=Math.max(...B.value.flatMap(c=>c.datapoints.map(x=>x.values.length))),l=m.value.padding.left+a+16+t.value.style.chart.yAxis.labels.offsetX,n=(k.value.width-l)/s,o=[];for(let c=0;c<s;c+=1)o.push({selectorX:l+n*c,x:l+n*c-n/2,y:k.value.top,label:t.value.style.chart.xAxis.labels.values[c]||"",index:c,width:n,height:he.value});return o});function ze(a){V("selectX",B.value.map(s=>s.datapoints.map(l=>({dp:l,selected:l.values[a.index]}))))}function Le(a,s){return a.length*s/2+s}function ve(a,s,l){const n=Le(s,l);return a+n>k.value.right}function Me(a,s,l="sans-serif"){const o=document.createElement("canvas").getContext("2d"),c=typeof s=="number"?`${s}px`:s;return o.font=`${c} ${l}`,o.measureText(a).width}const D=e.computed(()=>{y.value;const a=Math.max(...B.value.map(g=>g.labelLen)),s=Math.max(...B.value.flatMap(g=>g.datapoints.map(L=>L.values.length))),l=Math.max(...B.value.flatMap(g=>g.datapoints.flatMap(L=>L.values))),n=Math.min(...B.value.flatMap(g=>g.datapoints.flatMap(L=>L.values))),o=m.value.padding.left+a+16+t.value.style.chart.yAxis.labels.offsetX,c=(k.value.width-o)/s,x=Math.abs(Math.min(n,0)),ke=l+x;function xe(g){return isNaN(g/ke)?0:g/ke}return B.value.map((g,L)=>{const be=k.value.top+y.value*L,M=k.value.top+be+y.value*le.value*(1-xe(x));return{...g,label:{x:o-t.value.style.chart.yAxis.labels.fontSize,y:M},datapoints:g.datapoints.map(W=>{const _=W.values.map((U,qe)=>{const We=isNaN(U)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(U)?0:U||0,Ue=o+c*qe,Ye=k.value.top+be+y.value*le.value*(1-xe(We+x)),Ge=U===Math.max(...W.values);return{x:Ue,y:Ye,value:U,isMaxPoint:Ge,zero:M}}),Ie=`${u.createSmoothAreaSegments(_,M,!1,!1)}`,Xe=`M ${o},${M} ${u.createStraightPath(_)} ${_.at(-1).x},${M}`,Re=`M ${o},${M} ${_.at(-1).x},${M}`,we=`M ${u.createSmoothPath(_)}`,Ce=`M ${u.createStraightPath(_)}`,He=u.getPathLengthFromCoordinates(t.value.style.chart.areas.smooth?we:Ce);return{...W,uid:u.createUid(),plots:_,smoothPath:Ie,straightPath:Xe,zeroPath:Re,pathLength:He,smoothPathRidge:we,straightPathRidge:Ce}}).filter(W=>!S.value.includes(W.id))}})}),S=e.ref([]);function _e(a){const s=new Map;return a.forEach(l=>{l.datapoints.forEach((n,o)=>{const c=u.slugify(n.name);s.has(c)||s.set(c,{id:c,name:n.name,color:n.color,shape:"circle",segregate:()=>de(c),isSegregated:S.value.includes(c),opacity:S.value.includes(c)?.5:1})})}),Array.from(s.values())}const ae=e.computed(()=>_e(B.value)),Ve=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,fontWeight:t.value.style.chart.legend.bold?"bold":""})),q=e.ref(!1);function Pe(a){q.value=a,E.value+=1}const me=e.ref({}),fe=e.ref([]);function Te(a){V("selectDatapoint",a),t.value.style.chart.dialog.show&&(fe.value=a.datapoints.map(s=>({name:s.name,color:s.color,type:"line",useArea:!0,smooth:t.value.style.chart.areas.smooth,series:s.values})),i.value=a,me.value=u.deepEmptyObjectToNull({...t.value.style.chart.dialog.xyChart,responsive:!0,chart:{...t.value.style.chart.dialog.xyChart.chart,grid:{...t.value.style.chart.dialog.xyChart.chart.grid,labels:{...t.value.style.chart.dialog.xyChart.chart.grid.labels,xAxisLabels:{...t.value.style.chart.dialog.xyChart.chart.grid.labels.xAxisLabels,values:t.value.style.chart.xAxis.labels.values}}},tooltip:{...t.value.style.chart.dialog.xyChart.chart.tooltip,showTimeLabel:t.value.style.chart.xAxis.labels.values.length>0}}}),d.value&&d.value.open())}const oe=e.ref(null);function De(a){oe.value=a}function Oe(){oe.value=null}const j=e.ref(!1);function re(){j.value=!j.value}function pe(){H.value.showTable=!H.value.showTable}const ge=e.computed(()=>({body:D.value.flatMap(l=>l.datapoints.flatMap(n=>({...n,rowName:`${l.name}: ${n.name}`}))).map(l=>[{name:l.rowName,color:l.color},...l.values])})),J=e.computed(()=>{const a=[t.value.table.columnNames.series,...t.value.style.chart.xAxis.labels.values],s={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.style.chart.xAxis.labels.values],head:a,body:ge.value.body,config:s}});function ye(){e.nextTick(()=>{const a=[[t.value.table.columnNames.series,...t.value.style.chart.xAxis.labels.values.map(n=>[n])],...ge.value.body.map((n,o)=>[n[0].name,...n.slice(1)])],s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text]].concat(a),l=u.createCsvContent(s);u.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-ridgeline"})})}function Fe(){return D.value}return K({getData:Fe,generateImage:ce,generatePdf:ue,generateCsv:ye,toggleAnnotator:re,toggleTable:pe}),(a,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"ridgelineChart",ref:r,class:e.normalizeClass(`vue-ui-ridgeline ${q.value?"vue-data-ui-wrapper-fullscreen":""}`),id:`vue-ui-ridgeline_${f.value}`,style:e.normalizeStyle({fontFamily:t.value.style.fontFamily,width:"100%",textAlign:"center",background:t.value.style.chart.backgroundColor,height:t.value.responsive?"100%":void 0}),onMouseenter:s[4]||(s[4]=()=>e.unref(R)(!0)),onMouseleave:s[5]||(s[5]=()=>e.unref(R)(!1))},[t.value.userOptions.buttons.annotator&&e.unref(ee)?(e.openBlock(),e.createBlock(tt._sfc_main,{key:0,color:t.value.style.chart.color,backgroundColor:t.value.style.chart.backgroundColor,active:j.value,svgRef:e.unref(ee),onClose:re},null,8,["color","backgroundColor","active","svgRef"])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"userConfig",{},void 0,!0),Ae.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:F,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:Y,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ot._sfc_main,{key:`title_${A.value}`,config:{title:{cy:"ridgeline-div-title",...t.value.style.chart.title},subtitle:{cy:"ridgeline-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value&&(e.unref(ne)||e.unref(X))?(e.openBlock(),e.createBlock(Be.UserOptions,{ref:"details",key:`user_option_${E.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(se),isImaging:e.unref(ie),uid:f.value,hasTooltip:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasLabel:!1,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:q.value,chartElement:r.value,position:t.value.userOptions.position,isTooltip:!1,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:j.value,style:e.normalizeStyle({visibility:e.unref(ne)?e.unref(X)?"visible":"hidden":"visible"}),onToggleFullscreen:Pe,onGeneratePdf:e.unref(ue),onGenerateCsv:ye,onGenerateImage:e.unref(ce),onToggleTable:pe,onToggleAnnotator:re},e.createSlots({_:2},[a.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:l,color:n})=>[e.renderSlot(a.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:l,color:n})),void 0,!0)]),key:"0"}:void 0,a.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTooltip",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"4"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"5"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:n})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:n})),void 0,!0)]),key:"6"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:n})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:n})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","chartElement","position","titles","hasAnnotator","isAnnotation","style","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:ee,xmlns:e.unref(u.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":q.value,"vue-data-ui-fulscreen--off":!q.value}),viewBox:`0 0 ${m.value.width<=0?10:m.value.width} ${k.value.fullHeight<=0?10:k.value.fullHeight}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color};${t.value.responsive?`height: ${v.value}px; width: 100%;`:""}`)},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value,(l,n)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`gradient-${l.id}-${f.value}`,x1:"50%",y1:"0%",x2:"50%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":l.color,"stop-opacity":"1"},null,8,mt),e.createElementVNode("stop",{offset:"30%","stop-color":l.color,"stop-opacity":"0.7"},null,8,ft),e.createElementVNode("stop",{offset:"70%","stop-color":l.color,"stop-opacity":"0.3"},null,8,pt),e.createElementVNode("stop",{offset:"100%","stop-color":l.color,"stop-opacity":"0.1"},null,8,gt)],8,vt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,(l,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.datapoints,(o,c)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`grad${o.id}`,id:`gradient-single-${f.value}-${o.uid}`,x1:"50%",y1:"0%",x2:"50%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color,"stop-opacity":"1"},null,8,kt),e.createElementVNode("stop",{offset:"30%","stop-color":o.color,"stop-opacity":"0.7"},null,8,xt),e.createElementVNode("stop",{offset:"70%","stop-color":o.color,"stop-opacity":"0.3"},null,8,bt),e.createElementVNode("stop",{offset:"100%","stop-color":o.color,"stop-opacity":"0.1"},null,8,wt)],8,yt))),128))],64))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,(l,n)=>(e.openBlock(),e.createElementBlock("g",{key:`ds-${n}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.datapoints,(o,c)=>(e.openBlock(),e.createElementBlock("g",{key:o.id},[a.$slots.pattern?(e.openBlock(),e.createElementBlock("g",Ct,[e.createElementVNode("defs",null,[e.renderSlot(a.$slots,"pattern",e.mergeProps({ref_for:!0},{datapointIndex:n,seriesIndex:c,patternId:`pattern_${f.value}_${o.uid}`}),void 0,!0)])])):e.createCommentVNode("",!0),e.createElementVNode("path",{fill:a.$slots.pattern?`url(#pattern_${f.value}_${o.uid})`:t.value.style.chart.backgroundColor,stroke:"none","stroke-linecap":"round",d:t.value.style.chart.areas.smooth?o.smoothPath:o.straightPath,style:e.normalizeStyle({opacity:t.value.style.chart.areas.opacity})},null,12,Bt),e.createElementVNode("path",{fill:"none",stroke:t.value.style.chart.areas.stroke.useSerieColor?o.color:t.value.style.chart.areas.stroke.color,"stroke-width":t.value.style.chart.areas.strokeWidth,d:t.value.style.chart.areas.smooth?o.smoothPathRidge:o.straightPathRidge,"stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"vue-ui-ridgeline-animate":t.value.useCssAnimation}),style:e.normalizeStyle({strokeDasharray:o.pathLength,strokeDashoffset:t.value.useCssAnimation?o.pathLength:0})},null,14,Et),e.createElementVNode("path",{fill:t.value.style.chart.areas.useGradient?t.value.style.chart.areas.useCommonColor?`url(#gradient-${o.id}-${f.value})`:`url(#gradient-single-${f.value}-${o.uid})`:o.color,stroke:"none",d:t.value.style.chart.areas.smooth?o.smoothPath:o.straightPath,"stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"vue-ui-ridgeline-animate":t.value.useCssAnimation}),style:e.normalizeStyle({strokeDasharray:o.pathLength,strokeDashoffset:t.value.useCssAnimation?o.pathLength:0})},null,14,St),t.value.style.chart.zeroLine.show?(e.openBlock(),e.createElementBlock("path",{key:1,stroke:t.value.style.chart.zeroLine.useSerieColor?o.color:t.value.style.chart.zeroLine.stroke,"stroke-dasharray":t.value.style.chart.zeroLine.strokeDasharray,"stroke-width":t.value.style.chart.zeroLine.strokeWidth,d:o.zeroPath,"stroke-linecap":"round"},null,8,$t)):e.createCommentVNode("",!0),t.value.style.chart.areas.maxPoint.show&&o.plots.length>1?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(o.plots,x=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[x.isMaxPoint?(e.openBlock(),e.createElementBlock("line",{key:0,x1:x.x,y1:x.y,x2:x.x,y2:x.zero,stroke:t.value.style.chart.areas.maxPoint.adaptStrokeToBackground?e.unref(u.adaptColorToBackground)(o.color):t.value.style.chart.areas.maxPoint.stroke,"stroke-width":t.value.style.chart.areas.maxPoint.strokeWidth,"stroke-linecap":"round","stroke-dasharray":t.value.style.chart.areas.maxPoint.strokeDasharray},null,8,At)):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0),o.plots.length===1?(e.openBlock(),e.createElementBlock("circle",{key:3,cx:o.plots[0].x,cy:o.plots[0].y,stroke:t.value.style.chart.selector.dot.stroke,"stroke-width":t.value.style.chart.selector.dot.strokeWidth,r:t.value.style.chart.selector.dot.radius,fill:t.value.style.chart.selector.dot.useDatapointColor?o.color:t.value.style.chart.selector.dot.fill,style:{pointerEvents:"none"}},null,8,Nt)):e.createCommentVNode("",!0)]))),128)),e.createElementVNode("text",{x:l.label.x,y:l.label.y,"text-anchor":"end","font-size":t.value.style.chart.yAxis.labels.fontSize,"font-weight":t.value.style.chart.yAxis.labels.bold?"bold":"normal",fill:t.value.style.chart.yAxis.labels.color,style:e.normalizeStyle({cursor:t.value.style.chart.dialog.show?"pointer":"default"}),"text-decoration":t.value.style.chart.dialog.show&&(oe.value===n||i.value&&l.uid===i.value.uid)?"underline":"",onMouseenter:o=>De(n),onMouseleave:Oe,onClick:o=>Te(l)},e.toDisplayString(l.name),45,zt)]))),128)),t.value.style.chart.xAxis.labels.values.length?(e.openBlock(),e.createElementBlock("g",Lt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(l,n)=>e.renderSlot(a.$slots,"time-label",e.mergeProps({ref_for:!0},{show:l&&!t.value.style.chart.xAxis.labels.showOnlyFirstAndLast&&!t.value.style.chart.xAxis.labels.showOnlyAtModulo||l&&t.value.style.chart.xAxis.labels.showOnlyFirstAndLast&&(n===0||n===T.value.length-1)||l&&h.value&&h.value.index===n||l&&!t.value.style.chart.xAxis.labels.showOnlyFirstAndLast&&t.value.style.chart.xAxis.labels.showOnlyAtModulo&&n%Math.floor(T.value.length/t.value.style.chart.xAxis.labels.modulo)===0,fontSize:t.value.style.chart.xAxis.labels.fontSize,content:l.label,textAnchor:t.value.style.chart.xAxis.labels.rotation>0?"start":t.value.style.chart.xAxis.labels.rotation<0?"end":"middle",fill:t.value.style.chart.xAxis.labels.color,transform:`translate(${l.selectorX}, ${k.value.top+l.height+t.value.style.chart.xAxis.labels.offsetY}), rotate(${t.value.style.chart.xAxis.labels.rotation})`,x:l.selectorX,y:k.value.top+l.height+t.value.style.chart.xAxis.labels.offsetY}),()=>[l&&!t.value.style.chart.xAxis.labels.showOnlyFirstAndLast&&!t.value.style.chart.xAxis.labels.showOnlyAtModulo||l&&t.value.style.chart.xAxis.labels.showOnlyFirstAndLast&&(n===0||n===T.value.length-1)||l&&h.value&&h.value.index===n||l&&!t.value.style.chart.xAxis.labels.showOnlyFirstAndLast&&t.value.style.chart.xAxis.labels.showOnlyAtModulo&&n%Math.floor(T.value.length/t.value.style.chart.xAxis.labels.modulo)===0?(e.openBlock(),e.createElementBlock("text",{key:0,"font-size":t.value.style.chart.xAxis.labels.fontSize,fill:t.value.style.chart.xAxis.labels.color,"font-weight":t.value.style.chart.xAxis.labels.bold?"bold":"normal",transform:`translate(${l.selectorX}, ${k.value.top+l.height+t.value.style.chart.xAxis.labels.offsetY}), rotate(${t.value.style.chart.xAxis.labels.rotation})`,"text-anchor":t.value.style.chart.xAxis.labels.rotation>0?"start":t.value.style.chart.xAxis.labels.rotation<0?"end":"middle",style:e.normalizeStyle({opacity:h.value?h.value.index===n?1:.2:1})},e.toDisplayString(l.label),13,Mt)):e.createCommentVNode("",!0)],!0)),256))])):e.createCommentVNode("",!0),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(l,n)=>(e.openBlock(),e.createElementBlock("rect",{x:l.x,y:l.y,width:l.width<0?.1:l.width,height:l.height<0?.1:l.height,fill:"transparent",onMouseenter:o=>h.value=l,onMouseleave:s[0]||(s[0]=o=>h.value=null),onClick:()=>ze(l)},null,40,_t))),256)),t.value.style.chart.selector.show&&h.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:h.value.selectorX,x2:h.value.selectorX,y1:h.value.y,y2:h.value.y+h.value.height-y.value/2,stroke:t.value.style.chart.selector.stroke,"stroke-width":t.value.style.chart.selector.strokeWidth,"stroke-dasharray":t.value.style.chart.selector.strokeDasharray,"stroke-linecap":"round",style:{pointerEvents:"none"}},null,8,Vt)):e.createCommentVNode("",!0),h.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(D.value,l=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.datapoints,n=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.plots,(o,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[h.value&&h.value.index===c?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:o.x,cy:o.y,stroke:t.value.style.chart.selector.dot.stroke,"stroke-width":t.value.style.chart.selector.dot.strokeWidth,r:t.value.style.chart.selector.dot.radius,fill:t.value.style.chart.selector.dot.useDatapointColor?n.color:t.value.style.chart.selector.dot.fill,style:{pointerEvents:"none"}},null,8,Pt)):e.createCommentVNode("",!0),h.value&&h.value.index===c?(e.openBlock(),e.createElementBlock("text",{key:1,x:ve(o.x,e.unref(u.applyDataLabel)(t.value.style.chart.selector.labels.formatter,o.value,e.unref(u.dataLabel)({p:t.value.style.chart.xAxis.labels.prefix,v:o.value,s:t.value.style.chart.xAxis.labels.suffix,r:t.value.style.chart.selector.labels.rounding})),t.value.style.chart.selector.labels.fontSize)?o.x-t.value.style.chart.selector.labels.fontSize/2:o.x+t.value.style.chart.selector.labels.fontSize/2,y:o.y+t.value.style.chart.selector.labels.fontSize/3,"text-anchor":ve(o.x,e.unref(u.applyDataLabel)(t.value.style.chart.selector.labels.formatter,o.value,e.unref(u.dataLabel)({p:t.value.style.chart.xAxis.labels.prefix,v:o.value,s:t.value.style.chart.xAxis.labels.suffix,r:t.value.style.chart.selector.labels.rounding})),t.value.style.chart.selector.labels.fontSize)?"end":"start","font-size":t.value.style.chart.selector.labels.fontSize,fill:t.value.style.chart.selector.labels.color,style:{pointerEvents:"none"}},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.style.chart.selector.labels.formatter,o.value,e.unref(u.dataLabel)({p:t.value.style.chart.xAxis.labels.prefix,v:o.value,s:t.value.style.chart.xAxis.labels.suffix,r:t.value.style.chart.selector.labels.rounding}))),9,Tt)):e.createCommentVNode("",!0)],64))),256))],64))),256))],64))),256)):e.createCommentVNode("",!0)]),e.renderSlot(a.$slots,"svg",{svg:m.value},void 0,!0)],14,ht)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Dt,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(se)||e.unref(ie)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(at.default,{key:6,config:{type:"ridgeline",style:{backgroundColor:t.value.style.chart.backgroundColor,ridgeline:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:O},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(et.Legend,{key:`legend_${I.value}`,legendSet:ae.value,config:Ve.value,onClickMarker:s[1]||(s[1]=({legend:l})=>de(l.id))},e.createSlots({item:e.withCtx(({legend:l})=>[e.createElementVNode("div",{style:e.normalizeStyle(`opacity:${S.value.includes(l.id)?.5:1}`),onClick:n=>l.segregate()},e.toDisplayString(l.name),13,Ot)]),_:2},[a.$slots.pattern?{name:"legend-pattern",fn:e.withCtx(({legend:l,index:n})=>[e.createVNode(lt._sfc_main,{shape:l.shape,radius:30,stroke:"none",plot:{x:30,y:30},fill:`url(#pattern_${f.value}_${n})`},null,8,["shape","fill"])]),key:"0"}:void 0]),1032,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"legend",{legend:ae.value},void 0,!0)],512),a.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:C,dir:"auto"},[e.renderSlot(a.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createBlock(Ke.default,{key:8,hideDetails:"",config:{open:H.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(Ze.DataTable,{key:`table_${N.value}`,colNames:J.value.colNames,head:J.value.head,body:J.value.body,config:J.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` :${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[2]||(s[2]=l=>H.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l},null,8,Ft)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name?l.name:e.unref(u.applyDataLabel)(t.value.style.chart.selector.labels.formatter,l,e.unref(u.dataLabel)({p:t.value.style.chart.xAxis.labels.prefix,v:l,s:t.value.style.chart.xAxis.labels.suffix,r:t.value.table.td.roundingValue}))),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0),t.value.style.chart.dialog.show?(e.openBlock(),e.createBlock(ct,{key:9,ref_key:"dialog",ref:d,onClose:s[3]||(s[3]=l=>i.value=null),backgroundColor:t.value.style.chart.dialog.backgroundColor,color:t.value.style.chart.dialog.color,headerBg:t.value.style.chart.dialog.header.backgroundColor,headerColor:t.value.style.chart.dialog.header.color},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.name),1)]),default:e.withCtx(()=>[i.value?(e.openBlock(),e.createBlock(rt.default,{key:0,config:me.value,dataset:fe.value},null,8,["config","dataset"])):e.createCommentVNode("",!0)]),_:1},8,["backgroundColor","color","headerBg","headerColor"])):e.createCommentVNode("",!0)],46,dt))}},Xt=$e._export_sfc(It,[["__scopeId","data-v-9c3affc2"]]);exports.default=Xt;