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.18.13 to 0.18.14

cjs/utils/tick-wilkinson-extended.d.ts

1

cjs/base-scale.d.ts

@@ -23,2 +23,3 @@ import type { IRangeFactor, ScaleFishEyeOptions } from './interface';

unknown(_: any): this;
get(key: string, defaultValue?: any): any;
}

@@ -60,2 +60,6 @@ "use strict";

}
get(key, defaultValue) {
var _a;
return null !== (_a = null == this ? void 0 : this[key]) && void 0 !== _a ? _a : defaultValue;
}
}

@@ -62,0 +66,0 @@

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

import type { BaseScale } from './base-scale';
import type { ScaleEnum } from './type';

@@ -121,2 +122,8 @@ export type Tuple<TItem, TLength extends number> = [TItem, ...TItem[]] & {

}) => number[];
export type WilkinsonExtendedTicksFunc = (start: number, stop: number, count?: number, options?: {
onlyLoose?: boolean;
Q?: number[];
w?: [number, number, number, number];
}) => number[];
export type CustomTicksFunc<T extends BaseScale> = (scale: T, count: number) => number[];
export interface NiceOptions {

@@ -123,0 +130,0 @@ forceMin?: number;

3

cjs/linear-scale.d.ts
import { ContinuousScale } from './continuous-scale';
import type { ContinuousScaleType, NiceOptions } from './interface';
import type { ContinuousScaleType, CustomTicksFunc, NiceOptions } from './interface';
export declare class LinearScale extends ContinuousScale {

@@ -12,2 +12,3 @@ readonly type: ContinuousScaleType;

noDecimals?: boolean;
customTicks?: CustomTicksFunc<ContinuousScale>;
}): number[];

@@ -14,0 +15,0 @@ forceTicks(count?: number): any[];

@@ -25,2 +25,3 @@ "use strict";

var _a;
if ((0, vutils_1.isFunction)(null == options ? void 0 : options.customTicks)) return options.customTicks(this, count);
if ((0, vutils_1.isValid)(this._rangeFactorStart) && (0, vutils_1.isValid)(this._rangeFactorEnd) && (this._rangeFactorStart > 0 || this._rangeFactorEnd < 1) && 2 === this._range.length || !this._niceType) return this.d3Ticks(count, options);

@@ -27,0 +28,0 @@ const curNiceDomain = null !== (_a = this._niceDomain) && void 0 !== _a ? _a : this._domain, originalDomain = this._domain, start = curNiceDomain[0], stop = curNiceDomain[curNiceDomain.length - 1];

export { scaleWholeRangeSize } from './utils';
export { wilkinsonExtended } from './tick-wilkinson-extended';

@@ -5,3 +5,3 @@ "use strict";

value: !0
}), exports.scaleWholeRangeSize = void 0;
}), exports.wilkinsonExtended = exports.scaleWholeRangeSize = void 0;

@@ -16,2 +16,11 @@ var utils_1 = require("./utils");

});
var tick_wilkinson_extended_1 = require("./tick-wilkinson-extended");
Object.defineProperty(exports, "wilkinsonExtended", {
enumerable: !0,
get: function() {
return tick_wilkinson_extended_1.wilkinsonExtended;
}
});
//# sourceMappingURL=index.js.map

@@ -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 i(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function s(t,e,i,s,a){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new r(i,s||t,a),h=n?n+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function o(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),o.prototype.eventNames=function(){var t,i,r=[];if(0===this._eventsCount)return r;for(i in t=this._events)e.call(t,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,s=i.length,a=new Array(s);r<s;r++)a[r]=i[r].fn;return a},o.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},o.prototype.emit=function(t,e,i,r,s,a){var o=n?n+t:t;if(!this._events[o])return!1;var h,l,c=this._events[o],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,i),!0;case 4:return c.fn.call(c.context,e,i,r),!0;case 5:return c.fn.call(c.context,e,i,r,s),!0;case 6:return c.fn.call(c.context,e,i,r,s,a),!0}for(l=1,h=new Array(u-1);l<u;l++)h[l-1]=arguments[l];c.fn.apply(c.context,h)}else{var d,g=c.length;for(l=0;l<g;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),u){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,i);break;case 4:c[l].fn.call(c[l].context,e,i,r);break;default:if(!h)for(d=1,h=new Array(u-1);d<u;d++)h[d-1]=arguments[d];c[l].fn.apply(c[l].context,h)}}return!0},o.prototype.on=function(t,e,n){return s(this,t,e,n,!1)},o.prototype.once=function(t,e,n){return s(this,t,e,n,!0)},o.prototype.removeListener=function(t,e,i,r){var s=n?n+t:t;if(!this._events[s])return this;if(!e)return a(this,s),this;var o=this._events[s];if(o.fn)o.fn!==e||r&&!o.once||i&&o.context!==i||a(this,s);else{for(var h=0,l=[],c=o.length;h<c;h++)(o[h].fn!==e||r&&!o[h].once||i&&o[h].context!==i)&&l.push(o[h]);l.length?this._events[s]=1===l.length?l[0]:l:a(this,s)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&a(this,e)):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,t.exports=o}({exports:{}});var e=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var n=t=>null==t;var i=t=>null!=t;var r=function(t){const n=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===n:"string"===n||e(t,"String")};var s=t=>Array.isArray?Array.isArray(t):e(t,"Array");var a=function(t){const n=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===n:"number"===n||e(t,"Number")};var o=t=>a(t)&&Number.isFinite(t);function h(t,e,n){const i=function(t){if(!t)return[];if(Object.keys)return Object.keys(t);const e=[];for(const n in t)t.hasOwnProperty(n)&&e.push(n);return e}(e);for(let r=0;r<i.length;r++){const s=i[r];(n?null!=e[s]:null==t[s])&&(t[s]=e[s])}return t}function l(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames){const i=Object.getOwnPropertyNames(e);for(let r=0;r<i.length;r++){const s=i[r];"constructor"!==s&&(n?null!=e[s]:null==t[s])&&(t[s]=e[s])}}else h(t,e,n)}function c(t,e){if(!s(t)||!s(e))return!1;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function u(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function d(t){return Number(t)}function g(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:d;const i=t.length;if(!i)return;if(e<=0||i<2)return n(t[0],0,t);if(e>=1)return n(t[i-1],i-1,t);const r=(i-1)*e,s=Math.floor(r),a=n(t[s],s,t);return a+(n(t[s+1],s+1,t)-a)*(r-s)}function m(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0;for(n(r)&&(r=t.length);i<r;){const n=i+r>>>1;u(t[n],e)>0?r=n:i=n+1}return i}const _=Math.sqrt(50),f=Math.sqrt(10),p=Math.sqrt(2);function M(t,e,n){const i=Math.abs(e-t)/Math.max(0,n);let r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10));const s=i/r;return s>=_?r*=10:s>=f?r*=5:s>=p&&(r*=2),e<t?-r:r}const w=1e-10,b=1e-10;function y(t,e){const n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:w,i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:b)*Math.max(t,e);return Math.abs(t-e)<=Math.max(n,i)}function v(t,e,n,i){return t>e&&!y(t,e,n,i)}function x(t,e,n,i){return t<e&&!y(t,e,n,i)}const S=t=>{let e=null,n=null;return function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return e&&r.every(((t,n)=>t===e[n]))||(e=r,n=t(...r)),n}},F=function(t){let e="",n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)-1;for(;n>=0;)e=`${e}${t}`,n-=1;return e};var T=function(t,e){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"right";const i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:" ",r=t+"",s=e-r.length;return s<=0?r:"left"===n?F(i,s)+r:"center"===n?F(i,Math.floor(s/2))+r+F(i,Math.ceil(s/2)):r+F(i,s)};var k=function(t,e,n){return t<e?e:t>n?n:t};function E(t,e){let n;return t>e&&(n=t,t=e,e=n),n=>Math.max(t,Math.min(e,n))}function D(t,e){return n=>t*(1-n)+e*n}function N(t,e){return function(n){return Math.round(t*(1-n)+e*n)}}const C=/^(?:(\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 R(t){if(t instanceof Date)return t;if(r(t)){const e=C.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);let n=+e[4]||0;return"Z"!==e[8].toUpperCase()&&(n-=+e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,n,+(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 U(t,e,n){e/=100,n/=100;const i=(1-Math.abs(2*n-1))*e,r=i*(1-Math.abs(t/60%2-1)),s=n-i/2;let a=0,o=0,h=0;return 0<=t&&t<60?(a=i,o=r,h=0):60<=t&&t<120?(a=r,o=i,h=0):120<=t&&t<180?(a=0,o=i,h=r):180<=t&&t<240?(a=0,o=r,h=i):240<=t&&t<300?(a=r,o=0,h=i):300<=t&&t<360&&(a=i,o=0,h=r),a=Math.round(255*(a+s)),o=Math.round(255*(o+s)),h=Math.round(255*(h+s)),{r:a,g:o,b:h}}function O(t,e,n){t/=255,e/=255,n/=255;const i=Math.min(t,e,n),r=Math.max(t,e,n),s=r-i;let a=0,o=0,h=0;return a=0===s?0:r===t?(e-n)/s%6:r===e?(n-t)/s+2:(t-e)/s+4,a=Math.round(60*a),a<0&&(a+=360),h=(r+i)/2,o=0===s?0:s/(1-Math.abs(2*h-1)),o=+(100*o).toFixed(1),h=+(100*h).toFixed(1),{h:a,s:o,l:h}}const B=/^#([0-9a-f]{3,8})$/,L={transparent:4294967040},A={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 H(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function I(t){return a(t)?new G(t>>16,t>>8&255,255&t,1):s(t)?new G(t[0],t[1],t[2]):new G(255,255,255)}function V(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Y(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const q=(t,e)=>{const n=B.exec(t);if(e||n){const t=parseInt(n[1],16),e=n[1].length;return 3===e?new G((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?I(t):8===e?new G(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class ${static Brighter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new $(t).brighter(e).toRGBA()}static SetOpacity(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new $(t).setOpacity(e).toRGBA()}static getColorBrightness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl";const n=t instanceof $?t:new $(t);switch(e){case"hsv":default:return n.getHSVBrightness();case"hsl":return n.getHSLBrightness();case"lum":return n.getLuminance();case"lum2":return n.getLuminance2();case"lum3":return n.getLuminance3()}}static parseColorString(t){if(i(L[t]))return function(t){return a(t)?new G(t>>>24,t>>>16&255,t>>>8&255,255&t):s(t)?new G(t[0],t[1],t[2],t[3]):new G(255,255,255,1)}(L[t]);if(i(A[t]))return I(A[t]);const e=`${t}`.trim().toLowerCase(),n=q(e);if(void 0!==n)return n;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const t=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new G(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const t=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),n=U(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new G(n.r,n.g,n.b,parseFloat(t[3]))}}constructor(t){const e=$.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new G(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:n,b:i}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(n*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(i*t))),this}add(t){const{r:e,g:n,b:i}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,n+t.color.g),this.color.b+=Math.min(255,i+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:n,b:i}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(n*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(i*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){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)}setHsl(t,e,i){const r=this.color.opacity,s=O(this.color.r,this.color.g,this.color.b),a=U(n(t)?s.h:k(t,0,360),n(e)?s.s:e>=0&&e<=1?100*e:e,n(i)?s.l:i<=1&&i>=0?100*i:i);return this.color=new G(a.r,a.g,a.b,r),this}setRGB(t,e,i){return!n(t)&&(this.color.r=t),!n(e)&&(this.color.g=e),!n(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),n=q(e,!0);return null!=n?n:this}setColorName(t){const e=A[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}clone(){return new $(this.color.toString())}copyGammaToLinear(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;const n=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,n),this.color.g=Math.pow(t.color.g,n),this.color.b=Math.pow(t.color.b,n),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=V(t.color.r),this.color.g=V(t.color.g),this.color.b=V(t.color.b),this}copyLinearToSRGB(t){return this.color.r=Y(t.color.r),this.color.g=Y(t.color.g),this.color.b=Y(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class G{constructor(t,e,n,r){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+n)?255:Math.max(0,Math.min(255,+n)),i(r)?this.opacity=isNaN(+r)?1:Math.max(0,Math.min(1,+r)):this.opacity=1}formatHex(){return`#${H(this.r)+H(this.g)+H(this.b)+(1===this.opacity?"":H(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:n,l:i}=O(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${n}%,${i}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}var j=Object.freeze({__proto__:null,Color:$,DEFAULT_COLORS:A,RGB:G,hexToRgb:function(t){let e="",n="",i="";const r="#"===t[0]?1:0;for(let s=r;s<t.length;s++)"#"!==t[s]&&(s<r+2?e+=t[s]:s<r+4?n+=t[s]:s<r+6&&(i+=t[s]));return[parseInt(e,16),parseInt(n,16),parseInt(i,16)]},hslToRgb:U,interpolateRgb:function(t,e){const n=t.r,i=e.r,r=t.g,s=e.g,a=t.b,o=e.b,h=t.opacity,l=e.opacity;return t=>{const e=Math.round(n*(1-t)+i*t),c=Math.round(r*(1-t)+s*t),u=Math.round(a*(1-t)+o*t);return new G(e,c,u,h*(1-t)+l*t)}},rgbToHex:function(t,e,n){return Number((1<<24)+(t<<16)+(e<<8)+n).toString(16).slice(1)},rgbToHsl:O});function P(t){return t?"getUTCFullYear":"getFullYear"}function z(t){return t?"getUTCMonth":"getMonth"}function W(t){return t?"getUTCDate":"getDate"}function Q(t){return t?"getUTCHours":"getHours"}function Z(t){return t?"getUTCMinutes":"getMinutes"}function J(t){return t?"getUTCSeconds":"getSeconds"}function K(t){return t?"getUTCMilliseconds":"getMilliseconds"}function X(t){return t?"setUTCFullYear":"setFullYear"}function tt(t,e){return n=>{const i=R(n),r=i[P(e)](),s=i[z(e)]()+1,a=Math.floor((s-1)/3)+1,o=i[W(e)](),h=i["get"+(e?"UTC":"")+"Day"](),l=i[Q(e)](),c=(l-1)%12+1,u=i[Z(e)](),d=i[J(e)](),g=i[K(e)]();return(t||"").replace(/YYYY/g,T(r+"",4,"0","left")).replace(/yyyy/g,r+"").replace(/yy/g,r%100+"").replace(/Q/g,a+"").replace(/MM/g,T(s,2,"0","left")).replace(/M/g,s+"").replace(/dd/g,T(o,2,"0","left")).replace(/d/g,o+"").replace(/e/g,h+"").replace(/HH/g,T(l,2,"0","left")).replace(/H/g,l+"").replace(/hh/g,T(c+"",2,"0","left")).replace(/h/g,c+"").replace(/mm/g,T(u,2,"0","left")).replace(/m/g,u+"").replace(/ss/g,T(d,2,"0","left")).replace(/s/g,d+"").replace(/SSS/g,T(g,3,"0","left")).replace(/S/g,g+"")}}const et=1e3,nt=6e4,it=36e5,rt=24*it,st=31*rt,at=365*rt,ot=t=>(t.setMonth(0,1),t.setHours(0,0,0,0),t),ht=(t,e)=>(t.setFullYear(t.getFullYear()+e),t),lt=(t,e)=>e.getFullYear()-t.getFullYear(),ct=t=>t.getFullYear(),ut=t=>(t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0),t),dt=(t,e)=>(t.setUTCFullYear(t.getUTCFullYear()+e),t),gt=(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),mt=t=>t.getUTCFullYear(),_t=t=>(t.setDate(1),t.setHours(0,0,0,0),t),ft=(t,e)=>(t.setMonth(t.getMonth()+e),t),pt=(t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear()),Mt=t=>t.getMonth(),wt=t=>(t.setUTCDate(1),t.setUTCHours(0,0,0,0),t),bt=(t,e)=>(t.setUTCMonth(t.getUTCMonth()+e),t),yt=(t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear()),vt=t=>t.getUTCMonth(),xt=t=>(t.setHours(0,0,0,0),t),St=(t,e)=>(t.setDate(t.getDate()+e),t),Ft=(t,e)=>(+e-+t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/rt,Tt=t=>t.getDate()-1,kt=t=>(t.setUTCHours(0,0,0,0),t),Et=(t,e)=>(t.setUTCDate(t.getUTCDate()+e),t),Dt=(t,e)=>(+e-+t)/rt,Nt=t=>t.getUTCDate()-1,Ct=t=>(t.setTime(+t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes()),t),Rt=(t,e)=>(t.setHours(t.getHours()+e),t),Ut=(t,e)=>(+e-+t)/it,Ot=t=>t.getHours(),Bt=t=>(t.setTime(+t-t.getUTCMilliseconds()-1e3*t.getUTCSeconds()-6e4*t.getUTCMinutes()),t),Lt=(t,e)=>(t.setUTCHours(t.getUTCHours()+e),t),At=t=>t.getUTCHours(),Ht=t=>(t.setTime(+t-t.getMilliseconds()-1e3*t.getSeconds()),t),It=(t,e)=>(t.setMinutes(t.getMinutes()+e),t),Vt=(t,e)=>(+e-+t)/6e4,Yt=t=>t.getMinutes(),qt=t=>(t.setTime(+t-t.getUTCMilliseconds()-1e3*t.getUTCSeconds()),t),$t=(t,e)=>(t.setUTCMinutes(t.getUTCMinutes()+e),t),Gt=t=>t.getUTCMinutes(),jt=t=>(t.setTime(+t-t.getMilliseconds()),t),Pt=(t,e)=>(t.setSeconds(t.getSeconds()+e),t),zt=(t,e)=>(+e-+t)/1e3,Wt=t=>t.getSeconds(),Qt=t=>(t.setTime(+t-t.getUTCMilliseconds()),t),Zt=(t,e)=>(t.setUTCSeconds(t.getUTCSeconds()+e),t),Jt=t=>t.getUTCSeconds(),Kt=t=>t,Xt=(t,e)=>(t.setTime(+t+e),t),te=(t,e)=>+e-+t,ee=(t,e)=>n=>{const i=new Date(+n-1);return e(i,1),t(i),i},ne=(t,e)=>{let{floor:n,offset:i,field:r,count:s}=e;const a=Math.floor(t);if(!Number.isFinite(a)||a<=0)return null;if(a<=1)return{floor:n,offset:i,ceil:ee(n,i)};const o=((t,e)=>(n,i)=>{const r=new Date,s=new Date;return r.setTime(+n),s.setTime(+i),t(r),t(s),Math.floor(e(r,s))})(n,s),h=r?t=>r(t)%a==0:t=>o(0,t)%a==0,l=t=>{if(!Number.isNaN(+t))for(n(t);!h(t);)t.setTime(+t-1),n(t);return t},c=(t,e)=>{if(!Number.isNaN(+t))if(a<0)for(;++e<=0;)for(i(t,-1);!h(t);)i(t,-1);else for(;--e>=0;)for(i(t,1);!h(t);)i(t,1);return t};return{floor:l,offset:c,ceil:ee(l,c)}};var ie;t.ScaleEnum=void 0,(ie=t.ScaleEnum||(t.ScaleEnum={})).Identity="identity",ie.Linear="linear",ie.Log="log",ie.Pow="pow",ie.Sqrt="sqrt",ie.Symlog="symlog",ie.Time="time",ie.Quantile="quantile",ie.Quantize="quantize",ie.Threshold="threshold",ie.Ordinal="ordinal",ie.Point="point",ie.Band="band";const re={};function se(t){return t}Object.values(t.ScaleEnum).forEach((t=>{re[t]=!0}));const ae=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t),oe=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),he=t=>t<0?-t*t:t*t,le=t=>-Math.log(-t),ce=t=>-Math.exp(-t),ue=t=>isFinite(t)?Math.pow(10,t):t<0?0:t,de=t=>10===t?ue:t===Math.E?Math.exp:e=>Math.pow(t,e),ge=t=>t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:(t=Math.log(t),e=>Math.log(e)/t),me=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),_e=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t;function fe(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 pe(t,e,n){const i=t[0],r=t[1],s=e[0],a=e[1];let o,h;return r<i?(o=fe(r,i),h=n(a,s)):(o=fe(i,r),h=n(s,a)),t=>h(o(t))}function Me(t,e,n){let i;return i=1===t?t+2*n:t-e+2*n,t?i>0?i:1:0}function we(t,e,n,i){1===n&&(n=0);return Me(t,n,i)*(e/(1-n))}function be(t,e){const n=(t[1]-t[0])/(e[1]-e[0]),i=t[0]-n*e[0];return[i,n+i]}function ye(t,e,n){const i=Math.min(t.length,e.length)-1,r=new Array(i),s=new Array(i);let a=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<i;)r[a]=fe(t[a],t[a+1]),s[a]=n(e[a],e[a+1]);return function(e){const n=m(t,e,1,i)-1;return s[n](r[n](e))}}const ve=(t,e)=>{const n=t.slice();let i=0,r=n.length-1,s=n[i],a=n[r];return a<s&&([i,r]=[r,i],[s,a]=[a,s]),n[i]=e.floor(s),n[r]=e.ceil(a),n},xe=(t,e=!1)=>{const n=Math.floor(Math.log10(t)),i=t/Math.pow(10,n);let r;return r=e?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10,r*Math.pow(10,n)};class Se{constructor(){this._rangeFactorStart=null,this._rangeFactorEnd=null}_calculateWholeRange(t){return this._wholeRange?this._wholeRange:i(this._rangeFactorStart)&&i(this._rangeFactorEnd)&&2===t.length?(this._wholeRange=be(t,[this._rangeFactorStart,this._rangeFactorEnd]),this._wholeRange):t}rangeFactor(t,e,n){return t?(2===t.length&&t.every((t=>t>=0&&t<=1))&&(this._wholeRange=null,0===t[0]&&1===t[1]?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorStart=t[0],this._rangeFactorEnd=t[1])),this):n?(this._wholeRange=null,this._rangeFactorStart=null,this._rangeFactorEnd=null,this):i(this._rangeFactorStart)&&i(this._rangeFactorEnd)?[this._rangeFactorStart,this._rangeFactorEnd]:null}rangeFactorStart(t,e){var i;return n(t)?this._rangeFactorStart:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!n(this._rangeFactorEnd)&&1!==this._rangeFactorEnd?(this._rangeFactorStart=t,this._rangeFactorEnd=null!==(i=this._rangeFactorEnd)&&void 0!==i?i:1):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}rangeFactorEnd(t,e){var i;return n(t)?this._rangeFactorEnd:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!n(this._rangeFactorStart)&&0!==this._rangeFactorStart?(this._rangeFactorEnd=t,this._rangeFactorStart=null!==(i=this._rangeFactorStart)&&void 0!==i?i:0):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}generateFishEyeTransform(){var t;if(!this._fishEyeOptions)return void(this._fishEyeTransform=null);const{distortion:e=2,radiusRatio:i=.1,radius:r}=this._fishEyeOptions,s=this.range(),a=s[0],o=s[s.length-1],h=Math.min(a,o),l=Math.max(a,o),c=k(null!==(t=this._fishEyeOptions.focus)&&void 0!==t?t:0,h,l),u=n(r)?(l-h)*i:r;let d=Math.exp(e);d=d/(d-1)*u;const g=e/u;this._fishEyeTransform=t=>{const e=Math.abs(t-c);if(e>=u)return t;if(e<=1e-6)return c;const n=d*(1-Math.exp(-e*g))/e*.75+.25;return c+(t-c)*n}}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}}const Fe=Symbol("implicit");class Te extends Se{specified(t){var e;return t?(this._specified=Object.assign(null!==(e=this._specified)&&void 0!==e?e:{},t),this):Object.assign({},this._specified)}_getSpecifiedValue(t){if(this._specified)return this._specified[t]}constructor(){super(),this.type=t.ScaleEnum.Ordinal,this._index=new Map,this._domain=[],this._ordinalRange=[],this._unknown=Fe}clone(){const t=(new Te).domain(this._domain).range(this._ordinalRange).unknown(this._unknown);return this._specified&&t.specified(this._specified),t}calculateVisibleDomain(t){if(i(this._rangeFactorStart)&&i(this._rangeFactorEnd)&&2===t.length){return[this.invert(t[0]),this.invert(t[1])]}return this._domain}scale(t){const e=`${t}`,n=this._getSpecifiedValue(e);if(void 0!==n)return n;let i=this._index.get(e);if(!i){if(this._unknown!==Fe)return this._unknown;i=this._domain.push(t),this._index.set(e,i)}const r=this._ordinalRange[(i-1)%this._ordinalRange.length];return this._fishEyeTransform?this._fishEyeTransform(r):r}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}index(t){var e;return this._index&&null!==(e=this._index.get(`${t}`))&&void 0!==e?e:-1}}function ke(t,e,n,i){const r=[];let s=t;for(;s<=e;)r.push(s),s+=n;return i&&r.reverse(),r}function Ee(t,e,n,i){let r,s;if(e=Math.floor(+e),t=Math.floor(+t),!(n=Math.floor(+n)))return[];if(t===e)return[t];if(r=e<t){const n=t;t=e,e=n}let a=E(1,e-t+1)(n);if(s=Math.floor((e-t+1)/a),!i)for(;Math.ceil((e-t+1)/s)>n&&a>1;)a-=1,s=Math.floor((e-t)/a);return ke(t,e,s,r)}class De extends Te{constructor(e){super(),this.type=t.ScaleEnum.Band,this._range=[0,1],this._step=void 0,this._bandwidth=void 0,this._isFixed=!1,this._round=!1,this._paddingInner=0,this._paddingOuter=0,this._align=.5,this._unknown=void 0,delete this.unknown,this.rescale(e)}rescale(t,e){if(t)return this;this._wholeRange=null;const n=this._calculateWholeRange(this._range,e),i=super.domain().length,r=n[1]<n[0];let s=n[Number(r)-0];const a=n[1-Number(r)],o=Me(i,this._paddingInner,this._paddingOuter);return this._step=(a-s)/Math.max(1,o||1),this._round&&(this._step=Math.floor(this._step)),s+=(a-s-this._step*(i-this._paddingInner))*this._align,this.isBandwidthFixed()||(this._bandwidth=this._step*(1-this._paddingInner)),this._round&&(s=Math.round(s),this.isBandwidthFixed()||(this._bandwidth=Math.round(this._bandwidth))),this._bandRangeState={reverse:r,start:r?s+this._step*(i-1):s,count:i},this.generateFishEyeTransform(),this}scale(t){if(!this._bandRangeState)return;const e=`${t}`,n=this._getSpecifiedValue(e);if(void 0!==n)return n;let i=this._index.get(e);if(!i){if(this._unknown!==Fe)return this._unknown;i=this._domain.push(t),this._index.set(e,i)}const{count:r,start:s,reverse:a}=this._bandRangeState,o=s+(a?-1:1)*((i-1)%r)*this._step;return this._fishEyeTransform?this._fishEyeTransform(o):o}_calculateWholeRange(t,e){if(this._wholeRange)return this._wholeRange;if((this._minBandwidth||this._maxBandwidth)&&!this._isBandwidthFixedByUser()){let e;if(i(this._rangeFactorStart)&&i(this._rangeFactorEnd)&&2===t.length){const n=be(t,[this._rangeFactorStart,this._rangeFactorEnd]);e=Math.abs(n[1]-n[0])}else e=Math.abs(t[1]-t[0]);const n=function(t,e,n,i,r){const s=Me(t,n,i);let a=e/Math.max(1,s||1);r&&(a=Math.floor(a));let o=a*(1-n);return r&&(o=Math.round(o)),o}(super.domain().length,e,this._paddingInner,this._paddingOuter,this._round);n<this._minBandwidth?(this._bandwidth=this._minBandwidth,this._isFixed=!0):n>this._maxBandwidth?(this._bandwidth=this._maxBandwidth,this._isFixed=!0):(this._bandwidth=n,this._isFixed=!1)}if(this.isBandwidthFixed()){const n=we(super.domain().length,this._bandwidth,this._paddingInner,this._paddingOuter)*Math.sign(t[1]-t[0]),r=Math.min((t[1]-t[0])/n,1);if(i(this._rangeFactorStart)&&i(this._rangeFactorEnd)){if(n>0){const e=t[0]-n*this._rangeFactorStart,i=e+n;this._wholeRange=[e,i]}else{const e=t[1]+n*(1-this._rangeFactorEnd),i=e-n;this._wholeRange=[i,e]}const i=this._rangeFactorStart+r<=1,s=this._rangeFactorEnd-r>=0;"rangeFactorStart"===e&&i?this._rangeFactorEnd=this._rangeFactorStart+r:"rangeFactorEnd"===e&&s?this._rangeFactorStart=this._rangeFactorEnd-r:t[0]<=t[1]?i?this._rangeFactorEnd=this._rangeFactorStart+r:s?this._rangeFactorStart=this._rangeFactorEnd-r:(this._rangeFactorStart=0,this._rangeFactorEnd=r):s?this._rangeFactorStart=this._rangeFactorEnd-r:i?this._rangeFactorEnd=this._rangeFactorStart+r:(this._rangeFactorStart=1-r,this._rangeFactorEnd=1)}else this._rangeFactorStart=0,this._rangeFactorEnd=r,this._wholeRange=[t[0],t[0]+n];return this._wholeRange}return super._calculateWholeRange(t)}calculateWholeRangeSize(){const t=this._calculateWholeRange(this._range);return Math.abs(t[1]-t[0])}calculateVisibleDomain(t){const e=this._domain;if(i(this._rangeFactorStart)&&i(this._rangeFactorEnd)&&e.length){const n=this._getInvertIndex(t[0]),i=this._getInvertIndex(t[1]);return e.slice(Math.min(n,i),Math.max(n,i)+1)}return e}domain(t,e){return t?(super.domain(t),this.rescale(e)):super.domain()}range(t,e){return t?(this._range=[d(t[0]),d(t[1])],this.rescale(e)):this._range}rangeRound(t,e){return this._range=[d(t[0]),d(t[1])],this._round=!0,this.rescale(e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);if(-1===t)return e;return Ee(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 Ee(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){let i;if(n=E(1,(e=Math.floor(+e))-(t=Math.floor(+t))+1)(Math.floor(+n)),i=e<t){const n=t;t=e,e=n}return ke(t,e,n,i)}(0,e.length-1,t);return n.map((t=>e[t]))}_getInvertIndex(t){let e=0;const n=this.step()/2,i=this.bandwidth()/2,r=this._domain.length,s=this.range(),a=s[0]>s[s.length-1];for(e=0;e<r;e++){const s=this.scale(this._domain[e])+i;if(0===e&&(!a&&!v(t,s+n)||a&&!x(t,s-n)))break;if(e===r-1)break;if(!x(t,s-n)&&!v(t,s+n))break}return e>=0&&e<=r-1?e:r-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}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()}rangeFactorStart(t,e){return n(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this.rescale(e,"rangeFactorStart"))}rangeFactorEnd(t,e){return n(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this.rescale(e,"rangeFactorEnd"))}bandwidth(t,e){return t?("auto"===t?(this._bandwidth=void 0,this._isFixed=!1):(this._bandwidth=t,this._isFixed=!0),this._userBandwidth=t,this.rescale(e)):this._bandwidth}maxBandwidth(t,e){return t?(this._maxBandwidth="auto"===t?void 0:t,this.rescale(e)):this._maxBandwidth}minBandwidth(t,e){return t?(this._minBandwidth="auto"===t?void 0:t,this.rescale(e)):this._minBandwidth}fishEye(t,e,n){return t||n?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}isBandwidthFixed(){return this._isFixed&&!!this._bandwidth}_isBandwidthFixedByUser(){return this._isFixed&&this._userBandwidth&&a(this._userBandwidth)}clone(){var t,e,n;return new De(!0).domain(this._domain,!0).range(this._range,!0).round(this._round,!0).paddingInner(this._paddingInner,!0).paddingOuter(this._paddingOuter,!0).align(this._align,!0).bandwidth(null!==(t=this._userBandwidth)&&void 0!==t?t:"auto",!0).maxBandwidth(null!==(e=this._maxBandwidth)&&void 0!==e?e:"auto",!0).minBandwidth(null!==(n=this._maxBandwidth)&&void 0!==n?n:"auto")}}const{interpolateRgb:Ne}=j;function Ce(t,e){const i=typeof e;let r;if(n(e)||"boolean"===i)return()=>e;if("number"===i)return D(t,e);if("string"===i){if(r=$.parseColorString(e)){const e=Ne($.parseColorString(t),r);return t=>e(t).formatRgb()}return D(Number(t),Number(e))}return e instanceof G?Ne(t,e):e instanceof $?Ne(t.color,e.color):e instanceof Date?function(t,e){const n=t.valueOf(),i=e.valueOf(),r=new Date;return t=>(r.setTime(n*(1-t)+i*t),r)}(t,e):D(Number(t),Number(e))}class Re extends Se{constructor(t=se,e=se){super(),this._unknown=void 0,this.transformer=t,this.untransformer=e,this._forceAlign=!0,this._domain=[0,1],this._range=[0,1],this._clamp=se,this._piecewise=pe,this._interpolate=Ce}calculateVisibleDomain(t){var e;if(i(this._rangeFactorStart)&&i(this._rangeFactorEnd)&&2===t.length){return[this.invert(t[0]),this.invert(t[1])]}return null!==(e=this._niceDomain)&&void 0!==e?e:this._domain}fishEye(t,e,n){return t||n?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}scale(t){var e;if(t=Number(t),Number.isNaN(t)||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const n=this._output(this.transformer(this._clamp(t)));return this._fishEyeTransform?this._fishEyeTransform(n):n}invert(t){var e;return this._input||(this._input=this._piecewise(this._calculateWholeRange(this._range),(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),D)),this._clamp(this.untransformer(this._input(t)))}domain(t,e){var n;if(!t)return(null!==(n=this._niceDomain)&&void 0!==n?n:this._domain).slice();this._domainValidator=null,this._niceType=null,this._niceDomain=null;const i=Array.from(t,d);return this._domain=i,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=N,this.rescale(e)}rescale(t){var e;if(t)return this;const n=null!==(e=this._niceDomain)&&void 0!==e?e:this._domain,i=n.length,r=this._range.length;let s=Math.min(i,r);if(i&&i<r&&this._forceAlign){const t=r-i+1,e=n[i-1],a=i>=2?(e-n[i-2])/t:0;for(let r=1;r<=t;r++)n[i-2+r]=e-a*(t-r);s=r}return this._autoClamp&&(this._clamp=E(n[0],n[s-1])),this._piecewise=s>2?ye:pe,this._output=this._input=null,this._wholeRange=null,this.generateFishEyeTransform(),this}clamp(t,e,n){return arguments.length?(e?(this._autoClamp=!1,this._clamp=e):(this._autoClamp=!!t,this._clamp=t?void 0:se),this.rescale(n)):this._clamp!==se}interpolate(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}ticks(t=10){return[]}tickData(t=10){const e=this.ticks(t);return(null!=e?e:[]).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()}rangeFactorStart(t,e){return n(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this._output=this._input=null,this)}rangeFactorEnd(t,e){return n(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this._output=this._input=null,this)}forceAlignDomainRange(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}const Ue=Math.sqrt(50),Oe=Math.sqrt(10),Be=Math.sqrt(2),Le=[1,2,5,10],Ae=(t,e,n)=>{let r=1,s=t;const a=Math.floor((e-1)/2),o=Math.abs(t);return t>=0&&t<=Number.MIN_VALUE?s=0:t<0&&t>=-Number.MIN_VALUE?s=-(e-1):!n&&o<1?r=Ye(o).step:(n||o>1)&&(s=Math.floor(t)-a*r),r>0?(t>0?s=Math.max(s,0):t<0&&(s=Math.min(s,-(e-1)*r)),function(t,e,n){i(e)||(e=t,t=0),i(n)||(n=1);let r=-1;const s=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(s);for(;++r<s;)a[r]=t+r*n;return a}(0,e).map((t=>s+t*r))):t>0?Ie(0,-(e-1)/r,r):Ie((e-1)/r,0,r)},He=S(((t,e,n,i)=>{let r,s,a,o,h=-1;if(n=+n,(t=+t)===(e=+e))return[t];if(Math.abs(t-e)<=Number.MIN_VALUE&&n>0)return[t];if((r=e<t)&&(s=t,t=e,e=s),o=qe(t,e,n).step,!isFinite(o))return[];if(o>0){let n=Math.round(t/o),i=Math.round(e/o);for(n*o<t&&++n,i*o>e&&--i,a=new Array(s=i-n+1);++h<s;)a[h]=(n+h)*o}else if(o<0&&(null==i?void 0:i.noDecimals)){o=1;const n=Math.ceil(t),i=Math.floor(e);if(!(n<=i))return[];for(a=new Array(s=i-n+1);++h<s;)a[h]=n+h}else{o=-o;let n=Math.round(t*o),i=Math.round(e*o);for(n/o<t&&++n,i/o>e&&--i,a=new Array(s=i-n+1);++h<s;)a[h]=(n+h)/o}return r&&a.reverse(),a})),Ie=(t,e,n)=>{let i,r,s=-1;if(n>0){let a=Math.floor(t/n),o=Math.ceil(e/n);for((a+1)*n<t&&++a,(o-1)*n>e&&--o,r=new Array(i=o-a+1);++s<i;)r[s]=(a+s)*n}else{n=-n;let a=Math.floor(t*n),o=Math.ceil(e*n);for((a+1)/n<t&&++a,(o-1)/n>e&&--o,r=new Array(i=o-a+1);++s<i;)r[s]=(a+s)/n}return r},Ve=S(((t,e,n,i)=>{let r,s,a;if(n=+n,(t=+t)===(e=+e))return Ae(t,n,null==i?void 0:i.noDecimals);if(Math.abs(t-e)<=Number.MIN_VALUE&&n>0)return Ae(t,n,null==i?void 0:i.noDecimals);(r=e<t)&&(a=t,t=e,e=a);const o=qe(t,e,n);let h=o.step;if(!isFinite(h))return[];if(h>0){let i=1;const{power:r,gap:a}=o,l=10===a?2*10**r:1*10**r;for(;i<=5&&(s=Ie(t,e,h),s.length>n+1)&&n>2;)h+=l,i+=1;n>2&&s.length<n-1&&(s=((t,e,n)=>{let i;const r=t[0],s=t[t.length-1],a=e-t.length;if(s<=0){const e=[];for(i=a;i>=1;i--)e.push(r-i*n);return e.concat(t)}if(r>=0){for(i=1;i<=a;i++)t.push(s+i*n);return t}let o=[];const h=[];for(i=1;i<=a;i++)i%2==0?o=[r-Math.floor(i/2)*n].concat(o):h.push(s+Math.ceil(i/2)*n);return o.concat(t).concat(h)})(s,n,h))}else(null==i?void 0:i.noDecimals)&&h<0&&(h=1),s=Ie(t,e,h);return r&&s.reverse(),s})),Ye=t=>{const e=Math.floor(Math.log(t)/Math.LN10),n=t/10**e;let i=Le[0];return n>=Ue?i=Le[3]:n>=Oe?i=Le[2]:n>=Be&&(i=Le[1]),e>=0?{step:i*10**e,gap:i,power:e}:{step:-(10**-e)/i,gap:i,power:e}};function qe(t,e,n){const i=(e-t)/Math.max(0,n);return Ye(i)}function $e(t,e,n){let i;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if(n<=0||0===(i=function(t,e,n){const i=(e-t)/Math.max(1,n-1);return i}(t,e,n))||!isFinite(i))return[];const r=new Array(n);for(let e=0;e<n;e++)r[e]=t+e*i;return r}function Ge(t,e,n){let i,r,s=-1;if(n=+n,(r=(e=+e)<(t=+t))&&(i=t,t=e,e=i),!isFinite(n)||e-t<=n)return[t];const a=Math.floor((e-t)/n+1),o=new Array(a);for(;++s<a;)o[s]=t+s*n;return r&&o.reverse(),o}function je(t,e=10){let n,i,r=0,s=t.length-1,a=t[r],o=t[s],h=10;for(o<a&&(i=a,a=o,o=i,i=r,r=s,s=i);h-- >0;){if(i=qe(a,o,e).step,i===n)return t[r]=a,t[s]=o,t;if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else{if(!(i<0))break;a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i}n=i}}function Pe(t,e){const n=a(e.forceMin),i=a(e.forceMax);let r=null;const s=[];let o=null;const h=n&&i?t=>t>=e.forceMin&&t<=e.forceMax:n?t=>t>=e.forceMin:i?t=>t<=e.forceMax:null;return n?s[0]=e.forceMin:a(e.min)&&e.min<=Math.min(t[0],t[t.length-1])&&(s[0]=e.min),i?s[1]=e.forceMax:a(e.max)&&e.max>=Math.max(t[0],t[t.length-1])&&(s[1]=e.max),a(s[0])&&a(s[1])?(o=t.slice(),o[0]=s[0],o[o.length-1]=s[1]):r=a(s[0])||a(s[1])?a(s[0])?"max":"min":"all",{niceType:r,niceDomain:o,niceMinMax:s,domainValidator:h}}const ze=(t,e,n)=>Math.abs(e-t)<1?+n.toFixed(1):Math.round(+n),We=S(((t,e,n,i,r,s,a)=>{let o=t,h=e;const l=h<o;l&&([o,h]=[h,o]);let c,u,d=r(o),g=r(h),m=[];if(!(i%1)&&g-d<n){if(d=Math.floor(d),g=Math.ceil(g),o>0){for(;d<=g;++d)for(c=1;c<i;++c)if(u=d<0?c/s(-d):c*s(d),!(u<o)){if(u>h)break;m.push(u)}}else for(;d<=g;++d)for(c=i-1;c>=1;--c)if(u=d>0?c/s(-d):c*s(d),!(u<o)){if(u>h)break;m.push(u)}2*m.length<n&&(m=Ve(o,h,n))}else m=Ve(d,g,Math.min(g-d,n)).map(s);return m=m.filter((t=>0!==t)),(null==a?void 0:a.noDecimals)&&(m=Array.from(new Set(m.map((t=>Math.floor(t)))))),l?m.reverse():m})),Qe=S(((t,e,n,i,r,s)=>{const a=[],o={},h=r(t),l=r(e);let c=[];if(Number.isInteger(i))c=Ve(h,l,n);else{const t=(l-h)/(n-1);for(let e=0;e<n;e++)c.push(h+e*t)}return c.forEach((n=>{const r=s(n),h=Number.isInteger(i)?ze(t,e,r):ze(t,e,xe(r)),l=ze(t,e,((t,e)=>{let n,i;return e[0]<e[1]?(n=e[0],i=e[1]):(n=e[1],i=e[0]),Math.min(Math.max(t,n),i)})(h,[t,e]));!o[l]&&!isNaN(l)&&c.length>1&&(o[l]=1,a.push(l))})),a})),Ze=S(((t,e,n,i,r)=>$e(i(t),i(e),n).map((t=>xe(r(t))))));class Je extends Re{constructor(){super(...arguments),this.type=t.ScaleEnum.Linear}clone(){return(new Je).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}tickFormat(){return()=>{}}d3Ticks(t=10,e){const n=this.calculateVisibleDomain(this._range);return He(n[0],n[n.length-1],t,e)}ticks(t=10,e){var n;if(i(this._rangeFactorStart)&&i(this._rangeFactorEnd)&&(this._rangeFactorStart>0||this._rangeFactorEnd<1)&&2===this._range.length||!this._niceType)return this.d3Ticks(t,e);const r=null!==(n=this._niceDomain)&&void 0!==n?n:this._domain,s=this._domain,a=r[0],o=r[r.length-1];let h=Ve(s[0],s[s.length-1],t,e);if(!h.length)return h;if(this._domainValidator)h=h.filter(this._domainValidator);else if((h[0]!==a||h[h.length-1]!==o)&&this._niceType){const t=r.slice();if("all"===this._niceType?(t[0]=h[0],t[t.length-1]=h[h.length-1],this._niceDomain=t,this.rescale()):"min"===this._niceType&&h[0]!==a?(t[0]=h[0],this._niceDomain=t,this.rescale()):"max"===this._niceType&&h[h.length-1]!==o&&(t[t.length-1]=h[h.length-1],this._niceDomain=t,this.rescale()),"all"!==this._niceType){const e=Math.min(t[0],t[t.length-1]),n=Math.max(t[0],t[t.length-1]);h=h.filter((t=>t>=e&&t<=n))}}return h}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return $e(e[0],e[e.length-1],t)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return Ge(e[0],e[e.length-1],t)}nice(t=10,e){var n,i;const r=this._domain;let s=[];if(e){const t=Pe(r,e);if(s=t.niceMinMax,this._domainValidator=t.domainValidator,this._niceType=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else this._niceType="all";if(this._niceType){const e=je(r.slice(),t);"min"===this._niceType?e[e.length-1]=null!==(n=s[1])&&void 0!==n?n:e[e.length-1]:"max"===this._niceType&&(e[0]=null!==(i=s[0])&&void 0!==i?i:e[0]),this._niceDomain=e,this.rescale()}return this}niceMin(t=10){this._niceType="min";const e=this._domain[this._domain.length-1],n=je(this.domain(),t);return n&&(n[n.length-1]=e,this._niceDomain=n,this.rescale()),this}niceMax(t=10){this._niceType="max";const e=this._domain[0],n=je(this._domain.slice(),t);return n&&(n[0]=e,this._niceDomain=n,this.rescale()),this}}class Ke{nice(t=10,e){var n,i,r,s;const a=this._domain;let o=[],h=null;if(e){const t=Pe(a,e);if(o=t.niceMinMax,this._domainValidator=t.domainValidator,h=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else h="all";if(h){const t=ve(a.slice(),null!==(i=null===(n=this.getNiceConfig)||void 0===n?void 0:n.call(this))&&void 0!==i?i:{floor:t=>Math.floor(t),ceil:t=>Math.ceil(t)});return"min"===h?t[t.length-1]=null!==(r=o[1])&&void 0!==r?r:t[t.length-1]:"max"===h&&(t[0]=null!==(s=o[0])&&void 0!==s?s:t[0]),this._niceDomain=t,this.rescale(),this}return this}niceMin(){const t=this._domain[this._domain.length-1];this.nice();const e=this._domain.slice();return this._domain&&(e[e.length-1]=t,this._niceDomain=e,this.rescale()),this}niceMax(){const t=this._domain[0];this.nice();const e=this._domain.slice();return this._domain&&(e[0]=t,this._niceDomain=e,this.rescale()),this}}function Xe(t){return e=>-t(-e)}function tn(t=Number.EPSILON){return e=>Math.max(e,t)}class en extends Re{constructor(){super(ge(10),de(10)),this.type=t.ScaleEnum.Log,this._limit=tn(),this._logs=this.transformer,this._pows=this.untransformer,this._domain=[1,10],this._base=10}clone(){return(new en).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){var e;if(t)return this;super.rescale();const n=ge(this._base),i=de(this._base);return(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain)[0]<0?(this._logs=Xe(n),this._pows=Xe(i),this._limit=function(t=Number.EPSILON){return e=>Math.min(e,-t)}(),this.transformer=le,this.untransformer=ce):(this._logs=n,this._pows=i,this._limit=tn(),this.transformer=this._logs,this.untransformer=i),this}scale(t){var e;if(t=Number(t),Number.isNaN(t)||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this._limit).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const n=this._output(this.transformer(this._limit(this._clamp(t))));return this._fishEyeTransform?this._fishEyeTransform(n):n}base(t,e){return arguments.length?(this._base=t,this.rescale(e)):this._base}tickFormat(){return se}d3Ticks(t=10,e){const n=this.domain(),i=this._limit(n[0]),r=this._limit(n[n.length-1]);return We(i,r,t,this._base,this.transformer,this.untransformer,e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return Qe(this._limit(e[0]),this._limit(e[e.length-1]),t,this._base,this.transformer,this.untransformer)}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Ze(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return Ze(this._limit(e[0]),this._limit(e[e.length-1]),t,this.transformer,this.untransformer)}getNiceConfig(){return{floor:t=>this._pows(Math.floor(this._logs(this._limit(t)))),ceil:t=>Math.abs(t)>=1?Math.ceil(t):this._pows(Math.ceil(this._logs(this._limit(t))))}}}l(en,Ke);class nn extends Je{constructor(){super(),this.type=t.ScaleEnum.Pow,this._exponent=1}clone(){return(new nn).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=se,this.untransformer=se):.5===this._exponent?(this.transformer=oe,this.untransformer=he):(this.transformer=ae(this._exponent),this.untransformer=ae(1/this._exponent)),super.rescale()),this}exponent(t,e){return arguments.length?(this._exponent=t,this.rescale(e)):this._exponent}}class rn{constructor(){this.type=t.ScaleEnum.Quantile,this._range=[],this._domain=[],this._thresholds=[]}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]=g(this._domain,e/n);return this}scale(t){return o(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(u),this.rescale(e)}range(t,e){if(!t)return this._range.slice();const n=Array.from(t);return c(this._range,n)?this:(this._range=n,this.rescale(e))}clone(){return(new rn).domain(this._domain,!0).range(this._range).unknown(this._unknown)}}class sn{constructor(){this.type=t.ScaleEnum.Quantile,this._range=[0,1],this._domain=[.5],this.x0=0,this.x1=1,this.n=1}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 o(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 c(this._range,n)?this:(this.n=n.length-1,this._range=n,this.rescale(e))}clone(){return(new sn).domain([this.x0,this.x1],!0).range(this._range).unknown(this._unknown)}ticks(t=10){const e=this.domain();return Ve(e[0],e[e.length-1],t)}forceTicks(t=10){const e=this.domain();return $e(e[0],e[e.length-1],t)}stepTicks(t){const e=this.domain();return Ge(e[0],e[e.length-1],t)}nice(t=10){const e=je(this.domain(),t);return e?this.domain(e):this}niceMin(t=10){const e=this._domain[this._domain.length-1],n=je(this.domain(),t);return n&&(n[n.length-1]=e,this.domain(n)),this}niceMax(t=10){const e=this._domain[0],n=je(this.domain(),t);return n&&(n[0]=e,this.domain(n)),this}}class an extends Je{constructor(){super(oe,he),this.type=t.ScaleEnum.Sqrt}clone(){return(new an).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}}class on extends Je{constructor(){super(me(1),_e(1)),this.type=t.ScaleEnum.Symlog,this._const=1}clone(){return(new on).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=me(t),this.untransformer=_e(t),this.rescale(e)):this._const}d3Ticks(t=10,e){const n=this.domain(),i=n[0],r=n[n.length-1];return We(i,r,t,this._const,this.transformer,this.untransformer,e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return Qe(e[0],e[e.length-1],t,this._const,this.transformer,this.untransformer)}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Ze(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return Ze(e[0],e[e.length-1],t,this.transformer,this.untransformer)}}l(on,Ke);class hn{constructor(){this.type=t.ScaleEnum.Threshold,this._range=[0,1],this._domain=[.5],this.n=1}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}scale(t){return!n(t)&&o(+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 hn).domain(this._domain).range(this._range).unknown(this._unknown)}}const ln=[["second",1,et],["second",5,5e3],["second",10,1e4],["second",30,3e4],["minute",1,nt],["minute",5,3e5],["minute",10,6e5],["minute",30,18e5],["hour",1,it],["hour",3,3*it],["hour",6,6*it],["hour",12,12*it],["day",1,rt],["day",2,2*rt],["day",7,7*rt],["month",1,st],["month",3,3*st],["month",6,6*st],["year",1,365*rt]];function cn(t){return+R(t)}function un(t,e,n,i){const r=(+e-+t)/n,s=m(ln.map((t=>t[2])),r);if(s===ln.length){const r=Math.max(M(+t/at,+e/at,n),1),s=t=>(t[X(i)](Math.floor(t[P(i)]()/r)*r),t[function(t){return t?"setUTCMonth":"setMonth"}(i)](0,1),t[function(t){return t?"setUTCHours":"setHours"}(i)](0,0,0,0),t),a=(t,e)=>(t[X(i)](t[P(i)]()+e*r),t);return{floor:s,offset:a,ceil:ee(s,a)}}if(0===s){const i=Math.max(M(+t,+e,n),1),r=t=>(t.setTime(Math.floor(+t/i)*i),t),s=(t,e)=>(t.setTime(+t+e*i),t);return{floor:r,offset:s,ceil:ee(r,s)}}const[a,o]=ln[r/ln[s-1][2]<ln[s][2]/r?s-1:s],h=((t,e)=>"year"===t&&e?{floor:ut,offset:dt,count:gt,field:mt}:"month"===t&&e?{floor:wt,offset:bt,count:yt,field:vt}:"day"===t&&e?{floor:kt,offset:Et,count:Dt,field:Nt}:"hour"===t&&e?{floor:Bt,offset:Lt,count:Ut,field:At}:"minute"===t&&e?{floor:qt,offset:$t,count:Vt,field:Gt}:"second"===t&&e?{floor:Qt,offset:Zt,count:zt,field:Jt}:"year"===t?{floor:ot,offset:ht,count:lt,field:ct}:"month"===t?{floor:_t,offset:ft,count:pt,field:Mt}:"day"===t?{floor:xt,offset:St,count:Ft,field:Tt}:"hour"===t?{floor:Ct,offset:Rt,count:Ut,field:Ot}:"minute"===t?{floor:Ht,offset:It,count:Vt,field:Yt}:"second"===t?{floor:jt,offset:Pt,count:zt,field:Wt}:{floor:Kt,offset:Xt,count:te})(a,i);return ne(o,h)}class dn extends Re{constructor(e=!1){super(),this.type=t.ScaleEnum.Time,this._domain=e?[Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]:[+new Date(2e3,0,1),+new Date(2e3,0,2)],this._isUtc=e}invert(t){return new Date(super.invert(t))}domain(t,e){if(!t)return this._domain.map(R);const n=Array.from(t,cn);return this._domain=n,this.rescale(e)}ticks(t){const e=this.domain();let i=e[0],r=e[e.length-1];const s=r<i;s&&([i,r]=[r,i]);let o=t;(a(t)||n(t))&&(o=un(i,r,n(t)?10:t,this._isUtc)),i=o.ceil(i);const h=[];let l=+i,c=0;for(;l<=+r&&c<100;)h.push(new Date(l)),l=+o.offset(new Date(l),1),c++;return s?h.reverse():h}tickFormat(t,e){return tt(null==e?function(t,e){const n=R(t),i=n[z(e)]()+1,r=n[W(e)](),s=n[Q(e)](),a=n[Z(e)](),o=n[J(e)](),h=0===n[K(e)](),l=h&&0===o,c=l&&0===a,u=c&&0===s,d=u&&1===r;return d&&1===i?"YYYY":d?"YYYY-MM":u?"YYYY-MM-DD":c?"HH":l?"HH:mm":h?"HH:mm:ss":"HH:mm:ss SSS"}(this._domain[0],this._isUtc):e,this._isUtc)}clone(){return new dn(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 i=t;return(a(t)||n(t))&&(i=un(e[0],e[e.length-1],n(t)?10:t,this._isUtc)),i&&this.domain(ve(e,i)),this}utc(){return this._isUtc}}const gn=Symbol("implicit");class mn{constructor(){this.type=t.ScaleEnum.Identity}specified(t){var e;return t?(this._specified=Object.assign(null!==(e=this._specified)&&void 0!==e?e:{},t),this):Object.assign({},this._specified)}_getSpecifiedValue(t){if(this._specified)return this._specified[t]}clone(){return(new mn).unknown(this._unknown).domain(this._domain).specified(this._specified)}scale(t){const e=`${t}`,n=this._getSpecifiedValue(e);return void 0!==n?n:this._unknown!==gn&&this._domain&&!this._domain.includes(t)?this._unknown:t}invert(t){return t}domain(t){return t?(this._domain=t,this):this._domain?this._domain.slice():void 0}range(t){return t?this:this._domain?this._domain.slice():void 0}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}}t.BandScale=De,t.ContinuousScale=Re,t.IdentityScale=mn,t.LinearScale=Je,t.LogScale=en,t.OrdinalScale=Te,t.PointScale=class extends De{constructor(e){super(!1),this.type=t.ScaleEnum.Point,this._padding=0,this.paddingInner(1,e),this.padding=this.paddingOuter,this.paddingInner=void 0,this.paddingOuter=void 0}},t.PowScale=nn,t.QuantileScale=rn,t.QuantizeScale=sn,t.SqrtScale=an,t.SymlogScale=on,t.ThresholdScale=hn,t.TimeScale=dn,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(t){return!!re[t]},t.scaleWholeRangeSize=we,t.supportRangeFactor=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.Band:case t.ScaleEnum.Point: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 i(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function s(t,e,i,s,o){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new r(i,s||t,o),h=n?n+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),a.prototype.eventNames=function(){var t,i,r=[];if(0===this._eventsCount)return r;for(i in t=this._events)e.call(t,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},a.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,s=i.length,o=new Array(s);r<s;r++)o[r]=i[r].fn;return o},a.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},a.prototype.emit=function(t,e,i,r,s,o){var a=n?n+t:t;if(!this._events[a])return!1;var h,l,c=this._events[a],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,i),!0;case 4:return c.fn.call(c.context,e,i,r),!0;case 5:return c.fn.call(c.context,e,i,r,s),!0;case 6:return c.fn.call(c.context,e,i,r,s,o),!0}for(l=1,h=new Array(u-1);l<u;l++)h[l-1]=arguments[l];c.fn.apply(c.context,h)}else{var d,g=c.length;for(l=0;l<g;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),u){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,i);break;case 4:c[l].fn.call(c[l].context,e,i,r);break;default:if(!h)for(d=1,h=new Array(u-1);d<u;d++)h[d-1]=arguments[d];c[l].fn.apply(c[l].context,h)}}return!0},a.prototype.on=function(t,e,n){return s(this,t,e,n,!1)},a.prototype.once=function(t,e,n){return s(this,t,e,n,!0)},a.prototype.removeListener=function(t,e,i,r){var s=n?n+t:t;if(!this._events[s])return this;if(!e)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==e||r&&!a.once||i&&a.context!==i||o(this,s);else{for(var h=0,l=[],c=a.length;h<c;h++)(a[h].fn!==e||r&&!a[h].once||i&&a[h].context!==i)&&l.push(a[h]);l.length?this._events[s]=1===l.length?l[0]:l:o(this,s)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&o(this,e)):(this._events=new i,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=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var n=t=>"function"==typeof t;var i=t=>null==t;var r=t=>null!=t;var s=function(t){const n=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===n:"string"===n||e(t,"String")};var o=t=>Array.isArray?Array.isArray(t):e(t,"Array");var a=function(t){const n=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===n:"number"===n||e(t,"Number")};var h=t=>a(t)&&Number.isFinite(t);function l(t,e,n){const i=function(t){if(!t)return[];if(Object.keys)return Object.keys(t);const e=[];for(const n in t)t.hasOwnProperty(n)&&e.push(n);return e}(e);for(let r=0;r<i.length;r++){const s=i[r];(n?null!=e[s]:null==t[s])&&(t[s]=e[s])}return t}function c(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames){const i=Object.getOwnPropertyNames(e);for(let r=0;r<i.length;r++){const s=i[r];"constructor"!==s&&(n?null!=e[s]:null==t[s])&&(t[s]=e[s])}}else l(t,e,n)}function u(t,e){if(!o(t)||!o(e))return!1;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function d(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function g(t){return Number(t)}function m(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:g;const i=t.length;if(!i)return;if(e<=0||i<2)return n(t[0],0,t);if(e>=1)return n(t[i-1],i-1,t);const r=(i-1)*e,s=Math.floor(r),o=n(t[s],s,t);return o+(n(t[s+1],s+1,t)-o)*(r-s)}function f(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0;for(i(r)&&(r=t.length);n<r;){const i=n+r>>>1;d(t[i],e)>0?r=i:n=i+1}return n}const _=Math.sqrt(50),p=Math.sqrt(10),M=Math.sqrt(2);function w(t,e,n){const i=Math.abs(e-t)/Math.max(0,n);let r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10));const s=i/r;return s>=_?r*=10:s>=p?r*=5:s>=M&&(r*=2),e<t?-r:r}const b=1e-10,y=1e-10;function v(t,e){const n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:b,i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:y)*Math.max(t,e);return Math.abs(t-e)<=Math.max(n,i)}function x(t,e,n,i){return t>e&&!v(t,e,n,i)}function S(t,e,n,i){return t<e&&!v(t,e,n,i)}const F=t=>{let e=null,n=null;return function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return e&&r.every(((t,n)=>t===e[n]))||(e=r,n=t(...r)),n}},T=function(t){let e="",n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)-1;for(;n>=0;)e=`${e}${t}`,n-=1;return e};var k=function(t,e){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"right";const i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:" ",r=t+"",s=e-r.length;return s<=0?r:"left"===n?T(i,s)+r:"center"===n?T(i,Math.floor(s/2))+r+T(i,Math.ceil(s/2)):r+T(i,s)};var E=function(t,e,n){return t<e?e:t>n?n:t};function N(t,e){let n;return t>e&&(n=t,t=e,e=n),n=>Math.max(t,Math.min(e,n))}function D(t,e){return n=>t*(1-n)+e*n}function C(t,e){return function(n){return Math.round(t*(1-n)+e*n)}}const R=/^(?:(\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 U(t){if(t instanceof Date)return t;if(s(t)){const e=R.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);let n=+e[4]||0;return"Z"!==e[8].toUpperCase()&&(n-=+e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,n,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0))}return i(t)?new Date(NaN):new Date(Math.round(t))}function O(t,e,n){e/=100,n/=100;const i=(1-Math.abs(2*n-1))*e,r=i*(1-Math.abs(t/60%2-1)),s=n-i/2;let o=0,a=0,h=0;return 0<=t&&t<60?(o=i,a=r,h=0):60<=t&&t<120?(o=r,a=i,h=0):120<=t&&t<180?(o=0,a=i,h=r):180<=t&&t<240?(o=0,a=r,h=i):240<=t&&t<300?(o=r,a=0,h=i):300<=t&&t<360&&(o=i,a=0,h=r),o=Math.round(255*(o+s)),a=Math.round(255*(a+s)),h=Math.round(255*(h+s)),{r:o,g:a,b:h}}function L(t,e,n){t/=255,e/=255,n/=255;const i=Math.min(t,e,n),r=Math.max(t,e,n),s=r-i;let o=0,a=0,h=0;return o=0===s?0:r===t?(e-n)/s%6:r===e?(n-t)/s+2:(t-e)/s+4,o=Math.round(60*o),o<0&&(o+=360),h=(r+i)/2,a=0===s?0:s/(1-Math.abs(2*h-1)),a=+(100*a).toFixed(1),h=+(100*h).toFixed(1),{h:o,s:a,l:h}}const B=/^#([0-9a-f]{3,8})$/,A={transparent:4294967040},H={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 I(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function V(t){return a(t)?new j(t>>16,t>>8&255,255&t,1):o(t)?new j(t[0],t[1],t[2]):new j(255,255,255)}function Y(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function q(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const $=(t,e)=>{const n=B.exec(t);if(e||n){const t=parseInt(n[1],16),e=n[1].length;return 3===e?new j((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?V(t):8===e?new j(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class G{static Brighter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new G(t).brighter(e).toRGBA()}static SetOpacity(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new G(t).setOpacity(e).toRGBA()}static getColorBrightness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl";const n=t instanceof G?t:new G(t);switch(e){case"hsv":default:return n.getHSVBrightness();case"hsl":return n.getHSLBrightness();case"lum":return n.getLuminance();case"lum2":return n.getLuminance2();case"lum3":return n.getLuminance3()}}static parseColorString(t){if(r(A[t]))return function(t){return a(t)?new j(t>>>24,t>>>16&255,t>>>8&255,255&t):o(t)?new j(t[0],t[1],t[2],t[3]):new j(255,255,255,1)}(A[t]);if(r(H[t]))return V(H[t]);const e=`${t}`.trim().toLowerCase(),n=$(e);if(void 0!==n)return n;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const t=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new j(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const t=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),n=O(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new j(n.r,n.g,n.b,parseFloat(t[3]))}}constructor(t){const e=G.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new j(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:n,b:i}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(n*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(i*t))),this}add(t){const{r:e,g:n,b:i}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,n+t.color.g),this.color.b+=Math.min(255,i+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:n,b:i}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(n*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(i*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){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)}setHsl(t,e,n){const r=this.color.opacity,s=L(this.color.r,this.color.g,this.color.b),o=O(i(t)?s.h:E(t,0,360),i(e)?s.s:e>=0&&e<=1?100*e:e,i(n)?s.l:n<=1&&n>=0?100*n:n);return this.color=new j(o.r,o.g,o.b,r),this}setRGB(t,e,n){return!i(t)&&(this.color.r=t),!i(e)&&(this.color.g=e),!i(n)&&(this.color.b=n),this}setHex(t){const e=`${t}`.trim().toLowerCase(),n=$(e,!0);return null!=n?n:this}setColorName(t){const e=H[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}clone(){return new G(this.color.toString())}copyGammaToLinear(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;const n=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,n),this.color.g=Math.pow(t.color.g,n),this.color.b=Math.pow(t.color.b,n),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=Y(t.color.r),this.color.g=Y(t.color.g),this.color.b=Y(t.color.b),this}copyLinearToSRGB(t){return this.color.r=q(t.color.r),this.color.g=q(t.color.g),this.color.b=q(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class j{constructor(t,e,n,i){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+n)?255:Math.max(0,Math.min(255,+n)),r(i)?this.opacity=isNaN(+i)?1:Math.max(0,Math.min(1,+i)):this.opacity=1}formatHex(){return`#${I(this.r)+I(this.g)+I(this.b)+(1===this.opacity?"":I(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:n,l:i}=L(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${n}%,${i}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}var P=Object.freeze({__proto__:null,Color:G,DEFAULT_COLORS:H,RGB:j,hexToRgb:function(t){let e="",n="",i="";const r="#"===t[0]?1:0;for(let s=r;s<t.length;s++)"#"!==t[s]&&(s<r+2?e+=t[s]:s<r+4?n+=t[s]:s<r+6&&(i+=t[s]));return[parseInt(e,16),parseInt(n,16),parseInt(i,16)]},hslToRgb:O,interpolateRgb:function(t,e){const n=t.r,i=e.r,r=t.g,s=e.g,o=t.b,a=e.b,h=t.opacity,l=e.opacity;return t=>{const e=Math.round(n*(1-t)+i*t),c=Math.round(r*(1-t)+s*t),u=Math.round(o*(1-t)+a*t);return new j(e,c,u,h*(1-t)+l*t)}},rgbToHex:function(t,e,n){return Number((1<<24)+(t<<16)+(e<<8)+n).toString(16).slice(1)},rgbToHsl:L});function z(t){return t?"getUTCFullYear":"getFullYear"}function W(t){return t?"getUTCMonth":"getMonth"}function Q(t){return t?"getUTCDate":"getDate"}function Z(t){return t?"getUTCHours":"getHours"}function J(t){return t?"getUTCMinutes":"getMinutes"}function K(t){return t?"getUTCSeconds":"getSeconds"}function X(t){return t?"getUTCMilliseconds":"getMilliseconds"}function tt(t){return t?"setUTCFullYear":"setFullYear"}function et(t,e){return n=>{const i=U(n),r=i[z(e)](),s=i[W(e)]()+1,o=Math.floor((s-1)/3)+1,a=i[Q(e)](),h=i["get"+(e?"UTC":"")+"Day"](),l=i[Z(e)](),c=(l-1)%12+1,u=i[J(e)](),d=i[K(e)](),g=i[X(e)]();return(t||"").replace(/YYYY/g,k(r+"",4,"0","left")).replace(/yyyy/g,r+"").replace(/yy/g,r%100+"").replace(/Q/g,o+"").replace(/MM/g,k(s,2,"0","left")).replace(/M/g,s+"").replace(/dd/g,k(a,2,"0","left")).replace(/d/g,a+"").replace(/e/g,h+"").replace(/HH/g,k(l,2,"0","left")).replace(/H/g,l+"").replace(/hh/g,k(c+"",2,"0","left")).replace(/h/g,c+"").replace(/mm/g,k(u,2,"0","left")).replace(/m/g,u+"").replace(/ss/g,k(d,2,"0","left")).replace(/s/g,d+"").replace(/SSS/g,k(g,3,"0","left")).replace(/S/g,g+"")}}const nt=1e3,it=6e4,rt=36e5,st=24*rt,ot=31*st,at=365*st,ht=t=>(t.setMonth(0,1),t.setHours(0,0,0,0),t),lt=(t,e)=>(t.setFullYear(t.getFullYear()+e),t),ct=(t,e)=>e.getFullYear()-t.getFullYear(),ut=t=>t.getFullYear(),dt=t=>(t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0),t),gt=(t,e)=>(t.setUTCFullYear(t.getUTCFullYear()+e),t),mt=(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),ft=t=>t.getUTCFullYear(),_t=t=>(t.setDate(1),t.setHours(0,0,0,0),t),pt=(t,e)=>(t.setMonth(t.getMonth()+e),t),Mt=(t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear()),wt=t=>t.getMonth(),bt=t=>(t.setUTCDate(1),t.setUTCHours(0,0,0,0),t),yt=(t,e)=>(t.setUTCMonth(t.getUTCMonth()+e),t),vt=(t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear()),xt=t=>t.getUTCMonth(),St=t=>(t.setHours(0,0,0,0),t),Ft=(t,e)=>(t.setDate(t.getDate()+e),t),Tt=(t,e)=>(+e-+t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/st,kt=t=>t.getDate()-1,Et=t=>(t.setUTCHours(0,0,0,0),t),Nt=(t,e)=>(t.setUTCDate(t.getUTCDate()+e),t),Dt=(t,e)=>(+e-+t)/st,Ct=t=>t.getUTCDate()-1,Rt=t=>(t.setTime(+t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes()),t),Ut=(t,e)=>(t.setHours(t.getHours()+e),t),Ot=(t,e)=>(+e-+t)/rt,Lt=t=>t.getHours(),Bt=t=>(t.setTime(+t-t.getUTCMilliseconds()-1e3*t.getUTCSeconds()-6e4*t.getUTCMinutes()),t),At=(t,e)=>(t.setUTCHours(t.getUTCHours()+e),t),Ht=t=>t.getUTCHours(),It=t=>(t.setTime(+t-t.getMilliseconds()-1e3*t.getSeconds()),t),Vt=(t,e)=>(t.setMinutes(t.getMinutes()+e),t),Yt=(t,e)=>(+e-+t)/6e4,qt=t=>t.getMinutes(),$t=t=>(t.setTime(+t-t.getUTCMilliseconds()-1e3*t.getUTCSeconds()),t),Gt=(t,e)=>(t.setUTCMinutes(t.getUTCMinutes()+e),t),jt=t=>t.getUTCMinutes(),Pt=t=>(t.setTime(+t-t.getMilliseconds()),t),zt=(t,e)=>(t.setSeconds(t.getSeconds()+e),t),Wt=(t,e)=>(+e-+t)/1e3,Qt=t=>t.getSeconds(),Zt=t=>(t.setTime(+t-t.getUTCMilliseconds()),t),Jt=(t,e)=>(t.setUTCSeconds(t.getUTCSeconds()+e),t),Kt=t=>t.getUTCSeconds(),Xt=t=>t,te=(t,e)=>(t.setTime(+t+e),t),ee=(t,e)=>+e-+t,ne=(t,e)=>n=>{const i=new Date(+n-1);return e(i,1),t(i),i},ie=(t,e)=>{let{floor:n,offset:i,field:r,count:s}=e;const o=Math.floor(t);if(!Number.isFinite(o)||o<=0)return null;if(o<=1)return{floor:n,offset:i,ceil:ne(n,i)};const a=((t,e)=>(n,i)=>{const r=new Date,s=new Date;return r.setTime(+n),s.setTime(+i),t(r),t(s),Math.floor(e(r,s))})(n,s),h=r?t=>r(t)%o==0:t=>a(0,t)%o==0,l=t=>{if(!Number.isNaN(+t))for(n(t);!h(t);)t.setTime(+t-1),n(t);return t},c=(t,e)=>{if(!Number.isNaN(+t))if(o<0)for(;++e<=0;)for(i(t,-1);!h(t);)i(t,-1);else for(;--e>=0;)for(i(t,1);!h(t);)i(t,1);return t};return{floor:l,offset:c,ceil:ne(l,c)}};var re;t.ScaleEnum=void 0,(re=t.ScaleEnum||(t.ScaleEnum={})).Identity="identity",re.Linear="linear",re.Log="log",re.Pow="pow",re.Sqrt="sqrt",re.Symlog="symlog",re.Time="time",re.Quantile="quantile",re.Quantize="quantize",re.Threshold="threshold",re.Ordinal="ordinal",re.Point="point",re.Band="band";const se={};function oe(t){return t}Object.values(t.ScaleEnum).forEach((t=>{se[t]=!0}));const ae=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t),he=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),le=t=>t<0?-t*t:t*t,ce=t=>-Math.log(-t),ue=t=>-Math.exp(-t),de=t=>isFinite(t)?Math.pow(10,t):t<0?0:t,ge=t=>10===t?de:t===Math.E?Math.exp:e=>Math.pow(t,e),me=t=>t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:(t=Math.log(t),e=>Math.log(e)/t),fe=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),_e=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t;function pe(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 Me(t,e,n){const i=t[0],r=t[1],s=e[0],o=e[1];let a,h;return r<i?(a=pe(r,i),h=n(o,s)):(a=pe(i,r),h=n(s,o)),t=>h(a(t))}function we(t,e,n){let i;return i=1===t?t+2*n:t-e+2*n,t?i>0?i:1:0}function be(t,e,n,i){1===n&&(n=0);return we(t,n,i)*(e/(1-n))}function ye(t,e){const n=(t[1]-t[0])/(e[1]-e[0]),i=t[0]-n*e[0];return[i,n+i]}function ve(t,e,n){const i=Math.min(t.length,e.length)-1,r=new Array(i),s=new Array(i);let o=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<i;)r[o]=pe(t[o],t[o+1]),s[o]=n(e[o],e[o+1]);return function(e){const n=f(t,e,1,i)-1;return s[n](r[n](e))}}const xe=(t,e)=>{const n=t.slice();let i=0,r=n.length-1,s=n[i],o=n[r];return o<s&&([i,r]=[r,i],[s,o]=[o,s]),n[i]=e.floor(s),n[r]=e.ceil(o),n},Se=(t,e=!1)=>{const n=Math.floor(Math.log10(t)),i=t/Math.pow(10,n);let r;return r=e?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10,r*Math.pow(10,n)};class Fe{constructor(){this._rangeFactorStart=null,this._rangeFactorEnd=null}_calculateWholeRange(t){return this._wholeRange?this._wholeRange:r(this._rangeFactorStart)&&r(this._rangeFactorEnd)&&2===t.length?(this._wholeRange=ye(t,[this._rangeFactorStart,this._rangeFactorEnd]),this._wholeRange):t}rangeFactor(t,e,n){return t?(2===t.length&&t.every((t=>t>=0&&t<=1))&&(this._wholeRange=null,0===t[0]&&1===t[1]?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorStart=t[0],this._rangeFactorEnd=t[1])),this):n?(this._wholeRange=null,this._rangeFactorStart=null,this._rangeFactorEnd=null,this):r(this._rangeFactorStart)&&r(this._rangeFactorEnd)?[this._rangeFactorStart,this._rangeFactorEnd]:null}rangeFactorStart(t,e){var n;return i(t)?this._rangeFactorStart:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!i(this._rangeFactorEnd)&&1!==this._rangeFactorEnd?(this._rangeFactorStart=t,this._rangeFactorEnd=null!==(n=this._rangeFactorEnd)&&void 0!==n?n:1):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}rangeFactorEnd(t,e){var n;return i(t)?this._rangeFactorEnd:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!i(this._rangeFactorStart)&&0!==this._rangeFactorStart?(this._rangeFactorEnd=t,this._rangeFactorStart=null!==(n=this._rangeFactorStart)&&void 0!==n?n:0):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}generateFishEyeTransform(){var t;if(!this._fishEyeOptions)return void(this._fishEyeTransform=null);const{distortion:e=2,radiusRatio:n=.1,radius:r}=this._fishEyeOptions,s=this.range(),o=s[0],a=s[s.length-1],h=Math.min(o,a),l=Math.max(o,a),c=E(null!==(t=this._fishEyeOptions.focus)&&void 0!==t?t:0,h,l),u=i(r)?(l-h)*n:r;let d=Math.exp(e);d=d/(d-1)*u;const g=e/u;this._fishEyeTransform=t=>{const e=Math.abs(t-c);if(e>=u)return t;if(e<=1e-6)return c;const n=d*(1-Math.exp(-e*g))/e*.75+.25;return c+(t-c)*n}}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}get(t,e){var n;return null!==(n=null==this?void 0:this[t])&&void 0!==n?n:e}}const Te=Symbol("implicit");class ke extends Fe{specified(t){var e;return t?(this._specified=Object.assign(null!==(e=this._specified)&&void 0!==e?e:{},t),this):Object.assign({},this._specified)}_getSpecifiedValue(t){if(this._specified)return this._specified[t]}constructor(){super(),this.type=t.ScaleEnum.Ordinal,this._index=new Map,this._domain=[],this._ordinalRange=[],this._unknown=Te}clone(){const t=(new ke).domain(this._domain).range(this._ordinalRange).unknown(this._unknown);return this._specified&&t.specified(this._specified),t}calculateVisibleDomain(t){if(r(this._rangeFactorStart)&&r(this._rangeFactorEnd)&&2===t.length){return[this.invert(t[0]),this.invert(t[1])]}return this._domain}scale(t){const e=`${t}`,n=this._getSpecifiedValue(e);if(void 0!==n)return n;let i=this._index.get(e);if(!i){if(this._unknown!==Te)return this._unknown;i=this._domain.push(t),this._index.set(e,i)}const r=this._ordinalRange[(i-1)%this._ordinalRange.length];return this._fishEyeTransform?this._fishEyeTransform(r):r}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}index(t){var e;return this._index&&null!==(e=this._index.get(`${t}`))&&void 0!==e?e:-1}}function Ee(t,e,n,i){const r=[];let s=t;for(;s<=e;)r.push(s),s+=n;return i&&r.reverse(),r}function Ne(t,e,n,i){let r,s;if(e=Math.floor(+e),t=Math.floor(+t),!(n=Math.floor(+n)))return[];if(t===e)return[t];if(r=e<t){const n=t;t=e,e=n}let o=N(1,e-t+1)(n);if(s=Math.floor((e-t+1)/o),!i)for(;Math.ceil((e-t+1)/s)>n&&o>1;)o-=1,s=Math.floor((e-t)/o);return Ee(t,e,s,r)}class De extends ke{constructor(e){super(),this.type=t.ScaleEnum.Band,this._range=[0,1],this._step=void 0,this._bandwidth=void 0,this._isFixed=!1,this._round=!1,this._paddingInner=0,this._paddingOuter=0,this._align=.5,this._unknown=void 0,delete this.unknown,this.rescale(e)}rescale(t,e){if(t)return this;this._wholeRange=null;const n=this._calculateWholeRange(this._range,e),i=super.domain().length,r=n[1]<n[0];let s=n[Number(r)-0];const o=n[1-Number(r)],a=we(i,this._paddingInner,this._paddingOuter);return this._step=(o-s)/Math.max(1,a||1),this._round&&(this._step=Math.floor(this._step)),s+=(o-s-this._step*(i-this._paddingInner))*this._align,this.isBandwidthFixed()||(this._bandwidth=this._step*(1-this._paddingInner)),this._round&&(s=Math.round(s),this.isBandwidthFixed()||(this._bandwidth=Math.round(this._bandwidth))),this._bandRangeState={reverse:r,start:r?s+this._step*(i-1):s,count:i},this.generateFishEyeTransform(),this}scale(t){if(!this._bandRangeState)return;const e=`${t}`,n=this._getSpecifiedValue(e);if(void 0!==n)return n;let i=this._index.get(e);if(!i){if(this._unknown!==Te)return this._unknown;i=this._domain.push(t),this._index.set(e,i)}const{count:r,start:s,reverse:o}=this._bandRangeState,a=s+(o?-1:1)*((i-1)%r)*this._step;return this._fishEyeTransform?this._fishEyeTransform(a):a}_calculateWholeRange(t,e){if(this._wholeRange)return this._wholeRange;if((this._minBandwidth||this._maxBandwidth)&&!this._isBandwidthFixedByUser()){let e;if(r(this._rangeFactorStart)&&r(this._rangeFactorEnd)&&2===t.length){const n=ye(t,[this._rangeFactorStart,this._rangeFactorEnd]);e=Math.abs(n[1]-n[0])}else e=Math.abs(t[1]-t[0]);const n=function(t,e,n,i,r){const s=we(t,n,i);let o=e/Math.max(1,s||1);r&&(o=Math.floor(o));let a=o*(1-n);return r&&(a=Math.round(a)),a}(super.domain().length,e,this._paddingInner,this._paddingOuter,this._round);n<this._minBandwidth?(this._bandwidth=this._minBandwidth,this._isFixed=!0):n>this._maxBandwidth?(this._bandwidth=this._maxBandwidth,this._isFixed=!0):(this._bandwidth=n,this._isFixed=!1)}if(this.isBandwidthFixed()){const n=be(super.domain().length,this._bandwidth,this._paddingInner,this._paddingOuter)*Math.sign(t[1]-t[0]),i=Math.min((t[1]-t[0])/n,1);if(r(this._rangeFactorStart)&&r(this._rangeFactorEnd)){if(n>0){const e=t[0]-n*this._rangeFactorStart,i=e+n;this._wholeRange=[e,i]}else{const e=t[1]+n*(1-this._rangeFactorEnd),i=e-n;this._wholeRange=[i,e]}const r=this._rangeFactorStart+i<=1,s=this._rangeFactorEnd-i>=0;"rangeFactorStart"===e&&r?this._rangeFactorEnd=this._rangeFactorStart+i:"rangeFactorEnd"===e&&s?this._rangeFactorStart=this._rangeFactorEnd-i:t[0]<=t[1]?r?this._rangeFactorEnd=this._rangeFactorStart+i:s?this._rangeFactorStart=this._rangeFactorEnd-i:(this._rangeFactorStart=0,this._rangeFactorEnd=i):s?this._rangeFactorStart=this._rangeFactorEnd-i:r?this._rangeFactorEnd=this._rangeFactorStart+i:(this._rangeFactorStart=1-i,this._rangeFactorEnd=1)}else this._rangeFactorStart=0,this._rangeFactorEnd=i,this._wholeRange=[t[0],t[0]+n];return this._wholeRange}return super._calculateWholeRange(t)}calculateWholeRangeSize(){const t=this._calculateWholeRange(this._range);return Math.abs(t[1]-t[0])}calculateVisibleDomain(t){const e=this._domain;if(r(this._rangeFactorStart)&&r(this._rangeFactorEnd)&&e.length){const n=this._getInvertIndex(t[0]),i=this._getInvertIndex(t[1]);return e.slice(Math.min(n,i),Math.max(n,i)+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}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 Ne(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 Ne(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){let i;if(n=N(1,(e=Math.floor(+e))-(t=Math.floor(+t))+1)(Math.floor(+n)),i=e<t){const n=t;t=e,e=n}return Ee(t,e,n,i)}(0,e.length-1,t);return n.map((t=>e[t]))}_getInvertIndex(t){let e=0;const n=this.step()/2,i=this.bandwidth()/2,r=this._domain.length,s=this.range(),o=s[0]>s[s.length-1];for(e=0;e<r;e++){const s=this.scale(this._domain[e])+i;if(0===e&&(!o&&!x(t,s+n)||o&&!S(t,s-n)))break;if(e===r-1)break;if(!S(t,s-n)&&!x(t,s+n))break}return e>=0&&e<=r-1?e:r-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}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()}rangeFactorStart(t,e){return i(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this.rescale(e,"rangeFactorStart"))}rangeFactorEnd(t,e){return i(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this.rescale(e,"rangeFactorEnd"))}bandwidth(t,e){return t?("auto"===t?(this._bandwidth=void 0,this._isFixed=!1):(this._bandwidth=t,this._isFixed=!0),this._userBandwidth=t,this.rescale(e)):this._bandwidth}maxBandwidth(t,e){return t?(this._maxBandwidth="auto"===t?void 0:t,this.rescale(e)):this._maxBandwidth}minBandwidth(t,e){return t?(this._minBandwidth="auto"===t?void 0:t,this.rescale(e)):this._minBandwidth}fishEye(t,e,n){return t||n?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}isBandwidthFixed(){return this._isFixed&&!!this._bandwidth}_isBandwidthFixedByUser(){return this._isFixed&&this._userBandwidth&&a(this._userBandwidth)}clone(){var t,e,n;return new De(!0).domain(this._domain,!0).range(this._range,!0).round(this._round,!0).paddingInner(this._paddingInner,!0).paddingOuter(this._paddingOuter,!0).align(this._align,!0).bandwidth(null!==(t=this._userBandwidth)&&void 0!==t?t:"auto",!0).maxBandwidth(null!==(e=this._maxBandwidth)&&void 0!==e?e:"auto",!0).minBandwidth(null!==(n=this._maxBandwidth)&&void 0!==n?n:"auto")}}const{interpolateRgb:Ce}=P;function Re(t,e){const n=typeof e;let r;if(i(e)||"boolean"===n)return()=>e;if("number"===n)return D(t,e);if("string"===n){if(r=G.parseColorString(e)){const e=Ce(G.parseColorString(t),r);return t=>e(t).formatRgb()}return D(Number(t),Number(e))}return e instanceof j?Ce(t,e):e instanceof G?Ce(t.color,e.color):e instanceof Date?function(t,e){const n=t.valueOf(),i=e.valueOf(),r=new Date;return t=>(r.setTime(n*(1-t)+i*t),r)}(t,e):D(Number(t),Number(e))}class Ue extends Fe{constructor(t=oe,e=oe){super(),this._unknown=void 0,this.transformer=t,this.untransformer=e,this._forceAlign=!0,this._domain=[0,1],this._range=[0,1],this._clamp=oe,this._piecewise=Me,this._interpolate=Re}calculateVisibleDomain(t){var e;if(r(this._rangeFactorStart)&&r(this._rangeFactorEnd)&&2===t.length){return[this.invert(t[0]),this.invert(t[1])]}return null!==(e=this._niceDomain)&&void 0!==e?e:this._domain}fishEye(t,e,n){return t||n?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}scale(t){var e;if(t=Number(t),Number.isNaN(t)||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const n=this._output(this.transformer(this._clamp(t)));return this._fishEyeTransform?this._fishEyeTransform(n):n}invert(t){var e;return this._input||(this._input=this._piecewise(this._calculateWholeRange(this._range),(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),D)),this._clamp(this.untransformer(this._input(t)))}domain(t,e){var n;if(!t)return(null!==(n=this._niceDomain)&&void 0!==n?n:this._domain).slice();this._domainValidator=null,this._niceType=null,this._niceDomain=null;const i=Array.from(t,g);return this._domain=i,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=C,this.rescale(e)}rescale(t){var e;if(t)return this;const n=null!==(e=this._niceDomain)&&void 0!==e?e:this._domain,i=n.length,r=this._range.length;let s=Math.min(i,r);if(i&&i<r&&this._forceAlign){const t=r-i+1,e=n[i-1],o=i>=2?(e-n[i-2])/t:0;for(let r=1;r<=t;r++)n[i-2+r]=e-o*(t-r);s=r}return this._autoClamp&&(this._clamp=N(n[0],n[s-1])),this._piecewise=s>2?ve:Me,this._output=this._input=null,this._wholeRange=null,this.generateFishEyeTransform(),this}clamp(t,e,n){return arguments.length?(e?(this._autoClamp=!1,this._clamp=e):(this._autoClamp=!!t,this._clamp=t?void 0:oe),this.rescale(n)):this._clamp!==oe}interpolate(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}ticks(t=10){return[]}tickData(t=10){const e=this.ticks(t);return(null!=e?e:[]).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()}rangeFactorStart(t,e){return i(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this._output=this._input=null,this)}rangeFactorEnd(t,e){return i(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this._output=this._input=null,this)}forceAlignDomainRange(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}const Oe=Math.sqrt(50),Le=Math.sqrt(10),Be=Math.sqrt(2),Ae=[1,2,5,10],He=(t,e,n)=>{let i=1,s=t;const o=Math.floor((e-1)/2),a=Math.abs(t);return t>=0&&t<=Number.MIN_VALUE?s=0:t<0&&t>=-Number.MIN_VALUE?s=-(e-1):!n&&a<1?i=qe(a).step:(n||a>1)&&(s=Math.floor(t)-o*i),i>0?(t>0?s=Math.max(s,0):t<0&&(s=Math.min(s,-(e-1)*i)),function(t,e,n){r(e)||(e=t,t=0),r(n)||(n=1);let i=-1;const s=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(s);for(;++i<s;)o[i]=t+i*n;return o}(0,e).map((t=>s+t*i))):t>0?Ve(0,-(e-1)/i,i):Ve((e-1)/i,0,i)},Ie=F(((t,e,n,i)=>{let r,s,o,a,h=-1;if(n=+n,(t=+t)===(e=+e))return[t];if(Math.abs(t-e)<=Number.MIN_VALUE&&n>0)return[t];if((r=e<t)&&(s=t,t=e,e=s),a=$e(t,e,n).step,!isFinite(a))return[];if(a>0){let n=Math.round(t/a),i=Math.round(e/a);for(n*a<t&&++n,i*a>e&&--i,o=new Array(s=i-n+1);++h<s;)o[h]=(n+h)*a}else if(a<0&&(null==i?void 0:i.noDecimals)){a=1;const n=Math.ceil(t),i=Math.floor(e);if(!(n<=i))return[];for(o=new Array(s=i-n+1);++h<s;)o[h]=n+h}else{a=-a;let n=Math.round(t*a),i=Math.round(e*a);for(n/a<t&&++n,i/a>e&&--i,o=new Array(s=i-n+1);++h<s;)o[h]=(n+h)/a}return r&&o.reverse(),o})),Ve=(t,e,n)=>{let i,r,s=-1;if(n>0){let o=Math.floor(t/n),a=Math.ceil(e/n);for((o+1)*n<t&&++o,(a-1)*n>e&&--a,r=new Array(i=a-o+1);++s<i;)r[s]=(o+s)*n}else{n=-n;let o=Math.floor(t*n),a=Math.ceil(e*n);for((o+1)/n<t&&++o,(a-1)/n>e&&--a,r=new Array(i=a-o+1);++s<i;)r[s]=(o+s)/n}return r},Ye=F(((t,e,n,i)=>{let r,s,o;if(n=+n,(t=+t)===(e=+e))return He(t,n,null==i?void 0:i.noDecimals);if(Math.abs(t-e)<=Number.MIN_VALUE&&n>0)return He(t,n,null==i?void 0:i.noDecimals);(r=e<t)&&(o=t,t=e,e=o);const a=$e(t,e,n);let h=a.step;if(!isFinite(h))return[];if(h>0){let i=1;const{power:r,gap:o}=a,l=10===o?2*10**r:1*10**r;for(;i<=5&&(s=Ve(t,e,h),s.length>n+1)&&n>2;)h+=l,i+=1;n>2&&s.length<n-1&&(s=((t,e,n)=>{let i;const r=t[0],s=t[t.length-1],o=e-t.length;if(s<=0){const e=[];for(i=o;i>=1;i--)e.push(r-i*n);return e.concat(t)}if(r>=0){for(i=1;i<=o;i++)t.push(s+i*n);return t}let a=[];const h=[];for(i=1;i<=o;i++)i%2==0?a=[r-Math.floor(i/2)*n].concat(a):h.push(s+Math.ceil(i/2)*n);return a.concat(t).concat(h)})(s,n,h))}else(null==i?void 0:i.noDecimals)&&h<0&&(h=1),s=Ve(t,e,h);return r&&s.reverse(),s})),qe=t=>{const e=Math.floor(Math.log(t)/Math.LN10),n=t/10**e;let i=Ae[0];return n>=Oe?i=Ae[3]:n>=Le?i=Ae[2]:n>=Be&&(i=Ae[1]),e>=0?{step:i*10**e,gap:i,power:e}:{step:-(10**-e)/i,gap:i,power:e}};function $e(t,e,n){const i=(e-t)/Math.max(0,n);return qe(i)}function Ge(t,e,n){let i;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if(n<=0||0===(i=function(t,e,n){const i=(e-t)/Math.max(1,n-1);return i}(t,e,n))||!isFinite(i))return[];const r=new Array(n);for(let e=0;e<n;e++)r[e]=t+e*i;return r}function je(t,e,n){let i,r,s=-1;if(n=+n,(r=(e=+e)<(t=+t))&&(i=t,t=e,e=i),!isFinite(n)||e-t<=n)return[t];const o=Math.floor((e-t)/n+1),a=new Array(o);for(;++s<o;)a[s]=t+s*n;return r&&a.reverse(),a}function Pe(t,e=10){let n,i,r=0,s=t.length-1,o=t[r],a=t[s],h=10;for(a<o&&(i=o,o=a,a=i,i=r,r=s,s=i);h-- >0;){if(i=$e(o,a,e).step,i===n)return t[r]=o,t[s]=a,t;if(i>0)o=Math.floor(o/i)*i,a=Math.ceil(a/i)*i;else{if(!(i<0))break;o=Math.ceil(o*i)/i,a=Math.floor(a*i)/i}n=i}}function ze(t,e){const n=a(e.forceMin),i=a(e.forceMax);let r=null;const s=[];let o=null;const h=n&&i?t=>t>=e.forceMin&&t<=e.forceMax:n?t=>t>=e.forceMin:i?t=>t<=e.forceMax:null;return n?s[0]=e.forceMin:a(e.min)&&e.min<=Math.min(t[0],t[t.length-1])&&(s[0]=e.min),i?s[1]=e.forceMax:a(e.max)&&e.max>=Math.max(t[0],t[t.length-1])&&(s[1]=e.max),a(s[0])&&a(s[1])?(o=t.slice(),o[0]=s[0],o[o.length-1]=s[1]):r=a(s[0])||a(s[1])?a(s[0])?"max":"min":"all",{niceType:r,niceDomain:o,niceMinMax:s,domainValidator:h}}const We=(t,e,n)=>Math.abs(e-t)<1?+n.toFixed(1):Math.round(+n),Qe=F(((t,e,n,i,r,s,o)=>{let a=t,h=e;const l=h<a;l&&([a,h]=[h,a]);let c,u,d=r(a),g=r(h),m=[];if(!(i%1)&&g-d<n){if(d=Math.floor(d),g=Math.ceil(g),a>0){for(;d<=g;++d)for(c=1;c<i;++c)if(u=d<0?c/s(-d):c*s(d),!(u<a)){if(u>h)break;m.push(u)}}else for(;d<=g;++d)for(c=i-1;c>=1;--c)if(u=d>0?c/s(-d):c*s(d),!(u<a)){if(u>h)break;m.push(u)}2*m.length<n&&(m=Ye(a,h,n))}else m=Ye(d,g,Math.min(g-d,n)).map(s);return m=m.filter((t=>0!==t)),(null==o?void 0:o.noDecimals)&&(m=Array.from(new Set(m.map((t=>Math.floor(t)))))),l?m.reverse():m})),Ze=F(((t,e,n,i,r,s)=>{const o=[],a={},h=r(t),l=r(e);let c=[];if(Number.isInteger(i))c=Ye(h,l,n);else{const t=(l-h)/(n-1);for(let e=0;e<n;e++)c.push(h+e*t)}return c.forEach((n=>{const r=s(n),h=Number.isInteger(i)?We(t,e,r):We(t,e,Se(r)),l=We(t,e,((t,e)=>{let n,i;return e[0]<e[1]?(n=e[0],i=e[1]):(n=e[1],i=e[0]),Math.min(Math.max(t,n),i)})(h,[t,e]));!a[l]&&!isNaN(l)&&c.length>1&&(a[l]=1,o.push(l))})),o})),Je=F(((t,e,n,i,r)=>Ge(i(t),i(e),n).map((t=>Se(r(t))))));class Ke extends Ue{constructor(){super(...arguments),this.type=t.ScaleEnum.Linear}clone(){return(new Ke).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}tickFormat(){return()=>{}}d3Ticks(t=10,e){const n=this.calculateVisibleDomain(this._range);return Ie(n[0],n[n.length-1],t,e)}ticks(t=10,e){var i;if(n(null==e?void 0:e.customTicks))return e.customTicks(this,t);if(r(this._rangeFactorStart)&&r(this._rangeFactorEnd)&&(this._rangeFactorStart>0||this._rangeFactorEnd<1)&&2===this._range.length||!this._niceType)return this.d3Ticks(t,e);const s=null!==(i=this._niceDomain)&&void 0!==i?i:this._domain,o=this._domain,a=s[0],h=s[s.length-1];let l=Ye(o[0],o[o.length-1],t,e);if(!l.length)return l;if(this._domainValidator)l=l.filter(this._domainValidator);else if((l[0]!==a||l[l.length-1]!==h)&&this._niceType){const t=s.slice();if("all"===this._niceType?(t[0]=l[0],t[t.length-1]=l[l.length-1],this._niceDomain=t,this.rescale()):"min"===this._niceType&&l[0]!==a?(t[0]=l[0],this._niceDomain=t,this.rescale()):"max"===this._niceType&&l[l.length-1]!==h&&(t[t.length-1]=l[l.length-1],this._niceDomain=t,this.rescale()),"all"!==this._niceType){const e=Math.min(t[0],t[t.length-1]),n=Math.max(t[0],t[t.length-1]);l=l.filter((t=>t>=e&&t<=n))}}return l}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Ge(e[0],e[e.length-1],t)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return je(e[0],e[e.length-1],t)}nice(t=10,e){var n,i;const r=this._domain;let s=[];if(e){const t=ze(r,e);if(s=t.niceMinMax,this._domainValidator=t.domainValidator,this._niceType=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else this._niceType="all";if(this._niceType){const e=Pe(r.slice(),t);"min"===this._niceType?e[e.length-1]=null!==(n=s[1])&&void 0!==n?n:e[e.length-1]:"max"===this._niceType&&(e[0]=null!==(i=s[0])&&void 0!==i?i:e[0]),this._niceDomain=e,this.rescale()}return this}niceMin(t=10){this._niceType="min";const e=this._domain[this._domain.length-1],n=Pe(this.domain(),t);return n&&(n[n.length-1]=e,this._niceDomain=n,this.rescale()),this}niceMax(t=10){this._niceType="max";const e=this._domain[0],n=Pe(this._domain.slice(),t);return n&&(n[0]=e,this._niceDomain=n,this.rescale()),this}}class Xe{nice(t=10,e){var n,i,r,s;const o=this._domain;let a=[],h=null;if(e){const t=ze(o,e);if(a=t.niceMinMax,this._domainValidator=t.domainValidator,h=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else h="all";if(h){const t=xe(o.slice(),null!==(i=null===(n=this.getNiceConfig)||void 0===n?void 0:n.call(this))&&void 0!==i?i:{floor:t=>Math.floor(t),ceil:t=>Math.ceil(t)});return"min"===h?t[t.length-1]=null!==(r=a[1])&&void 0!==r?r:t[t.length-1]:"max"===h&&(t[0]=null!==(s=a[0])&&void 0!==s?s:t[0]),this._niceDomain=t,this.rescale(),this}return this}niceMin(){const t=this._domain[this._domain.length-1];this.nice();const e=this._domain.slice();return this._domain&&(e[e.length-1]=t,this._niceDomain=e,this.rescale()),this}niceMax(){const t=this._domain[0];this.nice();const e=this._domain.slice();return this._domain&&(e[0]=t,this._niceDomain=e,this.rescale()),this}}function tn(t){return e=>-t(-e)}function en(t=Number.EPSILON){return e=>Math.max(e,t)}class nn extends Ue{constructor(){super(me(10),ge(10)),this.type=t.ScaleEnum.Log,this._limit=en(),this._logs=this.transformer,this._pows=this.untransformer,this._domain=[1,10],this._base=10}clone(){return(new nn).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){var e;if(t)return this;super.rescale();const n=me(this._base),i=ge(this._base);return(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain)[0]<0?(this._logs=tn(n),this._pows=tn(i),this._limit=function(t=Number.EPSILON){return e=>Math.min(e,-t)}(),this.transformer=ce,this.untransformer=ue):(this._logs=n,this._pows=i,this._limit=en(),this.transformer=this._logs,this.untransformer=i),this}scale(t){var e;if(t=Number(t),Number.isNaN(t)||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this._limit).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const n=this._output(this.transformer(this._limit(this._clamp(t))));return this._fishEyeTransform?this._fishEyeTransform(n):n}base(t,e){return arguments.length?(this._base=t,this.rescale(e)):this._base}tickFormat(){return oe}d3Ticks(t=10,e){const n=this.domain(),i=this._limit(n[0]),r=this._limit(n[n.length-1]);return Qe(i,r,t,this._base,this.transformer,this.untransformer,e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return Ze(this._limit(e[0]),this._limit(e[e.length-1]),t,this._base,this.transformer,this.untransformer)}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Je(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return Je(this._limit(e[0]),this._limit(e[e.length-1]),t,this.transformer,this.untransformer)}getNiceConfig(){return{floor:t=>this._pows(Math.floor(this._logs(this._limit(t)))),ceil:t=>Math.abs(t)>=1?Math.ceil(t):this._pows(Math.ceil(this._logs(this._limit(t))))}}}c(nn,Xe);class rn extends Ke{constructor(){super(),this.type=t.ScaleEnum.Pow,this._exponent=1}clone(){return(new rn).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=oe,this.untransformer=oe):.5===this._exponent?(this.transformer=he,this.untransformer=le):(this.transformer=ae(this._exponent),this.untransformer=ae(1/this._exponent)),super.rescale()),this}exponent(t,e){return arguments.length?(this._exponent=t,this.rescale(e)):this._exponent}}class sn{constructor(){this.type=t.ScaleEnum.Quantile,this._range=[],this._domain=[],this._thresholds=[]}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]=m(this._domain,e/n);return this}scale(t){return h(t)?this._range[f(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)i(e)||Number.isNaN(+e)||this._domain.push(+e);return this._domain.sort(d),this.rescale(e)}range(t,e){if(!t)return this._range.slice();const n=Array.from(t);return u(this._range,n)?this:(this._range=n,this.rescale(e))}clone(){return(new sn).domain(this._domain,!0).range(this._range).unknown(this._unknown)}}class on{constructor(){this.type=t.ScaleEnum.Quantile,this._range=[0,1],this._domain=[.5],this.x0=0,this.x1=1,this.n=1}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 h(t)?this._range[f(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 u(this._range,n)?this:(this.n=n.length-1,this._range=n,this.rescale(e))}clone(){return(new on).domain([this.x0,this.x1],!0).range(this._range).unknown(this._unknown)}ticks(t=10){const e=this.domain();return Ye(e[0],e[e.length-1],t)}forceTicks(t=10){const e=this.domain();return Ge(e[0],e[e.length-1],t)}stepTicks(t){const e=this.domain();return je(e[0],e[e.length-1],t)}nice(t=10){const e=Pe(this.domain(),t);return e?this.domain(e):this}niceMin(t=10){const e=this._domain[this._domain.length-1],n=Pe(this.domain(),t);return n&&(n[n.length-1]=e,this.domain(n)),this}niceMax(t=10){const e=this._domain[0],n=Pe(this.domain(),t);return n&&(n[0]=e,this.domain(n)),this}}class an extends Ke{constructor(){super(he,le),this.type=t.ScaleEnum.Sqrt}clone(){return(new an).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}}class hn extends Ke{constructor(){super(fe(1),_e(1)),this.type=t.ScaleEnum.Symlog,this._const=1}clone(){return(new hn).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=fe(t),this.untransformer=_e(t),this.rescale(e)):this._const}d3Ticks(t=10,e){const n=this.domain(),i=n[0],r=n[n.length-1];return Qe(i,r,t,this._const,this.transformer,this.untransformer,e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return Ze(e[0],e[e.length-1],t,this._const,this.transformer,this.untransformer)}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Je(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return Je(e[0],e[e.length-1],t,this.transformer,this.untransformer)}}c(hn,Xe);class ln{constructor(){this.type=t.ScaleEnum.Threshold,this._range=[0,1],this._domain=[.5],this.n=1}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}scale(t){return!i(t)&&h(+t)?this._range[f(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 ln).domain(this._domain).range(this._range).unknown(this._unknown)}}const cn=[["second",1,nt],["second",5,5e3],["second",10,1e4],["second",30,3e4],["minute",1,it],["minute",5,3e5],["minute",10,6e5],["minute",30,18e5],["hour",1,rt],["hour",3,3*rt],["hour",6,6*rt],["hour",12,12*rt],["day",1,st],["day",2,2*st],["day",7,7*st],["month",1,ot],["month",3,3*ot],["month",6,6*ot],["year",1,365*st]];function un(t){return+U(t)}function dn(t,e,n,i){const r=(+e-+t)/n,s=f(cn.map((t=>t[2])),r);if(s===cn.length){const r=Math.max(w(+t/at,+e/at,n),1),s=t=>(t[tt(i)](Math.floor(t[z(i)]()/r)*r),t[function(t){return t?"setUTCMonth":"setMonth"}(i)](0,1),t[function(t){return t?"setUTCHours":"setHours"}(i)](0,0,0,0),t),o=(t,e)=>(t[tt(i)](t[z(i)]()+e*r),t);return{floor:s,offset:o,ceil:ne(s,o)}}if(0===s){const i=Math.max(w(+t,+e,n),1),r=t=>(t.setTime(Math.floor(+t/i)*i),t),s=(t,e)=>(t.setTime(+t+e*i),t);return{floor:r,offset:s,ceil:ne(r,s)}}const[o,a]=cn[r/cn[s-1][2]<cn[s][2]/r?s-1:s],h=((t,e)=>"year"===t&&e?{floor:dt,offset:gt,count:mt,field:ft}:"month"===t&&e?{floor:bt,offset:yt,count:vt,field:xt}:"day"===t&&e?{floor:Et,offset:Nt,count:Dt,field:Ct}:"hour"===t&&e?{floor:Bt,offset:At,count:Ot,field:Ht}:"minute"===t&&e?{floor:$t,offset:Gt,count:Yt,field:jt}:"second"===t&&e?{floor:Zt,offset:Jt,count:Wt,field:Kt}:"year"===t?{floor:ht,offset:lt,count:ct,field:ut}:"month"===t?{floor:_t,offset:pt,count:Mt,field:wt}:"day"===t?{floor:St,offset:Ft,count:Tt,field:kt}:"hour"===t?{floor:Rt,offset:Ut,count:Ot,field:Lt}:"minute"===t?{floor:It,offset:Vt,count:Yt,field:qt}:"second"===t?{floor:Pt,offset:zt,count:Wt,field:Qt}:{floor:Xt,offset:te,count:ee})(o,i);return ie(a,h)}class gn extends Ue{constructor(e=!1){super(),this.type=t.ScaleEnum.Time,this._domain=e?[Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]:[+new Date(2e3,0,1),+new Date(2e3,0,2)],this._isUtc=e}invert(t){return new Date(super.invert(t))}domain(t,e){if(!t)return this._domain.map(U);const n=Array.from(t,un);return this._domain=n,this.rescale(e)}ticks(t){const e=this.domain();let n=e[0],r=e[e.length-1];const s=r<n;s&&([n,r]=[r,n]);let o=t;(a(t)||i(t))&&(o=dn(n,r,i(t)?10:t,this._isUtc)),n=o.ceil(n);const h=[];let l=+n,c=0;for(;l<=+r&&c<100;)h.push(new Date(l)),l=+o.offset(new Date(l),1),c++;return s?h.reverse():h}tickFormat(t,e){return et(null==e?function(t,e){const n=U(t),i=n[W(e)]()+1,r=n[Q(e)](),s=n[Z(e)](),o=n[J(e)](),a=n[K(e)](),h=0===n[X(e)](),l=h&&0===a,c=l&&0===o,u=c&&0===s,d=u&&1===r;return d&&1===i?"YYYY":d?"YYYY-MM":u?"YYYY-MM-DD":c?"HH":l?"HH:mm":h?"HH:mm:ss":"HH:mm:ss SSS"}(this._domain[0],this._isUtc):e,this._isUtc)}clone(){return new gn(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 n=t;return(a(t)||i(t))&&(n=dn(e[0],e[e.length-1],i(t)?10:t,this._isUtc)),n&&this.domain(xe(e,n)),this}utc(){return this._isUtc}}const mn=Symbol("implicit");class fn{constructor(){this.type=t.ScaleEnum.Identity}specified(t){var e;return t?(this._specified=Object.assign(null!==(e=this._specified)&&void 0!==e?e:{},t),this):Object.assign({},this._specified)}_getSpecifiedValue(t){if(this._specified)return this._specified[t]}clone(){return(new fn).unknown(this._unknown).domain(this._domain).specified(this._specified)}scale(t){const e=`${t}`,n=this._getSpecifiedValue(e);return void 0!==n?n:this._unknown!==mn&&this._domain&&!this._domain.includes(t)?this._unknown:t}invert(t){return t}domain(t){return t?(this._domain=t,this):this._domain?this._domain.slice():void 0}range(t){return t?this:this._domain?this._domain.slice():void 0}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}}const _n=[1,5,2,2.5,4,3],pn=[.25,.2,.5,.05],Mn=100*Number.EPSILON;function wn(t){return Math.abs(t)<1e-14?t:parseFloat(t.toFixed(14))}function bn(t,e,n,i,r,s){const o=e.length,a=e.indexOf(t);let h=0;const l=function(t,e){return(t%e+e)%e}(i,s);return(l<Mn||s-l<Mn)&&i<=0&&r>=0&&(h=1),1-a/(o-1)-n+h}function yn(t,e,n){const i=e.length;return 1-e.indexOf(t)/(i-1)-n+1}function vn(t,e,n,i,r,s){const o=(t-1)/(s-r),a=(e-1)/(Math.max(s,i)-Math.min(n,r));return 2-Math.max(o/a,a/o)}function xn(t,e){return t>=e?2-(t-1)/(e-1):1}function Sn(t,e,n,i){return 1-.5*((e-i)**2+(t-n)**2)/(.1*(e-t))**2}function Fn(t,e,n){const i=e-t;if(n>i){return 1-((n-i)/2)**2/(.1*i)**2}return 1}t.BandScale=De,t.ContinuousScale=Ue,t.IdentityScale=fn,t.LinearScale=Ke,t.LogScale=nn,t.OrdinalScale=ke,t.PointScale=class extends De{constructor(e){super(!1),this.type=t.ScaleEnum.Point,this._padding=0,this.paddingInner(1,e),this.padding=this.paddingOuter,this.paddingInner=void 0,this.paddingOuter=void 0}},t.PowScale=rn,t.QuantileScale=sn,t.QuantizeScale=on,t.SqrtScale=an,t.SymlogScale=hn,t.ThresholdScale=ln,t.TimeScale=gn,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(t){return!!se[t]},t.scaleWholeRangeSize=be,t.supportRangeFactor=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.Band:case t.ScaleEnum.Point:return!0;default:return!1}},t.wilkinsonExtended=(t,e,n=5,i)=>{const{onlyLoose:r=!0,Q:s=_n,w:o=pn}=i||{},a=n<0?0:Math.round(n);if(Number.isNaN(t)||Number.isNaN(e)||"number"!=typeof t||"number"!=typeof e||!a)return[];if(e-t<1e-15||1===a)return[t];const h={score:-2,lmin:0,lmax:0,lstep:0};let l=1;for(;l<1/0;){for(let n=0;n<s.length;n+=1){const i=s[n],c=yn(i,s,l);if(o[0]*c+o[1]+o[2]+o[3]<h.score){l=1/0;break}let u=2;for(;u<1/0;){const n=xn(u,a);if(o[0]*c+o[1]+o[2]*n+o[3]<h.score)break;const d=(e-t)/(u+1)/l/i;let g=Math.ceil(Math.log10(d));for(;g<1/0;){const d=l*i*10**g,m=Fn(t,e,d*(u-1));if(o[0]*c+o[1]*m+o[2]*n+o[3]<h.score)break;const f=Math.floor(e/d)*l-(u-1)*l,_=Math.ceil(t/d)*l;if(f<=_){const n=_-f;for(let c=0;c<=n;c+=1){const n=(f+c)*(d/l),g=n+d*(u-1),m=d,_=bn(i,s,l,n,g,m),p=Sn(t,e,n,g),M=vn(u,a,t,e,n,g),w=1,b=o[0]*_+o[1]*p+o[2]*M+o[3]*w;b>h.score&&(!r||n<=t&&g>=e)&&(h.lmin=n,h.lmax=g,h.lstep=m,h.score=b)}}g+=1}u+=1}}l+=1}const c=wn(h.lmax),u=wn(h.lmin),d=wn(h.lstep),g=Math.floor(function(t){return Math.round(1e12*t)/1e12}((c-u)/d))+1,m=new Array(g);m[0]=wn(u);for(let t=1;t<g;t+=1)m[t]=wn(m[t-1]+d);return m}}));

@@ -23,2 +23,3 @@ import type { IRangeFactor, ScaleFishEyeOptions } from './interface';

unknown(_: any): this;
get(key: string, defaultValue?: any): any;
}

@@ -51,3 +51,7 @@ import { clamp, isNil, isValid } from "@visactor/vutils";

}
get(key, defaultValue) {
var _a;
return null !== (_a = null == this ? void 0 : this[key]) && void 0 !== _a ? _a : defaultValue;
}
}
//# sourceMappingURL=base-scale.js.map

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

import type { BaseScale } from './base-scale';
import type { ScaleEnum } from './type';

@@ -121,2 +122,8 @@ export type Tuple<TItem, TLength extends number> = [TItem, ...TItem[]] & {

}) => number[];
export type WilkinsonExtendedTicksFunc = (start: number, stop: number, count?: number, options?: {
onlyLoose?: boolean;
Q?: number[];
w?: [number, number, number, number];
}) => number[];
export type CustomTicksFunc<T extends BaseScale> = (scale: T, count: number) => number[];
export interface NiceOptions {

@@ -123,0 +130,0 @@ forceMin?: number;

import { ContinuousScale } from './continuous-scale';
import type { ContinuousScaleType, NiceOptions } from './interface';
import type { ContinuousScaleType, CustomTicksFunc, NiceOptions } from './interface';
export declare class LinearScale extends ContinuousScale {

@@ -12,2 +12,3 @@ readonly type: ContinuousScaleType;

noDecimals?: boolean;
customTicks?: CustomTicksFunc<ContinuousScale>;
}): number[];

@@ -14,0 +15,0 @@ forceTicks(count?: number): any[];

@@ -7,3 +7,3 @@ import { ScaleEnum } from "./type";

import { isValid } from "@visactor/vutils";
import { isFunction, isValid } from "@visactor/vutils";

@@ -26,2 +26,3 @@ export class LinearScale extends ContinuousScale {

var _a;
if (isFunction(null == options ? void 0 : options.customTicks)) return options.customTicks(this, count);
if (isValid(this._rangeFactorStart) && isValid(this._rangeFactorEnd) && (this._rangeFactorStart > 0 || this._rangeFactorEnd < 1) && 2 === this._range.length || !this._niceType) return this.d3Ticks(count, options);

@@ -28,0 +29,0 @@ const curNiceDomain = null !== (_a = this._niceDomain) && void 0 !== _a ? _a : this._domain, originalDomain = this._domain, start = curNiceDomain[0], stop = curNiceDomain[curNiceDomain.length - 1];

export { scaleWholeRangeSize } from './utils';
export { wilkinsonExtended } from './tick-wilkinson-extended';
export { scaleWholeRangeSize } from "./utils";
export { wilkinsonExtended } from "./tick-wilkinson-extended";
//# sourceMappingURL=index.js.map
{
"name": "@visactor/vscale",
"version": "0.18.13",
"version": "0.18.14",
"description": "Scales for visual encoding, used in VGrammar, VTable",

@@ -27,3 +27,3 @@ "keywords": [

"dependencies": {
"@visactor/vutils": "0.18.13"
"@visactor/vutils": "0.18.14"
},

@@ -40,6 +40,6 @@ "devDependencies": {

"@types/node": "*",
"@internal/bundler": "0.0.1",
"@internal/eslint-config": "0.0.1",
"@internal/jest-config": "0.0.1",
"@internal/ts-config": "0.0.1",
"@internal/eslint-config": "0.0.1",
"@internal/jest-config": "0.0.1"
"@internal/bundler": "0.0.1"
},

@@ -46,0 +46,0 @@ "publishConfig": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc