Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ag-grid-enterprise/sparklines

Package Overview
Dependencies
Maintainers
0
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ag-grid-enterprise/sparklines - npm Package Compare versions

Comparing version 32.1.0 to 32.2.0

8

dist/package/main.cjs.min.js

@@ -1,2 +0,2 @@

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=`
var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(t,e)=>{for(var s in e)__defProp(t,s,{get:e[s],enumerable:!0})},__copyProps=(t,e,s,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of __getOwnPropNames(e))!__hasOwnProp.call(t,n)&&n!==s&&__defProp(t,n,{get:()=>e[n],enumerable:!(i=__getOwnPropDesc(e,n))||i.enumerable});return t},__toCommonJS=t=>__copyProps(__defProp({},"__esModule",{value:!0}),t),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(t,e="solid"){const s={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]},i={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 t==="round"||t==="square"?i[e]==null?(warnInvalid(e),i.solid):i[e]:s[e]==null?(warnInvalid(e),s.solid):s[e]}function warnInvalid(t){(0,import_core._warnOnce)(`'${t}' is not a valid 'lineDash' option.`)}var import_ag_charts_community=require("ag-charts-community");function getMarker(t){switch(t){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_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}">
`,{extent,isNumber,isString,isStringObject,isDate,createId,Padding}=import_ag_charts_community2._Util,{LinearScale,BandScale,TimeScale}=import_ag_charts_community2._Scale,{Transformable}=import_ag_charts_community2._Scene,SparklineAxis=class{constructor(){this.type="category",this.stroke="rgb(204, 214, 235)",this.strokeWidth=1}},_Sparkline=class X{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 e=new import_ag_charts_community2._Scene.TranslatableGroup;this.rootGroup=e;const s=document.createElement("div");s.setAttribute("class","ag-sparkline-wrapper");const i=new import_ag_charts_community2._Scene.Scene({});this.scene=i,this.canvasElement=i.canvas.element,i.setRoot(e),i.setContainer(s),this.resizeAndSetDimensions(this.width,this.height),X.tooltipDocuments.includes(document)||this.initialiseTooltipStyles(),this.setupDomEventListeners(this.canvasElement)}set context(e){this._context!==e&&(this._context=e)}get context(){return this._context}set container(e){if(this._container!==e){const{parentNode:s}=this.canvasElement;s?.removeChild(this.canvasElement),e&&e.appendChild(this.canvasElement),this._container=e}}get container(){return this._container}set data(e){this._data!==e&&(this._data=e,this.processData(),this.mouseMoveEvent&&this.highlightedDatum&&this.updateHitPoint(this.mouseMoveEvent))}get data(){return this._data}resizeAndSetDimensions(e,s){this.scene.resize(e,s),this.seriesRect.width=e,this.seriesRect.height=s}initialiseTooltipStyles(){const e=document.createElement("style");e.innerHTML=defaultTooltipCss,document.head.insertBefore(e,document.head.querySelector("style")),X.tooltipDocuments.push(document)}set width(e){this._width!==e&&(this._width=e,this.scene.resize(e,this.height),this.scheduleLayout())}get width(){return this._width}set height(e){this._height!==e&&(this._height=e,this.scene.resize(this.width,e),this.scheduleLayout())}get height(){return this._height}update(){}updateYScale(){this.updateYScaleRange(),this.updateYScaleDomain()}updateYScaleDomain(){}updateYScaleRange(){const{yScale:e,seriesRect:s}=this;e.range=[s.height,0]}updateXScale(){const{type:e}=this.axis;this.xScale=this.getXScale(e),this.updateXScaleRange(),this.updateXScaleDomain()}updateXScaleRange(){this.xScale.range=[0,this.seriesRect.width]}updateXScaleDomain(){const{xData:e,xScale:s}=this;let i;(s instanceof LinearScale||s instanceof TimeScale)&&(i=extent(e)),this.xScale.domain=i?i.slice():e}getXScale(e="category"){switch(e){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(e){this.updateNodes()}dehighlightDatum(){this.highlightedDatum=void 0,this.updateNodes(),this.updateCrosshairs()}onMouseMove(e){this.mouseMoveEvent=e,this.updateHitPoint(e)}renderScene(){this.scene.render().catch(e=>(0,import_core2._errorOnce)("chart rendering failed",e))}updateHitPoint(e){const s=this.pickClosestSeriesNodeDatum(e.offsetX,e.offsetY);if(!s)return;const i=this.highlightedDatum;this.highlightedDatum=s,(this.highlightedDatum&&!i||this.highlightedDatum&&i&&this.highlightedDatum!==i)&&(this.highlightDatum(s),this.updateCrosshairs(),this.renderScene()),(this.processedOptions?.tooltip?.enabled??!0)&&this.handleTooltip(e,s)}onMouseOut(e){this.dehighlightDatum(),this.tooltip.toggle(!1),this.renderScene()}processData(){const{data:e,yData:s,xData:i}=this;if(!e||this.invalidData(this.data))return;s.length=0,i.length=0;const n=e.length,r=this.getDataType(e);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=e[c],d=this.getDatum(f,l),m=this.getDatum(y,"number");a&&h(d,g),i.push(d),s.push(m),g=d}else if(r==="array")for(let c=0;c<n;c++){const f=e[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),i.push(m),s.push(u),g=m}}else if(r==="object"){const{yKey:c,xKey:f}=this;for(let y=0;y<n;y++){const d=e[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),i.push(p),s.push(x),g=p}}}this.updateAxes(),this.immediateLayout()}getDataType(e){for(const s of e)if(s!=null){if(isNumber(s))return"number";if(Array.isArray(s))return"array";if(typeof s=="object")return"object"}}getDatum(e,s){if(s==="number"&&isNumber(e)||s==="time"&&(isNumber(e)||isDate(e)))return e;if(s==="category"){if(isString(e)||isDate(e)||isNumber(e))return{toString:()=>String(e)};if(isStringObject(e))return e}}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:e,height:s,padding:i,seriesRect:n,rootGroup:r}=this,o=e-i.left-i.right,l=s-i.top-i.bottom;n.width=o,n.height=l,n.x=i.left,n.y=i.top,r.translationX=n.x,r.translationY=n.y}pickClosestSeriesNodeDatum(e,s){let i=1/0,n;const r=Transformable.fromCanvasPoint(this.rootGroup,e,s),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<=i&&(i=h,n=a)}return n}getDistance(e,s){return Math.abs(e.x-s.x)}handleTooltip(e,s){const{seriesDatum:i}=s,{canvasElement:n}=this,{clientX:r,clientY:o}=e,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=i.y,g=i.x;let c=l?.enabled??!0;const f=l?.renderer;if(f){const d=f({context:this.context,datum:i,yValue:h,xValue:g});c=typeof d!="string"&&d.enabled!==void 0?d.enabled:c}const y=c&&i.y!==void 0&&this.getTooltipHtml(s);y&&this.tooltip.show(a,y)}formatNumericDatum(e){return String(Math.round(e*10)/10)}formatDatum(e){const s=this.axis.type||"category";return s==="number"&&typeof e=="number"?this.formatNumericDatum(e):s==="time"&&(e instanceof Date||isNumber(e))?this.defaultDateFormatter.format(e):String(e)}setupDomEventListeners(e){e.addEventListener("mousemove",this._onMouseMove),e.addEventListener("mouseout",this._onMouseOut)}cleanupDomEventListeners(e){e.removeEventListener("mousemove",this._onMouseMove),e.removeEventListener("mouseout",this._onMouseOut)}invalidData(e){return!e||!Array.isArray(e)}destroy(){this.cleanupDomEventListeners(this.canvasElement),this.scene.destroy(),this.container=void 0}};_Sparkline.tooltipDocuments=[];var Sparkline=_Sparkline;function toTooltipHtml(t,e){if(typeof t=="string")return t;e=e??{};const{content:s=e.content??"",title:i=e.title??void 0,color:n=e.color,backgroundColor:r=e.backgroundColor,opacity:o=e.opacity??1}=t;let l,a;n?(l=i?`<span class="${TooltipClass}-title"; style="color: ${n}">${i}</span>`:"",a=`<span class="${TooltipClass}-content" style="color: ${n}">${s}</span>`):(l=i?`<span class="${TooltipClass}-title">${i}</span>`:"",a=`<span class="${TooltipClass}-content">${s}</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.created=!1,this.element=document.createElement("div")}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){this.created||(document.body.appendChild(this.element),this.created=!0);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,N=b.y===this.min,C=b.y===this.max;m=t({datum:h,xValue:b.x,yValue:b.y,width:x,height:k,min:N,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],N=S===void 0;N&&(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,M=A-W,F={x:p,y:C};let z;d?z=d({value:S}):z=S!==void 0&&isNumber2(S)?this.formatLabelValue(S):"";const P=C+O/2;let D;const R="middle";let w;const v=S!==void 0&&S>=0,L=4;if(m==="center")D=W+M/2,w="center";else if(m==="outsideEnd")D=W+(v?M+L:-L),w=v?"start":"end";else if(m==="insideEnd"){D=W+(v?M-L:L),w=v?"end":"start";const T=import_ag_charts_community5._ModuleSupport.CachedTextMeasurerPool.measureText(z,{font:f}).width||20,I=p+T,X=p-T;(v&&D<I||!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:M,height:O,fill:r,stroke:o,strokeWidth:l,seriesDatum:{x:_,y:N?void 0:S},point:F,label:{x:D,y:P,text:z,fontStyle:h,fontWeight:g,fontSize:c,fontFamily:f,textAlign:w,textBaseline:R,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],N=S===void 0;N&&(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,M=A-C,F={x:W+O/2,y:p};let z;d?z=d({value:S}):z=S!==void 0&&isNumber3(S)?this.formatLabelValue(S):"";const P=W+O/2;let D;const R="center";let w;const v=S!==void 0&&S>=0,L=2;if(m==="center")D=C+M/2,w="middle";else if(m==="outsideEnd")D=C+(v?-L:M+L),w=v?"bottom":"top";else if(m==="insideEnd"){D=C+(v?L:M-L),w=v?"top":"bottom";const T=import_ag_charts_community6._ModuleSupport.CachedTextMeasurerPool.measureText(z,{font:f}).height||10,I=p-T,X=p+T;(v&&D>I||!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:M,fill:r,stroke:o,strokeWidth:l,seriesDatum:{x:_,y:N?void 0:S},point:F,label:{x:P,y:D,text:z,fontStyle:h,fontWeight:g,fontSize:c,fontFamily:f,textAlign:R,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">
</div>`}var TooltipClass="ag-sparkline-tooltip",SparklineTooltip=class{constructor(){this.created=!1,this.element=document.createElement("div")}isVisible(){const{element:t}=this;if(t.classList)return!t.classList.contains(`${TooltipClass}-wrapper-hidden`);const e=t.getAttribute("class");return e?e.split(" ").indexOf(`${TooltipClass}-wrapper-hidden`)<0:!1}updateClass(t){this.created||(document.body.appendChild(this.element),this.created=!0);const e=[`${TooltipClass}-wrapper`];t!==!0&&e.push(`${TooltipClass}-wrapper-hidden`),this.element.setAttribute("class",e.join(" "))}show(t,e){this.toggle(!1);const{element:s}=this;if(e!==void 0)s.innerHTML=e;else if(!s.innerHTML)return;const i=t.position?.xOffset??10,n=t.position?.yOffset??0;let r=t.pageX+i,o=t.pageY+n;const l=s.getBoundingClientRect();let a=window.innerWidth-l.width;if(t.container){const h=t.container.getBoundingClientRect();a=h.left+(h.width-l.width)}r>a&&(r=t.pageX-s.clientWidth-i),typeof scrollX<"u"&&(r+=scrollX),typeof scrollY<"u"&&(o+=scrollY),s.style.left=`${Math.round(r)}px`,s.style.top=`${Math.round(o)}px`,this.toggle(!0)}toggle(t){this.updateClass(t)}destroy(){const{parentNode:t}=this.element;t&&t.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:t}=this.marker,e=getMarker(t);return new e}getNodeData(){return this.markerSelectionData}update(){const t=this.generateNodeData();if(!t)return;const{nodeData:e,fillData:s,strokeData:i}=t;this.markerSelectionData=e,this.updateSelection(e),this.updateNodes(),this.updateStroke(i),this.updateFill(s)}updateYScaleDomain(){const{yData:t,yScale:e}=this,s=extent2(t);let i=0,n=1;s!=null&&(i=this.min=s[0],n=this.max=s[1]),i=i<0?i:0,n=n<0?0:n,e.domain=[i,n]}generateNodeData(){const{data:t,yData:e,xData:s,xScale:i,yScale:n}=this;if(!t)return;const r=!(i instanceof BandScale2),o=r?0:i.bandwidth/2,l=e.length,a=[],h=[],g=[];let c,f,y,d;const m=n.convert(0);for(let u=0;u<l;u++){const p=e[u],x=s[u],k=i.convert(r?i.toDomain(x):x)+o,b=p===void 0?NaN:n.convert(p);u+1<l&&(d=i.convert(r?i.toDomain(s[u+1]):s[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:t,yScale:e,axis:{stroke:s,strokeWidth:i},xAxisLine:n}=this,r=e.convert(0);n.x1=t.range[0],n.x2=t.range[1],n.y1=n.y2=r,n.stroke=s,n.strokeWidth=i}updateSelection(t){this.markerSelection.update(t)}updateNodes(){const{highlightedDatum:t,highlightStyle:e,marker:s}=this,{size:i,fill:n,stroke:r,strokeWidth:o}=e,l=s.formatter;this.markerSelection.each((a,h,g)=>{const{point:c,seriesDatum:f}=h;if(!c)return;const y=h===t,d=y&&n!==void 0?n:s.fill,m=y&&r!==void 0?r:s.stroke,u=y&&o!==void 0?o:s.strokeWidth,p=y&&i!==void 0?i:s.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:s.enabled&&a.size>0})}updateStroke(t){const{strokePath:e,yData:s,line:i}=this,n=e.path;if(n.clear(),s.length<2)return;const r=t.length;let o=!0;for(let l=0;l<r;l++){const{point:a,seriesDatum:h}=t[l],g=a.x,c=a.y;h.y==null?o=!0:o?(n.moveTo(g,c),o=!1):n.lineTo(g,c)}e.lineJoin=e.lineCap="round",e.fill=void 0,e.stroke=i.stroke,e.strokeWidth=i.strokeWidth}updateFill(t){const{fillPath:e,yData:s,fill:i}=this,n=e.path,r=t.length;if(n.clear(),!(s.length<2)){for(let o=0;o<r;o++){const{point:l}=t[o],a=l.x,h=l.y;o>0?n.lineTo(a,h):n.moveTo(a,h)}n.closePath(),e.lineJoin="round",e.stroke=void 0,e.fill=i}}updateXCrosshairLine(){const{yScale:t,xCrosshairLine:e,highlightedDatum:s,crosshairs:{xLine:i}}=this;if(!i.enabled||s==null){e.strokeWidth=0;return}e.y1=t.range[0],e.y2=t.range[1],e.x1=e.x2=s.point.x,e.stroke=i.stroke,e.strokeWidth=i.strokeWidth??1,e.lineCap=i.lineCap==="round"||i.lineCap==="square"?i.lineCap:void 0;const{lineDash:n}=i;e.lineDash=Array.isArray(n)?n:getLineDash(e.lineCap,i.lineDash)}updateYCrosshairLine(){const{xScale:t,yCrosshairLine:e,highlightedDatum:s,crosshairs:{yLine:i}}=this;if(!i.enabled||s==null){e.strokeWidth=0;return}e.x1=t.range[0],e.x2=t.range[1],e.y1=e.y2=s.point.y,e.stroke=i.stroke,e.strokeWidth=i.strokeWidth??1,e.lineCap=i.lineCap==="round"||i.lineCap==="square"?i.lineCap:void 0;const{lineDash:n}=i;e.lineDash=Array.isArray(n)?n:getLineDash(e.lineCap,i.lineDash)}getTooltipHtml(t){const{dataType:e}=this,{seriesDatum:s}=t,i=s.y,n=s.x,r=this.formatNumericDatum(i),o=e==="array"||e==="object"?this.formatDatum(n):void 0,l={content:r,title:o},a=this.processedOptions?.tooltip?.renderer;return a?toTooltipHtml(a({context:this.context,datum:s,yValue:i,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 t=this.generateNodeData();t&&(this.nodeSelectionData=t,this.updateRectSelection(t),this.updateLabelSelection(t))}updateNodes(){this.updateRectNodes(),this.updateLabelNodes()}calculateStep(t){const{xScale:e,paddingInner:s,paddingOuter:i,smallestInterval:n}=this,o=(e.domain[1]-e.domain[0])/(n?.x??1)+1,a=Math.min(o,50),h=a-1;return t/Math.max(1,2*i+h*s+a)}updateYScaleDomain(){const{yScale:t,yData:e,valueAxisDomain:s}=this,i=extent3(e);let n=0,r=1;i!=null&&(n=this.min=i[0],r=this.max=i[1]),n=n<0?n:0,r=r<0?0:r,s&&(s[1]<r&&(s[1]=r),s[0]>n&&(s[0]=n)),t.domain=s||[n,r]}updateRectSelection(t){this.rectSelection.update(t)}updateRectNodes(){const{highlightedDatum:t,formatter:e,fill:s,stroke:i,strokeWidth:n}=this,{fill:r,stroke:o,strokeWidth:l}=this.highlightStyle;this.rectSelection.each((a,h,g)=>{const c=h===t,f=c&&r!==void 0?r:s,y=c&&o!==void 0?o:i,d=c&&l!==void 0?l:n;let m;const{x:u,y:p,width:x,height:k,seriesDatum:b}=h;if(e){const S=g===0,_=g===this.nodeSelectionData.length-1,N=b.y===this.min,C=b.y===this.max;m=e({datum:h,xValue:b.x,yValue:b.y,width:x,height:k,min:N,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=u,a.y=p,a.width=x,a.height=k,a.visible=a.height>0})}updateLabelSelection(t){this.labelSelection.update(t,e=>{e.tag=1,e.pointerEvents=import_ag_charts_community4._Scene.PointerEvents.None})}updateLabelNodes(){const{label:{enabled:t,fontStyle:e,fontWeight:s,fontSize:i,fontFamily:n,color:r}}=this;this.labelSelection.each((o,l)=>{const a=l.label;a&&t?(o.fontStyle=e,o.fontWeight=s,o.fontSize=i,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(t){const{dataType:e}=this,{seriesDatum:s}=t,i=s.y,n=s.x,r=this.formatNumericDatum(i),o=e==="array"||e==="object"?this.formatDatum(n):void 0,l={content:r,title:o},a=this.processedOptions?.tooltip?.renderer;return a?toTooltipHtml(a({context:this.context,datum:s,yValue:i,xValue:n}),l):toTooltipHtml(l)}formatLabelValue(t){return t%1!==0?t.toFixed(1):t.toFixed(0)}},{isNumber:isNumber2}=import_ag_charts_community5._Util,{BandScale:BandScale3}=import_ag_charts_community5._Scale,BarSparkline=class extends BarColumnSparkline{updateYScaleRange(){const{seriesRect:t,yScale:e}=this;e.range=[0,t.width]}updateXScaleRange(){const{xScale:t,seriesRect:e,paddingOuter:s,paddingInner:i}=this;if(t instanceof BandScale3)t.range=[0,e.height],t.paddingInner=i,t.paddingOuter=s;else{const n=this.calculateStep(e.height),r=n*s;this.bandWidth=n*(1-i),t.range=[r,e.height-r-this.bandWidth]}}updateAxisLine(){const{yScale:t,axis:{stroke:e,strokeWidth:s},axisLine:i,seriesRect:n}=this,r=t.convert(0);i.x1=i.x2=r,i.y1=0,i.y2=n.height,i.stroke=e,i.strokeWidth=s+(s%2===1?1:0)}generateNodeData(){const{data:t,yData:e,xData:s,xScale:i,yScale:n,fill:r,stroke:o,strokeWidth:l,label:a}=this;if(!t)return;const{fontStyle:h,fontWeight:g,fontSize:c,fontFamily:f,color:y,formatter:d,placement:m}=a,u=[],p=n.convert(0),x=!(i instanceof BandScale3);for(let k=0,b=e.length;k<b;k++){let S=e[k];const _=s[k],N=S===void 0;N&&(S=0);const C=i.convert(x?i.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:i.bandwidth,M=A-W,F={x:p,y:C};let z;d?z=d({value:S}):z=S!==void 0&&isNumber2(S)?this.formatLabelValue(S):"";const P=C+O/2;let D;const R="middle";let w;const v=S!==void 0&&S>=0,L=4;if(m==="center")D=W+M/2,w="center";else if(m==="outsideEnd")D=W+(v?M+L:-L),w=v?"start":"end";else if(m==="insideEnd"){D=W+(v?M-L:L),w=v?"end":"start";const T=import_ag_charts_community5._ModuleSupport.CachedTextMeasurerPool.measureText(z,{font:f}).width||20,I=p+T,B=p-T;(v&&D<I||!v&&D>B)&&(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:M,height:O,fill:r,stroke:o,strokeWidth:l,seriesDatum:{x:_,y:N?void 0:S},point:F,label:{x:D,y:P,text:z,fontStyle:h,fontWeight:g,fontSize:c,fontFamily:f,textAlign:w,textBaseline:R,fill:y}})}return u}getDistance(t,e){return Math.abs(t.y-e.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:t,yScale:e}=this;e.range=[t.height,0]}updateXScaleRange(){const{xScale:t,seriesRect:e,paddingOuter:s,paddingInner:i}=this;if(t instanceof BandScale4)t.range=[0,e.width],t.paddingInner=i,t.paddingOuter=s;else{const n=this.calculateStep(e.width),r=n*s;this.bandWidth=n*(1-i),t.range=[r,e.width-r-this.bandWidth]}}updateAxisLine(){const{yScale:t,axis:{stroke:e,strokeWidth:s},axisLine:i,seriesRect:n}=this,r=t.convert(0);i.x1=0,i.x2=n.width,i.y1=i.y2=r,i.stroke=e,i.strokeWidth=s+(s%2===1?1:0)}generateNodeData(){const{data:t,yData:e,xData:s,xScale:i,yScale:n,fill:r,stroke:o,strokeWidth:l,label:a}=this;if(!t)return;const{fontStyle:h,fontWeight:g,fontSize:c,fontFamily:f,color:y,formatter:d,placement:m}=a,u=[],p=n.convert(0),x=!(i instanceof BandScale4);for(let k=0,b=e.length;k<b;k++){let S=e[k];const _=s[k],N=S===void 0;N&&(S=0);const C=Math.min(S===void 0?NaN:n.convert(S),p),W=i.convert(x?i.toDomain(_):_),A=Math.max(S===void 0?NaN:n.convert(S),p),O=x?this.bandWidth:i.bandwidth,M=A-C,F={x:W+O/2,y:p};let z;d?z=d({value:S}):z=S!==void 0&&isNumber3(S)?this.formatLabelValue(S):"";const P=W+O/2;let D;const R="center";let w;const v=S!==void 0&&S>=0,L=2;if(m==="center")D=C+M/2,w="middle";else if(m==="outsideEnd")D=C+(v?-L:M+L),w=v?"bottom":"top";else if(m==="insideEnd"){D=C+(v?L:M-L),w=v?"top":"bottom";const T=import_ag_charts_community6._ModuleSupport.CachedTextMeasurerPool.measureText(z,{font:f}).height||10,I=p-T,B=p+T;(v&&D>I||!v&&D<B)&&(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:M,fill:r,stroke:o,strokeWidth:l,seriesDatum:{x:_,y:N?void 0:S},point:F,label:{x:P,y:D,text:z,fontStyle:h,fontWeight:g,fontSize:c,fontFamily:f,textAlign:R,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:t}=this.marker,e=getMarker(t);return new e}onMarkerShapeChange(){this.markerSelection=this.markerSelection.clear(),this.scheduleLayout()}update(){const t=this.generateNodeData();t&&(this.markerSelectionData=t,this.updateSelection(t),this.updateNodes(),this.updateLine())}updateYScaleDomain(){const{yData:t,yScale:e}=this,s=extent4(t);let i=0,n=1;if(s!=null&&(i=this.min=s[0],n=this.max=s[1]),i===n){const r=Math.abs(i*.01);i-=r,n+=r}e.domain=[i,n]}generateNodeData(){const{data:t,yData:e,xData:s,xScale:i,yScale:n}=this;if(!t)return;const r=!(i instanceof BandScale5),o=r?0:i.bandwidth/2,l=[];for(let a=0;a<e.length;a++){const h=e[a],g=s[a];if(h==null)continue;const c=i.convert(r?i.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(t){this.markerSelection.update(t)}updateNodes(){const{highlightedDatum:t,highlightStyle:e,marker:s}=this,{size:i,fill:n,stroke:r,strokeWidth:o}=e,l=s.formatter;this.markerSelection.each((a,h,g)=>{const c=h===t,f=c&&n!==void 0?n:s.fill,y=c&&r!==void 0?r:s.stroke,d=c&&o!==void 0?o:s.strokeWidth,m=c&&i!==void 0?i:s.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:s.enabled&&a.size>0})}updateLine(){const{linePath:t,yData:e,xData:s,xScale:i,yScale:n,line:r}=this,o=t.path;if(o.clear(),e.length<2)return;const l=!(i instanceof BandScale5),a=e.length,h=l?0:i.bandwidth/2;let g=!0;for(let c=0;c<a;c++){const f=s[c],y=e[c],d=i.convert(l?i.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)}t.fill=void 0,t.stroke=r.stroke,t.strokeWidth=r.strokeWidth}updateXCrosshairLine(){const{yScale:t,xCrosshairLine:e,highlightedDatum:s,crosshairs:{xLine:i}}=this;if(!i.enabled||s==null){e.strokeWidth=0;return}e.y1=t.range[0],e.y2=t.range[1],e.x1=e.x2=s.point.x,e.stroke=i.stroke,e.strokeWidth=i.strokeWidth??1,e.lineCap=i.lineCap==="round"||i.lineCap==="square"?i.lineCap:void 0;const{lineDash:n}=i;e.lineDash=Array.isArray(n)?n:getLineDash(e.lineCap,i.lineDash)}updateYCrosshairLine(){const{xScale:t,yCrosshairLine:e,highlightedDatum:s,crosshairs:{yLine:i}}=this;if(!i.enabled||s==null){e.strokeWidth=0;return}e.x1=t.range[0],e.x2=t.range[1],e.y1=e.y2=s.point.y,e.stroke=i.stroke,e.strokeWidth=i.strokeWidth??1,e.lineCap=i.lineCap==="round"||i.lineCap==="square"?i.lineCap:void 0;const{lineDash:n}=i;e.lineDash=Array.isArray(n)?n:getLineDash(e.lineCap,i.lineDash)}getTooltipHtml(t){const{dataType:e}=this,{seriesDatum:s}=t,i=s.y,n=s.x,r=this.formatNumericDatum(i),o=e==="array"||e==="object"?this.formatDatum(n):void 0,l={content:r,title:o},a=this.processedOptions?.tooltip?.renderer;return a?toTooltipHtml(a({context:this.context,datum:s,yValue:i,xValue:n}),l):toTooltipHtml(l)}},{isNumber:isNumber4}=import_ag_charts_community8._Util,AgSparkline=class{static create(t,e){t=import_ag_charts_community8._Util.deepClone(t);const s=getSparklineInstance(t.type);return e&&(s.tooltip=e),initSparkline(s,t),initSparklineByType(s,t),t.data&&(s.data=t.data),s.processedOptions=t,s}};function getSparklineInstance(t="line"){switch(t){case"column":return new ColumnSparkline;case"bar":return new BarSparkline;case"area":return new AreaSparkline;case"line":default:return new LineSparkline}}function initSparklineByType(t,e){switch(e.type){case"bar":initBarColumnSparkline(t,e);break;case"column":initBarColumnSparkline(t,e);break;case"area":initAreaSparkline(t,e);break;case"line":default:initLineSparkline(t,e);break}}function initSparkline(t,e){setValueIfPropertyExists(t,"context",e.context,e),setValueIfPropertyExists(t,"width",e.width,e),setValueIfPropertyExists(t,"height",e.height,e),setValueIfPropertyExists(t,"container",e.container,e),setValueIfPropertyExists(t,"xKey",e.xKey,e),setValueIfPropertyExists(t,"yKey",e.yKey,e),e.padding&&initPaddingOptions(t.padding,e.padding),e.axis&&initAxisOptions(t.axis,e.axis),e.highlightStyle&&initHighlightStyleOptions(t.highlightStyle,e.highlightStyle)}function initLineSparkline(t,e){e.marker&&initMarkerOptions(t.marker,e.marker),e.line&&initLineOptions(t.line,e.line),e.crosshairs&&initCrosshairsOptions(t.crosshairs,e.crosshairs)}function initAreaSparkline(t,e){setValueIfPropertyExists(t,"fill",e.fill,e),e.marker&&initMarkerOptions(t.marker,e.marker),e.line&&initLineOptions(t.line,e.line),e.crosshairs&&initCrosshairsOptions(t.crosshairs,e.crosshairs)}function initBarColumnSparkline(t,e){setValueIfPropertyExists(t,"valueAxisDomain",e.valueAxisDomain,e),setValueIfPropertyExists(t,"fill",e.fill,e),setValueIfPropertyExists(t,"stroke",e.stroke,e),setValueIfPropertyExists(t,"strokeWidth",e.strokeWidth,e),setValueIfPropertyExists(t,"paddingInner",e.paddingInner,e),setValueIfPropertyExists(t,"paddingOuter",e.paddingOuter,e),setValueIfPropertyExists(t,"formatter",e.formatter,e),e.label&&initLabelOptions(t.label,e.label)}function initPaddingOptions(t,e){setValueIfPropertyExists(t,"top",e.top,e),setValueIfPropertyExists(t,"right",e.right,e),setValueIfPropertyExists(t,"bottom",e.bottom,e),setValueIfPropertyExists(t,"left",e.left,e)}function initMarkerOptions(t,e){setValueIfPropertyExists(t,"enabled",e.enabled,e),setValueIfPropertyExists(t,"size",e.size,e),setValueIfPropertyExists(t,"shape",e.shape,e),setValueIfPropertyExists(t,"fill",e.fill,e),setValueIfPropertyExists(t,"stroke",e.stroke,e),setValueIfPropertyExists(t,"strokeWidth",e.strokeWidth,e),setValueIfPropertyExists(t,"formatter",e.formatter,e)}function initLabelOptions(t,e){setValueIfPropertyExists(t,"enabled",e.enabled,e),setValueIfPropertyExists(t,"fontStyle",e.fontStyle,e),setValueIfPropertyExists(t,"fontWeight",e.fontWeight,e),setValueIfPropertyExists(t,"fontSize",e.fontSize,e),setValueIfPropertyExists(t,"fontFamily",e.fontFamily,e),setValueIfPropertyExists(t,"textAlign",e.textAlign,e),setValueIfPropertyExists(t,"textBaseline",e.textBaseline,e),setValueIfPropertyExists(t,"color",e.color,e),setValueIfPropertyExists(t,"formatter",e.formatter,e),setValueIfPropertyExists(t,"placement",e.placement,e)}function initLineOptions(t,e){setValueIfPropertyExists(t,"stroke",e.stroke,e),setValueIfPropertyExists(t,"strokeWidth",e.strokeWidth,e)}function initAxisOptions(t,e){setValueIfPropertyExists(t,"type",e.type,e),setValueIfPropertyExists(t,"stroke",e.stroke,e),setValueIfPropertyExists(t,"strokeWidth",e.strokeWidth,e)}function initHighlightStyleOptions(t,e){setValueIfPropertyExists(t,"fill",e.fill,e),setValueIfPropertyExists(t,"size",e.size,e),setValueIfPropertyExists(t,"stroke",e.stroke,e),setValueIfPropertyExists(t,"strokeWidth",e.strokeWidth,e)}function initCrosshairsOptions(t,e){t.xLine&&e.xLine&&initCrosshairLineOptions(t.xLine,e.xLine),t.yLine&&e.yLine&&initCrosshairLineOptions(t.yLine,e.yLine)}function initCrosshairLineOptions(t,e){setValueIfPropertyExists(t,"enabled",e.enabled,e),setValueIfPropertyExists(t,"stroke",e.stroke,e),setValueIfPropertyExists(t,"strokeWidth",e.strokeWidth,e),setValueIfPropertyExists(t,"lineDash",e.lineDash,e),setValueIfPropertyExists(t,"lineCap",e.lineCap,e)}var offsetValidator=(t,e,s)=>isNumber4(e)?!0:((0,import_core3._warnOnce)(`${t} must be a number, the value you provided is not a valid number. Using the default of ${s}px.`),!1),validators={xOffset:offsetValidator,yOffset:offsetValidator};function setValueIfPropertyExists(t,e,s,i){if(e in i)if(e in t){const n=validators[e];(n?n(e,s,t[e]):!0)&&t[e]!==s&&(t[e]=s)}else(0,import_core3._warnOnce)(`Property ${e} 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.1.0",SparklinesModule=(0,import_core6._defineModule)({version:VERSION,moduleName:import_core6.ModuleNames.SparklinesModule,beans:[SparklineTooltipSingleton],userComponents:[{name:"agSparklineCellRenderer",classImp:SparklineCellRenderer}],dependantModules:[import_core7.EnterpriseCoreModule]});
</div>`),this.eSparkline=import_core4.RefPlaceholder}wireBeans(t){this.resizeObserverService=t.resizeObserverService,this.sparklineTooltipSingleton=t.sparklineTooltipSingleton}init(t){let e=!0;const s=()=>{const{clientWidth:n,clientHeight:r}=this.getGui();if(!(n===0||r===0))if(e){const o={data:t.value,width:n,height:r,context:{data:t.data},...t.sparklineOptions};this.sparkline=AgSparkline.create(o,this.sparklineTooltipSingleton.getSparklineTooltip()),this.eSparkline.appendChild(this.sparkline.canvasElement),e=!1}else this.sparkline.width=n,this.sparkline.height=r},i=this.resizeObserverService.observeResize(this.getGui(),s);this.addDestroyFunc(()=>i())}refresh(t){return this.sparkline?(this.sparkline.data=t.value,this.sparkline.context={data:t.data},!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.2.0",SparklinesModule=(0,import_core6._defineModule)({version:VERSION,moduleName:import_core6.ModuleNames.SparklinesModule,beans:[SparklineTooltipSingleton],userComponents:[{name:"agSparklineCellRenderer",classImp:SparklineCellRenderer}],dependantModules:[import_core7.EnterpriseCoreModule]});
{
"name": "@ag-grid-enterprise/sparklines",
"version": "32.1.0",
"version": "32.2.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -16,5 +16,5 @@ "main": "./dist/package/main.cjs.js",

"dependencies": {
"@ag-grid-community/core": "32.1.0",
"@ag-grid-enterprise/core": "32.1.0",
"ag-charts-community": "10.1.0"
"@ag-grid-community/core": "32.2.0",
"@ag-grid-enterprise/core": "32.2.0",
"ag-charts-community": "10.2.0"
},

@@ -21,0 +21,0 @@ "devDependencies": {

{
"name": "@ag-grid-enterprise/sparklines",
"version": "32.1.0",
"version": "32.2.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -16,5 +16,5 @@ "main": "./src/main.js",

"dependencies": {
"@ag-grid-community/core": "32.1.0",
"@ag-grid-enterprise/core": "32.1.0",
"ag-charts-community": "10.1.0"
"@ag-grid-community/core": "32.2.0",
"@ag-grid-enterprise/core": "32.2.0",
"ag-charts-community": "10.2.0"
},

@@ -21,0 +21,0 @@ "devDependencies": {

@@ -45,3 +45,3 @@ import type { HighlightStyleOptions } from '@ag-grid-community/core';

readonly canvasElement: HTMLCanvasElement;
readonly rootGroup: _Scene.Group;
readonly rootGroup: _Scene.TranslatableGroup;
tooltip: SparklineTooltip;

@@ -48,0 +48,0 @@ private static tooltipDocuments;

@@ -1,1 +0,1 @@

export declare const VERSION = "32.1.0";
export declare const VERSION = "32.2.0";
{
"name": "@ag-grid-enterprise/sparklines",
"version": "32.1.0",
"version": "32.2.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -16,5 +16,5 @@ "main": "./dist/package/main.cjs.js",

"dependencies": {
"@ag-grid-community/core": "32.1.0",
"@ag-grid-enterprise/core": "32.1.0",
"ag-charts-community": "10.1.0"
"@ag-grid-community/core": "32.2.0",
"@ag-grid-enterprise/core": "32.2.0",
"ag-charts-community": "10.2.0"
},

@@ -21,0 +21,0 @@ "devDependencies": {

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc