vue-chrts 0.0.75 → 0.0.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +488 -480
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -51,4 +51,4 @@
|
|
|
51
51
|
}
|
|
52
52
|
`;class Ps{constructor(t){this.data=t}get data(){return this._data}set data(t){this._data=t}}var ke;(function(e){e.X="x",e.Y="y"})(ke||(ke={}));var k;(function(e){e.X="x",e.Y="y"})(k||(k={}));var De;(function(e){e.West="west",e.East="east",e.North="north",e.South="south"})(De||(De={}));const Hs=Object.assign(Object.assign({},rn),{components:[],tooltip:void 0,crosshair:void 0,annotations:void 0,xAxis:void 0,yAxis:void 0,autoMargin:!0,xScale:void 0,xDomain:void 0,xDomainMinConstraint:void 0,xDomainMaxConstraint:void 0,xRange:void 0,yScale:void 0,yDomain:void 0,yDomainMinConstraint:void 0,yDomainMaxConstraint:void 0,yRange:void 0,yDirection:De.North,preventEmptyDomain:null,scaleByDomain:!1});class Ls extends se{constructor(t,n,r){var i,s;super(t),this._defaultConfig=Hs,this.datamodel=new Ps,this.config=this._defaultConfig,this._clipPathId=ys(),this._axisMargin={top:0,bottom:0,left:0,right:0},this._firstRender=!0,this._clipPath=this.svg.append("clipPath").attr("id",this._clipPathId),this._clipPath.append("rect");const a="saturate",c=window.location.href.replace(window.location.hash,"");this.svg.attr("class",gs`
|
|
53
53
|
--highlight-filter-id: url(${c}#${a}); // defining a css variable
|
|
54
|
-
`),this._svgDefs.append("filter").attr("id",a).attr("filterUnits","objectBoundingBox").html('<feColorMatrix type="saturate" in="SourceGraphic" values="1.35"/>'),n&&this.updateContainer(n,!0),r&&this.setData(r,!0),(this.config.xAxis||this.config.yAxis||!((i=this.components)===null||i===void 0)&&i.some(o=>o.datamodel.data))&&this.render(),(s=document.fonts)===null||s===void 0||s.ready.then(()=>{this._firstRender||this._renderAxes(0)})}get components(){return this.config.components}get width(){const t=this._getMargin();return G(this.containerWidth-t.left-t.right,0,Number.POSITIVE_INFINITY)}get height(){const t=this._getMargin();return G(this.containerHeight-t.top-t.bottom,0,Number.POSITIVE_INFINITY)}setData(t,n){var r,i,s,a;const{components:c,config:o}=this;t&&(this.datamodel.data=t,c.forEach(f=>{f.setData(t)}),(r=o.crosshair)===null||r===void 0||r.setData(t),(i=o.xAxis)===null||i===void 0||i.setData(t),(s=o.yAxis)===null||s===void 0||s.setData(t),(a=o.tooltip)===null||a===void 0||a.hide(),n||this.render())}updateContainer(t,n){super.updateContainer(t),this._removeAllChildren(),this.setData(this.datamodel.data,!0),t.xAxis&&(this.config.xAxis.config.type=ke.X,this.element.appendChild(t.xAxis.element)),t.yAxis&&(this.config.yAxis.config.type=ke.Y,this.element.appendChild(t.yAxis.element));for(const a of this.components)this.element.appendChild(a.element);const r=t.tooltip;r&&(r.hasContainer()||r.setContainer(this._container),r.setComponents(this.components));const i=t.crosshair;i&&(i.setContainer(this.svg),i.tooltip=r,this.element.appendChild(i.element));const s=t.annotations;s&&this.element.appendChild(s.element),this.element.appendChild(this._clipPath.node()),this.element.appendChild(this._svgDefs.node()),this.element.appendChild(this._svgDefsExternal.node()),n||this.render()}updateComponents(t,n){const{config:r}=this;this.components.forEach((i,s)=>{t[s]&&i.setConfig(t[s])}),this._updateScales(...this.components,r.xAxis,r.yAxis,r.crosshair),n||this.render()}update(t,n,r){r&&(this.datamodel.data=r),t&&this.updateContainer(t,!0),n&&this.updateComponents(n,!0),this.render()}_preRender(){const{config:t}=this;super._preRender(),t.autoMargin&&this._setAutoMargin();const n=j([...this.components,t.xAxis,t.yAxis,t.crosshair,t.annotations]);for(const r of n)r.setSize(this.width,this.height,this.containerWidth,this.containerHeight);this._updateScales(...this.components,t.xAxis,t.yAxis,t.crosshair)}_render(t){var n,r,i,s,a;const{config:c}=this;super._render();const o=this._getMargin();for(const u of this.components)u.g.attr("transform",`translate(${o.left},${o.top})`).style("clip-path",u.clippable?`url(#${this._clipPathId})`:null).style("-webkit-clip-path",u.clippable?`url(#${this._clipPathId})`:null),u.render(t);this._renderAxes(this._firstRender?0:t);const f=2;this._clipPath.select("rect").attr("x",-2).attr("y",-2).attr("width",this.width+2*f).attr("height",this.height+2*f),(n=c.tooltip)===null||n===void 0||n.update();const l=c.crosshair;if(l){const u=this.components.filter(h=>!h.stacked).map(h=>h.config.y),p=this.components.filter(h=>h.stacked).map(h=>h.config.y),d=(r=this.components.find(h=>h.config.baseline))===null||r===void 0?void 0:r.config,g=d==null?void 0:d.baseline;l.accessors={x:(i=this.components[0])===null||i===void 0?void 0:i.config.x,y:lt(u),yStacked:lt(p),baseline:g},l.g.attr("transform",`translate(${o.left},${o.top})`).style("clip-path",`url(#${this._clipPathId})`).style("-webkit-clip-path",`url(#${this._clipPathId})`),l.hide()}(s=c.annotations)===null||s===void 0||s.g.attr("transform",`translate(${o.left},${o.top})`),(a=c.annotations)===null||a===void 0||a.render(),this._firstRender=!1}_updateScales(...t){const n=j(t||this.components);this._setScales(...n),this._updateScalesDomain(...n),this._updateScalesRange(...n)}_setScales(...t){const{config:n}=this;t&&(n.xScale&&t.forEach(r=>r.setScale(k.X,n.xScale)),n.yScale&&t.forEach(r=>r.setScale(k.Y,n.yScale)))}_updateScalesDomain(...t){const{config:n}=this;if(!t)return;const r=t.filter(i=>!i.config.excludeFromDomainCalculation);Object.values(k).forEach(i=>{var s,a,c,o,f,l,u,p;const[d,g]=ni(ii(r.map(C=>C.getDataExtent(i,n.scaleByDomain)))),h=i===k.Y?n.yDomain:n.xDomain,m=i===k.Y?n.yDomainMinConstraint:n.xDomainMinConstraint,x=i===k.Y?n.yDomainMaxConstraint:n.xDomainMaxConstraint,w=(a=(s=h==null?void 0:h[0])!==null&&s!==void 0?s:d)!==null&&a!==void 0?a:0,A=(o=(c=h==null?void 0:h[1])!==null&&c!==void 0?c:g)!==null&&o!==void 0?o:1,E=[G(w,(f=m==null?void 0:m[0])!==null&&f!==void 0?f:Number.NEGATIVE_INFINITY,(l=m==null?void 0:m[1])!==null&&l!==void 0?l:Number.POSITIVE_INFINITY),G(A,(u=x==null?void 0:x[0])!==null&&u!==void 0?u:Number.NEGATIVE_INFINITY,(p=x==null?void 0:x[1])!==null&&p!==void 0?p:Number.POSITIVE_INFINITY)];if(E[0]===E[1]){const C=r.some(O=>{var y;return((y=O.datamodel.data)===null||y===void 0?void 0:y.length)>0});(n.preventEmptyDomain||n.preventEmptyDomain===null&&(!C||i===k.Y))&&(E[1]=E[0]+1)}t.forEach(C=>C.setScaleDomain(i,E))})}_updateScalesRange(...t){var n,r,i,s,a,c;const{config:o}=this;if(!t)return;const f=o.yDirection===De.South,l=[(n=o.padding.left)!==null&&n!==void 0?n:0,this.width-((r=o.padding.right)!==null&&r!==void 0?r:0)],u=[this.height-((i=o.padding.bottom)!==null&&i!==void 0?i:0),(s=o.padding.top)!==null&&s!==void 0?s:0];f&&u.reverse();for(const d of t)d.setSize(this.width,this.height,this.containerWidth,this.containerHeight),d.setScaleRange(k.X,(a=o.xRange)!==null&&a!==void 0?a:l),d.setScaleRange(k.Y,(c=o.yRange)!==null&&c!==void 0?c:u);const p=t.map(d=>d.bleed).reduce((d,g)=>{for(const h of Object.keys(d)){const m=h;d[m]<g[m]&&(d[m]=g[m])}return d},{top:0,bottom:0,left:0,right:0});for(const d of t)d.setScaleRange(k.X,[l[0]+p.left,l[1]-p.right]),d.setScaleRange(k.Y,f?[u[0]+p.top,u[1]-p.bottom]:[u[0]-p.bottom,u[1]+p.top])}_renderAxes(t){const{config:{xAxis:n,yAxis:r}}=this,i=this._getMargin();j([n,r]).forEach(a=>{const c=a.getOffset(i);a.g.attr("transform",`translate(${c.left},${c.top})`),a.render(t)})}_setAutoMargin(){const{config:{xAxis:t,yAxis:n}}=this,r=j([...this.components,t,n]);this._setScales(...r),this._updateScalesDomain(...r);const i=this._firstRender?2:1;for(let s=0;s<i;s+=1){const a={top:0,bottom:0,left:0,right:0};this._updateScalesRange(...r),j([t,n]).forEach(o=>{o.preRender();const f=o.getRequiredMargin();a.top<f.top&&(a.top=f.top),a.bottom<f.bottom&&(a.bottom=f.bottom),a.left<f.left&&(a.left=f.left),a.right<f.right&&(a.right=f.right)}),this._axisMargin=a}}_getMargin(){const{config:{margin:t}}=this;return{top:t.top+this._axisMargin.top,bottom:t.bottom+this._axisMargin.bottom,left:t.left+this._axisMargin.left,right:t.right+this._axisMargin.right}}destroy(){const{components:t,config:{tooltip:n,crosshair:r,annotations:i,xAxis:s,yAxis:a}}=this;super.destroy();for(const c of t)c==null||c.destroy();n==null||n.destroy(),r==null||r.destroy(),i==null||i.destroy(),s==null||s.destroy(),a==null||a.destroy()}}const Vs=Symbol("componentAccessorKey"),Ws=Symbol("tooltipAccessorKey"),qs=Symbol("crosshairAccessorKey"),Us=Symbol("axisAccessorKey"),Ys=Symbol("annotationsAccessorKey");function Gs(e){const t=v.getCurrentInstance(),n=t.attrs;return v.computed(()=>{const r={},i=(t==null?void 0:t.vnode.props)??{};return Object.keys(i).forEach(s=>{r[v.camelize(s)]=e[v.camelize(s)]}),{...r,...n}})}const Xs=v.defineComponent({__name:"index",props:{components:{},xScale:{type:[Object,Function]},xDomain:{},xDomainMinConstraint:{},xDomainMaxConstraint:{},xRange:{},yScale:{type:[Object,Function]},yDomain:{},yDomainMinConstraint:{},yDomainMaxConstraint:{},yRange:{},yDirection:{},xAxis:{},yAxis:{},autoMargin:{type:Boolean},tooltip:{},crosshair:{},preventEmptyDomain:{type:[Boolean,null]},scaleByDomain:{type:Boolean},annotations:{},duration:{},margin:{},padding:{},sizing:{},width:{},height:{},svgDefs:{},ariaLabel:{},data:{}},setup(e,{expose:t}){const n=e,{data:r}=v.toRefs(n),i=Gs(n),s=v.ref(),a=v.reactive({components:[],annotations:void 0,crosshair:void 0,tooltip:void 0,xAxis:void 0,yAxis:void 0}),c=v.ref();return v.watch(r,()=>{s.value&&s.value.setData(r.value,!0)}),v.watchEffect(()=>{var o;a.components.map(f=>f.config),(o=s.value)==null||o.updateContainer({...v.toRaw(i.value),...v.toRaw(a)})}),v.onMounted(()=>{c.value&&(s.value=new Ls(c.value,{...v.toRaw(a)},r.value))}),v.onUnmounted(()=>{var o;return(o=s.value)==null?void 0:o.destroy()}),v.provide(Vs,{data:r,update:o=>a.components=[...a.components,o],destroy:()=>{var o;return a.components=(o=a.components)==null?void 0:o.filter(f=>!f.isDestroyed())}}),v.provide(Us,{data:r,update:o=>a[`${o.config.type}Axis`]=o,destroy:o=>{a[`${o}Axis`]=void 0}}),v.provide(qs,{data:r,update:o=>a.crosshair=o,destroy:()=>{a.crosshair=void 0}}),v.provide(Ws,{data:r,update:o=>a.tooltip=o,destroy:()=>{a.tooltip=void 0}}),v.provide(Ys,{data:r,update:o=>a.annotations=o,destroy:()=>{a.annotations=void 0}}),t({component:s}),(o,f)=>(v.openBlock(),v.createElementBlock("div",{"data-vis-xy-container":"",ref_key:"elRef",ref:c,class:"unovis-xy-container"},[v.renderSlot(o.$slots,"default")],512))}});(function(){try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".unovis-xy-container,.unovis-single-container{display:block;position:relative;width:100%}[data-vis-leaflet-map],[data-vis-leaflet-flow-map]{display:block;position:relative}[data-vis-bullet-legend]{display:block}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();const Zs=v.defineComponent({__name:"Area",props:{data:{},xNumTicks:{default:e=>e.data.length>24?24/4:e.data.length-1},yNumTicks:{default:e=>e.data.length>24?24/4:e.data.length-1}},setup(e){return(t,n)=>(v.openBlock(),v.createBlock(v.unref(Xs),{height:600},{default:v.withCtx(()=>n[0]||(n[0]=[v.createTextVNode(" 123123123 ")])),_:1}))}});var mn=(e=>(e.Top="top",e.Bottom="bottom",e))(mn||{});const Ks=v.defineComponent({__name:"Button",props:{variant:{},size:{}},setup(e){return(t,n)=>(v.openBlock(),v.createElementBlock("button",{class:v.normalizeClass(["button",`button--${t.variant||"primary"}`,`button--${t.size||"medium"}`])},[v.renderSlot(t.$slots,"default",{},void 0,!0)],2))}}),Js=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},Qs=Js(Ks,[["__scopeId","data-v-52b6ec0c"]]);exports.Area=Zs;exports.Button=Qs;exports.PaginationPosition=mn;
|
|
54
|
+
`),this._svgDefs.append("filter").attr("id",a).attr("filterUnits","objectBoundingBox").html('<feColorMatrix type="saturate" in="SourceGraphic" values="1.35"/>'),n&&this.updateContainer(n,!0),r&&this.setData(r,!0),(this.config.xAxis||this.config.yAxis||!((i=this.components)===null||i===void 0)&&i.some(o=>o.datamodel.data))&&this.render(),(s=document.fonts)===null||s===void 0||s.ready.then(()=>{this._firstRender||this._renderAxes(0)})}get components(){return this.config.components}get width(){const t=this._getMargin();return G(this.containerWidth-t.left-t.right,0,Number.POSITIVE_INFINITY)}get height(){const t=this._getMargin();return G(this.containerHeight-t.top-t.bottom,0,Number.POSITIVE_INFINITY)}setData(t,n){var r,i,s,a;const{components:c,config:o}=this;t&&(this.datamodel.data=t,c.forEach(f=>{f.setData(t)}),(r=o.crosshair)===null||r===void 0||r.setData(t),(i=o.xAxis)===null||i===void 0||i.setData(t),(s=o.yAxis)===null||s===void 0||s.setData(t),(a=o.tooltip)===null||a===void 0||a.hide(),n||this.render())}updateContainer(t,n){super.updateContainer(t),this._removeAllChildren(),this.setData(this.datamodel.data,!0),t.xAxis&&(this.config.xAxis.config.type=ke.X,this.element.appendChild(t.xAxis.element)),t.yAxis&&(this.config.yAxis.config.type=ke.Y,this.element.appendChild(t.yAxis.element));for(const a of this.components)this.element.appendChild(a.element);const r=t.tooltip;r&&(r.hasContainer()||r.setContainer(this._container),r.setComponents(this.components));const i=t.crosshair;i&&(i.setContainer(this.svg),i.tooltip=r,this.element.appendChild(i.element));const s=t.annotations;s&&this.element.appendChild(s.element),this.element.appendChild(this._clipPath.node()),this.element.appendChild(this._svgDefs.node()),this.element.appendChild(this._svgDefsExternal.node()),n||this.render()}updateComponents(t,n){const{config:r}=this;this.components.forEach((i,s)=>{t[s]&&i.setConfig(t[s])}),this._updateScales(...this.components,r.xAxis,r.yAxis,r.crosshair),n||this.render()}update(t,n,r){r&&(this.datamodel.data=r),t&&this.updateContainer(t,!0),n&&this.updateComponents(n,!0),this.render()}_preRender(){const{config:t}=this;super._preRender(),t.autoMargin&&this._setAutoMargin();const n=j([...this.components,t.xAxis,t.yAxis,t.crosshair,t.annotations]);for(const r of n)r.setSize(this.width,this.height,this.containerWidth,this.containerHeight);this._updateScales(...this.components,t.xAxis,t.yAxis,t.crosshair)}_render(t){var n,r,i,s,a;const{config:c}=this;super._render();const o=this._getMargin();for(const u of this.components)u.g.attr("transform",`translate(${o.left},${o.top})`).style("clip-path",u.clippable?`url(#${this._clipPathId})`:null).style("-webkit-clip-path",u.clippable?`url(#${this._clipPathId})`:null),u.render(t);this._renderAxes(this._firstRender?0:t);const f=2;this._clipPath.select("rect").attr("x",-2).attr("y",-2).attr("width",this.width+2*f).attr("height",this.height+2*f),(n=c.tooltip)===null||n===void 0||n.update();const l=c.crosshair;if(l){const u=this.components.filter(h=>!h.stacked).map(h=>h.config.y),p=this.components.filter(h=>h.stacked).map(h=>h.config.y),d=(r=this.components.find(h=>h.config.baseline))===null||r===void 0?void 0:r.config,g=d==null?void 0:d.baseline;l.accessors={x:(i=this.components[0])===null||i===void 0?void 0:i.config.x,y:lt(u),yStacked:lt(p),baseline:g},l.g.attr("transform",`translate(${o.left},${o.top})`).style("clip-path",`url(#${this._clipPathId})`).style("-webkit-clip-path",`url(#${this._clipPathId})`),l.hide()}(s=c.annotations)===null||s===void 0||s.g.attr("transform",`translate(${o.left},${o.top})`),(a=c.annotations)===null||a===void 0||a.render(),this._firstRender=!1}_updateScales(...t){const n=j(t||this.components);this._setScales(...n),this._updateScalesDomain(...n),this._updateScalesRange(...n)}_setScales(...t){const{config:n}=this;t&&(n.xScale&&t.forEach(r=>r.setScale(k.X,n.xScale)),n.yScale&&t.forEach(r=>r.setScale(k.Y,n.yScale)))}_updateScalesDomain(...t){const{config:n}=this;if(!t)return;const r=t.filter(i=>!i.config.excludeFromDomainCalculation);Object.values(k).forEach(i=>{var s,a,c,o,f,l,u,p;const[d,g]=ni(ii(r.map(C=>C.getDataExtent(i,n.scaleByDomain)))),h=i===k.Y?n.yDomain:n.xDomain,m=i===k.Y?n.yDomainMinConstraint:n.xDomainMinConstraint,x=i===k.Y?n.yDomainMaxConstraint:n.xDomainMaxConstraint,w=(a=(s=h==null?void 0:h[0])!==null&&s!==void 0?s:d)!==null&&a!==void 0?a:0,A=(o=(c=h==null?void 0:h[1])!==null&&c!==void 0?c:g)!==null&&o!==void 0?o:1,E=[G(w,(f=m==null?void 0:m[0])!==null&&f!==void 0?f:Number.NEGATIVE_INFINITY,(l=m==null?void 0:m[1])!==null&&l!==void 0?l:Number.POSITIVE_INFINITY),G(A,(u=x==null?void 0:x[0])!==null&&u!==void 0?u:Number.NEGATIVE_INFINITY,(p=x==null?void 0:x[1])!==null&&p!==void 0?p:Number.POSITIVE_INFINITY)];if(E[0]===E[1]){const C=r.some(O=>{var y;return((y=O.datamodel.data)===null||y===void 0?void 0:y.length)>0});(n.preventEmptyDomain||n.preventEmptyDomain===null&&(!C||i===k.Y))&&(E[1]=E[0]+1)}t.forEach(C=>C.setScaleDomain(i,E))})}_updateScalesRange(...t){var n,r,i,s,a,c;const{config:o}=this;if(!t)return;const f=o.yDirection===De.South,l=[(n=o.padding.left)!==null&&n!==void 0?n:0,this.width-((r=o.padding.right)!==null&&r!==void 0?r:0)],u=[this.height-((i=o.padding.bottom)!==null&&i!==void 0?i:0),(s=o.padding.top)!==null&&s!==void 0?s:0];f&&u.reverse();for(const d of t)d.setSize(this.width,this.height,this.containerWidth,this.containerHeight),d.setScaleRange(k.X,(a=o.xRange)!==null&&a!==void 0?a:l),d.setScaleRange(k.Y,(c=o.yRange)!==null&&c!==void 0?c:u);const p=t.map(d=>d.bleed).reduce((d,g)=>{for(const h of Object.keys(d)){const m=h;d[m]<g[m]&&(d[m]=g[m])}return d},{top:0,bottom:0,left:0,right:0});for(const d of t)d.setScaleRange(k.X,[l[0]+p.left,l[1]-p.right]),d.setScaleRange(k.Y,f?[u[0]+p.top,u[1]-p.bottom]:[u[0]-p.bottom,u[1]+p.top])}_renderAxes(t){const{config:{xAxis:n,yAxis:r}}=this,i=this._getMargin();j([n,r]).forEach(a=>{const c=a.getOffset(i);a.g.attr("transform",`translate(${c.left},${c.top})`),a.render(t)})}_setAutoMargin(){const{config:{xAxis:t,yAxis:n}}=this,r=j([...this.components,t,n]);this._setScales(...r),this._updateScalesDomain(...r);const i=this._firstRender?2:1;for(let s=0;s<i;s+=1){const a={top:0,bottom:0,left:0,right:0};this._updateScalesRange(...r),j([t,n]).forEach(o=>{o.preRender();const f=o.getRequiredMargin();a.top<f.top&&(a.top=f.top),a.bottom<f.bottom&&(a.bottom=f.bottom),a.left<f.left&&(a.left=f.left),a.right<f.right&&(a.right=f.right)}),this._axisMargin=a}}_getMargin(){const{config:{margin:t}}=this;return{top:t.top+this._axisMargin.top,bottom:t.bottom+this._axisMargin.bottom,left:t.left+this._axisMargin.left,right:t.right+this._axisMargin.right}}destroy(){const{components:t,config:{tooltip:n,crosshair:r,annotations:i,xAxis:s,yAxis:a}}=this;super.destroy();for(const c of t)c==null||c.destroy();n==null||n.destroy(),r==null||r.destroy(),i==null||i.destroy(),s==null||s.destroy(),a==null||a.destroy()}}const Vs=Symbol("componentAccessorKey"),Ws=Symbol("tooltipAccessorKey"),qs=Symbol("crosshairAccessorKey"),Us=Symbol("axisAccessorKey"),Ys=Symbol("annotationsAccessorKey");function Gs(e){const t=v.getCurrentInstance(),n=t.attrs;return v.computed(()=>{const r={},i=(t==null?void 0:t.vnode.props)??{};return Object.keys(i).forEach(s=>{r[v.camelize(s)]=e[v.camelize(s)]}),{...r,...n}})}const Xs=v.defineComponent({__name:"index",props:{components:{},xScale:{type:[Object,Function]},xDomain:{},xDomainMinConstraint:{},xDomainMaxConstraint:{},xRange:{},yScale:{type:[Object,Function]},yDomain:{},yDomainMinConstraint:{},yDomainMaxConstraint:{},yRange:{},yDirection:{},xAxis:{},yAxis:{},autoMargin:{type:Boolean},tooltip:{},crosshair:{},preventEmptyDomain:{type:[Boolean,null]},scaleByDomain:{type:Boolean},annotations:{},duration:{},margin:{},padding:{},sizing:{},width:{},height:{},svgDefs:{},ariaLabel:{},data:{}},setup(e,{expose:t}){const n=e,{data:r}=v.toRefs(n),i=Gs(n),s=v.ref(),a=v.reactive({components:[],annotations:void 0,crosshair:void 0,tooltip:void 0,xAxis:void 0,yAxis:void 0}),c=v.ref();return v.watch(r,()=>{s.value&&s.value.setData(r.value,!0)}),v.watchEffect(()=>{var o;a.components.map(f=>f.config),(o=s.value)==null||o.updateContainer({...v.toRaw(i.value),...v.toRaw(a)})}),v.onMounted(()=>{c.value&&(s.value=new Ls(c.value,{...v.toRaw(a)},r.value))}),v.onUnmounted(()=>{var o;return(o=s.value)==null?void 0:o.destroy()}),v.provide(Vs,{data:r,update:o=>a.components=[...a.components,o],destroy:()=>{var o;return a.components=(o=a.components)==null?void 0:o.filter(f=>!f.isDestroyed())}}),v.provide(Us,{data:r,update:o=>a[`${o.config.type}Axis`]=o,destroy:o=>{a[`${o}Axis`]=void 0}}),v.provide(qs,{data:r,update:o=>a.crosshair=o,destroy:()=>{a.crosshair=void 0}}),v.provide(Ws,{data:r,update:o=>a.tooltip=o,destroy:()=>{a.tooltip=void 0}}),v.provide(Ys,{data:r,update:o=>a.annotations=o,destroy:()=>{a.annotations=void 0}}),t({component:s}),(o,f)=>(v.openBlock(),v.createElementBlock("div",{"data-vis-xy-container":"",ref_key:"elRef",ref:c,class:"unovis-xy-container"},[v.renderSlot(o.$slots,"default")],512))}});(function(){try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".unovis-xy-container,.unovis-single-container{display:block;position:relative;width:100%}[data-vis-leaflet-map],[data-vis-leaflet-flow-map]{display:block;position:relative}[data-vis-bullet-legend]{display:block}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();const Zs=v.defineComponent({__name:"Area",props:{data:{},xNumTicks:{default:e=>e.data.length>24?24/4:e.data.length-1},yNumTicks:{default:e=>e.data.length>24?24/4:e.data.length-1}},setup(e){return(t,n)=>{const r=v.resolveComponent("ClientOnly");return v.openBlock(),v.createBlock(r,null,{default:v.withCtx(()=>[v.createVNode(v.unref(Xs),{height:600},{default:v.withCtx(()=>n[0]||(n[0]=[v.createTextVNode(" 123123123 ")])),_:1})]),_:1})}}});var mn=(e=>(e.Top="top",e.Bottom="bottom",e))(mn||{});const Ks=v.defineComponent({__name:"Button",props:{variant:{},size:{}},setup(e){return(t,n)=>(v.openBlock(),v.createElementBlock("button",{class:v.normalizeClass(["button",`button--${t.variant||"primary"}`,`button--${t.size||"medium"}`])},[v.renderSlot(t.$slots,"default",{},void 0,!0)],2))}}),Js=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},Qs=Js(Ks,[["__scopeId","data-v-52b6ec0c"]]);exports.Area=Zs;exports.Button=Qs;exports.PaginationPosition=mn;
|