Spaccogram/webk/public/chart-BIax9IsQ.js

3 lines
83 KiB
JavaScript
Raw Normal View History

const zt=(v,t,s,i)=>({linear:(e,n,o,c)=>o*e/c+n,easeInOutQuad:(e,n,o,c)=>(e/=c*.5,e<1?o*.5*e*e+n:(e--,-o/2*(e*(e-2)-1)+n))})[i](s,v,t-v,1);class Yt{constructor(t){this.queue={},this.queueSize=0,this.step=()=>{const s=[],i=+new Date;let a,e,n,o,c;const r={top:!1,bottom:!1};for(const h in this.queue){a=this.queue[h],e=i,n=a.endDt-a.startDt,c=a.state[h];const m=e<a.startDt;e<a.startDt?e=a.startDt:e>a.endDt&&(e=a.endDt),o=n?(e-a.startDt)/n:m?0:1;let l;o<1?a.tween==="exp"?l=c+(a.end-c)*a.speed:l=zt(a.start,a.end,o,a.tween):l=a.end,l!==c?(a.state[h]=l,r.top=r.top||a.group.top,r.bottom=r.bottom||a.group.bottom):l===a.end&&s.push(h)}let d=0;for(;d<s.length;)this.queue[s[d]].cbEnd&&this.queue[s[d]].cbEnd(this.queue[s[d]].state),delete this.queue[s[d]],d++;this.queueSize-=s.length,this.composer.render(r),this.queueSize?this.animFrame=requestAnimationFrame(this.step):delete this.animFrame},this.composer=t.composer,this.state=t.state}add(t){let s=0;const i=+new Date;let a,e,n;const o=this.queue;for(;s<t.length;){if(e=t[s],a=o[e.prop],!a){if(e.end===e.state[e.prop]){e.cbEnd&&e.cbEnd(e.state),s++;continue}a={lastStart:1},o[e.prop]=a,this.queueSize++}n=i-a.lastStart,e.duration*=this.state.speed,e.delay*=this.state.speed,a.cbEnd=e.cbEnd,a.state=e.state,a.lastStart=i,a.start=e.state[e.prop],a.end=e.end,a.startDt=i+(e.delay||0),a.endDt=a.startDt+(e.duration||0)-(e.fixed?0:Math.max(e.duration-n,0)),a.tween=e.tween||"easeInOutQuad",a.speed=e.speed,a.group=e.group,s++}this.animFrame||(this.animFrame=requestAnimationFrame(this.step))}get(t){return this.queue[t]}}const kt=["January","February","March","April","May","June","July","August","September","October","November","December"],Ht=kt.map(v=>v.slice(0,3)),Ct=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Nt=Ct.map(v=>v.slice(0,3));function Ot(v,t){return Ft(v,t)}let St;function Ft(v,t){return St===void 0&&(St=new Date().getTimezoneOffset()*6e4),t.getLabelTime(864e5+ +v*36e5+St)}function Et(v,t){return t.getLabelDate(v,{isShort:!0,displayYear:!1})}function Pt(v,t){return t.getLabelTime(v)}function Xt(v,{isShort:t,isMonthShort:s=!0,displayWeekDay:i,displayYear:a=!0,displayHours:e}={}){const n=new Date(v),o=t?Nt:Ct;let c=`${n.getUTCDate()} ${(s?Ht:kt)[n.getUTCMonth()]}`;return i&&(c=`${o[n.getUTCDay()]}, `+c),a&&(c+=` ${n.getUTCFullYear()}`),e&&(c+=`, ${("0"+n.getUTCHours()).slice(-2)}:${("0"+n.getUTCMinutes()).slice(-2)}`),c}function Gt(v){return new Date(v).toString().match(/(\d+:\d+):/)[1]}Math.log2||(Math.log2=function(v){return Math.log(v)*Math.LOG2E});Math.log10||(Math.log10=function(v){return Math.log(v)*Math.LOG10E});function Bt(v,t,s,i,a,e,n,o,c){const r=(o-n)/c,d=[],h=[];if(r<=1)return{xInd1:n,xInd2:o,x:t,ys:s};{let m=0,l=-999999999;const p=e.length;let g;for(let f=n;f<=o;f++){const $=t[f]*i+a<<0,u=$>l;u?(d[m]=t[f],m++):g++;for(let x=0;x<p;x++){const _=e[x];h[_]=h[_]||{y:[]};const T=h[_].y[m-1],R=s[_].y[f];T===void 0?h[_].y[m-1]=R:h[_].y[m-1]+=R,m>1&&(u&&(h[_].y[m-2]/=g),f===o&&(h[_].y[m-1]/=g))}u&&(g=1),l=$}return n=0,o=m-1,{isOptimized:r>1,xInd1:0,xInd2:m-1,x:d,ys:h}}}function ft(v){const t=v.getBoundingClientRect();return{x:t.left+(window.pageXOffset||document.documentElement.scrollLeft),y:t.top+(window.pageYOffset||document.documentElement.scrollTop)}}function J(v,t,s){let i=0,a=v.length-1;for(s||(t<v[i]?t=v[i]:t>v[a]&&(t=v[a]));Math.abs(i-a)>1;){const e=Math.round((i+a)/2);t>=v[i]&&t<=v[e]?a=e:i=e}return i+(t-v[i])/(v[a]-v[i])}function bt(v,t){typeof window.CustomEvent=="function"&&document.dispatchEvent(new CustomEvent(v,{detail:t||null}))}function $t(){const v=" -webkit- -moz- -o- -ms- ".split(" "),t=i=>window.matchMedia(i).matches;if("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)return!0;const s=["(",v.join("touch-enabled),("),"heartz",")"].join("");return t(s)}function vt(v,t,s,i,a,e,n){s*=t,i*=t,a*=t,e*=t,typeof n=="number"&&(n=[n,n,n,n]),n[0]*=t,n[1]*=t,n[2]*=t,n[3]*=t,v.beginPath(),v.moveTo(a+n[0],e),v.lineTo(a+s-n[1],e),v.quadraticCurveTo(a+s,e,a+s,e+n[1]),v.lineTo(a+s,e+i-n[2]),v.quadraticCurveTo(a+s,e+i,a+s-
//# sourceMappingURL=chart-BIax9IsQ.js.map