d3-rails 6.6.2 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd0a2c7fdef86c9cd3c60d099a1b4fd36f9b27546b6a80be9a2d18ea46086775
4
- data.tar.gz: 700aca82dcf4da81a98d64698a934b25518ceb00b06560b7b03cfc124aae72ea
3
+ metadata.gz: 872c8c61c83f4a64bac7ee1fa88bdbd866740c24f8f90a5bda16d1e36744fabd
4
+ data.tar.gz: bce7e7c6211e662ff499e5b01d12c3a004bd4dae20cec53df5668d2b6c68848e
5
5
  SHA512:
6
- metadata.gz: bc9faa4af82f3c98075dbcaacfb7f68f104fe09497eb0b70735e77dcd6aa14cabc83cf221724dcdd57a86ae1b09b174637ef49fff67e01e82b7bf28ad45b8e2b
7
- data.tar.gz: d71eb771b1275a4bac5a4b10be330771cbdc6f12d10d07841644e41ece2c4bf051d8facfa501ab038714ffdf943be582a394685d4bf5699e2bf1d2913d19e483
6
+ metadata.gz: 2d323d4461910aa437c2c82421ec1d34f6c810ff757cbe55d901bf5eacc6b30033b6ec1c43bf75300bcfbaad1acfb4d784642863cb86cd1d8476373a4b26e697
7
+ data.tar.gz: 8c352574589f6f1bd4fe666b130fc966fbd66b667123ef84184677e95f4db475f5c45f91fc1c33cc6658429f8a312bc7337766d35f3755c4f23b9cd04a18f6e9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 7.0.0 (18 June 2021)
2
+ * Update updater to update to version 7
3
+ * Upgrade D3 to 7.0.0
4
+
1
5
  ## 6.6.2 (3 April 2021)
2
6
  * Update updater to update to version 6
3
7
  * Upgrade D3 to 6.6.3
data/LICENSE CHANGED
@@ -3,7 +3,7 @@ license applies:
3
3
 
4
4
  The MIT License
5
5
 
6
- Copyright (c) 2012-2014 Markus Fenske
6
+ Copyright (c) 2012-2021 Markus Fenske
7
7
 
8
8
  Permission is hereby granted, free of charge, to any person obtaining a copy
9
9
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -8,7 +8,7 @@ d3-rails provides D3 for Rails 3.1 and higher.
8
8
 
9
9
  ## Version
10
10
 
11
- d3-rails comes with version 6.6.2 of D3.js. The d3-rails version will
11
+ d3-rails comes with version 7.0.0 of D3.js. The d3-rails version will
12
12
  always mirror the version of D3. If you need a newer version of
13
13
  d3-rails, see section Development (below).
14
14
 
data/Rakefile CHANGED
@@ -4,10 +4,10 @@ Bundler::GemHelper.install_tasks
4
4
  namespace :d3 do
5
5
  desc 'Update d3 version'
6
6
  task :update_version do
7
- `curl -o app/assets/javascripts/d3.js https://d3js.org/d3.v6.js`
8
- `curl -o app/assets/javascripts/d3.min.js https://d3js.org/d3.v6.min.js`
9
- `cp app/assets/javascripts/d3.js app/assets/javascripts/d3.v6.js`
10
- `cp app/assets/javascripts/d3.min.js app/assets/javascripts/d3.v6.min.js`
7
+ `curl -o app/assets/javascripts/d3.js https://d3js.org/d3.v7.js`
8
+ `curl -o app/assets/javascripts/d3.min.js https://d3js.org/d3.v7.min.js`
9
+ `cp app/assets/javascripts/d3.js app/assets/javascripts/d3.v7.js`
10
+ `cp app/assets/javascripts/d3.min.js app/assets/javascripts/d3.v7.min.js`
11
11
  version = File.open("app/assets/javascripts/d3.js") { |f|
12
12
  f.each_line.lazy.select { |line|
13
13
  line.match(/((\d+\.)(\d+\.)(\*|\d+))/)
@@ -1,14 +1,18 @@
1
- // https://d3js.org v6.6.2 Copyright 2021 Mike Bostock
1
+ // https://d3js.org v7.0.0 Copyright 2010-2021 Mike Bostock
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
4
4
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
5
5
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {}));
6
6
  }(this, (function (exports) { 'use strict';
7
7
 
8
- var version = "6.6.2";
8
+ var version = "7.0.0";
9
9
 
10
10
  function ascending$3(a, b) {
11
- return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
11
+ return a == null || b == null ? NaN
12
+ : a < b ? -1
13
+ : a > b ? 1
14
+ : a >= b ? 0
15
+ : NaN;
12
16
  }
13
17
 
14
18
  function bisector(f) {
@@ -143,7 +147,11 @@ function cumsum(values, valueof) {
143
147
  }
144
148
 
145
149
  function descending$2(a, b) {
146
- return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
150
+ return a == null || b == null ? NaN
151
+ : b < a ? -1
152
+ : b > a ? 1
153
+ : b >= a ? 0
154
+ : NaN;
147
155
  }
148
156
 
149
157
  function variance(values, valueof) {
@@ -351,6 +359,21 @@ function groups(values, ...keys) {
351
359
  return nest(values, Array.from, identity$9, keys);
352
360
  }
353
361
 
362
+ function flatten$1(groups, keys) {
363
+ for (let i = 1, n = keys.length; i < n; ++i) {
364
+ groups = groups.flatMap(g => g.pop().map(([key, value]) => [...g, key, value]));
365
+ }
366
+ return groups;
367
+ }
368
+
369
+ function flatGroup(values, ...keys) {
370
+ return flatten$1(groups(values, ...keys), keys);
371
+ }
372
+
373
+ function flatRollup(values, reduce, ...keys) {
374
+ return flatten$1(rollups(values, reduce, ...keys), keys);
375
+ }
376
+
354
377
  function rollup(values, reduce, ...keys) {
355
378
  return nest(values, identity$9, reduce, keys);
356
379
  }
@@ -427,7 +450,7 @@ function groupSort(values, reduce, key) {
427
450
 
428
451
  var array$5 = Array.prototype;
429
452
 
430
- var slice$4 = array$5.slice;
453
+ var slice$3 = array$5.slice;
431
454
 
432
455
  function constant$b(x) {
433
456
  return function() {
@@ -581,7 +604,7 @@ function bin() {
581
604
  // Assign data to bins by value, ignoring any outside the domain.
582
605
  for (i = 0; i < n; ++i) {
583
606
  x = values[i];
584
- if (x0 <= x && x <= x1) {
607
+ if (x != null && x0 <= x && x <= x1) {
585
608
  bins[bisectRight(tz, x, 0, m)].push(data[i]);
586
609
  }
587
610
  }
@@ -598,7 +621,7 @@ function bin() {
598
621
  };
599
622
 
600
623
  histogram.thresholds = function(_) {
601
- return arguments.length ? (threshold = typeof _ === "function" ? _ : Array.isArray(_) ? constant$b(slice$4.call(_)) : constant$b(_), histogram) : threshold;
624
+ return arguments.length ? (threshold = typeof _ === "function" ? _ : Array.isArray(_) ? constant$b(slice$3.call(_)) : constant$b(_), histogram) : threshold;
602
625
  };
603
626
 
604
627
  return histogram;
@@ -802,6 +825,33 @@ function minIndex(values, valueof) {
802
825
  return minIndex;
803
826
  }
804
827
 
828
+ function mode(values, valueof) {
829
+ const counts = new InternMap();
830
+ if (valueof === undefined) {
831
+ for (let value of values) {
832
+ if (value != null && value >= value) {
833
+ counts.set(value, (counts.get(value) || 0) + 1);
834
+ }
835
+ }
836
+ } else {
837
+ let index = -1;
838
+ for (let value of values) {
839
+ if ((value = valueof(value, ++index, values)) != null && value >= value) {
840
+ counts.set(value, (counts.get(value) || 0) + 1);
841
+ }
842
+ }
843
+ }
844
+ let modeValue;
845
+ let modeCount = 0;
846
+ for (const [value, count] of counts) {
847
+ if (count > modeCount) {
848
+ modeCount = count;
849
+ modeValue = value;
850
+ }
851
+ }
852
+ return modeValue;
853
+ }
854
+
805
855
  function pairs(values, pairof = pair) {
806
856
  const pairs = [];
807
857
  let previous;
@@ -941,7 +991,7 @@ function shuffler(random) {
941
991
  };
942
992
  }
943
993
 
944
- function sum$1(values, valueof) {
994
+ function sum$2(values, valueof) {
945
995
  let sum = 0;
946
996
  if (valueof === undefined) {
947
997
  for (let value of values) {
@@ -1108,8 +1158,6 @@ function union(...others) {
1108
1158
  return set;
1109
1159
  }
1110
1160
 
1111
- var slice$3 = Array.prototype.slice;
1112
-
1113
1161
  function identity$8(x) {
1114
1162
  return x;
1115
1163
  }
@@ -1118,7 +1166,7 @@ var top = 1,
1118
1166
  right = 2,
1119
1167
  bottom = 3,
1120
1168
  left = 4,
1121
- epsilon$5 = 1e-6;
1169
+ epsilon$6 = 1e-6;
1122
1170
 
1123
1171
  function translateX(x) {
1124
1172
  return "translate(" + x + ",0)";
@@ -1192,11 +1240,11 @@ function axis(orient, scale) {
1192
1240
  text = text.transition(context);
1193
1241
 
1194
1242
  tickExit = tickExit.transition(context)
1195
- .attr("opacity", epsilon$5)
1243
+ .attr("opacity", epsilon$6)
1196
1244
  .attr("transform", function(d) { return isFinite(d = position(d)) ? transform(d + offset) : this.getAttribute("transform"); });
1197
1245
 
1198
1246
  tickEnter
1199
- .attr("opacity", epsilon$5)
1247
+ .attr("opacity", epsilon$6)
1200
1248
  .attr("transform", function(d) { var p = this.parentNode.__axis; return transform((p && isFinite(p = p(d)) ? p : position(d)) + offset); });
1201
1249
  }
1202
1250
 
@@ -1233,15 +1281,15 @@ function axis(orient, scale) {
1233
1281
  };
1234
1282
 
1235
1283
  axis.ticks = function() {
1236
- return tickArguments = slice$3.call(arguments), axis;
1284
+ return tickArguments = Array.from(arguments), axis;
1237
1285
  };
1238
1286
 
1239
1287
  axis.tickArguments = function(_) {
1240
- return arguments.length ? (tickArguments = _ == null ? [] : slice$3.call(_), axis) : tickArguments.slice();
1288
+ return arguments.length ? (tickArguments = _ == null ? [] : Array.from(_), axis) : tickArguments.slice();
1241
1289
  };
1242
1290
 
1243
1291
  axis.tickValues = function(_) {
1244
- return arguments.length ? (tickValues = _ == null ? null : slice$3.call(_), axis) : tickValues && tickValues.slice();
1292
+ return arguments.length ? (tickValues = _ == null ? null : Array.from(_), axis) : tickValues && tickValues.slice();
1245
1293
  };
1246
1294
 
1247
1295
  axis.tickFormat = function(_) {
@@ -1432,10 +1480,14 @@ function selection_select(select) {
1432
1480
  return new Selection$1(subgroups, this._parents);
1433
1481
  }
1434
1482
 
1483
+ // Given something array like (or null), returns something that is strictly an
1484
+ // array. This is used to ensure that array-like objects passed to d3.selectAll
1485
+ // or selection.selectAll are converted into proper arrays when creating a
1486
+ // selection; we don’t ever want to create a selection backed by a live
1487
+ // HTMLCollection or NodeList. However, note that selection.selectAll will use a
1488
+ // static NodeList as a group, since it safely derived from querySelectorAll.
1435
1489
  function array$4(x) {
1436
- return typeof x === "object" && "length" in x
1437
- ? x // Array, TypedArray, NodeList, array-like
1438
- : Array.from(x); // Map, Set, iterable, string, or anything else
1490
+ return x == null ? [] : Array.isArray(x) ? x : Array.from(x);
1439
1491
  }
1440
1492
 
1441
1493
  function empty$1() {
@@ -1450,8 +1502,7 @@ function selectorAll(selector) {
1450
1502
 
1451
1503
  function arrayAll(select) {
1452
1504
  return function() {
1453
- var group = select.apply(this, arguments);
1454
- return group == null ? [] : array$4(group);
1505
+ return array$4(select.apply(this, arguments));
1455
1506
  };
1456
1507
  }
1457
1508
 
@@ -1503,7 +1554,7 @@ function selection_selectChild(match) {
1503
1554
  var filter = Array.prototype.filter;
1504
1555
 
1505
1556
  function children() {
1506
- return this.children;
1557
+ return Array.from(this.children);
1507
1558
  }
1508
1559
 
1509
1560
  function childrenFilter(match) {
@@ -1648,7 +1699,7 @@ function selection_data(value, key) {
1648
1699
  var parent = parents[j],
1649
1700
  group = groups[j],
1650
1701
  groupLength = group.length,
1651
- data = array$4(value.call(parent, parent && parent.__data__, j, parents)),
1702
+ data = arraylike(value.call(parent, parent && parent.__data__, j, parents)),
1652
1703
  dataLength = data.length,
1653
1704
  enterGroup = enter[j] = new Array(dataLength),
1654
1705
  updateGroup = update[j] = new Array(dataLength),
@@ -1674,20 +1725,40 @@ function selection_data(value, key) {
1674
1725
  return update;
1675
1726
  }
1676
1727
 
1728
+ // Given some data, this returns an array-like view of it: an object that
1729
+ // exposes a length property and allows numeric indexing. Note that unlike
1730
+ // selectAll, this isn’t worried about “live” collections because the resulting
1731
+ // array will only be used briefly while data is being bound. (It is possible to
1732
+ // cause the data to change while iterating by using a key function, but please
1733
+ // don’t; we’d rather avoid a gratuitous copy.)
1734
+ function arraylike(data) {
1735
+ return typeof data === "object" && "length" in data
1736
+ ? data // Array, TypedArray, NodeList, array-like
1737
+ : Array.from(data); // Map, Set, iterable, string, or anything else
1738
+ }
1739
+
1677
1740
  function selection_exit() {
1678
1741
  return new Selection$1(this._exit || this._groups.map(sparse), this._parents);
1679
1742
  }
1680
1743
 
1681
1744
  function selection_join(onenter, onupdate, onexit) {
1682
1745
  var enter = this.enter(), update = this, exit = this.exit();
1683
- enter = typeof onenter === "function" ? onenter(enter) : enter.append(onenter + "");
1684
- if (onupdate != null) update = onupdate(update);
1746
+ if (typeof onenter === "function") {
1747
+ enter = onenter(enter);
1748
+ if (enter) enter = enter.selection();
1749
+ } else {
1750
+ enter = enter.append(onenter + "");
1751
+ }
1752
+ if (onupdate != null) {
1753
+ update = onupdate(update);
1754
+ if (update) update = update.selection();
1755
+ }
1685
1756
  if (onexit == null) exit.remove(); else onexit(exit);
1686
1757
  return enter && update ? enter.merge(update).order() : update;
1687
1758
  }
1688
1759
 
1689
- function selection_merge(selection) {
1690
- if (!(selection instanceof Selection$1)) throw new Error("invalid merge");
1760
+ function selection_merge(context) {
1761
+ var selection = context.selection ? context.selection() : context;
1691
1762
 
1692
1763
  for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {
1693
1764
  for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {
@@ -2340,9 +2411,14 @@ function pointers(events, node) {
2340
2411
  function selectAll(selector) {
2341
2412
  return typeof selector === "string"
2342
2413
  ? new Selection$1([document.querySelectorAll(selector)], [document.documentElement])
2343
- : new Selection$1([selector == null ? [] : array$4(selector)], root$1);
2414
+ : new Selection$1([array$4(selector)], root$1);
2344
2415
  }
2345
2416
 
2417
+ // These are typically used in conjunction with noevent to ensure that we can
2418
+ // preventDefault on the event.
2419
+ const nonpassive = {passive: false};
2420
+ const nonpassivecapture = {capture: true, passive: false};
2421
+
2346
2422
  function nopropagation$2(event) {
2347
2423
  event.stopImmediatePropagation();
2348
2424
  }
@@ -2354,9 +2430,9 @@ function noevent$2(event) {
2354
2430
 
2355
2431
  function dragDisable(view) {
2356
2432
  var root = view.document.documentElement,
2357
- selection = select(view).on("dragstart.drag", noevent$2, true);
2433
+ selection = select(view).on("dragstart.drag", noevent$2, nonpassivecapture);
2358
2434
  if ("onselectstart" in root) {
2359
- selection.on("selectstart.drag", noevent$2, true);
2435
+ selection.on("selectstart.drag", noevent$2, nonpassivecapture);
2360
2436
  } else {
2361
2437
  root.__noselect = root.style.MozUserSelect;
2362
2438
  root.style.MozUserSelect = "none";
@@ -2367,7 +2443,7 @@ function yesdrag(view, noclick) {
2367
2443
  var root = view.document.documentElement,
2368
2444
  selection = select(view).on("dragstart.drag", null);
2369
2445
  if (noclick) {
2370
- selection.on("click.drag", noevent$2, true);
2446
+ selection.on("click.drag", noevent$2, nonpassivecapture);
2371
2447
  setTimeout(function() { selection.on("click.drag", null); }, 0);
2372
2448
  }
2373
2449
  if ("onselectstart" in root) {
@@ -2445,7 +2521,7 @@ function drag() {
2445
2521
  .on("mousedown.drag", mousedowned)
2446
2522
  .filter(touchable)
2447
2523
  .on("touchstart.drag", touchstarted)
2448
- .on("touchmove.drag", touchmoved)
2524
+ .on("touchmove.drag", touchmoved, nonpassive)
2449
2525
  .on("touchend.drag touchcancel.drag", touchended)
2450
2526
  .style("touch-action", "none")
2451
2527
  .style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
@@ -2455,7 +2531,9 @@ function drag() {
2455
2531
  if (touchending || !filter.call(this, event, d)) return;
2456
2532
  var gesture = beforestart(this, container.call(this, event, d), event, d, "mouse");
2457
2533
  if (!gesture) return;
2458
- select(event.view).on("mousemove.drag", mousemoved, true).on("mouseup.drag", mouseupped, true);
2534
+ select(event.view)
2535
+ .on("mousemove.drag", mousemoved, nonpassivecapture)
2536
+ .on("mouseup.drag", mouseupped, nonpassivecapture);
2459
2537
  dragDisable(event.view);
2460
2538
  nopropagation$2(event);
2461
2539
  mousemoving = false;
@@ -2544,7 +2622,7 @@ function drag() {
2544
2622
  var p0 = p, n;
2545
2623
  switch (type) {
2546
2624
  case "start": gestures[identifier] = gesture, n = active++; break;
2547
- case "end": delete gestures[identifier], --active; // nobreak
2625
+ case "end": delete gestures[identifier], --active; // falls through
2548
2626
  case "drag": p = pointer(touch || event, container), n = active; break;
2549
2627
  }
2550
2628
  dispatch.call(
@@ -3100,13 +3178,13 @@ define(Hcl, hcl$2, extend(Color, {
3100
3178
  }));
3101
3179
 
3102
3180
  var A = -0.14861,
3103
- B = +1.78277,
3181
+ B$1 = +1.78277,
3104
3182
  C = -0.29227,
3105
- D = -0.90649,
3183
+ D$1 = -0.90649,
3106
3184
  E = +1.97294,
3107
- ED = E * D,
3108
- EB = E * B,
3109
- BC_DA = B * C - D * A;
3185
+ ED = E * D$1,
3186
+ EB = E * B$1,
3187
+ BC_DA = B$1 * C - D$1 * A;
3110
3188
 
3111
3189
  function cubehelixConvert(o) {
3112
3190
  if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);
@@ -3116,7 +3194,7 @@ function cubehelixConvert(o) {
3116
3194
  b = o.b / 255,
3117
3195
  l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),
3118
3196
  bl = b - l,
3119
- k = (E * (g - l) - C * bl) / D,
3197
+ k = (E * (g - l) - C * bl) / D$1,
3120
3198
  s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1
3121
3199
  h = s ? Math.atan2(k, bl) * degrees$2 - 120 : NaN;
3122
3200
  return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);
@@ -3149,8 +3227,8 @@ define(Cubehelix, cubehelix$3, extend(Color, {
3149
3227
  cosh = Math.cos(h),
3150
3228
  sinh = Math.sin(h);
3151
3229
  return new Rgb(
3152
- 255 * (l + a * (A * cosh + B * sinh)),
3153
- 255 * (l + a * (C * cosh + D * sinh)),
3230
+ 255 * (l + a * (A * cosh + B$1 * sinh)),
3231
+ 255 * (l + a * (C * cosh + D$1 * sinh)),
3154
3232
  255 * (l + a * (E * cosh)),
3155
3233
  this.opacity
3156
3234
  );
@@ -3769,7 +3847,7 @@ function timerFlush() {
3769
3847
  ++frame; // Pretend we’ve set an alarm, if we haven’t already.
3770
3848
  var t = taskHead, e;
3771
3849
  while (t) {
3772
- if ((e = clockNow - t._time) >= 0) t._call.call(null, e);
3850
+ if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e);
3773
3851
  t = t._next;
3774
3852
  }
3775
3853
  --frame;
@@ -4643,6 +4721,8 @@ Transition.prototype = transition.prototype = {
4643
4721
  constructor: Transition,
4644
4722
  select: transition_select,
4645
4723
  selectAll: transition_selectAll,
4724
+ selectChild: selection_prototype.selectChild,
4725
+ selectChildren: selection_prototype.selectChildren,
4646
4726
  filter: transition_filter,
4647
4727
  merge: transition_merge,
4648
4728
  selection: transition_selection,
@@ -5176,7 +5256,7 @@ function brush$1(dim) {
5176
5256
  .style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
5177
5257
  }
5178
5258
 
5179
- brush.move = function(group, selection) {
5259
+ brush.move = function(group, selection, event) {
5180
5260
  if (group.tween) {
5181
5261
  group
5182
5262
  .on("start.brush", function(event) { emitter(this, arguments).beforestart().start(event); })
@@ -5209,13 +5289,13 @@ function brush$1(dim) {
5209
5289
  interrupt(that);
5210
5290
  state.selection = selection1 === null ? null : selection1;
5211
5291
  redraw.call(that);
5212
- emit.start().brush().end();
5292
+ emit.start(event).brush(event).end(event);
5213
5293
  });
5214
5294
  }
5215
5295
  };
5216
5296
 
5217
- brush.clear = function(group) {
5218
- brush.move(group, null);
5297
+ brush.clear = function(group, event) {
5298
+ brush.move(group, null, event);
5219
5299
  };
5220
5300
 
5221
5301
  function redraw() {
@@ -5326,6 +5406,9 @@ function brush$1(dim) {
5326
5406
  return t;
5327
5407
  });
5328
5408
 
5409
+ interrupt(that);
5410
+ var emit = emitter(that, arguments, true).beforestart();
5411
+
5329
5412
  if (type === "overlay") {
5330
5413
  if (selection) moving = true;
5331
5414
  const pts = [points[0], points[1] || points[0]];
@@ -5336,7 +5419,7 @@ function brush$1(dim) {
5336
5419
  e0 = dim === Y ? E : max$2(pts[0][0], pts[1][0]),
5337
5420
  s0 = dim === X ? S : max$2(pts[0][1], pts[1][1])
5338
5421
  ]];
5339
- if (points.length > 1) move();
5422
+ if (points.length > 1) move(event);
5340
5423
  } else {
5341
5424
  w0 = selection[0][0];
5342
5425
  n0 = selection[0][1];
@@ -5355,9 +5438,6 @@ function brush$1(dim) {
5355
5438
  var overlay = group.selectAll(".overlay")
5356
5439
  .attr("cursor", cursors[type]);
5357
5440
 
5358
- interrupt(that);
5359
- var emit = emitter(that, arguments, true).beforestart();
5360
-
5361
5441
  if (event.touches) {
5362
5442
  emit.moved = moved;
5363
5443
  emit.ended = ended;
@@ -5483,7 +5563,7 @@ function brush$1(dim) {
5483
5563
  if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX;
5484
5564
  if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY;
5485
5565
  mode = MODE_CENTER;
5486
- move();
5566
+ move(event);
5487
5567
  }
5488
5568
  break;
5489
5569
  }
@@ -5493,7 +5573,7 @@ function brush$1(dim) {
5493
5573
  if (signY < 0) s0 = s1 - dy; else if (signY > 0) n0 = n1 - dy;
5494
5574
  mode = MODE_SPACE;
5495
5575
  overlay.attr("cursor", cursors.selection);
5496
- move();
5576
+ move(event);
5497
5577
  }
5498
5578
  break;
5499
5579
  }
@@ -5507,7 +5587,7 @@ function brush$1(dim) {
5507
5587
  case 16: { // SHIFT
5508
5588
  if (shifting) {
5509
5589
  lockX = lockY = shifting = false;
5510
- move();
5590
+ move(event);
5511
5591
  }
5512
5592
  break;
5513
5593
  }
@@ -5516,7 +5596,7 @@ function brush$1(dim) {
5516
5596
  if (signX < 0) e0 = e1; else if (signX > 0) w0 = w1;
5517
5597
  if (signY < 0) s0 = s1; else if (signY > 0) n0 = n1;
5518
5598
  mode = MODE_HANDLE;
5519
- move();
5599
+ move(event);
5520
5600
  }
5521
5601
  break;
5522
5602
  }
@@ -5532,7 +5612,7 @@ function brush$1(dim) {
5532
5612
  mode = MODE_HANDLE;
5533
5613
  }
5534
5614
  overlay.attr("cursor", cursors[type]);
5535
- move();
5615
+ move(event);
5536
5616
  }
5537
5617
  break;
5538
5618
  }
@@ -5592,7 +5672,7 @@ var pi$3 = Math.PI;
5592
5672
  var halfPi$2 = pi$3 / 2;
5593
5673
  var tau$4 = pi$3 * 2;
5594
5674
  var max$1 = Math.max;
5595
- var epsilon$4 = 1e-12;
5675
+ var epsilon$5 = 1e-12;
5596
5676
 
5597
5677
  function range$1(i, j) {
5598
5678
  return Array.from({length: j - i}, (_, k) => i + k);
@@ -5717,8 +5797,8 @@ function chord$1(directed, transpose) {
5717
5797
 
5718
5798
  const pi$2 = Math.PI,
5719
5799
  tau$3 = 2 * pi$2,
5720
- epsilon$3 = 1e-6,
5721
- tauEpsilon = tau$3 - epsilon$3;
5800
+ epsilon$4 = 1e-6,
5801
+ tauEpsilon = tau$3 - epsilon$4;
5722
5802
 
5723
5803
  function Path$1() {
5724
5804
  this._x0 = this._y0 = // start of current subpath
@@ -5769,12 +5849,12 @@ Path$1.prototype = path.prototype = {
5769
5849
  }
5770
5850
 
5771
5851
  // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.
5772
- else if (!(l01_2 > epsilon$3));
5852
+ else if (!(l01_2 > epsilon$4));
5773
5853
 
5774
5854
  // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?
5775
5855
  // Equivalently, is (x1,y1) coincident with (x2,y2)?
5776
5856
  // Or, is the radius zero? Line to (x1,y1).
5777
- else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon$3) || !r) {
5857
+ else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon$4) || !r) {
5778
5858
  this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1);
5779
5859
  }
5780
5860
 
@@ -5791,7 +5871,7 @@ Path$1.prototype = path.prototype = {
5791
5871
  t21 = l / l21;
5792
5872
 
5793
5873
  // If the start tangent is not coincident with (x0,y0), line to.
5794
- if (Math.abs(t01 - 1) > epsilon$3) {
5874
+ if (Math.abs(t01 - 1) > epsilon$4) {
5795
5875
  this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01);
5796
5876
  }
5797
5877
 
@@ -5816,7 +5896,7 @@ Path$1.prototype = path.prototype = {
5816
5896
  }
5817
5897
 
5818
5898
  // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).
5819
- else if (Math.abs(this._x1 - x0) > epsilon$3 || Math.abs(this._y1 - y0) > epsilon$3) {
5899
+ else if (Math.abs(this._x1 - x0) > epsilon$4 || Math.abs(this._y1 - y0) > epsilon$4) {
5820
5900
  this._ += "L" + x0 + "," + y0;
5821
5901
  }
5822
5902
 
@@ -5832,7 +5912,7 @@ Path$1.prototype = path.prototype = {
5832
5912
  }
5833
5913
 
5834
5914
  // Is this arc non-empty? Draw an arc!
5835
- else if (da > epsilon$3) {
5915
+ else if (da > epsilon$4) {
5836
5916
  this._ += "A" + r + "," + r + ",0," + (+(da >= pi$2)) + "," + cw + "," + (this._x1 = x + r * Math.cos(a1)) + "," + (this._y1 = y + r * Math.sin(a1));
5837
5917
  }
5838
5918
  },
@@ -5905,10 +5985,10 @@ function ribbon(headRadius) {
5905
5985
 
5906
5986
  if (!context) context = buffer = path();
5907
5987
 
5908
- if (ap > epsilon$4) {
5909
- if (abs$2(sa1 - sa0) > ap * 2 + epsilon$4) sa1 > sa0 ? (sa0 += ap, sa1 -= ap) : (sa0 -= ap, sa1 += ap);
5988
+ if (ap > epsilon$5) {
5989
+ if (abs$2(sa1 - sa0) > ap * 2 + epsilon$5) sa1 > sa0 ? (sa0 += ap, sa1 -= ap) : (sa0 -= ap, sa1 += ap);
5910
5990
  else sa0 = sa1 = (sa0 + sa1) / 2;
5911
- if (abs$2(ta1 - ta0) > ap * 2 + epsilon$4) ta1 > ta0 ? (ta0 += ap, ta1 -= ap) : (ta0 -= ap, ta1 += ap);
5991
+ if (abs$2(ta1 - ta0) > ap * 2 + epsilon$5) ta1 > ta0 ? (ta0 += ap, ta1 -= ap) : (ta0 -= ap, ta1 += ap);
5912
5992
  else ta0 = ta1 = (ta0 + ta1) / 2;
5913
5993
  }
5914
5994
 
@@ -6058,16 +6138,13 @@ function contours() {
6058
6138
 
6059
6139
  // Convert number of thresholds into uniform thresholds.
6060
6140
  if (!Array.isArray(tz)) {
6061
- var domain = extent$1(values), start = domain[0], stop = domain[1];
6062
- tz = tickStep(start, stop, tz);
6063
- tz = sequence(Math.floor(start / tz) * tz, Math.floor(stop / tz) * tz, tz);
6141
+ const e = extent$1(values), ts = tickStep(e[0], e[1], tz);
6142
+ tz = ticks(Math.floor(e[0] / ts) * ts, Math.floor(e[1] / ts - 1) * ts, tz);
6064
6143
  } else {
6065
6144
  tz = tz.slice().sort(ascending$1);
6066
6145
  }
6067
6146
 
6068
- return tz.map(function(value) {
6069
- return contour(values, value);
6070
- });
6147
+ return tz.map(value => contour(values, value));
6071
6148
  }
6072
6149
 
6073
6150
  // Accumulate, smooth contour rings, assign holes to exterior rings.
@@ -6295,14 +6372,22 @@ function density() {
6295
6372
 
6296
6373
  function density(data) {
6297
6374
  var values0 = new Float32Array(n * m),
6298
- values1 = new Float32Array(n * m);
6375
+ values1 = new Float32Array(n * m),
6376
+ pow2k = Math.pow(2, -k);
6299
6377
 
6300
6378
  data.forEach(function(d, i, data) {
6301
- var xi = (+x(d, i, data) + o) >> k,
6302
- yi = (+y(d, i, data) + o) >> k,
6379
+ var xi = (x(d, i, data) + o) * pow2k,
6380
+ yi = (y(d, i, data) + o) * pow2k,
6303
6381
  wi = +weight(d, i, data);
6304
6382
  if (xi >= 0 && xi < n && yi >= 0 && yi < m) {
6305
- values0[xi + yi * n] += wi;
6383
+ var x0 = Math.floor(xi),
6384
+ y0 = Math.floor(yi),
6385
+ xt = xi - x0 - 0.5,
6386
+ yt = yi - y0 - 0.5;
6387
+ values0[x0 + y0 * n] += (1 - xt) * (1 - yt) * wi;
6388
+ values0[x0 + 1 + y0 * n] += xt * (1 - yt) * wi;
6389
+ values0[x0 + 1 + (y0 + 1) * n] += xt * yt * wi;
6390
+ values0[x0 + (y0 + 1) * n] += (1 - xt) * yt * wi;
6306
6391
  }
6307
6392
  });
6308
6393
 
@@ -6396,6 +6481,274 @@ function density() {
6396
6481
  return density;
6397
6482
  }
6398
6483
 
6484
+ const epsilon$3 = 1.1102230246251565e-16;
6485
+ const splitter = 134217729;
6486
+ const resulterrbound = (3 + 8 * epsilon$3) * epsilon$3;
6487
+
6488
+ // fast_expansion_sum_zeroelim routine from oritinal code
6489
+ function sum$1(elen, e, flen, f, h) {
6490
+ let Q, Qnew, hh, bvirt;
6491
+ let enow = e[0];
6492
+ let fnow = f[0];
6493
+ let eindex = 0;
6494
+ let findex = 0;
6495
+ if ((fnow > enow) === (fnow > -enow)) {
6496
+ Q = enow;
6497
+ enow = e[++eindex];
6498
+ } else {
6499
+ Q = fnow;
6500
+ fnow = f[++findex];
6501
+ }
6502
+ let hindex = 0;
6503
+ if (eindex < elen && findex < flen) {
6504
+ if ((fnow > enow) === (fnow > -enow)) {
6505
+ Qnew = enow + Q;
6506
+ hh = Q - (Qnew - enow);
6507
+ enow = e[++eindex];
6508
+ } else {
6509
+ Qnew = fnow + Q;
6510
+ hh = Q - (Qnew - fnow);
6511
+ fnow = f[++findex];
6512
+ }
6513
+ Q = Qnew;
6514
+ if (hh !== 0) {
6515
+ h[hindex++] = hh;
6516
+ }
6517
+ while (eindex < elen && findex < flen) {
6518
+ if ((fnow > enow) === (fnow > -enow)) {
6519
+ Qnew = Q + enow;
6520
+ bvirt = Qnew - Q;
6521
+ hh = Q - (Qnew - bvirt) + (enow - bvirt);
6522
+ enow = e[++eindex];
6523
+ } else {
6524
+ Qnew = Q + fnow;
6525
+ bvirt = Qnew - Q;
6526
+ hh = Q - (Qnew - bvirt) + (fnow - bvirt);
6527
+ fnow = f[++findex];
6528
+ }
6529
+ Q = Qnew;
6530
+ if (hh !== 0) {
6531
+ h[hindex++] = hh;
6532
+ }
6533
+ }
6534
+ }
6535
+ while (eindex < elen) {
6536
+ Qnew = Q + enow;
6537
+ bvirt = Qnew - Q;
6538
+ hh = Q - (Qnew - bvirt) + (enow - bvirt);
6539
+ enow = e[++eindex];
6540
+ Q = Qnew;
6541
+ if (hh !== 0) {
6542
+ h[hindex++] = hh;
6543
+ }
6544
+ }
6545
+ while (findex < flen) {
6546
+ Qnew = Q + fnow;
6547
+ bvirt = Qnew - Q;
6548
+ hh = Q - (Qnew - bvirt) + (fnow - bvirt);
6549
+ fnow = f[++findex];
6550
+ Q = Qnew;
6551
+ if (hh !== 0) {
6552
+ h[hindex++] = hh;
6553
+ }
6554
+ }
6555
+ if (Q !== 0 || hindex === 0) {
6556
+ h[hindex++] = Q;
6557
+ }
6558
+ return hindex;
6559
+ }
6560
+
6561
+ function estimate(elen, e) {
6562
+ let Q = e[0];
6563
+ for (let i = 1; i < elen; i++) Q += e[i];
6564
+ return Q;
6565
+ }
6566
+
6567
+ function vec(n) {
6568
+ return new Float64Array(n);
6569
+ }
6570
+
6571
+ const ccwerrboundA = (3 + 16 * epsilon$3) * epsilon$3;
6572
+ const ccwerrboundB = (2 + 12 * epsilon$3) * epsilon$3;
6573
+ const ccwerrboundC = (9 + 64 * epsilon$3) * epsilon$3 * epsilon$3;
6574
+
6575
+ const B = vec(4);
6576
+ const C1 = vec(8);
6577
+ const C2 = vec(12);
6578
+ const D = vec(16);
6579
+ const u = vec(4);
6580
+
6581
+ function orient2dadapt(ax, ay, bx, by, cx, cy, detsum) {
6582
+ let acxtail, acytail, bcxtail, bcytail;
6583
+ let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;
6584
+
6585
+ const acx = ax - cx;
6586
+ const bcx = bx - cx;
6587
+ const acy = ay - cy;
6588
+ const bcy = by - cy;
6589
+
6590
+ s1 = acx * bcy;
6591
+ c = splitter * acx;
6592
+ ahi = c - (c - acx);
6593
+ alo = acx - ahi;
6594
+ c = splitter * bcy;
6595
+ bhi = c - (c - bcy);
6596
+ blo = bcy - bhi;
6597
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
6598
+ t1 = acy * bcx;
6599
+ c = splitter * acy;
6600
+ ahi = c - (c - acy);
6601
+ alo = acy - ahi;
6602
+ c = splitter * bcx;
6603
+ bhi = c - (c - bcx);
6604
+ blo = bcx - bhi;
6605
+ t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
6606
+ _i = s0 - t0;
6607
+ bvirt = s0 - _i;
6608
+ B[0] = s0 - (_i + bvirt) + (bvirt - t0);
6609
+ _j = s1 + _i;
6610
+ bvirt = _j - s1;
6611
+ _0 = s1 - (_j - bvirt) + (_i - bvirt);
6612
+ _i = _0 - t1;
6613
+ bvirt = _0 - _i;
6614
+ B[1] = _0 - (_i + bvirt) + (bvirt - t1);
6615
+ u3 = _j + _i;
6616
+ bvirt = u3 - _j;
6617
+ B[2] = _j - (u3 - bvirt) + (_i - bvirt);
6618
+ B[3] = u3;
6619
+
6620
+ let det = estimate(4, B);
6621
+ let errbound = ccwerrboundB * detsum;
6622
+ if (det >= errbound || -det >= errbound) {
6623
+ return det;
6624
+ }
6625
+
6626
+ bvirt = ax - acx;
6627
+ acxtail = ax - (acx + bvirt) + (bvirt - cx);
6628
+ bvirt = bx - bcx;
6629
+ bcxtail = bx - (bcx + bvirt) + (bvirt - cx);
6630
+ bvirt = ay - acy;
6631
+ acytail = ay - (acy + bvirt) + (bvirt - cy);
6632
+ bvirt = by - bcy;
6633
+ bcytail = by - (bcy + bvirt) + (bvirt - cy);
6634
+
6635
+ if (acxtail === 0 && acytail === 0 && bcxtail === 0 && bcytail === 0) {
6636
+ return det;
6637
+ }
6638
+
6639
+ errbound = ccwerrboundC * detsum + resulterrbound * Math.abs(det);
6640
+ det += (acx * bcytail + bcy * acxtail) - (acy * bcxtail + bcx * acytail);
6641
+ if (det >= errbound || -det >= errbound) return det;
6642
+
6643
+ s1 = acxtail * bcy;
6644
+ c = splitter * acxtail;
6645
+ ahi = c - (c - acxtail);
6646
+ alo = acxtail - ahi;
6647
+ c = splitter * bcy;
6648
+ bhi = c - (c - bcy);
6649
+ blo = bcy - bhi;
6650
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
6651
+ t1 = acytail * bcx;
6652
+ c = splitter * acytail;
6653
+ ahi = c - (c - acytail);
6654
+ alo = acytail - ahi;
6655
+ c = splitter * bcx;
6656
+ bhi = c - (c - bcx);
6657
+ blo = bcx - bhi;
6658
+ t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
6659
+ _i = s0 - t0;
6660
+ bvirt = s0 - _i;
6661
+ u[0] = s0 - (_i + bvirt) + (bvirt - t0);
6662
+ _j = s1 + _i;
6663
+ bvirt = _j - s1;
6664
+ _0 = s1 - (_j - bvirt) + (_i - bvirt);
6665
+ _i = _0 - t1;
6666
+ bvirt = _0 - _i;
6667
+ u[1] = _0 - (_i + bvirt) + (bvirt - t1);
6668
+ u3 = _j + _i;
6669
+ bvirt = u3 - _j;
6670
+ u[2] = _j - (u3 - bvirt) + (_i - bvirt);
6671
+ u[3] = u3;
6672
+ const C1len = sum$1(4, B, 4, u, C1);
6673
+
6674
+ s1 = acx * bcytail;
6675
+ c = splitter * acx;
6676
+ ahi = c - (c - acx);
6677
+ alo = acx - ahi;
6678
+ c = splitter * bcytail;
6679
+ bhi = c - (c - bcytail);
6680
+ blo = bcytail - bhi;
6681
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
6682
+ t1 = acy * bcxtail;
6683
+ c = splitter * acy;
6684
+ ahi = c - (c - acy);
6685
+ alo = acy - ahi;
6686
+ c = splitter * bcxtail;
6687
+ bhi = c - (c - bcxtail);
6688
+ blo = bcxtail - bhi;
6689
+ t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
6690
+ _i = s0 - t0;
6691
+ bvirt = s0 - _i;
6692
+ u[0] = s0 - (_i + bvirt) + (bvirt - t0);
6693
+ _j = s1 + _i;
6694
+ bvirt = _j - s1;
6695
+ _0 = s1 - (_j - bvirt) + (_i - bvirt);
6696
+ _i = _0 - t1;
6697
+ bvirt = _0 - _i;
6698
+ u[1] = _0 - (_i + bvirt) + (bvirt - t1);
6699
+ u3 = _j + _i;
6700
+ bvirt = u3 - _j;
6701
+ u[2] = _j - (u3 - bvirt) + (_i - bvirt);
6702
+ u[3] = u3;
6703
+ const C2len = sum$1(C1len, C1, 4, u, C2);
6704
+
6705
+ s1 = acxtail * bcytail;
6706
+ c = splitter * acxtail;
6707
+ ahi = c - (c - acxtail);
6708
+ alo = acxtail - ahi;
6709
+ c = splitter * bcytail;
6710
+ bhi = c - (c - bcytail);
6711
+ blo = bcytail - bhi;
6712
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
6713
+ t1 = acytail * bcxtail;
6714
+ c = splitter * acytail;
6715
+ ahi = c - (c - acytail);
6716
+ alo = acytail - ahi;
6717
+ c = splitter * bcxtail;
6718
+ bhi = c - (c - bcxtail);
6719
+ blo = bcxtail - bhi;
6720
+ t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
6721
+ _i = s0 - t0;
6722
+ bvirt = s0 - _i;
6723
+ u[0] = s0 - (_i + bvirt) + (bvirt - t0);
6724
+ _j = s1 + _i;
6725
+ bvirt = _j - s1;
6726
+ _0 = s1 - (_j - bvirt) + (_i - bvirt);
6727
+ _i = _0 - t1;
6728
+ bvirt = _0 - _i;
6729
+ u[1] = _0 - (_i + bvirt) + (bvirt - t1);
6730
+ u3 = _j + _i;
6731
+ bvirt = u3 - _j;
6732
+ u[2] = _j - (u3 - bvirt) + (_i - bvirt);
6733
+ u[3] = u3;
6734
+ const Dlen = sum$1(C2len, C2, 4, u, D);
6735
+
6736
+ return D[Dlen - 1];
6737
+ }
6738
+
6739
+ function orient2d(ax, ay, bx, by, cx, cy) {
6740
+ const detleft = (ay - cy) * (bx - cx);
6741
+ const detright = (ax - cx) * (by - cy);
6742
+ const det = detleft - detright;
6743
+
6744
+ if (detleft === 0 || detright === 0 || (detleft > 0) !== (detright > 0)) return det;
6745
+
6746
+ const detsum = Math.abs(detleft + detright);
6747
+ if (Math.abs(det) >= ccwerrboundA * detsum) return det;
6748
+
6749
+ return -orient2dadapt(ax, ay, bx, by, cx, cy, detsum);
6750
+ }
6751
+
6399
6752
  const EPSILON = Math.pow(2, -52);
6400
6753
  const EDGE_STACK = new Uint32Array(512);
6401
6754
 
@@ -6526,7 +6879,7 @@ class Delaunator {
6526
6879
  }
6527
6880
 
6528
6881
  // swap the order of the seed points for counter-clockwise orientation
6529
- if (orient(i0x, i0y, i1x, i1y, i2x, i2y)) {
6882
+ if (orient2d(i0x, i0y, i1x, i1y, i2x, i2y) < 0) {
6530
6883
  const i = i1;
6531
6884
  const x = i1x;
6532
6885
  const y = i1y;
@@ -6591,7 +6944,7 @@ class Delaunator {
6591
6944
 
6592
6945
  start = hullPrev[start];
6593
6946
  let e = start, q;
6594
- while (q = hullNext[e], !orient(x, y, coords[2 * e], coords[2 * e + 1], coords[2 * q], coords[2 * q + 1])) {
6947
+ while (q = hullNext[e], orient2d(x, y, coords[2 * e], coords[2 * e + 1], coords[2 * q], coords[2 * q + 1]) >= 0) {
6595
6948
  e = q;
6596
6949
  if (e === start) {
6597
6950
  e = -1;
@@ -6610,7 +6963,7 @@ class Delaunator {
6610
6963
 
6611
6964
  // walk forward through the hull, adding more triangles and flipping recursively
6612
6965
  let n = hullNext[e];
6613
- while (q = hullNext[n], orient(x, y, coords[2 * n], coords[2 * n + 1], coords[2 * q], coords[2 * q + 1])) {
6966
+ while (q = hullNext[n], orient2d(x, y, coords[2 * n], coords[2 * n + 1], coords[2 * q], coords[2 * q + 1]) < 0) {
6614
6967
  t = this._addTriangle(n, i, q, hullTri[i], -1, hullTri[n]);
6615
6968
  hullTri[i] = this._legalize(t + 2);
6616
6969
  hullNext[n] = n; // mark as removed
@@ -6620,7 +6973,7 @@ class Delaunator {
6620
6973
 
6621
6974
  // walk backward from the other side, adding more triangles and flipping
6622
6975
  if (e === start) {
6623
- while (q = hullPrev[e], orient(x, y, coords[2 * q], coords[2 * q + 1], coords[2 * e], coords[2 * e + 1])) {
6976
+ while (q = hullPrev[e], orient2d(x, y, coords[2 * q], coords[2 * q + 1], coords[2 * e], coords[2 * e + 1]) < 0) {
6624
6977
  t = this._addTriangle(q, i, e, -1, hullTri[e], hullTri[q]);
6625
6978
  this._legalize(t + 2);
6626
6979
  hullTri[q] = t;
@@ -6775,21 +7128,6 @@ function dist(ax, ay, bx, by) {
6775
7128
  return dx * dx + dy * dy;
6776
7129
  }
6777
7130
 
6778
- // return 2d orientation sign if we're confident in it through J. Shewchuk's error bound check
6779
- function orientIfSure(px, py, rx, ry, qx, qy) {
6780
- const l = (ry - py) * (qx - px);
6781
- const r = (rx - px) * (qy - py);
6782
- return Math.abs(l - r) >= 3.3306690738754716e-16 * Math.abs(l + r) ? l - r : 0;
6783
- }
6784
-
6785
- // a more robust orientation test that's stable in a given triangle (to fix robustness issues)
6786
- function orient(rx, ry, qx, qy, px, py) {
6787
- const sign = orientIfSure(px, py, rx, ry, qx, qy) ||
6788
- orientIfSure(rx, ry, qx, qy, px, py) ||
6789
- orientIfSure(qx, qy, px, py, rx, ry);
6790
- return sign < 0;
6791
- }
6792
-
6793
7131
  function inCircle(ax, ay, bx, by, cx, cy, px, py) {
6794
7132
  const dx = ax - px;
6795
7133
  const dy = ay - py;
@@ -6982,21 +7320,26 @@ class Voronoi {
6982
7320
  const dy = y2 - y1;
6983
7321
  const ex = x3 - x1;
6984
7322
  const ey = y3 - y1;
6985
- const bl = dx * dx + dy * dy;
6986
- const cl = ex * ex + ey * ey;
6987
7323
  const ab = (dx * ey - dy * ex) * 2;
6988
7324
 
6989
- if (!ab) {
7325
+ if (Math.abs(ab) < 1e-9) {
6990
7326
  // degenerate case (collinear diagram)
6991
- x = (x1 + x3) / 2 - 1e8 * ey;
6992
- y = (y1 + y3) / 2 + 1e8 * ex;
6993
- }
6994
- else if (Math.abs(ab) < 1e-8) {
6995
7327
  // almost equal points (degenerate triangle)
6996
- x = (x1 + x3) / 2;
6997
- y = (y1 + y3) / 2;
7328
+ // the circumcenter is at the infinity, in a
7329
+ // direction that is:
7330
+ // 1. orthogonal to the halfedge.
7331
+ let a = 1e9;
7332
+ // 2. points away from the center; since the list of triangles starts
7333
+ // in the center, the first point of the first triangle
7334
+ // will be our reference
7335
+ const r = triangles[0] * 2;
7336
+ a *= Math.sign((points[r] - x1) * ey - (points[r + 1] - y1) * ex);
7337
+ x = (x1 + x3) / 2 - a * ey;
7338
+ y = (y1 + y3) / 2 + a * ex;
6998
7339
  } else {
6999
7340
  const d = 1 / ab;
7341
+ const bl = dx * dx + dy * dy;
7342
+ const cl = ex * ex + ey * ey;
7000
7343
  x = x1 + (ey * bl - dy * cl) * d;
7001
7344
  y = y1 + (dx * cl - ex * bl) * d;
7002
7345
  }
@@ -7144,7 +7487,7 @@ class Voronoi {
7144
7487
  let P = null;
7145
7488
  let x0, y0, x1 = points[n - 2], y1 = points[n - 1];
7146
7489
  let c0, c1 = this._regioncode(x1, y1);
7147
- let e0, e1;
7490
+ let e0, e1 = 0;
7148
7491
  for (let j = 0; j < n; j += 2) {
7149
7492
  x0 = x1, y0 = y1, x1 = points[j], y1 = points[j + 1];
7150
7493
  c0 = c1, c1 = this._regioncode(x1, y1);
@@ -7219,6 +7562,8 @@ class Voronoi {
7219
7562
  case 0b1001: e0 = 0b0001; continue; // bottom-left
7220
7563
  case 0b0001: e0 = 0b0101, x = this.xmin, y = this.ymin; break; // left
7221
7564
  }
7565
+ // Note: this implicitly checks for out of bounds: if P[j] or P[j+1] are
7566
+ // undefined, the conditional statement will be executed.
7222
7567
  if ((P[j] !== x || P[j + 1] !== y) && this.contains(i, x, y)) {
7223
7568
  P.splice(j, 0, x, y), j += 2;
7224
7569
  }
@@ -7353,10 +7698,12 @@ class Delaunay {
7353
7698
  this.triangles = new Int32Array(3).fill(-1);
7354
7699
  this.halfedges = new Int32Array(3).fill(-1);
7355
7700
  this.triangles[0] = hull[0];
7356
- this.triangles[1] = hull[1];
7357
- this.triangles[2] = hull[1];
7358
7701
  inedges[hull[0]] = 1;
7359
- if (hull.length === 2) inedges[hull[1]] = 0;
7702
+ if (hull.length === 2) {
7703
+ inedges[hull[1]] = 0;
7704
+ this.triangles[1] = hull[1];
7705
+ this.triangles[2] = hull[1];
7706
+ }
7360
7707
  }
7361
7708
  }
7362
7709
  voronoi(bounds) {
@@ -7433,7 +7780,9 @@ class Delaunay {
7433
7780
  this.renderHull(context);
7434
7781
  return buffer && buffer.value();
7435
7782
  }
7436
- renderPoints(context, r = 2) {
7783
+ renderPoints(context, r) {
7784
+ if (r === undefined && (!context || typeof context.moveTo !== "function")) r = context, context = null;
7785
+ r = r == undefined ? 2 : +r;
7437
7786
  const buffer = context == null ? context = new Path : undefined;
7438
7787
  const {points} = this;
7439
7788
  for (let i = 0, n = points.length; i < n; i += 2) {
@@ -10012,10 +10361,7 @@ function link$1(array) {
10012
10361
  }
10013
10362
 
10014
10363
  function longitude(point) {
10015
- if (abs$1(point[0]) <= pi$1)
10016
- return point[0];
10017
- else
10018
- return sign$1(point[0]) * ((abs$1(point[0]) + pi$1) % tau$1 - pi$1);
10364
+ return abs$1(point[0]) <= pi$1 ? point[0] : sign$1(point[0]) * ((abs$1(point[0]) + pi$1) % tau$1 - pi$1);
10019
10365
  }
10020
10366
 
10021
10367
  function polygonContains(polygon, point) {
@@ -14055,27 +14401,26 @@ function initInterpolator(domain, interpolator) {
14055
14401
  const implicit = Symbol("implicit");
14056
14402
 
14057
14403
  function ordinal() {
14058
- var index = new Map(),
14404
+ var index = new InternMap(),
14059
14405
  domain = [],
14060
14406
  range = [],
14061
14407
  unknown = implicit;
14062
14408
 
14063
14409
  function scale(d) {
14064
- var key = d + "", i = index.get(key);
14065
- if (!i) {
14410
+ let i = index.get(d);
14411
+ if (i === undefined) {
14066
14412
  if (unknown !== implicit) return unknown;
14067
- index.set(key, i = domain.push(d));
14413
+ index.set(d, i = domain.push(d) - 1);
14068
14414
  }
14069
- return range[(i - 1) % range.length];
14415
+ return range[i % range.length];
14070
14416
  }
14071
14417
 
14072
14418
  scale.domain = function(_) {
14073
14419
  if (!arguments.length) return domain.slice();
14074
- domain = [], index = new Map();
14420
+ domain = [], index = new InternMap();
14075
14421
  for (const value of _) {
14076
- const key = value + "";
14077
- if (index.has(key)) continue;
14078
- index.set(key, domain.push(value));
14422
+ if (index.has(value)) continue;
14423
+ index.set(value, domain.push(value) - 1);
14079
14424
  }
14080
14425
  return scale;
14081
14426
  };
@@ -14982,40 +15327,42 @@ millisecond.every = function(k) {
14982
15327
  };
14983
15328
  var milliseconds = millisecond.range;
14984
15329
 
14985
- var durationSecond$1 = 1e3;
14986
- var durationMinute$1 = 6e4;
14987
- var durationHour$1 = 36e5;
14988
- var durationDay$1 = 864e5;
14989
- var durationWeek$1 = 6048e5;
15330
+ const durationSecond = 1000;
15331
+ const durationMinute = durationSecond * 60;
15332
+ const durationHour = durationMinute * 60;
15333
+ const durationDay = durationHour * 24;
15334
+ const durationWeek = durationDay * 7;
15335
+ const durationMonth = durationDay * 30;
15336
+ const durationYear = durationDay * 365;
14990
15337
 
14991
15338
  var second = newInterval(function(date) {
14992
15339
  date.setTime(date - date.getMilliseconds());
14993
15340
  }, function(date, step) {
14994
- date.setTime(+date + step * durationSecond$1);
15341
+ date.setTime(+date + step * durationSecond);
14995
15342
  }, function(start, end) {
14996
- return (end - start) / durationSecond$1;
15343
+ return (end - start) / durationSecond;
14997
15344
  }, function(date) {
14998
15345
  return date.getUTCSeconds();
14999
15346
  });
15000
15347
  var seconds = second.range;
15001
15348
 
15002
15349
  var minute = newInterval(function(date) {
15003
- date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond$1);
15350
+ date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);
15004
15351
  }, function(date, step) {
15005
- date.setTime(+date + step * durationMinute$1);
15352
+ date.setTime(+date + step * durationMinute);
15006
15353
  }, function(start, end) {
15007
- return (end - start) / durationMinute$1;
15354
+ return (end - start) / durationMinute;
15008
15355
  }, function(date) {
15009
15356
  return date.getMinutes();
15010
15357
  });
15011
15358
  var minutes = minute.range;
15012
15359
 
15013
15360
  var hour = newInterval(function(date) {
15014
- date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond$1 - date.getMinutes() * durationMinute$1);
15361
+ date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);
15015
15362
  }, function(date, step) {
15016
- date.setTime(+date + step * durationHour$1);
15363
+ date.setTime(+date + step * durationHour);
15017
15364
  }, function(start, end) {
15018
- return (end - start) / durationHour$1;
15365
+ return (end - start) / durationHour;
15019
15366
  }, function(date) {
15020
15367
  return date.getHours();
15021
15368
  });
@@ -15024,7 +15371,7 @@ var hours = hour.range;
15024
15371
  var day = newInterval(
15025
15372
  date => date.setHours(0, 0, 0, 0),
15026
15373
  (date, step) => date.setDate(date.getDate() + step),
15027
- (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute$1) / durationDay$1,
15374
+ (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,
15028
15375
  date => date.getDate() - 1
15029
15376
  );
15030
15377
  var days = day.range;
@@ -15036,7 +15383,7 @@ function weekday(i) {
15036
15383
  }, function(date, step) {
15037
15384
  date.setDate(date.getDate() + step * 7);
15038
15385
  }, function(start, end) {
15039
- return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute$1) / durationWeek$1;
15386
+ return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;
15040
15387
  });
15041
15388
  }
15042
15389
 
@@ -15094,9 +15441,9 @@ var years = year.range;
15094
15441
  var utcMinute = newInterval(function(date) {
15095
15442
  date.setUTCSeconds(0, 0);
15096
15443
  }, function(date, step) {
15097
- date.setTime(+date + step * durationMinute$1);
15444
+ date.setTime(+date + step * durationMinute);
15098
15445
  }, function(start, end) {
15099
- return (end - start) / durationMinute$1;
15446
+ return (end - start) / durationMinute;
15100
15447
  }, function(date) {
15101
15448
  return date.getUTCMinutes();
15102
15449
  });
@@ -15105,9 +15452,9 @@ var utcMinutes = utcMinute.range;
15105
15452
  var utcHour = newInterval(function(date) {
15106
15453
  date.setUTCMinutes(0, 0, 0);
15107
15454
  }, function(date, step) {
15108
- date.setTime(+date + step * durationHour$1);
15455
+ date.setTime(+date + step * durationHour);
15109
15456
  }, function(start, end) {
15110
- return (end - start) / durationHour$1;
15457
+ return (end - start) / durationHour;
15111
15458
  }, function(date) {
15112
15459
  return date.getUTCHours();
15113
15460
  });
@@ -15118,7 +15465,7 @@ var utcDay = newInterval(function(date) {
15118
15465
  }, function(date, step) {
15119
15466
  date.setUTCDate(date.getUTCDate() + step);
15120
15467
  }, function(start, end) {
15121
- return (end - start) / durationDay$1;
15468
+ return (end - start) / durationDay;
15122
15469
  }, function(date) {
15123
15470
  return date.getUTCDate() - 1;
15124
15471
  });
@@ -15131,7 +15478,7 @@ function utcWeekday(i) {
15131
15478
  }, function(date, step) {
15132
15479
  date.setUTCDate(date.getUTCDate() + step * 7);
15133
15480
  }, function(start, end) {
15134
- return (end - start) / durationWeek$1;
15481
+ return (end - start) / durationWeek;
15135
15482
  });
15136
15483
  }
15137
15484
 
@@ -15186,6 +15533,52 @@ utcYear.every = function(k) {
15186
15533
  };
15187
15534
  var utcYears = utcYear.range;
15188
15535
 
15536
+ function ticker(year, month, week, day, hour, minute) {
15537
+
15538
+ const tickIntervals = [
15539
+ [second, 1, durationSecond],
15540
+ [second, 5, 5 * durationSecond],
15541
+ [second, 15, 15 * durationSecond],
15542
+ [second, 30, 30 * durationSecond],
15543
+ [minute, 1, durationMinute],
15544
+ [minute, 5, 5 * durationMinute],
15545
+ [minute, 15, 15 * durationMinute],
15546
+ [minute, 30, 30 * durationMinute],
15547
+ [ hour, 1, durationHour ],
15548
+ [ hour, 3, 3 * durationHour ],
15549
+ [ hour, 6, 6 * durationHour ],
15550
+ [ hour, 12, 12 * durationHour ],
15551
+ [ day, 1, durationDay ],
15552
+ [ day, 2, 2 * durationDay ],
15553
+ [ week, 1, durationWeek ],
15554
+ [ month, 1, durationMonth ],
15555
+ [ month, 3, 3 * durationMonth ],
15556
+ [ year, 1, durationYear ]
15557
+ ];
15558
+
15559
+ function ticks(start, stop, count) {
15560
+ const reverse = stop < start;
15561
+ if (reverse) [start, stop] = [stop, start];
15562
+ const interval = count && typeof count.range === "function" ? count : tickInterval(start, stop, count);
15563
+ const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop
15564
+ return reverse ? ticks.reverse() : ticks;
15565
+ }
15566
+
15567
+ function tickInterval(start, stop, count) {
15568
+ const target = Math.abs(stop - start) / count;
15569
+ const i = bisector(([,, step]) => step).right(tickIntervals, target);
15570
+ if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));
15571
+ if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1));
15572
+ const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];
15573
+ return t.every(step);
15574
+ }
15575
+
15576
+ return [ticks, tickInterval];
15577
+ }
15578
+
15579
+ const [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, utcDay, utcHour, utcMinute);
15580
+ const [timeTicks, timeTickInterval] = ticker(year, month, sunday, day, hour, minute);
15581
+
15189
15582
  function localDate(d) {
15190
15583
  if (0 <= d.y && d.y < 100) {
15191
15584
  var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);
@@ -15916,14 +16309,6 @@ var parseIso = +new Date("2000-01-01T00:00:00.000Z")
15916
16309
  ? parseIsoNative
15917
16310
  : exports.utcParse(isoSpecifier);
15918
16311
 
15919
- var durationSecond = 1000,
15920
- durationMinute = durationSecond * 60,
15921
- durationHour = durationMinute * 60,
15922
- durationDay = durationHour * 24,
15923
- durationWeek = durationDay * 7,
15924
- durationMonth = durationDay * 30,
15925
- durationYear = durationDay * 365;
15926
-
15927
16312
  function date(t) {
15928
16313
  return new Date(t);
15929
16314
  }
@@ -15932,7 +16317,7 @@ function number(t) {
15932
16317
  return t instanceof Date ? +t : +new Date(+t);
15933
16318
  }
15934
16319
 
15935
- function calendar(year, month, week, day, hour, minute, second, millisecond, format) {
16320
+ function calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {
15936
16321
  var scale = continuous(),
15937
16322
  invert = scale.invert,
15938
16323
  domain = scale.domain;
@@ -15946,27 +16331,6 @@ function calendar(year, month, week, day, hour, minute, second, millisecond, for
15946
16331
  formatMonth = format("%B"),
15947
16332
  formatYear = format("%Y");
15948
16333
 
15949
- var tickIntervals = [
15950
- [second, 1, durationSecond],
15951
- [second, 5, 5 * durationSecond],
15952
- [second, 15, 15 * durationSecond],
15953
- [second, 30, 30 * durationSecond],
15954
- [minute, 1, durationMinute],
15955
- [minute, 5, 5 * durationMinute],
15956
- [minute, 15, 15 * durationMinute],
15957
- [minute, 30, 30 * durationMinute],
15958
- [ hour, 1, durationHour ],
15959
- [ hour, 3, 3 * durationHour ],
15960
- [ hour, 6, 6 * durationHour ],
15961
- [ hour, 12, 12 * durationHour ],
15962
- [ day, 1, durationDay ],
15963
- [ day, 2, 2 * durationDay ],
15964
- [ week, 1, durationWeek ],
15965
- [ month, 1, durationMonth ],
15966
- [ month, 3, 3 * durationMonth ],
15967
- [ year, 1, durationYear ]
15968
- ];
15969
-
15970
16334
  function tickFormat(date) {
15971
16335
  return (second(date) < date ? formatMillisecond
15972
16336
  : minute(date) < date ? formatSecond
@@ -15977,33 +16341,6 @@ function calendar(year, month, week, day, hour, minute, second, millisecond, for
15977
16341
  : formatYear)(date);
15978
16342
  }
15979
16343
 
15980
- function tickInterval(interval, start, stop) {
15981
- if (interval == null) interval = 10;
15982
-
15983
- // If a desired tick count is specified, pick a reasonable tick interval
15984
- // based on the extent of the domain and a rough estimate of tick size.
15985
- // Otherwise, assume interval is already a time interval and use it.
15986
- if (typeof interval === "number") {
15987
- var target = Math.abs(stop - start) / interval,
15988
- i = bisector(function(i) { return i[2]; }).right(tickIntervals, target),
15989
- step;
15990
- if (i === tickIntervals.length) {
15991
- step = tickStep(start / durationYear, stop / durationYear, interval);
15992
- interval = year;
15993
- } else if (i) {
15994
- i = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];
15995
- step = i[1];
15996
- interval = i[0];
15997
- } else {
15998
- step = Math.max(tickStep(start, stop, interval), 1);
15999
- interval = millisecond;
16000
- }
16001
- return interval.every(step);
16002
- }
16003
-
16004
- return interval;
16005
- }
16006
-
16007
16344
  scale.invert = function(y) {
16008
16345
  return new Date(invert(y));
16009
16346
  };
@@ -16013,15 +16350,8 @@ function calendar(year, month, week, day, hour, minute, second, millisecond, for
16013
16350
  };
16014
16351
 
16015
16352
  scale.ticks = function(interval) {
16016
- var d = domain(),
16017
- t0 = d[0],
16018
- t1 = d[d.length - 1],
16019
- r = t1 < t0,
16020
- t;
16021
- if (r) t = t0, t0 = t1, t1 = t;
16022
- t = tickInterval(interval, t0, t1);
16023
- t = t ? t.range(t0, t1 + 1) : []; // inclusive stop
16024
- return r ? t.reverse() : t;
16353
+ var d = domain();
16354
+ return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);
16025
16355
  };
16026
16356
 
16027
16357
  scale.tickFormat = function(count, specifier) {
@@ -16030,24 +16360,23 @@ function calendar(year, month, week, day, hour, minute, second, millisecond, for
16030
16360
 
16031
16361
  scale.nice = function(interval) {
16032
16362
  var d = domain();
16033
- return (interval = tickInterval(interval, d[0], d[d.length - 1]))
16034
- ? domain(nice(d, interval))
16035
- : scale;
16363
+ if (!interval || typeof interval.range !== "function") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);
16364
+ return interval ? domain(nice(d, interval)) : scale;
16036
16365
  };
16037
16366
 
16038
16367
  scale.copy = function() {
16039
- return copy$1(scale, calendar(year, month, week, day, hour, minute, second, millisecond, format));
16368
+ return copy$1(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));
16040
16369
  };
16041
16370
 
16042
16371
  return scale;
16043
16372
  }
16044
16373
 
16045
16374
  function time() {
16046
- return initRange.apply(calendar(year, month, sunday, day, hour, minute, second, millisecond, exports.timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);
16375
+ return initRange.apply(calendar(timeTicks, timeTickInterval, year, month, sunday, day, hour, minute, second, exports.timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);
16047
16376
  }
16048
16377
 
16049
16378
  function utcTime() {
16050
- return initRange.apply(calendar(utcYear, utcMonth, utcSunday, utcDay, utcHour, utcMinute, second, millisecond, exports.utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]), arguments);
16379
+ return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcSunday, utcDay, utcHour, utcMinute, second, exports.utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]), arguments);
16051
16380
  }
16052
16381
 
16053
16382
  function transformer$1() {
@@ -17029,7 +17358,7 @@ Linear.prototype = {
17029
17358
  x = +x, y = +y;
17030
17359
  switch (this._point) {
17031
17360
  case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
17032
- case 1: this._point = 2; // proceed
17361
+ case 1: this._point = 2; // falls through
17033
17362
  default: this._context.lineTo(x, y); break;
17034
17363
  }
17035
17364
  }
@@ -17628,7 +17957,7 @@ Basis.prototype = {
17628
17957
  },
17629
17958
  lineEnd: function() {
17630
17959
  switch (this._point) {
17631
- case 3: point$3(this, this._x1, this._y1); // proceed
17960
+ case 3: point$3(this, this._x1, this._y1); // falls through
17632
17961
  case 2: this._context.lineTo(this._x1, this._y1); break;
17633
17962
  }
17634
17963
  if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
@@ -17639,7 +17968,7 @@ Basis.prototype = {
17639
17968
  switch (this._point) {
17640
17969
  case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
17641
17970
  case 1: this._point = 2; break;
17642
- case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // proceed
17971
+ case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // falls through
17643
17972
  default: point$3(this, x, y); break;
17644
17973
  }
17645
17974
  this._x0 = this._x1, this._x1 = x;
@@ -17727,7 +18056,7 @@ BasisOpen.prototype = {
17727
18056
  case 0: this._point = 1; break;
17728
18057
  case 1: this._point = 2; break;
17729
18058
  case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;
17730
- case 3: this._point = 4; // proceed
18059
+ case 3: this._point = 4; // falls through
17731
18060
  default: point$3(this, x, y); break;
17732
18061
  }
17733
18062
  this._x0 = this._x1, this._x1 = x;
@@ -17766,7 +18095,7 @@ class Bump {
17766
18095
  else this._context.moveTo(x, y);
17767
18096
  break;
17768
18097
  }
17769
- case 1: this._point = 2; // proceed
18098
+ case 1: this._point = 2; // falls through
17770
18099
  default: {
17771
18100
  if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x) / 2, this._y0, this._x0, y, x, y);
17772
18101
  else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y) / 2, x, this._y0, x, y);
@@ -17881,7 +18210,7 @@ Cardinal.prototype = {
17881
18210
  switch (this._point) {
17882
18211
  case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
17883
18212
  case 1: this._point = 2; this._x1 = x, this._y1 = y; break;
17884
- case 2: this._point = 3; // proceed
18213
+ case 2: this._point = 3; // falls through
17885
18214
  default: point$2(this, x, y); break;
17886
18215
  }
17887
18216
  this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
@@ -17988,7 +18317,7 @@ CardinalOpen.prototype = {
17988
18317
  case 0: this._point = 1; break;
17989
18318
  case 1: this._point = 2; break;
17990
18319
  case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;
17991
- case 3: this._point = 4; // proceed
18320
+ case 3: this._point = 4; // falls through
17992
18321
  default: point$2(this, x, y); break;
17993
18322
  }
17994
18323
  this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
@@ -18071,7 +18400,7 @@ CatmullRom.prototype = {
18071
18400
  switch (this._point) {
18072
18401
  case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
18073
18402
  case 1: this._point = 2; break;
18074
- case 2: this._point = 3; // proceed
18403
+ case 2: this._point = 3; // falls through
18075
18404
  default: point$1(this, x, y); break;
18076
18405
  }
18077
18406
 
@@ -18202,7 +18531,7 @@ CatmullRomOpen.prototype = {
18202
18531
  case 0: this._point = 1; break;
18203
18532
  case 1: this._point = 2; break;
18204
18533
  case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;
18205
- case 3: this._point = 4; // proceed
18534
+ case 3: this._point = 4; // falls through
18206
18535
  default: point$1(this, x, y); break;
18207
18536
  }
18208
18537
 
@@ -18446,7 +18775,7 @@ Step.prototype = {
18446
18775
  x = +x, y = +y;
18447
18776
  switch (this._point) {
18448
18777
  case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
18449
- case 1: this._point = 2; // proceed
18778
+ case 1: this._point = 2; // falls through
18450
18779
  default: {
18451
18780
  if (this._t <= 0) {
18452
18781
  this._context.lineTo(this._x, y);
@@ -18798,7 +19127,7 @@ function zoom() {
18798
19127
  function zoom(selection) {
18799
19128
  selection
18800
19129
  .property("__zoom", defaultTransform)
18801
- .on("wheel.zoom", wheeled)
19130
+ .on("wheel.zoom", wheeled, {passive: false})
18802
19131
  .on("mousedown.zoom", mousedowned)
18803
19132
  .on("dblclick.zoom", dblclicked)
18804
19133
  .filter(touchable)
@@ -18995,10 +19324,10 @@ function zoom() {
18995
19324
 
18996
19325
  function mousedowned(event, ...args) {
18997
19326
  if (touchending || !filter.apply(this, arguments)) return;
18998
- var g = gesture(this, args, true).event(event),
19327
+ var currentTarget = event.currentTarget,
19328
+ g = gesture(this, args, true).event(event),
18999
19329
  v = select(event.view).on("mousemove.zoom", mousemoved, true).on("mouseup.zoom", mouseupped, true),
19000
19330
  p = pointer(event, currentTarget),
19001
- currentTarget = event.currentTarget,
19002
19331
  x0 = event.clientX,
19003
19332
  y0 = event.clientY;
19004
19333
 
@@ -19177,7 +19506,9 @@ exports.Delaunay = Delaunay;
19177
19506
  exports.FormatSpecifier = FormatSpecifier;
19178
19507
  exports.InternMap = InternMap;
19179
19508
  exports.InternSet = InternSet;
19509
+ exports.Node = Node$1;
19180
19510
  exports.Voronoi = Voronoi;
19511
+ exports.ZoomTransform = Transform;
19181
19512
  exports.active = active;
19182
19513
  exports.arc = arc;
19183
19514
  exports.area = area;
@@ -19292,6 +19623,8 @@ exports.every = every;
19292
19623
  exports.extent = extent$1;
19293
19624
  exports.fcumsum = fcumsum;
19294
19625
  exports.filter = filter$1;
19626
+ exports.flatGroup = flatGroup;
19627
+ exports.flatRollup = flatRollup;
19295
19628
  exports.forceCenter = center;
19296
19629
  exports.forceCollide = collide;
19297
19630
  exports.forceLink = link$2;
@@ -19455,6 +19788,7 @@ exports.median = median;
19455
19788
  exports.merge = merge;
19456
19789
  exports.min = min$2;
19457
19790
  exports.minIndex = minIndex;
19791
+ exports.mode = mode;
19458
19792
  exports.namespace = namespace;
19459
19793
  exports.namespaces = namespaces;
19460
19794
  exports.nice = nice$1;
@@ -19601,7 +19935,7 @@ exports.stackOrderReverse = reverse;
19601
19935
  exports.stratify = stratify;
19602
19936
  exports.style = styleValue;
19603
19937
  exports.subset = subset;
19604
- exports.sum = sum$1;
19938
+ exports.sum = sum$2;
19605
19939
  exports.superset = superset;
19606
19940
  exports.svg = svg;
19607
19941
  exports.symbol = symbol;
@@ -19646,6 +19980,8 @@ exports.timeSunday = sunday;
19646
19980
  exports.timeSundays = sundays;
19647
19981
  exports.timeThursday = thursday;
19648
19982
  exports.timeThursdays = thursdays;
19983
+ exports.timeTickInterval = timeTickInterval;
19984
+ exports.timeTicks = timeTicks;
19649
19985
  exports.timeTuesday = tuesday;
19650
19986
  exports.timeTuesdays = tuesdays;
19651
19987
  exports.timeWednesday = wednesday;
@@ -19698,6 +20034,8 @@ exports.utcSunday = utcSunday;
19698
20034
  exports.utcSundays = utcSundays;
19699
20035
  exports.utcThursday = utcThursday;
19700
20036
  exports.utcThursdays = utcThursdays;
20037
+ exports.utcTickInterval = utcTickInterval;
20038
+ exports.utcTicks = utcTicks;
19701
20039
  exports.utcTuesday = utcTuesday;
19702
20040
  exports.utcTuesdays = utcTuesdays;
19703
20041
  exports.utcWednesday = utcWednesday;