-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathplot-c239951a.js
More file actions
12321 lines (12321 loc) · 420 KB
/
Copy pathplot-c239951a.js
File metadata and controls
12321 lines (12321 loc) · 420 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import { c as csvParse, a as airportsString, f as flightsString } from "./flights-airports-9a9e6422.js";
function ascending$1(a2, b) {
return a2 == null || b == null ? NaN : a2 < b ? -1 : a2 > b ? 1 : a2 >= b ? 0 : NaN;
}
function descending(a2, b) {
return a2 == null || b == null ? NaN : b < a2 ? -1 : b > a2 ? 1 : b >= a2 ? 0 : NaN;
}
function bisector(f) {
let compare1, compare2, delta;
if (f.length !== 2) {
compare1 = ascending$1;
compare2 = (d, x) => ascending$1(f(d), x);
delta = (d, x) => f(d) - x;
} else {
compare1 = f === ascending$1 || f === descending ? f : zero$1;
compare2 = f;
delta = f;
}
function left2(a2, x, lo = 0, hi = a2.length) {
if (lo < hi) {
if (compare1(x, x) !== 0)
return hi;
do {
const mid2 = lo + hi >>> 1;
if (compare2(a2[mid2], x) < 0)
lo = mid2 + 1;
else
hi = mid2;
} while (lo < hi);
}
return lo;
}
function right2(a2, x, lo = 0, hi = a2.length) {
if (lo < hi) {
if (compare1(x, x) !== 0)
return hi;
do {
const mid2 = lo + hi >>> 1;
if (compare2(a2[mid2], x) <= 0)
lo = mid2 + 1;
else
hi = mid2;
} while (lo < hi);
}
return lo;
}
function center2(a2, x, lo = 0, hi = a2.length) {
const i = left2(a2, x, lo, hi - 1);
return i > lo && delta(a2[i - 1], x) > -delta(a2[i], x) ? i - 1 : i;
}
return { left: left2, center: center2, right: right2 };
}
function zero$1() {
return 0;
}
function number$4(x) {
return x === null ? NaN : +x;
}
function* numbers(values2, valueof2) {
if (valueof2 === void 0) {
for (let value of values2) {
if (value != null && (value = +value) >= value) {
yield value;
}
}
} else {
let index2 = -1;
for (let value of values2) {
if ((value = valueof2(value, ++index2, values2)) != null && (value = +value) >= value) {
yield value;
}
}
}
}
const ascendingBisect = bisector(ascending$1);
const bisectRight = ascendingBisect.right;
bisector(number$4).center;
const bisect = bisectRight;
function length$1(array2) {
return array2.length | 0;
}
function empty$1(length2) {
return !(length2 > 0);
}
function arrayify$1(values2) {
return typeof values2 !== "object" || "length" in values2 ? values2 : Array.from(values2);
}
function reducer(reduce) {
return (values2) => reduce(...values2);
}
function cross(...values2) {
const reduce = typeof values2[values2.length - 1] === "function" && reducer(values2.pop());
values2 = values2.map(arrayify$1);
const lengths = values2.map(length$1);
const j = values2.length - 1;
const index2 = new Array(j + 1).fill(0);
const product = [];
if (j < 0 || lengths.some(empty$1))
return product;
while (true) {
product.push(index2.map((j2, i2) => values2[i2][j2]));
let i = j;
while (++index2[i] === lengths[i]) {
if (i === 0)
return reduce ? product.map(reduce) : product;
index2[i--] = 0;
}
}
}
function cumsum(values2, valueof2) {
var sum2 = 0, index2 = 0;
return Float64Array.from(values2, valueof2 === void 0 ? (v) => sum2 += +v || 0 : (v) => sum2 += +valueof2(v, index2++, values2) || 0);
}
function variance(values2, valueof2) {
let count = 0;
let delta;
let mean2 = 0;
let sum2 = 0;
if (valueof2 === void 0) {
for (let value of values2) {
if (value != null && (value = +value) >= value) {
delta = value - mean2;
mean2 += delta / ++count;
sum2 += delta * (value - mean2);
}
}
} else {
let index2 = -1;
for (let value of values2) {
if ((value = valueof2(value, ++index2, values2)) != null && (value = +value) >= value) {
delta = value - mean2;
mean2 += delta / ++count;
sum2 += delta * (value - mean2);
}
}
}
if (count > 1)
return sum2 / (count - 1);
}
function deviation(values2, valueof2) {
const v = variance(values2, valueof2);
return v ? Math.sqrt(v) : v;
}
function extent$1(values2, valueof2) {
let min2;
let max2;
if (valueof2 === void 0) {
for (const value of values2) {
if (value != null) {
if (min2 === void 0) {
if (value >= value)
min2 = max2 = value;
} else {
if (min2 > value)
min2 = value;
if (max2 < value)
max2 = value;
}
}
}
} else {
let index2 = -1;
for (let value of values2) {
if ((value = valueof2(value, ++index2, values2)) != null) {
if (min2 === void 0) {
if (value >= value)
min2 = max2 = value;
} else {
if (min2 > value)
min2 = value;
if (max2 < value)
max2 = value;
}
}
}
}
return [min2, max2];
}
class Adder {
constructor() {
this._partials = new Float64Array(32);
this._n = 0;
}
add(x) {
const p = this._partials;
let i = 0;
for (let j = 0; j < this._n && j < 32; j++) {
const y = p[j], hi = x + y, lo = Math.abs(x) < Math.abs(y) ? x - (hi - y) : y - (hi - x);
if (lo)
p[i++] = lo;
x = hi;
}
p[i] = x;
this._n = i + 1;
return this;
}
valueOf() {
const p = this._partials;
let n = this._n, x, y, lo, hi = 0;
if (n > 0) {
hi = p[--n];
while (n > 0) {
x = hi;
y = p[--n];
hi = x + y;
lo = y - (hi - x);
if (lo)
break;
}
if (n > 0 && (lo < 0 && p[n - 1] < 0 || lo > 0 && p[n - 1] > 0)) {
y = lo * 2;
x = hi + y;
if (y == x - hi)
hi = x;
}
}
return hi;
}
}
class InternMap extends Map {
constructor(entries, key = keyof) {
super();
Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key } });
if (entries != null)
for (const [key2, value] of entries)
this.set(key2, value);
}
get(key) {
return super.get(intern_get(this, key));
}
has(key) {
return super.has(intern_get(this, key));
}
set(key, value) {
return super.set(intern_set(this, key), value);
}
delete(key) {
return super.delete(intern_delete(this, key));
}
}
class InternSet extends Set {
constructor(values2, key = keyof) {
super();
Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key } });
if (values2 != null)
for (const value of values2)
this.add(value);
}
has(value) {
return super.has(intern_get(this, value));
}
add(value) {
return super.add(intern_set(this, value));
}
delete(value) {
return super.delete(intern_delete(this, value));
}
}
function intern_get({ _intern, _key }, value) {
const key = _key(value);
return _intern.has(key) ? _intern.get(key) : value;
}
function intern_set({ _intern, _key }, value) {
const key = _key(value);
if (_intern.has(key))
return _intern.get(key);
_intern.set(key, value);
return value;
}
function intern_delete({ _intern, _key }, value) {
const key = _key(value);
if (_intern.has(key)) {
value = _intern.get(key);
_intern.delete(key);
}
return value;
}
function keyof(value) {
return value !== null && typeof value === "object" ? value.valueOf() : value;
}
function identity$8(x) {
return x;
}
function group(values2, ...keys) {
return nest(values2, identity$8, identity$8, keys);
}
function groups(values2, ...keys) {
return nest(values2, Array.from, identity$8, keys);
}
function rollup(values2, reduce, ...keys) {
return nest(values2, identity$8, reduce, keys);
}
function index(values2, ...keys) {
return nest(values2, identity$8, unique, keys);
}
function unique(values2) {
if (values2.length !== 1)
throw new Error("duplicate key");
return values2[0];
}
function nest(values2, map2, reduce, keys) {
return function regroup(values3, i) {
if (i >= keys.length)
return reduce(values3);
const groups2 = new InternMap();
const keyof2 = keys[i++];
let index2 = -1;
for (const value of values3) {
const key = keyof2(value, ++index2, values3);
const group2 = groups2.get(key);
if (group2)
group2.push(value);
else
groups2.set(key, [value]);
}
for (const [key, values4] of groups2) {
groups2.set(key, regroup(values4, i));
}
return map2(groups2);
}(values2, 0);
}
function permute(source, keys) {
return Array.from(keys, (key) => source[key]);
}
function sort$1(values2, ...F) {
if (typeof values2[Symbol.iterator] !== "function")
throw new TypeError("values is not iterable");
values2 = Array.from(values2);
let [f] = F;
if (f && f.length !== 2 || F.length > 1) {
const index2 = Uint32Array.from(values2, (d, i) => i);
if (F.length > 1) {
F = F.map((f2) => values2.map(f2));
index2.sort((i, j) => {
for (const f2 of F) {
const c2 = ascendingDefined$1(f2[i], f2[j]);
if (c2)
return c2;
}
});
} else {
f = values2.map(f);
index2.sort((i, j) => ascendingDefined$1(f[i], f[j]));
}
return permute(values2, index2);
}
return values2.sort(compareDefined(f));
}
function compareDefined(compare = ascending$1) {
if (compare === ascending$1)
return ascendingDefined$1;
if (typeof compare !== "function")
throw new TypeError("compare is not a function");
return (a2, b) => {
const x = compare(a2, b);
if (x || x === 0)
return x;
return (compare(b, b) === 0) - (compare(a2, a2) === 0);
};
}
function ascendingDefined$1(a2, b) {
return (a2 == null || !(a2 >= a2)) - (b == null || !(b >= b)) || (a2 < b ? -1 : a2 > b ? 1 : 0);
}
function groupSort(values2, reduce, key) {
return (reduce.length !== 2 ? sort$1(rollup(values2, reduce, key), ([ak, av], [bk, bv]) => ascending$1(av, bv) || ascending$1(ak, bk)) : sort$1(group(values2, key), ([ak, av], [bk, bv]) => reduce(av, bv) || ascending$1(ak, bk))).map(([key2]) => key2);
}
const e10 = Math.sqrt(50), e5 = Math.sqrt(10), e2 = Math.sqrt(2);
function tickSpec(start2, stop, count) {
const step = (stop - start2) / Math.max(0, count), power = Math.floor(Math.log10(step)), error = step / Math.pow(10, power), factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;
let i1, i2, inc;
if (power < 0) {
inc = Math.pow(10, -power) / factor;
i1 = Math.round(start2 * inc);
i2 = Math.round(stop * inc);
if (i1 / inc < start2)
++i1;
if (i2 / inc > stop)
--i2;
inc = -inc;
} else {
inc = Math.pow(10, power) * factor;
i1 = Math.round(start2 / inc);
i2 = Math.round(stop / inc);
if (i1 * inc < start2)
++i1;
if (i2 * inc > stop)
--i2;
}
if (i2 < i1 && 0.5 <= count && count < 2)
return tickSpec(start2, stop, count * 2);
return [i1, i2, inc];
}
function ticks(start2, stop, count) {
stop = +stop, start2 = +start2, count = +count;
if (!(count > 0))
return [];
if (start2 === stop)
return [start2];
const reverse2 = stop < start2, [i1, i2, inc] = reverse2 ? tickSpec(stop, start2, count) : tickSpec(start2, stop, count);
if (!(i2 >= i1))
return [];
const n = i2 - i1 + 1, ticks2 = new Array(n);
if (reverse2) {
if (inc < 0)
for (let i = 0; i < n; ++i)
ticks2[i] = (i2 - i) / -inc;
else
for (let i = 0; i < n; ++i)
ticks2[i] = (i2 - i) * inc;
} else {
if (inc < 0)
for (let i = 0; i < n; ++i)
ticks2[i] = (i1 + i) / -inc;
else
for (let i = 0; i < n; ++i)
ticks2[i] = (i1 + i) * inc;
}
return ticks2;
}
function tickIncrement(start2, stop, count) {
stop = +stop, start2 = +start2, count = +count;
return tickSpec(start2, stop, count)[2];
}
function tickStep(start2, stop, count) {
stop = +stop, start2 = +start2, count = +count;
const reverse2 = stop < start2, inc = reverse2 ? tickIncrement(stop, start2, count) : tickIncrement(start2, stop, count);
return (reverse2 ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
}
function max(values2, valueof2) {
let max2;
if (valueof2 === void 0) {
for (const value of values2) {
if (value != null && (max2 < value || max2 === void 0 && value >= value)) {
max2 = value;
}
}
} else {
let index2 = -1;
for (let value of values2) {
if ((value = valueof2(value, ++index2, values2)) != null && (max2 < value || max2 === void 0 && value >= value)) {
max2 = value;
}
}
}
return max2;
}
function maxIndex(values2, valueof2) {
let max2;
let maxIndex2 = -1;
let index2 = -1;
if (valueof2 === void 0) {
for (const value of values2) {
++index2;
if (value != null && (max2 < value || max2 === void 0 && value >= value)) {
max2 = value, maxIndex2 = index2;
}
}
} else {
for (let value of values2) {
if ((value = valueof2(value, ++index2, values2)) != null && (max2 < value || max2 === void 0 && value >= value)) {
max2 = value, maxIndex2 = index2;
}
}
}
return maxIndex2;
}
function min$1(values2, valueof2) {
let min2;
if (valueof2 === void 0) {
for (const value of values2) {
if (value != null && (min2 > value || min2 === void 0 && value >= value)) {
min2 = value;
}
}
} else {
let index2 = -1;
for (let value of values2) {
if ((value = valueof2(value, ++index2, values2)) != null && (min2 > value || min2 === void 0 && value >= value)) {
min2 = value;
}
}
}
return min2;
}
function minIndex(values2, valueof2) {
let min2;
let minIndex2 = -1;
let index2 = -1;
if (valueof2 === void 0) {
for (const value of values2) {
++index2;
if (value != null && (min2 > value || min2 === void 0 && value >= value)) {
min2 = value, minIndex2 = index2;
}
}
} else {
for (let value of values2) {
if ((value = valueof2(value, ++index2, values2)) != null && (min2 > value || min2 === void 0 && value >= value)) {
min2 = value, minIndex2 = index2;
}
}
}
return minIndex2;
}
function quickselect(array2, k2, left2 = 0, right2 = Infinity, compare) {
k2 = Math.floor(k2);
left2 = Math.floor(Math.max(0, left2));
right2 = Math.floor(Math.min(array2.length - 1, right2));
if (!(left2 <= k2 && k2 <= right2))
return array2;
compare = compare === void 0 ? ascendingDefined$1 : compareDefined(compare);
while (right2 > left2) {
if (right2 - left2 > 600) {
const n = right2 - left2 + 1;
const m = k2 - left2 + 1;
const z = Math.log(n);
const s2 = 0.5 * Math.exp(2 * z / 3);
const sd = 0.5 * Math.sqrt(z * s2 * (n - s2) / n) * (m - n / 2 < 0 ? -1 : 1);
const newLeft = Math.max(left2, Math.floor(k2 - m * s2 / n + sd));
const newRight = Math.min(right2, Math.floor(k2 + (n - m) * s2 / n + sd));
quickselect(array2, k2, newLeft, newRight, compare);
}
const t = array2[k2];
let i = left2;
let j = right2;
swap(array2, left2, k2);
if (compare(array2[right2], t) > 0)
swap(array2, left2, right2);
while (i < j) {
swap(array2, i, j), ++i, --j;
while (compare(array2[i], t) < 0)
++i;
while (compare(array2[j], t) > 0)
--j;
}
if (compare(array2[left2], t) === 0)
swap(array2, left2, j);
else
++j, swap(array2, j, right2);
if (j <= k2)
left2 = j + 1;
if (k2 <= j)
right2 = j - 1;
}
return array2;
}
function swap(array2, i, j) {
const t = array2[i];
array2[i] = array2[j];
array2[j] = t;
}
function greatest(values2, compare = ascending$1) {
let max2;
let defined2 = false;
if (compare.length === 1) {
let maxValue;
for (const element of values2) {
const value = compare(element);
if (defined2 ? ascending$1(value, maxValue) > 0 : ascending$1(value, value) === 0) {
max2 = element;
maxValue = value;
defined2 = true;
}
}
} else {
for (const value of values2) {
if (defined2 ? compare(value, max2) > 0 : compare(value, value) === 0) {
max2 = value;
defined2 = true;
}
}
}
return max2;
}
function quantile$1(values2, p, valueof2) {
values2 = Float64Array.from(numbers(values2, valueof2));
if (!(n = values2.length) || isNaN(p = +p))
return;
if (p <= 0 || n < 2)
return min$1(values2);
if (p >= 1)
return max(values2);
var n, i = (n - 1) * p, i0 = Math.floor(i), value0 = max(quickselect(values2, i0).subarray(0, i0 + 1)), value1 = min$1(values2.subarray(i0 + 1));
return value0 + (value1 - value0) * (i - i0);
}
function quantileSorted(values2, p, valueof2 = number$4) {
if (!(n = values2.length) || isNaN(p = +p))
return;
if (p <= 0 || n < 2)
return +valueof2(values2[0], 0, values2);
if (p >= 1)
return +valueof2(values2[n - 1], n - 1, values2);
var n, i = (n - 1) * p, i0 = Math.floor(i), value0 = +valueof2(values2[i0], i0, values2), value1 = +valueof2(values2[i0 + 1], i0 + 1, values2);
return value0 + (value1 - value0) * (i - i0);
}
function mean(values2, valueof2) {
let count = 0;
let sum2 = 0;
if (valueof2 === void 0) {
for (let value of values2) {
if (value != null && (value = +value) >= value) {
++count, sum2 += value;
}
}
} else {
let index2 = -1;
for (let value of values2) {
if ((value = valueof2(value, ++index2, values2)) != null && (value = +value) >= value) {
++count, sum2 += value;
}
}
}
if (count)
return sum2 / count;
}
function median(values2, valueof2) {
return quantile$1(values2, 0.5, valueof2);
}
function* flatten(arrays) {
for (const array2 of arrays) {
yield* array2;
}
}
function merge(arrays) {
return Array.from(flatten(arrays));
}
function mode(values2, valueof2) {
const counts = new InternMap();
if (valueof2 === void 0) {
for (let value of values2) {
if (value != null && value >= value) {
counts.set(value, (counts.get(value) || 0) + 1);
}
}
} else {
let index2 = -1;
for (let value of values2) {
if ((value = valueof2(value, ++index2, values2)) != null && value >= value) {
counts.set(value, (counts.get(value) || 0) + 1);
}
}
}
let modeValue;
let modeCount = 0;
for (const [value, count] of counts) {
if (count > modeCount) {
modeCount = count;
modeValue = value;
}
}
return modeValue;
}
function range$1(start2, stop, step) {
start2 = +start2, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start2, start2 = 0, 1) : n < 3 ? 1 : +step;
var i = -1, n = Math.max(0, Math.ceil((stop - start2) / step)) | 0, range2 = new Array(n);
while (++i < n) {
range2[i] = start2 + i * step;
}
return range2;
}
function sum(values2, valueof2) {
let sum2 = 0;
if (valueof2 === void 0) {
for (let value of values2) {
if (value = +value) {
sum2 += value;
}
}
} else {
let index2 = -1;
for (let value of values2) {
if (value = +valueof2(value, ++index2, values2)) {
sum2 += value;
}
}
}
return sum2;
}
function reverse(values2) {
if (typeof values2[Symbol.iterator] !== "function")
throw new TypeError("values is not iterable");
return Array.from(values2).reverse();
}
function identity$7(x) {
return x;
}
var top = 1, right = 2, bottom = 3, left = 4, epsilon$2 = 1e-6;
function translateX(x) {
return "translate(" + x + ",0)";
}
function translateY(y) {
return "translate(0," + y + ")";
}
function number$3(scale) {
return (d) => +scale(d);
}
function center(scale, offset2) {
offset2 = Math.max(0, scale.bandwidth() - offset2 * 2) / 2;
if (scale.round())
offset2 = Math.round(offset2);
return (d) => +scale(d) + offset2;
}
function entering() {
return !this.__axis;
}
function axis(orient, scale) {
var tickArguments = [], tickValues = null, tickFormat2 = null, tickSizeInner = 6, tickSizeOuter = 6, tickPadding = 3, offset2 = typeof window !== "undefined" && window.devicePixelRatio > 1 ? 0 : 0.5, k2 = orient === top || orient === left ? -1 : 1, x = orient === left || orient === right ? "x" : "y", transform = orient === top || orient === bottom ? translateX : translateY;
function axis2(context) {
var values2 = tickValues == null ? scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain() : tickValues, format2 = tickFormat2 == null ? scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity$7 : tickFormat2, spacing = Math.max(tickSizeInner, 0) + tickPadding, range2 = scale.range(), range0 = +range2[0] + offset2, range1 = +range2[range2.length - 1] + offset2, position2 = (scale.bandwidth ? center : number$3)(scale.copy(), offset2), selection2 = context.selection ? context.selection() : context, path = selection2.selectAll(".domain").data([null]), tick = selection2.selectAll(".tick").data(values2, scale).order(), tickExit = tick.exit(), tickEnter = tick.enter().append("g").attr("class", "tick"), line = tick.select("line"), text2 = tick.select("text");
path = path.merge(path.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor"));
tick = tick.merge(tickEnter);
line = line.merge(tickEnter.append("line").attr("stroke", "currentColor").attr(x + "2", k2 * tickSizeInner));
text2 = text2.merge(tickEnter.append("text").attr("fill", "currentColor").attr(x, k2 * spacing).attr("dy", orient === top ? "0em" : orient === bottom ? "0.71em" : "0.32em"));
if (context !== selection2) {
path = path.transition(context);
tick = tick.transition(context);
line = line.transition(context);
text2 = text2.transition(context);
tickExit = tickExit.transition(context).attr("opacity", epsilon$2).attr("transform", function(d) {
return isFinite(d = position2(d)) ? transform(d + offset2) : this.getAttribute("transform");
});
tickEnter.attr("opacity", epsilon$2).attr("transform", function(d) {
var p = this.parentNode.__axis;
return transform((p && isFinite(p = p(d)) ? p : position2(d)) + offset2);
});
}
tickExit.remove();
path.attr("d", orient === left || orient === right ? tickSizeOuter ? "M" + k2 * tickSizeOuter + "," + range0 + "H" + offset2 + "V" + range1 + "H" + k2 * tickSizeOuter : "M" + offset2 + "," + range0 + "V" + range1 : tickSizeOuter ? "M" + range0 + "," + k2 * tickSizeOuter + "V" + offset2 + "H" + range1 + "V" + k2 * tickSizeOuter : "M" + range0 + "," + offset2 + "H" + range1);
tick.attr("opacity", 1).attr("transform", function(d) {
return transform(position2(d) + offset2);
});
line.attr(x + "2", k2 * tickSizeInner);
text2.attr(x, k2 * spacing).text(format2);
selection2.filter(entering).attr("fill", "none").attr("font-size", 10).attr("font-family", "sans-serif").attr("text-anchor", orient === right ? "start" : orient === left ? "end" : "middle");
selection2.each(function() {
this.__axis = position2;
});
}
axis2.scale = function(_) {
return arguments.length ? (scale = _, axis2) : scale;
};
axis2.ticks = function() {
return tickArguments = Array.from(arguments), axis2;
};
axis2.tickArguments = function(_) {
return arguments.length ? (tickArguments = _ == null ? [] : Array.from(_), axis2) : tickArguments.slice();
};
axis2.tickValues = function(_) {
return arguments.length ? (tickValues = _ == null ? null : Array.from(_), axis2) : tickValues && tickValues.slice();
};
axis2.tickFormat = function(_) {
return arguments.length ? (tickFormat2 = _, axis2) : tickFormat2;
};
axis2.tickSize = function(_) {
return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis2) : tickSizeInner;
};
axis2.tickSizeInner = function(_) {
return arguments.length ? (tickSizeInner = +_, axis2) : tickSizeInner;
};
axis2.tickSizeOuter = function(_) {
return arguments.length ? (tickSizeOuter = +_, axis2) : tickSizeOuter;
};
axis2.tickPadding = function(_) {
return arguments.length ? (tickPadding = +_, axis2) : tickPadding;
};
axis2.offset = function(_) {
return arguments.length ? (offset2 = +_, axis2) : offset2;
};
return axis2;
}
function axisBottom(scale) {
return axis(bottom, scale);
}
var noop$1 = { value: () => {
} };
function dispatch() {
for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {
if (!(t = arguments[i] + "") || t in _ || /[\s.]/.test(t))
throw new Error("illegal type: " + t);
_[t] = [];
}
return new Dispatch(_);
}
function Dispatch(_) {
this._ = _;
}
function parseTypenames$1(typenames, types) {
return typenames.trim().split(/^|\s+/).map(function(t) {
var name = "", i = t.indexOf(".");
if (i >= 0)
name = t.slice(i + 1), t = t.slice(0, i);
if (t && !types.hasOwnProperty(t))
throw new Error("unknown type: " + t);
return { type: t, name };
});
}
Dispatch.prototype = dispatch.prototype = {
constructor: Dispatch,
on: function(typename, callback) {
var _ = this._, T = parseTypenames$1(typename + "", _), t, i = -1, n = T.length;
if (arguments.length < 2) {
while (++i < n)
if ((t = (typename = T[i]).type) && (t = get$1(_[t], typename.name)))
return t;
return;
}
if (callback != null && typeof callback !== "function")
throw new Error("invalid callback: " + callback);
while (++i < n) {
if (t = (typename = T[i]).type)
_[t] = set$1(_[t], typename.name, callback);
else if (callback == null)
for (t in _)
_[t] = set$1(_[t], typename.name, null);
}
return this;
},
copy: function() {
var copy2 = {}, _ = this._;
for (var t in _)
copy2[t] = _[t].slice();
return new Dispatch(copy2);
},
call: function(type, that) {
if ((n = arguments.length - 2) > 0)
for (var args = new Array(n), i = 0, n, t; i < n; ++i)
args[i] = arguments[i + 2];
if (!this._.hasOwnProperty(type))
throw new Error("unknown type: " + type);
for (t = this._[type], i = 0, n = t.length; i < n; ++i)
t[i].value.apply(that, args);
},
apply: function(type, that, args) {
if (!this._.hasOwnProperty(type))
throw new Error("unknown type: " + type);
for (var t = this._[type], i = 0, n = t.length; i < n; ++i)
t[i].value.apply(that, args);
}
};
function get$1(type, name) {
for (var i = 0, n = type.length, c2; i < n; ++i) {
if ((c2 = type[i]).name === name) {
return c2.value;
}
}
}
function set$1(type, name, callback) {
for (var i = 0, n = type.length; i < n; ++i) {
if (type[i].name === name) {
type[i] = noop$1, type = type.slice(0, i).concat(type.slice(i + 1));
break;
}
}
if (callback != null)
type.push({ name, value: callback });
return type;
}
var xhtml = "http://www.w3.org/1999/xhtml";
const namespaces = {
svg: "http://www.w3.org/2000/svg",
xhtml,
xlink: "http://www.w3.org/1999/xlink",
xml: "http://www.w3.org/XML/1998/namespace",
xmlns: "http://www.w3.org/2000/xmlns/"
};
function namespace(name) {
var prefix = name += "", i = prefix.indexOf(":");
if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns")
name = name.slice(i + 1);
return namespaces.hasOwnProperty(prefix) ? { space: namespaces[prefix], local: name } : name;
}
function creatorInherit(name) {
return function() {
var document2 = this.ownerDocument, uri = this.namespaceURI;
return uri === xhtml && document2.documentElement.namespaceURI === xhtml ? document2.createElement(name) : document2.createElementNS(uri, name);
};
}
function creatorFixed(fullname) {
return function() {
return this.ownerDocument.createElementNS(fullname.space, fullname.local);
};
}
function creator(name) {
var fullname = namespace(name);
return (fullname.local ? creatorFixed : creatorInherit)(fullname);
}
function none() {
}
function selector(selector2) {
return selector2 == null ? none : function() {
return this.querySelector(selector2);
};
}
function selection_select(select2) {
if (typeof select2 !== "function")
select2 = selector(select2);
for (var groups2 = this._groups, m = groups2.length, subgroups = new Array(m), j = 0; j < m; ++j) {
for (var group2 = groups2[j], n = group2.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {
if ((node = group2[i]) && (subnode = select2.call(node, node.__data__, i, group2))) {
if ("__data__" in node)
subnode.__data__ = node.__data__;
subgroup[i] = subnode;
}
}
}
return new Selection$1(subgroups, this._parents);
}
function array(x) {
return x == null ? [] : Array.isArray(x) ? x : Array.from(x);
}
function empty() {
return [];
}
function selectorAll(selector2) {
return selector2 == null ? empty : function() {
return this.querySelectorAll(selector2);
};
}
function arrayAll(select2) {
return function() {
return array(select2.apply(this, arguments));
};
}
function selection_selectAll(select2) {
if (typeof select2 === "function")
select2 = arrayAll(select2);
else
select2 = selectorAll(select2);
for (var groups2 = this._groups, m = groups2.length, subgroups = [], parents = [], j = 0; j < m; ++j) {
for (var group2 = groups2[j], n = group2.length, node, i = 0; i < n; ++i) {
if (node = group2[i]) {
subgroups.push(select2.call(node, node.__data__, i, group2));
parents.push(node);
}
}
}
return new Selection$1(subgroups, parents);
}
function matcher(selector2) {
return function() {
return this.matches(selector2);
};
}
function childMatcher(selector2) {
return function(node) {
return node.matches(selector2);
};
}
var find = Array.prototype.find;
function childFind(match) {
return function() {
return find.call(this.children, match);
};
}
function childFirst() {
return this.firstElementChild;
}
function selection_selectChild(match) {
return this.select(match == null ? childFirst : childFind(typeof match === "function" ? match : childMatcher(match)));
}
var filter = Array.prototype.filter;
function children() {
return Array.from(this.children);
}
function childrenFilter(match) {
return function() {
return filter.call(this.children, match);
};
}
function selection_selectChildren(match) {
return this.selectAll(match == null ? children : childrenFilter(typeof match === "function" ? match : childMatcher(match)));
}
function selection_filter(match) {
if (typeof match !== "function")
match = matcher(match);
for (var groups2 = this._groups, m = groups2.length, subgroups = new Array(m), j = 0; j < m; ++j) {
for (var group2 = groups2[j], n = group2.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {
if ((node = group2[i]) && match.call(node, node.__data__, i, group2)) {
subgroup.push(node);
}
}
}
return new Selection$1(subgroups, this._parents);
}
function sparse(update) {
return new Array(update.length);
}
function selection_enter() {
return new Selection$1(this._enter || this._groups.map(sparse), this._parents);
}
function EnterNode(parent, datum2) {
this.ownerDocument = parent.ownerDocument;
this.namespaceURI = parent.namespaceURI;
this._next = null;
this._parent = parent;
this.__data__ = datum2;
}
EnterNode.prototype = {
constructor: EnterNode,
appendChild: function(child) {