Socket
Socket
Sign inDemoInstall

uplot

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uplot - npm Package Compare versions

Comparing version 1.0.11 to 1.1.0

77

dist/uPlot.d.ts

@@ -9,3 +9,3 @@ declare class uPlot {

/** width of the plotting area + axes in CSS pixels */
/** chart container */
readonly root: HTMLElement;

@@ -74,3 +74,3 @@

/** toggles series visibility or focus */
setSeries(opts: {show?: boolean, focus?: boolean}): void;
setSeries(seriesIdx: number, opts: {show?: boolean, focus?: boolean}): void;

@@ -110,2 +110,8 @@ /** adds a series */

/** re-ranges a given min/max outwards to nearest 10% of given min/max's magnitudes, unless fullMags = true */
static rangeLog(min: number, max: number, fullMags: boolean): uPlot.MinMax;
/** default numeric formatter using browser's locale: new Intl.NumberFormat(navigator.language).format */
static fmtNum(val: number): string;
/** creates an efficient formatter for Date objects from a template string, e.g. {YYYY}-{MM}-{DD} */

@@ -195,3 +201,3 @@ static fmtDate(tpl: string, names?: uPlot.DateNames): (date: Date) => string;

opts?: (self: uPlot, opts: Options) => void;
hooks: Hooks;
hooks: PluginHooks;
}[];

@@ -229,5 +235,8 @@ }

/** closest data index to cursor */
/** closest data index to cursor (hoveredIdx) */
idx?: number;
/** returns data idx used for hover points & legend display (defaults to hoveredIdx) */
dataIdx?: (self: uPlot, seriesIdx: number, hoveredIdx: number) => number;
/** series hover points */

@@ -241,5 +250,5 @@ points?: {

setScale?: boolean; // true
/** toggles dragging in along x */
/** toggles dragging along x */
x?: boolean; // true
/** toggles dragging in along y */
/** toggles dragging along y */
y?: boolean; // false

@@ -279,7 +288,7 @@ /** min drag distance threshold */

/** determines whether all series' data on this scale be scanned to find the full min/max range */
/** determines whether all series' data on this scale will be scanned to find the full min/max range */
auto?: boolean;
/** can define a static scale range or re-range an initially-determined range from series data */
range?: MinMax | ((self: uPlot, initMin: number, initMax: number) => MinMax);
range?: MinMax | ((self: uPlot, initMin: number, initMax: number, scaleKey: string) => MinMax);

@@ -289,4 +298,4 @@ /** scale key from which this scale is derived */

/** treat the data distribution along this scale as linear (1) or equidistant (2)? */
distr?: 1 | 2;
/** scale distribution. 1: linear, 2: uniform, 3: logarithmic */
distr?: 1 | 2 | 3;

@@ -310,2 +319,5 @@ /** current min scale value */

/** if & how the data is pre-sorted (scale.auto optimization) */
sorted?: 0 | 1 | -1;
/** when true, null data values will not cause line breaks */

@@ -410,16 +422,16 @@ spanGaps?: boolean;

/** minimum divisor/tick spacing in CSS pixels */
space?: number | ((self: uPlot, scaleMin: number, scaleMax: number, plotDim: number) => number);
/** minimum grid & tick spacing in CSS pixels */
space?: number | ((self: uPlot, axisIdx: number, scaleMin: number, scaleMax: number, plotDim: number) => number);
/** available divisors for axis ticks, values, grid */
incrs?: number[] | ((self: uPlot, scaleMin: number, scaleMax: number, fullDim: number, minSpace: number) => number[]);
incrs?: number[] | ((self: uPlot, axisIdx: number, scaleMin: number, scaleMax: number, fullDim: number, minSpace: number) => number[]);
/** determines how and where the axis must be split for placing ticks, values, grid */
split?: number[] | ((self: uPlot, scaleMin: number, scaleMax: number, foundIncr: number, pctSpace: number) => number[]);
splits?: number[] | ((self: uPlot, axisIdx: number, scaleMin: number, scaleMax: number, foundIncr: number, pctSpace: number) => number[]);
/** formats splits values for rendering */
values?: (self: uPlot, splits: number[], foundSpace: number, foundIncr: number) => Array<string|number>;
/** formats values for rendering */
values?: (self: uPlot, splits: number[], axisIdx: number, foundSpace: number, foundIncr: number) => Array<string|number>;
/** values rotation in degrees off horizontal (only bottom axes w/ side: 2) */
rotate?: number | ((self: uPlot, values: Array<string|number>, foundSpace: number) => number);
rotate?: number | ((self: uPlot, values: Array<string|number>, axisIdx: number, foundSpace: number) => number);

@@ -460,44 +472,47 @@ /** gridlines to draw from this axis' splits */

export interface Hooks {
interface HooksDescription {
/** fires after opts are defaulted & merged but data has not been set and scales have not been ranged */
init?: ((self: uPlot, opts: Options, data: AlignedData) => void)[];
init?: (self: uPlot, opts: Options, data: AlignedData) => void;
/** fires after any scale has changed */
setScale?: ((self: uPlot, scaleKey: string) => void)[];
setScale?: (self: uPlot, scaleKey: string) => void;
/** fires after the cursor is moved (debounced by rAF) */
setCursor?: ((self: uPlot) => void)[];
setCursor?: (self: uPlot) => void;
/** fires after a selection is completed */
setSelect?: ((self: uPlot) => void)[];
setSelect?: (self: uPlot) => void;
/** fires after a series is toggled or focused */
setSeries?: ((self: uPlot, seriesIdx: number, opts: Series) => void)[];
setSeries?: (self: uPlot, seriesIdx: number, opts: Series) => void;
/** fires after data is updated updated */
setData?: ((self: uPlot) => void)[];
setData?: (self: uPlot) => void;
/** fires after the chart is resized */
setSize?: ((self: uPlot) => void)[];
setSize?: (self: uPlot) => void;
/** fires at start of every redraw */
drawClear?: ((self: uPlot) => void)[];
drawClear?: (self: uPlot) => void;
/** fires after all axes are drawn */
drawAxes?: ((self: uPlot) => void)[];
drawAxes?: (self: uPlot) => void;
/** fires after each series is drawn */
drawSeries?: ((self: uPlot, seriesKey: string) => void)[];
drawSeries?: (self: uPlot, seriesKey: string) => void;
/** fires after everything is drawn */
draw?: ((self: uPlot) => void)[];
draw?: (self: uPlot) => void;
/** fires after the chart is fully initialized and in the DOM */
ready?: ((self: uPlot) => void)[];
ready?: (self: uPlot) => void;
/** fires after the chart is destroyed */
destroy?: ((self: uPlot) => void)[];
destroy?: (self: uPlot) => void;
}
export type Hooks = { [P in keyof HooksDescription]: HooksDescription[P][] }
export type PluginHooks = { [P in keyof HooksDescription]: HooksDescription[P] | HooksDescription[P][] }
}
export default uPlot;

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

/*! https://github.com/leeoniya/uPlot (v1.0.11) */
var uPlot=function(){"use strict";function n(n,t,e,r){var i;e=e||0;for(var a=2147483647>=(r=r||t.length-1);r-e>1;)n>t[i=a?e+r>>1:o((e+r)/2)]?e=i:r=i;return n-t[e]>t[r]-n?r:e}function t(n,t,e,i){var a=t-n,l=f(a||r(t)||1),u=o(l),c=s(10,u)*e,v=0==a?c:0,h=g(function(n,t){return o(n/t)*t}(n-v,c)),m=g(p(t+v,c));return i&&(0==a?t>0?(h=0,m=2*t):0>t&&(m=0,h=2*n):(c>m-t&&(m+=c),c>n-h&&(h-=c),n>=0&&0>h&&(h=0),0>=t&&m>0&&(m=0))),[h,m]}var e=Math,r=e.abs,o=e.floor,i=e.round,a=e.ceil,l=e.min,u=e.max,s=e.pow,f=e.log10,c=e.PI;function v(n,t){return i(n/t)*t}function h(n,t,e){return l(u(n,t),e)}function m(n){return"function"==typeof n?n:function(){return n}}function p(n,t){return a(n/t)*t}function d(n){return i(1e3*n)/1e3}function g(n){return i(1e6*n)/1e6}var x=Array.isArray;function w(n){return"object"==typeof n&&null!==n}function b(n){var t;if(x(n))t=n.map(b);else if(w(n))for(var e in t={},n)t[e]=b(n[e]);else t=n;return t}function y(n){for(var t=arguments,e=1;t.length>e;e++){var r=t[e];for(var o in r)w(n[o])?y(n[o],b(r[o])):n[o]=b(r[o])}return n}var M="width",k="height",S="top",T="left",D=requestAnimationFrame,Y=document,E=window,_=devicePixelRatio;function z(n,t){null!=t&&n.classList.add(t)}function W(n,t,e){n.style[t]=e+"px"}function F(n,t,e,r){var o=Y.createElement(n);return null!=t&&z(o,t),null!=e&&e.insertBefore(o,r),o}function A(n,t){return F("div",n,t)}function C(n,t,e){n.style.transform="translate("+t+"px,"+e+"px)"}var H={passive:!0};function P(n,t,e){t.addEventListener(n,e,H)}function N(n,t,e){t.removeEventListener(n,e,H)}var V=["January","February","March","April","May","June","July","August","September","October","November","December"],L=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function I(n){return n.slice(0,3)}var B=L.map(I),R=V.map(I),U={MMMM:V,MMM:R,WWWW:L,WWW:B};function j(n){return(10>n?"0":"")+n}var J={YYYY:function(n){return n.getFullYear()},YY:function(n){return(n.getFullYear()+"").slice(2)},MMMM:function(n,t){return t.MMMM[n.getMonth()]},MMM:function(n,t){return t.MMM[n.getMonth()]},MM:function(n){return j(n.getMonth()+1)},M:function(n){return n.getMonth()+1},DD:function(n){return j(n.getDate())},D:function(n){return n.getDate()},WWWW:function(n,t){return t.WWWW[n.getDay()]},WWW:function(n,t){return t.WWW[n.getDay()]},HH:function(n){return j(n.getHours())},H:function(n){return n.getHours()},h:function(n){var t=n.getHours();return 0==t?12:t>12?t-12:t},AA:function(n){return 12>n.getHours()?"AM":"PM"},aa:function(n){return 12>n.getHours()?"am":"pm"},a:function(n){return 12>n.getHours()?"a":"p"},mm:function(n){return j(n.getMinutes())},m:function(n){return n.getMinutes()},ss:function(n){return j(n.getSeconds())},s:function(n){return n.getSeconds()},fff:function(n){return function(n){return(10>n?"00":100>n?"0":"")+n}(n.getMilliseconds())}};function O(n,t){t=t||U;for(var e,r=[],o=/\{([a-z]+)\}|[^{]+/gi;e=o.exec(n);)r.push("{"==e[0][0]?J[e[1]]:e[0]);return function(n){for(var e="",o=0;r.length>o;o++)e+="string"==typeof r[o]?r[o]:r[o](n,t);return e}}function G(n,t,e){for(var o=[],i=n;t>i;i++)for(var a=0;e.length>a;a++){var l=e[a]*s(10,i);o.push(+l.toFixed(r(i)))}return o}var q=[1,2,5],X=G(-12,0,q),Z=G(0,12,q),K=X.concat(Z),Q=3600,$=86400,nn=30*$,tn=365*$,en=[5e-4].concat(G(-3,0,q),[1,5,10,15,30,60,300,600,900,1800,Q,7200,3*Q,4*Q,6*Q,8*Q,43200,$,2*$,3*$,4*$,5*$,6*$,7*$,8*$,9*$,10*$,15*$,nn,2*nn,3*nn,4*nn,6*nn,tn,2*tn,5*tn,10*tn,25*tn,50*tn,100*tn]);function rn(n,t){return n.map((function(n){return[n[0],t(n[1]),n[2],t(n[4]?n[1]+n[3]:n[3])]}))}var on="{M}/{D}",an="\n"+on,ln="{h}:{mm}{aa}",un=[[tn,"{YYYY}",7,"",1],[28*$,"{MMM}",7,"\n{YYYY}",1],[$,on,7,"\n{YYYY}",1],[Q,"{h}{aa}",4,an,1],[60,ln,4,an,1],[1,":{ss}",2,an+" "+ln,1],[.001,":{ss}.{fff}",2,an+" "+ln,1]];function sn(n,t){return function(e,r,o,i){var a=t.find((function(n){return i>=n[0]}))||t[t.length-1],l=null,u=null,s=null;return r.map((function(t){var e=n(t),r=e.getFullYear(),o=e.getDate(),i=e.getMinutes(),f=r!=l,c=o!=u,v=i!=s;return l=r,u=o,s=i,(7==a[2]&&f||4==a[2]&&c||2==a[2]&&v?a[3]:a[1])(e)}))}}function fn(n,t,e){return new Date(n,t,e)}function cn(n,t){return t(n)}function vn(n,t){return function(e,r){return t(n(r))}}var hn={show:!0,x:!0,y:!0,lock:!1,points:{show:function(n,t){var e=n.series[t],r=A();r.style.background=e.stroke||"#000";var o=Tn(e.width,1),i=(o-1)/-2;return W(r,M,o),W(r,k,o),W(r,"marginLeft",i),W(r,"marginTop",i),r}},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,_x:!1,_y:!1},focus:{prox:-1},locked:!1,left:-10,top:-10,idx:null},mn={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},pn=y({},mn,{size:10}),dn='12px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',gn="bold "+dn,xn={type:"x",show:!0,scale:"x",space:50,gap:5,size:50,labelSize:30,labelFont:gn,side:2,grid:mn,ticks:pn,font:dn,rotate:0},wn={show:!0,scale:"x",min:1/0,max:-1/0,idxs:[]},bn=new Intl.NumberFormat(navigator.language);function yn(n,t){return t.map(bn.format)}function Mn(n,t,e,r,o,i){for(var a=[],l=t=i?t:+p(t,r).toFixed(12);e>=l;l=+(l+r).toFixed(12))a.push(l);return a}function kn(n,t){return t}var Sn={type:"y",show:!0,scale:"y",space:40,gap:5,size:50,labelSize:30,labelFont:gn,side:3,grid:mn,ticks:pn,font:dn,rotate:0};function Tn(n,t){return d((3+2*(n||1))*t)}var Dn={scale:"y",show:!0,band:!1,spanGaps:!1,alpha:1,points:{show:function(n,t){var e=Tn(n.series[t].width,_),r=n.series[0].idxs;return n.bbox.width/e/2>=r[1]-r[0]}},values:null,min:1/0,max:-1/0,idxs:[],path:null,clip:null},Yn={time:!0,auto:!1,distr:1,min:null,max:null},En=y({},Yn,{time:!1,auto:!0}),_n={};function zn(){var n=[];return{sub:function(t){n.push(t)},unsub:function(t){n=n.filter((function(n){return n!=t}))},pub:function(t,e,r,o,i,a,l){n.length>1&&n.forEach((function(n){n!=e&&n.pub(t,e,r,o,i,a,l)}))}}}function Wn(n,t,e,r){return(r?[n[0],n[1]].concat(n.slice(2)):[n[0]].concat(n.slice(1))).map((function(n,r){return Fn(n,r,t,e)}))}function Fn(n,t,e,r){return y({},0==t||n&&n.side%2==0?e:r,n)}function An(n,t,e,r){return r+(1-(n-t.min)/(t.max-t.min))*e}function Cn(n,t,e,r){return r+(n-t.min)/(t.max-t.min)*e}function Hn(n,t,e){return[t,e>t?e:e+86400]}function Pn(n,t,e){var i=e-t;if(0==i){var a=f(i||r(e)||1),l=o(a)+1;return[t,p(e,s(10,l))]}return[t,e]}function Nn(n,e,r){return t(e,r,.2,!0)}function Vn(n){return 0==n.button}function Ln(n){var t;return[n=n.replace(/\d+/,(function(n){return t=i(n*_)})),t]}function In(t,e,a){var s={},f=s.root=A("uplot");null!=t.id&&(f.id=t.id),z(f,t.class),t.title&&(A("title",f).textContent=t.title);var w=F("canvas"),H=s.ctx=w.getContext("2d"),V=A("wrap",f),L=A("under",V);V.appendChild(w);var I=A("over",V);((t=b(t)).plugins||[]).forEach((function(n){n.opts&&(t=n.opts(s,t)||t)}));var B=!1,R=s.series=Wn(t.series||[],wn,Dn,!1),U=s.axes=Wn(t.axes||[],xn,Sn,!0),j=s.scales=y({},{x:Yn,y:En},t.scales),J=y({x:i(Sn.size/2),y:i(xn.size/3)},t.gutters),G=t.tzDate||function(n){return new Date(1e3*n)},q=t.fmtDate||O,X=function(n){return function(t,e,r,i,a){var l=[],u=i>=nn&&tn>i,s=n(e),f=s/1e3,c=fn(s.getFullYear(),s.getMonth(),u?1:s.getDate()),v=c/1e3;if(u)for(var h=i/nn,m=f==v?f:fn(c.getFullYear(),c.getMonth()+h,1)/1e3,x=new Date(1e3*m),w=x.getFullYear(),b=x.getMonth(),y=0;r>=m;y++){var M=fn(w,b+h*y,1);(m=(+M+(M-n(M/1e3)))/1e3)>r||l.push(m)}else{var k=$>i?i:$,S=v+(o(e)-o(f))+p(f-v,k);l.push(S);for(var T=n(S),D=T.getHours()+T.getMinutes()/60+T.getSeconds()/Q,Y=i/Q;;){S=d(S+i);var E=o(g(D+Y))%24,_=n(S).getHours()-E;if(_>1&&(_=-1),(S-=_*Q)>r)break;D=(D+Y)%24,.7>d((S-l[l.length-1])/i)*a||l.push(S)}}return l}}(G),on=sn(G,rn(un,q)),an=vn(G,cn("{YYYY}-{MM}-{DD} {h}:{mm}{aa}",q)),ln={};for(var mn in j){var pn=j[mn];null==pn.min&&null==pn.max||(ln[mn]={min:pn.min,max:pn.max})}var dn,gn,bn=y({show:!0},t.legend).show,In=[],Bn=!1;if(bn){dn=F("table","legend",f);var Rn=R[1]?R[1].values:null;if(Bn=null!=Rn){var Un=F("tr","labels",dn);for(var jn in F("th",null,Un),gn=Rn(s,1,0))F("th",null,Un).textContent=jn}else gn={_:0},z(dn,"inline")}var Jn=s.cursor=y({},hn,t.cursor);Jn.points.show=m(Jn.points.show);var On=s.focus=y({},t.focus||{alpha:.3},Jn.focus),Gn=On.prox>=0,qn=[null];function Xn(n,t){var e=n.scale,r=j[e]=y({},0==t?Yn:En,j[e]),o=r.time;r.range=m(r.range||(o?Hn:0==t?Pn:Nn));var i=n.value;if(n.value=o?function(n){return"string"==typeof n}(i)?vn(G,cn(i,q)):i||an:i||kn,n.label=n.label||(o?"Time":"Value"),t>0){n.width=null==n.width?1:n.width,n.paths=n.paths||_t;var a=Tn(n.width,1);n.points=y({},{size:a,width:u(1,.2*a)},n.points),n.points.show=m(n.points.show),n._paths=null}if(bn&&In.splice(t,0,function(n,t){if(0==t&&Bn)return null;var e=[],r=F("tr","series",dn,dn.childNodes[t]);z(r,n.class),n.show||z(r,"off");var o=F("th",null,r),i=A("ident",o);n.width&&(i.style.borderColor=n.stroke),i.style.backgroundColor=n.fill;var a=A("text",o);for(var l in a.textContent=n.label,t>0&&(P("click",o,(function(t){Jn.locked||Vn(t)&&Jt(R.indexOf(n),{show:!n.show},ge.setSeries)})),Gn&&P("mouseenter",o,(function(){Jn.locked||Jt(R.indexOf(n),{focus:!0},ge.setSeries)}))),gn){var u=F("td",null,r);u.textContent="--",e.push(u)}return e}(n,t)),Jn.show){var l=function(n,t){if(t>0){var e=Jn.points.show(s,t);if(e)return z(e,"cursor-pt"),z(e,n.class),C(e,-10,-10),I.insertBefore(e,qn[t]),e}}(n,t);l&&qn.splice(t,0,l)}}for(var Zn in s.addSeries=function(n,t){n=Fn(n,t=null==t?R.length:t,wn,Dn),R.splice(t,0,n),Xn(R[t],t)},s.delSeries=function(n){R.splice(n,1),bn&&In.splice(n,1)[0][0].parentNode.remove(),qn.length>1&&qn.splice(n,1)[0].remove()},R.forEach(Xn),j){var Kn=j[Zn];null!=Kn.from&&(j[Zn]=y({},j[Kn.from],Kn))}var Qn,$n=R[0].scale,nt=j[$n].distr;U.forEach((function(n){if(n.show){var t=j[n.scale];null==t&&(n.scale=n.side%2?R[1].scale:$n,t=j[n.scale]);var e=t.time;n.space=m(n.space),n.rotate=m(n.rotate),n.incrs=m(n.incrs||(2==t.distr?Z:e?en:K)),n.split=m(n.split||(e&&1==t.distr?X:Mn));var r=n.values;n.values=e?x(r)?sn(G,rn(r,q)):r||on:r||yn,n.font=Ln(n.font),n.labelFont=Ln(n.labelFont)}}));var tt,et,rt,ot,it,at,lt,ut,st,ft,ct=null,vt=null,ht=R[0].idxs,mt=null;function pt(n,t){(n=n||[])[0]=n[0]||[],s.data=n,e=n.slice(),Qn=(mt=e[0]).length,2==nt&&(e[0]=mt.map((function(n,t){return t}))),Ft(),de("setData"),!1!==t&&dt()}function dt(){ct=ht[0]=0,vt=ht[1]=Qn-1,jt($n,2==nt?ct:e[0][ct],2==nt?vt:e[0][vt])}function gt(n,t,e,r){H.strokeStyle=n||"#000",H.lineWidth=t,H.lineJoin="round",H.setLineDash(e||[]),H.fillStyle=r||"#000"}function xt(n,t){s.width=tt=rt=n,s.height=et=ot=t,it=at=0,function(){var n=!1,t=!1,e=!1,r=!1;U.forEach((function(o){if(o.show){var i=o.side,a=i%2,l=o.size+(o.labelSize=null!=o.label?o.labelSize||30:0);l>0&&(a?(rt-=l,3==i?(it+=l,r=!0):e=!0):(ot-=l,0==i?(at+=l,n=!0):t=!0))}})),(n||t)&&(e||(rt-=J.x),r||(rt-=J.x,it+=J.x)),(r||e)&&(t||(ot-=J.y),n||(ot-=J.y,at+=J.y))}(),function(){var n=it+rt,t=at+ot,e=it,r=at;function o(o,i){switch(o){case 1:return(n+=i)-i;case 2:return(t+=i)-i;case 3:return(e-=i)+i;case 0:return(r-=i)+i}}U.forEach((function(n){var t=n.side;n._pos=o(t,n.size),null!=n.label&&(n._lpos=o(t,n.labelSize))}))}();var e=s.bbox;lt=e[T]=v(it*_,.5),ut=e.top=v(at*_,.5),st=e[M]=v(rt*_,.5),ft=e[k]=v(ot*_,.5),W(L,T,it),W(L,S,at),W(L,M,rt),W(L,k,ot),W(I,T,it),W(I,S,at),W(I,M,rt),W(I,k,ot),W(V,M,tt),W(V,k,et),w[M]=i(tt*_),w[k]=i(et*_),ie(),B&&jt($n,j[$n].min,j[$n].max),B&&de("setSize")}function wt(){if(Kt)$t=!0;else{if(Qn>0){var t=b(j);for(var r in t){var o=t[r],i=ln[r];null!=i?(y(o,i),r==$n&&Ft()):r!=$n&&(o.min=1/0,o.max=-1/0)}for(var a in R.forEach((function(r,o){var i=r.scale,a=t[i];if(0==o){var f=a.range(s,a.min,a.max);a.min=f[0],a.max=f[1],ct=n(a.min,e[0]),vt=n(a.max,e[0]),a.min>e[0][ct]&&ct++,e[0][vt]>a.max&&vt--,r.min=mt[ct],r.max=mt[vt]}else if(r.show&&null==ln[i]){var c=r.min==1/0?a.auto?function(n,t,e){for(var r=1/0,o=-1/0,i=t;e>=i;i++)null!=n[i]&&(r=l(r,n[i]),o=u(o,n[i]));return[r,o]}(e[o],ct,vt):[0,100]:[r.min,r.max];a.min=l(a.min,r.min=c[0]),a.max=u(a.max,r.max=c[1])}r.idxs[0]=ct,r.idxs[1]=vt})),t){var f=t[a];if(null==f.from&&f.min!=1/0&&null==ln[a]){var c=f.range(s,f.min,f.max);f.min=c[0],f.max=c[1]}}for(var v in t){var h=t[v];if(null!=h.from){var m=t[h.from];if(m.min!=1/0){var p=h.range(s,m.min,m.max);h.min=p[0],h.max=p[1]}}}var d={};for(var g in t){var x=t[g],w=j[g];w.min==x.min&&w.max==x.max||(w.min=x.min,w.max=x.max,d[g]=!0)}for(var M in R.forEach((function(n){d[n.scale]&&(n._paths=null)})),d)de("setScale",M)}for(var k in ln)ln[k]=null;Jn.show&&re()}}s.setData=pt,s.bbox={},s.setSize=function(n){xt(n.width,n.height)};var bt,yt,Mt,kt,St,Tt,Dt,Yt=1;function Et(n,t,e){var r=n[n.length-1];r&&r[0]==t?r[1]=e:n.push([t,e])}function _t(n,t,r,o){var a,s,f=R[t],c=e[0],v=e[t],h=j[$n],m=j[f.scale],p=1==Yt?{stroke:new Path2D,fill:null,clip:null}:R[t-1]._paths,g=p.stroke,x=d(f[M]*_),w=1/0,b=-1/0,y=[],k=i(Cn(c[1==Yt?r:o],h,st,lt));f.band&&1==Yt&&r==ct&&(x&&g.lineTo(-x,i(An(v[r],m,ft,ut))),c[0]>h.min&&y.push([lt,k-1]));for(var S=1==Yt?r:o;S>=r&&o>=S;S+=Yt){var T=i(Cn(c[S],h,st,lt));if(T==k)null!=v[S]&&(a=i(An(v[S],m,ft,ut)),w=l(a,w),b=u(a,b));else{var D=!1;w!=1/0?(g.lineTo(k,w),g.lineTo(k,b),g.lineTo(k,a),s=k):D=!0,null!=v[S]?(a=i(An(v[S],m,ft,ut)),g.lineTo(T,a),w=b=a,T-k>1&&null==v[S-1]&&(D=!0)):(w=1/0,b=-1/0),D&&Et(y,s,T),k=T}}if(null==v[o]&&Et(y,s,k),f.band){var Y,E,z=100*x;-1==Yt&&r==ct&&(E=lt-z,Y=r),1==Yt&&o==vt&&(E=lt+st+z,Y=o,h.max>c[Qn-1]&&y.push([k,lt+st])),g.lineTo(E,i(An(v[Y],m,ft,ut)))}if(1==Yt&&(p.clip=function(n,t,e,r){var o=null;if(t.length>0){if(R[n].spanGaps){var i=t[0],a=t[t.length-1];t=[],e&&t.push(i),r&&t.push(a)}o=new Path2D;for(var l=lt,u=0;t.length>u;u++){var s=t[u];o.rect(l,ut,s[0]-l,ut+ft),l=s[1]}o.rect(l,ut,lt+st-l,ut+ft)}return o}(t,y,null==v[r],null==v[o]),null!=f.fill)){var W=p.fill=new Path2D(g),F=i(An(0,m,ft,ut));W.lineTo(lt+st,F),W.lineTo(lt,F)}return f.band&&(Yt*=-1),p}function zt(n,t,e,r){var o;if(r>0){var i=n.space(s,t,e,r);(o=function(n,t,e,r){for(var o=e/n,i=0;t.length>i;i++){var a=t[i]*o;if(a>=r)return[t[i],a]}}(e-t,n.incrs(s,t,e,r,i),r,i)).push(o[1]/i)}else o=[0,0];return o}function Wt(n,t,e,r,o,i,a,l){var u=i%2/2;H.translate(u,u),gt(a,i,l),H.beginPath();var s,f,c,v,h=r+(0==e||3==e?-o:o);0==t?(f=r,v=h):(s=r,c=h),n.forEach((function(n){0==t?s=c=n:f=v=n,H.moveTo(s,f),H.lineTo(c,v)})),H.stroke(),H.translate(-u,-u)}function Ft(){R.forEach((function(n,t){t>0&&(n.min=1/0,n.max=-1/0,n._paths=null)}))}function At(){Kt?Qt=!0:(H.clearRect(0,0,w[M],w[k]),de("drawClear"),function(){U.forEach((function(n){if(n.show){var t=j[n.scale];if(t.min!=1/0){var e=n.side,r=e%2,o=t.min,a=t.max,l=zt(n,o,a,0==r?rt:ot),u=l[0],f=l[1],v=n.split(s,o,a,u,l[2],2==t.distr),h=0==r?Cn:An,m=0==r?st:ft,p=0==r?lt:ut,g=v.map((function(n){return i(h(n,t,m,p))})),x=i(n.gap*_),w=n.ticks,b=w.show?i(w.size*_):0,y=n.values(s,2==t.distr?v.map((function(n){return mt[n]})):v,f,2==t.distr?mt[v[1]]-mt[v[0]]:u),k=2==e?n.rotate(s,y,f)*-c/180:0,D=i(n._pos*_),Y=D+(b+x)*(0==r&&0==e||1==r&&3==e?-1:1),E=0==r?Y:0,z=1==r?Y:0;H.font=n.font[0],H.fillStyle=n.stroke||"#000",H.textAlign=k>0?T:0>k?"right":0==r?"center":3==e?"right":T,H.textBaseline=k||1==r?"middle":2==e?S:"bottom";var W=1.5*n.font[1];if(y.forEach((function(n,t){0==r?z=g[t]:E=g[t],(""+n).split(/\n/gm).forEach((function(n,t){k?(H.save(),H.translate(z,E+t*W),H.rotate(k),H.fillText(n,0,0),H.restore()):H.fillText(n,z,E+t*W)}))})),n.label){H.save();var F=i(n._lpos*_);1==r?(z=E=0,H.translate(F,i(ut+ft/2)),H.rotate((3==e?-c:c)/2)):(z=i(lt+st/2),E=F),H.font=n.labelFont[0],H.textAlign="center",H.textBaseline=2==e?S:"bottom",H.fillText(n.label,z,E),H.restore()}w.show&&Wt(g,r,e,D,b,d(w[M]*_),w.stroke);var A=n.grid;A.show&&Wt(g,r,0==r?2:1,0==r?ut:lt,0==r?ft:st,d(A[M]*_),A.stroke,A.dash)}}})),de("drawAxes")}(),function(){R.forEach((function(n,t){if(t>0&&n.show&&Qn>0&&null==n._paths){var r=function(n){for(var t=h(ct-1,0,Qn-1),e=h(vt+1,0,Qn-1);null==n[t]&&t>0;)t--;for(;null==n[e]&&Qn-1>e;)e++;return[t,e]}(e[t]);n._paths=n.paths(s,t,r[0],r[1])}})),R.forEach((function(n,t){t>0&&n.show&&(n._paths&&function(n){var t=R[n];if(1==Yt){var e=t._paths,r=e.stroke,o=e.fill,i=e.clip,a=d(t[M]*_),l=a%2/2;gt(t.stroke,a,t.dash,t.fill),H.globalAlpha=t.alpha,H.translate(l,l),H.save();var u=lt,s=ut,f=st,c=ft,v=a*_/2;0==t.min&&(c+=v),0==t.max&&(s-=v,c+=v),H.beginPath(),H.rect(u,s,f,c),H.clip(),null!=i&&H.clip(i),t.band?(H.fill(r),a&&H.stroke(r)):(a&&H.stroke(r),null!=t.fill&&H.fill(o)),H.restore(),H.translate(-l,-l),H.globalAlpha=1}t.band&&(Yt*=-1)}(t),n.points.show(s,t,ct,vt)&&function(n){var t=R[n],r=t.points,o=d(r.width*_),a=o%2/2,l=r.width>0,u=(r.size-r.width)/2*_,s=d(2*u);H.translate(a,a),H.save(),H.beginPath(),H.rect(lt-s,ut-s,st+2*s,ft+2*s),H.clip(),H.globalAlpha=t.alpha;for(var f=new Path2D,v=ct;vt>=v;v++)if(null!=e[n][v]){var h=i(Cn(e[0][v],j[$n],st,lt)),m=i(An(e[n][v],j[t.scale],ft,ut));f.moveTo(h+u,m),f.arc(h,m,u,0,2*c)}gt(r.stroke||t.stroke||"#000",o,null,r.fill||(l?"#fff":t.stroke||"#000")),H.fill(f),l&&H.stroke(f),H.globalAlpha=1,H.restore(),H.translate(-a,-a)}(t),de("drawSeries",t))}))}(),bt=!0,de("draw"))}function Ct(t,r){var o=j[t];if(null==o.from){if(t==$n&&(2==o.distr&&(r.min=n(r.min,e[0]),r.max=n(r.max,e[0])),o.time&&U[0].show&&r.max>r.min&&.001>zt(U[0],r.min,r.max,rt)[0]))return;ln[t]=r,bt=!1,wt(),!bt&&At(),bt=!1}}s.redraw=function(n){!1!==n?jt($n,j[$n].min,j[$n].max):At()},s.setScale=Ct;var Ht=!1,Pt=Jn.drag,Nt=Pt.x,Vt=Pt.y;if(Jn.show){var Lt="cursor-";Jn.x&&(Tt=Jn.left,yt=A(Lt+"x",I)),Jn.y&&(Dt=Jn.top,Mt=A(Lt+"y",I))}var It=s.select=y({show:!0,left:0,width:0,top:0,height:0},t.select),Bt=It.show?A("select",I):null;function Rt(n,t){if(It.show){for(var e in n)W(Bt,e,It[e]=n[e]);!1!==t&&de("setSelect")}}function Ut(n){var t=bn?In[n][0].parentNode:null;R[n].show?t&&function(n){n.classList.remove("off")}(t):(t&&z(t,"off"),qn.length>1&&C(qn[n],0,-10))}function jt(n,t,e){Ct(n,{min:t,max:e})}function Jt(n,t,e){var r=R[n];if(null!=t.focus&&function(n){n!=qt&&(R.forEach((function(t,e){!function(n,t){var e=R[n];Ot(n,t),e.band&&Ot(R[n+1].band?n+1:n-1,t)}(e,null==n||0==e||e==n?1:On.alpha)})),qt=n,At())}(n),null!=t.show){if(r.show=t.show,Ut(n),r.band){var o=R[n+1]&&R[n+1].band?n+1:n-1;R[o].show=r.show,Ut(o)}jt($n,j[$n].min,j[$n].max)}de("setSeries",n,t),e&&we.pub("setSeries",s,n,t)}function Ot(n,t){R[n].alpha=t,In&&(In[n][0].parentNode.style.opacity=t)}s.setSelect=Rt,s.setSeries=Jt;var Gt=Array(R.length),qt=null;function Xt(n,t){var e=rt;t!=$n&&(n=(e=ot)-n);var r=j[t];return r.min+n/e*(r.max-r.min)}function Zt(t){return n(Xt(t,$n),e[0],ct,vt)}bn&&Gn&&P("mouseleave",dn,(function(){Jn.locked||(Jt(null,{focus:!1},ge.setSeries),re())})),s.valToIdx=function(t){return n(t,e[0])},s.posToIdx=Zt,s.posToVal=Xt,s.valToPos=function(n,t,e){return t==$n?Cn(n,j[t],e?st:rt,e?lt:0):An(n,j[t],e?ft:ot,e?ut:0)};var Kt=!1,Qt=!1,$t=!1,ne=!1;function te(n){Kt=!0,n(s),Kt=!1,$t&&wt(),ne&&re(),Qt&&!bt&&At(),$t=ne=Qt=bt=Kt}s.batch=te,s.setCursor=function(n){Tt=n.left,Dt=n.top,re()};var ee=0;function re(n,t){if(Kt)ne=!0;else{var o;if(ee=0,Jn.show&&(Jn.x&&C(yt,i(Tt),0),Jn.y&&C(Mt,0,i(Dt))),0>Tt||0==Qn||ct>vt){o=null;for(var a=0;R.length>a;a++)if(a>0&&(Gt[a]=1/0,qn.length>1&&C(qn[a],-10,-10)),bn){if(0==a&&Bn)continue;for(var u=0;In[a].length>u;u++)In[a][u].firstChild.nodeValue="--"}Gn&&Jt(null,{focus:!0},ge.setSeries)}else{o=Zt(Tt);for(var f=d(Cn(e[0][o],j[$n],rt,0)),c=0;R.length>c;c++){var v=R[c];if(c>0&&v.show){var h=e[c][o],m=null==h?-10:d(An(h,j[v.scale],ot,0));Gt[c]=m>0?r(m-Dt):1/0,qn.length>1&&C(qn[c],f,m)}else Gt[c]=1/0;if(bn){if(o==Jn.idx||0==c&&Bn)continue;var p=0==c&&2==nt?mt:e[c],g=Bn?v.values(s,c,o):{_:v.value(s,p[o],c,o)},x=0;for(var w in g)In[c][x++].firstChild.nodeValue=g[w]}}}if(It.show&&Ht){var b=r(Tt-kt),y=r(Dt-St);if(null!=t){var D=ge.scales,Y=D[0],E=D[1],_=t.cursor.drag;if(Nt=_._x,Vt=_._y,Y){var z=j[Y],F=t.posToVal(t.select[T],Y),A=t.posToVal(t.select[T]+t.select[M],Y);It[T]=Cn(F,z,rt,0),It[M]=r(It[T]-Cn(A,z,rt,0)),W(Bt,T,It[T]),W(Bt,M,It[M]),E||(W(Bt,S,It.top=0),W(Bt,k,It[k]=ot))}if(E){var H=j[E],P=t.posToVal(t.select.top,E),N=t.posToVal(t.select.top+t.select[k],E);It.top=An(P,H,ot,0),It[k]=r(It.top-An(N,H,ot,0)),W(Bt,S,It.top),W(Bt,k,It[k]),Y||(W(Bt,T,It[T]=0),W(Bt,M,It[M]=rt))}}else{Nt=Pt.x&&b>=Pt.dist,Vt=Pt.y&&y>=Pt.dist;var V=Pt.uni;if(null!=V?Nt&&Vt&&(Vt=y>=V,(Nt=b>=V)||Vt||(y>b?Vt=!0:Nt=!0)):Pt.x&&Pt.y&&(Nt||Vt)&&(Nt=Vt=!0),Nt){var L=l(kt,Tt);W(Bt,T,It[T]=L),W(Bt,M,It[M]=b),Vt||(W(Bt,S,It.top=0),W(Bt,k,It[k]=ot))}if(Vt){var I=l(St,Dt);W(Bt,S,It.top=I),W(Bt,k,It[k]=y),Nt||(W(Bt,T,It[T]=0),W(Bt,M,It[M]=rt))}Nt||Vt||(W(Bt,k,It[k]=0),W(Bt,M,It[M]=0))}}if(Jn.idx=o,Jn.left=Tt,Jn.top=Dt,Pt._x=Nt,Pt._y=Vt,null!=n&&(we.pub("mousemove",s,Tt,Dt,rt,ot,o),Gn)){var U=l.apply(null,Gt),J=null;U>On.prox||Gt.some((function(n,t){if(n==U)return J=t})),Jt(J,{focus:!0},ge.setSeries)}B&&de("setCursor")}}var oe=null;function ie(){oe=I.getBoundingClientRect()}function ae(n,t,e,r,o,i){Jn.locked||(le(n,t,e,r,o,i,0,!1,null!=n),null!=n?0==ee&&(ee=D(re)):re(null,t))}function le(n,t,e,r,o,i,a,l,u){if(null!=n)e=n.clientX-oe.left,r=n.clientY-oe.top;else{if(0>e||0>r)return Tt=-10,void(Dt=-10);var s=ge.scales,f=s[0],c=s[1];e=null!=f?Cn(t.posToVal(e,f),j[f],rt,0):rt*(e/o),r=null!=c?An(t.posToVal(r,c),j[c],ot,0):ot*(r/i)}u&&(e>1&&rt-1>e||(e=v(e,rt)),r>1&&ot-1>r||(r=v(r,ot))),l?(kt=e,St=r):(Tt=e,Dt=r)}function ue(){Rt({width:0,height:0},!1)}function se(n,t,e,r,o,i){(null!=t||Vn(n))&&(Ht=!0,Nt=Vt=Pt._x=Pt._y=!1,le(n,t,e,r,o,i,0,!0,!1),null!=n&&(P("mouseup",Y,fe),we.pub("mousedown",s,kt,St,rt,ot,null)))}function fe(n,t,e,r,o,i){if(null!=t||Vn(n)){Ht=Pt._x=Pt._y=!1,le(n,t,e,r,o,i,0,!1,!0);var a=It[M]>0||It[k]>0;a&&Rt(It),Pt.setScale&&a?(te((function(){if(Nt&&jt($n,Xt(It[T],$n),Xt(It[T]+It[M],$n)),Vt)for(var n in j)n!=$n&&null==j[n].from&&jt(n,Xt(It.top+It[k],n),Xt(It.top,n))})),ue()):Jn.lock&&(Jn.locked=!Jn.locked,Jn.locked||re())}null!=n&&(N("mouseup",Y,fe),we.pub("mouseup",s,Tt,Dt,rt,ot,null))}function ce(){if(!Jn.locked){var n=Ht;if(Ht){var t=!0,e=!0;if(Nt&&Vt&&(t=10>=Tt||Tt>=rt-10,e=10>=Dt||Dt>=ot-10),Nt&&t){var r=Tt,o=rt-Tt,i=l(r,o);i==r&&(Tt=0),i==o&&(Tt=rt)}if(Vt&&e){var a=Dt,u=ot-Dt,s=l(a,u);s==a&&(Dt=0),s==u&&(Dt=ot)}re(1),Ht=!1}Tt=-10,Dt=-10,re(1),n&&(Ht=n)}}function ve(n){dt(),ue(),null!=n&&we.pub("dblclick",s,Tt,Dt,rt,ot,null)}var he,me={};me.mousedown=se,me.mousemove=ae,me.mouseup=fe,me.dblclick=ve,me.setSeries=function(n,t,e,r){Jt(e,r)},Jn.show&&(P("mousedown",I,se),P("mousemove",I,ae),P("mouseenter",I,ie),P("mouseleave",I,(function(){D(ce)})),P("dblclick",I,ve),he=function(n){var t=null;function e(){t=null,n()}return function(){clearTimeout(t),t=setTimeout(e,100)}}(ie),P("resize",E,he),P("scroll",E,he),s.syncRect=ie);var pe=s.hooks=t.hooks||{};function de(n,t,e){n in pe&&pe[n].forEach((function(n){n.call(null,s,t,e)}))}(t.plugins||[]).forEach((function(n){for(var t in n.hooks)pe[t]=(pe[t]||[]).concat(n.hooks[t])}));var ge=y({key:null,setSeries:!1,scales:[$n,null]},Jn.sync),xe=ge.key,we=null!=xe?_n[xe]=_n[xe]||zn():zn();function be(){xt(t[M],t[k]),de("init",t,e),pt(e||t.data,!1),ln[$n]?Ct($n,ln[$n]):dt(),Rt(It,!1),B=!0,de("ready")}return we.sub(s),s.pub=function(n,t,e,r,o,i,a){me[n](null,t,e,r,o,i,a)},s.destroy=function(){we.unsub(s),N("resize",E,he),N("scroll",E,he),f.remove(),de("destroy")},a?a instanceof HTMLElement?(a.appendChild(f),be()):a(s,be):be(),s}return In.assign=y,In.rangeNum=t,In.fmtDate=O,In.tzDate=function(n,t){var e;return"Etc/UTC"==t?e=new Date(+n+6e4*n.getTimezoneOffset()):(e=new Date(n.toLocaleString("en-US",{timeZone:t}))).setMilliseconds(n.getMilliseconds()),e},In}();
/*! https://github.com/leeoniya/uPlot (v1.1.0) */
var uPlot=function(){"use strict";function n(n,e,t,r){var o;t=t||0;for(var i=2147483647>=(r=r||e.length-1);r-t>1;)n>e[o=i?t+r>>1:a((t+r)/2)]?t=o:r=o;return n-e[t]>e[r]-n?r:t}function e(n,e,t){return t?(n=c(10,a(v(n))),e=c(10,u(v(e)))):(n=x(n,c(10,a(v(n)))),e=g(e,c(10,a(v(e))))),[+n.toFixed(12),+e.toFixed(12)]}function t(n,e,t,r){var o=e-n,l=o||i(e)||1e3,u=v(l),s=c(10,a(u)),f=l*t,h=e+f,m=b(x(n-f,s/100)),p=b(g(h,s/100));return r&&(0==o?e>0?m=0:0>e&&(p=0):(n>=0&&0>m&&(m=0),0>=e&&p>0&&(p=0))),[m,p]}var r=new Intl.NumberFormat(navigator.language).format,o=Math,i=o.abs,a=o.floor,l=o.round,u=o.ceil,s=o.min,f=o.max,c=o.pow,v=o.log10,h=o.PI;function m(n,e){return l(n/e)*e}function p(n,e,t){return s(f(n,e),t)}function d(n){return"function"==typeof n?n:function(){return n}}function g(n,e){return u(n/e)*e}function x(n,e){return a(n/e)*e}function w(n){return l(1e3*n)/1e3}function b(n){return l(1e6*n)/1e6}function y(n,e,t){for(var r=[],o=n;e>o;o++)for(var a=c(10,o),l=0;t.length>l;l++)r.push(+(t[l]*a).toFixed(i(o)));return r}var M=Array.isArray;function k(n){return"object"==typeof n&&null!==n}function S(n){var e;if(M(n))e=n.map(S);else if(k(n))for(var t in e={},n)e[t]=S(n[t]);else e=n;return e}function T(n){for(var e=arguments,t=1;e.length>t;t++){var r=e[t];for(var o in r)k(n[o])?T(n[o],S(r[o])):n[o]=S(r[o])}return n}var D="width",Y="height",E="top",_="left",z=requestAnimationFrame,W=document,F=window,A=devicePixelRatio;function C(n,e){null!=e&&n.classList.add(e)}function H(n,e,t){n.style[e]=t+"px"}function P(n,e,t,r){var o=W.createElement(n);return null!=e&&C(o,e),null!=t&&t.insertBefore(o,r),o}function N(n,e){return P("div",n,e)}function I(n,e,t){n.style.transform="translate("+e+"px,"+t+"px)"}var V={passive:!0};function L(n,e,t){e.addEventListener(n,t,V)}function B(n,e,t){e.removeEventListener(n,t,V)}var O=["January","February","March","April","May","June","July","August","September","October","November","December"],R=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function U(n){return n.slice(0,3)}var j=R.map(U),J=O.map(U),G={MMMM:O,MMM:J,WWWW:R,WWW:j};function Z(n){return(10>n?"0":"")+n}var q={YYYY:function(n){return n.getFullYear()},YY:function(n){return(n.getFullYear()+"").slice(2)},MMMM:function(n,e){return e.MMMM[n.getMonth()]},MMM:function(n,e){return e.MMM[n.getMonth()]},MM:function(n){return Z(n.getMonth()+1)},M:function(n){return n.getMonth()+1},DD:function(n){return Z(n.getDate())},D:function(n){return n.getDate()},WWWW:function(n,e){return e.WWWW[n.getDay()]},WWW:function(n,e){return e.WWW[n.getDay()]},HH:function(n){return Z(n.getHours())},H:function(n){return n.getHours()},h:function(n){var e=n.getHours();return 0==e?12:e>12?e-12:e},AA:function(n){return 12>n.getHours()?"AM":"PM"},aa:function(n){return 12>n.getHours()?"am":"pm"},a:function(n){return 12>n.getHours()?"a":"p"},mm:function(n){return Z(n.getMinutes())},m:function(n){return n.getMinutes()},ss:function(n){return Z(n.getSeconds())},s:function(n){return n.getSeconds()},fff:function(n){return function(n){return(10>n?"00":100>n?"0":"")+n}(n.getMilliseconds())}};function X(n,e){e=e||G;for(var t,r=[],o=/\{([a-z]+)\}|[^{]+/gi;t=o.exec(n);)r.push("{"==t[0][0]?q[t[1]]:t[0]);return function(n){for(var t="",o=0;r.length>o;o++)t+="string"==typeof r[o]?r[o]:r[o](n,e);return t}}var K=(new Intl.DateTimeFormat).resolvedOptions().timeZone,Q=[1,2,5],$=y(-12,0,Q),nn=y(0,12,Q),en=$.concat(nn),tn=3600,rn=86400,on=30*rn,an=365*rn,ln=[5e-4].concat(y(-3,0,Q),[1,5,10,15,30,60,300,600,900,1800,tn,7200,3*tn,4*tn,6*tn,8*tn,43200,rn,2*rn,3*rn,4*rn,5*rn,6*rn,7*rn,8*rn,9*rn,10*rn,15*rn,on,2*on,3*on,4*on,6*on,an,2*an,5*an,10*an,25*an,50*an,100*an]);function un(n,e){return n.map((function(n){return[n[0],e(n[1]),n[2],e(n[4]?n[1]+n[3]:n[3])]}))}var sn="{M}/{D}",fn="\n"+sn,cn="{h}:{mm}{aa}",vn=[[an,"{YYYY}",7,"",1],[28*rn,"{MMM}",7,"\n{YYYY}",1],[rn,sn,7,"\n{YYYY}",1],[tn,"{h}{aa}",4,fn,1],[60,cn,4,fn,1],[1,":{ss}",2,fn+" "+cn,1],[.001,":{ss}.{fff}",2,fn+" "+cn,1]];function hn(n,e){return function(t,r,o,i,a){var l=e.find((function(n){return a>=n[0]}))||e[e.length-1],u=null,s=null,f=null;return r.map((function(e){var t=n(e),r=t.getFullYear(),o=t.getDate(),i=t.getMinutes(),a=r!=u,c=o!=s,v=i!=f;return u=r,s=o,f=i,(7==l[2]&&a||4==l[2]&&c||2==l[2]&&v?l[3]:l[1])(t)}))}}function mn(n,e,t){return new Date(n,e,t)}function pn(n,e){return e(n)}function dn(n,e){return function(t,r){return e(n(r))}}var gn={show:!0,x:!0,y:!0,lock:!1,points:{show:function(n,e){var t=n.series[e],r=N();r.style.background=t.stroke||"#000";var o=Cn(t.width,1),i=(o-1)/-2;return H(r,D,o),H(r,Y,o),H(r,"marginLeft",i),H(r,"marginTop",i),r}},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,_x:!1,_y:!1},focus:{prox:-1},locked:!1,left:-10,top:-10,idx:null,dataIdx:function(n,e,t){return t}},xn={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},wn=T({},xn,{size:10}),bn='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',yn="bold "+bn,Mn={type:"x",show:!0,scale:"x",space:50,gap:5,size:50,labelSize:30,labelFont:yn,side:2,grid:xn,ticks:wn,font:bn,rotate:0},kn={show:!0,scale:"x",sorted:1,min:1/0,max:-1/0,idxs:[]};function Sn(n,e){return e.map(r)}function Tn(n,e,t,r,o,i,a){for(var l=[],u=t=a?t:+g(t,o).toFixed(12);r>=u;u=+(u+o).toFixed(12))l.push(u);return l}function Dn(n,e,t,r,o){var i=[];o=c(10,a(v(t)));var l=t;do{i.push(l),10*o>(l=+(l+o).toFixed(12))||(o=l)}while(r>=l);return i}var Yn=/./,En=/[12357]/,_n=/[125]/,zn=/1/;function Wn(n,e,t){var o=n.axes[t],i=o.scale,a=n.valToPos,l=o.space(),u=a(10,i),s=a(9,i)-u<l?a(7,i)-u<l?a(5,i)-u<l?zn:_n:En:Yn;return e.map((function(n){return s.test(n)?r(n):""}))}function Fn(n,e){return r(e)}var An={type:"y",show:!0,scale:"y",space:40,gap:5,size:50,labelSize:30,labelFont:yn,side:3,grid:xn,ticks:wn,font:bn,rotate:0};function Cn(n,e){return w((3+2*(n||1))*e)}var Hn={scale:"y",sorted:0,show:!0,band:!1,spanGaps:!1,alpha:1,points:{show:function(n,e){var t=Cn(n.series[e].width,A),r=n.series[0].idxs;return n.bbox.width/t/2>=r[1]-r[0]}},values:null,min:1/0,max:-1/0,idxs:[],path:null,clip:null},Pn={time:!0,auto:!0,distr:1,min:null,max:null},Nn=T({},Pn,{time:!1}),In={};function Vn(){var n=[];return{sub:function(e){n.push(e)},unsub:function(e){n=n.filter((function(n){return n!=e}))},pub:function(e,t,r,o,i,a,l){n.length>1&&n.forEach((function(n){n!=t&&n.pub(e,t,r,o,i,a,l)}))}}}function Ln(n,e,t,r){return(r?[n[0],n[1]].concat(n.slice(2)):[n[0]].concat(n.slice(1))).map((function(n,r){return Bn(n,r,e,t)}))}function Bn(n,e,t,r){return T({},0==e||n&&n.side%2==0?t:r,n)}function On(n,e){return 3==e.distr?v(n/e.min)/v(e.max/e.min):(n-e.min)/(e.max-e.min)}function Rn(n,e,t,r){return r+(1-On(n,e))*t}function Un(n,e,t,r){return r+On(n,e)*t}function jn(n,e,t){return[e,t>e?t:t+86400]}function Jn(n,e,t){var r=t-e;if(0==r){var o=v(r||i(t)||1),l=a(o)+1;return[e,g(t,c(10,l))]}return[e,t]}function Gn(n,e,r){return t(e,r,.1,!0)}function Zn(n,t,r){return e(t,r)}function qn(n,t,r){return e(t,r)}function Xn(n){return 0==n.button}function Kn(n){var e;return[n=n.replace(/\d+/,(function(n){return e=l(n*A)})),e]}function Qn(e,t,r){var o={},u=o.root=N("uplot");null!=e.id&&(u.id=e.id),C(u,e.class),e.title&&(N("u-title",u).textContent=e.title);var x=P("canvas"),y=o.ctx=x.getContext("2d"),k=N("u-wrap",u),V=N("u-under",k);k.appendChild(x);var O=N("u-over",k);((e=S(e)).plugins||[]).forEach((function(n){n.opts&&(e=n.opts(o,e)||e)}));var R=!1,U=o.series=Ln(e.series||[],kn,Hn,!1),j=o.axes=Ln(e.axes||[],Mn,An,!0),J=o.scales=T({},{x:Pn,y:Nn},e.scales),G=T({x:l(An.size/2),y:l(Mn.size/3)},e.gutters),Z=e.tzDate||function(n){return new Date(1e3*n)},q=e.fmtDate||X,K=function(n){return function(e,t,r,o,i,l){var u=[],s=i>=on&&an>i,f=n(r),c=f/1e3,v=mn(f.getFullYear(),f.getMonth(),s?1:f.getDate()),h=v/1e3;if(s)for(var m=i/on,p=c==h?c:mn(v.getFullYear(),v.getMonth()+m,1)/1e3,d=new Date(1e3*p),x=d.getFullYear(),y=d.getMonth(),M=0;o>=p;M++){var k=mn(x,y+m*M,1);(p=(+k+(k-n(k/1e3)))/1e3)>o||u.push(p)}else{var S=rn>i?i:rn,T=h+(a(r)-a(c))+g(c-h,S);u.push(T);for(var D=n(T),Y=D.getHours()+D.getMinutes()/60+D.getSeconds()/tn,E=i/tn,_=l/e.axes[t].space();;){T=w(T+i);var z=a(b(Y+E))%24,W=n(T).getHours()-z;if(W>1&&(W=-1),(T-=W*tn)>o)break;Y=(Y+E)%24,.7>w((T-u[u.length-1])/i)*_||u.push(T)}}return u}}(Z),Q=hn(Z,un(vn,q)),$=dn(Z,pn("{YYYY}-{MM}-{DD} {h}:{mm}{aa}",q)),sn={};for(var fn in J){var cn=J[fn];null==cn.min&&null==cn.max||(sn[fn]={min:cn.min,max:cn.max})}var xn,wn,bn=T({show:!0},e.legend).show,yn=[],Yn=!1;if(bn){xn=P("table","u-legend",u);var En=U[1]?U[1].values:null;if(Yn=null!=En){var _n=P("tr","u-thead",xn);for(var zn in P("th",null,_n),wn=En(o,1,0))P("th","u-label",_n).textContent=zn}else wn={_:0},C(xn,"u-inline")}var On=o.cursor=T({},gn,e.cursor);On.points.show=d(On.points.show);var Qn=o.focus=T({},e.focus||{alpha:.3},On.focus),$n=Qn.prox>=0,ne=[null];function ee(n,e){var t=n.scale,r=J[t]=T({},0==e?Pn:Nn,J[t]),i=r.time,a=3==r.distr;r.range=d(r.range||(i?jn:0==e?a?Zn:Jn:a?qn:Gn));var l=n.value;if(n.value=i?function(n){return"string"==typeof n}(l)?dn(Z,pn(l,q)):l||$:l||Fn,n.label=n.label||(i?"Time":"Value"),e>0){n.width=null==n.width?1:n.width,n.paths=n.paths||He;var u=Cn(n.width,1);n.points=T({},{size:u,width:f(1,.2*u)},n.points),n.points.show=d(n.points.show),n._paths=null}if(bn&&yn.splice(e,0,function(n,e){if(0==e&&Yn)return null;var t=[],r=P("tr","u-series",xn,xn.childNodes[e]);C(r,n.class),n.show||C(r,"u-off");var o=P("th",null,r),i=N("u-marker",o);n.width&&(i.style.borderColor=n.stroke),i.style.backgroundColor=n.fill;var a=N("u-label",o);for(var l in a.textContent=n.label,e>0&&(L("click",o,(function(e){On.locked||Xn(e)&&Xe(U.indexOf(n),{show:!n.show},Mt.setSeries)})),$n&&L("mouseenter",o,(function(){On.locked||Xe(U.indexOf(n),{focus:!0},Mt.setSeries)}))),wn){var u=P("td","u-value",r);u.textContent="--",t.push(u)}return t}(n,e)),On.show){var s=function(n,e){if(e>0){var t=On.points.show(o,e);if(t)return C(t,"u-cursor-pt"),C(t,n.class),I(t,-10,-10),O.insertBefore(t,ne[e]),t}}(n,e);s&&ne.splice(e,0,s)}}o.addSeries=function(n,e){n=Bn(n,e=null==e?U.length:e,kn,Hn),U.splice(e,0,n),ee(U[e],e)},o.delSeries=function(n){U.splice(n,1),bn&&yn.splice(n,1)[0][0].parentNode.remove(),ne.length>1&&ne.splice(n,1)[0].remove()},U.forEach(ee);var te,re=U[0].scale,oe=J[re].distr;for(var ie in J){var ae=J[ie];null!=ae.from&&(J[ie]=T({},J[ae.from],ae))}j.forEach((function(n){if(n.show){var e=J[n.scale];null==e&&(n.scale=n.side%2?U[1].scale:re,e=J[n.scale]);var t=e.time;n.space=d(n.space),n.rotate=d(n.rotate),n.incrs=d(n.incrs||(2==e.distr?nn:t?ln:en)),n.splits=d(n.splits||(t&&1==e.distr?K:3==e.distr?Dn:Tn));var r=n.values;n.values=t?M(r)?hn(Z,un(r,q)):r||Q:r||(3==e.distr?Wn:Sn),n.font=Kn(n.font),n.labelFont=Kn(n.labelFont)}}));var le,ue,se,fe,ce,ve,he,me,pe,de,ge=null,xe=null,we=U[0].idxs,be=null;function ye(n,e){if((n=n||[])[0]=n[0]||[],o.data=n,t=n.slice(),te=(be=t[0]).length,2==oe&&(t[0]=be.map((function(n,e){return e}))),Ie(),yt("setData"),!1!==e){var r=J[re];r.auto?Me():qe(re,r.min,r.max)}}function Me(){ge=we[0]=0,xe=we[1]=te-1,qe(re,2==oe?ge:t[0][ge],2==oe?xe:t[0][xe])}function ke(n,e,t,r){y.strokeStyle=n||"#000",y.lineWidth=e,y.lineJoin="round",y.setLineDash(t||[]),y.fillStyle=r||"#000"}function Se(n,e){o.width=le=se=n,o.height=ue=fe=e,ce=ve=0,function(){var n=!1,e=!1,t=!1,r=!1;j.forEach((function(o){if(o.show){var i=o.side,a=i%2,l=o.size+(o.labelSize=null!=o.label?o.labelSize||30:0);l>0&&(a?(se-=l,3==i?(ce+=l,r=!0):t=!0):(fe-=l,0==i?(ve+=l,n=!0):e=!0))}})),(n||e)&&(t||(se-=G.x),r||(se-=G.x,ce+=G.x)),(r||t)&&(e||(fe-=G.y),n||(fe-=G.y,ve+=G.y))}(),function(){var n=ce+se,e=ve+fe,t=ce,r=ve;function o(o,i){switch(o){case 1:return(n+=i)-i;case 2:return(e+=i)-i;case 3:return(t-=i)+i;case 0:return(r-=i)+i}}j.forEach((function(n){var e=n.side;n._pos=o(e,n.size),null!=n.label&&(n._lpos=o(e,n.labelSize))}))}();var t=o.bbox;he=t[_]=m(ce*A,.5),me=t.top=m(ve*A,.5),pe=t[D]=m(se*A,.5),de=t[Y]=m(fe*A,.5),H(V,_,ce),H(V,E,ve),H(V,D,se),H(V,Y,fe),H(O,_,ce),H(O,E,ve),H(O,D,se),H(O,Y,fe),H(k,D,le),H(k,Y,ue),x[D]=l(le*A),x[Y]=l(ue*A),ft(),R&&qe(re,J[re].min,J[re].max),R&&yt("setSize")}function Te(){if(tt)ot=!0;else{if(te>0){var e=S(J);for(var r in e){var i=e[r],a=sn[r];null!=a?(T(i,a),r==re&&Ie()):r!=re&&(i.min=1/0,i.max=-1/0)}for(var l in U.forEach((function(r,i){var a=r.scale,l=e[a];if(0==i){var u=l.range(o,l.min,l.max,a);l.min=u[0],l.max=u[1],ge=n(l.min,t[0]),xe=n(l.max,t[0]),l.min>t[0][ge]&&ge++,t[0][xe]>l.max&&xe--,r.min=be[ge],r.max=be[xe]}else if(r.show&&null==sn[a]){var c=r.min==1/0?l.auto?function(n,e,t,r){var o=1/0,i=-1/0;if(1==r)o=n[e],i=n[t];else if(-1==r)o=n[t],i=n[e];else for(var a=e;t>=a;a++)null!=n[a]&&(o=s(o,n[a]),i=f(i,n[a]));return[o,i]}(t[i],ge,xe,r.sorted):[0,100]:[r.min,r.max];l.min=s(l.min,r.min=c[0]),l.max=f(l.max,r.max=c[1])}r.idxs[0]=ge,r.idxs[1]=xe})),e){var u=e[l];if(null==u.from&&u.min!=1/0&&null==sn[l]){var c=u.range(o,u.min,u.max,l);u.min=c[0],u.max=c[1]}}for(var v in e){var h=e[v];if(null!=h.from){var m=e[h.from];if(m.min!=1/0){var p=h.range(o,m.min,m.max,v);h.min=p[0],h.max=p[1]}}}var d={};for(var g in e){var x=e[g],w=J[g];w.min==x.min&&w.max==x.max||(w.min=x.min,w.max=x.max,d[g]=!0)}for(var b in U.forEach((function(n){d[n.scale]&&(n._paths=null)})),d)yt("setScale",b)}for(var y in sn)sn[y]=null;On.show&&ut()}}o.setData=ye,o.bbox={},o.setSize=function(n){Se(n.width,n.height)};var De,Ye,Ee,_e,ze,We,Fe,Ae=1;function Ce(n,e,t){var r=n[n.length-1];r&&r[0]==e?r[1]=t:n.push([e,t])}function He(n,e,r,o){var i,a,u=U[e],c=t[0],v=t[e],h=J[re],m=J[u.scale],p=1==Ae?{stroke:new Path2D,fill:null,clip:null}:U[e-1]._paths,d=p.stroke,g=w(u[D]*A),x=1/0,b=-1/0,y=[],M=l(Un(c[1==Ae?r:o],h,pe,he));u.band&&1==Ae&&r==ge&&(g&&d.lineTo(-g,l(Rn(v[r],m,de,me))),c[0]>h.min&&y.push([he,M-1]));for(var k=1==Ae?r:o;k>=r&&o>=k;k+=Ae){var S=l(Un(c[k],h,pe,he));if(S==M)null!=v[k]&&(i=l(Rn(v[k],m,de,me)),x=s(i,x),b=f(i,b));else{var T=!1;x!=1/0?(d.lineTo(M,x),d.lineTo(M,b),d.lineTo(M,i),a=M):T=!0,null!=v[k]?(i=l(Rn(v[k],m,de,me)),d.lineTo(S,i),x=b=i,S-M>1&&null==v[k-1]&&(T=!0)):(x=1/0,b=-1/0),T&&Ce(y,a,S),M=S}}if(null==v[o]&&Ce(y,a,M),u.band){var Y,E,_=100*g;-1==Ae&&r==ge&&(E=he-_,Y=r),1==Ae&&o==xe&&(E=he+pe+_,Y=o,h.max>c[te-1]&&y.push([M,he+pe])),d.lineTo(E,l(Rn(v[Y],m,de,me)))}if(1==Ae&&(p.clip=function(n,e,t,r){var o=null;if(e.length>0){if(U[n].spanGaps){var i=e[0],a=e[e.length-1];e=[],t&&e.push(i),r&&e.push(a)}o=new Path2D;for(var l=he,u=0;e.length>u;u++){var s=e[u];o.rect(l,me,s[0]-l,me+de),l=s[1]}o.rect(l,me,he+pe-l,me+de)}return o}(e,y,null==v[r],null==v[o]),null!=u.fill)){var z=p.fill=new Path2D(d),W=l(Rn(0,m,de,me));z.lineTo(he+pe,W),z.lineTo(he,W)}return u.band&&(Ae*=-1),p}function Pe(n,e,t,r){var i,a=j[n];if(r>0){var l=a.space(o,n,e,t,r);i=function(n,e,t,r){for(var o=t/n,i=0;e.length>i;i++){var a=e[i]*o;if(a>=r)return[e[i],a]}}(t-e,a.incrs(o,n,e,t,r,l),r,l)}else i=[0,0];return i}function Ne(n,e,t,r,o,i,a,l){var u=i%2/2;y.translate(u,u),ke(a,i,l),y.beginPath();var s,f,c,v,h=r+(0==t||3==t?-o:o);0==e?(f=r,v=h):(s=r,c=h),n.forEach((function(n){0==e?s=c=n:f=v=n,y.moveTo(s,f),y.lineTo(c,v)})),y.stroke(),y.translate(-u,-u)}function Ie(){U.forEach((function(n,e){e>0&&(n.min=1/0,n.max=-1/0,n._paths=null)}))}function Ve(){tt?rt=!0:(y.clearRect(0,0,x[D],x[Y]),yt("drawClear"),function(){j.forEach((function(n,e){if(n.show){var t=J[n.scale];if(t.min!=1/0){var r=n.side,i=r%2,a=t.min,u=t.max,s=Pe(e,a,u,0==i?se:fe),f=s[0],c=s[1],v=n.splits(o,e,a,u,f,c,2==t.distr),m=0==i?Un:Rn,p=0==i?pe:de,d=0==i?he:me,g=v.map((function(n){return l(m(n,t,p,d))})),x=l(n.gap*A),b=n.ticks,M=b.show?l(b.size*A):0,k=n.values(o,2==t.distr?v.map((function(n){return be[n]})):v,e,c,2==t.distr?be[v[1]]-be[v[0]]:f),S=2==r?n.rotate(o,k,e,c)*-h/180:0,T=l(n._pos*A),Y=T+(M+x)*(0==i&&0==r||1==i&&3==r?-1:1),z=0==i?Y:0,W=1==i?Y:0;y.font=n.font[0],y.fillStyle=n.stroke||"#000",y.textAlign=S>0?_:0>S?"right":0==i?"center":3==r?"right":_,y.textBaseline=S||1==i?"middle":2==r?E:"bottom";var F=1.5*n.font[1];if(k.forEach((function(n,e){0==i?W=g[e]:z=g[e],(""+n).split(/\n/gm).forEach((function(n,e){S?(y.save(),y.translate(W,z+e*F),y.rotate(S),y.fillText(n,0,0),y.restore()):y.fillText(n,W,z+e*F)}))})),n.label){y.save();var C=l(n._lpos*A);1==i?(W=z=0,y.translate(C,l(me+de/2)),y.rotate((3==r?-h:h)/2)):(W=l(he+pe/2),z=C),y.font=n.labelFont[0],y.textAlign="center",y.textBaseline=2==r?E:"bottom",y.fillText(n.label,W,z),y.restore()}b.show&&Ne(g,i,r,T,M,w(b[D]*A),b.stroke);var H=n.grid;H.show&&Ne(g,i,0==i?2:1,0==i?me:he,0==i?de:pe,w(H[D]*A),H.stroke,H.dash)}}})),yt("drawAxes")}(),function(){U.forEach((function(n,e){if(e>0&&n.show&&te>0&&null==n._paths){var r=function(n){for(var e=p(ge-1,0,te-1),t=p(xe+1,0,te-1);null==n[e]&&e>0;)e--;for(;null==n[t]&&te-1>t;)t++;return[e,t]}(t[e]);n._paths=n.paths(o,e,r[0],r[1])}})),U.forEach((function(n,e){e>0&&n.show&&(n._paths&&function(n){var e=U[n];if(1==Ae){var t=e._paths,r=t.stroke,o=t.fill,i=t.clip,a=w(e[D]*A),l=a%2/2;ke(e.stroke,a,e.dash,e.fill),y.globalAlpha=e.alpha,y.translate(l,l),y.save();var u=he,s=me,f=pe,c=de,v=a*A/2;0==e.min&&(c+=v),0==e.max&&(s-=v,c+=v),y.beginPath(),y.rect(u,s,f,c),y.clip(),null!=i&&y.clip(i),e.band?(y.fill(r),a&&y.stroke(r)):(a&&y.stroke(r),null!=e.fill&&y.fill(o)),y.restore(),y.translate(-l,-l),y.globalAlpha=1}e.band&&(Ae*=-1)}(e),n.points.show(o,e,ge,xe)&&function(n){var e=U[n],r=e.points,o=w(r.width*A),i=o%2/2,a=r.width>0,u=(r.size-r.width)/2*A,s=w(2*u);y.translate(i,i),y.save(),y.beginPath(),y.rect(he-s,me-s,pe+2*s,de+2*s),y.clip(),y.globalAlpha=e.alpha;for(var f=new Path2D,c=ge;xe>=c;c++)if(null!=t[n][c]){var v=l(Un(t[0][c],J[re],pe,he)),m=l(Rn(t[n][c],J[e.scale],de,me));f.moveTo(v+u,m),f.arc(v,m,u,0,2*h)}ke(r.stroke||e.stroke||"#000",o,null,r.fill||(a?"#fff":e.stroke||"#000")),y.fill(f),a&&y.stroke(f),y.globalAlpha=1,y.restore(),y.translate(-i,-i)}(e),yt("drawSeries",e))}))}(),De=!0,yt("draw"))}function Le(e,r){var o=J[e];if(null==o.from){if(e==re&&(2==o.distr&&(r.min=n(r.min,t[0]),r.max=n(r.max,t[0])),o.time&&j[0].show&&r.max>r.min&&.001>Pe(0,r.min,r.max,se)[0]))return;sn[e]=r,De=!1,Te(),!De&&Ve(),De=!1}}o.redraw=function(n){!1!==n?qe(re,J[re].min,J[re].max):Ve()},o.setScale=Le;var Be=!1,Oe=On.drag,Re=Oe.x,Ue=Oe.y;On.show&&(On.x&&(We=On.left,Ye=N("u-cursor-x",O)),On.y&&(Fe=On.top,Ee=N("u-cursor-y",O)));var je=o.select=T({show:!0,left:0,width:0,top:0,height:0},e.select),Je=je.show?N("u-select",O):null;function Ge(n,e){if(je.show){for(var t in n)H(Je,t,je[t]=n[t]);!1!==e&&yt("setSelect")}}function Ze(n){var e=bn?yn[n][0].parentNode:null;U[n].show?e&&function(n){n.classList.remove("u-off")}(e):(e&&C(e,"u-off"),ne.length>1&&I(ne[n],0,-10))}function qe(n,e,t){Le(n,{min:e,max:t})}function Xe(n,e,t){var r=U[n];if(null!=e.focus&&function(n){n!=$e&&(U.forEach((function(e,t){!function(n,e){var t=U[n];Ke(n,e),t.band&&Ke(U[n+1].band?n+1:n-1,e)}(t,null==n||0==t||t==n?1:Qn.alpha)})),$e=n,Ve())}(n),null!=e.show){if(r.show=e.show,Ze(n),r.band){var i=U[n+1]&&U[n+1].band?n+1:n-1;U[i].show=r.show,Ze(i)}qe(re,J[re].min,J[re].max)}yt("setSeries",n,e),t&&St.pub("setSeries",o,n,e)}function Ke(n,e){U[n].alpha=e,bn&&(yn[n][0].parentNode.style.opacity=e)}o.setSelect=Ge,o.setSeries=Xe;var Qe=Array(U.length),$e=null;function nt(n,e){var t=se;e!=re&&(n=(t=fe)-n);var r=n/t,o=J[e],i=o.min,a=o.max;return 3==o.distr?(i=v(i),a=v(a),c(10,i+(a-i)*r)):i+(a-i)*r}function et(e){return n(nt(e,re),t[0],ge,xe)}bn&&$n&&L("mouseleave",xn,(function(){On.locked||(Xe(null,{focus:!1},Mt.setSeries),ut())})),o.valToIdx=function(e){return n(e,t[0])},o.posToIdx=et,o.posToVal=nt,o.valToPos=function(n,e,t){return e==re?Un(n,J[e],t?pe:se,t?he:0):Rn(n,J[e],t?de:fe,t?me:0)};var tt=!1,rt=!1,ot=!1,it=!1;function at(n){tt=!0,n(o),tt=!1,ot&&Te(),it&&ut(),rt&&!De&&Ve(),ot=it=rt=De=tt}o.batch=at,o.setCursor=function(n){We=n.left,Fe=n.top,ut()};var lt=0;function ut(n,e){if(tt)it=!0;else{var r;if(lt=0,On.show&&(On.x&&I(Ye,l(We),0),On.y&&I(Ee,0,l(Fe))),0>We||0==te||ge>xe){r=null;for(var a=0;U.length>a;a++)if(a>0&&(Qe[a]=1/0,ne.length>1&&I(ne[a],-10,-10)),bn){if(0==a&&Yn)continue;for(var u=0;yn[a].length>u;u++)yn[a][u].firstChild.nodeValue="--"}$n&&Xe(null,{focus:!0},Mt.setSeries)}else{r=et(We);for(var f=J[re],c=w(Un(t[0][r],f,se,0)),v=0;U.length>v;v++){var h=U[v],m=On.dataIdx(o,v,r),p=m==r?c:w(Un(t[0][m],f,se,0));if(v>0&&h.show){var d=t[v][m],g=null==d?-10:w(Rn(d,J[h.scale],fe,0));Qe[v]=g>0?i(g-Fe):1/0,ne.length>1&&I(ne[v],p,g)}else Qe[v]=1/0;if(bn){if(m==On.idx||0==v&&Yn)continue;var x=0==v&&2==oe?be:t[v],b=Yn?h.values(o,v,m):{_:h.value(o,x[m],v,m)},y=0;for(var M in b)yn[v][y++].firstChild.nodeValue=b[M]}}}if(je.show&&Be){var k=i(We-_e),S=i(Fe-ze);if(null!=e){var T=Mt.scales,z=T[0],W=T[1],F=e.cursor.drag;if(Re=F._x,Ue=F._y,z){var A=J[z],C=e.posToVal(e.select[_],z),P=e.posToVal(e.select[_]+e.select[D],z);je[_]=Un(C,A,se,0),je[D]=i(je[_]-Un(P,A,se,0)),H(Je,_,je[_]),H(Je,D,je[D]),W||(H(Je,E,je.top=0),H(Je,Y,je[Y]=fe))}if(W){var N=J[W],V=e.posToVal(e.select.top,W),L=e.posToVal(e.select.top+e.select[Y],W);je.top=Rn(V,N,fe,0),je[Y]=i(je.top-Rn(L,N,fe,0)),H(Je,E,je.top),H(Je,Y,je[Y]),z||(H(Je,_,je[_]=0),H(Je,D,je[D]=se))}}else{Re=Oe.x&&k>=Oe.dist,Ue=Oe.y&&S>=Oe.dist;var B=Oe.uni;if(null!=B?Re&&Ue&&(Ue=S>=B,(Re=k>=B)||Ue||(S>k?Ue=!0:Re=!0)):Oe.x&&Oe.y&&(Re||Ue)&&(Re=Ue=!0),Re){var O=s(_e,We);H(Je,_,je[_]=O),H(Je,D,je[D]=k),Ue||(H(Je,E,je.top=0),H(Je,Y,je[Y]=fe))}if(Ue){var j=s(ze,Fe);H(Je,E,je.top=j),H(Je,Y,je[Y]=S),Re||(H(Je,_,je[_]=0),H(Je,D,je[D]=se))}Re||Ue||(H(Je,Y,je[Y]=0),H(Je,D,je[D]=0))}}if(On.idx=r,On.left=We,On.top=Fe,Oe._x=Re,Oe._y=Ue,null!=n&&(St.pub("mousemove",o,We,Fe,se,fe,r),$n)){var G=s.apply(null,Qe),Z=null;G>Qn.prox||Qe.some((function(n,e){if(n==G)return Z=e})),Xe(Z,{focus:!0},Mt.setSeries)}R&&yt("setCursor")}}var st=null;function ft(){st=O.getBoundingClientRect()}function ct(n,e,t,r,o,i){On.locked||(vt(n,e,t,r,o,i,0,!1,null!=n),null!=n?0==lt&&(lt=z(ut)):ut(null,e))}function vt(n,e,t,r,o,i,a,l,u){if(null!=n)t=n.clientX-st.left,r=n.clientY-st.top;else{if(0>t||0>r)return We=-10,void(Fe=-10);var s=Mt.scales,f=s[0],c=s[1];t=null!=f?Un(e.posToVal(t,f),J[f],se,0):se*(t/o),r=null!=c?Rn(e.posToVal(r,c),J[c],fe,0):fe*(r/i)}u&&(t>1&&se-1>t||(t=m(t,se)),r>1&&fe-1>r||(r=m(r,fe))),l?(_e=t,ze=r):(We=t,Fe=r)}function ht(){Ge({width:0,height:0},!1)}function mt(n,e,t,r,i,a){(null!=e||Xn(n))&&(Be=!0,Re=Ue=Oe._x=Oe._y=!1,vt(n,e,t,r,i,a,0,!0,!1),null!=n&&(L("mouseup",W,pt),St.pub("mousedown",o,_e,ze,se,fe,null)))}function pt(n,e,t,r,i,a){if(null!=e||Xn(n)){Be=Oe._x=Oe._y=!1,vt(n,e,t,r,i,a,0,!1,!0);var l=je[D]>0||je[Y]>0;l&&Ge(je),Oe.setScale&&l?(at((function(){if(Re&&qe(re,nt(je[_],re),nt(je[_]+je[D],re)),Ue)for(var n in J)n!=re&&null==J[n].from&&qe(n,nt(je.top+je[Y],n),nt(je.top,n))})),ht()):On.lock&&(On.locked=!On.locked,On.locked||ut())}null!=n&&(B("mouseup",W,pt),St.pub("mouseup",o,We,Fe,se,fe,null))}function dt(){if(!On.locked){var n=Be;if(Be){var e=!0,t=!0;if(Re&&Ue&&(e=10>=We||We>=se-10,t=10>=Fe||Fe>=fe-10),Re&&e){var r=We,o=se-We,i=s(r,o);i==r&&(We=0),i==o&&(We=se)}if(Ue&&t){var a=Fe,l=fe-Fe,u=s(a,l);u==a&&(Fe=0),u==l&&(Fe=fe)}ut(1),Be=!1}We=-10,Fe=-10,ut(1),n&&(Be=n)}}function gt(n){Me(),ht(),null!=n&&St.pub("dblclick",o,We,Fe,se,fe,null)}var xt,wt={};wt.mousedown=mt,wt.mousemove=ct,wt.mouseup=pt,wt.dblclick=gt,wt.setSeries=function(n,e,t,r){Xe(t,r)},On.show&&(L("mousedown",O,mt),L("mousemove",O,ct),L("mouseenter",O,ft),L("mouseleave",O,(function(){z(dt)})),L("dblclick",O,gt),xt=function(n){var e=null;function t(){e=null,n()}return function(){clearTimeout(e),e=setTimeout(t,100)}}(ft),L("resize",F,xt),L("scroll",F,xt),o.syncRect=ft);var bt=o.hooks=e.hooks||{};function yt(n,e,t){n in bt&&bt[n].forEach((function(n){n.call(null,o,e,t)}))}(e.plugins||[]).forEach((function(n){for(var e in n.hooks)bt[e]=(bt[e]||[]).concat(n.hooks[e])}));var Mt=T({key:null,setSeries:!1,scales:[re,null]},On.sync),kt=Mt.key,St=null!=kt?In[kt]=In[kt]||Vn():Vn();function Tt(){Se(e[D],e[Y]),yt("init",e,t),ye(t||e.data,!1),sn[re]?Le(re,sn[re]):Me(),Ge(je,!1),R=!0,yt("ready")}return St.sub(o),o.pub=function(n,e,t,r,o,i,a){wt[n](null,e,t,r,o,i,a)},o.destroy=function(){St.unsub(o),B("resize",F,xt),B("scroll",F,xt),u.remove(),yt("destroy")},r?r instanceof HTMLElement?(r.appendChild(u),Tt()):r(o,Tt):Tt(),o}return Qn.assign=T,Qn.fmtNum=r,Qn.rangeNum=t,Qn.rangeLog=e,Qn.fmtDate=X,Qn.tzDate=function(n,e){var t;return"Etc/UTC"==e?t=new Date(+n+6e4*n.getTimezoneOffset()):e==K?t=n:(t=new Date(n.toLocaleString("en-US",{timeZone:e}))).setMilliseconds(n.getMilliseconds()),t},Qn}();
{
"name": "uplot",
"version": "1.0.11",
"version": "1.1.0",
"description": "A small, fast chart for time series, lines, areas, ohlc & bars",

@@ -42,3 +42,3 @@ "main": "./dist/uPlot.cjs.js",

"devDependencies": {
"rollup": "^2.16.1",
"rollup": "^2.23.0",
"rollup-plugin-buble": "^0.19.8",

@@ -45,0 +45,0 @@ "rollup-plugin-replace": "^2.2.0",

@@ -25,2 +25,3 @@ ## 📈 μPlot

- Temporal or numeric x-axis
- Linear, uniform or [logarithmic](https://leeoniya.github.io/uPlot/demos/log-scales.html) scales
- Line & Area styles (stroke, fill, width, dash)

@@ -60,3 +61,4 @@ - Zoom with auto-rescale

- Windows 10 x64, Chrome 83.0.4103.24 (Official Build) (32-bit)
- Date: 2020-08-01
- Windows 10 x64, Chrome 84.0.4147.105 (Official Build) (64-bit)
- Core i5-8350U @ 1.70GHz, 8GB RAM

@@ -72,18 +74,16 @@ - Intel HD 620 GPU, 2560x1440 res

<pre>
| lib | size | done | js,rend,paint,sys | heap peak,final | interact (10s) |
| -------------- | ------- | ------- | ----------------- | --------------- | ------------------- |
| <a href="https://leeoniya.github.io/uPlot/bench/uPlot.html">uPlot</a> | 24 KB | 68 ms | 93 3 3 74 | 16 MB 3 MB | 245 434 136 263 |
| <a href="https://leeoniya.github.io/uPlot/bench/Chart.js-next.html">Chart.js-next</a> | 253 KB | 241 ms | 299 3 3 94 | 35 MB 28 MB | 3029 35 96 6704 |
| <a href="https://leeoniya.github.io/uPlot/bench/dygraphs.html">dygraphs</a> | 125 KB | 199 ms | 263 6 4 177 | 64 MB 47 MB | 2610 268 331 441 |
| <a href="https://leeoniya.github.io/uPlot/bench/Flot.html">Flot</a> | 494 KB | 325 ms | 210 8 5 290 | 25 MB 24 MB | --- |
| <a href="https://leeoniya.github.io/uPlot/bench/CanvasJS.html">CanvasJS</a> | 459 KB | 347 ms | 424 4 3 113 | 37 MB 26 MB | 2499 561 346 456 |
| <a href="https://leeoniya.github.io/uPlot/bench/LightningChart.html">LightningChart</a> | 924 KB | --- ms | 600 5 4 89 | 39 MB 13 MB | 9534 34 56 119 |
| <a href="https://leeoniya.github.io/uPlot/bench/jqChart.html">jqChart</a> | 280 KB | 509 ms | 654 7 6 106 | 92 MB 53 MB | 1277 400 300 369 |
| <a href="https://leeoniya.github.io/uPlot/bench/Highcharts.html">Highcharts</a> | 292 KB | --- ms | 746 8 2 72 | 46 MB 30 MB | 2102 778 200 290 |
| <a href="https://leeoniya.github.io/uPlot/bench/Chart.js.html">Chart.js</a> | 245 KB | 695 ms | 755 7 6 185 | 78 MB 78 MB | 6230 4 10 3009 |
| <a href="https://leeoniya.github.io/uPlot/bench/Plotly.js.html">Plotly.js</a> | 3400 KB | 492 ms | 884 11 2 90 | 51 MB 48 MB | 1676 242 61 234 |
| <a href="https://leeoniya.github.io/uPlot/bench/ECharts.html">ECharts</a> | 752 KB | --- ms | 777 5 11 1132 | 120 MB 81 MB | 2425 60 54 7650 |
| <a href="https://leeoniya.github.io/uPlot/bench/ApexCharts.html">ApexCharts</a> | 458 KB | --- ms | 2357 31 69 64 | 162 MB 96 MB | 2179 219 7806 59 |
| <a href="https://leeoniya.github.io/uPlot/bench/ZingChart.html">ZingChart</a> | 699 KB | 2720 ms | 2992 8 1 65 | 202 MB 119 MB | --- |
| <a href="https://leeoniya.github.io/uPlot/bench/amCharts.html">amCharts</a> | 1200 KB | 6700 ms | 6704 49 25 99 | 268 MB 268 MB | 6700 1414 1183 505 |
| <a href="https://leeoniya.github.io/uPlot/bench/uPlot.html">uPlot</a> | 26 KB | 68 ms | 99 3 4 68 | 12 MB 4 MB | 196 458 135 264 |
| <a href="https://leeoniya.github.io/uPlot/bench/Chart.js-next.html">Chart.js-next</a> | 222 KB | 189 ms | 275 3 3 95 | 32 MB 21 MB | 3411 35 112 6322 |
| <a href="https://leeoniya.github.io/uPlot/bench/LightningChart.html">LightningChart</a> | 964 KB | --- ms | 378 4 2 70 | 24 MB 18 MB | 9647 32 59 113 |
| <a href="https://leeoniya.github.io/uPlot/bench/dygraphs.html">dygraphs</a> | 125 KB | 190 ms | 286 5 3 174 | 57 MB 46 MB | 2329 272 333 415 |
| <a href="https://leeoniya.github.io/uPlot/bench/CanvasJS.html">CanvasJS</a> | 477 KB | 320 ms | 400 4 2 103 | 40 MB 25 MB | 2282 541 337 481 |
| <a href="https://leeoniya.github.io/uPlot/bench/Flot.html">Flot</a> | 494 KB | 320 ms | 205 7 6 307 | 24 MB 24 MB | --- |
| <a href="https://leeoniya.github.io/uPlot/bench/dvxcharts.html">dvxcharts</a> | 369 KB | 347 ms | 633 41 45 72 | 42 MB 24 MB | 1476 891 294 280 |
| <a href="https://leeoniya.github.io/uPlot/bench/Highcharts.html">Highcharts</a> | 381 KB | --- ms | 757 9 2 63 | 27 MB 23 MB | 1986 780 207 311 |
| <a href="https://leeoniya.github.io/uPlot/bench/Chart.js.html">Chart.js</a> | 245 KB | 668 ms | 747 6 7 174 | 82 MB 76 MB | 5565 5 13 4111 |
| <a href="https://leeoniya.github.io/uPlot/bench/Plotly.js.html">Plotly.js</a> | 3400 KB | 483 ms | 849 10 4 87 | 39 MB 24 MB | 1601 216 58 203 |
| <a href="https://leeoniya.github.io/uPlot/bench/ECharts.html">ECharts</a> | 781 KB | --- ms | 789 4 9 1119 | 79 MB 79 MB | 2027 64 59 7696 |
| <a href="https://leeoniya.github.io/uPlot/bench/ApexCharts.html">ApexCharts</a> | 459 KB | --- ms | 2298 30 135 61 | 151 MB 151 MB | 2223 259 7802 66 |
| <a href="https://leeoniya.github.io/uPlot/bench/ZingChart.html">ZingChart</a> | 857 KB | 2632 ms | 2934 8 1 68 | 121 MB 97 MB | --- |
| <a href="https://leeoniya.github.io/uPlot/bench/amCharts.html">amCharts</a> | 1200 KB | 6147 ms | 7159 56 15 112 | 251 MB 251 MB | 6244 1163 598 448 |
</pre>

@@ -90,0 +90,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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