@ni/nimble-components 15.5.5 → 15.5.6

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.
@@ -1323,7 +1323,7 @@
1323
1323
 
1324
1324
  // A singleton Range instance used to efficiently remove ranges of DOM nodes.
1325
1325
  // See the implementation of HTMLView below for further details.
1326
- const range = document.createRange();
1326
+ const range$1 = document.createRange();
1327
1327
  /**
1328
1328
  * The standard View implementation, which also implements ElementView and SyntheticView.
1329
1329
  * @public
@@ -1465,9 +1465,9 @@
1465
1465
  if (views.length === 0) {
1466
1466
  return;
1467
1467
  }
1468
- range.setStartBefore(views[0].firstChild);
1469
- range.setEndAfter(views[views.length - 1].lastChild);
1470
- range.deleteContents();
1468
+ range$1.setStartBefore(views[0].firstChild);
1469
+ range$1.setEndAfter(views[views.length - 1].lastChild);
1470
+ range$1.deleteContents();
1471
1471
  for (let i = 0, ii = views.length; i < ii; ++i) {
1472
1472
  const view = views[i];
1473
1473
  const behaviors = view.behaviors;
@@ -25932,11 +25932,1718 @@ Instead styling against the role which is more general and likely a better appro
25932
25932
  left: 'left',
25933
25933
  right: 'right'
25934
25934
  };
25935
- const WaferMapColorsScaleMode = {
25935
+ const WaferMapColorScaleMode = {
25936
25936
  linear: 'linear',
25937
25937
  ordinal: 'ordinal'
25938
25938
  };
25939
25939
 
25940
+ function ascending(a, b) {
25941
+ return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
25942
+ }
25943
+
25944
+ function descending(a, b) {
25945
+ return a == null || b == null ? NaN
25946
+ : b < a ? -1
25947
+ : b > a ? 1
25948
+ : b >= a ? 0
25949
+ : NaN;
25950
+ }
25951
+
25952
+ function bisector(f) {
25953
+ let compare1, compare2, delta;
25954
+
25955
+ // If an accessor is specified, promote it to a comparator. In this case we
25956
+ // can test whether the search value is (self-) comparable. We can’t do this
25957
+ // for a comparator (except for specific, known comparators) because we can’t
25958
+ // tell if the comparator is symmetric, and an asymmetric comparator can’t be
25959
+ // used to test whether a single value is comparable.
25960
+ if (f.length !== 2) {
25961
+ compare1 = ascending;
25962
+ compare2 = (d, x) => ascending(f(d), x);
25963
+ delta = (d, x) => f(d) - x;
25964
+ } else {
25965
+ compare1 = f === ascending || f === descending ? f : zero$1;
25966
+ compare2 = f;
25967
+ delta = f;
25968
+ }
25969
+
25970
+ function left(a, x, lo = 0, hi = a.length) {
25971
+ if (lo < hi) {
25972
+ if (compare1(x, x) !== 0) return hi;
25973
+ do {
25974
+ const mid = (lo + hi) >>> 1;
25975
+ if (compare2(a[mid], x) < 0) lo = mid + 1;
25976
+ else hi = mid;
25977
+ } while (lo < hi);
25978
+ }
25979
+ return lo;
25980
+ }
25981
+
25982
+ function right(a, x, lo = 0, hi = a.length) {
25983
+ if (lo < hi) {
25984
+ if (compare1(x, x) !== 0) return hi;
25985
+ do {
25986
+ const mid = (lo + hi) >>> 1;
25987
+ if (compare2(a[mid], x) <= 0) lo = mid + 1;
25988
+ else hi = mid;
25989
+ } while (lo < hi);
25990
+ }
25991
+ return lo;
25992
+ }
25993
+
25994
+ function center(a, x, lo = 0, hi = a.length) {
25995
+ const i = left(a, x, lo, hi - 1);
25996
+ return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;
25997
+ }
25998
+
25999
+ return {left, center, right};
26000
+ }
26001
+
26002
+ function zero$1() {
26003
+ return 0;
26004
+ }
26005
+
26006
+ function number$1(x) {
26007
+ return x === null ? NaN : +x;
26008
+ }
26009
+
26010
+ const ascendingBisect = bisector(ascending);
26011
+ const bisectRight = ascendingBisect.right;
26012
+ bisector(number$1).center;
26013
+ var bisect = bisectRight;
26014
+
26015
+ class InternMap extends Map {
26016
+ constructor(entries, key = keyof) {
26017
+ super();
26018
+ Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});
26019
+ if (entries != null) for (const [key, value] of entries) this.set(key, value);
26020
+ }
26021
+ get(key) {
26022
+ return super.get(intern_get(this, key));
26023
+ }
26024
+ has(key) {
26025
+ return super.has(intern_get(this, key));
26026
+ }
26027
+ set(key, value) {
26028
+ return super.set(intern_set(this, key), value);
26029
+ }
26030
+ delete(key) {
26031
+ return super.delete(intern_delete(this, key));
26032
+ }
26033
+ }
26034
+
26035
+ function intern_get({_intern, _key}, value) {
26036
+ const key = _key(value);
26037
+ return _intern.has(key) ? _intern.get(key) : value;
26038
+ }
26039
+
26040
+ function intern_set({_intern, _key}, value) {
26041
+ const key = _key(value);
26042
+ if (_intern.has(key)) return _intern.get(key);
26043
+ _intern.set(key, value);
26044
+ return value;
26045
+ }
26046
+
26047
+ function intern_delete({_intern, _key}, value) {
26048
+ const key = _key(value);
26049
+ if (_intern.has(key)) {
26050
+ value = _intern.get(key);
26051
+ _intern.delete(key);
26052
+ }
26053
+ return value;
26054
+ }
26055
+
26056
+ function keyof(value) {
26057
+ return value !== null && typeof value === "object" ? value.valueOf() : value;
26058
+ }
26059
+
26060
+ var e10 = Math.sqrt(50),
26061
+ e5 = Math.sqrt(10),
26062
+ e2 = Math.sqrt(2);
26063
+
26064
+ function ticks(start, stop, count) {
26065
+ var reverse,
26066
+ i = -1,
26067
+ n,
26068
+ ticks,
26069
+ step;
26070
+
26071
+ stop = +stop, start = +start, count = +count;
26072
+ if (start === stop && count > 0) return [start];
26073
+ if (reverse = stop < start) n = start, start = stop, stop = n;
26074
+ if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) return [];
26075
+
26076
+ if (step > 0) {
26077
+ let r0 = Math.round(start / step), r1 = Math.round(stop / step);
26078
+ if (r0 * step < start) ++r0;
26079
+ if (r1 * step > stop) --r1;
26080
+ ticks = new Array(n = r1 - r0 + 1);
26081
+ while (++i < n) ticks[i] = (r0 + i) * step;
26082
+ } else {
26083
+ step = -step;
26084
+ let r0 = Math.round(start * step), r1 = Math.round(stop * step);
26085
+ if (r0 / step < start) ++r0;
26086
+ if (r1 / step > stop) --r1;
26087
+ ticks = new Array(n = r1 - r0 + 1);
26088
+ while (++i < n) ticks[i] = (r0 + i) / step;
26089
+ }
26090
+
26091
+ if (reverse) ticks.reverse();
26092
+
26093
+ return ticks;
26094
+ }
26095
+
26096
+ function tickIncrement(start, stop, count) {
26097
+ var step = (stop - start) / Math.max(0, count),
26098
+ power = Math.floor(Math.log(step) / Math.LN10),
26099
+ error = step / Math.pow(10, power);
26100
+ return power >= 0
26101
+ ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power)
26102
+ : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1);
26103
+ }
26104
+
26105
+ function tickStep(start, stop, count) {
26106
+ var step0 = Math.abs(stop - start) / Math.max(0, count),
26107
+ step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)),
26108
+ error = step0 / step1;
26109
+ if (error >= e10) step1 *= 10;
26110
+ else if (error >= e5) step1 *= 5;
26111
+ else if (error >= e2) step1 *= 2;
26112
+ return stop < start ? -step1 : step1;
26113
+ }
26114
+
26115
+ function range(start, stop, step) {
26116
+ start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;
26117
+
26118
+ var i = -1,
26119
+ n = Math.max(0, Math.ceil((stop - start) / step)) | 0,
26120
+ range = new Array(n);
26121
+
26122
+ while (++i < n) {
26123
+ range[i] = start + i * step;
26124
+ }
26125
+
26126
+ return range;
26127
+ }
26128
+
26129
+ function initRange(domain, range) {
26130
+ switch (arguments.length) {
26131
+ case 0: break;
26132
+ case 1: this.range(domain); break;
26133
+ default: this.range(range).domain(domain); break;
26134
+ }
26135
+ return this;
26136
+ }
26137
+
26138
+ const implicit = Symbol("implicit");
26139
+
26140
+ function ordinal() {
26141
+ var index = new InternMap(),
26142
+ domain = [],
26143
+ range = [],
26144
+ unknown = implicit;
26145
+
26146
+ function scale(d) {
26147
+ let i = index.get(d);
26148
+ if (i === undefined) {
26149
+ if (unknown !== implicit) return unknown;
26150
+ index.set(d, i = domain.push(d) - 1);
26151
+ }
26152
+ return range[i % range.length];
26153
+ }
26154
+
26155
+ scale.domain = function(_) {
26156
+ if (!arguments.length) return domain.slice();
26157
+ domain = [], index = new InternMap();
26158
+ for (const value of _) {
26159
+ if (index.has(value)) continue;
26160
+ index.set(value, domain.push(value) - 1);
26161
+ }
26162
+ return scale;
26163
+ };
26164
+
26165
+ scale.range = function(_) {
26166
+ return arguments.length ? (range = Array.from(_), scale) : range.slice();
26167
+ };
26168
+
26169
+ scale.unknown = function(_) {
26170
+ return arguments.length ? (unknown = _, scale) : unknown;
26171
+ };
26172
+
26173
+ scale.copy = function() {
26174
+ return ordinal(domain, range).unknown(unknown);
26175
+ };
26176
+
26177
+ initRange.apply(scale, arguments);
26178
+
26179
+ return scale;
26180
+ }
26181
+
26182
+ function band() {
26183
+ var scale = ordinal().unknown(undefined),
26184
+ domain = scale.domain,
26185
+ ordinalRange = scale.range,
26186
+ r0 = 0,
26187
+ r1 = 1,
26188
+ step,
26189
+ bandwidth,
26190
+ round = false,
26191
+ paddingInner = 0,
26192
+ paddingOuter = 0,
26193
+ align = 0.5;
26194
+
26195
+ delete scale.unknown;
26196
+
26197
+ function rescale() {
26198
+ var n = domain().length,
26199
+ reverse = r1 < r0,
26200
+ start = reverse ? r1 : r0,
26201
+ stop = reverse ? r0 : r1;
26202
+ step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);
26203
+ if (round) step = Math.floor(step);
26204
+ start += (stop - start - step * (n - paddingInner)) * align;
26205
+ bandwidth = step * (1 - paddingInner);
26206
+ if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);
26207
+ var values = range(n).map(function(i) { return start + step * i; });
26208
+ return ordinalRange(reverse ? values.reverse() : values);
26209
+ }
26210
+
26211
+ scale.domain = function(_) {
26212
+ return arguments.length ? (domain(_), rescale()) : domain();
26213
+ };
26214
+
26215
+ scale.range = function(_) {
26216
+ return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];
26217
+ };
26218
+
26219
+ scale.rangeRound = function(_) {
26220
+ return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();
26221
+ };
26222
+
26223
+ scale.bandwidth = function() {
26224
+ return bandwidth;
26225
+ };
26226
+
26227
+ scale.step = function() {
26228
+ return step;
26229
+ };
26230
+
26231
+ scale.round = function(_) {
26232
+ return arguments.length ? (round = !!_, rescale()) : round;
26233
+ };
26234
+
26235
+ scale.padding = function(_) {
26236
+ return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;
26237
+ };
26238
+
26239
+ scale.paddingInner = function(_) {
26240
+ return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;
26241
+ };
26242
+
26243
+ scale.paddingOuter = function(_) {
26244
+ return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;
26245
+ };
26246
+
26247
+ scale.align = function(_) {
26248
+ return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;
26249
+ };
26250
+
26251
+ scale.copy = function() {
26252
+ return band(domain(), [r0, r1])
26253
+ .round(round)
26254
+ .paddingInner(paddingInner)
26255
+ .paddingOuter(paddingOuter)
26256
+ .align(align);
26257
+ };
26258
+
26259
+ return initRange.apply(rescale(), arguments);
26260
+ }
26261
+
26262
+ function define(constructor, factory, prototype) {
26263
+ constructor.prototype = factory.prototype = prototype;
26264
+ prototype.constructor = constructor;
26265
+ }
26266
+
26267
+ function extend(parent, definition) {
26268
+ var prototype = Object.create(parent.prototype);
26269
+ for (var key in definition) prototype[key] = definition[key];
26270
+ return prototype;
26271
+ }
26272
+
26273
+ function Color() {}
26274
+
26275
+ var darker = 0.7;
26276
+ var brighter = 1 / darker;
26277
+
26278
+ var reI = "\\s*([+-]?\\d+)\\s*",
26279
+ reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",
26280
+ reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
26281
+ reHex = /^#([0-9a-f]{3,8})$/,
26282
+ reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`),
26283
+ reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`),
26284
+ reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`),
26285
+ reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`),
26286
+ reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`),
26287
+ reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`);
26288
+
26289
+ var named = {
26290
+ aliceblue: 0xf0f8ff,
26291
+ antiquewhite: 0xfaebd7,
26292
+ aqua: 0x00ffff,
26293
+ aquamarine: 0x7fffd4,
26294
+ azure: 0xf0ffff,
26295
+ beige: 0xf5f5dc,
26296
+ bisque: 0xffe4c4,
26297
+ black: 0x000000,
26298
+ blanchedalmond: 0xffebcd,
26299
+ blue: 0x0000ff,
26300
+ blueviolet: 0x8a2be2,
26301
+ brown: 0xa52a2a,
26302
+ burlywood: 0xdeb887,
26303
+ cadetblue: 0x5f9ea0,
26304
+ chartreuse: 0x7fff00,
26305
+ chocolate: 0xd2691e,
26306
+ coral: 0xff7f50,
26307
+ cornflowerblue: 0x6495ed,
26308
+ cornsilk: 0xfff8dc,
26309
+ crimson: 0xdc143c,
26310
+ cyan: 0x00ffff,
26311
+ darkblue: 0x00008b,
26312
+ darkcyan: 0x008b8b,
26313
+ darkgoldenrod: 0xb8860b,
26314
+ darkgray: 0xa9a9a9,
26315
+ darkgreen: 0x006400,
26316
+ darkgrey: 0xa9a9a9,
26317
+ darkkhaki: 0xbdb76b,
26318
+ darkmagenta: 0x8b008b,
26319
+ darkolivegreen: 0x556b2f,
26320
+ darkorange: 0xff8c00,
26321
+ darkorchid: 0x9932cc,
26322
+ darkred: 0x8b0000,
26323
+ darksalmon: 0xe9967a,
26324
+ darkseagreen: 0x8fbc8f,
26325
+ darkslateblue: 0x483d8b,
26326
+ darkslategray: 0x2f4f4f,
26327
+ darkslategrey: 0x2f4f4f,
26328
+ darkturquoise: 0x00ced1,
26329
+ darkviolet: 0x9400d3,
26330
+ deeppink: 0xff1493,
26331
+ deepskyblue: 0x00bfff,
26332
+ dimgray: 0x696969,
26333
+ dimgrey: 0x696969,
26334
+ dodgerblue: 0x1e90ff,
26335
+ firebrick: 0xb22222,
26336
+ floralwhite: 0xfffaf0,
26337
+ forestgreen: 0x228b22,
26338
+ fuchsia: 0xff00ff,
26339
+ gainsboro: 0xdcdcdc,
26340
+ ghostwhite: 0xf8f8ff,
26341
+ gold: 0xffd700,
26342
+ goldenrod: 0xdaa520,
26343
+ gray: 0x808080,
26344
+ green: 0x008000,
26345
+ greenyellow: 0xadff2f,
26346
+ grey: 0x808080,
26347
+ honeydew: 0xf0fff0,
26348
+ hotpink: 0xff69b4,
26349
+ indianred: 0xcd5c5c,
26350
+ indigo: 0x4b0082,
26351
+ ivory: 0xfffff0,
26352
+ khaki: 0xf0e68c,
26353
+ lavender: 0xe6e6fa,
26354
+ lavenderblush: 0xfff0f5,
26355
+ lawngreen: 0x7cfc00,
26356
+ lemonchiffon: 0xfffacd,
26357
+ lightblue: 0xadd8e6,
26358
+ lightcoral: 0xf08080,
26359
+ lightcyan: 0xe0ffff,
26360
+ lightgoldenrodyellow: 0xfafad2,
26361
+ lightgray: 0xd3d3d3,
26362
+ lightgreen: 0x90ee90,
26363
+ lightgrey: 0xd3d3d3,
26364
+ lightpink: 0xffb6c1,
26365
+ lightsalmon: 0xffa07a,
26366
+ lightseagreen: 0x20b2aa,
26367
+ lightskyblue: 0x87cefa,
26368
+ lightslategray: 0x778899,
26369
+ lightslategrey: 0x778899,
26370
+ lightsteelblue: 0xb0c4de,
26371
+ lightyellow: 0xffffe0,
26372
+ lime: 0x00ff00,
26373
+ limegreen: 0x32cd32,
26374
+ linen: 0xfaf0e6,
26375
+ magenta: 0xff00ff,
26376
+ maroon: 0x800000,
26377
+ mediumaquamarine: 0x66cdaa,
26378
+ mediumblue: 0x0000cd,
26379
+ mediumorchid: 0xba55d3,
26380
+ mediumpurple: 0x9370db,
26381
+ mediumseagreen: 0x3cb371,
26382
+ mediumslateblue: 0x7b68ee,
26383
+ mediumspringgreen: 0x00fa9a,
26384
+ mediumturquoise: 0x48d1cc,
26385
+ mediumvioletred: 0xc71585,
26386
+ midnightblue: 0x191970,
26387
+ mintcream: 0xf5fffa,
26388
+ mistyrose: 0xffe4e1,
26389
+ moccasin: 0xffe4b5,
26390
+ navajowhite: 0xffdead,
26391
+ navy: 0x000080,
26392
+ oldlace: 0xfdf5e6,
26393
+ olive: 0x808000,
26394
+ olivedrab: 0x6b8e23,
26395
+ orange: 0xffa500,
26396
+ orangered: 0xff4500,
26397
+ orchid: 0xda70d6,
26398
+ palegoldenrod: 0xeee8aa,
26399
+ palegreen: 0x98fb98,
26400
+ paleturquoise: 0xafeeee,
26401
+ palevioletred: 0xdb7093,
26402
+ papayawhip: 0xffefd5,
26403
+ peachpuff: 0xffdab9,
26404
+ peru: 0xcd853f,
26405
+ pink: 0xffc0cb,
26406
+ plum: 0xdda0dd,
26407
+ powderblue: 0xb0e0e6,
26408
+ purple: 0x800080,
26409
+ rebeccapurple: 0x663399,
26410
+ red: 0xff0000,
26411
+ rosybrown: 0xbc8f8f,
26412
+ royalblue: 0x4169e1,
26413
+ saddlebrown: 0x8b4513,
26414
+ salmon: 0xfa8072,
26415
+ sandybrown: 0xf4a460,
26416
+ seagreen: 0x2e8b57,
26417
+ seashell: 0xfff5ee,
26418
+ sienna: 0xa0522d,
26419
+ silver: 0xc0c0c0,
26420
+ skyblue: 0x87ceeb,
26421
+ slateblue: 0x6a5acd,
26422
+ slategray: 0x708090,
26423
+ slategrey: 0x708090,
26424
+ snow: 0xfffafa,
26425
+ springgreen: 0x00ff7f,
26426
+ steelblue: 0x4682b4,
26427
+ tan: 0xd2b48c,
26428
+ teal: 0x008080,
26429
+ thistle: 0xd8bfd8,
26430
+ tomato: 0xff6347,
26431
+ turquoise: 0x40e0d0,
26432
+ violet: 0xee82ee,
26433
+ wheat: 0xf5deb3,
26434
+ white: 0xffffff,
26435
+ whitesmoke: 0xf5f5f5,
26436
+ yellow: 0xffff00,
26437
+ yellowgreen: 0x9acd32
26438
+ };
26439
+
26440
+ define(Color, color, {
26441
+ copy(channels) {
26442
+ return Object.assign(new this.constructor, this, channels);
26443
+ },
26444
+ displayable() {
26445
+ return this.rgb().displayable();
26446
+ },
26447
+ hex: color_formatHex, // Deprecated! Use color.formatHex.
26448
+ formatHex: color_formatHex,
26449
+ formatHex8: color_formatHex8,
26450
+ formatHsl: color_formatHsl,
26451
+ formatRgb: color_formatRgb,
26452
+ toString: color_formatRgb
26453
+ });
26454
+
26455
+ function color_formatHex() {
26456
+ return this.rgb().formatHex();
26457
+ }
26458
+
26459
+ function color_formatHex8() {
26460
+ return this.rgb().formatHex8();
26461
+ }
26462
+
26463
+ function color_formatHsl() {
26464
+ return hslConvert(this).formatHsl();
26465
+ }
26466
+
26467
+ function color_formatRgb() {
26468
+ return this.rgb().formatRgb();
26469
+ }
26470
+
26471
+ function color(format) {
26472
+ var m, l;
26473
+ format = (format + "").trim().toLowerCase();
26474
+ return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000
26475
+ : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00
26476
+ : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000
26477
+ : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000
26478
+ : null) // invalid hex
26479
+ : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)
26480
+ : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)
26481
+ : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)
26482
+ : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)
26483
+ : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)
26484
+ : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)
26485
+ : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins
26486
+ : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0)
26487
+ : null;
26488
+ }
26489
+
26490
+ function rgbn(n) {
26491
+ return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);
26492
+ }
26493
+
26494
+ function rgba(r, g, b, a) {
26495
+ if (a <= 0) r = g = b = NaN;
26496
+ return new Rgb(r, g, b, a);
26497
+ }
26498
+
26499
+ function rgbConvert(o) {
26500
+ if (!(o instanceof Color)) o = color(o);
26501
+ if (!o) return new Rgb;
26502
+ o = o.rgb();
26503
+ return new Rgb(o.r, o.g, o.b, o.opacity);
26504
+ }
26505
+
26506
+ function rgb$1(r, g, b, opacity) {
26507
+ return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
26508
+ }
26509
+
26510
+ function Rgb(r, g, b, opacity) {
26511
+ this.r = +r;
26512
+ this.g = +g;
26513
+ this.b = +b;
26514
+ this.opacity = +opacity;
26515
+ }
26516
+
26517
+ define(Rgb, rgb$1, extend(Color, {
26518
+ brighter(k) {
26519
+ k = k == null ? brighter : Math.pow(brighter, k);
26520
+ return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
26521
+ },
26522
+ darker(k) {
26523
+ k = k == null ? darker : Math.pow(darker, k);
26524
+ return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
26525
+ },
26526
+ rgb() {
26527
+ return this;
26528
+ },
26529
+ clamp() {
26530
+ return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
26531
+ },
26532
+ displayable() {
26533
+ return (-0.5 <= this.r && this.r < 255.5)
26534
+ && (-0.5 <= this.g && this.g < 255.5)
26535
+ && (-0.5 <= this.b && this.b < 255.5)
26536
+ && (0 <= this.opacity && this.opacity <= 1);
26537
+ },
26538
+ hex: rgb_formatHex, // Deprecated! Use color.formatHex.
26539
+ formatHex: rgb_formatHex,
26540
+ formatHex8: rgb_formatHex8,
26541
+ formatRgb: rgb_formatRgb,
26542
+ toString: rgb_formatRgb
26543
+ }));
26544
+
26545
+ function rgb_formatHex() {
26546
+ return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
26547
+ }
26548
+
26549
+ function rgb_formatHex8() {
26550
+ return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
26551
+ }
26552
+
26553
+ function rgb_formatRgb() {
26554
+ const a = clampa(this.opacity);
26555
+ return `${a === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? ")" : `, ${a})`}`;
26556
+ }
26557
+
26558
+ function clampa(opacity) {
26559
+ return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
26560
+ }
26561
+
26562
+ function clampi(value) {
26563
+ return Math.max(0, Math.min(255, Math.round(value) || 0));
26564
+ }
26565
+
26566
+ function hex(value) {
26567
+ value = clampi(value);
26568
+ return (value < 16 ? "0" : "") + value.toString(16);
26569
+ }
26570
+
26571
+ function hsla(h, s, l, a) {
26572
+ if (a <= 0) h = s = l = NaN;
26573
+ else if (l <= 0 || l >= 1) h = s = NaN;
26574
+ else if (s <= 0) h = NaN;
26575
+ return new Hsl(h, s, l, a);
26576
+ }
26577
+
26578
+ function hslConvert(o) {
26579
+ if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
26580
+ if (!(o instanceof Color)) o = color(o);
26581
+ if (!o) return new Hsl;
26582
+ if (o instanceof Hsl) return o;
26583
+ o = o.rgb();
26584
+ var r = o.r / 255,
26585
+ g = o.g / 255,
26586
+ b = o.b / 255,
26587
+ min = Math.min(r, g, b),
26588
+ max = Math.max(r, g, b),
26589
+ h = NaN,
26590
+ s = max - min,
26591
+ l = (max + min) / 2;
26592
+ if (s) {
26593
+ if (r === max) h = (g - b) / s + (g < b) * 6;
26594
+ else if (g === max) h = (b - r) / s + 2;
26595
+ else h = (r - g) / s + 4;
26596
+ s /= l < 0.5 ? max + min : 2 - max - min;
26597
+ h *= 60;
26598
+ } else {
26599
+ s = l > 0 && l < 1 ? 0 : h;
26600
+ }
26601
+ return new Hsl(h, s, l, o.opacity);
26602
+ }
26603
+
26604
+ function hsl(h, s, l, opacity) {
26605
+ return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
26606
+ }
26607
+
26608
+ function Hsl(h, s, l, opacity) {
26609
+ this.h = +h;
26610
+ this.s = +s;
26611
+ this.l = +l;
26612
+ this.opacity = +opacity;
26613
+ }
26614
+
26615
+ define(Hsl, hsl, extend(Color, {
26616
+ brighter(k) {
26617
+ k = k == null ? brighter : Math.pow(brighter, k);
26618
+ return new Hsl(this.h, this.s, this.l * k, this.opacity);
26619
+ },
26620
+ darker(k) {
26621
+ k = k == null ? darker : Math.pow(darker, k);
26622
+ return new Hsl(this.h, this.s, this.l * k, this.opacity);
26623
+ },
26624
+ rgb() {
26625
+ var h = this.h % 360 + (this.h < 0) * 360,
26626
+ s = isNaN(h) || isNaN(this.s) ? 0 : this.s,
26627
+ l = this.l,
26628
+ m2 = l + (l < 0.5 ? l : 1 - l) * s,
26629
+ m1 = 2 * l - m2;
26630
+ return new Rgb(
26631
+ hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
26632
+ hsl2rgb(h, m1, m2),
26633
+ hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
26634
+ this.opacity
26635
+ );
26636
+ },
26637
+ clamp() {
26638
+ return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
26639
+ },
26640
+ displayable() {
26641
+ return (0 <= this.s && this.s <= 1 || isNaN(this.s))
26642
+ && (0 <= this.l && this.l <= 1)
26643
+ && (0 <= this.opacity && this.opacity <= 1);
26644
+ },
26645
+ formatHsl() {
26646
+ const a = clampa(this.opacity);
26647
+ return `${a === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? ")" : `, ${a})`}`;
26648
+ }
26649
+ }));
26650
+
26651
+ function clamph(value) {
26652
+ value = (value || 0) % 360;
26653
+ return value < 0 ? value + 360 : value;
26654
+ }
26655
+
26656
+ function clampt(value) {
26657
+ return Math.max(0, Math.min(1, value || 0));
26658
+ }
26659
+
26660
+ /* From FvD 13.37, CSS Color Module Level 3 */
26661
+ function hsl2rgb(h, m1, m2) {
26662
+ return (h < 60 ? m1 + (m2 - m1) * h / 60
26663
+ : h < 180 ? m2
26664
+ : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60
26665
+ : m1) * 255;
26666
+ }
26667
+
26668
+ var constant = x => () => x;
26669
+
26670
+ function linear$1(a, d) {
26671
+ return function(t) {
26672
+ return a + t * d;
26673
+ };
26674
+ }
26675
+
26676
+ function exponential(a, b, y) {
26677
+ return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {
26678
+ return Math.pow(a + t * b, y);
26679
+ };
26680
+ }
26681
+
26682
+ function gamma(y) {
26683
+ return (y = +y) === 1 ? nogamma : function(a, b) {
26684
+ return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);
26685
+ };
26686
+ }
26687
+
26688
+ function nogamma(a, b) {
26689
+ var d = b - a;
26690
+ return d ? linear$1(a, d) : constant(isNaN(a) ? b : a);
26691
+ }
26692
+
26693
+ var rgb = (function rgbGamma(y) {
26694
+ var color = gamma(y);
26695
+
26696
+ function rgb(start, end) {
26697
+ var r = color((start = rgb$1(start)).r, (end = rgb$1(end)).r),
26698
+ g = color(start.g, end.g),
26699
+ b = color(start.b, end.b),
26700
+ opacity = nogamma(start.opacity, end.opacity);
26701
+ return function(t) {
26702
+ start.r = r(t);
26703
+ start.g = g(t);
26704
+ start.b = b(t);
26705
+ start.opacity = opacity(t);
26706
+ return start + "";
26707
+ };
26708
+ }
26709
+
26710
+ rgb.gamma = rgbGamma;
26711
+
26712
+ return rgb;
26713
+ })(1);
26714
+
26715
+ function numberArray(a, b) {
26716
+ if (!b) b = [];
26717
+ var n = a ? Math.min(b.length, a.length) : 0,
26718
+ c = b.slice(),
26719
+ i;
26720
+ return function(t) {
26721
+ for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;
26722
+ return c;
26723
+ };
26724
+ }
26725
+
26726
+ function isNumberArray(x) {
26727
+ return ArrayBuffer.isView(x) && !(x instanceof DataView);
26728
+ }
26729
+
26730
+ function genericArray(a, b) {
26731
+ var nb = b ? b.length : 0,
26732
+ na = a ? Math.min(nb, a.length) : 0,
26733
+ x = new Array(na),
26734
+ c = new Array(nb),
26735
+ i;
26736
+
26737
+ for (i = 0; i < na; ++i) x[i] = interpolate(a[i], b[i]);
26738
+ for (; i < nb; ++i) c[i] = b[i];
26739
+
26740
+ return function(t) {
26741
+ for (i = 0; i < na; ++i) c[i] = x[i](t);
26742
+ return c;
26743
+ };
26744
+ }
26745
+
26746
+ function date(a, b) {
26747
+ var d = new Date;
26748
+ return a = +a, b = +b, function(t) {
26749
+ return d.setTime(a * (1 - t) + b * t), d;
26750
+ };
26751
+ }
26752
+
26753
+ function interpolateNumber(a, b) {
26754
+ return a = +a, b = +b, function(t) {
26755
+ return a * (1 - t) + b * t;
26756
+ };
26757
+ }
26758
+
26759
+ function object(a, b) {
26760
+ var i = {},
26761
+ c = {},
26762
+ k;
26763
+
26764
+ if (a === null || typeof a !== "object") a = {};
26765
+ if (b === null || typeof b !== "object") b = {};
26766
+
26767
+ for (k in b) {
26768
+ if (k in a) {
26769
+ i[k] = interpolate(a[k], b[k]);
26770
+ } else {
26771
+ c[k] = b[k];
26772
+ }
26773
+ }
26774
+
26775
+ return function(t) {
26776
+ for (k in i) c[k] = i[k](t);
26777
+ return c;
26778
+ };
26779
+ }
26780
+
26781
+ var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,
26782
+ reB = new RegExp(reA.source, "g");
26783
+
26784
+ function zero(b) {
26785
+ return function() {
26786
+ return b;
26787
+ };
26788
+ }
26789
+
26790
+ function one(b) {
26791
+ return function(t) {
26792
+ return b(t) + "";
26793
+ };
26794
+ }
26795
+
26796
+ function string(a, b) {
26797
+ var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b
26798
+ am, // current match in a
26799
+ bm, // current match in b
26800
+ bs, // string preceding current number in b, if any
26801
+ i = -1, // index in s
26802
+ s = [], // string constants and placeholders
26803
+ q = []; // number interpolators
26804
+
26805
+ // Coerce inputs to strings.
26806
+ a = a + "", b = b + "";
26807
+
26808
+ // Interpolate pairs of numbers in a & b.
26809
+ while ((am = reA.exec(a))
26810
+ && (bm = reB.exec(b))) {
26811
+ if ((bs = bm.index) > bi) { // a string precedes the next number in b
26812
+ bs = b.slice(bi, bs);
26813
+ if (s[i]) s[i] += bs; // coalesce with previous string
26814
+ else s[++i] = bs;
26815
+ }
26816
+ if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match
26817
+ if (s[i]) s[i] += bm; // coalesce with previous string
26818
+ else s[++i] = bm;
26819
+ } else { // interpolate non-matching numbers
26820
+ s[++i] = null;
26821
+ q.push({i: i, x: interpolateNumber(am, bm)});
26822
+ }
26823
+ bi = reB.lastIndex;
26824
+ }
26825
+
26826
+ // Add remains of b.
26827
+ if (bi < b.length) {
26828
+ bs = b.slice(bi);
26829
+ if (s[i]) s[i] += bs; // coalesce with previous string
26830
+ else s[++i] = bs;
26831
+ }
26832
+
26833
+ // Special optimization for only a single match.
26834
+ // Otherwise, interpolate each of the numbers and rejoin the string.
26835
+ return s.length < 2 ? (q[0]
26836
+ ? one(q[0].x)
26837
+ : zero(b))
26838
+ : (b = q.length, function(t) {
26839
+ for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);
26840
+ return s.join("");
26841
+ });
26842
+ }
26843
+
26844
+ function interpolate(a, b) {
26845
+ var t = typeof b, c;
26846
+ return b == null || t === "boolean" ? constant(b)
26847
+ : (t === "number" ? interpolateNumber
26848
+ : t === "string" ? ((c = color(b)) ? (b = c, rgb) : string)
26849
+ : b instanceof color ? rgb
26850
+ : b instanceof Date ? date
26851
+ : isNumberArray(b) ? numberArray
26852
+ : Array.isArray(b) ? genericArray
26853
+ : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object
26854
+ : interpolateNumber)(a, b);
26855
+ }
26856
+
26857
+ function interpolateRound(a, b) {
26858
+ return a = +a, b = +b, function(t) {
26859
+ return Math.round(a * (1 - t) + b * t);
26860
+ };
26861
+ }
26862
+
26863
+ function constants(x) {
26864
+ return function() {
26865
+ return x;
26866
+ };
26867
+ }
26868
+
26869
+ function number(x) {
26870
+ return +x;
26871
+ }
26872
+
26873
+ var unit = [0, 1];
26874
+
26875
+ function identity$1(x) {
26876
+ return x;
26877
+ }
26878
+
26879
+ function normalize(a, b) {
26880
+ return (b -= (a = +a))
26881
+ ? function(x) { return (x - a) / b; }
26882
+ : constants(isNaN(b) ? NaN : 0.5);
26883
+ }
26884
+
26885
+ function clamper(a, b) {
26886
+ var t;
26887
+ if (a > b) t = a, a = b, b = t;
26888
+ return function(x) { return Math.max(a, Math.min(b, x)); };
26889
+ }
26890
+
26891
+ // normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].
26892
+ // interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].
26893
+ function bimap(domain, range, interpolate) {
26894
+ var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];
26895
+ if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);
26896
+ else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);
26897
+ return function(x) { return r0(d0(x)); };
26898
+ }
26899
+
26900
+ function polymap(domain, range, interpolate) {
26901
+ var j = Math.min(domain.length, range.length) - 1,
26902
+ d = new Array(j),
26903
+ r = new Array(j),
26904
+ i = -1;
26905
+
26906
+ // Reverse descending domains.
26907
+ if (domain[j] < domain[0]) {
26908
+ domain = domain.slice().reverse();
26909
+ range = range.slice().reverse();
26910
+ }
26911
+
26912
+ while (++i < j) {
26913
+ d[i] = normalize(domain[i], domain[i + 1]);
26914
+ r[i] = interpolate(range[i], range[i + 1]);
26915
+ }
26916
+
26917
+ return function(x) {
26918
+ var i = bisect(domain, x, 1, j) - 1;
26919
+ return r[i](d[i](x));
26920
+ };
26921
+ }
26922
+
26923
+ function copy(source, target) {
26924
+ return target
26925
+ .domain(source.domain())
26926
+ .range(source.range())
26927
+ .interpolate(source.interpolate())
26928
+ .clamp(source.clamp())
26929
+ .unknown(source.unknown());
26930
+ }
26931
+
26932
+ function transformer() {
26933
+ var domain = unit,
26934
+ range = unit,
26935
+ interpolate$1 = interpolate,
26936
+ transform,
26937
+ untransform,
26938
+ unknown,
26939
+ clamp = identity$1,
26940
+ piecewise,
26941
+ output,
26942
+ input;
26943
+
26944
+ function rescale() {
26945
+ var n = Math.min(domain.length, range.length);
26946
+ if (clamp !== identity$1) clamp = clamper(domain[0], domain[n - 1]);
26947
+ piecewise = n > 2 ? polymap : bimap;
26948
+ output = input = null;
26949
+ return scale;
26950
+ }
26951
+
26952
+ function scale(x) {
26953
+ return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate$1)))(transform(clamp(x)));
26954
+ }
26955
+
26956
+ scale.invert = function(y) {
26957
+ return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));
26958
+ };
26959
+
26960
+ scale.domain = function(_) {
26961
+ return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();
26962
+ };
26963
+
26964
+ scale.range = function(_) {
26965
+ return arguments.length ? (range = Array.from(_), rescale()) : range.slice();
26966
+ };
26967
+
26968
+ scale.rangeRound = function(_) {
26969
+ return range = Array.from(_), interpolate$1 = interpolateRound, rescale();
26970
+ };
26971
+
26972
+ scale.clamp = function(_) {
26973
+ return arguments.length ? (clamp = _ ? true : identity$1, rescale()) : clamp !== identity$1;
26974
+ };
26975
+
26976
+ scale.interpolate = function(_) {
26977
+ return arguments.length ? (interpolate$1 = _, rescale()) : interpolate$1;
26978
+ };
26979
+
26980
+ scale.unknown = function(_) {
26981
+ return arguments.length ? (unknown = _, scale) : unknown;
26982
+ };
26983
+
26984
+ return function(t, u) {
26985
+ transform = t, untransform = u;
26986
+ return rescale();
26987
+ };
26988
+ }
26989
+
26990
+ function continuous() {
26991
+ return transformer()(identity$1, identity$1);
26992
+ }
26993
+
26994
+ function formatDecimal(x) {
26995
+ return Math.abs(x = Math.round(x)) >= 1e21
26996
+ ? x.toLocaleString("en").replace(/,/g, "")
26997
+ : x.toString(10);
26998
+ }
26999
+
27000
+ // Computes the decimal coefficient and exponent of the specified number x with
27001
+ // significant digits p, where x is positive and p is in [1, 21] or undefined.
27002
+ // For example, formatDecimalParts(1.23) returns ["123", 0].
27003
+ function formatDecimalParts(x, p) {
27004
+ if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity
27005
+ var i, coefficient = x.slice(0, i);
27006
+
27007
+ // The string returned by toExponential either has the form \d\.\d+e[-+]\d+
27008
+ // (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3).
27009
+ return [
27010
+ coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
27011
+ +x.slice(i + 1)
27012
+ ];
27013
+ }
27014
+
27015
+ function exponent(x) {
27016
+ return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;
27017
+ }
27018
+
27019
+ function formatGroup(grouping, thousands) {
27020
+ return function(value, width) {
27021
+ var i = value.length,
27022
+ t = [],
27023
+ j = 0,
27024
+ g = grouping[0],
27025
+ length = 0;
27026
+
27027
+ while (i > 0 && g > 0) {
27028
+ if (length + g + 1 > width) g = Math.max(1, width - length);
27029
+ t.push(value.substring(i -= g, i + g));
27030
+ if ((length += g + 1) > width) break;
27031
+ g = grouping[j = (j + 1) % grouping.length];
27032
+ }
27033
+
27034
+ return t.reverse().join(thousands);
27035
+ };
27036
+ }
27037
+
27038
+ function formatNumerals(numerals) {
27039
+ return function(value) {
27040
+ return value.replace(/[0-9]/g, function(i) {
27041
+ return numerals[+i];
27042
+ });
27043
+ };
27044
+ }
27045
+
27046
+ // [[fill]align][sign][symbol][0][width][,][.precision][~][type]
27047
+ var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
27048
+
27049
+ function formatSpecifier(specifier) {
27050
+ if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier);
27051
+ var match;
27052
+ return new FormatSpecifier({
27053
+ fill: match[1],
27054
+ align: match[2],
27055
+ sign: match[3],
27056
+ symbol: match[4],
27057
+ zero: match[5],
27058
+ width: match[6],
27059
+ comma: match[7],
27060
+ precision: match[8] && match[8].slice(1),
27061
+ trim: match[9],
27062
+ type: match[10]
27063
+ });
27064
+ }
27065
+
27066
+ formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof
27067
+
27068
+ function FormatSpecifier(specifier) {
27069
+ this.fill = specifier.fill === undefined ? " " : specifier.fill + "";
27070
+ this.align = specifier.align === undefined ? ">" : specifier.align + "";
27071
+ this.sign = specifier.sign === undefined ? "-" : specifier.sign + "";
27072
+ this.symbol = specifier.symbol === undefined ? "" : specifier.symbol + "";
27073
+ this.zero = !!specifier.zero;
27074
+ this.width = specifier.width === undefined ? undefined : +specifier.width;
27075
+ this.comma = !!specifier.comma;
27076
+ this.precision = specifier.precision === undefined ? undefined : +specifier.precision;
27077
+ this.trim = !!specifier.trim;
27078
+ this.type = specifier.type === undefined ? "" : specifier.type + "";
27079
+ }
27080
+
27081
+ FormatSpecifier.prototype.toString = function() {
27082
+ return this.fill
27083
+ + this.align
27084
+ + this.sign
27085
+ + this.symbol
27086
+ + (this.zero ? "0" : "")
27087
+ + (this.width === undefined ? "" : Math.max(1, this.width | 0))
27088
+ + (this.comma ? "," : "")
27089
+ + (this.precision === undefined ? "" : "." + Math.max(0, this.precision | 0))
27090
+ + (this.trim ? "~" : "")
27091
+ + this.type;
27092
+ };
27093
+
27094
+ // Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.
27095
+ function formatTrim(s) {
27096
+ out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {
27097
+ switch (s[i]) {
27098
+ case ".": i0 = i1 = i; break;
27099
+ case "0": if (i0 === 0) i0 = i; i1 = i; break;
27100
+ default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;
27101
+ }
27102
+ }
27103
+ return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;
27104
+ }
27105
+
27106
+ var prefixExponent;
27107
+
27108
+ function formatPrefixAuto(x, p) {
27109
+ var d = formatDecimalParts(x, p);
27110
+ if (!d) return x + "";
27111
+ var coefficient = d[0],
27112
+ exponent = d[1],
27113
+ i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,
27114
+ n = coefficient.length;
27115
+ return i === n ? coefficient
27116
+ : i > n ? coefficient + new Array(i - n + 1).join("0")
27117
+ : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i)
27118
+ : "0." + new Array(1 - i).join("0") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!
27119
+ }
27120
+
27121
+ function formatRounded(x, p) {
27122
+ var d = formatDecimalParts(x, p);
27123
+ if (!d) return x + "";
27124
+ var coefficient = d[0],
27125
+ exponent = d[1];
27126
+ return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient
27127
+ : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1)
27128
+ : coefficient + new Array(exponent - coefficient.length + 2).join("0");
27129
+ }
27130
+
27131
+ var formatTypes = {
27132
+ "%": (x, p) => (x * 100).toFixed(p),
27133
+ "b": (x) => Math.round(x).toString(2),
27134
+ "c": (x) => x + "",
27135
+ "d": formatDecimal,
27136
+ "e": (x, p) => x.toExponential(p),
27137
+ "f": (x, p) => x.toFixed(p),
27138
+ "g": (x, p) => x.toPrecision(p),
27139
+ "o": (x) => Math.round(x).toString(8),
27140
+ "p": (x, p) => formatRounded(x * 100, p),
27141
+ "r": formatRounded,
27142
+ "s": formatPrefixAuto,
27143
+ "X": (x) => Math.round(x).toString(16).toUpperCase(),
27144
+ "x": (x) => Math.round(x).toString(16)
27145
+ };
27146
+
27147
+ function identity(x) {
27148
+ return x;
27149
+ }
27150
+
27151
+ var map = Array.prototype.map,
27152
+ prefixes = ["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];
27153
+
27154
+ function formatLocale(locale) {
27155
+ var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + ""),
27156
+ currencyPrefix = locale.currency === undefined ? "" : locale.currency[0] + "",
27157
+ currencySuffix = locale.currency === undefined ? "" : locale.currency[1] + "",
27158
+ decimal = locale.decimal === undefined ? "." : locale.decimal + "",
27159
+ numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),
27160
+ percent = locale.percent === undefined ? "%" : locale.percent + "",
27161
+ minus = locale.minus === undefined ? "−" : locale.minus + "",
27162
+ nan = locale.nan === undefined ? "NaN" : locale.nan + "";
27163
+
27164
+ function newFormat(specifier) {
27165
+ specifier = formatSpecifier(specifier);
27166
+
27167
+ var fill = specifier.fill,
27168
+ align = specifier.align,
27169
+ sign = specifier.sign,
27170
+ symbol = specifier.symbol,
27171
+ zero = specifier.zero,
27172
+ width = specifier.width,
27173
+ comma = specifier.comma,
27174
+ precision = specifier.precision,
27175
+ trim = specifier.trim,
27176
+ type = specifier.type;
27177
+
27178
+ // The "n" type is an alias for ",g".
27179
+ if (type === "n") comma = true, type = "g";
27180
+
27181
+ // The "" type, and any invalid type, is an alias for ".12~g".
27182
+ else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = "g";
27183
+
27184
+ // If zero fill is specified, padding goes after sign and before digits.
27185
+ if (zero || (fill === "0" && align === "=")) zero = true, fill = "0", align = "=";
27186
+
27187
+ // Compute the prefix and suffix.
27188
+ // For SI-prefix, the suffix is lazily computed.
27189
+ var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "",
27190
+ suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : "";
27191
+
27192
+ // What format function should we use?
27193
+ // Is this an integer type?
27194
+ // Can this type generate exponential notation?
27195
+ var formatType = formatTypes[type],
27196
+ maybeSuffix = /[defgprs%]/.test(type);
27197
+
27198
+ // Set the default precision if not specified,
27199
+ // or clamp the specified precision to the supported range.
27200
+ // For significant precision, it must be in [1, 21].
27201
+ // For fixed precision, it must be in [0, 20].
27202
+ precision = precision === undefined ? 6
27203
+ : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))
27204
+ : Math.max(0, Math.min(20, precision));
27205
+
27206
+ function format(value) {
27207
+ var valuePrefix = prefix,
27208
+ valueSuffix = suffix,
27209
+ i, n, c;
27210
+
27211
+ if (type === "c") {
27212
+ valueSuffix = formatType(value) + valueSuffix;
27213
+ value = "";
27214
+ } else {
27215
+ value = +value;
27216
+
27217
+ // Determine the sign. -0 is not less than 0, but 1 / -0 is!
27218
+ var valueNegative = value < 0 || 1 / value < 0;
27219
+
27220
+ // Perform the initial formatting.
27221
+ value = isNaN(value) ? nan : formatType(Math.abs(value), precision);
27222
+
27223
+ // Trim insignificant zeros.
27224
+ if (trim) value = formatTrim(value);
27225
+
27226
+ // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.
27227
+ if (valueNegative && +value === 0 && sign !== "+") valueNegative = false;
27228
+
27229
+ // Compute the prefix and suffix.
27230
+ valuePrefix = (valueNegative ? (sign === "(" ? sign : minus) : sign === "-" || sign === "(" ? "" : sign) + valuePrefix;
27231
+ valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : "");
27232
+
27233
+ // Break the formatted value into the integer “value” part that can be
27234
+ // grouped, and fractional or exponential “suffix” part that is not.
27235
+ if (maybeSuffix) {
27236
+ i = -1, n = value.length;
27237
+ while (++i < n) {
27238
+ if (c = value.charCodeAt(i), 48 > c || c > 57) {
27239
+ valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;
27240
+ value = value.slice(0, i);
27241
+ break;
27242
+ }
27243
+ }
27244
+ }
27245
+ }
27246
+
27247
+ // If the fill character is not "0", grouping is applied before padding.
27248
+ if (comma && !zero) value = group(value, Infinity);
27249
+
27250
+ // Compute the padding.
27251
+ var length = valuePrefix.length + value.length + valueSuffix.length,
27252
+ padding = length < width ? new Array(width - length + 1).join(fill) : "";
27253
+
27254
+ // If the fill character is "0", grouping is applied after padding.
27255
+ if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = "";
27256
+
27257
+ // Reconstruct the final output based on the desired alignment.
27258
+ switch (align) {
27259
+ case "<": value = valuePrefix + value + valueSuffix + padding; break;
27260
+ case "=": value = valuePrefix + padding + value + valueSuffix; break;
27261
+ case "^": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;
27262
+ default: value = padding + valuePrefix + value + valueSuffix; break;
27263
+ }
27264
+
27265
+ return numerals(value);
27266
+ }
27267
+
27268
+ format.toString = function() {
27269
+ return specifier + "";
27270
+ };
27271
+
27272
+ return format;
27273
+ }
27274
+
27275
+ function formatPrefix(specifier, value) {
27276
+ var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)),
27277
+ e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,
27278
+ k = Math.pow(10, -e),
27279
+ prefix = prefixes[8 + e / 3];
27280
+ return function(value) {
27281
+ return f(k * value) + prefix;
27282
+ };
27283
+ }
27284
+
27285
+ return {
27286
+ format: newFormat,
27287
+ formatPrefix: formatPrefix
27288
+ };
27289
+ }
27290
+
27291
+ var locale;
27292
+ var format;
27293
+ var formatPrefix;
27294
+
27295
+ defaultLocale({
27296
+ thousands: ",",
27297
+ grouping: [3],
27298
+ currency: ["$", ""]
27299
+ });
27300
+
27301
+ function defaultLocale(definition) {
27302
+ locale = formatLocale(definition);
27303
+ format = locale.format;
27304
+ formatPrefix = locale.formatPrefix;
27305
+ return locale;
27306
+ }
27307
+
27308
+ function precisionFixed(step) {
27309
+ return Math.max(0, -exponent(Math.abs(step)));
27310
+ }
27311
+
27312
+ function precisionPrefix(step, value) {
27313
+ return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));
27314
+ }
27315
+
27316
+ function precisionRound(step, max) {
27317
+ step = Math.abs(step), max = Math.abs(max) - step;
27318
+ return Math.max(0, exponent(max) - exponent(step)) + 1;
27319
+ }
27320
+
27321
+ function tickFormat(start, stop, count, specifier) {
27322
+ var step = tickStep(start, stop, count),
27323
+ precision;
27324
+ specifier = formatSpecifier(specifier == null ? ",f" : specifier);
27325
+ switch (specifier.type) {
27326
+ case "s": {
27327
+ var value = Math.max(Math.abs(start), Math.abs(stop));
27328
+ if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;
27329
+ return formatPrefix(specifier, value);
27330
+ }
27331
+ case "":
27332
+ case "e":
27333
+ case "g":
27334
+ case "p":
27335
+ case "r": {
27336
+ if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e");
27337
+ break;
27338
+ }
27339
+ case "f":
27340
+ case "%": {
27341
+ if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === "%") * 2;
27342
+ break;
27343
+ }
27344
+ }
27345
+ return format(specifier);
27346
+ }
27347
+
27348
+ function linearish(scale) {
27349
+ var domain = scale.domain;
27350
+
27351
+ scale.ticks = function(count) {
27352
+ var d = domain();
27353
+ return ticks(d[0], d[d.length - 1], count == null ? 10 : count);
27354
+ };
27355
+
27356
+ scale.tickFormat = function(count, specifier) {
27357
+ var d = domain();
27358
+ return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);
27359
+ };
27360
+
27361
+ scale.nice = function(count) {
27362
+ if (count == null) count = 10;
27363
+
27364
+ var d = domain();
27365
+ var i0 = 0;
27366
+ var i1 = d.length - 1;
27367
+ var start = d[i0];
27368
+ var stop = d[i1];
27369
+ var prestep;
27370
+ var step;
27371
+ var maxIter = 10;
27372
+
27373
+ if (stop < start) {
27374
+ step = start, start = stop, stop = step;
27375
+ step = i0, i0 = i1, i1 = step;
27376
+ }
27377
+
27378
+ while (maxIter-- > 0) {
27379
+ step = tickIncrement(start, stop, count);
27380
+ if (step === prestep) {
27381
+ d[i0] = start;
27382
+ d[i1] = stop;
27383
+ return domain(d);
27384
+ } else if (step > 0) {
27385
+ start = Math.floor(start / step) * step;
27386
+ stop = Math.ceil(stop / step) * step;
27387
+ } else if (step < 0) {
27388
+ start = Math.ceil(start * step) / step;
27389
+ stop = Math.floor(stop * step) / step;
27390
+ } else {
27391
+ break;
27392
+ }
27393
+ prestep = step;
27394
+ }
27395
+
27396
+ return scale;
27397
+ };
27398
+
27399
+ return scale;
27400
+ }
27401
+
27402
+ function linear() {
27403
+ var scale = continuous();
27404
+
27405
+ scale.copy = function() {
27406
+ return copy(scale, linear());
27407
+ };
27408
+
27409
+ initRange.apply(scale, arguments);
27410
+
27411
+ return linearish(scale);
27412
+ }
27413
+
27414
+ /**
27415
+ * Computations calculates and stores different measures which are used in the Wafermap
27416
+ */
27417
+ class Computations {
27418
+ constructor(dies, axisLocation, canvasDimensions) {
27419
+ this.baseMargin = {
27420
+ top: 20,
27421
+ right: 20,
27422
+ bottom: 20,
27423
+ left: 20
27424
+ };
27425
+ this.dieSizeFactor = 1.5;
27426
+ this.defaultAlign = 0.5;
27427
+ this.margin = this.baseMargin;
27428
+ const gridMapDimensions = this.calculateMapDimensions(dies);
27429
+ this.containerDimensions = this.calculateContainerDimensions(canvasDimensions, this.margin);
27430
+ this.horizontalScale = this.createHorizontalScale(axisLocation, gridMapDimensions, this.containerDimensions.width);
27431
+ this.dieDimensions = {
27432
+ width: this.calculateGridWidth(gridMapDimensions.cols, this.containerDimensions.width),
27433
+ height: 0
27434
+ };
27435
+ this.radius = this.containerDimensions.width / 2
27436
+ + this.dieDimensions.width * this.dieSizeFactor;
27437
+ if (this.radius > canvasDimensions.width / 2) {
27438
+ this.margin = this.calculateMarginWithAddition(this.radius - canvasDimensions.width / 2);
27439
+ this.containerDimensions = this.calculateContainerDimensions(canvasDimensions, this.margin);
27440
+ this.horizontalScale = this.createHorizontalScale(axisLocation, gridMapDimensions, this.containerDimensions.width);
27441
+ this.dieDimensions = {
27442
+ width: this.calculateGridWidth(gridMapDimensions.cols, this.containerDimensions.width),
27443
+ height: 0
27444
+ };
27445
+ this.radius = this.containerDimensions.width / 2
27446
+ + this.dieDimensions.width * this.dieSizeFactor;
27447
+ }
27448
+ this.verticalScale = this.createVerticalScale(axisLocation, gridMapDimensions, this.containerDimensions.height);
27449
+ this.dieDimensions = {
27450
+ width: this.dieDimensions.width,
27451
+ height: this.calculateGridHeight(gridMapDimensions.rows, this.containerDimensions.height)
27452
+ };
27453
+ }
27454
+ calculateMapDimensions(dies) {
27455
+ if (dies.length === 0 || dies[0] === undefined)
27456
+ return { origin: { x: 0, y: 0 }, rows: 0, cols: 0 };
27457
+ const minPoint = { x: dies[0].x, y: dies[0].y };
27458
+ const maxPoint = { x: dies[0].x, y: dies[0].y };
27459
+ for (const die of dies) {
27460
+ if (die.x < minPoint.x)
27461
+ minPoint.x = die.x;
27462
+ if (die.y < minPoint.y)
27463
+ minPoint.y = die.y;
27464
+ if (die.x > maxPoint.x)
27465
+ maxPoint.x = die.x;
27466
+ if (die.y > maxPoint.y)
27467
+ maxPoint.y = die.y;
27468
+ }
27469
+ return {
27470
+ origin: minPoint,
27471
+ rows: maxPoint.y - minPoint.y + 1,
27472
+ cols: maxPoint.x - minPoint.x + 1
27473
+ };
27474
+ }
27475
+ calculateContainerDimensions(canvasDimensions, margin) {
27476
+ return {
27477
+ width: canvasDimensions.width - margin.left - margin.right,
27478
+ height: canvasDimensions.height - margin.top - margin.bottom
27479
+ };
27480
+ }
27481
+ createHorizontalScale(axisLocation, grid, containerWidth) {
27482
+ if (axisLocation === WaferMapQuadrant.bottomLeft
27483
+ || axisLocation === WaferMapQuadrant.topLeft) {
27484
+ return linear()
27485
+ .domain([grid.origin.x, grid.origin.x + grid.cols])
27486
+ .range([0, containerWidth]);
27487
+ }
27488
+ return linear()
27489
+ .domain([grid.origin.x - 1, grid.origin.x + grid.cols - 1])
27490
+ .range([containerWidth, 0]);
27491
+ }
27492
+ createVerticalScale(axisLocation, grid, containerHeight) {
27493
+ if (axisLocation === WaferMapQuadrant.bottomLeft
27494
+ || axisLocation === WaferMapQuadrant.bottomRight) {
27495
+ return linear()
27496
+ .domain([grid.origin.y - 1, grid.origin.y + grid.rows - 1])
27497
+ .range([containerHeight, 0]);
27498
+ }
27499
+ return linear()
27500
+ .domain([grid.origin.y, grid.origin.y + grid.rows])
27501
+ .range([0, containerHeight]);
27502
+ }
27503
+ calculateGridWidth(cols, containerWidth) {
27504
+ return band()
27505
+ .align(this.defaultAlign)
27506
+ .padding(0)
27507
+ .domain(this.horizontalScale.ticks(cols))
27508
+ .range([0, containerWidth])
27509
+ .bandwidth();
27510
+ }
27511
+ calculateGridHeight(rows, containerHeight) {
27512
+ return band()
27513
+ .align(this.defaultAlign)
27514
+ .padding(0)
27515
+ .domain(this.verticalScale.ticks(rows))
27516
+ .range([0, containerHeight])
27517
+ .bandwidth();
27518
+ }
27519
+ calculateMarginWithAddition(baseAddition = 0) {
27520
+ return {
27521
+ top: this.baseMargin.top + baseAddition,
27522
+ right: this.baseMargin.right + baseAddition,
27523
+ bottom: this.baseMargin.bottom + baseAddition,
27524
+ left: this.baseMargin.top + baseAddition
27525
+ };
27526
+ }
27527
+ }
27528
+
27529
+ /**
27530
+ * Prerendering prepares render-ready dies data to be used by the rendering module
27531
+ */
27532
+ class Prerendering {
27533
+ constructor(dies, colorScale, highlightedValues, horizontalScale, verticalScale, colorScaleMode, dieLabelsHidden, dieLabelsSuffix, maxCharacters, dieDimensions, margin) {
27534
+ this.fontSizeFactor = 0.8;
27535
+ this.nonHighlightedOpacity = 0.3;
27536
+ this.emptyDieColor = '#DADFEC';
27537
+ this.nanDieColor = '#7a7a7a';
27538
+ this.d3ColorScale = this.createD3ColorScale(colorScale, colorScaleMode);
27539
+ this.labelsFontSize = this.calculateLabelsFontSize(dieDimensions, maxCharacters);
27540
+ this.diesRenderInfo = [];
27541
+ for (const die of dies) {
27542
+ this.diesRenderInfo.push({
27543
+ x: horizontalScale(die.x) + margin.right,
27544
+ y: verticalScale(die.y) + margin.top,
27545
+ fillStyle: this.calculateFillStyle(die, colorScaleMode),
27546
+ opacity: this.calculateOpacity(die.value, highlightedValues),
27547
+ text: this.buildLabel(die.value, maxCharacters, dieLabelsHidden, dieLabelsSuffix)
27548
+ });
27549
+ }
27550
+ }
27551
+ calculateLabelsFontSize(dieDimensions, maxCharacters) {
27552
+ return Math.min(dieDimensions.height, (dieDimensions.width / (Math.max(2, maxCharacters) * 0.5))
27553
+ * this.fontSizeFactor);
27554
+ }
27555
+ createD3ColorScale(colorScale, colorScaleMode) {
27556
+ if (this.isColorScaleLinear(colorScaleMode)) {
27557
+ return linear()
27558
+ .domain(colorScale.values.map(item => +item))
27559
+ .range(colorScale.colors);
27560
+ }
27561
+ return ordinal()
27562
+ .domain(colorScale.values)
27563
+ .range(colorScale.colors);
27564
+ }
27565
+ dieHasData(dieData) {
27566
+ return dieData !== null && dieData !== undefined && dieData !== '';
27567
+ }
27568
+ buildLabel(value, maxCharacters, dieLabelsHidden, dieLabelsSuffix) {
27569
+ if (dieLabelsHidden || !this.dieHasData(value)) {
27570
+ return '';
27571
+ }
27572
+ const label = `${value}${dieLabelsSuffix}`;
27573
+ if (label.length > maxCharacters) {
27574
+ return `${label.substring(0, maxCharacters)}…`;
27575
+ }
27576
+ return label;
27577
+ }
27578
+ calculateOpacity(selectedValue, highlightedValues) {
27579
+ return highlightedValues.length > 0
27580
+ && !highlightedValues.some(dieValue => dieValue === selectedValue)
27581
+ ? this.nonHighlightedOpacity
27582
+ : 0;
27583
+ }
27584
+ isColorScaleLinear(colorScaleMode) {
27585
+ return colorScaleMode === WaferMapColorScaleMode.linear;
27586
+ }
27587
+ isColorScaleOrdinal(colorScaleMode) {
27588
+ return colorScaleMode === WaferMapColorScaleMode.ordinal;
27589
+ }
27590
+ calculateFillStyle(die, colorScaleMode) {
27591
+ if (!this.dieHasData(die.value)) {
27592
+ return this.emptyDieColor;
27593
+ }
27594
+ if (isNaN(+die.value)) {
27595
+ return this.nanDieColor;
27596
+ }
27597
+ if (this.isColorScaleLinear(colorScaleMode)) {
27598
+ return this.d3ColorScale(+die.value);
27599
+ }
27600
+ if (this.isColorScaleOrdinal(colorScaleMode)) {
27601
+ return this.d3ColorScale(die.value);
27602
+ }
27603
+ return this.emptyDieColor;
27604
+ }
27605
+ }
27606
+
27607
+ /**
27608
+ * Data Manager uses Computations and Prerendering modules in order and exposes the results
27609
+ */
27610
+ class DataManager {
27611
+ constructor(dies, axisLocation, canvasDimensions, colorScale, highlightedValues, colorScaleMode, dieLabelsHidden, dieLabelsSuffix, maxCharacters) {
27612
+ this.computations = new Computations(dies, axisLocation, canvasDimensions);
27613
+ this.prerendering = new Prerendering(dies, colorScale, highlightedValues, this.computations.horizontalScale, this.computations.verticalScale, colorScaleMode, dieLabelsHidden, dieLabelsSuffix, maxCharacters, this.computations.dieDimensions, this.computations.margin);
27614
+ }
27615
+ get containerDimensions() {
27616
+ return this.computations.containerDimensions;
27617
+ }
27618
+ get dieDimensions() {
27619
+ return this.computations.dieDimensions;
27620
+ }
27621
+ get radius() {
27622
+ return this.computations.radius;
27623
+ }
27624
+ get margin() {
27625
+ return this.computations.margin;
27626
+ }
27627
+ get horizontalScale() {
27628
+ return this.computations.horizontalScale;
27629
+ }
27630
+ get verticalScale() {
27631
+ return this.computations.verticalScale;
27632
+ }
27633
+ get labelsFontSize() {
27634
+ return this.prerendering.labelsFontSize;
27635
+ }
27636
+ get diesRenderInfo() {
27637
+ return this.prerendering.diesRenderInfo;
27638
+ }
27639
+ get mainCircleLocation() {
27640
+ return {
27641
+ x: this.computations.containerDimensions.width / 2,
27642
+ y: this.computations.containerDimensions.height / 2
27643
+ };
27644
+ }
27645
+ }
27646
+
25940
27647
  /**
25941
27648
  * A nimble-styled WaferMap
25942
27649
  */
@@ -25948,13 +27655,54 @@ Instead styling against the role which is more general and likely a better appro
25948
27655
  this.maxCharacters = 4;
25949
27656
  this.dieLabelsHidden = false;
25950
27657
  this.dieLabelsSuffix = '';
25951
- this.colorsScaleMode = WaferMapColorsScaleMode.linear;
27658
+ this.colorScaleMode = WaferMapColorScaleMode.linear;
25952
27659
  this.highlightedValues = [];
25953
27660
  this.dies = [];
25954
27661
  this.colorScale = {
25955
27662
  colors: [],
25956
27663
  values: []
25957
27664
  };
27665
+ this.renderQueued = false;
27666
+ }
27667
+ /**
27668
+ * @internal
27669
+ */
27670
+ render() {
27671
+ this.renderQueued = false;
27672
+ this.dataManager = new DataManager(this.dies, this.quadrant, { width: this.offsetWidth, height: this.offsetHeight }, this.colorScale, this.highlightedValues, this.colorScaleMode, this.dieLabelsHidden, this.dieLabelsSuffix, this.maxCharacters);
27673
+ }
27674
+ quadrantChanged() {
27675
+ this.queueRender();
27676
+ }
27677
+ orientationChanged() {
27678
+ this.queueRender();
27679
+ }
27680
+ maxCharactersChanged() {
27681
+ this.queueRender();
27682
+ }
27683
+ dieLabelsHiddenChanged() {
27684
+ this.queueRender();
27685
+ }
27686
+ dieLabelsSuffixChanged() {
27687
+ this.queueRender();
27688
+ }
27689
+ colorScaleModeChanged() {
27690
+ this.queueRender();
27691
+ }
27692
+ highlightedValuesChanged() {
27693
+ this.queueRender();
27694
+ }
27695
+ diesChanged() {
27696
+ this.queueRender();
27697
+ }
27698
+ colorScaleChanged() {
27699
+ this.queueRender();
27700
+ }
27701
+ queueRender() {
27702
+ if (!this.renderQueued) {
27703
+ this.renderQueued = true;
27704
+ DOM.queueUpdate(() => this.render());
27705
+ }
25958
27706
  }
25959
27707
  }
25960
27708
  __decorate([
@@ -25982,9 +27730,9 @@ Instead styling against the role which is more general and likely a better appro
25982
27730
  ], WaferMap.prototype, "dieLabelsSuffix", void 0);
25983
27731
  __decorate([
25984
27732
  attr({
25985
- attribute: 'colors-scale-mode'
27733
+ attribute: 'color-scale-mode'
25986
27734
  })
25987
- ], WaferMap.prototype, "colorsScaleMode", void 0);
27735
+ ], WaferMap.prototype, "colorScaleMode", void 0);
25988
27736
  __decorate([
25989
27737
  observable
25990
27738
  ], WaferMap.prototype, "highlightedValues", void 0);