@nebula.js/sn-waterfall 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * @nebula.js/sn-waterfall v1.2.0
2
+ * @nebula.js/sn-waterfall v1.3.0
3
3
  * Copyright (c) 2026 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -844,7 +844,7 @@ const properties = {
844
844
  * @default
845
845
  */
846
846
  // oxlint-disable-next-line no-undef
847
- version: "1.2.0",
847
+ version: "1.3.0",
848
848
  /**
849
849
  * Extends `HyperCubeDef`, see Engine API: `HyperCubeDef`.
850
850
  * @extends {HyperCubeDef}
@@ -9344,7 +9344,7 @@ const hexShort = /^#([A-f0-9])([A-f0-9])([A-f0-9])$/i;
9344
9344
  const hsl$1 = /^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i;
9345
9345
  const hsla$1 = /^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i;
9346
9346
  const floor = Math.floor;
9347
- const round = Math.round;
9347
+ const round$1 = Math.round;
9348
9348
 
9349
9349
  /**
9350
9350
  * @class
@@ -9452,9 +9452,9 @@ const Color$1 = Class.extend(/** @lends module:objects.views/charts/representati
9452
9452
  r = rgb_[0] + m;
9453
9453
  g = rgb_[1] + m;
9454
9454
  b = rgb_[2] + m;
9455
- r = round(255 * r);
9456
- g = round(255 * g);
9457
- b = round(255 * b);
9455
+ r = round$1(255 * r);
9456
+ g = round$1(255 * g);
9457
+ b = round$1(255 * b);
9458
9458
  a = 1.0;
9459
9459
  } else if (matches = /^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(colorString)) {
9460
9460
  // hsla(1,2,3,0.4)
@@ -9499,9 +9499,9 @@ const Color$1 = Class.extend(/** @lends module:objects.views/charts/representati
9499
9499
  r = rgb_[0] + m;
9500
9500
  g = rgb_[1] + m;
9501
9501
  b = rgb_[2] + m;
9502
- r = round(255 * r);
9503
- g = round(255 * g);
9504
- b = round(255 * b);
9502
+ r = round$1(255 * r);
9503
+ g = round$1(255 * g);
9504
+ b = round$1(255 * b);
9505
9505
  } else if (matches = /^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(colorString)) {
9506
9506
  // hsv(1, 2, 3) {
9507
9507
  h = parseFloat(matches[1]);
@@ -9544,9 +9544,9 @@ const Color$1 = Class.extend(/** @lends module:objects.views/charts/representati
9544
9544
  r = rgb_[0] + m;
9545
9545
  g = rgb_[1] + m;
9546
9546
  b = rgb_[2] + m;
9547
- r = round(255 * r);
9548
- g = round(255 * g);
9549
- b = round(255 * b);
9547
+ r = round$1(255 * r);
9548
+ g = round$1(255 * g);
9549
+ b = round$1(255 * b);
9550
9550
  a = 1.0;
9551
9551
  } else if (colorStruct[colorString.toLowerCase()]) {
9552
9552
  lcs = colorString.toLowerCase();
@@ -11716,14 +11716,13 @@ var CubeGenerator = {
11716
11716
  getGeneratedMeasurePath
11717
11717
  };
11718
11718
 
11719
+ // https://d3js.org/d3-array/ v3.2.5 Copyright 2010-2026 Mike Bostock
11719
11720
  function ascending(a, b) {
11720
11721
  return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
11721
11722
  }
11722
-
11723
11723
  function descending(a, b) {
11724
11724
  return a == null || b == null ? NaN : b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
11725
11725
  }
11726
-
11727
11726
  function bisector(f) {
11728
11727
  let compare1, compare2, delta;
11729
11728
 
@@ -11774,15 +11773,12 @@ function bisector(f) {
11774
11773
  function zero$1() {
11775
11774
  return 0;
11776
11775
  }
11777
-
11778
- function number$1(x) {
11776
+ function number$2(x) {
11779
11777
  return x === null ? NaN : +x;
11780
11778
  }
11781
-
11782
11779
  const ascendingBisect = bisector(ascending);
11783
11780
  const bisectRight = ascendingBisect.right;
11784
- bisector(number$1).center;
11785
-
11781
+ bisector(number$2).center;
11786
11782
  const e10 = Math.sqrt(50),
11787
11783
  e5 = Math.sqrt(10),
11788
11784
  e2 = Math.sqrt(2);
@@ -11836,21 +11832,8 @@ function tickStep(start, stop, count) {
11836
11832
  return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
11837
11833
  }
11838
11834
 
11839
- function initRange(domain, range) {
11840
- switch (arguments.length) {
11841
- case 0:
11842
- break;
11843
- case 1:
11844
- this.range(domain);
11845
- break;
11846
- default:
11847
- this.range(range).domain(domain);
11848
- break;
11849
- }
11850
- return this;
11851
- }
11852
-
11853
- function define (constructor, factory, prototype) {
11835
+ // https://d3js.org/d3-color/ v3.1.1 Copyright 2010-2026 Mike Bostock
11836
+ function define(constructor, factory, prototype) {
11854
11837
  constructor.prototype = factory.prototype = prototype;
11855
11838
  prototype.constructor = constructor;
11856
11839
  }
@@ -11859,7 +11842,6 @@ function extend(parent, definition) {
11859
11842
  for (var key in definition) prototype[key] = definition[key];
11860
11843
  return prototype;
11861
11844
  }
11862
-
11863
11845
  function Color() {}
11864
11846
  var darker = 0.7;
11865
11847
  var brighter = 1 / darker;
@@ -12210,9 +12192,156 @@ function clampt(value) {
12210
12192
  function hsl2rgb(h, m1, m2) {
12211
12193
  return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255;
12212
12194
  }
12195
+ const radians = Math.PI / 180;
12196
+ const degrees = 180 / Math.PI;
12197
+
12198
+ // https://observablehq.com/@mbostock/lab-and-rgb
12199
+ const K = 18,
12200
+ Xn = 0.96422,
12201
+ Yn = 1,
12202
+ Zn = 0.82521,
12203
+ t0 = 4 / 29,
12204
+ t1 = 6 / 29,
12205
+ t2 = 3 * t1 * t1,
12206
+ t3 = t1 * t1 * t1;
12207
+ function labConvert(o) {
12208
+ if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);
12209
+ if (o instanceof Hcl) return hcl2lab(o);
12210
+ if (!(o instanceof Rgb)) o = rgbConvert(o);
12211
+ var r = rgb2lrgb(o.r),
12212
+ g = rgb2lrgb(o.g),
12213
+ b = rgb2lrgb(o.b),
12214
+ y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn),
12215
+ x,
12216
+ z;
12217
+ if (r === g && g === b) x = z = y;else {
12218
+ x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);
12219
+ z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);
12220
+ }
12221
+ return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);
12222
+ }
12223
+ function lab(l, a, b, opacity) {
12224
+ return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);
12225
+ }
12226
+ function Lab(l, a, b, opacity) {
12227
+ this.l = +l;
12228
+ this.a = +a;
12229
+ this.b = +b;
12230
+ this.opacity = +opacity;
12231
+ }
12232
+ define(Lab, lab, extend(Color, {
12233
+ brighter(k) {
12234
+ return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);
12235
+ },
12236
+ darker(k) {
12237
+ return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);
12238
+ },
12239
+ rgb() {
12240
+ var y = (this.l + 16) / 116,
12241
+ x = isNaN(this.a) ? y : y + this.a / 500,
12242
+ z = isNaN(this.b) ? y : y - this.b / 200;
12243
+ x = Xn * lab2xyz(x);
12244
+ y = Yn * lab2xyz(y);
12245
+ z = Zn * lab2xyz(z);
12246
+ return new Rgb(lrgb2rgb(3.1338561 * x - 1.6168667 * y - 0.4906146 * z), lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z), lrgb2rgb(0.0719453 * x - 0.2289914 * y + 1.4052427 * z), this.opacity);
12247
+ }
12248
+ }));
12249
+ function xyz2lab(t) {
12250
+ return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;
12251
+ }
12252
+ function lab2xyz(t) {
12253
+ return t > t1 ? t * t * t : t2 * (t - t0);
12254
+ }
12255
+ function lrgb2rgb(x) {
12256
+ return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
12257
+ }
12258
+ function rgb2lrgb(x) {
12259
+ return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);
12260
+ }
12261
+ function hclConvert(o) {
12262
+ if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);
12263
+ if (!(o instanceof Lab)) o = labConvert(o);
12264
+ if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);
12265
+ var h = Math.atan2(o.b, o.a) * degrees;
12266
+ return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);
12267
+ }
12268
+ function hcl(h, c, l, opacity) {
12269
+ return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);
12270
+ }
12271
+ function Hcl(h, c, l, opacity) {
12272
+ this.h = +h;
12273
+ this.c = +c;
12274
+ this.l = +l;
12275
+ this.opacity = +opacity;
12276
+ }
12277
+ function hcl2lab(o) {
12278
+ if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);
12279
+ var h = o.h * radians;
12280
+ return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);
12281
+ }
12282
+ define(Hcl, hcl, extend(Color, {
12283
+ brighter(k) {
12284
+ return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);
12285
+ },
12286
+ darker(k) {
12287
+ return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);
12288
+ },
12289
+ rgb() {
12290
+ return hcl2lab(this).rgb();
12291
+ }
12292
+ }));
12293
+ var A = -0.14861,
12294
+ B = 1.78277,
12295
+ C = -0.29227,
12296
+ D = -0.90649,
12297
+ E = 1.97294,
12298
+ ED = E * D,
12299
+ EB = E * B,
12300
+ BC_DA = B * C - D * A;
12301
+ function cubehelixConvert(o) {
12302
+ if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);
12303
+ if (!(o instanceof Rgb)) o = rgbConvert(o);
12304
+ var r = o.r / 255,
12305
+ g = o.g / 255,
12306
+ b = o.b / 255,
12307
+ l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),
12308
+ bl = b - l,
12309
+ k = (E * (g - l) - C * bl) / D,
12310
+ s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)),
12311
+ // NaN if l=0 or l=1
12312
+ h = s ? Math.atan2(k, bl) * degrees - 120 : NaN;
12313
+ return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);
12314
+ }
12315
+ function cubehelix$1(h, s, l, opacity) {
12316
+ return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);
12317
+ }
12318
+ function Cubehelix(h, s, l, opacity) {
12319
+ this.h = +h;
12320
+ this.s = +s;
12321
+ this.l = +l;
12322
+ this.opacity = +opacity;
12323
+ }
12324
+ define(Cubehelix, cubehelix$1, extend(Color, {
12325
+ brighter(k) {
12326
+ k = k == null ? brighter : Math.pow(brighter, k);
12327
+ return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
12328
+ },
12329
+ darker(k) {
12330
+ k = k == null ? darker : Math.pow(darker, k);
12331
+ return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
12332
+ },
12333
+ rgb() {
12334
+ var h = isNaN(this.h) ? 0 : (this.h + 120) * radians,
12335
+ l = +this.l,
12336
+ a = isNaN(this.s) ? 0 : this.s * l * (1 - l),
12337
+ cosh = Math.cos(h),
12338
+ sinh = Math.sin(h);
12339
+ return new Rgb(255 * (l + a * (A * cosh + B * sinh)), 255 * (l + a * (C * cosh + D * sinh)), 255 * (l + a * (E * cosh)), this.opacity);
12340
+ }
12341
+ }));
12213
12342
 
12343
+ // https://d3js.org/d3-interpolate/ v3.0.2 Copyright 2010-2026 Mike Bostock
12214
12344
  var constant = x => () => x;
12215
-
12216
12345
  function linear$1(a, d) {
12217
12346
  return function (t) {
12218
12347
  return a + t * d;
@@ -12223,6 +12352,10 @@ function exponential(a, b, y) {
12223
12352
  return Math.pow(a + t * b, y);
12224
12353
  };
12225
12354
  }
12355
+ function hue$1(a, b) {
12356
+ var d = b - a;
12357
+ return d ? linear$1(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);
12358
+ }
12226
12359
  function gamma(y) {
12227
12360
  return (y = +y) === 1 ? nogamma : function (a, b) {
12228
12361
  return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);
@@ -12232,8 +12365,7 @@ function nogamma(a, b) {
12232
12365
  var d = b - a;
12233
12366
  return d ? linear$1(a, d) : constant(isNaN(a) ? b : a);
12234
12367
  }
12235
-
12236
- var rgb = (function rgbGamma(y) {
12368
+ var rgb = function rgbGamma(y) {
12237
12369
  var color = gamma(y);
12238
12370
  function rgb(start, end) {
12239
12371
  var r = color((start = rgb$1(start)).r, (end = rgb$1(end)).r),
@@ -12250,9 +12382,8 @@ var rgb = (function rgbGamma(y) {
12250
12382
  }
12251
12383
  rgb.gamma = rgbGamma;
12252
12384
  return rgb;
12253
- })(1);
12254
-
12255
- function numberArray (a, b) {
12385
+ }(1);
12386
+ function numberArray(a, b) {
12256
12387
  if (!b) b = [];
12257
12388
  var n = a ? Math.min(b.length, a.length) : 0,
12258
12389
  c = b.slice(),
@@ -12265,35 +12396,31 @@ function numberArray (a, b) {
12265
12396
  function isNumberArray(x) {
12266
12397
  return ArrayBuffer.isView(x) && !(x instanceof DataView);
12267
12398
  }
12268
-
12269
12399
  function genericArray(a, b) {
12270
12400
  var nb = b ? b.length : 0,
12271
12401
  na = a ? Math.min(nb, a.length) : 0,
12272
12402
  x = new Array(na),
12273
12403
  c = new Array(nb),
12274
12404
  i;
12275
- for (i = 0; i < na; ++i) x[i] = interpolate(a[i], b[i]);
12405
+ for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);
12276
12406
  for (; i < nb; ++i) c[i] = b[i];
12277
12407
  return function (t) {
12278
12408
  for (i = 0; i < na; ++i) c[i] = x[i](t);
12279
12409
  return c;
12280
12410
  };
12281
12411
  }
12282
-
12283
- function date (a, b) {
12412
+ function date(a, b) {
12284
12413
  var d = new Date();
12285
12414
  return a = +a, b = +b, function (t) {
12286
12415
  return d.setTime(a * (1 - t) + b * t), d;
12287
12416
  };
12288
12417
  }
12289
-
12290
- function interpolateNumber (a, b) {
12418
+ function number(a, b) {
12291
12419
  return a = +a, b = +b, function (t) {
12292
12420
  return a * (1 - t) + b * t;
12293
12421
  };
12294
12422
  }
12295
-
12296
- function object (a, b) {
12423
+ function object(a, b) {
12297
12424
  var i = {},
12298
12425
  c = {},
12299
12426
  k;
@@ -12301,7 +12428,7 @@ function object (a, b) {
12301
12428
  if (b === null || typeof b !== "object") b = {};
12302
12429
  for (k in b) {
12303
12430
  if (k in a) {
12304
- i[k] = interpolate(a[k], b[k]);
12431
+ i[k] = value(a[k], b[k]);
12305
12432
  } else {
12306
12433
  c[k] = b[k];
12307
12434
  }
@@ -12311,7 +12438,6 @@ function object (a, b) {
12311
12438
  return c;
12312
12439
  };
12313
12440
  }
12314
-
12315
12441
  var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,
12316
12442
  reB = new RegExp(reA.source, "g");
12317
12443
  function zero(b) {
@@ -12324,7 +12450,7 @@ function one(b) {
12324
12450
  return b(t) + "";
12325
12451
  };
12326
12452
  }
12327
- function string (a, b) {
12453
+ function string(a, b) {
12328
12454
  var bi = reA.lastIndex = reB.lastIndex = 0,
12329
12455
  // scan index for next number in b
12330
12456
  am,
@@ -12359,7 +12485,7 @@ function string (a, b) {
12359
12485
  s[++i] = null;
12360
12486
  q.push({
12361
12487
  i: i,
12362
- x: interpolateNumber(am, bm)
12488
+ x: number(am, bm)
12363
12489
  });
12364
12490
  }
12365
12491
  bi = reB.lastIndex;
@@ -12379,133 +12505,101 @@ function string (a, b) {
12379
12505
  return s.join("");
12380
12506
  });
12381
12507
  }
12382
-
12383
- function interpolate (a, b) {
12508
+ function value(a, b) {
12384
12509
  var t = typeof b,
12385
12510
  c;
12386
- return b == null || t === "boolean" ? constant(b) : (t === "number" ? interpolateNumber : t === "string" ? (c = color(b)) ? (b = c, rgb) : string : b instanceof color ? rgb : b instanceof Date ? date : isNumberArray(b) ? numberArray : Array.isArray(b) ? genericArray : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object : interpolateNumber)(a, b);
12511
+ return b == null || t === "boolean" ? constant(b) : (t === "number" ? number : t === "string" ? (c = color(b)) ? (b = c, rgb) : string : b instanceof color ? rgb : b instanceof Date ? date : isNumberArray(b) ? numberArray : Array.isArray(b) ? genericArray : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object : number)(a, b);
12387
12512
  }
12388
-
12389
- function interpolateRound (a, b) {
12513
+ function round(a, b) {
12390
12514
  return a = +a, b = +b, function (t) {
12391
12515
  return Math.round(a * (1 - t) + b * t);
12392
12516
  };
12393
12517
  }
12518
+ var epsilon2 = 1e-12;
12519
+ function cosh(x) {
12520
+ return ((x = Math.exp(x)) + 1 / x) / 2;
12521
+ }
12522
+ function sinh(x) {
12523
+ return ((x = Math.exp(x)) - 1 / x) / 2;
12524
+ }
12525
+ function tanh(x) {
12526
+ return ((x = Math.exp(2 * x)) - 1) / (x + 1);
12527
+ }
12528
+ (function zoomRho(rho, rho2, rho4) {
12529
+ // p0 = [ux0, uy0, w0]
12530
+ // p1 = [ux1, uy1, w1]
12531
+ function zoom(p0, p1) {
12532
+ var ux0 = p0[0],
12533
+ uy0 = p0[1],
12534
+ w0 = p0[2],
12535
+ ux1 = p1[0],
12536
+ uy1 = p1[1],
12537
+ w1 = p1[2],
12538
+ dx = ux1 - ux0,
12539
+ dy = uy1 - uy0,
12540
+ d2 = dx * dx + dy * dy,
12541
+ i,
12542
+ S;
12543
+
12544
+ // Special case for u0 ≅ u1.
12545
+ if (d2 < epsilon2) {
12546
+ S = Math.log(w1 / w0) / rho;
12547
+ i = function (t) {
12548
+ return [ux0 + t * dx, uy0 + t * dy, w0 * Math.exp(rho * t * S)];
12549
+ };
12550
+ }
12394
12551
 
12395
- function constants(x) {
12396
- return function () {
12397
- return x;
12398
- };
12399
- }
12400
-
12401
- function number(x) {
12402
- return +x;
12403
- }
12404
-
12405
- var unit = [0, 1];
12406
- function identity$1(x) {
12407
- return x;
12408
- }
12409
- function normalize(a, b) {
12410
- return (b -= a = +a) ? function (x) {
12411
- return (x - a) / b;
12412
- } : constants(isNaN(b) ? NaN : 0.5);
12413
- }
12414
- function clamper(a, b) {
12415
- var t;
12416
- if (a > b) t = a, a = b, b = t;
12417
- return function (x) {
12418
- return Math.max(a, Math.min(b, x));
12419
- };
12420
- }
12421
-
12422
- // normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].
12423
- // interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].
12424
- function bimap(domain, range, interpolate) {
12425
- var d0 = domain[0],
12426
- d1 = domain[1],
12427
- r0 = range[0],
12428
- r1 = range[1];
12429
- if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);
12430
- return function (x) {
12431
- return r0(d0(x));
12432
- };
12433
- }
12434
- function polymap(domain, range, interpolate) {
12435
- var j = Math.min(domain.length, range.length) - 1,
12436
- d = new Array(j),
12437
- r = new Array(j),
12438
- i = -1;
12439
-
12440
- // Reverse descending domains.
12441
- if (domain[j] < domain[0]) {
12442
- domain = domain.slice().reverse();
12443
- range = range.slice().reverse();
12444
- }
12445
- while (++i < j) {
12446
- d[i] = normalize(domain[i], domain[i + 1]);
12447
- r[i] = interpolate(range[i], range[i + 1]);
12448
- }
12449
- return function (x) {
12450
- var i = bisectRight(domain, x, 1, j) - 1;
12451
- return r[i](d[i](x));
12452
- };
12453
- }
12454
- function copy(source, target) {
12455
- return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown());
12456
- }
12457
- function transformer() {
12458
- var domain = unit,
12459
- range = unit,
12460
- interpolate$1 = interpolate,
12461
- transform,
12462
- untransform,
12463
- unknown,
12464
- clamp = identity$1,
12465
- piecewise,
12466
- output,
12467
- input;
12468
- function rescale() {
12469
- var n = Math.min(domain.length, range.length);
12470
- if (clamp !== identity$1) clamp = clamper(domain[0], domain[n - 1]);
12471
- piecewise = n > 2 ? polymap : bimap;
12472
- output = input = null;
12473
- return scale;
12474
- }
12475
- function scale(x) {
12476
- return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate$1)))(transform(clamp(x)));
12477
- }
12478
- scale.invert = function (y) {
12479
- return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));
12480
- };
12481
- scale.domain = function (_) {
12482
- return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();
12483
- };
12484
- scale.range = function (_) {
12485
- return arguments.length ? (range = Array.from(_), rescale()) : range.slice();
12486
- };
12487
- scale.rangeRound = function (_) {
12488
- return range = Array.from(_), interpolate$1 = interpolateRound, rescale();
12489
- };
12490
- scale.clamp = function (_) {
12491
- return arguments.length ? (clamp = _ ? true : identity$1, rescale()) : clamp !== identity$1;
12492
- };
12493
- scale.interpolate = function (_) {
12494
- return arguments.length ? (interpolate$1 = _, rescale()) : interpolate$1;
12495
- };
12496
- scale.unknown = function (_) {
12497
- return arguments.length ? (unknown = _, scale) : unknown;
12498
- };
12499
- return function (t, u) {
12500
- transform = t, untransform = u;
12501
- return rescale();
12502
- };
12503
- }
12504
- function continuous() {
12505
- return transformer()(identity$1, identity$1);
12552
+ // General case.
12553
+ else {
12554
+ var d1 = Math.sqrt(d2),
12555
+ b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),
12556
+ b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),
12557
+ r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),
12558
+ r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
12559
+ S = (r1 - r0) / rho;
12560
+ i = function (t) {
12561
+ var s = t * S,
12562
+ coshr0 = cosh(r0),
12563
+ u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));
12564
+ return [ux0 + u * dx, uy0 + u * dy, w0 * coshr0 / cosh(rho * s + r0)];
12565
+ };
12566
+ }
12567
+ i.duration = Math.abs(S) * 1000 * rho / Math.SQRT2;
12568
+ return i;
12569
+ }
12570
+ zoom.rho = function (_) {
12571
+ var _1 = Math.max(1e-3, +_),
12572
+ _2 = _1 * _1,
12573
+ _4 = _2 * _2;
12574
+ return zoomRho(_1, _2, _4);
12575
+ };
12576
+ return zoom;
12577
+ })(Math.SQRT2, 2, 4);
12578
+ function cubehelix(hue) {
12579
+ return function cubehelixGamma(y) {
12580
+ y = +y;
12581
+ function cubehelix(start, end) {
12582
+ var h = hue((start = cubehelix$1(start)).h, (end = cubehelix$1(end)).h),
12583
+ s = nogamma(start.s, end.s),
12584
+ l = nogamma(start.l, end.l),
12585
+ opacity = nogamma(start.opacity, end.opacity);
12586
+ return function (t) {
12587
+ start.h = h(t);
12588
+ start.s = s(t);
12589
+ start.l = l(Math.pow(t, y));
12590
+ start.opacity = opacity(t);
12591
+ return start + "";
12592
+ };
12593
+ }
12594
+ cubehelix.gamma = cubehelixGamma;
12595
+ return cubehelix;
12596
+ }(1);
12506
12597
  }
12598
+ cubehelix(hue$1);
12599
+ cubehelix(nogamma);
12507
12600
 
12508
- function formatDecimal (x) {
12601
+ // https://d3js.org/d3-format/ v3.1.3 Copyright 2010-2026 Mike Bostock
12602
+ function formatDecimal(x) {
12509
12603
  return Math.abs(x = Math.round(x)) >= 1e21 ? x.toLocaleString("en").replace(/,/g, "") : x.toString(10);
12510
12604
  }
12511
12605
 
@@ -12521,12 +12615,10 @@ function formatDecimalParts(x, p) {
12521
12615
  // (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3).
12522
12616
  return [coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, +x.slice(i + 1)];
12523
12617
  }
12524
-
12525
- function exponent (x) {
12618
+ function exponent(x) {
12526
12619
  return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;
12527
12620
  }
12528
-
12529
- function formatGroup (grouping, thousands) {
12621
+ function formatGroup(grouping, thousands) {
12530
12622
  return function (value, width) {
12531
12623
  var i = value.length,
12532
12624
  t = [],
@@ -12542,8 +12634,7 @@ function formatGroup (grouping, thousands) {
12542
12634
  return t.reverse().join(thousands);
12543
12635
  };
12544
12636
  }
12545
-
12546
- function formatNumerals (numerals) {
12637
+ function formatNumerals(numerals) {
12547
12638
  return function (value) {
12548
12639
  return value.replace(/[0-9]/g, function (i) {
12549
12640
  return numerals[+i];
@@ -12588,7 +12679,7 @@ FormatSpecifier.prototype.toString = function () {
12588
12679
  };
12589
12680
 
12590
12681
  // Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.
12591
- function formatTrim (s) {
12682
+ function formatTrim(s) {
12592
12683
  out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {
12593
12684
  switch (s[i]) {
12594
12685
  case ".":
@@ -12606,9 +12697,8 @@ function formatTrim (s) {
12606
12697
  }
12607
12698
  return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;
12608
12699
  }
12609
-
12610
12700
  var prefixExponent;
12611
- function formatPrefixAuto (x, p) {
12701
+ function formatPrefixAuto(x, p) {
12612
12702
  var d = formatDecimalParts(x, p);
12613
12703
  if (!d) return prefixExponent = undefined, x.toPrecision(p);
12614
12704
  var coefficient = d[0],
@@ -12617,15 +12707,13 @@ function formatPrefixAuto (x, p) {
12617
12707
  n = coefficient.length;
12618
12708
  return i === n ? coefficient : i > n ? coefficient + new Array(i - n + 1).join("0") : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) : "0." + new Array(1 - i).join("0") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!
12619
12709
  }
12620
-
12621
- function formatRounded (x, p) {
12710
+ function formatRounded(x, p) {
12622
12711
  var d = formatDecimalParts(x, p);
12623
12712
  if (!d) return x + "";
12624
12713
  var coefficient = d[0],
12625
12714
  exponent = d[1];
12626
12715
  return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1) : coefficient + new Array(exponent - coefficient.length + 2).join("0");
12627
12716
  }
12628
-
12629
12717
  var formatTypes = {
12630
12718
  "%": (x, p) => (x * 100).toFixed(p),
12631
12719
  "b": x => Math.round(x).toString(2),
@@ -12641,14 +12729,12 @@ var formatTypes = {
12641
12729
  "X": x => Math.round(x).toString(16).toUpperCase(),
12642
12730
  "x": x => Math.round(x).toString(16)
12643
12731
  };
12644
-
12645
- function identity (x) {
12732
+ function identity(x) {
12646
12733
  return x;
12647
12734
  }
12648
-
12649
12735
  var map = Array.prototype.map,
12650
12736
  prefixes = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
12651
- function formatLocale (locale) {
12737
+ function formatLocale(locale) {
12652
12738
  var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + ""),
12653
12739
  currencyPrefix = locale.currency === undefined ? "" : locale.currency[0] + "",
12654
12740
  currencySuffix = locale.currency === undefined ? "" : locale.currency[1] + "",
@@ -12784,7 +12870,6 @@ function formatLocale (locale) {
12784
12870
  formatPrefix: formatPrefix
12785
12871
  };
12786
12872
  }
12787
-
12788
12873
  var locale;
12789
12874
  var format;
12790
12875
  var formatPrefix;
@@ -12799,20 +12884,141 @@ function defaultLocale(definition) {
12799
12884
  formatPrefix = locale.formatPrefix;
12800
12885
  return locale;
12801
12886
  }
12802
-
12803
- function precisionFixed (step) {
12887
+ function precisionFixed(step) {
12804
12888
  return Math.max(0, -exponent(Math.abs(step)));
12805
12889
  }
12806
-
12807
- function precisionPrefix (step, value) {
12890
+ function precisionPrefix(step, value) {
12808
12891
  return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));
12809
12892
  }
12810
-
12811
- function precisionRound (step, max) {
12893
+ function precisionRound(step, max) {
12812
12894
  step = Math.abs(step), max = Math.abs(max) - step;
12813
12895
  return Math.max(0, exponent(max) - exponent(step)) + 1;
12814
12896
  }
12815
12897
 
12898
+ // https://d3js.org/d3-scale/ v4.0.3 Copyright 2010-2026 Mike Bostock
12899
+ function initRange(domain, range) {
12900
+ switch (arguments.length) {
12901
+ case 0:
12902
+ break;
12903
+ case 1:
12904
+ this.range(domain);
12905
+ break;
12906
+ default:
12907
+ this.range(range).domain(domain);
12908
+ break;
12909
+ }
12910
+ return this;
12911
+ }
12912
+ function constants(x) {
12913
+ return function () {
12914
+ return x;
12915
+ };
12916
+ }
12917
+ function number$1(x) {
12918
+ return +x;
12919
+ }
12920
+ var unit = [0, 1];
12921
+ function identity$1(x) {
12922
+ return x;
12923
+ }
12924
+ function normalize(a, b) {
12925
+ return (b -= a = +a) ? function (x) {
12926
+ return (x - a) / b;
12927
+ } : constants(isNaN(b) ? NaN : 0.5);
12928
+ }
12929
+ function clamper(a, b) {
12930
+ var t;
12931
+ if (a > b) t = a, a = b, b = t;
12932
+ return function (x) {
12933
+ return Math.max(a, Math.min(b, x));
12934
+ };
12935
+ }
12936
+
12937
+ // normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].
12938
+ // interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].
12939
+ function bimap(domain, range, interpolate) {
12940
+ var d0 = domain[0],
12941
+ d1 = domain[1],
12942
+ r0 = range[0],
12943
+ r1 = range[1];
12944
+ if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);
12945
+ return function (x) {
12946
+ return r0(d0(x));
12947
+ };
12948
+ }
12949
+ function polymap(domain, range, interpolate) {
12950
+ var j = Math.min(domain.length, range.length) - 1,
12951
+ d = new Array(j),
12952
+ r = new Array(j),
12953
+ i = -1;
12954
+
12955
+ // Reverse descending domains.
12956
+ if (domain[j] < domain[0]) {
12957
+ domain = domain.slice().reverse();
12958
+ range = range.slice().reverse();
12959
+ }
12960
+ while (++i < j) {
12961
+ d[i] = normalize(domain[i], domain[i + 1]);
12962
+ r[i] = interpolate(range[i], range[i + 1]);
12963
+ }
12964
+ return function (x) {
12965
+ var i = bisectRight(domain, x, 1, j) - 1;
12966
+ return r[i](d[i](x));
12967
+ };
12968
+ }
12969
+ function copy$1(source, target) {
12970
+ return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown());
12971
+ }
12972
+ function transformer$2() {
12973
+ var domain = unit,
12974
+ range = unit,
12975
+ interpolate$1 = value,
12976
+ transform,
12977
+ untransform,
12978
+ unknown,
12979
+ clamp = identity$1,
12980
+ piecewise,
12981
+ output,
12982
+ input;
12983
+ function rescale() {
12984
+ var n = Math.min(domain.length, range.length);
12985
+ if (clamp !== identity$1) clamp = clamper(domain[0], domain[n - 1]);
12986
+ piecewise = n > 2 ? polymap : bimap;
12987
+ output = input = null;
12988
+ return scale;
12989
+ }
12990
+ function scale(x) {
12991
+ return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate$1)))(transform(clamp(x)));
12992
+ }
12993
+ scale.invert = function (y) {
12994
+ return clamp(untransform((input || (input = piecewise(range, domain.map(transform), number)))(y)));
12995
+ };
12996
+ scale.domain = function (_) {
12997
+ return arguments.length ? (domain = Array.from(_, number$1), rescale()) : domain.slice();
12998
+ };
12999
+ scale.range = function (_) {
13000
+ return arguments.length ? (range = Array.from(_), rescale()) : range.slice();
13001
+ };
13002
+ scale.rangeRound = function (_) {
13003
+ return range = Array.from(_), interpolate$1 = round, rescale();
13004
+ };
13005
+ scale.clamp = function (_) {
13006
+ return arguments.length ? (clamp = _ ? true : identity$1, rescale()) : clamp !== identity$1;
13007
+ };
13008
+ scale.interpolate = function (_) {
13009
+ return arguments.length ? (interpolate$1 = _, rescale()) : interpolate$1;
13010
+ };
13011
+ scale.unknown = function (_) {
13012
+ return arguments.length ? (unknown = _, scale) : unknown;
13013
+ };
13014
+ return function (t, u) {
13015
+ transform = t, untransform = u;
13016
+ return rescale();
13017
+ };
13018
+ }
13019
+ function continuous() {
13020
+ return transformer$2()(identity$1, identity$1);
13021
+ }
12816
13022
  function tickFormat(start, stop, count, specifier) {
12817
13023
  var step = tickStep(start, stop, count),
12818
13024
  precision;
@@ -12842,7 +13048,6 @@ function tickFormat(start, stop, count, specifier) {
12842
13048
  }
12843
13049
  return format(specifier);
12844
13050
  }
12845
-
12846
13051
  function linearish(scale) {
12847
13052
  var domain = scale.domain;
12848
13053
  scale.ticks = function (count) {
@@ -12891,7 +13096,7 @@ function linearish(scale) {
12891
13096
  function linear() {
12892
13097
  var scale = continuous();
12893
13098
  scale.copy = function () {
12894
- return copy(scale, linear());
13099
+ return copy$1(scale, linear());
12895
13100
  };
12896
13101
  initRange.apply(scale, arguments);
12897
13102
  return linearish(scale);