d3-rails 4.8.0 → 4.9.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
  SHA1:
3
- metadata.gz: 24f20f9493fba5c1f8305d14092ba0b8b690dec5
4
- data.tar.gz: 8119c2d1696efb04885477fcd07f55b745fafb19
3
+ metadata.gz: 91ac39ccf3a5acdc7fc25d05715474fab1cdef2a
4
+ data.tar.gz: 8b1cde1cdc3778b6495516762dd28e8cf302fda4
5
5
  SHA512:
6
- metadata.gz: 1519b56b9e8de820a076c26f553736a4819d78610049cba2f20ddab0a6ec9c2068884014941b44ae9a89bfe8714d5caee592890baedb287aa9f5f94deb29eb16
7
- data.tar.gz: e9ac4beb4b6399240df5d0939b1740c7d9d03593780e855e456329c2b74d5a074983ed7940790b63f04601203e06a442990fd700fad7a5dc21ff39bb30e04d4e
6
+ metadata.gz: 73f1e32459d289046ec3ff32afad9529458b85c8a9d2157841ee60b08e03f5a5113276ae3999aa392c7787ce8ab681f11e5b1ff38a0699d0b3258558d4cd5242
7
+ data.tar.gz: f6121e0e68000287d77ed57cb5ff9d2e6db53d8e04c1fd003abee93ebc33686bfd80babe2a904edb156e46b2cea1485d2e4d973c119f389c44e80740e50998a1
@@ -1,5 +1,8 @@
1
+ ## 4.9.0 (15 May 2017)
2
+ * Upgrade D3 to 4.9.0
3
+
1
4
  ## 4.8.0 (15 April 2017)
2
- # Upgrade D3 to 4.8.0
5
+ * Upgrade D3 to 4.8.0
3
6
 
4
7
  ## 4.7.0 (28 February 2017)
5
8
  * Upgrade D3 to 4.7.0
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 4.8.0 of D3.js. The d3-rails version will
11
+ d3-rails comes with version 4.9.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
 
@@ -1,11 +1,11 @@
1
- // https://d3js.org Version 4.8.0. Copyright 2017 Mike Bostock.
1
+ // https://d3js.org Version 4.9.0. Copyright 2017 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
  (factory((global.d3 = global.d3 || {})));
6
6
  }(this, (function (exports) { 'use strict';
7
7
 
8
- var version = "4.8.0";
8
+ var version = "4.9.0";
9
9
 
10
10
  var ascending = function(a, b) {
11
11
  return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
@@ -567,15 +567,15 @@ var left = 4;
567
567
  var epsilon = 1e-6;
568
568
 
569
569
  function translateX(x) {
570
- return "translate(" + x + ",0)";
570
+ return "translate(" + (x + 0.5) + ",0)";
571
571
  }
572
572
 
573
573
  function translateY(y) {
574
- return "translate(0," + y + ")";
574
+ return "translate(0," + (y + 0.5) + ")";
575
575
  }
576
576
 
577
577
  function center(scale) {
578
- var offset = scale.bandwidth() / 2;
578
+ var offset = Math.max(0, scale.bandwidth() - 1) / 2; // Adjust for 0.5px offset.
579
579
  if (scale.round()) offset = Math.round(offset);
580
580
  return function(d) {
581
581
  return scale(d) + offset;
@@ -594,7 +594,7 @@ function axis(orient, scale) {
594
594
  tickSizeOuter = 6,
595
595
  tickPadding = 3,
596
596
  k = orient === top || orient === left ? -1 : 1,
597
- x, y = orient === left || orient === right ? (x = "x", "y") : (x = "y", "x"),
597
+ x = orient === left || orient === right ? "x" : "y",
598
598
  transform = orient === top || orient === bottom ? translateX : translateY;
599
599
 
600
600
  function axis(context) {
@@ -621,14 +621,11 @@ function axis(orient, scale) {
621
621
 
622
622
  line = line.merge(tickEnter.append("line")
623
623
  .attr("stroke", "#000")
624
- .attr(x + "2", k * tickSizeInner)
625
- .attr(y + "1", 0.5)
626
- .attr(y + "2", 0.5));
624
+ .attr(x + "2", k * tickSizeInner));
627
625
 
628
626
  text = text.merge(tickEnter.append("text")
629
627
  .attr("fill", "#000")
630
628
  .attr(x, k * spacing)
631
- .attr(y, 0.5)
632
629
  .attr("dy", orient === top ? "0em" : orient === bottom ? "0.71em" : "0.32em"));
633
630
 
634
631
  if (context !== selection) {
@@ -1403,7 +1400,7 @@ var selection_attr = function(name, value) {
1403
1400
  : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));
1404
1401
  };
1405
1402
 
1406
- var window = function(node) {
1403
+ var defaultView = function(node) {
1407
1404
  return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node
1408
1405
  || (node.document && node) // node is a Window
1409
1406
  || node.defaultView; // node is a Document
@@ -1430,17 +1427,19 @@ function styleFunction(name, value, priority) {
1430
1427
  }
1431
1428
 
1432
1429
  var selection_style = function(name, value, priority) {
1433
- var node;
1434
1430
  return arguments.length > 1
1435
1431
  ? this.each((value == null
1436
1432
  ? styleRemove : typeof value === "function"
1437
1433
  ? styleFunction
1438
1434
  : styleConstant)(name, value, priority == null ? "" : priority))
1439
- : window(node = this.node())
1440
- .getComputedStyle(node, null)
1441
- .getPropertyValue(name);
1435
+ : styleValue(this.node(), name);
1442
1436
  };
1443
1437
 
1438
+ function styleValue(node, name) {
1439
+ return node.style.getPropertyValue(name)
1440
+ || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);
1441
+ }
1442
+
1444
1443
  function propertyRemove(name) {
1445
1444
  return function() {
1446
1445
  delete this[name];
@@ -1649,13 +1648,13 @@ var selection_datum = function(value) {
1649
1648
  };
1650
1649
 
1651
1650
  function dispatchEvent(node, type, params) {
1652
- var window$$1 = window(node),
1653
- event = window$$1.CustomEvent;
1651
+ var window = defaultView(node),
1652
+ event = window.CustomEvent;
1654
1653
 
1655
- if (event) {
1654
+ if (typeof event === "function") {
1656
1655
  event = new event(type, params);
1657
1656
  } else {
1658
- event = window$$1.document.createEvent("Event");
1657
+ event = window.document.createEvent("Event");
1659
1658
  if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;
1660
1659
  else event.initEvent(type, false, false);
1661
1660
  }
@@ -1838,8 +1837,11 @@ var drag = function() {
1838
1837
  gestures = {},
1839
1838
  listeners = dispatch("start", "drag", "end"),
1840
1839
  active = 0,
1840
+ mousedownx,
1841
+ mousedowny,
1841
1842
  mousemoving,
1842
- touchending;
1843
+ touchending,
1844
+ clickDistance2 = 0;
1843
1845
 
1844
1846
  function drag(selection$$1) {
1845
1847
  selection$$1
@@ -1858,12 +1860,17 @@ var drag = function() {
1858
1860
  dragDisable(exports.event.view);
1859
1861
  nopropagation();
1860
1862
  mousemoving = false;
1863
+ mousedownx = exports.event.clientX;
1864
+ mousedowny = exports.event.clientY;
1861
1865
  gesture("start");
1862
1866
  }
1863
1867
 
1864
1868
  function mousemoved() {
1865
1869
  noevent();
1866
- mousemoving = true;
1870
+ if (!mousemoving) {
1871
+ var dx = exports.event.clientX - mousedownx, dy = exports.event.clientY - mousedowny;
1872
+ mousemoving = dx * dx + dy * dy > clickDistance2;
1873
+ }
1867
1874
  gestures.mouse("drag");
1868
1875
  }
1869
1876
 
@@ -1953,6 +1960,10 @@ var drag = function() {
1953
1960
  return value === listeners ? drag : value;
1954
1961
  };
1955
1962
 
1963
+ drag.clickDistance = function(_) {
1964
+ return arguments.length ? (clickDistance2 = (_ = +_) * _, drag) : Math.sqrt(clickDistance2);
1965
+ };
1966
+
1956
1967
  return drag;
1957
1968
  };
1958
1969
 
@@ -2701,7 +2712,7 @@ var interpolateValue = function(a, b) {
2701
2712
  : b instanceof color ? interpolateRgb
2702
2713
  : b instanceof Date ? date
2703
2714
  : Array.isArray(b) ? array$1
2704
- : isNaN(b) ? object
2715
+ : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object
2705
2716
  : reinterpolate)(a, b);
2706
2717
  };
2707
2718
 
@@ -3664,9 +3675,8 @@ function styleRemove$1(name, interpolate$$2) {
3664
3675
  value10,
3665
3676
  interpolate0;
3666
3677
  return function() {
3667
- var style = window(this).getComputedStyle(this, null),
3668
- value0 = style.getPropertyValue(name),
3669
- value1 = (this.style.removeProperty(name), style.getPropertyValue(name));
3678
+ var value0 = styleValue(this, name),
3679
+ value1 = (this.style.removeProperty(name), styleValue(this, name));
3670
3680
  return value0 === value1 ? null
3671
3681
  : value0 === value00 && value1 === value10 ? interpolate0
3672
3682
  : interpolate0 = interpolate$$2(value00 = value0, value10 = value1);
@@ -3683,7 +3693,7 @@ function styleConstant$1(name, interpolate$$2, value1) {
3683
3693
  var value00,
3684
3694
  interpolate0;
3685
3695
  return function() {
3686
- var value0 = window(this).getComputedStyle(this, null).getPropertyValue(name);
3696
+ var value0 = styleValue(this, name);
3687
3697
  return value0 === value1 ? null
3688
3698
  : value0 === value00 ? interpolate0
3689
3699
  : interpolate0 = interpolate$$2(value00 = value0, value1);
@@ -3695,10 +3705,9 @@ function styleFunction$1(name, interpolate$$2, value) {
3695
3705
  value10,
3696
3706
  interpolate0;
3697
3707
  return function() {
3698
- var style = window(this).getComputedStyle(this, null),
3699
- value0 = style.getPropertyValue(name),
3708
+ var value0 = styleValue(this, name),
3700
3709
  value1 = value(this);
3701
- if (value1 == null) value1 = (this.style.removeProperty(name), style.getPropertyValue(name));
3710
+ if (value1 == null) value1 = (this.style.removeProperty(name), styleValue(this, name));
3702
3711
  return value0 === value1 ? null
3703
3712
  : value0 === value00 && value1 === value10 ? interpolate0
3704
3713
  : interpolate0 = interpolate$$2(value00 = value0, value10 = value1);
@@ -10966,7 +10975,6 @@ var slice$3 = [].slice;
10966
10975
  var noabort = {};
10967
10976
 
10968
10977
  function Queue(size) {
10969
- if (!(size >= 1)) throw new Error;
10970
10978
  this._size = size;
10971
10979
  this._call =
10972
10980
  this._error = null;
@@ -10981,7 +10989,8 @@ function Queue(size) {
10981
10989
  Queue.prototype = queue.prototype = {
10982
10990
  constructor: Queue,
10983
10991
  defer: function(callback) {
10984
- if (typeof callback !== "function" || this._call) throw new Error;
10992
+ if (typeof callback !== "function") throw new Error("invalid callback");
10993
+ if (this._call) throw new Error("defer after await");
10985
10994
  if (this._error != null) return this;
10986
10995
  var t = slice$3.call(arguments, 1);
10987
10996
  t.push(callback);
@@ -10994,13 +11003,15 @@ Queue.prototype = queue.prototype = {
10994
11003
  return this;
10995
11004
  },
10996
11005
  await: function(callback) {
10997
- if (typeof callback !== "function" || this._call) throw new Error;
11006
+ if (typeof callback !== "function") throw new Error("invalid callback");
11007
+ if (this._call) throw new Error("multiple await");
10998
11008
  this._call = function(error, results) { callback.apply(null, [error].concat(results)); };
10999
11009
  maybeNotify(this);
11000
11010
  return this;
11001
11011
  },
11002
11012
  awaitAll: function(callback) {
11003
- if (typeof callback !== "function" || this._call) throw new Error;
11013
+ if (typeof callback !== "function") throw new Error("invalid callback");
11014
+ if (this._call) throw new Error("multiple await");
11004
11015
  this._call = callback;
11005
11016
  maybeNotify(this);
11006
11017
  return this;
@@ -11076,66 +11087,108 @@ function maybeNotify(q) {
11076
11087
  }
11077
11088
 
11078
11089
  function queue(concurrency) {
11079
- return new Queue(arguments.length ? +concurrency : Infinity);
11090
+ if (concurrency == null) concurrency = Infinity;
11091
+ else if (!((concurrency = +concurrency) >= 1)) throw new Error("invalid concurrency");
11092
+ return new Queue(concurrency);
11080
11093
  }
11081
11094
 
11082
- var uniform = function(min, max) {
11083
- min = min == null ? 0 : +min;
11084
- max = max == null ? 1 : +max;
11085
- if (arguments.length === 1) max = min, min = 0;
11086
- else max -= min;
11087
- return function() {
11088
- return Math.random() * max + min;
11089
- };
11095
+ var defaultSource$1 = function() {
11096
+ return Math.random();
11090
11097
  };
11091
11098
 
11092
- var normal = function(mu, sigma) {
11093
- var x, r;
11094
- mu = mu == null ? 0 : +mu;
11095
- sigma = sigma == null ? 1 : +sigma;
11096
- return function() {
11097
- var y;
11099
+ var uniform = ((function sourceRandomUniform(source) {
11100
+ function randomUniform(min, max) {
11101
+ min = min == null ? 0 : +min;
11102
+ max = max == null ? 1 : +max;
11103
+ if (arguments.length === 1) max = min, min = 0;
11104
+ else max -= min;
11105
+ return function() {
11106
+ return source() * max + min;
11107
+ };
11108
+ }
11098
11109
 
11099
- // If available, use the second previously-generated uniform random.
11100
- if (x != null) y = x, x = null;
11110
+ randomUniform.source = sourceRandomUniform;
11101
11111
 
11102
- // Otherwise, generate a new x and y.
11103
- else do {
11104
- x = Math.random() * 2 - 1;
11105
- y = Math.random() * 2 - 1;
11106
- r = x * x + y * y;
11107
- } while (!r || r > 1);
11112
+ return randomUniform;
11113
+ }))(defaultSource$1);
11108
11114
 
11109
- return mu + sigma * y * Math.sqrt(-2 * Math.log(r) / r);
11110
- };
11111
- };
11115
+ var normal = ((function sourceRandomNormal(source) {
11116
+ function randomNormal(mu, sigma) {
11117
+ var x, r;
11118
+ mu = mu == null ? 0 : +mu;
11119
+ sigma = sigma == null ? 1 : +sigma;
11120
+ return function() {
11121
+ var y;
11112
11122
 
11113
- var logNormal = function() {
11114
- var randomNormal = normal.apply(this, arguments);
11115
- return function() {
11116
- return Math.exp(randomNormal());
11117
- };
11118
- };
11123
+ // If available, use the second previously-generated uniform random.
11124
+ if (x != null) y = x, x = null;
11119
11125
 
11120
- var irwinHall = function(n) {
11121
- return function() {
11122
- for (var sum = 0, i = 0; i < n; ++i) sum += Math.random();
11123
- return sum;
11124
- };
11125
- };
11126
+ // Otherwise, generate a new x and y.
11127
+ else do {
11128
+ x = source() * 2 - 1;
11129
+ y = source() * 2 - 1;
11130
+ r = x * x + y * y;
11131
+ } while (!r || r > 1);
11126
11132
 
11127
- var bates = function(n) {
11128
- var randomIrwinHall = irwinHall(n);
11129
- return function() {
11130
- return randomIrwinHall() / n;
11131
- };
11132
- };
11133
+ return mu + sigma * y * Math.sqrt(-2 * Math.log(r) / r);
11134
+ };
11135
+ }
11133
11136
 
11134
- var exponential$1 = function(lambda) {
11135
- return function() {
11136
- return -Math.log(1 - Math.random()) / lambda;
11137
- };
11138
- };
11137
+ randomNormal.source = sourceRandomNormal;
11138
+
11139
+ return randomNormal;
11140
+ }))(defaultSource$1);
11141
+
11142
+ var logNormal = ((function sourceRandomLogNormal(source) {
11143
+ function randomLogNormal() {
11144
+ var randomNormal = normal.source(source).apply(this, arguments);
11145
+ return function() {
11146
+ return Math.exp(randomNormal());
11147
+ };
11148
+ }
11149
+
11150
+ randomLogNormal.source = sourceRandomLogNormal;
11151
+
11152
+ return randomLogNormal;
11153
+ }))(defaultSource$1);
11154
+
11155
+ var irwinHall = ((function sourceRandomIrwinHall(source) {
11156
+ function randomIrwinHall(n) {
11157
+ return function() {
11158
+ for (var sum = 0, i = 0; i < n; ++i) sum += source();
11159
+ return sum;
11160
+ };
11161
+ }
11162
+
11163
+ randomIrwinHall.source = sourceRandomIrwinHall;
11164
+
11165
+ return randomIrwinHall;
11166
+ }))(defaultSource$1);
11167
+
11168
+ var bates = ((function sourceRandomBates(source) {
11169
+ function randomBates(n) {
11170
+ var randomIrwinHall = irwinHall.source(source)(n);
11171
+ return function() {
11172
+ return randomIrwinHall() / n;
11173
+ };
11174
+ }
11175
+
11176
+ randomBates.source = sourceRandomBates;
11177
+
11178
+ return randomBates;
11179
+ }))(defaultSource$1);
11180
+
11181
+ var exponential$1 = ((function sourceRandomExponential(source) {
11182
+ function randomExponential(lambda) {
11183
+ return function() {
11184
+ return -Math.log(1 - source()) / lambda;
11185
+ };
11186
+ }
11187
+
11188
+ randomExponential.source = sourceRandomExponential;
11189
+
11190
+ return randomExponential;
11191
+ }))(defaultSource$1);
11139
11192
 
11140
11193
  var request = function(url, callback) {
11141
11194
  var request,
@@ -11643,17 +11696,39 @@ function linearish(scale) {
11643
11696
  };
11644
11697
 
11645
11698
  scale.nice = function(count) {
11699
+ if (count == null) count = 10;
11700
+
11646
11701
  var d = domain(),
11647
- i = d.length - 1,
11648
- n = count == null ? 10 : count,
11649
- start = d[0],
11650
- stop = d[i],
11651
- step = tickStep(start, stop, n);
11652
-
11653
- if (step) {
11654
- step = tickStep(Math.floor(start / step) * step, Math.ceil(stop / step) * step, n);
11655
- d[0] = Math.floor(start / step) * step;
11656
- d[i] = Math.ceil(stop / step) * step;
11702
+ i0 = 0,
11703
+ i1 = d.length - 1,
11704
+ start = d[i0],
11705
+ stop = d[i1],
11706
+ step;
11707
+
11708
+ if (stop < start) {
11709
+ step = start, start = stop, stop = step;
11710
+ step = i0, i0 = i1, i1 = step;
11711
+ }
11712
+
11713
+ step = tickIncrement(start, stop, count);
11714
+
11715
+ if (step > 0) {
11716
+ start = Math.floor(start / step) * step;
11717
+ stop = Math.ceil(stop / step) * step;
11718
+ step = tickIncrement(start, stop, count);
11719
+ } else if (step < 0) {
11720
+ start = Math.ceil(start * step) / step;
11721
+ stop = Math.floor(stop * step) / step;
11722
+ step = tickIncrement(start, stop, count);
11723
+ }
11724
+
11725
+ if (step > 0) {
11726
+ d[i0] = Math.floor(start / step) * step;
11727
+ d[i1] = Math.ceil(stop / step) * step;
11728
+ domain(d);
11729
+ } else if (step < 0) {
11730
+ d[i0] = Math.ceil(start * step) / step;
11731
+ d[i1] = Math.floor(stop * step) / step;
11657
11732
  domain(d);
11658
11733
  }
11659
11734
 
@@ -13718,6 +13793,92 @@ var radialArea = function() {
13718
13793
  return a;
13719
13794
  };
13720
13795
 
13796
+ var slice$5 = Array.prototype.slice;
13797
+
13798
+ function linkSource(d) {
13799
+ return d.source;
13800
+ }
13801
+
13802
+ function linkTarget(d) {
13803
+ return d.target;
13804
+ }
13805
+
13806
+ function link$2(curve) {
13807
+ var source = linkSource,
13808
+ target = linkTarget,
13809
+ x$$1 = x$3,
13810
+ y$$1 = y$3,
13811
+ context = null;
13812
+
13813
+ function link() {
13814
+ var buffer, argv = slice$5.call(arguments), s = source.apply(this, argv), t = target.apply(this, argv);
13815
+ if (!context) context = buffer = path();
13816
+ curve(context, +x$$1.apply(this, (argv[0] = s, argv)), +y$$1.apply(this, argv), +x$$1.apply(this, (argv[0] = t, argv)), +y$$1.apply(this, argv));
13817
+ if (buffer) return context = null, buffer + "" || null;
13818
+ }
13819
+
13820
+ link.source = function(_) {
13821
+ return arguments.length ? (source = _, link) : source;
13822
+ };
13823
+
13824
+ link.target = function(_) {
13825
+ return arguments.length ? (target = _, link) : target;
13826
+ };
13827
+
13828
+ link.x = function(_) {
13829
+ return arguments.length ? (x$$1 = typeof _ === "function" ? _ : constant$10(+_), link) : x$$1;
13830
+ };
13831
+
13832
+ link.y = function(_) {
13833
+ return arguments.length ? (y$$1 = typeof _ === "function" ? _ : constant$10(+_), link) : y$$1;
13834
+ };
13835
+
13836
+ link.context = function(_) {
13837
+ return arguments.length ? ((context = _ == null ? null : _), link) : context;
13838
+ };
13839
+
13840
+ return link;
13841
+ }
13842
+
13843
+ function curveHorizontal(context, x0, y0, x1, y1) {
13844
+ context.moveTo(x0, y0);
13845
+ context.bezierCurveTo(x0 = (x0 + x1) / 2, y0, x0, y1, x1, y1);
13846
+ }
13847
+
13848
+ function curveVertical(context, x0, y0, x1, y1) {
13849
+ context.moveTo(x0, y0);
13850
+ context.bezierCurveTo(x0, y0 = (y0 + y1) / 2, x1, y0, x1, y1);
13851
+ }
13852
+
13853
+ function curveRadial$1(context, x0, y0, x1, y1) {
13854
+ var p0 = cartesian$1(x0, y0),
13855
+ p1 = cartesian$1(x0, y0 = (y0 + y1) / 2),
13856
+ p2 = cartesian$1(x1, y0),
13857
+ p3 = cartesian$1(x1, y1);
13858
+ context.moveTo(p0[0], p0[1]);
13859
+ context.bezierCurveTo(p1[0], p1[1], p2[0], p2[1], p3[0], p3[1]);
13860
+ }
13861
+
13862
+ function linkHorizontal() {
13863
+ return link$2(curveHorizontal);
13864
+ }
13865
+
13866
+ function linkVertical() {
13867
+ return link$2(curveVertical);
13868
+ }
13869
+
13870
+ function linkRadial() {
13871
+ var l = link$2(curveRadial$1);
13872
+ l.angle = l.x, delete l.x;
13873
+ l.radius = l.y, delete l.y;
13874
+ return l;
13875
+ }
13876
+
13877
+ function cartesian$1(x$$1, y$$1) {
13878
+ var angle = (x$$1 - 90) / 180 * Math.PI, radius = y$$1;
13879
+ return [radius * Math.cos(angle), radius * Math.sin(angle)];
13880
+ }
13881
+
13721
13882
  var circle$2 = {
13722
13883
  draw: function(context, size) {
13723
13884
  var r = Math.sqrt(size / pi$4);
@@ -14699,13 +14860,11 @@ function stepAfter(context) {
14699
14860
  return new Step(context, 1);
14700
14861
  }
14701
14862
 
14702
- var slice$5 = Array.prototype.slice;
14703
-
14704
14863
  var none$1 = function(series, order) {
14705
14864
  if (!((n = series.length) > 1)) return;
14706
- for (var i = 1, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {
14865
+ for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {
14707
14866
  s0 = s1, s1 = series[order[i]];
14708
- for (var j = 0; j < m; ++j) {
14867
+ for (j = 0; j < m; ++j) {
14709
14868
  s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];
14710
14869
  }
14711
14870
  }
@@ -14779,6 +14938,21 @@ var expand = function(series, order) {
14779
14938
  none$1(series, order);
14780
14939
  };
14781
14940
 
14941
+ var diverging = function(series, order) {
14942
+ if (!((n = series.length) > 1)) return;
14943
+ for (var i, j = 0, d, dy, yp, yn, n, m = series[order[0]].length; j < m; ++j) {
14944
+ for (yp = yn = 0, i = 0; i < n; ++i) {
14945
+ if ((dy = (d = series[order[i]][j])[1] - d[0]) >= 0) {
14946
+ d[0] = yp, d[1] = yp += dy;
14947
+ } else if (dy < 0) {
14948
+ d[1] = yn, d[0] = yn += dy;
14949
+ } else {
14950
+ d[0] = yp;
14951
+ }
14952
+ }
14953
+ }
14954
+ };
14955
+
14782
14956
  var silhouette = function(series, order) {
14783
14957
  if (!((n = series.length) > 0)) return;
14784
14958
  for (var j = 0, s0 = series[order[0]], n, m = s0.length; j < m; ++j) {
@@ -15952,7 +16126,8 @@ var zoom = function() {
15952
16126
  touchstarting,
15953
16127
  touchending,
15954
16128
  touchDelay = 500,
15955
- wheelDelay = 150;
16129
+ wheelDelay = 150,
16130
+ clickDistance2 = 0;
15956
16131
 
15957
16132
  function zoom(selection$$1) {
15958
16133
  selection$$1
@@ -16142,7 +16317,9 @@ var zoom = function() {
16142
16317
  if (touchending || !filter.apply(this, arguments)) return;
16143
16318
  var g = gesture(this, arguments),
16144
16319
  v = select(exports.event.view).on("mousemove.zoom", mousemoved, true).on("mouseup.zoom", mouseupped, true),
16145
- p = mouse(this);
16320
+ p = mouse(this),
16321
+ x0 = exports.event.clientX,
16322
+ y0 = exports.event.clientY;
16146
16323
 
16147
16324
  dragDisable(exports.event.view);
16148
16325
  nopropagation$2();
@@ -16152,7 +16329,10 @@ var zoom = function() {
16152
16329
 
16153
16330
  function mousemoved() {
16154
16331
  noevent$2();
16155
- g.moved = true;
16332
+ if (!g.moved) {
16333
+ var dx = exports.event.clientX - x0, dy = exports.event.clientY - y0;
16334
+ g.moved = dx * dx + dy * dy > clickDistance2;
16335
+ }
16156
16336
  g.zoom("mouse", constrain(translate(g.that.__zoom, g.mouse[0] = mouse(g.that), g.mouse[1]), g.extent));
16157
16337
  }
16158
16338
 
@@ -16284,6 +16464,10 @@ var zoom = function() {
16284
16464
  return value === listeners ? zoom : value;
16285
16465
  };
16286
16466
 
16467
+ zoom.clickDistance = function(_) {
16468
+ return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom) : Math.sqrt(clickDistance2);
16469
+ };
16470
+
16287
16471
  return zoom;
16288
16472
  };
16289
16473
 
@@ -16543,9 +16727,10 @@ exports.selectAll = selectAll;
16543
16727
  exports.selection = selection;
16544
16728
  exports.selector = selector;
16545
16729
  exports.selectorAll = selectorAll;
16730
+ exports.style = styleValue;
16546
16731
  exports.touch = touch;
16547
16732
  exports.touches = touches;
16548
- exports.window = window;
16733
+ exports.window = defaultView;
16549
16734
  exports.customEvent = customEvent;
16550
16735
  exports.arc = arc;
16551
16736
  exports.area = area$2;
@@ -16553,6 +16738,9 @@ exports.line = line;
16553
16738
  exports.pie = pie;
16554
16739
  exports.radialArea = radialArea;
16555
16740
  exports.radialLine = radialLine$1;
16741
+ exports.linkHorizontal = linkHorizontal;
16742
+ exports.linkVertical = linkVertical;
16743
+ exports.linkRadial = linkRadial;
16556
16744
  exports.symbol = symbol;
16557
16745
  exports.symbols = symbols;
16558
16746
  exports.symbolCircle = circle$2;
@@ -16582,6 +16770,7 @@ exports.curveStepAfter = stepAfter;
16582
16770
  exports.curveStepBefore = stepBefore;
16583
16771
  exports.stack = stack;
16584
16772
  exports.stackOffsetExpand = expand;
16773
+ exports.stackOffsetDiverging = diverging;
16585
16774
  exports.stackOffsetNone = none$1;
16586
16775
  exports.stackOffsetSilhouette = silhouette;
16587
16776
  exports.stackOffsetWiggle = wiggle;