@ag-grid-enterprise/sparklines
Advanced tools
Comparing version 31.3.2 to 32.0.0
@@ -1,2 +0,2 @@ | ||
var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,i)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,__spreadValues=(e,t)=>{for(var i in t||(t={}))__hasOwnProp.call(t,i)&&__defNormalProp(e,i,t[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(t))__propIsEnum.call(t,i)&&__defNormalProp(e,i,t[i]);return e},__export=(e,t)=>{for(var i in t)__defProp(e,i,{get:t[i],enumerable:!0})},__copyProps=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of __getOwnPropNames(t))!__hasOwnProp.call(e,s)&&s!==i&&__defProp(e,s,{get:()=>t[s],enumerable:!(n=__getOwnPropDesc(t,s))||n.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__decorateClass=(e,t,i,n)=>{for(var s=n>1?void 0:n?__getOwnPropDesc(t,i):t,a=e.length-1,r;a>=0;a--)(r=e[a])&&(s=(n?r(t,i,s):r(s))||s);return n&&s&&__defProp(t,i,s),s},main_exports={};__export(main_exports,{SparklinesModule:()=>SparklinesModule}),module.exports=__toCommonJS(main_exports);var import_core3=require("@ag-grid-community/core"),import_core4=require("@ag-grid-enterprise/core"),import_core=require("@ag-grid-community/core"),import_ag_charts_community3=require("ag-charts-community"),import_ag_charts_community=require("ag-charts-community"),defaultTooltipCss=` | ||
var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var i in t)__defProp(e,i,{get:t[i],enumerable:!0})},__copyProps=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of __getOwnPropNames(t))!__hasOwnProp.call(e,n)&&n!==i&&__defProp(e,n,{get:()=>t[n],enumerable:!(s=__getOwnPropDesc(t,n))||s.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),main_exports={};__export(main_exports,{SparklinesModule:()=>SparklinesModule}),module.exports=__toCommonJS(main_exports);var import_core6=require("@ag-grid-community/core"),import_core7=require("@ag-grid-enterprise/core"),import_core4=require("@ag-grid-community/core"),import_core3=require("@ag-grid-community/core"),import_ag_charts_community8=require("ag-charts-community"),import_ag_charts_community3=require("ag-charts-community"),import_core=require("@ag-grid-community/core");function getLineDash(e,t="solid"){const i={solid:[],dash:[4,3],dot:[1,3],dashDot:[4,3,1,3],dashDotDot:[4,3,1,3,1,3],shortDot:[1,1],shortDash:[3,1],shortDashDot:[3,1,1,1],shortDashDotDot:[3,1,1,1,1,1],longDash:[8,3],longDashDot:[8,3,1,3],longDashDotDot:[8,3,1,3,1,3]},s={solid:[],dash:[3,3],dot:[0,3],dashDot:[3,3,0,3],dashDotDot:[3,3,0,3,0,3],shortDot:[0,2],shortDash:[2,2],shortDashDot:[2,2,0,2],shortDashDotDot:[2,2,0,2,0,2],longDash:[7,3],longDashDot:[7,3,0,3],longDashDotDot:[7,3,0,3,0,3]};return e==="round"||e==="square"?s[t]==null?(warnInvalid(t),s.solid):s[t]:i[t]==null?(warnInvalid(t),i.solid):i[t]}function warnInvalid(e){(0,import_core._warnOnce)(`'${e}' is not a valid 'lineDash' option.`)}var import_ag_charts_community=require("ag-charts-community");function getMarker(e){switch(e){case"circle":return import_ag_charts_community._Scene.Circle;case"square":return import_ag_charts_community._Scene.Square;case"diamond":return import_ag_charts_community._Scene.Diamond;default:return import_ag_charts_community._Scene.Circle}}var import_core2=require("@ag-grid-community/core"),import_ag_charts_community2=require("ag-charts-community"),defaultTooltipCss=` | ||
.ag-sparkline-tooltip-wrapper { | ||
@@ -39,7 +39,7 @@ position: absolute; | ||
} | ||
`,{extent,isNumber,isString,isStringObject,isDate,createId,Padding}=import_ag_charts_community._Util,{LinearScale,BandScale,TimeScale}=import_ag_charts_community._Scale,SparklineAxis=class{constructor(){this.type="category",this.stroke="rgb(204, 214, 235)",this.strokeWidth=1}},_Sparkline=class G{constructor(){this.id=createId(this),this.seriesRect={x:0,y:0,width:0,height:0},this._context=void 0,this._container=void 0,this._data=void 0,this.padding=new Padding(3),this.xKey="x",this.yKey="y",this.dataType=void 0,this.xData=[],this.yData=[],this.min=void 0,this.max=void 0,this.yScale=new LinearScale,this.axis=new SparklineAxis,this.highlightStyle={size:6,fill:"yellow",stroke:"silver",strokeWidth:1},this._width=100,this._height=100,this.smallestInterval=void 0,this.layoutId=0,this.defaultDateFormatter=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),this._onMouseMove=this.onMouseMove.bind(this),this._onMouseOut=this.onMouseOut.bind(this);const t=new import_ag_charts_community._Scene.Group;this.rootGroup=t;const i=document.createElement("div");i.setAttribute("class","ag-sparkline-wrapper");const n=new import_ag_charts_community._Scene.Scene({});this.scene=n,this.canvasElement=n.canvas.element,n.setRoot(t),n.setContainer(i),this.resizeAndSetDimensions(this.width,this.height),G.tooltipDocuments.includes(document)||this.initialiseTooltipStyles(),this.setupDomEventListeners(this.canvasElement)}set context(t){this._context!==t&&(this._context=t)}get context(){return this._context}set container(t){if(this._container!==t){const{parentNode:i}=this.canvasElement;i?.removeChild(this.canvasElement),t&&t.appendChild(this.canvasElement),this._container=t}}get container(){return this._container}set data(t){this._data!==t&&(this._data=t,this.processData(),this.mouseMoveEvent&&this.highlightedDatum&&this.updateHitPoint(this.mouseMoveEvent))}get data(){return this._data}resizeAndSetDimensions(t,i){this.scene.resize(t,i),this.seriesRect.width=t,this.seriesRect.height=i}initialiseTooltipStyles(){const t=document.createElement("style");t.innerHTML=defaultTooltipCss,document.head.insertBefore(t,document.head.querySelector("style")),G.tooltipDocuments.push(document)}set width(t){this._width!==t&&(this._width=t,this.scene.resize(t,this.height),this.scheduleLayout())}get width(){return this._width}set height(t){this._height!==t&&(this._height=t,this.scene.resize(this.width,t),this.scheduleLayout())}get height(){return this._height}update(){}updateYScale(){this.updateYScaleRange(),this.updateYScaleDomain()}updateYScaleDomain(){}updateYScaleRange(){const{yScale:t,seriesRect:i}=this;t.range=[i.height,0]}updateXScale(){const{type:t}=this.axis;this.xScale=this.getXScale(t),this.updateXScaleRange(),this.updateXScaleDomain()}updateXScaleRange(){this.xScale.range=[0,this.seriesRect.width]}updateXScaleDomain(){const{xData:t,xScale:i}=this;let n;(i instanceof LinearScale||i instanceof TimeScale)&&(n=extent(t)),this.xScale.domain=n?n.slice():t}getXScale(t="category"){switch(t){case"number":return new LinearScale;case"time":return new TimeScale;case"category":default:return new BandScale}}updateAxisLine(){}updateAxes(){this.updateYScale(),this.updateXScale(),this.updateAxisLine()}updateCrosshairs(){this.updateXCrosshairLine(),this.updateYCrosshairLine()}generateNodeData(){return[]}getNodeData(){return[]}updateNodes(){}updateXCrosshairLine(){}updateYCrosshairLine(){}highlightDatum(t){this.updateNodes()}dehighlightDatum(){this.highlightedDatum=void 0,this.updateNodes(),this.updateCrosshairs()}onMouseMove(t){this.mouseMoveEvent=t,this.updateHitPoint(t)}updateHitPoint(t){var i,n,s;const a=this.pickClosestSeriesNodeDatum(t.offsetX,t.offsetY);if(!a)return;const r=this.highlightedDatum;this.highlightedDatum=a,(this.highlightedDatum&&!r||this.highlightedDatum&&r&&this.highlightedDatum!==r)&&(this.highlightDatum(a),this.updateCrosshairs(),this.scene.render().catch(o=>console.error("AG Grid - chart rendering failed",o))),((s=(n=(i=this.processedOptions)==null?void 0:i.tooltip)==null?void 0:n.enabled)!=null?s:!0)&&this.handleTooltip(t,a)}onMouseOut(t){this.dehighlightDatum(),this.tooltip.toggle(!1),this.scene.render().catch(i=>console.error("AG Grid - chart rendering failed",i))}processData(){const{data:t,yData:i,xData:n}=this;if(!t||this.invalidData(this.data))return;i.length=0,n.length=0;const s=t.length,a=this.getDataType(t);this.dataType=a;const{type:r}=this.axis,h=r!=="number"&&r!=="time"?"category":r,o=h==="number"||h==="time",l=(d,m)=>{this.smallestInterval==null&&(this.smallestInterval={x:1/0,y:1/0});const{x:g}=this.smallestInterval,p=Math.abs(d-m);p>0&&p<g&&(this.smallestInterval.x=p)};let c;if(a==="number")for(let d=0;d<s;d++){const m=d,g=t[d],p=this.getDatum(m,h),f=this.getDatum(g,"number");o&&l(p,c),n.push(p),i.push(f),c=p}else if(a==="array")for(let d=0;d<s;d++){const m=t[d];if(Array.isArray(m)){const g=m[0],p=m[1],f=this.getDatum(g,h),u=this.getDatum(p,"number");if(f==null)continue;o&&l(f,c),n.push(f),i.push(u),c=f}}else if(a==="object"){const{yKey:d,xKey:m}=this;for(let g=0;g<s;g++){const p=t[g];if(typeof p=="object"&&!Array.isArray(p)){const f=p[m],u=p[d],y=this.getDatum(f,h),v=this.getDatum(u,"number");if(y==null)continue;o&&l(y,c),n.push(y),i.push(v),c=y}}}this.updateAxes(),this.immediateLayout()}getDataType(t){for(const i of t)if(i!=null){if(isNumber(i))return"number";if(Array.isArray(i))return"array";if(typeof i=="object")return"object"}}getDatum(t,i){if(i==="number"&&isNumber(t)||i==="time"&&(isNumber(t)||isDate(t)))return t;if(i==="category"){if(isString(t)||isDate(t)||isNumber(t))return{toString:()=>String(t)};if(isStringObject(t))return t}}get layoutScheduled(){return!!this.layoutId}scheduleLayout(){this.layoutId&&cancelAnimationFrame(this.layoutId),this.layoutId=requestAnimationFrame(()=>{this.immediateLayout(),this.layoutId=0})}immediateLayout(){this.setSparklineDimensions(),!this.invalidData(this.data)&&(this.updateXScaleRange(),this.updateYScaleRange(),this.updateAxisLine(),this.update(),this.scene.render().catch(t=>console.error("AG Grid - chart rendering failed",t)))}setSparklineDimensions(){const{width:t,height:i,padding:n,seriesRect:s,rootGroup:a}=this,r=t-n.left-n.right,h=i-n.top-n.bottom;s.width=r,s.height=h,s.x=n.left,s.y=n.top,a.translationX=s.x,a.translationY=s.y}pickClosestSeriesNodeDatum(t,i){let n=1/0,s;const a=this.rootGroup.transformPoint(t,i),r=this.getNodeData();for(let h=0;h<r.length;h++){const o=r[h];if(!o.point)return;const l=this.getDistance(a,o.point);l<=n&&(n=l,s=o)}return s}getDistance(t,i){return Math.abs(t.x-i.x)}handleTooltip(t,i){var n,s;const{seriesDatum:a}=i,{canvasElement:r}=this,{clientX:h,clientY:o}=t,l=(n=this.processedOptions)==null?void 0:n.tooltip,c={pageX:h,pageY:o,position:{xOffset:l?.xOffset,yOffset:l?.yOffset},container:l?.container};c.container==null&&(c.container=r);const d=a.y,m=a.x;let g=(s=l?.enabled)!=null?s:!0;const p=l?.renderer;if(p){const u=p({context:this.context,datum:a,yValue:d,xValue:m});g=typeof u!="string"&&u.enabled!==void 0?u.enabled:g}const f=g&&a.y!==void 0&&this.getTooltipHtml(i);f&&this.tooltip.show(c,f)}formatNumericDatum(t){return String(Math.round(t*10)/10)}formatDatum(t){const i=this.axis.type||"category";return i==="number"&&typeof t=="number"?this.formatNumericDatum(t):i==="time"&&(t instanceof Date||isNumber(t))?this.defaultDateFormatter.format(t):String(t)}setupDomEventListeners(t){t.addEventListener("mousemove",this._onMouseMove),t.addEventListener("mouseout",this._onMouseOut)}cleanupDomEventListeners(t){t.removeEventListener("mousemove",this._onMouseMove),t.removeEventListener("mouseout",this._onMouseOut)}invalidData(t){return!t||!Array.isArray(t)}destroy(){this.cleanupDomEventListeners(this.canvasElement),this.scene.destroy(),this.container=void 0}};_Sparkline.tooltipDocuments=[];var Sparkline=_Sparkline;function toTooltipHtml(e,t){var i,n,s;if(typeof e=="string")return e;t=t??{};const{content:a=(i=t.content)!=null?i:"",title:r=(n=t.title)!=null?n:void 0,color:h=t.color,backgroundColor:o=t.backgroundColor,opacity:l=(s=t.opacity)!=null?s:1}=e;let c,d;h?(c=r?`<span class="${SparklineTooltip.class}-title"; style="color: ${h}">${r}</span>`:"",d=`<span class="${SparklineTooltip.class}-content" style="color: ${h}">${a}</span>`):(c=r?`<span class="${SparklineTooltip.class}-title">${r}</span>`:"",d=`<span class="${SparklineTooltip.class}-content">${a}</span>`);let m=`opacity: ${l}`;return o&&(m+=`; background-color: ${o.toLowerCase()}`),`<div class="${SparklineTooltip.class}" style="${m}"> | ||
${c} | ||
${d} | ||
</div>`}var _SparklineTooltip=class A{constructor(){this.element=document.createElement("div"),document.body.appendChild(this.element)}isVisible(){const{element:t}=this;if(t.classList)return!t.classList.contains(`${A.class}-wrapper-hidden`);const i=t.getAttribute("class");return i?i.split(" ").indexOf(`${A.class}-wrapper-hidden`)<0:!1}updateClass(t){const i=[`${A.class}-wrapper`];t!==!0&&i.push(`${A.class}-wrapper-hidden`),this.element.setAttribute("class",i.join(" "))}show(t,i){var n,s,a,r;this.toggle(!1);const{element:h}=this;if(i!==void 0)h.innerHTML=i;else if(!h.innerHTML)return;const o=(s=(n=t.position)==null?void 0:n.xOffset)!=null?s:10,l=(r=(a=t.position)==null?void 0:a.yOffset)!=null?r:0;let c=t.pageX+o,d=t.pageY+l;const m=h.getBoundingClientRect();let g=window.innerWidth-m.width;if(t.container){const p=t.container.getBoundingClientRect();g=p.left+(p.width-m.width)}c>g&&(c=t.pageX-h.clientWidth-o),typeof scrollX<"u"&&(c+=scrollX),typeof scrollY<"u"&&(d+=scrollY),h.style.left=`${Math.round(c)}px`,h.style.top=`${Math.round(d)}px`,this.toggle(!0)}toggle(t){this.updateClass(t)}destroy(){const{parentNode:t}=this.element;t&&t.removeChild(this.element)}};_SparklineTooltip.class="ag-sparkline-tooltip";var SparklineTooltip=_SparklineTooltip,import_ag_charts_community2=require("ag-charts-community");function getMarker(e){switch(e){case"circle":return import_ag_charts_community2._Scene.Circle;case"square":return import_ag_charts_community2._Scene.Square;case"diamond":return import_ag_charts_community2._Scene.Diamond;default:return import_ag_charts_community2._Scene.Circle}}function getLineDash(e,t="solid"){const i={solid:[],dash:[4,3],dot:[1,3],dashDot:[4,3,1,3],dashDotDot:[4,3,1,3,1,3],shortDot:[1,1],shortDash:[3,1],shortDashDot:[3,1,1,1],shortDashDotDot:[3,1,1,1,1,1],longDash:[8,3],longDashDot:[8,3,1,3],longDashDotDot:[8,3,1,3,1,3]},n={solid:[],dash:[3,3],dot:[0,3],dashDot:[3,3,0,3],dashDotDot:[3,3,0,3,0,3],shortDot:[0,2],shortDash:[2,2],shortDashDot:[2,2,0,2],shortDashDotDot:[2,2,0,2,0,2],longDash:[7,3],longDashDot:[7,3,0,3],longDashDotDot:[7,3,0,3,0,3]};return e==="round"||e==="square"?n[t]==null?(console.warn(`'${t}' is not a valid 'lineDash' option.`),n.solid):n[t]:i[t]==null?(console.warn(`'${t}' is not a valid 'lineDash' option.`),i.solid):i[t]}var{extent:extent2}=import_ag_charts_community3._Util,{BandScale:BandScale2}=import_ag_charts_community3._Scale,SparklineMarker=class{constructor(){this.enabled=!0,this.shape="circle",this.size=0,this.fill="rgb(124, 181, 236)",this.stroke="rgb(124, 181, 236)",this.strokeWidth=1,this.formatter=void 0}},SparklineLine=class{constructor(){this.stroke="rgb(124, 181, 236)",this.strokeWidth=1}},SparklineCrosshairs=class{constructor(){this.xLine={enabled:!0,stroke:"rgba(0,0,0, 0.54)",strokeWidth:1,lineDash:"solid",lineCap:void 0},this.yLine={enabled:!1,stroke:"rgba(0,0,0, 0.54)",strokeWidth:1,lineDash:"solid",lineCap:void 0}}},AreaSparkline=class extends Sparkline{constructor(){super(),this.fill="rgba(124, 181, 236, 0.25)",this.strokePath=new import_ag_charts_community3._Scene.Path,this.fillPath=new import_ag_charts_community3._Scene.Path,this.xCrosshairLine=new import_ag_charts_community3._Scene.Line,this.yCrosshairLine=new import_ag_charts_community3._Scene.Line,this.areaSparklineGroup=new import_ag_charts_community3._Scene.Group,this.xAxisLine=new import_ag_charts_community3._Scene.Line,this.markers=new import_ag_charts_community3._Scene.Group,this.markerSelection=import_ag_charts_community3._Scene.Selection.select(this.markers,()=>this.markerFactory()),this.markerSelectionData=[],this.marker=new SparklineMarker,this.line=new SparklineLine,this.crosshairs=new SparklineCrosshairs,this.rootGroup.append(this.areaSparklineGroup),this.xAxisLine.zIndex=500,this.fillPath.zIndex=50,this.strokePath.zIndex=1e3,this.xCrosshairLine.zIndex=2e3,this.yCrosshairLine.zIndex=2e3,this.markers.zIndex=2500,this.areaSparklineGroup.append([this.fillPath,this.xAxisLine,this.strokePath,this.xCrosshairLine,this.yCrosshairLine,this.markers])}markerFactory(){const{shape:e}=this.marker,t=getMarker(e);return new t}getNodeData(){return this.markerSelectionData}update(){const e=this.generateNodeData();if(!e)return;const{nodeData:t,fillData:i,strokeData:n}=e;this.markerSelectionData=t,this.updateSelection(t),this.updateNodes(),this.updateStroke(n),this.updateFill(i)}updateYScaleDomain(){const{yData:e,yScale:t}=this,i=extent2(e);let n=0,s=1;i!==void 0&&(n=this.min=i[0],s=this.max=i[1]),n=n<0?n:0,s=s<0?0:s,t.domain=[n,s]}generateNodeData(){const{data:e,yData:t,xData:i,xScale:n,yScale:s}=this;if(!e)return;const a=!(n instanceof BandScale2),r=a?0:n.bandwidth/2,h=t.length,o=[],l=[],c=[];let d,m,g,p;const f=s.convert(0);for(let u=0;u<h;u++){const y=t[u],v=i[u],x=n.convert(a?n.toDomain(v):v)+r,b=y===void 0?NaN:s.convert(y);u+1<h&&(p=n.convert(a?n.toDomain(i[u+1]):i[u+1])+r),c.push({seriesDatum:{x:v,y},point:{x,y:b}}),y===void 0&&g!==void 0?(l.push({seriesDatum:void 0,point:{x:g,y:f}}),p!==void 0&&l.push({seriesDatum:void 0,point:{x:p,y:f}})):y!==void 0&&(l.push({seriesDatum:{x:v,y},point:{x,y:b}}),o.push({seriesDatum:{x:v,y},point:{x,y:b}}),d=d!==void 0?d:x,m=x),g=x}return l.push({seriesDatum:void 0,point:{x:m,y:f}},{seriesDatum:void 0,point:{x:d,y:f}}),{nodeData:o,fillData:l,strokeData:c}}updateAxisLine(){const{xScale:e,yScale:t,axis:i,xAxisLine:n}=this;n.x1=e.range[0],n.x2=e.range[1],n.y1=n.y2=0,n.stroke=i.stroke,n.strokeWidth=i.strokeWidth;const s=t.convert(0);n.translationY=s}updateSelection(e){this.markerSelection.update(e)}updateNodes(){const{highlightedDatum:e,highlightStyle:t,marker:i}=this,{size:n,fill:s,stroke:a,strokeWidth:r}=t,h=i.formatter;this.markerSelection.each((o,l,c)=>{const{point:d,seriesDatum:m}=l;if(!d)return;const g=l===e,p=g&&s!==void 0?s:i.fill,f=g&&a!==void 0?a:i.stroke,u=g&&r!==void 0?r:i.strokeWidth,y=g&&n!==void 0?n:i.size;let v;if(h){const x=c===0,b=c===this.markerSelectionData.length-1,S=m.y===this.min,_=m.y===this.max;v=h({datum:l,xValue:m.x,yValue:m.y,min:S,max:_,first:x,last:b,fill:p,stroke:f,strokeWidth:u,size:y,highlighted:g})}o.size=v&&v.size!=null?v.size:y,o.fill=v&&v.fill!=null?v.fill:p,o.stroke=v&&v.stroke!=null?v.stroke:f,o.strokeWidth=v&&v.strokeWidth!=null?v.strokeWidth:u,o.translationX=d.x,o.translationY=d.y,o.visible=v&&v.enabled!=null?v.enabled:i.enabled&&o.size>0})}updateStroke(e){const{strokePath:t,yData:i,line:n}=this,s=t.path;if(s.clear(),i.length<2)return;const a=e.length;let r=!0;for(let h=0;h<a;h++){const{point:o,seriesDatum:l}=e[h],c=o.x,d=o.y;l.y==null?r=!0:r?(s.moveTo(c,d),r=!1):s.lineTo(c,d)}t.lineJoin=t.lineCap="round",t.fill=void 0,t.stroke=n.stroke,t.strokeWidth=n.strokeWidth}updateFill(e){const{fillPath:t,yData:i,fill:n}=this,s=t.path,a=e.length;if(s.clear(),!(i.length<2)){for(let r=0;r<a;r++){const{point:h}=e[r],o=h.x,l=h.y;r>0?s.lineTo(o,l):s.moveTo(o,l)}s.closePath(),t.lineJoin="round",t.stroke=void 0,t.fill=n}}updateXCrosshairLine(){var e;const{yScale:t,xCrosshairLine:i,highlightedDatum:n,crosshairs:{xLine:s}}=this;if(!s.enabled||n==null){i.strokeWidth=0;return}i.y1=t.range[0],i.y2=t.range[1],i.x1=i.x2=0,i.stroke=s.stroke,i.strokeWidth=(e=s.strokeWidth)!=null?e:1,i.lineCap=s.lineCap==="round"||s.lineCap==="square"?s.lineCap:void 0;const{lineDash:a}=s;i.lineDash=Array.isArray(a)?a:getLineDash(i.lineCap,s.lineDash),i.translationX=n.point.x}updateYCrosshairLine(){var e;const{xScale:t,yCrosshairLine:i,highlightedDatum:n,crosshairs:{yLine:s}}=this;if(!s.enabled||n==null){i.strokeWidth=0;return}i.x1=t.range[0],i.x2=t.range[1],i.y1=i.y2=0,i.stroke=s.stroke,i.strokeWidth=(e=s.strokeWidth)!=null?e:1,i.lineCap=s.lineCap==="round"||s.lineCap==="square"?s.lineCap:void 0;const{lineDash:a}=s;i.lineDash=Array.isArray(a)?a:getLineDash(i.lineCap,s.lineDash),i.translationY=n.point.y}getTooltipHtml(e){var t,i;const{dataType:n}=this,{seriesDatum:s}=e,a=s.y,r=s.x,h=this.formatNumericDatum(a),o=n==="array"||n==="object"?this.formatDatum(r):void 0,l={content:h,title:o},c=(i=(t=this.processedOptions)==null?void 0:t.tooltip)==null?void 0:i.renderer;return c?toTooltipHtml(c({context:this.context,datum:s,yValue:a,xValue:r}),l):toTooltipHtml(l)}};AreaSparkline.className="AreaSparkline";var import_ag_charts_community4=require("ag-charts-community"),{extent:extent3}=import_ag_charts_community4._Util,{BandScale:BandScale3}=import_ag_charts_community4._Scale,SparklineMarker2=class{constructor(){this.enabled=!0,this.shape="circle",this.size=0,this.fill="rgb(124, 181, 236)",this.stroke="rgb(124, 181, 236)",this.strokeWidth=1,this.formatter=void 0}},SparklineLine2=class{constructor(){this.stroke="rgb(124, 181, 236)",this.strokeWidth=1}},SparklineCrosshairs2=class{constructor(){this.xLine={enabled:!0,stroke:"rgba(0,0,0, 0.54)",strokeWidth:1,lineDash:"solid",lineCap:void 0},this.yLine={enabled:!1,stroke:"rgba(0,0,0, 0.54)",strokeWidth:1,lineDash:"solid",lineCap:void 0}}},LineSparkline=class extends Sparkline{constructor(){super(),this.linePath=new import_ag_charts_community4._Scene.Path,this.xCrosshairLine=new import_ag_charts_community4._Scene.Line,this.yCrosshairLine=new import_ag_charts_community4._Scene.Line,this.lineSparklineGroup=new import_ag_charts_community4._Scene.Group,this.markers=new import_ag_charts_community4._Scene.Group,this.markerSelection=import_ag_charts_community4._Scene.Selection.select(this.markers,()=>this.markerFactory()),this.markerSelectionData=[],this.marker=new SparklineMarker2,this.line=new SparklineLine2,this.crosshairs=new SparklineCrosshairs2,this.rootGroup.append(this.lineSparklineGroup),this.linePath.zIndex=1e3,this.xCrosshairLine.zIndex=2e3,this.yCrosshairLine.zIndex=2e3,this.markers.zIndex=2500,this.lineSparklineGroup.append([this.linePath,this.xCrosshairLine,this.yCrosshairLine,this.markers])}getNodeData(){return this.markerSelectionData}markerFactory(){const{shape:e}=this.marker,t=getMarker(e);return new t}onMarkerShapeChange(){this.markerSelection=this.markerSelection.clear(),this.scheduleLayout()}update(){const e=this.generateNodeData();e&&(this.markerSelectionData=e,this.updateSelection(e),this.updateNodes(),this.updateLine())}updateYScaleDomain(){const{yData:e,yScale:t}=this,i=extent3(e);let n=0,s=1;if(i!==void 0&&(n=this.min=i[0],s=this.max=i[1]),n===s){const a=Math.abs(n*.01);n-=a,s+=a}t.domain=[n,s]}generateNodeData(){const{data:e,yData:t,xData:i,xScale:n,yScale:s}=this;if(!e)return;const a=!(n instanceof BandScale3),r=a?0:n.bandwidth/2,h=[];for(let o=0;o<t.length;o++){const l=t[o],c=i[o];if(l==null)continue;const d=n.convert(a?n.toDomain(c):c)+r,m=l===void 0?NaN:s.convert(l);h.push({seriesDatum:{x:c,y:l},point:{x:d,y:m}})}return h}updateSelection(e){this.markerSelection.update(e)}updateNodes(){const{highlightedDatum:e,highlightStyle:t,marker:i}=this,{size:n,fill:s,stroke:a,strokeWidth:r}=t,h=i.formatter;this.markerSelection.each((o,l,c)=>{const d=l===e,m=d&&s!==void 0?s:i.fill,g=d&&a!==void 0?a:i.stroke,p=d&&r!==void 0?r:i.strokeWidth,f=d&&n!==void 0?n:i.size;let u;const{seriesDatum:y,point:v}=l;if(h){const x=c===0,b=c===this.markerSelectionData.length-1,S=y.y===this.min,_=y.y===this.max;u=h({datum:l,xValue:y.x,yValue:y.y,min:S,max:_,first:x,last:b,fill:m,stroke:g,strokeWidth:p,size:f,highlighted:d})}o.size=u&&u.size!=null?u.size:f,o.fill=u&&u.fill!=null?u.fill:m,o.stroke=u&&u.stroke!=null?u.stroke:g,o.strokeWidth=u&&u.strokeWidth!=null?u.strokeWidth:p,o.translationX=v.x,o.translationY=v.y,o.visible=u&&u.enabled!=null?u.enabled:i.enabled&&o.size>0})}updateLine(){const{linePath:e,yData:t,xData:i,xScale:n,yScale:s,line:a}=this,r=e.path;if(r.clear(),t.length<2)return;const h=!(n instanceof BandScale3),o=t.length,l=h?0:n.bandwidth/2;let c=!0;for(let d=0;d<o;d++){const m=i[d],g=t[d],p=n.convert(h?n.toDomain(m):m)+l,f=g===void 0?NaN:s.convert(g);g==null?c=!0:c?(r.moveTo(p,f),c=!1):r.lineTo(p,f)}e.fill=void 0,e.stroke=a.stroke,e.strokeWidth=a.strokeWidth}updateXCrosshairLine(){var e;const{yScale:t,xCrosshairLine:i,highlightedDatum:n,crosshairs:{xLine:s}}=this;if(!s.enabled||n==null){i.strokeWidth=0;return}i.y1=t.range[0],i.y2=t.range[1],i.x1=i.x2=0,i.stroke=s.stroke,i.strokeWidth=(e=s.strokeWidth)!=null?e:1,i.lineCap=s.lineCap==="round"||s.lineCap==="square"?s.lineCap:void 0;const{lineDash:a}=s;i.lineDash=Array.isArray(a)?a:getLineDash(i.lineCap,s.lineDash),i.translationX=n.point.x}updateYCrosshairLine(){var e;const{xScale:t,yCrosshairLine:i,highlightedDatum:n,crosshairs:{yLine:s}}=this;if(!s.enabled||n==null){i.strokeWidth=0;return}i.x1=t.range[0],i.x2=t.range[1],i.y1=i.y2=0,i.stroke=s.stroke,i.strokeWidth=(e=s.strokeWidth)!=null?e:1,i.lineCap=s.lineCap==="round"||s.lineCap==="square"?s.lineCap:void 0;const{lineDash:a}=s;i.lineDash=Array.isArray(a)?a:getLineDash(i.lineCap,s.lineDash),i.translationY=n.point.y}getTooltipHtml(e){var t,i;const{dataType:n}=this,{seriesDatum:s}=e,a=s.y,r=s.x,h=this.formatNumericDatum(a),o=n==="array"||n==="object"?this.formatDatum(r):void 0,l={content:h,title:o},c=(i=(t=this.processedOptions)==null?void 0:t.tooltip)==null?void 0:i.renderer;return c?toTooltipHtml(c({context:this.context,datum:s,yValue:a,xValue:r}),l):toTooltipHtml(l)}};LineSparkline.className="LineSparkline";var import_ag_charts_community6=require("ag-charts-community"),import_ag_charts_community5=require("ag-charts-community"),Label=class{constructor(){this.enabled=!0,this.fontSize=8,this.fontFamily="Verdana, sans-serif",this.fontStyle=void 0,this.fontWeight=void 0,this.color="rgba(70, 70, 70, 1)"}},{extent:extent4}=import_ag_charts_community5._Util,BarColumnLabel=class extends Label{constructor(){super(...arguments),this.formatter=void 0,this.placement="insideEnd"}},BarColumnSparkline=class extends Sparkline{constructor(){super(),this.fill="rgb(124, 181, 236)",this.stroke="silver",this.strokeWidth=0,this.paddingInner=.1,this.paddingOuter=.2,this.valueAxisDomain=void 0,this.formatter=void 0,this.axisLine=new import_ag_charts_community5._Scene.Line,this.bandWidth=0,this.sparklineGroup=new import_ag_charts_community5._Scene.Group,this.rectGroup=new import_ag_charts_community5._Scene.Group,this.labelGroup=new import_ag_charts_community5._Scene.Group,this.rectSelection=import_ag_charts_community5._Scene.Selection.select(this.rectGroup,import_ag_charts_community5._Scene.Rect),this.labelSelection=import_ag_charts_community5._Scene.Selection.select(this.labelGroup,import_ag_charts_community5._Scene.Text),this.nodeSelectionData=[],this.label=new BarColumnLabel,this.rootGroup.append(this.sparklineGroup),this.rectGroup.zIndex=50,this.axisLine.zIndex=500,this.labelGroup.zIndex=1500,this.sparklineGroup.append([this.rectGroup,this.axisLine,this.labelGroup]),this.axisLine.lineCap="round",this.label.enabled=!1}getNodeData(){return this.nodeSelectionData}update(){this.updateSelections(),this.updateNodes()}updateSelections(){const e=this.generateNodeData();e&&(this.nodeSelectionData=e,this.updateRectSelection(e),this.updateLabelSelection(e))}updateNodes(){this.updateRectNodes(),this.updateLabelNodes()}calculateStep(e){var t;const{xScale:i,paddingInner:n,paddingOuter:s,smallestInterval:a}=this;let h=(i.domain[1]-i.domain[0])/((t=a?.x)!=null?t:1)+1;const l=Math.min(h,50),c=l-1;return e/Math.max(1,2*s+c*n+l)}updateYScaleDomain(){const{yScale:e,yData:t,valueAxisDomain:i}=this,n=extent4(t);let s=0,a=1;n!==void 0&&(s=this.min=n[0],a=this.max=n[1]),s=s<0?s:0,a=a<0?0:a,i&&(i[1]<a&&(i[1]=a),i[0]>s&&(i[0]=s)),e.domain=i||[s,a]}updateRectSelection(e){this.rectSelection.update(e)}updateRectNodes(){const{highlightedDatum:e,formatter:t,fill:i,stroke:n,strokeWidth:s}=this,{fill:a,stroke:r,strokeWidth:h}=this.highlightStyle;this.rectSelection.each((o,l,c)=>{const d=l===e,m=d&&a!==void 0?a:i,g=d&&r!==void 0?r:n,p=d&&h!==void 0?h:s;let f;const{x:u,y,width:v,height:x,seriesDatum:b}=l;if(t){const S=c===0,_=c===this.nodeSelectionData.length-1,M=b.y===this.min,C=b.y===this.max;f=t({datum:l,xValue:b.x,yValue:b.y,width:v,height:x,min:M,max:C,first:S,last:_,fill:m,stroke:g,strokeWidth:p,highlighted:d})}o.fill=f&&f.fill||m,o.stroke=f&&f.stroke||g,o.strokeWidth=f&&f.strokeWidth||p,o.x=o.y=0,o.width=v,o.height=x,o.visible=o.height>0,o.translationX=u,o.translationY=y})}updateLabelSelection(e){this.labelSelection.update(e,t=>{t.tag=1,t.pointerEvents=import_ag_charts_community5._Scene.PointerEvents.None})}updateLabelNodes(){const{label:{enabled:e,fontStyle:t,fontWeight:i,fontSize:n,fontFamily:s,color:a}}=this;this.labelSelection.each((r,h)=>{const o=h.label;o&&e?(r.fontStyle=t,r.fontWeight=i,r.fontSize=n,r.fontFamily=s,r.textAlign=o.textAlign,r.textBaseline=o.textBaseline,r.text=o.text,r.x=o.x,r.y=o.y,r.fill=a,r.visible=!0):r.visible=!1})}getTooltipHtml(e){var t,i;const{dataType:n}=this,{seriesDatum:s}=e,a=s.y,r=s.x,h=this.formatNumericDatum(a),o=n==="array"||n==="object"?this.formatDatum(r):void 0,l={content:h,title:o},c=(i=(t=this.processedOptions)==null?void 0:t.tooltip)==null?void 0:i.renderer;return c?toTooltipHtml(c({context:this.context,datum:s,yValue:a,xValue:r}),l):toTooltipHtml(l)}formatLabelValue(e){return e%1!==0?e.toFixed(1):e.toFixed(0)}},{isNumber:isNumber2}=import_ag_charts_community6._Util,{BandScale:BandScale4}=import_ag_charts_community6._Scale,BarSparkline=class extends BarColumnSparkline{updateYScaleRange(){const{seriesRect:e,yScale:t}=this;t.range=[0,e.width]}updateXScaleRange(){const{xScale:e,seriesRect:t,paddingOuter:i,paddingInner:n}=this;if(e instanceof BandScale4)e.range=[0,t.height],e.paddingInner=n,e.paddingOuter=i;else{const s=this.calculateStep(t.height),a=s*i;this.bandWidth=s*(1-n),e.range=[a,t.height-a-this.bandWidth]}}updateAxisLine(){const{yScale:e,axis:t,axisLine:i,seriesRect:n}=this,{strokeWidth:s}=t;i.x1=0,i.x2=0,i.y1=0,i.y2=n.height,i.stroke=t.stroke,i.strokeWidth=s+(s%2===1?1:0);const a=e.convert(0);i.translationX=a}generateNodeData(){const{data:e,yData:t,xData:i,xScale:n,yScale:s,fill:a,stroke:r,strokeWidth:h,label:o}=this;if(!e)return;const{fontStyle:l,fontWeight:c,fontSize:d,fontFamily:m,color:g,formatter:p,placement:f}=o,u=[],y=s.convert(0),v=!(n instanceof BandScale4);for(let x=0,b=t.length;x<b;x++){let S=t[x];const _=i[x],M=S===void 0;M&&(S=0);const C=n.convert(v?n.toDomain(_):_),W=Math.min(S===void 0?NaN:s.convert(S),y),P=Math.max(S===void 0?NaN:s.convert(S),y),O=v?this.bandWidth:n.bandwidth,N=P-W,F={x:y,y:C};let z;p?z=p({value:S}):z=S!==void 0&&isNumber2(S)?this.formatLabelValue(S):"";const R=C+O/2;let D;const I="middle";let w;const k=S!==void 0&&S>=0,L=4;if(f==="center")D=W+N/2,w="center";else if(f==="outsideEnd")D=W+(k?N+L:-L),w=k?"start":"end";else if(f==="insideEnd"){D=W+(k?N-L:L),w=k?"end":"start";const T=import_ag_charts_community6._Scene.Text.getTextSize(z,m).width||20,X=y+T,E=y-T;(k&&D<X||!k&&D>E)&&(D=y+L*(k?1:-1),w=k?"start":"end")}else D=y+L*(k?1:-1),w=k?"start":"end";u.push({x:W,y:C,width:N,height:O,fill:a,stroke:r,strokeWidth:h,seriesDatum:{x:_,y:M?void 0:S},point:F,label:{x:D,y:R,text:z,fontStyle:l,fontWeight:c,fontSize:d,fontFamily:m,textAlign:w,textBaseline:I,fill:g}})}return u}getDistance(e,t){return Math.abs(e.y-t.y)}};BarSparkline.className="BarSparkline";var import_ag_charts_community7=require("ag-charts-community"),{isNumber:isNumber3}=import_ag_charts_community7._Util,{BandScale:BandScale5}=import_ag_charts_community7._Scale,ColumnSparkline=class extends BarColumnSparkline{updateYScaleRange(){const{seriesRect:e,yScale:t}=this;t.range=[e.height,0]}updateXScaleRange(){const{xScale:e,seriesRect:t,paddingOuter:i,paddingInner:n}=this;if(e instanceof BandScale5)e.range=[0,t.width],e.paddingInner=n,e.paddingOuter=i;else{const s=this.calculateStep(t.width),a=s*i;this.bandWidth=s*(1-n),e.range=[a,t.width-a-this.bandWidth]}}updateAxisLine(){const{yScale:e,axis:t,axisLine:i,seriesRect:n}=this,{strokeWidth:s}=t;i.x1=0,i.x2=n.width,i.y1=0,i.y2=0,i.stroke=t.stroke,i.strokeWidth=s+(s%2===1?1:0);const a=e.convert(0);i.translationY=a}generateNodeData(){const{data:e,yData:t,xData:i,xScale:n,yScale:s,fill:a,stroke:r,strokeWidth:h,label:o}=this;if(!e)return;const{fontStyle:l,fontWeight:c,fontSize:d,fontFamily:m,color:g,formatter:p,placement:f}=o,u=[],y=s.convert(0),v=!(n instanceof BandScale5);for(let x=0,b=t.length;x<b;x++){let S=t[x];const _=i[x],M=S===void 0;M&&(S=0);const C=Math.min(S===void 0?NaN:s.convert(S),y),W=n.convert(v?n.toDomain(_):_),P=Math.max(S===void 0?NaN:s.convert(S),y),O=v?this.bandWidth:n.bandwidth,N=P-C,F={x:W+O/2,y};let z;p?z=p({value:S}):z=S!==void 0&&isNumber3(S)?this.formatLabelValue(S):"";const R=W+O/2;let D;const I="center";let w;const k=S!==void 0&&S>=0,L=2;if(f==="center")D=C+N/2,w="middle";else if(f==="outsideEnd")D=C+(k?-L:N+L),w=k?"bottom":"top";else if(f==="insideEnd"){D=C+(k?L:N-L),w=k?"top":"bottom";const T=import_ag_charts_community7._Scene.Text.getTextSize(z,m).height||10,X=y-T,E=y+T;(k&&D>X||!k&&D<E)&&(D=y+L*(k?-1:1),w=k?"bottom":"top")}else D=y+L*(k?-1:1),w=k?"bottom":"top";u.push({x:W,y:C,width:O,height:N,fill:a,stroke:r,strokeWidth:h,seriesDatum:{x:_,y:M?void 0:S},point:F,label:{x:R,y:D,text:z,fontStyle:l,fontWeight:c,fontSize:d,fontFamily:m,textAlign:I,textBaseline:w,fill:g}})}return u}};ColumnSparkline.className="ColumnSparkline";var import_ag_charts_community8=require("ag-charts-community"),{isNumber:isNumber4}=import_ag_charts_community8._Util,AgSparkline=class{static create(e,t){e=import_ag_charts_community8._Util.deepClone(e);const i=getSparklineInstance(e.type);return t&&(i.tooltip=t),initSparkline(i,e),initSparklineByType(i,e),e.data&&(i.data=e.data),i.processedOptions=e,i}};function getSparklineInstance(e="line"){switch(e){case"column":return new ColumnSparkline;case"bar":return new BarSparkline;case"area":return new AreaSparkline;case"line":default:return new LineSparkline}}function initSparklineByType(e,t){switch(t.type){case"bar":initBarColumnSparkline(e,t);break;case"column":initBarColumnSparkline(e,t);break;case"area":initAreaSparkline(e,t);break;case"line":default:initLineSparkline(e,t);break}}function initSparkline(e,t){setValueIfPropertyExists(e,"context",t.context,t),setValueIfPropertyExists(e,"width",t.width,t),setValueIfPropertyExists(e,"height",t.height,t),setValueIfPropertyExists(e,"container",t.container,t),setValueIfPropertyExists(e,"xKey",t.xKey,t),setValueIfPropertyExists(e,"yKey",t.yKey,t),t.padding&&initPaddingOptions(e.padding,t.padding),t.axis&&initAxisOptions(e.axis,t.axis),t.highlightStyle&&initHighlightStyleOptions(e.highlightStyle,t.highlightStyle)}function initLineSparkline(e,t){t.marker&&initMarkerOptions(e.marker,t.marker),t.line&&initLineOptions(e.line,t.line),t.crosshairs&&initCrosshairsOptions(e.crosshairs,t.crosshairs)}function initAreaSparkline(e,t){setValueIfPropertyExists(e,"fill",t.fill,t),t.marker&&initMarkerOptions(e.marker,t.marker),t.line&&initLineOptions(e.line,t.line),t.crosshairs&&initCrosshairsOptions(e.crosshairs,t.crosshairs)}function initBarColumnSparkline(e,t){setValueIfPropertyExists(e,"valueAxisDomain",t.valueAxisDomain,t),setValueIfPropertyExists(e,"fill",t.fill,t),setValueIfPropertyExists(e,"stroke",t.stroke,t),setValueIfPropertyExists(e,"strokeWidth",t.strokeWidth,t),setValueIfPropertyExists(e,"paddingInner",t.paddingInner,t),setValueIfPropertyExists(e,"paddingOuter",t.paddingOuter,t),setValueIfPropertyExists(e,"formatter",t.formatter,t),t.label&&initLabelOptions(e.label,t.label)}function initPaddingOptions(e,t){setValueIfPropertyExists(e,"top",t.top,t),setValueIfPropertyExists(e,"right",t.right,t),setValueIfPropertyExists(e,"bottom",t.bottom,t),setValueIfPropertyExists(e,"left",t.left,t)}function initMarkerOptions(e,t){setValueIfPropertyExists(e,"enabled",t.enabled,t),setValueIfPropertyExists(e,"size",t.size,t),setValueIfPropertyExists(e,"shape",t.shape,t),setValueIfPropertyExists(e,"fill",t.fill,t),setValueIfPropertyExists(e,"stroke",t.stroke,t),setValueIfPropertyExists(e,"strokeWidth",t.strokeWidth,t),setValueIfPropertyExists(e,"formatter",t.formatter,t)}function initLabelOptions(e,t){setValueIfPropertyExists(e,"enabled",t.enabled,t),setValueIfPropertyExists(e,"fontStyle",t.fontStyle,t),setValueIfPropertyExists(e,"fontWeight",t.fontWeight,t),setValueIfPropertyExists(e,"fontSize",t.fontSize,t),setValueIfPropertyExists(e,"fontFamily",t.fontFamily,t),setValueIfPropertyExists(e,"textAlign",t.textAlign,t),setValueIfPropertyExists(e,"textBaseline",t.textBaseline,t),setValueIfPropertyExists(e,"color",t.color,t),setValueIfPropertyExists(e,"formatter",t.formatter,t),setValueIfPropertyExists(e,"placement",t.placement,t)}function initLineOptions(e,t){setValueIfPropertyExists(e,"stroke",t.stroke,t),setValueIfPropertyExists(e,"strokeWidth",t.strokeWidth,t)}function initAxisOptions(e,t){setValueIfPropertyExists(e,"type",t.type,t),setValueIfPropertyExists(e,"stroke",t.stroke,t),setValueIfPropertyExists(e,"strokeWidth",t.strokeWidth,t)}function initHighlightStyleOptions(e,t){setValueIfPropertyExists(e,"fill",t.fill,t),setValueIfPropertyExists(e,"size",t.size,t),setValueIfPropertyExists(e,"stroke",t.stroke,t),setValueIfPropertyExists(e,"strokeWidth",t.strokeWidth,t)}function initCrosshairsOptions(e,t){e.xLine&&t.xLine&&initCrosshairLineOptions(e.xLine,t.xLine),e.yLine&&t.yLine&&initCrosshairLineOptions(e.yLine,t.yLine)}function initCrosshairLineOptions(e,t){setValueIfPropertyExists(e,"enabled",t.enabled,t),setValueIfPropertyExists(e,"stroke",t.stroke,t),setValueIfPropertyExists(e,"strokeWidth",t.strokeWidth,t),setValueIfPropertyExists(e,"lineDash",t.lineDash,t),setValueIfPropertyExists(e,"lineCap",t.lineCap,t)}var doOnceFlags={};function doOnce(e,t){doOnceFlags[t]||(e(),doOnceFlags[t]=!0)}var offsetValidator=(e,t,i)=>{if(isNumber4(t))return!0;const n=`AG Charts: ${e} must be a number, the value you provided is not a valid number. Using the default of ${i}px.`;return doOnce(()=>console.warn(n),`${e} not a number`),!1},validators={xOffset:offsetValidator,yOffset:offsetValidator};function setValueIfPropertyExists(e,t,i,n){if(t in n)if(t in e){const s=validators[t];(s?s(t,i,e[t]):!0)&&e[t]!==i&&(e[t]=i)}else console.warn(`Property ${t} does not exist on the target object.`)}var _SparklineCellRenderer=class B extends import_core.Component{constructor(){super(B.TEMPLATE)}init(t){let i=!0;const n=()=>{const{clientWidth:a,clientHeight:r}=this.getGui();if(!(a===0||r===0))if(i){const h=__spreadValues({data:t.value,width:a,height:r,context:{data:t.data}},t.sparklineOptions);this.sparkline=AgSparkline.create(h,this.sparklineTooltipSingleton.getSparklineTooltip()),this.eSparkline.appendChild(this.sparkline.canvasElement),i=!1}else this.sparkline.width=a,this.sparkline.height=r},s=this.resizeObserverService.observeResize(this.getGui(),n);this.addDestroyFunc(()=>s())}refresh(t){return this.sparkline?(this.sparkline.data=t.value,!0):!1}destroy(){this.sparkline&&this.sparkline.destroy(),super.destroy()}};_SparklineCellRenderer.TEMPLATE=`<div class="ag-sparkline-wrapper"> | ||
<span ref="eSparkline"></span> | ||
</div>`,__decorateClass([(0,import_core.RefSelector)("eSparkline")],_SparklineCellRenderer.prototype,"eSparkline",2),__decorateClass([(0,import_core.Autowired)("resizeObserverService")],_SparklineCellRenderer.prototype,"resizeObserverService",2),__decorateClass([(0,import_core.Autowired)("sparklineTooltipSingleton")],_SparklineCellRenderer.prototype,"sparklineTooltipSingleton",2);var SparklineCellRenderer=_SparklineCellRenderer,import_core2=require("@ag-grid-community/core"),SparklineTooltipSingleton=class extends import_core2.BeanStub{postConstruct(){this.tooltip=new SparklineTooltip}getSparklineTooltip(){return this.tooltip}destroyTooltip(){this.tooltip&&this.tooltip.destroy()}};__decorateClass([import_core2.PostConstruct],SparklineTooltipSingleton.prototype,"postConstruct",1),__decorateClass([import_core2.PreDestroy],SparklineTooltipSingleton.prototype,"destroyTooltip",1),SparklineTooltipSingleton=__decorateClass([(0,import_core2.Bean)("sparklineTooltipSingleton")],SparklineTooltipSingleton);var VERSION="31.3.2",SparklinesModule={version:VERSION,moduleName:import_core3.ModuleNames.SparklinesModule,beans:[SparklineTooltipSingleton],userComponents:[{componentName:"agSparklineCellRenderer",componentClass:SparklineCellRenderer}],dependantModules:[import_core4.EnterpriseCoreModule]}; | ||
`,{extent,isNumber,isString,isStringObject,isDate,createId,Padding}=import_ag_charts_community2._Util,{LinearScale,BandScale,TimeScale}=import_ag_charts_community2._Scale,SparklineAxis=class{constructor(){this.type="category",this.stroke="rgb(204, 214, 235)",this.strokeWidth=1}},_Sparkline=class B{constructor(){this.id=createId(this),this.seriesRect={x:0,y:0,width:0,height:0},this._context=void 0,this._container=void 0,this._data=void 0,this.padding=new Padding(3),this.xKey="x",this.yKey="y",this.dataType=void 0,this.xData=[],this.yData=[],this.min=void 0,this.max=void 0,this.yScale=new LinearScale,this.axis=new SparklineAxis,this.highlightStyle={size:6,fill:"yellow",stroke:"silver",strokeWidth:1},this._width=100,this._height=100,this.smallestInterval=void 0,this.layoutId=0,this.defaultDateFormatter=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),this._onMouseMove=this.onMouseMove.bind(this),this._onMouseOut=this.onMouseOut.bind(this);const t=new import_ag_charts_community2._Scene.Group;this.rootGroup=t;const i=document.createElement("div");i.setAttribute("class","ag-sparkline-wrapper");const s=new import_ag_charts_community2._Scene.Scene({});this.scene=s,this.canvasElement=s.canvas.element,s.setRoot(t),s.setContainer(i),this.resizeAndSetDimensions(this.width,this.height),B.tooltipDocuments.includes(document)||this.initialiseTooltipStyles(),this.setupDomEventListeners(this.canvasElement)}set context(t){this._context!==t&&(this._context=t)}get context(){return this._context}set container(t){if(this._container!==t){const{parentNode:i}=this.canvasElement;i?.removeChild(this.canvasElement),t&&t.appendChild(this.canvasElement),this._container=t}}get container(){return this._container}set data(t){this._data!==t&&(this._data=t,this.processData(),this.mouseMoveEvent&&this.highlightedDatum&&this.updateHitPoint(this.mouseMoveEvent))}get data(){return this._data}resizeAndSetDimensions(t,i){this.scene.resize(t,i),this.seriesRect.width=t,this.seriesRect.height=i}initialiseTooltipStyles(){const t=document.createElement("style");t.innerHTML=defaultTooltipCss,document.head.insertBefore(t,document.head.querySelector("style")),B.tooltipDocuments.push(document)}set width(t){this._width!==t&&(this._width=t,this.scene.resize(t,this.height),this.scheduleLayout())}get width(){return this._width}set height(t){this._height!==t&&(this._height=t,this.scene.resize(this.width,t),this.scheduleLayout())}get height(){return this._height}update(){}updateYScale(){this.updateYScaleRange(),this.updateYScaleDomain()}updateYScaleDomain(){}updateYScaleRange(){const{yScale:t,seriesRect:i}=this;t.range=[i.height,0]}updateXScale(){const{type:t}=this.axis;this.xScale=this.getXScale(t),this.updateXScaleRange(),this.updateXScaleDomain()}updateXScaleRange(){this.xScale.range=[0,this.seriesRect.width]}updateXScaleDomain(){const{xData:t,xScale:i}=this;let s;(i instanceof LinearScale||i instanceof TimeScale)&&(s=extent(t)),this.xScale.domain=s?s.slice():t}getXScale(t="category"){switch(t){case"number":return new LinearScale;case"time":return new TimeScale;case"category":default:return new BandScale}}updateAxisLine(){}updateAxes(){this.updateYScale(),this.updateXScale(),this.updateAxisLine()}updateCrosshairs(){this.updateXCrosshairLine(),this.updateYCrosshairLine()}generateNodeData(){return[]}getNodeData(){return[]}updateNodes(){}updateXCrosshairLine(){}updateYCrosshairLine(){}highlightDatum(t){this.updateNodes()}dehighlightDatum(){this.highlightedDatum=void 0,this.updateNodes(),this.updateCrosshairs()}onMouseMove(t){this.mouseMoveEvent=t,this.updateHitPoint(t)}renderScene(){this.scene.render().catch(t=>(0,import_core2._errorOnce)("chart rendering failed",t))}updateHitPoint(t){const i=this.pickClosestSeriesNodeDatum(t.offsetX,t.offsetY);if(!i)return;const s=this.highlightedDatum;this.highlightedDatum=i,(this.highlightedDatum&&!s||this.highlightedDatum&&s&&this.highlightedDatum!==s)&&(this.highlightDatum(i),this.updateCrosshairs(),this.renderScene()),(this.processedOptions?.tooltip?.enabled??!0)&&this.handleTooltip(t,i)}onMouseOut(t){this.dehighlightDatum(),this.tooltip.toggle(!1),this.renderScene()}processData(){const{data:t,yData:i,xData:s}=this;if(!t||this.invalidData(this.data))return;i.length=0,s.length=0;const n=t.length,r=this.getDataType(t);this.dataType=r;const{type:o}=this.axis,l=o!=="number"&&o!=="time"?"category":o,a=l==="number"||l==="time",h=(c,f)=>{this.smallestInterval==null&&(this.smallestInterval={x:1/0,y:1/0});const{x:y}=this.smallestInterval,d=Math.abs(c-f);d>0&&d<y&&(this.smallestInterval.x=d)};let g;if(r==="number")for(let c=0;c<n;c++){const f=c,y=t[c],d=this.getDatum(f,l),m=this.getDatum(y,"number");a&&h(d,g),s.push(d),i.push(m),g=d}else if(r==="array")for(let c=0;c<n;c++){const f=t[c];if(Array.isArray(f)){const y=f[0],d=f[1],m=this.getDatum(y,l),u=this.getDatum(d,"number");if(m==null)continue;a&&h(m,g),s.push(m),i.push(u),g=m}}else if(r==="object"){const{yKey:c,xKey:f}=this;for(let y=0;y<n;y++){const d=t[y];if(typeof d=="object"&&!Array.isArray(d)){const m=d[f],u=d[c],p=this.getDatum(m,l),x=this.getDatum(u,"number");if(p==null)continue;a&&h(p,g),s.push(p),i.push(x),g=p}}}this.updateAxes(),this.immediateLayout()}getDataType(t){for(const i of t)if(i!=null){if(isNumber(i))return"number";if(Array.isArray(i))return"array";if(typeof i=="object")return"object"}}getDatum(t,i){if(i==="number"&&isNumber(t)||i==="time"&&(isNumber(t)||isDate(t)))return t;if(i==="category"){if(isString(t)||isDate(t)||isNumber(t))return{toString:()=>String(t)};if(isStringObject(t))return t}}get layoutScheduled(){return!!this.layoutId}scheduleLayout(){this.layoutId&&cancelAnimationFrame(this.layoutId),this.layoutId=requestAnimationFrame(()=>{this.immediateLayout(),this.layoutId=0})}immediateLayout(){this.setSparklineDimensions(),!this.invalidData(this.data)&&(this.updateXScaleRange(),this.updateYScaleRange(),this.updateAxisLine(),this.update(),this.renderScene())}setSparklineDimensions(){const{width:t,height:i,padding:s,seriesRect:n,rootGroup:r}=this,o=t-s.left-s.right,l=i-s.top-s.bottom;n.width=o,n.height=l,n.x=s.left,n.y=s.top,r.translationX=n.x,r.translationY=n.y}pickClosestSeriesNodeDatum(t,i){let s=1/0,n;const r=this.rootGroup.transformPoint(t,i),o=this.getNodeData();for(let l=0;l<o.length;l++){const a=o[l];if(!a.point)return;const h=this.getDistance(r,a.point);h<=s&&(s=h,n=a)}return n}getDistance(t,i){return Math.abs(t.x-i.x)}handleTooltip(t,i){const{seriesDatum:s}=i,{canvasElement:n}=this,{clientX:r,clientY:o}=t,l=this.processedOptions?.tooltip,a={pageX:r,pageY:o,position:{xOffset:l?.xOffset,yOffset:l?.yOffset},container:l?.container};a.container==null&&(a.container=n);const h=s.y,g=s.x;let c=l?.enabled??!0;const f=l?.renderer;if(f){const d=f({context:this.context,datum:s,yValue:h,xValue:g});c=typeof d!="string"&&d.enabled!==void 0?d.enabled:c}const y=c&&s.y!==void 0&&this.getTooltipHtml(i);y&&this.tooltip.show(a,y)}formatNumericDatum(t){return String(Math.round(t*10)/10)}formatDatum(t){const i=this.axis.type||"category";return i==="number"&&typeof t=="number"?this.formatNumericDatum(t):i==="time"&&(t instanceof Date||isNumber(t))?this.defaultDateFormatter.format(t):String(t)}setupDomEventListeners(t){t.addEventListener("mousemove",this._onMouseMove),t.addEventListener("mouseout",this._onMouseOut)}cleanupDomEventListeners(t){t.removeEventListener("mousemove",this._onMouseMove),t.removeEventListener("mouseout",this._onMouseOut)}invalidData(t){return!t||!Array.isArray(t)}destroy(){this.cleanupDomEventListeners(this.canvasElement),this.scene.destroy(),this.container=void 0}};_Sparkline.tooltipDocuments=[];var Sparkline=_Sparkline;function toTooltipHtml(e,t){if(typeof e=="string")return e;t=t??{};const{content:i=t.content??"",title:s=t.title??void 0,color:n=t.color,backgroundColor:r=t.backgroundColor,opacity:o=t.opacity??1}=e;let l,a;n?(l=s?`<span class="${TooltipClass}-title"; style="color: ${n}">${s}</span>`:"",a=`<span class="${TooltipClass}-content" style="color: ${n}">${i}</span>`):(l=s?`<span class="${TooltipClass}-title">${s}</span>`:"",a=`<span class="${TooltipClass}-content">${i}</span>`);let h=`opacity: ${o}`;return r&&(h+=`; background-color: ${r.toLowerCase()}`),`<div class="${TooltipClass}" style="${h}"> | ||
${l} | ||
${a} | ||
</div>`}var TooltipClass="ag-sparkline-tooltip",SparklineTooltip=class{constructor(){this.element=document.createElement("div"),document.body.appendChild(this.element)}isVisible(){const{element:e}=this;if(e.classList)return!e.classList.contains(`${TooltipClass}-wrapper-hidden`);const t=e.getAttribute("class");return t?t.split(" ").indexOf(`${TooltipClass}-wrapper-hidden`)<0:!1}updateClass(e){const t=[`${TooltipClass}-wrapper`];e!==!0&&t.push(`${TooltipClass}-wrapper-hidden`),this.element.setAttribute("class",t.join(" "))}show(e,t){this.toggle(!1);const{element:i}=this;if(t!==void 0)i.innerHTML=t;else if(!i.innerHTML)return;const s=e.position?.xOffset??10,n=e.position?.yOffset??0;let r=e.pageX+s,o=e.pageY+n;const l=i.getBoundingClientRect();let a=window.innerWidth-l.width;if(e.container){const h=e.container.getBoundingClientRect();a=h.left+(h.width-l.width)}r>a&&(r=e.pageX-i.clientWidth-s),typeof scrollX<"u"&&(r+=scrollX),typeof scrollY<"u"&&(o+=scrollY),i.style.left=`${Math.round(r)}px`,i.style.top=`${Math.round(o)}px`,this.toggle(!0)}toggle(e){this.updateClass(e)}destroy(){const{parentNode:e}=this.element;e&&e.removeChild(this.element)}},{extent:extent2}=import_ag_charts_community3._Util,{BandScale:BandScale2}=import_ag_charts_community3._Scale,SparklineMarker=class{constructor(){this.enabled=!0,this.shape="circle",this.size=0,this.fill="rgb(124, 181, 236)",this.stroke="rgb(124, 181, 236)",this.strokeWidth=1,this.formatter=void 0}},SparklineLine=class{constructor(){this.stroke="rgb(124, 181, 236)",this.strokeWidth=1}},SparklineCrosshairs=class{constructor(){this.xLine={enabled:!0,stroke:"rgba(0,0,0, 0.54)",strokeWidth:1,lineDash:"solid",lineCap:void 0},this.yLine={enabled:!1,stroke:"rgba(0,0,0, 0.54)",strokeWidth:1,lineDash:"solid",lineCap:void 0}}},AreaSparkline=class extends Sparkline{constructor(){super(),this.fill="rgba(124, 181, 236, 0.25)",this.strokePath=new import_ag_charts_community3._Scene.Path,this.fillPath=new import_ag_charts_community3._Scene.Path,this.xCrosshairLine=new import_ag_charts_community3._Scene.Line,this.yCrosshairLine=new import_ag_charts_community3._Scene.Line,this.areaSparklineGroup=new import_ag_charts_community3._Scene.Group,this.xAxisLine=new import_ag_charts_community3._Scene.Line,this.markers=new import_ag_charts_community3._Scene.Group,this.markerSelection=import_ag_charts_community3._Scene.Selection.select(this.markers,()=>this.markerFactory()),this.markerSelectionData=[],this.marker=new SparklineMarker,this.line=new SparklineLine,this.crosshairs=new SparklineCrosshairs,this.rootGroup.append(this.areaSparklineGroup),this.xAxisLine.zIndex=500,this.fillPath.zIndex=50,this.strokePath.zIndex=1e3,this.xCrosshairLine.zIndex=2e3,this.yCrosshairLine.zIndex=2e3,this.markers.zIndex=2500,this.areaSparklineGroup.append([this.fillPath,this.xAxisLine,this.strokePath,this.xCrosshairLine,this.yCrosshairLine,this.markers])}markerFactory(){const{shape:e}=this.marker,t=getMarker(e);return new t}getNodeData(){return this.markerSelectionData}update(){const e=this.generateNodeData();if(!e)return;const{nodeData:t,fillData:i,strokeData:s}=e;this.markerSelectionData=t,this.updateSelection(t),this.updateNodes(),this.updateStroke(s),this.updateFill(i)}updateYScaleDomain(){const{yData:e,yScale:t}=this,i=extent2(e);let s=0,n=1;i!==void 0&&(s=this.min=i[0],n=this.max=i[1]),s=s<0?s:0,n=n<0?0:n,t.domain=[s,n]}generateNodeData(){const{data:e,yData:t,xData:i,xScale:s,yScale:n}=this;if(!e)return;const r=!(s instanceof BandScale2),o=r?0:s.bandwidth/2,l=t.length,a=[],h=[],g=[];let c,f,y,d;const m=n.convert(0);for(let u=0;u<l;u++){const p=t[u],x=i[u],k=s.convert(r?s.toDomain(x):x)+o,b=p===void 0?NaN:n.convert(p);u+1<l&&(d=s.convert(r?s.toDomain(i[u+1]):i[u+1])+o),g.push({seriesDatum:{x,y:p},point:{x:k,y:b}}),p===void 0&&y!==void 0?(h.push({seriesDatum:void 0,point:{x:y,y:m}}),d!==void 0&&h.push({seriesDatum:void 0,point:{x:d,y:m}})):p!==void 0&&(h.push({seriesDatum:{x,y:p},point:{x:k,y:b}}),a.push({seriesDatum:{x,y:p},point:{x:k,y:b}}),c=c!==void 0?c:k,f=k),y=k}return h.push({seriesDatum:void 0,point:{x:f,y:m}},{seriesDatum:void 0,point:{x:c,y:m}}),{nodeData:a,fillData:h,strokeData:g}}updateAxisLine(){const{xScale:e,yScale:t,axis:i,xAxisLine:s}=this;s.x1=e.range[0],s.x2=e.range[1],s.y1=s.y2=0,s.stroke=i.stroke,s.strokeWidth=i.strokeWidth;const n=t.convert(0);s.translationY=n}updateSelection(e){this.markerSelection.update(e)}updateNodes(){const{highlightedDatum:e,highlightStyle:t,marker:i}=this,{size:s,fill:n,stroke:r,strokeWidth:o}=t,l=i.formatter;this.markerSelection.each((a,h,g)=>{const{point:c,seriesDatum:f}=h;if(!c)return;const y=h===e,d=y&&n!==void 0?n:i.fill,m=y&&r!==void 0?r:i.stroke,u=y&&o!==void 0?o:i.strokeWidth,p=y&&s!==void 0?s:i.size;let x;if(l){const k=g===0,b=g===this.markerSelectionData.length-1,S=f.y===this.min,_=f.y===this.max;x=l({datum:h,xValue:f.x,yValue:f.y,min:S,max:_,first:k,last:b,fill:d,stroke:m,strokeWidth:u,size:p,highlighted:y})}a.size=x&&x.size!=null?x.size:p,a.fill=x&&x.fill!=null?x.fill:d,a.stroke=x&&x.stroke!=null?x.stroke:m,a.strokeWidth=x&&x.strokeWidth!=null?x.strokeWidth:u,a.translationX=c.x,a.translationY=c.y,a.visible=x&&x.enabled!=null?x.enabled:i.enabled&&a.size>0})}updateStroke(e){const{strokePath:t,yData:i,line:s}=this,n=t.path;if(n.clear(),i.length<2)return;const r=e.length;let o=!0;for(let l=0;l<r;l++){const{point:a,seriesDatum:h}=e[l],g=a.x,c=a.y;h.y==null?o=!0:o?(n.moveTo(g,c),o=!1):n.lineTo(g,c)}t.lineJoin=t.lineCap="round",t.fill=void 0,t.stroke=s.stroke,t.strokeWidth=s.strokeWidth}updateFill(e){const{fillPath:t,yData:i,fill:s}=this,n=t.path,r=e.length;if(n.clear(),!(i.length<2)){for(let o=0;o<r;o++){const{point:l}=e[o],a=l.x,h=l.y;o>0?n.lineTo(a,h):n.moveTo(a,h)}n.closePath(),t.lineJoin="round",t.stroke=void 0,t.fill=s}}updateXCrosshairLine(){const{yScale:e,xCrosshairLine:t,highlightedDatum:i,crosshairs:{xLine:s}}=this;if(!s.enabled||i==null){t.strokeWidth=0;return}t.y1=e.range[0],t.y2=e.range[1],t.x1=t.x2=0,t.stroke=s.stroke,t.strokeWidth=s.strokeWidth??1,t.lineCap=s.lineCap==="round"||s.lineCap==="square"?s.lineCap:void 0;const{lineDash:n}=s;t.lineDash=Array.isArray(n)?n:getLineDash(t.lineCap,s.lineDash),t.translationX=i.point.x}updateYCrosshairLine(){const{xScale:e,yCrosshairLine:t,highlightedDatum:i,crosshairs:{yLine:s}}=this;if(!s.enabled||i==null){t.strokeWidth=0;return}t.x1=e.range[0],t.x2=e.range[1],t.y1=t.y2=0,t.stroke=s.stroke,t.strokeWidth=s.strokeWidth??1,t.lineCap=s.lineCap==="round"||s.lineCap==="square"?s.lineCap:void 0;const{lineDash:n}=s;t.lineDash=Array.isArray(n)?n:getLineDash(t.lineCap,s.lineDash),t.translationY=i.point.y}getTooltipHtml(e){const{dataType:t}=this,{seriesDatum:i}=e,s=i.y,n=i.x,r=this.formatNumericDatum(s),o=t==="array"||t==="object"?this.formatDatum(n):void 0,l={content:r,title:o},a=this.processedOptions?.tooltip?.renderer;return a?toTooltipHtml(a({context:this.context,datum:i,yValue:s,xValue:n}),l):toTooltipHtml(l)}},import_ag_charts_community5=require("ag-charts-community"),import_ag_charts_community4=require("ag-charts-community"),Label=class{constructor(){this.enabled=!0,this.fontSize=8,this.fontFamily="Verdana, sans-serif",this.fontStyle=void 0,this.fontWeight=void 0,this.color="rgba(70, 70, 70, 1)"}},{extent:extent3}=import_ag_charts_community4._Util,BarColumnLabel=class extends Label{constructor(){super(...arguments),this.formatter=void 0,this.placement="insideEnd"}},BarColumnSparkline=class extends Sparkline{constructor(){super(),this.fill="rgb(124, 181, 236)",this.stroke="silver",this.strokeWidth=0,this.paddingInner=.1,this.paddingOuter=.2,this.valueAxisDomain=void 0,this.formatter=void 0,this.axisLine=new import_ag_charts_community4._Scene.Line,this.bandWidth=0,this.sparklineGroup=new import_ag_charts_community4._Scene.Group,this.rectGroup=new import_ag_charts_community4._Scene.Group,this.labelGroup=new import_ag_charts_community4._Scene.Group,this.rectSelection=import_ag_charts_community4._Scene.Selection.select(this.rectGroup,import_ag_charts_community4._Scene.Rect),this.labelSelection=import_ag_charts_community4._Scene.Selection.select(this.labelGroup,import_ag_charts_community4._Scene.Text),this.nodeSelectionData=[],this.label=new BarColumnLabel,this.rootGroup.append(this.sparklineGroup),this.rectGroup.zIndex=50,this.axisLine.zIndex=500,this.labelGroup.zIndex=1500,this.sparklineGroup.append([this.rectGroup,this.axisLine,this.labelGroup]),this.axisLine.lineCap="round",this.label.enabled=!1}getNodeData(){return this.nodeSelectionData}update(){this.updateSelections(),this.updateNodes()}updateSelections(){const e=this.generateNodeData();e&&(this.nodeSelectionData=e,this.updateRectSelection(e),this.updateLabelSelection(e))}updateNodes(){this.updateRectNodes(),this.updateLabelNodes()}calculateStep(e){const{xScale:t,paddingInner:i,paddingOuter:s,smallestInterval:n}=this,o=(t.domain[1]-t.domain[0])/(n?.x??1)+1,a=Math.min(o,50),h=a-1;return e/Math.max(1,2*s+h*i+a)}updateYScaleDomain(){const{yScale:e,yData:t,valueAxisDomain:i}=this,s=extent3(t);let n=0,r=1;s!==void 0&&(n=this.min=s[0],r=this.max=s[1]),n=n<0?n:0,r=r<0?0:r,i&&(i[1]<r&&(i[1]=r),i[0]>n&&(i[0]=n)),e.domain=i||[n,r]}updateRectSelection(e){this.rectSelection.update(e)}updateRectNodes(){const{highlightedDatum:e,formatter:t,fill:i,stroke:s,strokeWidth:n}=this,{fill:r,stroke:o,strokeWidth:l}=this.highlightStyle;this.rectSelection.each((a,h,g)=>{const c=h===e,f=c&&r!==void 0?r:i,y=c&&o!==void 0?o:s,d=c&&l!==void 0?l:n;let m;const{x:u,y:p,width:x,height:k,seriesDatum:b}=h;if(t){const S=g===0,_=g===this.nodeSelectionData.length-1,M=b.y===this.min,C=b.y===this.max;m=t({datum:h,xValue:b.x,yValue:b.y,width:x,height:k,min:M,max:C,first:S,last:_,fill:f,stroke:y,strokeWidth:d,highlighted:c})}a.fill=m&&m.fill||f,a.stroke=m&&m.stroke||y,a.strokeWidth=m&&m.strokeWidth||d,a.x=a.y=0,a.width=x,a.height=k,a.visible=a.height>0,a.translationX=u,a.translationY=p})}updateLabelSelection(e){this.labelSelection.update(e,t=>{t.tag=1,t.pointerEvents=import_ag_charts_community4._Scene.PointerEvents.None})}updateLabelNodes(){const{label:{enabled:e,fontStyle:t,fontWeight:i,fontSize:s,fontFamily:n,color:r}}=this;this.labelSelection.each((o,l)=>{const a=l.label;a&&e?(o.fontStyle=t,o.fontWeight=i,o.fontSize=s,o.fontFamily=n,o.textAlign=a.textAlign,o.textBaseline=a.textBaseline,o.text=a.text,o.x=a.x,o.y=a.y,o.fill=r,o.visible=!0):o.visible=!1})}getTooltipHtml(e){const{dataType:t}=this,{seriesDatum:i}=e,s=i.y,n=i.x,r=this.formatNumericDatum(s),o=t==="array"||t==="object"?this.formatDatum(n):void 0,l={content:r,title:o},a=this.processedOptions?.tooltip?.renderer;return a?toTooltipHtml(a({context:this.context,datum:i,yValue:s,xValue:n}),l):toTooltipHtml(l)}formatLabelValue(e){return e%1!==0?e.toFixed(1):e.toFixed(0)}},{isNumber:isNumber2}=import_ag_charts_community5._Util,{BandScale:BandScale3}=import_ag_charts_community5._Scale,BarSparkline=class extends BarColumnSparkline{updateYScaleRange(){const{seriesRect:e,yScale:t}=this;t.range=[0,e.width]}updateXScaleRange(){const{xScale:e,seriesRect:t,paddingOuter:i,paddingInner:s}=this;if(e instanceof BandScale3)e.range=[0,t.height],e.paddingInner=s,e.paddingOuter=i;else{const n=this.calculateStep(t.height),r=n*i;this.bandWidth=n*(1-s),e.range=[r,t.height-r-this.bandWidth]}}updateAxisLine(){const{yScale:e,axis:t,axisLine:i,seriesRect:s}=this,{strokeWidth:n}=t;i.x1=0,i.x2=0,i.y1=0,i.y2=s.height,i.stroke=t.stroke,i.strokeWidth=n+(n%2===1?1:0);const r=e.convert(0);i.translationX=r}generateNodeData(){const{data:e,yData:t,xData:i,xScale:s,yScale:n,fill:r,stroke:o,strokeWidth:l,label:a}=this;if(!e)return;const{fontStyle:h,fontWeight:g,fontSize:c,fontFamily:f,color:y,formatter:d,placement:m}=a,u=[],p=n.convert(0),x=!(s instanceof BandScale3);for(let k=0,b=t.length;k<b;k++){let S=t[k];const _=i[k],M=S===void 0;M&&(S=0);const C=s.convert(x?s.toDomain(_):_),W=Math.min(S===void 0?NaN:n.convert(S),p),A=Math.max(S===void 0?NaN:n.convert(S),p),O=x?this.bandWidth:s.bandwidth,z=A-W,F={x:p,y:C};let N;d?N=d({value:S}):N=S!==void 0&&isNumber2(S)?this.formatLabelValue(S):"";const R=C+O/2;let D;const I="middle";let w;const v=S!==void 0&&S>=0,L=4;if(m==="center")D=W+z/2,w="center";else if(m==="outsideEnd")D=W+(v?z+L:-L),w=v?"start":"end";else if(m==="insideEnd"){D=W+(v?z-L:L),w=v?"end":"start";const T=import_ag_charts_community5._Scene.Text.getTextSize(N,f).width||20,P=p+T,X=p-T;(v&&D<P||!v&&D>X)&&(D=p+L*(v?1:-1),w=v?"start":"end")}else D=p+L*(v?1:-1),w=v?"start":"end";u.push({x:W,y:C,width:z,height:O,fill:r,stroke:o,strokeWidth:l,seriesDatum:{x:_,y:M?void 0:S},point:F,label:{x:D,y:R,text:N,fontStyle:h,fontWeight:g,fontSize:c,fontFamily:f,textAlign:w,textBaseline:I,fill:y}})}return u}getDistance(e,t){return Math.abs(e.y-t.y)}},import_ag_charts_community6=require("ag-charts-community"),{isNumber:isNumber3}=import_ag_charts_community6._Util,{BandScale:BandScale4}=import_ag_charts_community6._Scale,ColumnSparkline=class extends BarColumnSparkline{updateYScaleRange(){const{seriesRect:e,yScale:t}=this;t.range=[e.height,0]}updateXScaleRange(){const{xScale:e,seriesRect:t,paddingOuter:i,paddingInner:s}=this;if(e instanceof BandScale4)e.range=[0,t.width],e.paddingInner=s,e.paddingOuter=i;else{const n=this.calculateStep(t.width),r=n*i;this.bandWidth=n*(1-s),e.range=[r,t.width-r-this.bandWidth]}}updateAxisLine(){const{yScale:e,axis:t,axisLine:i,seriesRect:s}=this,{strokeWidth:n}=t;i.x1=0,i.x2=s.width,i.y1=0,i.y2=0,i.stroke=t.stroke,i.strokeWidth=n+(n%2===1?1:0);const r=e.convert(0);i.translationY=r}generateNodeData(){const{data:e,yData:t,xData:i,xScale:s,yScale:n,fill:r,stroke:o,strokeWidth:l,label:a}=this;if(!e)return;const{fontStyle:h,fontWeight:g,fontSize:c,fontFamily:f,color:y,formatter:d,placement:m}=a,u=[],p=n.convert(0),x=!(s instanceof BandScale4);for(let k=0,b=t.length;k<b;k++){let S=t[k];const _=i[k],M=S===void 0;M&&(S=0);const C=Math.min(S===void 0?NaN:n.convert(S),p),W=s.convert(x?s.toDomain(_):_),A=Math.max(S===void 0?NaN:n.convert(S),p),O=x?this.bandWidth:s.bandwidth,z=A-C,F={x:W+O/2,y:p};let N;d?N=d({value:S}):N=S!==void 0&&isNumber3(S)?this.formatLabelValue(S):"";const R=W+O/2;let D;const I="center";let w;const v=S!==void 0&&S>=0,L=2;if(m==="center")D=C+z/2,w="middle";else if(m==="outsideEnd")D=C+(v?-L:z+L),w=v?"bottom":"top";else if(m==="insideEnd"){D=C+(v?L:z-L),w=v?"top":"bottom";const T=import_ag_charts_community6._Scene.Text.getTextSize(N,f).height||10,P=p-T,X=p+T;(v&&D>P||!v&&D<X)&&(D=p+L*(v?-1:1),w=v?"bottom":"top")}else D=p+L*(v?-1:1),w=v?"bottom":"top";u.push({x:W,y:C,width:O,height:z,fill:r,stroke:o,strokeWidth:l,seriesDatum:{x:_,y:M?void 0:S},point:F,label:{x:R,y:D,text:N,fontStyle:h,fontWeight:g,fontSize:c,fontFamily:f,textAlign:I,textBaseline:w,fill:y}})}return u}},import_ag_charts_community7=require("ag-charts-community"),{extent:extent4}=import_ag_charts_community7._Util,{BandScale:BandScale5}=import_ag_charts_community7._Scale,SparklineMarker2=class{constructor(){this.enabled=!0,this.shape="circle",this.size=0,this.fill="rgb(124, 181, 236)",this.stroke="rgb(124, 181, 236)",this.strokeWidth=1,this.formatter=void 0}},SparklineLine2=class{constructor(){this.stroke="rgb(124, 181, 236)",this.strokeWidth=1}},SparklineCrosshairs2=class{constructor(){this.xLine={enabled:!0,stroke:"rgba(0,0,0, 0.54)",strokeWidth:1,lineDash:"solid",lineCap:void 0},this.yLine={enabled:!1,stroke:"rgba(0,0,0, 0.54)",strokeWidth:1,lineDash:"solid",lineCap:void 0}}},LineSparkline=class extends Sparkline{constructor(){super(),this.linePath=new import_ag_charts_community7._Scene.Path,this.xCrosshairLine=new import_ag_charts_community7._Scene.Line,this.yCrosshairLine=new import_ag_charts_community7._Scene.Line,this.lineSparklineGroup=new import_ag_charts_community7._Scene.Group,this.markers=new import_ag_charts_community7._Scene.Group,this.markerSelection=import_ag_charts_community7._Scene.Selection.select(this.markers,()=>this.markerFactory()),this.markerSelectionData=[],this.marker=new SparklineMarker2,this.line=new SparklineLine2,this.crosshairs=new SparklineCrosshairs2,this.rootGroup.append(this.lineSparklineGroup),this.linePath.zIndex=1e3,this.xCrosshairLine.zIndex=2e3,this.yCrosshairLine.zIndex=2e3,this.markers.zIndex=2500,this.lineSparklineGroup.append([this.linePath,this.xCrosshairLine,this.yCrosshairLine,this.markers])}getNodeData(){return this.markerSelectionData}markerFactory(){const{shape:e}=this.marker,t=getMarker(e);return new t}onMarkerShapeChange(){this.markerSelection=this.markerSelection.clear(),this.scheduleLayout()}update(){const e=this.generateNodeData();e&&(this.markerSelectionData=e,this.updateSelection(e),this.updateNodes(),this.updateLine())}updateYScaleDomain(){const{yData:e,yScale:t}=this,i=extent4(e);let s=0,n=1;if(i!==void 0&&(s=this.min=i[0],n=this.max=i[1]),s===n){const r=Math.abs(s*.01);s-=r,n+=r}t.domain=[s,n]}generateNodeData(){const{data:e,yData:t,xData:i,xScale:s,yScale:n}=this;if(!e)return;const r=!(s instanceof BandScale5),o=r?0:s.bandwidth/2,l=[];for(let a=0;a<t.length;a++){const h=t[a],g=i[a];if(h==null)continue;const c=s.convert(r?s.toDomain(g):g)+o,f=h===void 0?NaN:n.convert(h);l.push({seriesDatum:{x:g,y:h},point:{x:c,y:f}})}return l}updateSelection(e){this.markerSelection.update(e)}updateNodes(){const{highlightedDatum:e,highlightStyle:t,marker:i}=this,{size:s,fill:n,stroke:r,strokeWidth:o}=t,l=i.formatter;this.markerSelection.each((a,h,g)=>{const c=h===e,f=c&&n!==void 0?n:i.fill,y=c&&r!==void 0?r:i.stroke,d=c&&o!==void 0?o:i.strokeWidth,m=c&&s!==void 0?s:i.size;let u;const{seriesDatum:p,point:x}=h;if(l){const k=g===0,b=g===this.markerSelectionData.length-1,S=p.y===this.min,_=p.y===this.max;u=l({datum:h,xValue:p.x,yValue:p.y,min:S,max:_,first:k,last:b,fill:f,stroke:y,strokeWidth:d,size:m,highlighted:c})}a.size=u&&u.size!=null?u.size:m,a.fill=u&&u.fill!=null?u.fill:f,a.stroke=u&&u.stroke!=null?u.stroke:y,a.strokeWidth=u&&u.strokeWidth!=null?u.strokeWidth:d,a.translationX=x.x,a.translationY=x.y,a.visible=u&&u.enabled!=null?u.enabled:i.enabled&&a.size>0})}updateLine(){const{linePath:e,yData:t,xData:i,xScale:s,yScale:n,line:r}=this,o=e.path;if(o.clear(),t.length<2)return;const l=!(s instanceof BandScale5),a=t.length,h=l?0:s.bandwidth/2;let g=!0;for(let c=0;c<a;c++){const f=i[c],y=t[c],d=s.convert(l?s.toDomain(f):f)+h,m=y===void 0?NaN:n.convert(y);y==null?g=!0:g?(o.moveTo(d,m),g=!1):o.lineTo(d,m)}e.fill=void 0,e.stroke=r.stroke,e.strokeWidth=r.strokeWidth}updateXCrosshairLine(){const{yScale:e,xCrosshairLine:t,highlightedDatum:i,crosshairs:{xLine:s}}=this;if(!s.enabled||i==null){t.strokeWidth=0;return}t.y1=e.range[0],t.y2=e.range[1],t.x1=t.x2=0,t.stroke=s.stroke,t.strokeWidth=s.strokeWidth??1,t.lineCap=s.lineCap==="round"||s.lineCap==="square"?s.lineCap:void 0;const{lineDash:n}=s;t.lineDash=Array.isArray(n)?n:getLineDash(t.lineCap,s.lineDash),t.translationX=i.point.x}updateYCrosshairLine(){const{xScale:e,yCrosshairLine:t,highlightedDatum:i,crosshairs:{yLine:s}}=this;if(!s.enabled||i==null){t.strokeWidth=0;return}t.x1=e.range[0],t.x2=e.range[1],t.y1=t.y2=0,t.stroke=s.stroke,t.strokeWidth=s.strokeWidth??1,t.lineCap=s.lineCap==="round"||s.lineCap==="square"?s.lineCap:void 0;const{lineDash:n}=s;t.lineDash=Array.isArray(n)?n:getLineDash(t.lineCap,s.lineDash),t.translationY=i.point.y}getTooltipHtml(e){const{dataType:t}=this,{seriesDatum:i}=e,s=i.y,n=i.x,r=this.formatNumericDatum(s),o=t==="array"||t==="object"?this.formatDatum(n):void 0,l={content:r,title:o},a=this.processedOptions?.tooltip?.renderer;return a?toTooltipHtml(a({context:this.context,datum:i,yValue:s,xValue:n}),l):toTooltipHtml(l)}},{isNumber:isNumber4}=import_ag_charts_community8._Util,AgSparkline=class{static create(e,t){e=import_ag_charts_community8._Util.deepClone(e);const i=getSparklineInstance(e.type);return t&&(i.tooltip=t),initSparkline(i,e),initSparklineByType(i,e),e.data&&(i.data=e.data),i.processedOptions=e,i}};function getSparklineInstance(e="line"){switch(e){case"column":return new ColumnSparkline;case"bar":return new BarSparkline;case"area":return new AreaSparkline;case"line":default:return new LineSparkline}}function initSparklineByType(e,t){switch(t.type){case"bar":initBarColumnSparkline(e,t);break;case"column":initBarColumnSparkline(e,t);break;case"area":initAreaSparkline(e,t);break;case"line":default:initLineSparkline(e,t);break}}function initSparkline(e,t){setValueIfPropertyExists(e,"context",t.context,t),setValueIfPropertyExists(e,"width",t.width,t),setValueIfPropertyExists(e,"height",t.height,t),setValueIfPropertyExists(e,"container",t.container,t),setValueIfPropertyExists(e,"xKey",t.xKey,t),setValueIfPropertyExists(e,"yKey",t.yKey,t),t.padding&&initPaddingOptions(e.padding,t.padding),t.axis&&initAxisOptions(e.axis,t.axis),t.highlightStyle&&initHighlightStyleOptions(e.highlightStyle,t.highlightStyle)}function initLineSparkline(e,t){t.marker&&initMarkerOptions(e.marker,t.marker),t.line&&initLineOptions(e.line,t.line),t.crosshairs&&initCrosshairsOptions(e.crosshairs,t.crosshairs)}function initAreaSparkline(e,t){setValueIfPropertyExists(e,"fill",t.fill,t),t.marker&&initMarkerOptions(e.marker,t.marker),t.line&&initLineOptions(e.line,t.line),t.crosshairs&&initCrosshairsOptions(e.crosshairs,t.crosshairs)}function initBarColumnSparkline(e,t){setValueIfPropertyExists(e,"valueAxisDomain",t.valueAxisDomain,t),setValueIfPropertyExists(e,"fill",t.fill,t),setValueIfPropertyExists(e,"stroke",t.stroke,t),setValueIfPropertyExists(e,"strokeWidth",t.strokeWidth,t),setValueIfPropertyExists(e,"paddingInner",t.paddingInner,t),setValueIfPropertyExists(e,"paddingOuter",t.paddingOuter,t),setValueIfPropertyExists(e,"formatter",t.formatter,t),t.label&&initLabelOptions(e.label,t.label)}function initPaddingOptions(e,t){setValueIfPropertyExists(e,"top",t.top,t),setValueIfPropertyExists(e,"right",t.right,t),setValueIfPropertyExists(e,"bottom",t.bottom,t),setValueIfPropertyExists(e,"left",t.left,t)}function initMarkerOptions(e,t){setValueIfPropertyExists(e,"enabled",t.enabled,t),setValueIfPropertyExists(e,"size",t.size,t),setValueIfPropertyExists(e,"shape",t.shape,t),setValueIfPropertyExists(e,"fill",t.fill,t),setValueIfPropertyExists(e,"stroke",t.stroke,t),setValueIfPropertyExists(e,"strokeWidth",t.strokeWidth,t),setValueIfPropertyExists(e,"formatter",t.formatter,t)}function initLabelOptions(e,t){setValueIfPropertyExists(e,"enabled",t.enabled,t),setValueIfPropertyExists(e,"fontStyle",t.fontStyle,t),setValueIfPropertyExists(e,"fontWeight",t.fontWeight,t),setValueIfPropertyExists(e,"fontSize",t.fontSize,t),setValueIfPropertyExists(e,"fontFamily",t.fontFamily,t),setValueIfPropertyExists(e,"textAlign",t.textAlign,t),setValueIfPropertyExists(e,"textBaseline",t.textBaseline,t),setValueIfPropertyExists(e,"color",t.color,t),setValueIfPropertyExists(e,"formatter",t.formatter,t),setValueIfPropertyExists(e,"placement",t.placement,t)}function initLineOptions(e,t){setValueIfPropertyExists(e,"stroke",t.stroke,t),setValueIfPropertyExists(e,"strokeWidth",t.strokeWidth,t)}function initAxisOptions(e,t){setValueIfPropertyExists(e,"type",t.type,t),setValueIfPropertyExists(e,"stroke",t.stroke,t),setValueIfPropertyExists(e,"strokeWidth",t.strokeWidth,t)}function initHighlightStyleOptions(e,t){setValueIfPropertyExists(e,"fill",t.fill,t),setValueIfPropertyExists(e,"size",t.size,t),setValueIfPropertyExists(e,"stroke",t.stroke,t),setValueIfPropertyExists(e,"strokeWidth",t.strokeWidth,t)}function initCrosshairsOptions(e,t){e.xLine&&t.xLine&&initCrosshairLineOptions(e.xLine,t.xLine),e.yLine&&t.yLine&&initCrosshairLineOptions(e.yLine,t.yLine)}function initCrosshairLineOptions(e,t){setValueIfPropertyExists(e,"enabled",t.enabled,t),setValueIfPropertyExists(e,"stroke",t.stroke,t),setValueIfPropertyExists(e,"strokeWidth",t.strokeWidth,t),setValueIfPropertyExists(e,"lineDash",t.lineDash,t),setValueIfPropertyExists(e,"lineCap",t.lineCap,t)}var offsetValidator=(e,t,i)=>isNumber4(t)?!0:((0,import_core3._warnOnce)(`${e} must be a number, the value you provided is not a valid number. Using the default of ${i}px.`),!1),validators={xOffset:offsetValidator,yOffset:offsetValidator};function setValueIfPropertyExists(e,t,i,s){if(t in s)if(t in e){const n=validators[t];(n?n(t,i,e[t]):!0)&&e[t]!==i&&(e[t]=i)}else(0,import_core3._warnOnce)(`Property ${t} does not exist on the target object.`)}var SparklineCellRenderer=class extends import_core4.Component{constructor(){super(`<div class="ag-sparkline-wrapper"> | ||
<span data-ref="eSparkline"></span> | ||
</div>`),this.eSparkline=import_core4.RefPlaceholder}wireBeans(e){this.resizeObserverService=e.resizeObserverService,this.sparklineTooltipSingleton=e.sparklineTooltipSingleton}init(e){let t=!0;const i=()=>{const{clientWidth:n,clientHeight:r}=this.getGui();if(!(n===0||r===0))if(t){const o={data:e.value,width:n,height:r,context:{data:e.data},...e.sparklineOptions};this.sparkline=AgSparkline.create(o,this.sparklineTooltipSingleton.getSparklineTooltip()),this.eSparkline.appendChild(this.sparkline.canvasElement),t=!1}else this.sparkline.width=n,this.sparkline.height=r},s=this.resizeObserverService.observeResize(this.getGui(),i);this.addDestroyFunc(()=>s())}refresh(e){return this.sparkline?(this.sparkline.data=e.value,!0):!1}destroy(){this.sparkline&&this.sparkline.destroy(),super.destroy()}},import_core5=require("@ag-grid-community/core"),SparklineTooltipSingleton=class extends import_core5.BeanStub{constructor(){super(...arguments),this.beanName="sparklineTooltipSingleton"}postConstruct(){this.tooltip=new SparklineTooltip}getSparklineTooltip(){return this.tooltip}destroy(){this.tooltip&&this.tooltip.destroy(),super.destroy()}},VERSION="32.0.0",SparklinesModule={version:VERSION,moduleName:import_core6.ModuleNames.SparklinesModule,beans:[SparklineTooltipSingleton],userComponents:[{name:"agSparklineCellRenderer",classImp:SparklineCellRenderer}],dependantModules:[import_core7.EnterpriseCoreModule]}; |
{ | ||
"name": "@ag-grid-enterprise/sparklines", | ||
"version": "31.3.2", | ||
"version": "32.0.0", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue", | ||
@@ -14,9 +14,11 @@ "main": "./dist/package/main.cjs.js", | ||
}, | ||
"sideEffects": false, | ||
"dependencies": { | ||
"@ag-grid-community/core": "31.3.2", | ||
"@ag-grid-enterprise/core": "31.3.2", | ||
"ag-charts-community": "9.3.1" | ||
"@ag-grid-community/core": "32.0.0", | ||
"@ag-grid-enterprise/core": "32.0.0", | ||
"ag-charts-community": "10.0.0" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^29.5.0", | ||
"canvas": "^2.10.2", | ||
"jest": "^29.5.0", | ||
@@ -23,0 +25,0 @@ "jest-canvas-mock": "2.5.1", |
{ | ||
"name": "@ag-grid-enterprise/sparklines", | ||
"version": "31.3.2", | ||
"version": "32.0.0", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue", | ||
@@ -14,9 +14,11 @@ "main": "./src/main.js", | ||
}, | ||
"sideEffects": false, | ||
"dependencies": { | ||
"@ag-grid-community/core": "31.3.2", | ||
"@ag-grid-enterprise/core": "31.3.2", | ||
"ag-charts-community": "9.3.1" | ||
"@ag-grid-community/core": "32.0.0", | ||
"@ag-grid-enterprise/core": "32.0.0", | ||
"ag-charts-community": "10.0.0" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^29.5.0", | ||
"canvas": "^2.10.2", | ||
"jest": "^29.5.0", | ||
@@ -23,0 +25,0 @@ "jest-canvas-mock": "2.5.1", |
@@ -1,3 +0,3 @@ | ||
import { SparklineOptions } from '@ag-grid-community/core'; | ||
import { SparklineTooltip } from './tooltip/sparklineTooltip'; | ||
import type { SparklineOptions } from '@ag-grid-community/core'; | ||
import type { SparklineTooltip } from './tooltip/sparklineTooltip'; | ||
export type SparklineFactoryOptions = SparklineOptions & { | ||
@@ -4,0 +4,0 @@ data: any[]; |
@@ -1,4 +0,5 @@ | ||
import { MarkerFormat, MarkerFormatterParams, CrosshairLineOptions } from '@ag-grid-community/core'; | ||
import type { CrosshairLineOptions, MarkerFormat, MarkerFormatterParams } from '@ag-grid-community/core'; | ||
import { _Scene } from 'ag-charts-community'; | ||
import { Point, SeriesNodeDatum, Sparkline } from '../sparkline'; | ||
import type { Point, SeriesNodeDatum } from '../sparkline'; | ||
import { Sparkline } from '../sparkline'; | ||
interface AreaNodeDatum extends SeriesNodeDatum { | ||
@@ -27,3 +28,2 @@ } | ||
export declare class AreaSparkline extends Sparkline { | ||
static className: string; | ||
fill: string; | ||
@@ -30,0 +30,0 @@ protected strokePath: _Scene.Path; |
@@ -1,5 +0,7 @@ | ||
import { ColumnFormat, ColumnFormatterParams } from '@ag-grid-community/core'; | ||
import { FontStyle, FontWeight, _Scene } from 'ag-charts-community'; | ||
import { SeriesNodeDatum, Sparkline } from '../sparkline'; | ||
import type { ColumnFormat, ColumnFormatterParams } from '@ag-grid-community/core'; | ||
import type { FontStyle, FontWeight } from 'ag-charts-community'; | ||
import { _Scene } from 'ag-charts-community'; | ||
import { Label } from '../label/label'; | ||
import type { SeriesNodeDatum } from '../sparkline'; | ||
import { Sparkline } from '../sparkline'; | ||
export interface RectNodeDatum extends SeriesNodeDatum { | ||
@@ -6,0 +8,0 @@ readonly x: number; |
@@ -1,7 +0,7 @@ | ||
import { BarColumnSparkline, RectNodeDatum } from './barColumnSparkline'; | ||
import { Point } from '../sparkline'; | ||
import type { Point } from '../sparkline'; | ||
import type { RectNodeDatum } from './barColumnSparkline'; | ||
import { BarColumnSparkline } from './barColumnSparkline'; | ||
interface BarNodeDatum extends RectNodeDatum { | ||
} | ||
export declare class BarSparkline extends BarColumnSparkline { | ||
static className: string; | ||
protected updateYScaleRange(): void; | ||
@@ -8,0 +8,0 @@ protected updateXScaleRange(): void; |
@@ -1,6 +0,6 @@ | ||
import { BarColumnSparkline, RectNodeDatum } from './barColumnSparkline'; | ||
import type { RectNodeDatum } from './barColumnSparkline'; | ||
import { BarColumnSparkline } from './barColumnSparkline'; | ||
interface ColumnNodeDatum extends RectNodeDatum { | ||
} | ||
export declare class ColumnSparkline extends BarColumnSparkline { | ||
static className: string; | ||
protected updateYScaleRange(): void; | ||
@@ -7,0 +7,0 @@ protected updateXScaleRange(): void; |
@@ -1,2 +0,2 @@ | ||
import { FontStyle, FontWeight } from 'ag-charts-community'; | ||
import type { FontStyle, FontWeight } from 'ag-charts-community'; | ||
export declare class Label { | ||
@@ -3,0 +3,0 @@ enabled: boolean; |
@@ -1,4 +0,5 @@ | ||
import { MarkerFormat, MarkerFormatterParams, CrosshairLineOptions } from '@ag-grid-community/core'; | ||
import type { CrosshairLineOptions, MarkerFormat, MarkerFormatterParams } from '@ag-grid-community/core'; | ||
import { _Scene } from 'ag-charts-community'; | ||
import { Point, SeriesNodeDatum, Sparkline } from '../sparkline'; | ||
import type { Point, SeriesNodeDatum } from '../sparkline'; | ||
import { Sparkline } from '../sparkline'; | ||
interface LineNodeDatum extends SeriesNodeDatum { | ||
@@ -25,3 +26,2 @@ readonly point: Point; | ||
export declare class LineSparkline extends Sparkline { | ||
static className: string; | ||
protected linePath: _Scene.Path; | ||
@@ -28,0 +28,0 @@ protected xCrosshairLine: _Scene.Line; |
@@ -1,5 +0,5 @@ | ||
import { HighlightStyleOptions } from '@ag-grid-community/core'; | ||
import type { HighlightStyleOptions } from '@ag-grid-community/core'; | ||
import { _Scale, _Scene, _Util } from 'ag-charts-community'; | ||
import { SparklineFactoryOptions } from './agSparkline'; | ||
import { SparklineTooltip } from './tooltip/sparklineTooltip'; | ||
import type { SparklineFactoryOptions } from './agSparkline'; | ||
import type { SparklineTooltip } from './tooltip/sparklineTooltip'; | ||
/** | ||
@@ -125,2 +125,3 @@ * Constants to declare the expected nominal zIndex for nodes in a sparkline rendering. | ||
private onMouseMove; | ||
private renderScene; | ||
private updateHitPoint; | ||
@@ -127,0 +128,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { TooltipRendererResult } from '@ag-grid-community/core'; | ||
import type { TooltipRendererResult } from '@ag-grid-community/core'; | ||
export interface SparklineTooltipMeta { | ||
@@ -14,3 +14,2 @@ pageX: number; | ||
element: HTMLElement; | ||
static class: string; | ||
constructor(); | ||
@@ -17,0 +16,0 @@ isVisible(): boolean; |
@@ -1,7 +0,8 @@ | ||
import { Component, ICellRenderer, ISparklineCellRendererParams } from '@ag-grid-community/core'; | ||
import type { BeanCollection, ICellRenderer, ISparklineCellRendererParams } from '@ag-grid-community/core'; | ||
import { Component } from '@ag-grid-community/core'; | ||
export declare class SparklineCellRenderer extends Component implements ICellRenderer { | ||
private static TEMPLATE; | ||
private eSparkline; | ||
private resizeObserverService; | ||
private sparklineTooltipSingleton; | ||
wireBeans(beans: BeanCollection): void; | ||
private readonly eSparkline; | ||
private sparkline?; | ||
@@ -8,0 +9,0 @@ constructor(); |
@@ -1,2 +0,2 @@ | ||
import { Module } from '@ag-grid-community/core'; | ||
import type { Module } from '@ag-grid-community/core'; | ||
export declare const SparklinesModule: Module; |
@@ -0,1 +1,2 @@ | ||
import type { NamedBean } from '@ag-grid-community/core'; | ||
import { BeanStub } from '@ag-grid-community/core'; | ||
@@ -6,7 +7,8 @@ import { SparklineTooltip } from '../sparkline/tooltip/sparklineTooltip'; | ||
*/ | ||
export declare class SparklineTooltipSingleton extends BeanStub { | ||
export declare class SparklineTooltipSingleton extends BeanStub implements NamedBean { | ||
beanName: "sparklineTooltipSingleton"; | ||
private tooltip; | ||
private postConstruct; | ||
postConstruct(): void; | ||
getSparklineTooltip(): SparklineTooltip; | ||
private destroyTooltip; | ||
destroy(): void; | ||
} |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "31.3.2"; | ||
export declare const VERSION = "32.0.0"; |
const gulp = require('gulp'); | ||
const {series} = gulp; | ||
const { series } = gulp; | ||
const replace = require('gulp-replace'); | ||
const rename = require('gulp-rename'); | ||
const del = require("del"); | ||
const del = require('del'); | ||
@@ -12,10 +12,12 @@ const DIST_FOLDER = 'dist/esm/es6/'; | ||
.src(['dist/esm/es6/**/*.js', '!dist/esm/es6/**/*.map']) | ||
.pipe(replace(/(import|export)(.*['"]\..*)(['"].*)/gi, (line) => { | ||
const regexp = /(import|export)(.*['"]\..*)(['"].*)/gi; | ||
const matches = [...line.matchAll(regexp)][0]; | ||
return `${matches[1]}${matches[2]}.mjs${matches[3]}` | ||
})) | ||
.pipe( | ||
replace(/(import|export)(.*['"]\..*)(['"].*)/gi, (line) => { | ||
const regexp = /(import|export)(.*['"]\..*)(['"].*)/gi; | ||
const matches = [...line.matchAll(regexp)][0]; | ||
return `${matches[1]}${matches[2]}.mjs${matches[3]}`; | ||
}) | ||
) | ||
.pipe(rename({ extname: '.mjs' })) | ||
.pipe(gulp.dest(DIST_FOLDER)); | ||
} | ||
}; | ||
@@ -25,3 +27,1 @@ const cleanup = () => del([`${DIST_FOLDER}/**/*.js`]); | ||
gulp.task('mjs-processing', series(mjsProcessing, cleanup)); | ||
{ | ||
"name": "@ag-grid-enterprise/sparklines", | ||
"version": "31.3.2", | ||
"version": "32.0.0", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue", | ||
@@ -14,9 +14,11 @@ "main": "./dist/package/main.cjs.js", | ||
}, | ||
"sideEffects": false, | ||
"dependencies": { | ||
"@ag-grid-community/core": "31.3.2", | ||
"@ag-grid-enterprise/core": "31.3.2", | ||
"ag-charts-community": "9.3.1" | ||
"@ag-grid-community/core": "32.0.0", | ||
"@ag-grid-enterprise/core": "32.0.0", | ||
"ag-charts-community": "10.0.0" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^29.5.0", | ||
"canvas": "^2.10.2", | ||
"jest": "^29.5.0", | ||
@@ -23,0 +25,0 @@ "jest-canvas-mock": "2.5.1", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
364887
29
5
5186
+ Added@ag-grid-community/core@32.0.0(transitive)
+ Added@ag-grid-enterprise/core@32.0.0(transitive)
+ Addedag-charts-community@10.0.0(transitive)
+ Addedag-charts-locale@10.0.0(transitive)
+ Addedag-charts-types@10.0.0(transitive)
- Removed@ag-grid-community/core@31.3.2(transitive)
- Removed@ag-grid-enterprise/core@31.3.2(transitive)
- Removedag-charts-community@9.3.1(transitive)
Updatedag-charts-community@10.0.0