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

@visactor/vscale

Package Overview
Dependencies
Maintainers
15
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@visactor/vscale - npm Package Compare versions

Comparing version 0.11.1 to 0.11.2

5

cjs/utils/tick-sample.js

@@ -11,5 +11,6 @@ "use strict";

let reverse, n, ticks, step, i = -1;
if (stop = +stop, start = +start, count = +count, Math.abs(start - stop) <= Number.MIN_VALUE && count > 0) return [ start ];
if (count = +count, (start = +start) === (stop = +stop)) return [];
if (Math.abs(start - stop) <= Number.MIN_VALUE && count > 0) return [ start ];
if ((reverse = stop < start) && (n = start, start = stop, stop = n), step = tickIncrement(start, stop, count),
0 === stop || !isFinite(step)) return [];
!isFinite(step)) return [];
if (step > 0) {

@@ -16,0 +17,0 @@ let r0 = Math.round(start / step), r1 = Math.round(stop / step);

2

dist/index.min.js

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VScale={})}(this,(function(t){"use strict";!function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new i(r,o||t,s),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,s=new Array(o);i<o;i++)s[i]=r[i].fn;return s},a.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},a.prototype.emit=function(t,e,r,i,o,s){var a=n?n+t:t;if(!this._events[a])return!1;var u,h,l=this._events[a],c=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,o),!0;case 6:return l.fn.call(l.context,e,r,i,o,s),!0}for(h=1,u=new Array(c-1);h<c;h++)u[h-1]=arguments[h];l.fn.apply(l.context,u)}else{var f,g=l.length;for(h=0;h<g;h++)switch(l[h].once&&this.removeListener(t,l[h].fn,void 0,!0),c){case 1:l[h].fn.call(l[h].context);break;case 2:l[h].fn.call(l[h].context,e);break;case 3:l[h].fn.call(l[h].context,e,r);break;case 4:l[h].fn.call(l[h].context,e,r,i);break;default:if(!u)for(f=1,u=new Array(c-1);f<c;f++)u[f-1]=arguments[f];l[h].fn.apply(l[h].context,u)}}return!0},a.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},a.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},a.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||i&&!a.once||r&&a.context!==r||s(this,o);else{for(var u=0,h=[],l=a.length;u<l;u++)(a[u].fn!==e||i&&!a[u].once||r&&a[u].context!==r)&&h.push(a[u]);h.length?this._events[o]=1===h.length?h[0]:h:s(this,o)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&s(this,e)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a}({exports:{}});var e=function(t,e){return toString.call(t)==="[object ".concat(e,"]")},n=function(t){return null==t},r=function(t){return null!=t};function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(i=r.key,o=void 0,"symbol"==typeof(o=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"))?o:String(o)),r)}var i,o}function a(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var u=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=i(t);return n?"string"===r:"string"===r||e(t,"String")},h=function(t){return Array.isArray?Array.isArray(t):e(t,"Array")},l=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=i(t);return n?"number"===r:"number"===r||e(t,"Number")},c=function(t){return l(t)&&Number.isFinite(t)};function f(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function g(t){return Number(t)}function d(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:g,r=t.length;if(r){if(e<=0||r<2)return n(t[0],0,t);if(e>=1)return n(t[r-1],r-1,t);var i=(r-1)*e,o=Math.floor(i),s=n(t[o],o,t);return s+(n(t[o+1],o+1,t)-s)*(i-o)}}function m(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;for(n(i)&&(i=t.length);r<i;){var o=r+i>>>1;f(t[o],e)>0?i=o:r=o+1}return r}var _=Math.sqrt(50),p=Math.sqrt(10),v=Math.sqrt(2);function w(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=_?i*=10:o>=p?i*=5:o>=v&&(i*=2),e<t?-i:i}var y=1e-10,M=1e-10;function b(t,e){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:y,r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:M)*Math.max(t,e);return Math.abs(t-e)<=Math.max(n,r)}function k(t,e,n,r){return t>e&&!b(t,e,n,r)}function x(t,e,n,r){return t<e&&!b(t,e,n,r)}var S=function(t){for(var e="",n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)-1;n>=0;)e="".concat(e).concat(t),n-=1;return e},T=function(t,e){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"right",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:" ",i=t+"",o=e-i.length;return o<=0?i:"left"===n?S(r,o)+i:"center"===n?S(r,Math.floor(o/2))+i+S(r,Math.ceil(o/2)):i+S(r,o)};function C(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}try{"function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame}catch(t){!1}function N(t,e){return function(n){return t*(1-n)+e*n}}function U(t,e){return function(n){return Math.round(t*(1-n)+e*n)}}var E=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function F(t){if(t instanceof Date)return t;if(u(t)){var e=E.exec(t);if(!e)return new Date(NaN);if(!e[8])return new Date(+e[1],+(e[2]||1)-1,+e[3]||1,+e[4]||0,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0);var r=+e[4]||0;return"Z"!==e[8].toUpperCase()&&(r-=+e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,r,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0))}return n(t)?new Date(NaN):new Date(Math.round(t))}function A(t,e,n){e/=100,n/=100;var r=(1-Math.abs(2*n-1))*e,i=r*(1-Math.abs(t/60%2-1)),o=n-r/2,s=0,a=0,u=0;return 0<=t&&t<60?(s=r,a=i,u=0):60<=t&&t<120?(s=i,a=r,u=0):120<=t&&t<180?(s=0,a=r,u=i):180<=t&&t<240?(s=0,a=i,u=r):240<=t&&t<300?(s=i,a=0,u=r):300<=t&&t<360&&(s=r,a=0,u=i),{r:s=Math.round(255*(s+o)),g:a=Math.round(255*(a+o)),b:u=Math.round(255*(u+o))}}function D(t,e,n){t/=255,e/=255,n/=255;var r=Math.min(t,e,n),i=Math.max(t,e,n),o=i-r,s=0,a=0;return s=0===o?0:i===t?(e-n)/o%6:i===e?(n-t)/o+2:(t-e)/o+4,(s=Math.round(60*s))<0&&(s+=360),a=(i+r)/2,{h:s,s:+(100*(0===o?0:o/(1-Math.abs(2*a-1)))).toFixed(1),l:a=+(100*a).toFixed(1)}}var O=/^#([0-9a-f]{3,8})$/,H={transparent:4294967040},R={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function L(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Y(t){return l(t)?new q(t>>16,t>>8&255,255&t,1):h(t)?new q(t[0],t[1],t[2]):new q(255,255,255)}var I=function(){function t(e){o(this,t);var n=t.parseColorString(e);n?this.color=n:(console.warn("Warn: 传入".concat(e,"无法解析为Color")),this.color=new q(255,255,255))}return a(t,[{key:"toRGBA",value:function(){return this.color.formatRgb()}},{key:"toString",value:function(){return this.color.formatRgb()}},{key:"toHex",value:function(){return this.color.formatHex()}},{key:"toHsl",value:function(){return this.color.formatHsl()}},{key:"setOpacity",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}},{key:"brighter",value:function(t){var e=this.color,n=e.r,r=e.g,i=e.b;return this.color.r=Math.max(0,Math.min(255,Math.floor(n*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(r*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(i*t))),this}},{key:"getHSVBrightness",value:function(){return Math.max(this.color.r,this.color.g,this.color.b)/255}},{key:"getHSLBrightness",value:function(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}},{key:"setHsl",value:function(t,e,r){var i,o,s,a=this.color.opacity,u=D(this.color.r,this.color.g,this.color.b),h=A(n(t)?u.h:(s=360,(i=t)<(o=0)?o:i>s?s:i),n(e)?u.s:e>=0&&e<=1?100*e:e,n(r)?u.l:r<=1&&r>=0?100*r:r);return this.color=new q(h.r,h.g,h.b,a),this}},{key:"getLuminance",value:function(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}},{key:"getLuminance2",value:function(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}},{key:"getLuminance3",value:function(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}}],[{key:"Brighter",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===n?e:new t(e).brighter(n).toRGBA()}},{key:"SetOpacity",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===n?e:new t(e).setOpacity(n).toRGBA()}},{key:"getColorBrightness",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl",r=e instanceof t?e:new t(e);switch(n){case"hsv":default:return r.getHSVBrightness();case"hsl":return r.getHSLBrightness();case"lum":return r.getLuminance();case"lum2":return r.getLuminance2();case"lum3":return r.getLuminance3()}}},{key:"parseColorString",value:function(t){if(r(H[t]))return function(t){return l(t)?new q(t>>>24,t>>>16&255,t>>>8&255,255&t):h(t)?new q(t[0],t[1],t[2],t[3]):new q(255,255,255,1)}(H[t]);if(r(R[t]))return Y(R[t]);var e="".concat(t).trim().toLowerCase(),n=O.exec(e);if(n){var i=parseInt(n[1],16),o=n[1].length;return 3===o?new q((i>>8&15)+((i>>8&15)<<4),(i>>4&15)+((i>>4&15)<<4),(15&i)+((15&i)<<4),1):6===o?Y(i):8===o?new q(i>>24&255,i>>16&255,i>>8&255,(255&i)/255):void 0}if(/^(rgb|RGB|rgba|RGBA)/.test(e)){var s=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new q(parseInt(s[0],10),parseInt(s[1],10),parseInt(s[2],10),parseFloat(s[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){var a=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),u=A(parseInt(a[0],10),parseInt(a[1],10),parseInt(a[2],10));return new q(u.r,u.g,u.b,parseFloat(a[3]))}}}]),t}(),q=function(){function t(e,n,i,s){o(this,t),this.r=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.g=isNaN(+n)?255:Math.max(0,Math.min(255,+n)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),r(s)?this.opacity=isNaN(+s)?1:Math.max(0,Math.min(1,+s)):this.opacity=1}return a(t,[{key:"formatHex",value:function(){return"#".concat(L(this.r)+L(this.g)+L(this.b)+(1===this.opacity?"":L(255*this.opacity)))}},{key:"formatRgb",value:function(){var t=this.opacity;return"".concat(1===t?"rgb(":"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b).concat(1===t?")":",".concat(t,")"))}},{key:"formatHsl",value:function(){var t=this.opacity,e=D(this.r,this.g,this.b),n=e.h,r=e.s,i=e.l;return"".concat(1===t?"hsl(":"hsla(").concat(n,",").concat(r,"%,").concat(i,"%").concat(1===t?")":",".concat(t,")"))}},{key:"toString",value:function(){return this.formatHex()}}]),t}();var B,P=Object.freeze({__proto__:null,Color:I,DEFAULT_COLORS:R,RGB:q,hexToRgb:function(t){for(var e="",n="",r="",i="#"===t[0]?1:0,o=i;o<t.length;o++)"#"!==t[o]&&(o<i+2?e+=t[o]:o<i+4?n+=t[o]:o<i+6&&(r+=t[o]));return[parseInt(e,16),parseInt(n,16),parseInt(r,16)]},hslToRgb:A,interpolateRgb:function(t,e){var n=t.r,r=e.r,i=t.g,o=e.g,s=t.b,a=e.b,u=t.opacity,h=e.opacity;return function(t){var e=Math.round(n*(1-t)+r*t),l=Math.round(i*(1-t)+o*t),c=Math.round(s*(1-t)+a*t);return new q(e,l,c,u*(1-t)+h*t)}},rgbToHex:function(t,e,n){return Number((1<<24)+(t<<16)+(e<<8)+n).toString(16).slice(1)},rgbToHsl:D});function j(t){return t?"getUTCFullYear":"getFullYear"}function V(t){return t?"getUTCMonth":"getMonth"}function z(t){return t?"getUTCDate":"getDate"}function Q(t){return t?"getUTCHours":"getHours"}function G(t){return t?"getUTCMinutes":"getMinutes"}function X(t){return t?"getUTCSeconds":"getSeconds"}function $(t){return t?"getUTCMilliseconds":"getMilliseconds"}function Z(t){return t?"setUTCFullYear":"setFullYear"}function W(t,e){return function(n){var r=F(n),i=r[j(e)](),o=r[V(e)]()+1,s=Math.floor((o-1)/3)+1,a=r[z(e)](),u=r["get"+(e?"UTC":"")+"Day"](),h=r[Q(e)](),l=(h-1)%12+1,c=r[G(e)](),f=r[X(e)](),g=r[$(e)]();return(t||"").replace(/YYYY/g,T(i+"",4,"0","left")).replace(/yyyy/g,i+"").replace(/yy/g,i%100+"").replace(/Q/g,s+"").replace(/MM/g,T(o,2,"0","left")).replace(/M/g,o+"").replace(/dd/g,T(a,2,"0","left")).replace(/d/g,a+"").replace(/e/g,u+"").replace(/HH/g,T(h,2,"0","left")).replace(/H/g,h+"").replace(/hh/g,T(l+"",2,"0","left")).replace(/h/g,l+"").replace(/mm/g,T(c,2,"0","left")).replace(/m/g,c+"").replace(/ss/g,T(f,2,"0","left")).replace(/s/g,f+"").replace(/SSS/g,T(g,3,"0","left")).replace(/S/g,g+"")}}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(B||(B={}));var J,K=1e3,tt=6e4,et=36e5,nt=24*et,rt=31*nt,it=365*nt,ot=function(t){return t.setMonth(0,1),t.setHours(0,0,0,0),t},st=function(t,e){return t.setFullYear(t.getFullYear()+e),t},at=function(t,e){return e.getFullYear()-t.getFullYear()},ut=function(t){return t.getFullYear()},ht=function(t){return t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0),t},lt=function(t,e){return t.setUTCFullYear(t.getUTCFullYear()+e),t},ct=function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()},ft=function(t){return t.getUTCFullYear()},gt=function(t){return t.setDate(1),t.setHours(0,0,0,0),t},dt=function(t,e){return t.setMonth(t.getMonth()+e),t},mt=function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())},_t=function(t){return t.getMonth()},pt=function(t){return t.setUTCDate(1),t.setUTCHours(0,0,0,0),t},vt=function(t,e){return t.setUTCMonth(t.getUTCMonth()+e),t},wt=function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())},yt=function(t){return t.getUTCMonth()},Mt=function(t){return t.setHours(0,0,0,0),t},bt=function(t,e){return t.setDate(t.getDate()+e),t},kt=function(t,e){return(+e-+t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/nt},xt=function(t){return t.getDate()-1},St=function(t){return t.setUTCHours(0,0,0,0),t},Tt=function(t,e){return t.setUTCDate(t.getUTCDate()+e),t},Ct=function(t,e){return(+e-+t)/nt},Nt=function(t){return t.getUTCDate()-1},Ut=function(t){return t.setTime(+t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes()),t},Et=function(t,e){return t.setHours(t.getHours()+e),t},Ft=function(t,e){return(+e-+t)/et},At=function(t){return t.getHours()},Dt=function(t){return t.setTime(+t-t.getUTCMilliseconds()-1e3*t.getUTCSeconds()-6e4*t.getUTCMinutes()),t},Ot=function(t,e){return t.setUTCHours(t.getUTCHours()+e),t},Ht=function(t){return t.getUTCHours()},Rt=function(t){return t.setTime(+t-t.getMilliseconds()-1e3*t.getSeconds()),t},Lt=function(t,e){return t.setMinutes(t.getMinutes()+e),t},Yt=function(t,e){return(+e-+t)/6e4},It=function(t){return t.getMinutes()},qt=function(t){return t.setTime(+t-t.getUTCMilliseconds()-1e3*t.getUTCSeconds()),t},Bt=function(t,e){return t.setUTCMinutes(t.getUTCMinutes()+e),t},Pt=function(t){return t.getUTCMinutes()},jt=function(t){return t.setTime(+t-t.getMilliseconds()),t},Vt=function(t,e){return t.setSeconds(t.getSeconds()+e),t},zt=function(t,e){return(+e-+t)/1e3},Qt=function(t){return t.getSeconds()},Gt=function(t){return t.setTime(+t-t.getUTCMilliseconds()),t},Xt=function(t,e){return t.setUTCSeconds(t.getUTCSeconds()+e),t},$t=function(t){return t.getUTCSeconds()},Zt=function(t){return t},Wt=function(t,e){return t.setTime(+t+e),t},Jt=function(t,e){return+e-+t},Kt=function(t,e){return function(n){var r=new Date(+n-1);return e(r,1),t(r),r}},te=function(t,e){var n=e.floor,r=e.offset,i=e.field,o=e.count,s=Math.floor(t);if(!Number.isFinite(s)||s<=0)return null;if(s<=1)return{floor:n,offset:r,ceil:Kt(n,r)};var a=function(t,e){return function(n,r){var i=new Date,o=new Date;return i.setTime(+n),o.setTime(+r),t(i),t(o),Math.floor(e(i,o))}}(n,o),u=i?function(t){return i(t)%s==0}:function(t){return a(0,t)%s==0},h=function(t){if(!Number.isNaN(+t))for(n(t);!u(t);)t.setTime(+t-1),n(t);return t},l=function(t,e){if(!Number.isNaN(+t))if(s<0)for(;++e<=0;)for(r(t,-1);!u(t);)r(t,-1);else for(;--e>=0;)for(r(t,1);!u(t);)r(t,1);return t};return{floor:h,offset:l,ceil:Kt(h,l)}};t.ScaleEnum=void 0,(J=t.ScaleEnum||(t.ScaleEnum={})).Linear="linear",J.Log="log",J.Pow="pow",J.Sqrt="sqrt",J.Symlog="symlog",J.Time="time",J.Quantile="quantile",J.Quantize="quantize",J.Threshold="threshold",J.Ordinal="ordinal",J.Point="point",J.Band="band";class ee{_wholeRange;_rangeFactor;_unknown;_calculateRange(t){if(this._wholeRange)return this._wholeRange;if(this._rangeFactor&&2===t.length){const e=(t[1]-t[0])/(this._rangeFactor[1]-this._rangeFactor[0]),n=t[0]-e*this._rangeFactor[0],r=n,i=e+n;return this._wholeRange=[r,i],this._wholeRange}return t}calculateVisibleDomain(t){if(this._rangeFactor&&2===t.length){return[this.invert(t[0]),this.invert(t[1])]}return this.domain()}rangeFactor(t,e){return t?(2===t.length&&t.every((t=>t>=0&&t<=1))&&(this._wholeRange=null,this._rangeFactor=t),this):this._rangeFactor}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}}const ne=Symbol("implicit");class re extends ee{type=t.ScaleEnum.Ordinal;_index;_domain;_ordinalRange;constructor(){super(),this._index=new Map,this._domain=[],this._ordinalRange=[],this._unknown=ne}clone(){return(new re).domain(this._domain).range(this._ordinalRange).unknown(this._unknown)}scale(t){const e=`${t}`;let n=this._index.get(e);if(!n){if(this._unknown!==ne)return this._unknown;n=this._domain.push(t),this._index.set(e,n)}return this._ordinalRange[(n-1)%this._ordinalRange.length]}invert(t){let e=0;for(;e<this._ordinalRange.length&&this._ordinalRange[e]!==t;)e++;return this._domain[(e-1)%this._domain.length]}domain(t){if(!t)return this._domain.slice();this._domain=[],this._index=new Map;for(const e of t){const t=`${e}`;this._index.has(t)||this._index.set(t,this._domain.push(e))}return this}range(t){if(!t)return this._ordinalRange.slice();const e=Array.from(t);return this._ordinalRange=e,this}}function ie(t){return t}const oe=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t),se=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),ae=t=>t<0?-t*t:t*t,ue=t=>-Math.log(-t),he=t=>-Math.exp(-t),le=t=>isFinite(t)?Math.pow(10,t):t<0?0:t,ce=t=>10===t?le:t===Math.E?Math.exp:e=>Math.pow(t,e),fe=t=>t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:(t=Math.log(t),e=>Math.log(e)/t),ge=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),de=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t;function me(t,e){if(t=Number(t),e=Number(e),e-=t)return n=>(n-t)/e;const n=Number.isNaN(e)?NaN:.5;return()=>n}function _e(t,e,n){const r=t[0],i=t[1],o=e[0],s=e[1];let a,u;return i<r?(a=me(i,r),u=n(s,o)):(a=me(r,i),u=n(o,s)),t=>u(a(t))}function pe(t,e,n){const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r);let s=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<r;)i[s]=me(t[s],t[s+1]),o[s]=n(e[s],e[s+1]);return function(e){const n=m(t,e,1,r)-1;return o[n](i[n](e))}}const ve=(t,e)=>{const n=t.slice();let r=0,i=n.length-1,o=n[r],s=n[i];return s<o&&([r,i]=[i,r],[o,s]=[s,o]),n[r]=e.floor(o),n[i]=e.ceil(s),n};function we(t,e,n,r){let i;const o=[];let s;if(e=Math.floor(+e),t=Math.floor(+t),!(n=Math.floor(+n)))return[];if(t===e)return[t];if(i=e<t){const n=t;t=e,e=n}let a=C(1,e-t+1)(n);if(s=Math.floor((e-t+1)/a),!r)for(;Math.ceil((e-t+1)/s)>n&&a>1;)a-=1,s=Math.floor((e-t)/a);let u=t;for(;u<=e;)o.push(u),u+=s;return i&&o.reverse(),o}class ye extends re{type=t.ScaleEnum.Band;_step;_bandwidth;_round;_paddingInner;_paddingOuter;_align;_range;constructor(t){super(),this._range=[0,1],this._step=void 0,this._bandwidth=void 0,this._round=!1,this._paddingInner=0,this._paddingOuter=0,this._align=.5,this._unknown=void 0,delete this.unknown,this.rescale(t)}rescale(t){if(t)return this;this._wholeRange=null;const e=this._calculateRange(this._range),n=super.domain().length,i=e[1]<e[0];let o=e[Number(i)-0];const s=e[1-Number(i)],a=function(t,e,n){let r;return r=1===t?t+2*n:t-e+2*n,t?r>0?r:1:0}(n,this._paddingInner,this._paddingOuter);this._step=(s-o)/Math.max(1,a||1),this._round&&(this._step=Math.floor(this._step)),o+=(s-o-this._step*(n-this._paddingInner))*this._align,this._bandwidth=this._step*(1-this._paddingInner),this._round&&(o=Math.round(o),this._bandwidth=Math.round(this._bandwidth));const u=function(t,e,n){r(e)||(e=t,t=0),r(n)||(n=1);for(var i=-1,o=0|Math.max(0,Math.ceil((e-t)/n)),s=new Array(o);++i<o;)s[i]=t+i*n;return s}(n).map((t=>o+this._step*t));return super.range(i?u.reverse():u),this}calculateVisibleDomain(t){const e=this.domain();if(this._rangeFactor&&e.length){const n=this._getInvertIndex(t[0]),r=this._getInvertIndex(t[1]);return e.slice(Math.min(n,r),Math.max(n,r)+1)}return e}domain(t,e){return t?(super.domain(t),this.rescale(e)):super.domain()}range(t,e){return t?(this._range=[g(t[0]),g(t[1])],this.rescale(e)):this._range.slice()}rangeRound(t,e){return this._range=[g(t[0]),g(t[1])],this._round=!0,this.rescale(e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);if(-1===t)return e;return we(0,e.length-1,t,!1).map((t=>e[t]))}tickData(t=10){return this.ticks(t).map(((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0]+this._bandwidth/2)/(this._range[1]-this._range[0])})))}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return we(0,e.length-1,t,!0).filter((t=>t<e.length)).map((t=>e[t]))}stepTicks(t){const e=this.calculateVisibleDomain(this._range),n=function(t,e,n){const r=[];let i;if(n=C(1,(e=Math.floor(+e))-(t=Math.floor(+t))+1)(Math.floor(+n)),i=e<t){const n=t;t=e,e=n}let o=t;for(;o<=e;)r.push(o),o+=n;return i&&r.reverse(),r}(0,e.length-1,t);return n.map((t=>e[t]))}_getInvertIndex(t){let e=0;const n=this.step()/2,r=this.bandwidth()/2,i=this._domain.length,o=this.range(),s=o[0]>o[o.length-1];for(e=0;e<i;e++){const o=this.scale(this._domain[e])+r;if(0===e&&(!s&&!k(t,o+n)||s&&!x(t,o-n)))break;if(e===i-1)break;if(!x(t,o-n)&&!k(t,o+n))break}return e>=0&&e<=i-1?e:i-1}invert(t){return this._domain[this._getInvertIndex(t)]}padding(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(Array.isArray(t)?Math.min.apply(null,t):t)),this._paddingInner=this._paddingOuter,this.rescale(e)):this._paddingInner}paddingInner(t,e){return void 0!==t?(this._paddingInner=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingInner}paddingOuter(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingOuter}bandwidth(){return this._bandwidth}step(){return this._step}round(t,e){return void 0!==t?(this._round=t,this.rescale(e)):this._round}align(t,e){return void 0!==t?(this._align=Math.max(0,Math.min(1,t)),this.rescale(e)):this._align}rangeFactor(t,e){return t?(super.rangeFactor(t),this.rescale(e)):super.rangeFactor()}clone(){return new ye(!0).domain(this._domain,!0).range(this._range,!0).round(this._round,!0).paddingInner(this._paddingInner,!0).paddingOuter(this._paddingOuter,!0).align(this._align)}}const{interpolateRgb:Me}=P;function be(t,e){const r=typeof e;let i;if(n(e)||"boolean"===r)return()=>e;if("number"===r)return N(t,e);if("string"===r){if(i=I.parseColorString(e)){const e=Me(I.parseColorString(t),i);return t=>e(t).formatRgb()}return N(Number(t),Number(e))}return e instanceof q?Me(t,e):e instanceof I?Me(t.color,e.color):e instanceof Date?function(t,e){var n=t.valueOf(),r=e.valueOf(),i=new Date;return function(t){return i.setTime(n*(1-t)+r*t),i}}(t,e):N(Number(t),Number(e))}class ke extends ee{type;transformer;untransformer;_domain;_range;_unknown=void 0;_forceAlign;_output;_input;_interpolate;_piecewise;_clamp;constructor(t=ie,e=ie){super(),this.transformer=t,this.untransformer=e,this._forceAlign=!0,this._domain=[0,1],this._range=[0,1],this._clamp=ie,this._piecewise=_e,this._interpolate=be}scale(t){return t=Number(t),Number.isNaN(t)?this._unknown:(this._output||(this._output=this._piecewise(this._domain.map(this.transformer),this._calculateRange(this._range),this._interpolate)),this._output(this.transformer(this._clamp(t))))}invert(t){return this._input||(this._input=this._piecewise(this._calculateRange(this._range),this._domain.map(this.transformer),N)),this._clamp(this.untransformer(this._input(t)))}domain(t,e){if(!t)return this._domain.slice();const n=Array.from(t,g);return this._domain=n,this.rescale(e)}range(t,e){if(!t)return this._range.slice();const n=Array.from(t);return this._range=n,this.rescale(e)}rangeRound(t,e){const n=Array.from(t);return this._range=n,this._interpolate=U,this.rescale(e)}rescale(t){if(t)return this;const e=this._domain.length,n=this._range.length;let r=Math.min(e,n);if(e&&e<n&&this._forceAlign){const t=n-e+1,i=this._domain[e-1],o=e>=2?(i-this._domain[e-2])/t:0;for(let n=1;n<=t;n++)this._domain[e-2+n]=i-o*(t-n);r=n}return void 0===this._clamp&&(this._clamp=C(this._domain[0],this._domain[r-1])),this._piecewise=r>2?pe:_e,this._output=this._input=null,this._wholeRange=null,this}clamp(t,e,n){return arguments.length?(this._clamp=e||(t?void 0:ie),this.rescale(n)):this._clamp!==ie}interpolate(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}ticks(t=10){return[]}tickData(t=10){return(this.ticks(t)??[]).map(((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0])/(this._range[1]-this._range[0])})))}rangeFactor(t,e){return t?(super.rangeFactor(t),this._output=this._input=null,this):super.rangeFactor()}forceAlignDomainRange(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}const xe=Math.sqrt(50),Se=Math.sqrt(10),Te=Math.sqrt(2);function Ce(t,e,n){let r,i,o,s,a=-1;if(e=+e,t=+t,n=+n,Math.abs(t-e)<=Number.MIN_VALUE&&n>0)return[t];if((r=e<t)&&(i=t,t=e,e=i),s=Ne(t,e,n),0===e||!isFinite(s))return[];if(s>0){let n=Math.round(t/s),r=Math.round(e/s);for(n*s<t&&++n,r*s>e&&--r,o=new Array(i=r-n+1);++a<i;)o[a]=(n+a)*s}else{s=-s;let n=Math.round(t*s),r=Math.round(e*s);for(n/s<t&&++n,r/s>e&&--r,o=new Array(i=r-n+1);++a<i;)o[a]=(n+a)/s}return r&&o.reverse(),o}function Ne(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/10**i;let s=1;return o>=xe?s=10:o>=Se?s=5:o>=Te&&(s=2),i>=0?s*10**i:-(10**-i)/s}function Ue(t,e,n){let r;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if(n<=0||0===(r=function(t,e,n){const r=(e-t)/Math.max(1,n-1);return r}(t,e,n))||!isFinite(r))return[];const i=new Array(n);for(let e=0;e<n;e++)i[e]=t+e*r;return i}function Ee(t,e,n){let r,i,o=-1;if(n=+n,(i=(e=+e)<(t=+t))&&(r=t,t=e,e=r),!isFinite(n)||e-t<=n)return[t];const s=Math.floor((e-t)/n+1),a=new Array(s);for(;++o<s;)a[o]=t+o*n;return i&&a.reverse(),a}function Fe(t,e=10){let n,r,i=0,o=t.length-1,s=t[i],a=t[o],u=10;for(a<s&&(r=s,s=a,a=r,r=i,i=o,o=r);u-- >0;){if(r=Ne(s,a,e),r===n)return t[i]=s,t[o]=a,t;if(r>0)s=Math.floor(s/r)*r,a=Math.ceil(a/r)*r;else{if(!(r<0))break;s=Math.ceil(s*r)/r,a=Math.floor(a*r)/r}n=r}}class Ae extends ke{type=t.ScaleEnum.Linear;clone(){return(new Ae).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}tickFormat(){return()=>{}}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return Ce(e[0],e[e.length-1],t)}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Ue(e[0],e[e.length-1],t)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return Ee(e[0],e[e.length-1],t)}nice(t=10){const e=Fe(this.domain(),t);return e?this.domain(e):this}niceMin(t=10){const e=this._domain[this._domain.length-1],n=Fe(this.domain(),t);return n&&(n[n.length-1]=e,this.domain(n)),this}niceMax(t=10){const e=this._domain[0],n=Fe(this.domain(),t);return n&&(n[0]=e,this.domain(n)),this}}function De(t){return e=>-t(-e)}class Oe extends ke{type=t.ScaleEnum.Log;_base;_logs;_pows;constructor(){super(fe(10),ce(10)),this._logs=this.transformer,this._pows=this.untransformer,this._domain=[1,10],this._base=10}clone(){return(new Oe).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).base(this._base)}rescale(t){if(t)return this;super.rescale();const e=fe(this._base),n=ce(this._base);return this._domain[0]<0?(this._logs=De(e),this._pows=De(n),this.transformer=ue,this.untransformer=he):(this._logs=e,this._pows=n,this.transformer=e,this.untransformer=n),this}base(t,e){return arguments.length?(this._base=t,this.rescale(e)):this._base}tickFormat(){return ie}ticks(t=10){const e=this.domain();let n=e[0],r=e[e.length-1];const i=r<n;i&&([n,r]=[r,n]);let o,s,a=this._logs(n),u=this._logs(r),h=[];if(!(this._base%1)&&u-a<t){if(a=Math.floor(a),u=Math.ceil(u),n>0){for(;a<=u;++a)for(o=1;o<this._base;++o)if(s=a<0?o/this._pows(-a):o*this._pows(a),!(s<n)){if(s>r)break;h.push(s)}}else for(;a<=u;++a)for(o=this._base-1;o>=1;--o)if(s=a>0?o/this._pows(-a):o*this._pows(a),!(s<n)){if(s>r)break;h.push(s)}2*h.length<t&&(h=Ce(n,r,t))}else h=Ce(a,u,Math.min(u-a,t)).map(this._pows);return i?h.reverse():h}nice(){return this.domain(ve(this.domain(),{floor:t=>this._pows(Math.floor(this._logs(t))),ceil:t=>this._pows(Math.ceil(this._logs(t)))}))}}class He extends Ae{type=t.ScaleEnum.Pow;_exponent;constructor(){super(),this._exponent=1}clone(){return(new He).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).exponent(this._exponent)}rescale(t){return t||(1===this._exponent?(this.transformer=ie,this.untransformer=ie):.5===this._exponent?(this.transformer=se,this.untransformer=ae):(this.transformer=oe(this._exponent),this.untransformer=oe(1/this._exponent)),super.rescale()),this}exponent(t,e){return arguments.length?(this._exponent=t,this.rescale(e)):this._exponent}}function Re(t,e){return t.length===e.length&&t.every(((t,n)=>t===e[n]))}class Le{type=t.ScaleEnum.Quantile;_range=[];_domain=[];_thresholds=[];_unknown;unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}rescale(t){if(t)return this;let e=0;const n=Math.max(1,this._range.length);for(this._thresholds=new Array(n-1);++e<n;)this._thresholds[e-1]=d(this._domain,e/n);return this}scale(t){return c(t)?this._range[m(this._thresholds,t)]:this._unknown}invertExtent(t){const e=this._range.indexOf(t);return e<0?[NaN,NaN]:[e>0?this._thresholds[e-1]:this._domain[0],e<this._thresholds.length?this._thresholds[e]:this._domain[this._domain.length-1]]}quantiles(){return this._thresholds.slice()}domain(t,e){if(!t)return this._domain.slice();this._domain=[];for(const e of t)n(e)||Number.isNaN(+e)||this._domain.push(+e);return this._domain.sort(f),this.rescale(e)}range(t,e){if(!t)return this._range.slice();const n=Array.from(t);return Re(this._range,n)?this:(this._range=n,this.rescale(e))}clone(){return(new Le).domain(this._domain,!0).range(this._range).unknown(this._unknown)}}class Ye{type=t.ScaleEnum.Quantile;_range=[0,1];_domain=[.5];x0=0;x1=1;n=1;_unknown;unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}rescale(t){if(t)return this;let e=-1;for(this._domain=new Array(this.n);++e<this.n;)this._domain[e]=((e+1)*this.x1-(e-this.n)*this.x0)/(this.n+1);return this}scale(t){return c(t)?this._range[m(this._domain,t,0,this.n)]:this._unknown}invertExtent(t){const e=this._range.indexOf(t);return e<0?[NaN,NaN]:e<1?[this.x0,this._domain[0]]:e>=this.n?[this._domain[this.n-1],this.x1]:[this._domain[e-1],this._domain[e]]}thresholds(){return this._domain.slice()}domain(t,e){if(!t)return[this.x0,this.x1];const n=Array.from(t);return this.x0=+n[0],this.x1=+n[1],this.rescale(e)}range(t,e){if(!t)return this._range.slice();const n=Array.from(t);return Re(this._range,n)?this:(this.n=n.length-1,this._range=n,this.rescale(e))}clone(){return(new Ye).domain([this.x0,this.x1],!0).range(this._range).unknown(this._unknown)}ticks(t=10){const e=this.domain();return Ce(e[0],e[e.length-1],t)}forceTicks(t=10){const e=this.domain();return Ue(e[0],e[e.length-1],t)}stepTicks(t){const e=this.domain();return Ee(e[0],e[e.length-1],t)}nice(t=10){const e=Fe(this.domain(),t);return e?this.domain(e):this}niceMin(t=10){const e=this._domain[this._domain.length-1],n=Fe(this.domain(),t);return n&&(n[n.length-1]=e,this.domain(n)),this}niceMax(t=10){const e=this._domain[0],n=Fe(this.domain(),t);return n&&(n[0]=e,this.domain(n)),this}}class Ie extends Ae{type=t.ScaleEnum.Sqrt;constructor(){super(se,ae)}clone(){return(new Ie).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}}class qe extends Ae{type=t.ScaleEnum.Symlog;_const;constructor(){super(ge(1),de(1)),this._const=1}clone(){return(new qe).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).constant(this._const)}constant(t,e){return arguments.length?(this._const=t,this.transformer=ge(t),this.untransformer=de(t),this.rescale(e)):this._const}}class Be{type=t.ScaleEnum.Threshold;_range=[0,1];_domain=[.5];n=1;_unknown;unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}scale(t){return!n(t)&&c(+t)?this._range[m(this._domain,t,0,this.n)]:this._unknown}invertExtent(t){const e=this._range.indexOf(t);return[this._domain[e-1],this._domain[e]]}domain(t){return t?(this._domain=Array.from(t),this.n=Math.min(this._domain.length,this._range.length-1),this):this._domain.slice()}range(t){return t?(this._range=Array.from(t),this.n=Math.min(this._domain.length,this._range.length-1),this):this._range.slice()}clone(){return(new Be).domain(this._domain).range(this._range).unknown(this._unknown)}}const Pe=[["second",1,K],["second",5,5e3],["second",10,1e4],["second",30,3e4],["minute",1,tt],["minute",5,3e5],["minute",10,6e5],["minute",30,18e5],["hour",1,et],["hour",3,3*et],["hour",6,6*et],["hour",12,12*et],["day",1,nt],["day",2,2*nt],["day",7,7*nt],["month",1,rt],["month",3,3*rt],["month",6,6*rt],["year",1,365*nt]];function je(t){return+F(t)}function Ve(t,e,n,r){const i=(+e-+t)/n,o=m(Pe.map((t=>t[2])),i);if(o===Pe.length){const i=Math.max(w(+t/it,+e/it,n),1),o=t=>(t[Z(r)](Math.floor(t[j(r)]()/i)*i),t[function(t){return t?"setUTCMonth":"setMonth"}(r)](0,1),t[function(t){return t?"setUTCHours":"setHours"}(r)](0,0,0,0),t),s=(t,e)=>(t[Z(r)](t[j(r)]()+e*i),t);return{floor:o,offset:s,ceil:Kt(o,s)}}if(0===o){const r=Math.max(w(+t,+e,n),1),i=t=>(t.setTime(Math.floor(+t/r)*r),t),o=(t,e)=>(t.setTime(+t+e*r),t);return{floor:i,offset:o,ceil:Kt(i,o)}}const[s,a]=Pe[i/Pe[o-1][2]<Pe[o][2]/i?o-1:o],u=function(t,e){return"year"===t&&e?{floor:ht,offset:lt,count:ct,field:ft}:"month"===t&&e?{floor:pt,offset:vt,count:wt,field:yt}:"day"===t&&e?{floor:St,offset:Tt,count:Ct,field:Nt}:"hour"===t&&e?{floor:Dt,offset:Ot,count:Ft,field:Ht}:"minute"===t&&e?{floor:qt,offset:Bt,count:Yt,field:Pt}:"second"===t&&e?{floor:Gt,offset:Xt,count:zt,field:$t}:"year"===t?{floor:ot,offset:st,count:at,field:ut}:"month"===t?{floor:gt,offset:dt,count:mt,field:_t}:"day"===t?{floor:Mt,offset:bt,count:kt,field:xt}:"hour"===t?{floor:Ut,offset:Et,count:Ft,field:At}:"minute"===t?{floor:Rt,offset:Lt,count:Yt,field:It}:"second"===t?{floor:jt,offset:Vt,count:zt,field:Qt}:{floor:Zt,offset:Wt,count:Jt}}(s,r);return te(a,u)}class ze extends ke{type=t.ScaleEnum.Time;_isUtc;constructor(t=!1){super(),this._domain=t?[Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]:[+new Date(2e3,0,1),+new Date(2e3,0,2)],this._isUtc=t}invert(t){return new Date(super.invert(t))}domain(t,e){if(!t)return this._domain.map(F);const n=Array.from(t,je);return this._domain=n,this.rescale(e)}ticks(t){const e=this.domain();let r=e[0],i=e[e.length-1];const o=i<r;o&&([r,i]=[i,r]);let s=t;(l(t)||n(t))&&(s=Ve(r,i,n(t)?10:t,this._isUtc)),r=s.ceil(r);const a=[];let u=+r,h=0;for(;u<=+i&&h<100;)a.push(new Date(u)),u=+s.offset(new Date(u),1),h++;return o?a.reverse():a}tickFormat(t,e){return W(null==e?(n=this._domain[0],r=this._isUtc,i=F(n),o=i[V(r)]()+1,s=i[z(r)](),a=i[Q(r)](),u=i[G(r)](),h=i[X(r)](),l=0===i[$(r)](),(d=(g=(f=(c=l&&0===h)&&0===u)&&0===a)&&1===s)&&1===o?"YYYY":d?"YYYY-MM":g?"YYYY-MM-DD":f?"HH":c?"HH:mm":l?"HH:mm:ss":"HH:mm:ss SSS"):e,this._isUtc);var n,r,i,o,s,a,u,h,l,c,f,g,d}clone(){return new ze(this._isUtc).domain(this.domain(),!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}nice(t){const e=this.domain();let r=t;return(l(t)||n(t))&&(r=Ve(e[0],e[e.length-1],n(t)?10:t,this._isUtc)),r&&this.domain(ve(e,r)),this}utc(){return this._isUtc}}t.BandScale=ye,t.ContinuousScale=ke,t.LinearScale=Ae,t.LogScale=Oe,t.OrdinalScale=re,t.PointScale=class extends ye{type=t.ScaleEnum.Point;_padding=0;constructor(t){super(!1),this.paddingInner(1,t),this.padding=this.paddingOuter,this.paddingInner=void 0,this.paddingOuter=void 0}},t.PowScale=He,t.QuantileScale=Le,t.QuantizeScale=Ye,t.SqrtScale=Ie,t.SymlogScale=qe,t.ThresholdScale=Be,t.TimeScale=ze,t.isContinuous=function(e){switch(e){case t.ScaleEnum.Linear:case t.ScaleEnum.Log:case t.ScaleEnum.Pow:case t.ScaleEnum.Sqrt:case t.ScaleEnum.Symlog:case t.ScaleEnum.Time:return!0;default:return!1}},t.isDiscrete=function(e){switch(e){case t.ScaleEnum.Ordinal:case t.ScaleEnum.Point:case t.ScaleEnum.Band:return!0;default:return!1}},t.isDiscretizing=function(e){switch(e){case t.ScaleEnum.Quantile:case t.ScaleEnum.Quantize:case t.ScaleEnum.Threshold:return!0;default:return!1}},t.isValidScaleType=function(e){switch(e){case t.ScaleEnum.Linear:case t.ScaleEnum.Log:case t.ScaleEnum.Pow:case t.ScaleEnum.Sqrt:case t.ScaleEnum.Symlog:case t.ScaleEnum.Time:case t.ScaleEnum.Ordinal:case t.ScaleEnum.Point:case t.ScaleEnum.Band:return!0;default:return!1}}}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VScale={})}(this,(function(t){"use strict";!function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new i(r,o||t,s),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,s=new Array(o);i<o;i++)s[i]=r[i].fn;return s},a.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},a.prototype.emit=function(t,e,r,i,o,s){var a=n?n+t:t;if(!this._events[a])return!1;var u,h,l=this._events[a],c=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,o),!0;case 6:return l.fn.call(l.context,e,r,i,o,s),!0}for(h=1,u=new Array(c-1);h<c;h++)u[h-1]=arguments[h];l.fn.apply(l.context,u)}else{var f,g=l.length;for(h=0;h<g;h++)switch(l[h].once&&this.removeListener(t,l[h].fn,void 0,!0),c){case 1:l[h].fn.call(l[h].context);break;case 2:l[h].fn.call(l[h].context,e);break;case 3:l[h].fn.call(l[h].context,e,r);break;case 4:l[h].fn.call(l[h].context,e,r,i);break;default:if(!u)for(f=1,u=new Array(c-1);f<c;f++)u[f-1]=arguments[f];l[h].fn.apply(l[h].context,u)}}return!0},a.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},a.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},a.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||i&&!a.once||r&&a.context!==r||s(this,o);else{for(var u=0,h=[],l=a.length;u<l;u++)(a[u].fn!==e||i&&!a[u].once||r&&a[u].context!==r)&&h.push(a[u]);h.length?this._events[o]=1===h.length?h[0]:h:s(this,o)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&s(this,e)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a}({exports:{}});var e=function(t,e){return toString.call(t)==="[object ".concat(e,"]")},n=function(t){return null==t},r=function(t){return null!=t};function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(i=r.key,o=void 0,"symbol"==typeof(o=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"))?o:String(o)),r)}var i,o}function a(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var u=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=i(t);return n?"string"===r:"string"===r||e(t,"String")},h=function(t){return Array.isArray?Array.isArray(t):e(t,"Array")},l=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=i(t);return n?"number"===r:"number"===r||e(t,"Number")},c=function(t){return l(t)&&Number.isFinite(t)};function f(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function g(t){return Number(t)}function d(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:g,r=t.length;if(r){if(e<=0||r<2)return n(t[0],0,t);if(e>=1)return n(t[r-1],r-1,t);var i=(r-1)*e,o=Math.floor(i),s=n(t[o],o,t);return s+(n(t[o+1],o+1,t)-s)*(i-o)}}function m(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;for(n(i)&&(i=t.length);r<i;){var o=r+i>>>1;f(t[o],e)>0?i=o:r=o+1}return r}var _=Math.sqrt(50),p=Math.sqrt(10),v=Math.sqrt(2);function w(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=_?i*=10:o>=p?i*=5:o>=v&&(i*=2),e<t?-i:i}var y=1e-10,M=1e-10;function b(t,e){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:y,r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:M)*Math.max(t,e);return Math.abs(t-e)<=Math.max(n,r)}function k(t,e,n,r){return t>e&&!b(t,e,n,r)}function x(t,e,n,r){return t<e&&!b(t,e,n,r)}var S=function(t){for(var e="",n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)-1;n>=0;)e="".concat(e).concat(t),n-=1;return e},T=function(t,e){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"right",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:" ",i=t+"",o=e-i.length;return o<=0?i:"left"===n?S(r,o)+i:"center"===n?S(r,Math.floor(o/2))+i+S(r,Math.ceil(o/2)):i+S(r,o)};function C(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}try{"function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame}catch(t){!1}function N(t,e){return function(n){return t*(1-n)+e*n}}function U(t,e){return function(n){return Math.round(t*(1-n)+e*n)}}var E=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function F(t){if(t instanceof Date)return t;if(u(t)){var e=E.exec(t);if(!e)return new Date(NaN);if(!e[8])return new Date(+e[1],+(e[2]||1)-1,+e[3]||1,+e[4]||0,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0);var r=+e[4]||0;return"Z"!==e[8].toUpperCase()&&(r-=+e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,r,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0))}return n(t)?new Date(NaN):new Date(Math.round(t))}function A(t,e,n){e/=100,n/=100;var r=(1-Math.abs(2*n-1))*e,i=r*(1-Math.abs(t/60%2-1)),o=n-r/2,s=0,a=0,u=0;return 0<=t&&t<60?(s=r,a=i,u=0):60<=t&&t<120?(s=i,a=r,u=0):120<=t&&t<180?(s=0,a=r,u=i):180<=t&&t<240?(s=0,a=i,u=r):240<=t&&t<300?(s=i,a=0,u=r):300<=t&&t<360&&(s=r,a=0,u=i),{r:s=Math.round(255*(s+o)),g:a=Math.round(255*(a+o)),b:u=Math.round(255*(u+o))}}function D(t,e,n){t/=255,e/=255,n/=255;var r=Math.min(t,e,n),i=Math.max(t,e,n),o=i-r,s=0,a=0;return s=0===o?0:i===t?(e-n)/o%6:i===e?(n-t)/o+2:(t-e)/o+4,(s=Math.round(60*s))<0&&(s+=360),a=(i+r)/2,{h:s,s:+(100*(0===o?0:o/(1-Math.abs(2*a-1)))).toFixed(1),l:a=+(100*a).toFixed(1)}}var O=/^#([0-9a-f]{3,8})$/,H={transparent:4294967040},R={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function L(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Y(t){return l(t)?new q(t>>16,t>>8&255,255&t,1):h(t)?new q(t[0],t[1],t[2]):new q(255,255,255)}var I=function(){function t(e){o(this,t);var n=t.parseColorString(e);n?this.color=n:(console.warn("Warn: 传入".concat(e,"无法解析为Color")),this.color=new q(255,255,255))}return a(t,[{key:"toRGBA",value:function(){return this.color.formatRgb()}},{key:"toString",value:function(){return this.color.formatRgb()}},{key:"toHex",value:function(){return this.color.formatHex()}},{key:"toHsl",value:function(){return this.color.formatHsl()}},{key:"setOpacity",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}},{key:"brighter",value:function(t){var e=this.color,n=e.r,r=e.g,i=e.b;return this.color.r=Math.max(0,Math.min(255,Math.floor(n*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(r*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(i*t))),this}},{key:"getHSVBrightness",value:function(){return Math.max(this.color.r,this.color.g,this.color.b)/255}},{key:"getHSLBrightness",value:function(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}},{key:"setHsl",value:function(t,e,r){var i,o,s,a=this.color.opacity,u=D(this.color.r,this.color.g,this.color.b),h=A(n(t)?u.h:(s=360,(i=t)<(o=0)?o:i>s?s:i),n(e)?u.s:e>=0&&e<=1?100*e:e,n(r)?u.l:r<=1&&r>=0?100*r:r);return this.color=new q(h.r,h.g,h.b,a),this}},{key:"getLuminance",value:function(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}},{key:"getLuminance2",value:function(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}},{key:"getLuminance3",value:function(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}}],[{key:"Brighter",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===n?e:new t(e).brighter(n).toRGBA()}},{key:"SetOpacity",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===n?e:new t(e).setOpacity(n).toRGBA()}},{key:"getColorBrightness",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl",r=e instanceof t?e:new t(e);switch(n){case"hsv":default:return r.getHSVBrightness();case"hsl":return r.getHSLBrightness();case"lum":return r.getLuminance();case"lum2":return r.getLuminance2();case"lum3":return r.getLuminance3()}}},{key:"parseColorString",value:function(t){if(r(H[t]))return function(t){return l(t)?new q(t>>>24,t>>>16&255,t>>>8&255,255&t):h(t)?new q(t[0],t[1],t[2],t[3]):new q(255,255,255,1)}(H[t]);if(r(R[t]))return Y(R[t]);var e="".concat(t).trim().toLowerCase(),n=O.exec(e);if(n){var i=parseInt(n[1],16),o=n[1].length;return 3===o?new q((i>>8&15)+((i>>8&15)<<4),(i>>4&15)+((i>>4&15)<<4),(15&i)+((15&i)<<4),1):6===o?Y(i):8===o?new q(i>>24&255,i>>16&255,i>>8&255,(255&i)/255):void 0}if(/^(rgb|RGB|rgba|RGBA)/.test(e)){var s=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new q(parseInt(s[0],10),parseInt(s[1],10),parseInt(s[2],10),parseFloat(s[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){var a=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),u=A(parseInt(a[0],10),parseInt(a[1],10),parseInt(a[2],10));return new q(u.r,u.g,u.b,parseFloat(a[3]))}}}]),t}(),q=function(){function t(e,n,i,s){o(this,t),this.r=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.g=isNaN(+n)?255:Math.max(0,Math.min(255,+n)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),r(s)?this.opacity=isNaN(+s)?1:Math.max(0,Math.min(1,+s)):this.opacity=1}return a(t,[{key:"formatHex",value:function(){return"#".concat(L(this.r)+L(this.g)+L(this.b)+(1===this.opacity?"":L(255*this.opacity)))}},{key:"formatRgb",value:function(){var t=this.opacity;return"".concat(1===t?"rgb(":"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b).concat(1===t?")":",".concat(t,")"))}},{key:"formatHsl",value:function(){var t=this.opacity,e=D(this.r,this.g,this.b),n=e.h,r=e.s,i=e.l;return"".concat(1===t?"hsl(":"hsla(").concat(n,",").concat(r,"%,").concat(i,"%").concat(1===t?")":",".concat(t,")"))}},{key:"toString",value:function(){return this.formatHex()}}]),t}();var B,P=Object.freeze({__proto__:null,Color:I,DEFAULT_COLORS:R,RGB:q,hexToRgb:function(t){for(var e="",n="",r="",i="#"===t[0]?1:0,o=i;o<t.length;o++)"#"!==t[o]&&(o<i+2?e+=t[o]:o<i+4?n+=t[o]:o<i+6&&(r+=t[o]));return[parseInt(e,16),parseInt(n,16),parseInt(r,16)]},hslToRgb:A,interpolateRgb:function(t,e){var n=t.r,r=e.r,i=t.g,o=e.g,s=t.b,a=e.b,u=t.opacity,h=e.opacity;return function(t){var e=Math.round(n*(1-t)+r*t),l=Math.round(i*(1-t)+o*t),c=Math.round(s*(1-t)+a*t);return new q(e,l,c,u*(1-t)+h*t)}},rgbToHex:function(t,e,n){return Number((1<<24)+(t<<16)+(e<<8)+n).toString(16).slice(1)},rgbToHsl:D});function j(t){return t?"getUTCFullYear":"getFullYear"}function V(t){return t?"getUTCMonth":"getMonth"}function z(t){return t?"getUTCDate":"getDate"}function Q(t){return t?"getUTCHours":"getHours"}function G(t){return t?"getUTCMinutes":"getMinutes"}function X(t){return t?"getUTCSeconds":"getSeconds"}function $(t){return t?"getUTCMilliseconds":"getMilliseconds"}function Z(t){return t?"setUTCFullYear":"setFullYear"}function W(t,e){return function(n){var r=F(n),i=r[j(e)](),o=r[V(e)]()+1,s=Math.floor((o-1)/3)+1,a=r[z(e)](),u=r["get"+(e?"UTC":"")+"Day"](),h=r[Q(e)](),l=(h-1)%12+1,c=r[G(e)](),f=r[X(e)](),g=r[$(e)]();return(t||"").replace(/YYYY/g,T(i+"",4,"0","left")).replace(/yyyy/g,i+"").replace(/yy/g,i%100+"").replace(/Q/g,s+"").replace(/MM/g,T(o,2,"0","left")).replace(/M/g,o+"").replace(/dd/g,T(a,2,"0","left")).replace(/d/g,a+"").replace(/e/g,u+"").replace(/HH/g,T(h,2,"0","left")).replace(/H/g,h+"").replace(/hh/g,T(l+"",2,"0","left")).replace(/h/g,l+"").replace(/mm/g,T(c,2,"0","left")).replace(/m/g,c+"").replace(/ss/g,T(f,2,"0","left")).replace(/s/g,f+"").replace(/SSS/g,T(g,3,"0","left")).replace(/S/g,g+"")}}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(B||(B={}));var J,K=1e3,tt=6e4,et=36e5,nt=24*et,rt=31*nt,it=365*nt,ot=function(t){return t.setMonth(0,1),t.setHours(0,0,0,0),t},st=function(t,e){return t.setFullYear(t.getFullYear()+e),t},at=function(t,e){return e.getFullYear()-t.getFullYear()},ut=function(t){return t.getFullYear()},ht=function(t){return t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0),t},lt=function(t,e){return t.setUTCFullYear(t.getUTCFullYear()+e),t},ct=function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()},ft=function(t){return t.getUTCFullYear()},gt=function(t){return t.setDate(1),t.setHours(0,0,0,0),t},dt=function(t,e){return t.setMonth(t.getMonth()+e),t},mt=function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())},_t=function(t){return t.getMonth()},pt=function(t){return t.setUTCDate(1),t.setUTCHours(0,0,0,0),t},vt=function(t,e){return t.setUTCMonth(t.getUTCMonth()+e),t},wt=function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())},yt=function(t){return t.getUTCMonth()},Mt=function(t){return t.setHours(0,0,0,0),t},bt=function(t,e){return t.setDate(t.getDate()+e),t},kt=function(t,e){return(+e-+t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/nt},xt=function(t){return t.getDate()-1},St=function(t){return t.setUTCHours(0,0,0,0),t},Tt=function(t,e){return t.setUTCDate(t.getUTCDate()+e),t},Ct=function(t,e){return(+e-+t)/nt},Nt=function(t){return t.getUTCDate()-1},Ut=function(t){return t.setTime(+t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes()),t},Et=function(t,e){return t.setHours(t.getHours()+e),t},Ft=function(t,e){return(+e-+t)/et},At=function(t){return t.getHours()},Dt=function(t){return t.setTime(+t-t.getUTCMilliseconds()-1e3*t.getUTCSeconds()-6e4*t.getUTCMinutes()),t},Ot=function(t,e){return t.setUTCHours(t.getUTCHours()+e),t},Ht=function(t){return t.getUTCHours()},Rt=function(t){return t.setTime(+t-t.getMilliseconds()-1e3*t.getSeconds()),t},Lt=function(t,e){return t.setMinutes(t.getMinutes()+e),t},Yt=function(t,e){return(+e-+t)/6e4},It=function(t){return t.getMinutes()},qt=function(t){return t.setTime(+t-t.getUTCMilliseconds()-1e3*t.getUTCSeconds()),t},Bt=function(t,e){return t.setUTCMinutes(t.getUTCMinutes()+e),t},Pt=function(t){return t.getUTCMinutes()},jt=function(t){return t.setTime(+t-t.getMilliseconds()),t},Vt=function(t,e){return t.setSeconds(t.getSeconds()+e),t},zt=function(t,e){return(+e-+t)/1e3},Qt=function(t){return t.getSeconds()},Gt=function(t){return t.setTime(+t-t.getUTCMilliseconds()),t},Xt=function(t,e){return t.setUTCSeconds(t.getUTCSeconds()+e),t},$t=function(t){return t.getUTCSeconds()},Zt=function(t){return t},Wt=function(t,e){return t.setTime(+t+e),t},Jt=function(t,e){return+e-+t},Kt=function(t,e){return function(n){var r=new Date(+n-1);return e(r,1),t(r),r}},te=function(t,e){var n=e.floor,r=e.offset,i=e.field,o=e.count,s=Math.floor(t);if(!Number.isFinite(s)||s<=0)return null;if(s<=1)return{floor:n,offset:r,ceil:Kt(n,r)};var a=function(t,e){return function(n,r){var i=new Date,o=new Date;return i.setTime(+n),o.setTime(+r),t(i),t(o),Math.floor(e(i,o))}}(n,o),u=i?function(t){return i(t)%s==0}:function(t){return a(0,t)%s==0},h=function(t){if(!Number.isNaN(+t))for(n(t);!u(t);)t.setTime(+t-1),n(t);return t},l=function(t,e){if(!Number.isNaN(+t))if(s<0)for(;++e<=0;)for(r(t,-1);!u(t);)r(t,-1);else for(;--e>=0;)for(r(t,1);!u(t);)r(t,1);return t};return{floor:h,offset:l,ceil:Kt(h,l)}};t.ScaleEnum=void 0,(J=t.ScaleEnum||(t.ScaleEnum={})).Linear="linear",J.Log="log",J.Pow="pow",J.Sqrt="sqrt",J.Symlog="symlog",J.Time="time",J.Quantile="quantile",J.Quantize="quantize",J.Threshold="threshold",J.Ordinal="ordinal",J.Point="point",J.Band="band";class ee{_wholeRange;_rangeFactor;_unknown;_calculateRange(t){if(this._wholeRange)return this._wholeRange;if(this._rangeFactor&&2===t.length){const e=(t[1]-t[0])/(this._rangeFactor[1]-this._rangeFactor[0]),n=t[0]-e*this._rangeFactor[0],r=n,i=e+n;return this._wholeRange=[r,i],this._wholeRange}return t}calculateVisibleDomain(t){if(this._rangeFactor&&2===t.length){return[this.invert(t[0]),this.invert(t[1])]}return this.domain()}rangeFactor(t,e){return t?(2===t.length&&t.every((t=>t>=0&&t<=1))&&(this._wholeRange=null,this._rangeFactor=t),this):this._rangeFactor}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}}const ne=Symbol("implicit");class re extends ee{type=t.ScaleEnum.Ordinal;_index;_domain;_ordinalRange;constructor(){super(),this._index=new Map,this._domain=[],this._ordinalRange=[],this._unknown=ne}clone(){return(new re).domain(this._domain).range(this._ordinalRange).unknown(this._unknown)}scale(t){const e=`${t}`;let n=this._index.get(e);if(!n){if(this._unknown!==ne)return this._unknown;n=this._domain.push(t),this._index.set(e,n)}return this._ordinalRange[(n-1)%this._ordinalRange.length]}invert(t){let e=0;for(;e<this._ordinalRange.length&&this._ordinalRange[e]!==t;)e++;return this._domain[(e-1)%this._domain.length]}domain(t){if(!t)return this._domain.slice();this._domain=[],this._index=new Map;for(const e of t){const t=`${e}`;this._index.has(t)||this._index.set(t,this._domain.push(e))}return this}range(t){if(!t)return this._ordinalRange.slice();const e=Array.from(t);return this._ordinalRange=e,this}}function ie(t){return t}const oe=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t),se=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),ae=t=>t<0?-t*t:t*t,ue=t=>-Math.log(-t),he=t=>-Math.exp(-t),le=t=>isFinite(t)?Math.pow(10,t):t<0?0:t,ce=t=>10===t?le:t===Math.E?Math.exp:e=>Math.pow(t,e),fe=t=>t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:(t=Math.log(t),e=>Math.log(e)/t),ge=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),de=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t;function me(t,e){if(t=Number(t),e=Number(e),e-=t)return n=>(n-t)/e;const n=Number.isNaN(e)?NaN:.5;return()=>n}function _e(t,e,n){const r=t[0],i=t[1],o=e[0],s=e[1];let a,u;return i<r?(a=me(i,r),u=n(s,o)):(a=me(r,i),u=n(o,s)),t=>u(a(t))}function pe(t,e,n){const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r);let s=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<r;)i[s]=me(t[s],t[s+1]),o[s]=n(e[s],e[s+1]);return function(e){const n=m(t,e,1,r)-1;return o[n](i[n](e))}}const ve=(t,e)=>{const n=t.slice();let r=0,i=n.length-1,o=n[r],s=n[i];return s<o&&([r,i]=[i,r],[o,s]=[s,o]),n[r]=e.floor(o),n[i]=e.ceil(s),n};function we(t,e,n,r){let i;const o=[];let s;if(e=Math.floor(+e),t=Math.floor(+t),!(n=Math.floor(+n)))return[];if(t===e)return[t];if(i=e<t){const n=t;t=e,e=n}let a=C(1,e-t+1)(n);if(s=Math.floor((e-t+1)/a),!r)for(;Math.ceil((e-t+1)/s)>n&&a>1;)a-=1,s=Math.floor((e-t)/a);let u=t;for(;u<=e;)o.push(u),u+=s;return i&&o.reverse(),o}class ye extends re{type=t.ScaleEnum.Band;_step;_bandwidth;_round;_paddingInner;_paddingOuter;_align;_range;constructor(t){super(),this._range=[0,1],this._step=void 0,this._bandwidth=void 0,this._round=!1,this._paddingInner=0,this._paddingOuter=0,this._align=.5,this._unknown=void 0,delete this.unknown,this.rescale(t)}rescale(t){if(t)return this;this._wholeRange=null;const e=this._calculateRange(this._range),n=super.domain().length,i=e[1]<e[0];let o=e[Number(i)-0];const s=e[1-Number(i)],a=function(t,e,n){let r;return r=1===t?t+2*n:t-e+2*n,t?r>0?r:1:0}(n,this._paddingInner,this._paddingOuter);this._step=(s-o)/Math.max(1,a||1),this._round&&(this._step=Math.floor(this._step)),o+=(s-o-this._step*(n-this._paddingInner))*this._align,this._bandwidth=this._step*(1-this._paddingInner),this._round&&(o=Math.round(o),this._bandwidth=Math.round(this._bandwidth));const u=function(t,e,n){r(e)||(e=t,t=0),r(n)||(n=1);for(var i=-1,o=0|Math.max(0,Math.ceil((e-t)/n)),s=new Array(o);++i<o;)s[i]=t+i*n;return s}(n).map((t=>o+this._step*t));return super.range(i?u.reverse():u),this}calculateVisibleDomain(t){const e=this.domain();if(this._rangeFactor&&e.length){const n=this._getInvertIndex(t[0]),r=this._getInvertIndex(t[1]);return e.slice(Math.min(n,r),Math.max(n,r)+1)}return e}domain(t,e){return t?(super.domain(t),this.rescale(e)):super.domain()}range(t,e){return t?(this._range=[g(t[0]),g(t[1])],this.rescale(e)):this._range.slice()}rangeRound(t,e){return this._range=[g(t[0]),g(t[1])],this._round=!0,this.rescale(e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);if(-1===t)return e;return we(0,e.length-1,t,!1).map((t=>e[t]))}tickData(t=10){return this.ticks(t).map(((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0]+this._bandwidth/2)/(this._range[1]-this._range[0])})))}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return we(0,e.length-1,t,!0).filter((t=>t<e.length)).map((t=>e[t]))}stepTicks(t){const e=this.calculateVisibleDomain(this._range),n=function(t,e,n){const r=[];let i;if(n=C(1,(e=Math.floor(+e))-(t=Math.floor(+t))+1)(Math.floor(+n)),i=e<t){const n=t;t=e,e=n}let o=t;for(;o<=e;)r.push(o),o+=n;return i&&r.reverse(),r}(0,e.length-1,t);return n.map((t=>e[t]))}_getInvertIndex(t){let e=0;const n=this.step()/2,r=this.bandwidth()/2,i=this._domain.length,o=this.range(),s=o[0]>o[o.length-1];for(e=0;e<i;e++){const o=this.scale(this._domain[e])+r;if(0===e&&(!s&&!k(t,o+n)||s&&!x(t,o-n)))break;if(e===i-1)break;if(!x(t,o-n)&&!k(t,o+n))break}return e>=0&&e<=i-1?e:i-1}invert(t){return this._domain[this._getInvertIndex(t)]}padding(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(Array.isArray(t)?Math.min.apply(null,t):t)),this._paddingInner=this._paddingOuter,this.rescale(e)):this._paddingInner}paddingInner(t,e){return void 0!==t?(this._paddingInner=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingInner}paddingOuter(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingOuter}bandwidth(){return this._bandwidth}step(){return this._step}round(t,e){return void 0!==t?(this._round=t,this.rescale(e)):this._round}align(t,e){return void 0!==t?(this._align=Math.max(0,Math.min(1,t)),this.rescale(e)):this._align}rangeFactor(t,e){return t?(super.rangeFactor(t),this.rescale(e)):super.rangeFactor()}clone(){return new ye(!0).domain(this._domain,!0).range(this._range,!0).round(this._round,!0).paddingInner(this._paddingInner,!0).paddingOuter(this._paddingOuter,!0).align(this._align)}}const{interpolateRgb:Me}=P;function be(t,e){const r=typeof e;let i;if(n(e)||"boolean"===r)return()=>e;if("number"===r)return N(t,e);if("string"===r){if(i=I.parseColorString(e)){const e=Me(I.parseColorString(t),i);return t=>e(t).formatRgb()}return N(Number(t),Number(e))}return e instanceof q?Me(t,e):e instanceof I?Me(t.color,e.color):e instanceof Date?function(t,e){var n=t.valueOf(),r=e.valueOf(),i=new Date;return function(t){return i.setTime(n*(1-t)+r*t),i}}(t,e):N(Number(t),Number(e))}class ke extends ee{type;transformer;untransformer;_domain;_range;_unknown=void 0;_forceAlign;_output;_input;_interpolate;_piecewise;_clamp;constructor(t=ie,e=ie){super(),this.transformer=t,this.untransformer=e,this._forceAlign=!0,this._domain=[0,1],this._range=[0,1],this._clamp=ie,this._piecewise=_e,this._interpolate=be}scale(t){return t=Number(t),Number.isNaN(t)?this._unknown:(this._output||(this._output=this._piecewise(this._domain.map(this.transformer),this._calculateRange(this._range),this._interpolate)),this._output(this.transformer(this._clamp(t))))}invert(t){return this._input||(this._input=this._piecewise(this._calculateRange(this._range),this._domain.map(this.transformer),N)),this._clamp(this.untransformer(this._input(t)))}domain(t,e){if(!t)return this._domain.slice();const n=Array.from(t,g);return this._domain=n,this.rescale(e)}range(t,e){if(!t)return this._range.slice();const n=Array.from(t);return this._range=n,this.rescale(e)}rangeRound(t,e){const n=Array.from(t);return this._range=n,this._interpolate=U,this.rescale(e)}rescale(t){if(t)return this;const e=this._domain.length,n=this._range.length;let r=Math.min(e,n);if(e&&e<n&&this._forceAlign){const t=n-e+1,i=this._domain[e-1],o=e>=2?(i-this._domain[e-2])/t:0;for(let n=1;n<=t;n++)this._domain[e-2+n]=i-o*(t-n);r=n}return void 0===this._clamp&&(this._clamp=C(this._domain[0],this._domain[r-1])),this._piecewise=r>2?pe:_e,this._output=this._input=null,this._wholeRange=null,this}clamp(t,e,n){return arguments.length?(this._clamp=e||(t?void 0:ie),this.rescale(n)):this._clamp!==ie}interpolate(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}ticks(t=10){return[]}tickData(t=10){return(this.ticks(t)??[]).map(((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0])/(this._range[1]-this._range[0])})))}rangeFactor(t,e){return t?(super.rangeFactor(t),this._output=this._input=null,this):super.rangeFactor()}forceAlignDomainRange(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}const xe=Math.sqrt(50),Se=Math.sqrt(10),Te=Math.sqrt(2);function Ce(t,e,n){let r,i,o,s,a=-1;if(n=+n,(t=+t)===(e=+e))return[];if(Math.abs(t-e)<=Number.MIN_VALUE&&n>0)return[t];if((r=e<t)&&(i=t,t=e,e=i),s=Ne(t,e,n),!isFinite(s))return[];if(s>0){let n=Math.round(t/s),r=Math.round(e/s);for(n*s<t&&++n,r*s>e&&--r,o=new Array(i=r-n+1);++a<i;)o[a]=(n+a)*s}else{s=-s;let n=Math.round(t*s),r=Math.round(e*s);for(n/s<t&&++n,r/s>e&&--r,o=new Array(i=r-n+1);++a<i;)o[a]=(n+a)/s}return r&&o.reverse(),o}function Ne(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/10**i;let s=1;return o>=xe?s=10:o>=Se?s=5:o>=Te&&(s=2),i>=0?s*10**i:-(10**-i)/s}function Ue(t,e,n){let r;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if(n<=0||0===(r=function(t,e,n){const r=(e-t)/Math.max(1,n-1);return r}(t,e,n))||!isFinite(r))return[];const i=new Array(n);for(let e=0;e<n;e++)i[e]=t+e*r;return i}function Ee(t,e,n){let r,i,o=-1;if(n=+n,(i=(e=+e)<(t=+t))&&(r=t,t=e,e=r),!isFinite(n)||e-t<=n)return[t];const s=Math.floor((e-t)/n+1),a=new Array(s);for(;++o<s;)a[o]=t+o*n;return i&&a.reverse(),a}function Fe(t,e=10){let n,r,i=0,o=t.length-1,s=t[i],a=t[o],u=10;for(a<s&&(r=s,s=a,a=r,r=i,i=o,o=r);u-- >0;){if(r=Ne(s,a,e),r===n)return t[i]=s,t[o]=a,t;if(r>0)s=Math.floor(s/r)*r,a=Math.ceil(a/r)*r;else{if(!(r<0))break;s=Math.ceil(s*r)/r,a=Math.floor(a*r)/r}n=r}}class Ae extends ke{type=t.ScaleEnum.Linear;clone(){return(new Ae).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}tickFormat(){return()=>{}}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return Ce(e[0],e[e.length-1],t)}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Ue(e[0],e[e.length-1],t)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return Ee(e[0],e[e.length-1],t)}nice(t=10){const e=Fe(this.domain(),t);return e?this.domain(e):this}niceMin(t=10){const e=this._domain[this._domain.length-1],n=Fe(this.domain(),t);return n&&(n[n.length-1]=e,this.domain(n)),this}niceMax(t=10){const e=this._domain[0],n=Fe(this.domain(),t);return n&&(n[0]=e,this.domain(n)),this}}function De(t){return e=>-t(-e)}class Oe extends ke{type=t.ScaleEnum.Log;_base;_logs;_pows;constructor(){super(fe(10),ce(10)),this._logs=this.transformer,this._pows=this.untransformer,this._domain=[1,10],this._base=10}clone(){return(new Oe).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).base(this._base)}rescale(t){if(t)return this;super.rescale();const e=fe(this._base),n=ce(this._base);return this._domain[0]<0?(this._logs=De(e),this._pows=De(n),this.transformer=ue,this.untransformer=he):(this._logs=e,this._pows=n,this.transformer=e,this.untransformer=n),this}base(t,e){return arguments.length?(this._base=t,this.rescale(e)):this._base}tickFormat(){return ie}ticks(t=10){const e=this.domain();let n=e[0],r=e[e.length-1];const i=r<n;i&&([n,r]=[r,n]);let o,s,a=this._logs(n),u=this._logs(r),h=[];if(!(this._base%1)&&u-a<t){if(a=Math.floor(a),u=Math.ceil(u),n>0){for(;a<=u;++a)for(o=1;o<this._base;++o)if(s=a<0?o/this._pows(-a):o*this._pows(a),!(s<n)){if(s>r)break;h.push(s)}}else for(;a<=u;++a)for(o=this._base-1;o>=1;--o)if(s=a>0?o/this._pows(-a):o*this._pows(a),!(s<n)){if(s>r)break;h.push(s)}2*h.length<t&&(h=Ce(n,r,t))}else h=Ce(a,u,Math.min(u-a,t)).map(this._pows);return i?h.reverse():h}nice(){return this.domain(ve(this.domain(),{floor:t=>this._pows(Math.floor(this._logs(t))),ceil:t=>this._pows(Math.ceil(this._logs(t)))}))}}class He extends Ae{type=t.ScaleEnum.Pow;_exponent;constructor(){super(),this._exponent=1}clone(){return(new He).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).exponent(this._exponent)}rescale(t){return t||(1===this._exponent?(this.transformer=ie,this.untransformer=ie):.5===this._exponent?(this.transformer=se,this.untransformer=ae):(this.transformer=oe(this._exponent),this.untransformer=oe(1/this._exponent)),super.rescale()),this}exponent(t,e){return arguments.length?(this._exponent=t,this.rescale(e)):this._exponent}}function Re(t,e){return t.length===e.length&&t.every(((t,n)=>t===e[n]))}class Le{type=t.ScaleEnum.Quantile;_range=[];_domain=[];_thresholds=[];_unknown;unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}rescale(t){if(t)return this;let e=0;const n=Math.max(1,this._range.length);for(this._thresholds=new Array(n-1);++e<n;)this._thresholds[e-1]=d(this._domain,e/n);return this}scale(t){return c(t)?this._range[m(this._thresholds,t)]:this._unknown}invertExtent(t){const e=this._range.indexOf(t);return e<0?[NaN,NaN]:[e>0?this._thresholds[e-1]:this._domain[0],e<this._thresholds.length?this._thresholds[e]:this._domain[this._domain.length-1]]}quantiles(){return this._thresholds.slice()}domain(t,e){if(!t)return this._domain.slice();this._domain=[];for(const e of t)n(e)||Number.isNaN(+e)||this._domain.push(+e);return this._domain.sort(f),this.rescale(e)}range(t,e){if(!t)return this._range.slice();const n=Array.from(t);return Re(this._range,n)?this:(this._range=n,this.rescale(e))}clone(){return(new Le).domain(this._domain,!0).range(this._range).unknown(this._unknown)}}class Ye{type=t.ScaleEnum.Quantile;_range=[0,1];_domain=[.5];x0=0;x1=1;n=1;_unknown;unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}rescale(t){if(t)return this;let e=-1;for(this._domain=new Array(this.n);++e<this.n;)this._domain[e]=((e+1)*this.x1-(e-this.n)*this.x0)/(this.n+1);return this}scale(t){return c(t)?this._range[m(this._domain,t,0,this.n)]:this._unknown}invertExtent(t){const e=this._range.indexOf(t);return e<0?[NaN,NaN]:e<1?[this.x0,this._domain[0]]:e>=this.n?[this._domain[this.n-1],this.x1]:[this._domain[e-1],this._domain[e]]}thresholds(){return this._domain.slice()}domain(t,e){if(!t)return[this.x0,this.x1];const n=Array.from(t);return this.x0=+n[0],this.x1=+n[1],this.rescale(e)}range(t,e){if(!t)return this._range.slice();const n=Array.from(t);return Re(this._range,n)?this:(this.n=n.length-1,this._range=n,this.rescale(e))}clone(){return(new Ye).domain([this.x0,this.x1],!0).range(this._range).unknown(this._unknown)}ticks(t=10){const e=this.domain();return Ce(e[0],e[e.length-1],t)}forceTicks(t=10){const e=this.domain();return Ue(e[0],e[e.length-1],t)}stepTicks(t){const e=this.domain();return Ee(e[0],e[e.length-1],t)}nice(t=10){const e=Fe(this.domain(),t);return e?this.domain(e):this}niceMin(t=10){const e=this._domain[this._domain.length-1],n=Fe(this.domain(),t);return n&&(n[n.length-1]=e,this.domain(n)),this}niceMax(t=10){const e=this._domain[0],n=Fe(this.domain(),t);return n&&(n[0]=e,this.domain(n)),this}}class Ie extends Ae{type=t.ScaleEnum.Sqrt;constructor(){super(se,ae)}clone(){return(new Ie).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}}class qe extends Ae{type=t.ScaleEnum.Symlog;_const;constructor(){super(ge(1),de(1)),this._const=1}clone(){return(new qe).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).constant(this._const)}constant(t,e){return arguments.length?(this._const=t,this.transformer=ge(t),this.untransformer=de(t),this.rescale(e)):this._const}}class Be{type=t.ScaleEnum.Threshold;_range=[0,1];_domain=[.5];n=1;_unknown;unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}scale(t){return!n(t)&&c(+t)?this._range[m(this._domain,t,0,this.n)]:this._unknown}invertExtent(t){const e=this._range.indexOf(t);return[this._domain[e-1],this._domain[e]]}domain(t){return t?(this._domain=Array.from(t),this.n=Math.min(this._domain.length,this._range.length-1),this):this._domain.slice()}range(t){return t?(this._range=Array.from(t),this.n=Math.min(this._domain.length,this._range.length-1),this):this._range.slice()}clone(){return(new Be).domain(this._domain).range(this._range).unknown(this._unknown)}}const Pe=[["second",1,K],["second",5,5e3],["second",10,1e4],["second",30,3e4],["minute",1,tt],["minute",5,3e5],["minute",10,6e5],["minute",30,18e5],["hour",1,et],["hour",3,3*et],["hour",6,6*et],["hour",12,12*et],["day",1,nt],["day",2,2*nt],["day",7,7*nt],["month",1,rt],["month",3,3*rt],["month",6,6*rt],["year",1,365*nt]];function je(t){return+F(t)}function Ve(t,e,n,r){const i=(+e-+t)/n,o=m(Pe.map((t=>t[2])),i);if(o===Pe.length){const i=Math.max(w(+t/it,+e/it,n),1),o=t=>(t[Z(r)](Math.floor(t[j(r)]()/i)*i),t[function(t){return t?"setUTCMonth":"setMonth"}(r)](0,1),t[function(t){return t?"setUTCHours":"setHours"}(r)](0,0,0,0),t),s=(t,e)=>(t[Z(r)](t[j(r)]()+e*i),t);return{floor:o,offset:s,ceil:Kt(o,s)}}if(0===o){const r=Math.max(w(+t,+e,n),1),i=t=>(t.setTime(Math.floor(+t/r)*r),t),o=(t,e)=>(t.setTime(+t+e*r),t);return{floor:i,offset:o,ceil:Kt(i,o)}}const[s,a]=Pe[i/Pe[o-1][2]<Pe[o][2]/i?o-1:o],u=function(t,e){return"year"===t&&e?{floor:ht,offset:lt,count:ct,field:ft}:"month"===t&&e?{floor:pt,offset:vt,count:wt,field:yt}:"day"===t&&e?{floor:St,offset:Tt,count:Ct,field:Nt}:"hour"===t&&e?{floor:Dt,offset:Ot,count:Ft,field:Ht}:"minute"===t&&e?{floor:qt,offset:Bt,count:Yt,field:Pt}:"second"===t&&e?{floor:Gt,offset:Xt,count:zt,field:$t}:"year"===t?{floor:ot,offset:st,count:at,field:ut}:"month"===t?{floor:gt,offset:dt,count:mt,field:_t}:"day"===t?{floor:Mt,offset:bt,count:kt,field:xt}:"hour"===t?{floor:Ut,offset:Et,count:Ft,field:At}:"minute"===t?{floor:Rt,offset:Lt,count:Yt,field:It}:"second"===t?{floor:jt,offset:Vt,count:zt,field:Qt}:{floor:Zt,offset:Wt,count:Jt}}(s,r);return te(a,u)}class ze extends ke{type=t.ScaleEnum.Time;_isUtc;constructor(t=!1){super(),this._domain=t?[Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]:[+new Date(2e3,0,1),+new Date(2e3,0,2)],this._isUtc=t}invert(t){return new Date(super.invert(t))}domain(t,e){if(!t)return this._domain.map(F);const n=Array.from(t,je);return this._domain=n,this.rescale(e)}ticks(t){const e=this.domain();let r=e[0],i=e[e.length-1];const o=i<r;o&&([r,i]=[i,r]);let s=t;(l(t)||n(t))&&(s=Ve(r,i,n(t)?10:t,this._isUtc)),r=s.ceil(r);const a=[];let u=+r,h=0;for(;u<=+i&&h<100;)a.push(new Date(u)),u=+s.offset(new Date(u),1),h++;return o?a.reverse():a}tickFormat(t,e){return W(null==e?(n=this._domain[0],r=this._isUtc,i=F(n),o=i[V(r)]()+1,s=i[z(r)](),a=i[Q(r)](),u=i[G(r)](),h=i[X(r)](),l=0===i[$(r)](),(d=(g=(f=(c=l&&0===h)&&0===u)&&0===a)&&1===s)&&1===o?"YYYY":d?"YYYY-MM":g?"YYYY-MM-DD":f?"HH":c?"HH:mm":l?"HH:mm:ss":"HH:mm:ss SSS"):e,this._isUtc);var n,r,i,o,s,a,u,h,l,c,f,g,d}clone(){return new ze(this._isUtc).domain(this.domain(),!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}nice(t){const e=this.domain();let r=t;return(l(t)||n(t))&&(r=Ve(e[0],e[e.length-1],n(t)?10:t,this._isUtc)),r&&this.domain(ve(e,r)),this}utc(){return this._isUtc}}t.BandScale=ye,t.ContinuousScale=ke,t.LinearScale=Ae,t.LogScale=Oe,t.OrdinalScale=re,t.PointScale=class extends ye{type=t.ScaleEnum.Point;_padding=0;constructor(t){super(!1),this.paddingInner(1,t),this.padding=this.paddingOuter,this.paddingInner=void 0,this.paddingOuter=void 0}},t.PowScale=He,t.QuantileScale=Le,t.QuantizeScale=Ye,t.SqrtScale=Ie,t.SymlogScale=qe,t.ThresholdScale=Be,t.TimeScale=ze,t.isContinuous=function(e){switch(e){case t.ScaleEnum.Linear:case t.ScaleEnum.Log:case t.ScaleEnum.Pow:case t.ScaleEnum.Sqrt:case t.ScaleEnum.Symlog:case t.ScaleEnum.Time:return!0;default:return!1}},t.isDiscrete=function(e){switch(e){case t.ScaleEnum.Ordinal:case t.ScaleEnum.Point:case t.ScaleEnum.Band:return!0;default:return!1}},t.isDiscretizing=function(e){switch(e){case t.ScaleEnum.Quantile:case t.ScaleEnum.Quantize:case t.ScaleEnum.Threshold:return!0;default:return!1}},t.isValidScaleType=function(e){switch(e){case t.ScaleEnum.Linear:case t.ScaleEnum.Log:case t.ScaleEnum.Pow:case t.ScaleEnum.Sqrt:case t.ScaleEnum.Symlog:case t.ScaleEnum.Time:case t.ScaleEnum.Ordinal:case t.ScaleEnum.Point:case t.ScaleEnum.Band:return!0;default:return!1}}}));

@@ -5,5 +5,6 @@ const e10 = Math.sqrt(50), e5 = Math.sqrt(10), e2 = Math.sqrt(2);

let reverse, n, ticks, step, i = -1;
if (stop = +stop, start = +start, count = +count, Math.abs(start - stop) <= Number.MIN_VALUE && count > 0) return [ start ];
if (count = +count, (start = +start) === (stop = +stop)) return [];
if (Math.abs(start - stop) <= Number.MIN_VALUE && count > 0) return [ start ];
if ((reverse = stop < start) && (n = start, start = stop, stop = n), step = tickIncrement(start, stop, count),
0 === stop || !isFinite(step)) return [];
!isFinite(step)) return [];
if (step > 0) {

@@ -10,0 +11,0 @@ let r0 = Math.round(start / step), r1 = Math.round(stop / step);

{
"name": "@visactor/vscale",
"version": "0.11.1",
"version": "0.11.2",
"description": "Scales for visual encoding, used in VGrammar, VTable",

@@ -54,4 +54,5 @@ "keywords": [

"test": "jest",
"test-check": "DEBUG=jest jest --forceExit --detectOpenHandles --silent false --verbose false --runInBand"
"test-check": "DEBUG=jest jest --forceExit --detectOpenHandles --silent false --verbose false --runInBand",
"test-cov": "jest -w 16 --coverage"
}
}

Sorry, the diff of this file is not supported yet

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