mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-16 04:32:33 +00:00
3 lines
44 KiB
JavaScript
3 lines
44 KiB
JavaScript
|
/*! https://github.com/leeoniya/uPlot (v1.6.21) */
|
||
|
var uPlot=function(){"use strict";const e="u-off",t="u-label",l="width",n="height",i="top",o="bottom",s="left",r="right",u="#000",a="mousemove",f="mousedown",c="mouseup",h="mouseenter",d="mouseleave",p="dblclick",m="change",g="dppxchange",x="undefined"!=typeof window,w=x?document:null,_=x?window:null,k=x?navigator:null;let b,v;function y(e,t){if(null!=t){let l=e.classList;!l.contains(t)&&l.add(t)}}function M(e,t){let l=e.classList;l.contains(t)&&l.remove(t)}function S(e,t,l){e.style[t]=l+"px"}function E(e,t,l,n){let i=w.createElement(e);return null!=t&&y(i,t),null!=l&&l.insertBefore(i,n),i}function D(e,t){return E("div",e,t)}const z=new WeakMap;function T(t,l,n,i,o){let s="translate("+l+"px,"+n+"px)";s!=z.get(t)&&(t.style.transform=s,z.set(t,s),0>l||0>n||l>i||n>o?y(t,e):M(t,e))}const P=new WeakMap;function A(e,t,l){let n=t+l;n!=P.get(e)&&(P.set(e,n),e.style.background=t,e.style.borderColor=l)}const W=new WeakMap;function Y(e,t,l,n){let i=t+""+l;i!=W.get(e)&&(W.set(e,i),e.style.height=l+"px",e.style.width=t+"px",e.style.marginLeft=n?-t/2+"px":0,e.style.marginTop=n?-l/2+"px":0)}const C={passive:!0},F={...C,capture:!0};function H(e,t,l,n){t.addEventListener(e,l,n?F:C)}function R(e,t,l,n){t.removeEventListener(e,l,n?F:C)}function G(e,t,l,n){let i;l=l||0;let o=2147483647>=(n=n||t.length-1);for(;n-l>1;)i=o?l+n>>1:te((l+n)/2),e>t[i]?l=i:n=i;return e-t[l]>t[n]-e?n:l}function L(e,t,l,n){for(let i=1==n?t:l;i>=t&&l>=i;i+=n)if(null!=e[i])return i;return-1}x&&function e(){let t=devicePixelRatio;b!=t&&(b=t,v&&R(m,v,e),v=matchMedia(`(min-resolution: ${b-.001}dppx) and (max-resolution: ${b+.001}dppx)`),H(m,v,e),_.dispatchEvent(new CustomEvent(g)))}();const I=[0,0];function O(e,t,l,n){return I[0]=0>l?ye(e,-l):e,I[1]=0>n?ye(t,-n):t,I}function N(e,t,l,n){let i,o,s,r=re(e),u=10==l?ue:ae;return e==t&&(-1==r?(e*=l,t/=l):(e/=l,t*=l)),n?(i=te(u(e)),o=ne(u(t)),s=O(se(l,i),se(l,o),i,o),e=s[0],t=s[1]):(i=te(u(ee(e))),o=te(u(ee(t))),s=O(se(l,i),se(l,o),i,o),e=ve(e,s[0]),t=be(t,s[1])),[e,t]}function j(e,t,l,n){let i=N(e,t,l,n);return 0==e&&(i[0]=0),0==t&&(i[1]=0),i}const B={mode:3,pad:.1},U={pad:0,soft:null,mode:0},V={min:U,max:U};function J(e,t,l,n){return We(l)?K(e,t,l):(U.pad=l,U.soft=n?0:null,U.mode=n?3:0,K(e,t,V))}function q(e,t){return null==e?t:e}function K(e,t,l){let n=l.min,i=l.max,o=q(n.pad,0),s=q(i.pad,0),r=q(n.hard,-ce),u=q(i.hard,ce),a=q(n.soft,ce),f=q(i.soft,-ce),c=q(n.mode,0),h=q(i.mode,0),d=t-e;1e-9>d&&(d=0,0!=e&&0!=t||(d=1e-9,2==c&&a!=ce&&(o=0),2==h&&f!=-ce&&(s=0)));let p=d||ee(t)||1e3,m=ue(p),g=se(10,te(m)),x=ye(ve(e-p*(0==d?0==e?.1:1:o),g/10),9),w=a>e||1!=c&&(3!=c||x>a)&&(2!=c||a>x)?ce:a,_=oe(r,w>x&&e>=w?w:ie(w,x)),k=ye(be(t+p*(0==d?0==t?.1:1:s),g/10),9),b=t>f||1!=h&&(3!=h||f>k)&&(2!=h||k>f)?-ce:f,v=ie(u,k>b&&b>=t?b:oe(b,k));return _==v&&0==_&&(v=100),[_,v]}const Z=new Intl.NumberFormat(x?k.language:"en-US"),$=e=>Z.format(e),X=Math,Q=X.PI,ee=X.abs,te=X.floor,le=X.round,ne=X.ceil,ie=X.min,oe=X.max,se=X.pow,re=X.sign,ue=X.log10,ae=X.log2,fe=(e,t=1)=>X.asinh(e/t),ce=1/0;function he(e){return 1+(0|ue((e^e>>31)-(e>>31)))}function de(e,t){return le(e/t)*t}function pe(e,t,l){return ie(oe(e,t),l)}function me(e){return"function"==typeof e?e:()=>e}const ge=e=>e,xe=(e,t)=>t,we=()=>null,_e=()=>!0,ke=(e,t)=>e==t;function be(e,t){return ne(e/t)*t}function ve(e,t){return te(e/t)*t}function ye(e,t){return le(e*(t=10**t))/t}const Me=new Map;function Se(e){return((""+e).split(".")[1]||"").length}function Ee(e,t,l,n){let i=[],o=n.map(Se);for(let s=t;l>s;s++){let t=ee(s),l=ye(se(e,s),t);for(let e=0;n.length>e;e++){let r=n[e]*l,u=(0>r||0>s?t:0)+(o[e]>s?o[e]:0),a=ye(r,u);i.push(a),Me.set(a,u)}}return i}const De={},ze=[],Te=[null,null],Pe=Array.isArray;function Ae(e){return"string"==typeof e}function We(e){let t=!1;if(null!=e){let l=e.constructor;t=null==l||l==Object}return t}function Ye(e){return null!=e&&"object"==typeof e}function Ce(e,t=We){let l;if(Pe(e)){let n=e.find((e=>null!=e));if(Pe(n)||t(n)){l=Array(e.length);for(let n=0;e.length>n;n++)l[n]=Ce(e[n],t)}else l=e.slice()}else if(t(e)){l={};for(let n in e)l[n]=Ce(e[n],t)}else l=e;return l}functi
|