d3-rails 4.2.6 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8975964fed10e8d6ad0f6f3a0fdd6365a7124b28
4
- data.tar.gz: 8480dced1f181b49042002ea87c5641b99ca1683
3
+ metadata.gz: 7c606e71e21f579f308d6ec0352e23956785c607
4
+ data.tar.gz: 55a7198780d1be5c0304c597d2eeec7209f96d27
5
5
  SHA512:
6
- metadata.gz: 1c550097cdac3018c0bdda6a35d0bab0b77800a5e5bdac872fe3819763ca07692401f7f1244275c52a72185567adfc88c13c0e3b8b938c731c7d124a0b5d7934
7
- data.tar.gz: 09b8a796d92ea87e0fe6e1c50a9b3aae33c41d4b874e9cadfe63e12b63fcfca1f87515a1fc907a1f68ee8b3dc983759c5c9744a2987e01cbd1705a775b699db3
6
+ metadata.gz: 12bca3f8efa94d23e9eaf4e824ac842b9621c5794e467f85dbb8bad53954da57954d9c2b4536ff6f7cee34727b822a4228e5cfec759926d1628ab041553f35a6
7
+ data.tar.gz: eb639f33789d788f45415b36d26cd4f8f89474db4b83d0938821aab1ce5f7464736e64b5423aec18c229ed0f2e7e213a365439b5d726dccd733dadefcc3d3e8b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 4.3.0 (28 October 2016)
2
+ * Upgrade D3 to 4.3.0
3
+
1
4
  ## 4.2.6 (26 September 2016)
2
5
  * Upgrade D3 to 4.2.6
3
6
 
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.2.6 of D3.js. The d3-rails version will
11
+ d3-rails comes with version 4.3.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,15 +1,15 @@
1
- // https://d3js.org Version 4.2.6. Copyright 2016 Mike Bostock.
1
+ // https://d3js.org Version 4.3.0. Copyright 2016 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.2.6";
8
+ var version = "4.3.0";
9
9
 
10
10
  var ascending = function(a, b) {
11
11
  return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
12
- }
12
+ };
13
13
 
14
14
  var bisector = function(compare) {
15
15
  if (compare.length === 1) compare = ascendingComparator(compare);
@@ -35,7 +35,7 @@ var bisector = function(compare) {
35
35
  return lo;
36
36
  }
37
37
  };
38
- }
38
+ };
39
39
 
40
40
  function ascendingComparator(f) {
41
41
  return function(d, x) {
@@ -49,11 +49,11 @@ var bisectLeft = ascendingBisect.left;
49
49
 
50
50
  var descending = function(a, b) {
51
51
  return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
52
- }
52
+ };
53
53
 
54
54
  var number = function(x) {
55
55
  return x === null ? NaN : +x;
56
- }
56
+ };
57
57
 
58
58
  var variance = function(array, f) {
59
59
  var n = array.length,
@@ -85,12 +85,12 @@ var variance = function(array, f) {
85
85
  }
86
86
 
87
87
  if (j > 1) return s / (j - 1);
88
- }
88
+ };
89
89
 
90
90
  var deviation = function(array, f) {
91
91
  var v = variance(array, f);
92
92
  return v ? Math.sqrt(v) : v;
93
- }
93
+ };
94
94
 
95
95
  var extent = function(array, f) {
96
96
  var i = -1,
@@ -116,7 +116,7 @@ var extent = function(array, f) {
116
116
  }
117
117
 
118
118
  return [a, c];
119
- }
119
+ };
120
120
 
121
121
  var array = Array.prototype;
122
122
 
@@ -127,11 +127,11 @@ var constant$1 = function(x) {
127
127
  return function() {
128
128
  return x;
129
129
  };
130
- }
130
+ };
131
131
 
132
132
  var identity = function(x) {
133
133
  return x;
134
- }
134
+ };
135
135
 
136
136
  var range = function(start, stop, step) {
137
137
  start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;
@@ -145,7 +145,7 @@ var range = function(start, stop, step) {
145
145
  }
146
146
 
147
147
  return range;
148
- }
148
+ };
149
149
 
150
150
  var e10 = Math.sqrt(50);
151
151
  var e5 = Math.sqrt(10);
@@ -158,7 +158,7 @@ var ticks = function(start, stop, count) {
158
158
  Math.floor(stop / step) * step + step / 2, // inclusive
159
159
  step
160
160
  );
161
- }
161
+ };
162
162
 
163
163
  function tickStep(start, stop, count) {
164
164
  var step0 = Math.abs(stop - start) / Math.max(0, count),
@@ -172,7 +172,7 @@ function tickStep(start, stop, count) {
172
172
 
173
173
  var sturges = function(values) {
174
174
  return Math.ceil(Math.log(values.length) / Math.LN2) + 1;
175
- }
175
+ };
176
176
 
177
177
  var histogram = function() {
178
178
  var value = identity,
@@ -236,7 +236,7 @@ var histogram = function() {
236
236
  };
237
237
 
238
238
  return histogram;
239
- }
239
+ };
240
240
 
241
241
  var threshold = function(array, p, f) {
242
242
  if (f == null) f = number;
@@ -249,16 +249,16 @@ var threshold = function(array, p, f) {
249
249
  a = +f(array[i], i, array),
250
250
  b = +f(array[i + 1], i + 1, array);
251
251
  return a + (b - a) * (h - i);
252
- }
252
+ };
253
253
 
254
254
  var freedmanDiaconis = function(values, min, max) {
255
255
  values = map.call(values, number).sort(ascending);
256
256
  return Math.ceil((max - min) / (2 * (threshold(values, 0.75) - threshold(values, 0.25)) * Math.pow(values.length, -1 / 3)));
257
- }
257
+ };
258
258
 
259
259
  var scott = function(values, min, max) {
260
260
  return Math.ceil((max - min) / (3.5 * deviation(values) * Math.pow(values.length, -1 / 3)));
261
- }
261
+ };
262
262
 
263
263
  var max = function(array, f) {
264
264
  var i = -1,
@@ -277,7 +277,7 @@ var max = function(array, f) {
277
277
  }
278
278
 
279
279
  return a;
280
- }
280
+ };
281
281
 
282
282
  var mean = function(array, f) {
283
283
  var s = 0,
@@ -295,7 +295,7 @@ var mean = function(array, f) {
295
295
  }
296
296
 
297
297
  if (j) return s / j;
298
- }
298
+ };
299
299
 
300
300
  var median = function(array, f) {
301
301
  var numbers = [],
@@ -312,7 +312,7 @@ var median = function(array, f) {
312
312
  }
313
313
 
314
314
  return threshold(numbers.sort(ascending), 0.5);
315
- }
315
+ };
316
316
 
317
317
  var merge = function(arrays) {
318
318
  var n = arrays.length,
@@ -334,7 +334,7 @@ var merge = function(arrays) {
334
334
  }
335
335
 
336
336
  return merged;
337
- }
337
+ };
338
338
 
339
339
  var min = function(array, f) {
340
340
  var i = -1,
@@ -353,19 +353,19 @@ var min = function(array, f) {
353
353
  }
354
354
 
355
355
  return a;
356
- }
356
+ };
357
357
 
358
358
  var pairs = function(array) {
359
359
  var i = 0, n = array.length - 1, p = array[0], pairs = new Array(n < 0 ? 0 : n);
360
360
  while (i < n) pairs[i] = [p, p = array[++i]];
361
361
  return pairs;
362
- }
362
+ };
363
363
 
364
364
  var permute = function(array, indexes) {
365
365
  var i = indexes.length, permutes = new Array(i);
366
366
  while (i--) permutes[i] = array[indexes[i]];
367
367
  return permutes;
368
- }
368
+ };
369
369
 
370
370
  var scan = function(array, compare) {
371
371
  if (!(n = array.length)) return;
@@ -380,7 +380,7 @@ var scan = function(array, compare) {
380
380
  while (++i < n) if (compare(xi = array[i], xj) < 0 || compare(xj, xj) !== 0) xj = xi, j = i;
381
381
 
382
382
  if (compare(xj, xj) === 0) return j;
383
- }
383
+ };
384
384
 
385
385
  var shuffle = function(array, i0, i1) {
386
386
  var m = (i1 == null ? array.length : i1) - (i0 = i0 == null ? 0 : +i0),
@@ -395,7 +395,7 @@ var shuffle = function(array, i0, i1) {
395
395
  }
396
396
 
397
397
  return array;
398
- }
398
+ };
399
399
 
400
400
  var sum = function(array, f) {
401
401
  var s = 0,
@@ -412,7 +412,7 @@ var sum = function(array, f) {
412
412
  }
413
413
 
414
414
  return s;
415
- }
415
+ };
416
416
 
417
417
  var transpose = function(matrix) {
418
418
  if (!(n = matrix.length)) return [];
@@ -422,7 +422,7 @@ var transpose = function(matrix) {
422
422
  }
423
423
  }
424
424
  return transpose;
425
- }
425
+ };
426
426
 
427
427
  function length(d) {
428
428
  return d.length;
@@ -430,7 +430,7 @@ function length(d) {
430
430
 
431
431
  var zip = function() {
432
432
  return transpose(arguments);
433
- }
433
+ };
434
434
 
435
435
  var prefix = "$";
436
436
 
@@ -560,7 +560,7 @@ var nest = function() {
560
560
  sortValues: function(order) { sortValues = order; return nest; },
561
561
  rollup: function(f) { rollup = f; return nest; }
562
562
  };
563
- }
563
+ };
564
564
 
565
565
  function createObject() {
566
566
  return {};
@@ -618,19 +618,19 @@ var keys = function(map) {
618
618
  var keys = [];
619
619
  for (var key in map) keys.push(key);
620
620
  return keys;
621
- }
621
+ };
622
622
 
623
623
  var values = function(map) {
624
624
  var values = [];
625
625
  for (var key in map) values.push(map[key]);
626
626
  return values;
627
- }
627
+ };
628
628
 
629
629
  var entries = function(map) {
630
630
  var entries = [];
631
631
  for (var key in map) entries.push({key: key, value: map[key]});
632
632
  return entries;
633
- }
633
+ };
634
634
 
635
635
  var uniform = function(min, max) {
636
636
  min = min == null ? 0 : +min;
@@ -640,7 +640,7 @@ var uniform = function(min, max) {
640
640
  return function() {
641
641
  return Math.random() * max + min;
642
642
  };
643
- }
643
+ };
644
644
 
645
645
  var normal = function(mu, sigma) {
646
646
  var x, r;
@@ -661,34 +661,34 @@ var normal = function(mu, sigma) {
661
661
 
662
662
  return mu + sigma * y * Math.sqrt(-2 * Math.log(r) / r);
663
663
  };
664
- }
664
+ };
665
665
 
666
666
  var logNormal = function() {
667
667
  var randomNormal = normal.apply(this, arguments);
668
668
  return function() {
669
669
  return Math.exp(randomNormal());
670
670
  };
671
- }
671
+ };
672
672
 
673
673
  var irwinHall = function(n) {
674
674
  return function() {
675
675
  for (var sum = 0, i = 0; i < n; ++i) sum += Math.random();
676
676
  return sum;
677
677
  };
678
- }
678
+ };
679
679
 
680
680
  var bates = function(n) {
681
681
  var randomIrwinHall = irwinHall(n);
682
682
  return function() {
683
683
  return randomIrwinHall() / n;
684
684
  };
685
- }
685
+ };
686
686
 
687
687
  var exponential = function(lambda) {
688
688
  return function() {
689
689
  return -Math.log(1 - Math.random()) / lambda;
690
690
  };
691
- }
691
+ };
692
692
 
693
693
  function linear(t) {
694
694
  return +t;
@@ -915,7 +915,7 @@ var area = function(polygon) {
915
915
  }
916
916
 
917
917
  return area / 2;
918
- }
918
+ };
919
919
 
920
920
  var centroid = function(polygon) {
921
921
  var i = -1,
@@ -936,7 +936,7 @@ var centroid = function(polygon) {
936
936
  }
937
937
 
938
938
  return k *= 3, [x / k, y / k];
939
- }
939
+ };
940
940
 
941
941
  // Returns the 2D cross product of AB and AC vectors, i.e., the z-component of
942
942
  // the 3D cross product in a quadrant I Cartesian coordinate system (+x is
@@ -944,7 +944,7 @@ var centroid = function(polygon) {
944
944
  // negative if clockwise, and zero if the points are collinear.
945
945
  var cross = function(a, b, c) {
946
946
  return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]);
947
- }
947
+ };
948
948
 
949
949
  function lexicographicOrder(a, b) {
950
950
  return a[0] - b[0] || a[1] - b[1];
@@ -992,7 +992,7 @@ var hull = function(points) {
992
992
  for (i = +skipLeft; i < lowerIndexes.length - skipRight; ++i) hull.push(points[sortedPoints[lowerIndexes[i]][2]]);
993
993
 
994
994
  return hull;
995
- }
995
+ };
996
996
 
997
997
  var contains = function(polygon, point) {
998
998
  var n = polygon.length,
@@ -1009,7 +1009,7 @@ var contains = function(polygon, point) {
1009
1009
  }
1010
1010
 
1011
1011
  return inside;
1012
- }
1012
+ };
1013
1013
 
1014
1014
  var length$1 = function(polygon) {
1015
1015
  var i = -1,
@@ -1033,7 +1033,7 @@ var length$1 = function(polygon) {
1033
1033
  }
1034
1034
 
1035
1035
  return perimeter;
1036
- }
1036
+ };
1037
1037
 
1038
1038
  var pi$1 = Math.PI;
1039
1039
  var tau$1 = 2 * pi$1;
@@ -1183,7 +1183,7 @@ var tree_add = function(d) {
1183
1183
  var x = +this._x.call(null, d),
1184
1184
  y = +this._y.call(null, d);
1185
1185
  return add(this.cover(x, y), x, y, d);
1186
- }
1186
+ };
1187
1187
 
1188
1188
  function add(tree, x, y, d) {
1189
1189
  if (isNaN(x) || isNaN(y)) return tree; // ignore invalid points
@@ -1322,7 +1322,7 @@ var tree_cover = function(x, y) {
1322
1322
  this._x1 = x1;
1323
1323
  this._y1 = y1;
1324
1324
  return this;
1325
- }
1325
+ };
1326
1326
 
1327
1327
  var tree_data = function() {
1328
1328
  var data = [];
@@ -1330,13 +1330,13 @@ var tree_data = function() {
1330
1330
  if (!node.length) do data.push(node.data); while (node = node.next)
1331
1331
  });
1332
1332
  return data;
1333
- }
1333
+ };
1334
1334
 
1335
1335
  var tree_extent = function(_) {
1336
1336
  return arguments.length
1337
1337
  ? this.cover(+_[0][0], +_[0][1]).cover(+_[1][0], +_[1][1])
1338
1338
  : isNaN(this._x0) ? undefined : [[this._x0, this._y0], [this._x1, this._y1]];
1339
- }
1339
+ };
1340
1340
 
1341
1341
  var Quad = function(node, x0, y0, x1, y1) {
1342
1342
  this.node = node;
@@ -1344,7 +1344,7 @@ var Quad = function(node, x0, y0, x1, y1) {
1344
1344
  this.y0 = y0;
1345
1345
  this.x1 = x1;
1346
1346
  this.y1 = y1;
1347
- }
1347
+ };
1348
1348
 
1349
1349
  var tree_find = function(x, y, radius) {
1350
1350
  var data,
@@ -1413,7 +1413,7 @@ var tree_find = function(x, y, radius) {
1413
1413
  }
1414
1414
 
1415
1415
  return data;
1416
- }
1416
+ };
1417
1417
 
1418
1418
  var tree_remove = function(d) {
1419
1419
  if (isNaN(x = +this._x.call(null, d)) || isNaN(y = +this._y.call(null, d))) return this; // ignore invalid points
@@ -1471,7 +1471,7 @@ var tree_remove = function(d) {
1471
1471
  }
1472
1472
 
1473
1473
  return this;
1474
- }
1474
+ };
1475
1475
 
1476
1476
  function removeAll(data) {
1477
1477
  for (var i = 0, n = data.length; i < n; ++i) this.remove(data[i]);
@@ -1480,7 +1480,7 @@ function removeAll(data) {
1480
1480
 
1481
1481
  var tree_root = function() {
1482
1482
  return this._root;
1483
- }
1483
+ };
1484
1484
 
1485
1485
  var tree_size = function() {
1486
1486
  var size = 0;
@@ -1488,7 +1488,7 @@ var tree_size = function() {
1488
1488
  if (!node.length) do ++size; while (node = node.next)
1489
1489
  });
1490
1490
  return size;
1491
- }
1491
+ };
1492
1492
 
1493
1493
  var tree_visit = function(callback) {
1494
1494
  var quads = [], q, node = this._root, child, x0, y0, x1, y1;
@@ -1503,7 +1503,7 @@ var tree_visit = function(callback) {
1503
1503
  }
1504
1504
  }
1505
1505
  return this;
1506
- }
1506
+ };
1507
1507
 
1508
1508
  var tree_visitAfter = function(callback) {
1509
1509
  var quads = [], next = [], q;
@@ -1523,7 +1523,7 @@ var tree_visitAfter = function(callback) {
1523
1523
  callback(q.node, q.x0, q.y0, q.x1, q.y1);
1524
1524
  }
1525
1525
  return this;
1526
- }
1526
+ };
1527
1527
 
1528
1528
  function defaultX(d) {
1529
1529
  return d[0];
@@ -1531,7 +1531,7 @@ function defaultX(d) {
1531
1531
 
1532
1532
  var tree_x = function(_) {
1533
1533
  return arguments.length ? (this._x = _, this) : this._x;
1534
- }
1534
+ };
1535
1535
 
1536
1536
  function defaultY(d) {
1537
1537
  return d[1];
@@ -1539,7 +1539,7 @@ function defaultY(d) {
1539
1539
 
1540
1540
  var tree_y = function(_) {
1541
1541
  return arguments.length ? (this._y = _, this) : this._y;
1542
- }
1542
+ };
1543
1543
 
1544
1544
  function quadtree(nodes, x, y) {
1545
1545
  var tree = new Quadtree(x == null ? defaultX : x, y == null ? defaultY : y, NaN, NaN, NaN, NaN);
@@ -1724,7 +1724,7 @@ var constant$2 = function(x) {
1724
1724
  return function constant() {
1725
1725
  return x;
1726
1726
  };
1727
- }
1727
+ };
1728
1728
 
1729
1729
  var epsilon$1 = 1e-12;
1730
1730
  var pi$2 = Math.PI;
@@ -1989,7 +1989,7 @@ var arc = function() {
1989
1989
  };
1990
1990
 
1991
1991
  return arc;
1992
- }
1992
+ };
1993
1993
 
1994
1994
  function Linear(context) {
1995
1995
  this._context = context;
@@ -2021,7 +2021,7 @@ Linear.prototype = {
2021
2021
 
2022
2022
  var curveLinear = function(context) {
2023
2023
  return new Linear(context);
2024
- }
2024
+ };
2025
2025
 
2026
2026
  function x(p) {
2027
2027
  return p[0];
@@ -2080,7 +2080,7 @@ var line = function() {
2080
2080
  };
2081
2081
 
2082
2082
  return line;
2083
- }
2083
+ };
2084
2084
 
2085
2085
  var area$1 = function() {
2086
2086
  var x0 = x,
@@ -2184,15 +2184,15 @@ var area$1 = function() {
2184
2184
  };
2185
2185
 
2186
2186
  return area;
2187
- }
2187
+ };
2188
2188
 
2189
2189
  var descending$1 = function(a, b) {
2190
2190
  return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
2191
- }
2191
+ };
2192
2192
 
2193
2193
  var identity$1 = function(d) {
2194
2194
  return d;
2195
- }
2195
+ };
2196
2196
 
2197
2197
  var pie = function() {
2198
2198
  var value = identity$1,
@@ -2267,7 +2267,7 @@ var pie = function() {
2267
2267
  };
2268
2268
 
2269
2269
  return pie;
2270
- }
2270
+ };
2271
2271
 
2272
2272
  var curveRadialLinear = curveRadial(curveLinear);
2273
2273
 
@@ -2319,7 +2319,7 @@ function radialLine(l) {
2319
2319
 
2320
2320
  var radialLine$1 = function() {
2321
2321
  return radialLine(line().curve(curveRadialLinear));
2322
- }
2322
+ };
2323
2323
 
2324
2324
  var radialArea = function() {
2325
2325
  var a = area$1().curve(curveRadialLinear),
@@ -2345,7 +2345,7 @@ var radialArea = function() {
2345
2345
  };
2346
2346
 
2347
2347
  return a;
2348
- }
2348
+ };
2349
2349
 
2350
2350
  var circle = {
2351
2351
  draw: function(context, size) {
@@ -2494,9 +2494,9 @@ var symbol = function() {
2494
2494
  };
2495
2495
 
2496
2496
  return symbol;
2497
- }
2497
+ };
2498
2498
 
2499
- var noop = function() {}
2499
+ var noop = function() {};
2500
2500
 
2501
2501
  function point(that, x, y) {
2502
2502
  that._context.bezierCurveTo(
@@ -2548,7 +2548,7 @@ Basis.prototype = {
2548
2548
 
2549
2549
  var basis = function(context) {
2550
2550
  return new Basis(context);
2551
- }
2551
+ };
2552
2552
 
2553
2553
  function BasisClosed(context) {
2554
2554
  this._context = context;
@@ -2598,7 +2598,7 @@ BasisClosed.prototype = {
2598
2598
 
2599
2599
  var basisClosed = function(context) {
2600
2600
  return new BasisClosed(context);
2601
- }
2601
+ };
2602
2602
 
2603
2603
  function BasisOpen(context) {
2604
2604
  this._context = context;
@@ -2636,7 +2636,7 @@ BasisOpen.prototype = {
2636
2636
 
2637
2637
  var basisOpen = function(context) {
2638
2638
  return new BasisOpen(context);
2639
- }
2639
+ };
2640
2640
 
2641
2641
  function Bundle(context, beta) {
2642
2642
  this._basis = new Basis(context);
@@ -3101,7 +3101,7 @@ LinearClosed.prototype = {
3101
3101
 
3102
3102
  var linearClosed = function(context) {
3103
3103
  return new LinearClosed(context);
3104
- }
3104
+ };
3105
3105
 
3106
3106
  function sign(x) {
3107
3107
  return x < 0 ? -1 : 1;
@@ -3179,7 +3179,7 @@ MonotoneX.prototype = {
3179
3179
  this._y0 = this._y1, this._y1 = y;
3180
3180
  this._t0 = t1;
3181
3181
  }
3182
- }
3182
+ };
3183
3183
 
3184
3184
  function MonotoneY(context) {
3185
3185
  this._context = new ReflectContext(context);
@@ -3272,7 +3272,7 @@ function controlPoints(x) {
3272
3272
 
3273
3273
  var natural = function(context) {
3274
3274
  return new Natural(context);
3275
- }
3275
+ };
3276
3276
 
3277
3277
  function Step(context, t) {
3278
3278
  this._context = context;
@@ -3318,7 +3318,7 @@ Step.prototype = {
3318
3318
 
3319
3319
  var step = function(context) {
3320
3320
  return new Step(context, 0.5);
3321
- }
3321
+ };
3322
3322
 
3323
3323
  function stepBefore(context) {
3324
3324
  return new Step(context, 0);
@@ -3338,13 +3338,13 @@ var none = function(series, order) {
3338
3338
  s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];
3339
3339
  }
3340
3340
  }
3341
- }
3341
+ };
3342
3342
 
3343
3343
  var none$1 = function(series) {
3344
3344
  var n = series.length, o = new Array(n);
3345
3345
  while (--n >= 0) o[n] = n;
3346
3346
  return o;
3347
- }
3347
+ };
3348
3348
 
3349
3349
  function stackValue(d, key) {
3350
3350
  return d[key];
@@ -3397,7 +3397,7 @@ var stack = function() {
3397
3397
  };
3398
3398
 
3399
3399
  return stack;
3400
- }
3400
+ };
3401
3401
 
3402
3402
  var expand = function(series, order) {
3403
3403
  if (!((n = series.length) > 0)) return;
@@ -3406,7 +3406,7 @@ var expand = function(series, order) {
3406
3406
  if (y) for (i = 0; i < n; ++i) series[i][j][1] /= y;
3407
3407
  }
3408
3408
  none(series, order);
3409
- }
3409
+ };
3410
3410
 
3411
3411
  var silhouette = function(series, order) {
3412
3412
  if (!((n = series.length) > 0)) return;
@@ -3415,7 +3415,7 @@ var silhouette = function(series, order) {
3415
3415
  s0[j][1] += s0[j][0] = -y / 2;
3416
3416
  }
3417
3417
  none(series, order);
3418
- }
3418
+ };
3419
3419
 
3420
3420
  var wiggle = function(series, order) {
3421
3421
  if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return;
@@ -3438,12 +3438,12 @@ var wiggle = function(series, order) {
3438
3438
  }
3439
3439
  s0[j - 1][1] += s0[j - 1][0] = y;
3440
3440
  none(series, order);
3441
- }
3441
+ };
3442
3442
 
3443
3443
  var ascending$1 = function(series) {
3444
3444
  var sums = series.map(sum$1);
3445
3445
  return none$1(series).sort(function(a, b) { return sums[a] - sums[b]; });
3446
- }
3446
+ };
3447
3447
 
3448
3448
  function sum$1(series) {
3449
3449
  var s = 0, i = -1, n = series.length, v;
@@ -3453,7 +3453,7 @@ function sum$1(series) {
3453
3453
 
3454
3454
  var descending$2 = function(series) {
3455
3455
  return ascending$1(series).reverse();
3456
- }
3456
+ };
3457
3457
 
3458
3458
  var insideOut = function(series) {
3459
3459
  var n = series.length,
@@ -3478,16 +3478,16 @@ var insideOut = function(series) {
3478
3478
  }
3479
3479
 
3480
3480
  return bottoms.reverse().concat(tops);
3481
- }
3481
+ };
3482
3482
 
3483
3483
  var reverse = function(series) {
3484
3484
  return none$1(series).reverse();
3485
- }
3485
+ };
3486
3486
 
3487
3487
  var define = function(constructor, factory, prototype) {
3488
3488
  constructor.prototype = factory.prototype = prototype;
3489
3489
  prototype.constructor = constructor;
3490
- }
3490
+ };
3491
3491
 
3492
3492
  function extend(parent, definition) {
3493
3493
  var prototype = Object.create(parent.prototype);
@@ -4005,7 +4005,7 @@ var basis$2 = function(values) {
4005
4005
  v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;
4006
4006
  return basis$1((t - i / n) * n, v0, v1, v2, v3);
4007
4007
  };
4008
- }
4008
+ };
4009
4009
 
4010
4010
  var basisClosed$1 = function(values) {
4011
4011
  var n = values.length;
@@ -4017,13 +4017,13 @@ var basisClosed$1 = function(values) {
4017
4017
  v3 = values[(i + 2) % n];
4018
4018
  return basis$1((t - i / n) * n, v0, v1, v2, v3);
4019
4019
  };
4020
- }
4020
+ };
4021
4021
 
4022
4022
  var constant$3 = function(x) {
4023
4023
  return function() {
4024
4024
  return x;
4025
4025
  };
4026
- }
4026
+ };
4027
4027
 
4028
4028
  function linear$1(a, d) {
4029
4029
  return function(t) {
@@ -4118,20 +4118,20 @@ var array$1 = function(a, b) {
4118
4118
  for (i = 0; i < na; ++i) c[i] = x[i](t);
4119
4119
  return c;
4120
4120
  };
4121
- }
4121
+ };
4122
4122
 
4123
4123
  var date = function(a, b) {
4124
4124
  var d = new Date;
4125
4125
  return a = +a, b -= a, function(t) {
4126
4126
  return d.setTime(a + b * t), d;
4127
4127
  };
4128
- }
4128
+ };
4129
4129
 
4130
4130
  var interpolateNumber = function(a, b) {
4131
4131
  return a = +a, b -= a, function(t) {
4132
4132
  return a + b * t;
4133
4133
  };
4134
- }
4134
+ };
4135
4135
 
4136
4136
  var object = function(a, b) {
4137
4137
  var i = {},
@@ -4153,7 +4153,7 @@ var object = function(a, b) {
4153
4153
  for (k in i) c[k] = i[k](t);
4154
4154
  return c;
4155
4155
  };
4156
- }
4156
+ };
4157
4157
 
4158
4158
  var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;
4159
4159
  var reB = new RegExp(reA.source, "g");
@@ -4216,7 +4216,7 @@ var interpolateString = function(a, b) {
4216
4216
  for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);
4217
4217
  return s.join("");
4218
4218
  });
4219
- }
4219
+ };
4220
4220
 
4221
4221
  var interpolate = function(a, b) {
4222
4222
  var t = typeof b, c;
@@ -4228,13 +4228,13 @@ var interpolate = function(a, b) {
4228
4228
  : Array.isArray(b) ? array$1
4229
4229
  : isNaN(b) ? object
4230
4230
  : interpolateNumber)(a, b);
4231
- }
4231
+ };
4232
4232
 
4233
4233
  var interpolateRound = function(a, b) {
4234
4234
  return a = +a, b -= a, function(t) {
4235
4235
  return Math.round(a + b * t);
4236
4236
  };
4237
- }
4237
+ };
4238
4238
 
4239
4239
  var degrees = 180 / Math.PI;
4240
4240
 
@@ -4261,7 +4261,7 @@ var decompose = function(a, b, c, d, e, f) {
4261
4261
  scaleX: scaleX,
4262
4262
  scaleY: scaleY
4263
4263
  };
4264
- }
4264
+ };
4265
4265
 
4266
4266
  var cssNode;
4267
4267
  var cssRoot;
@@ -4385,7 +4385,7 @@ var interpolateZoom = function(p0, p1) {
4385
4385
  uy0 + t * dy,
4386
4386
  w0 * Math.exp(rho * t * S)
4387
4387
  ];
4388
- }
4388
+ };
4389
4389
  }
4390
4390
 
4391
4391
  // General case.
@@ -4405,13 +4405,13 @@ var interpolateZoom = function(p0, p1) {
4405
4405
  uy0 + u * dy,
4406
4406
  w0 * coshr0 / cosh(rho * s + r0)
4407
4407
  ];
4408
- }
4408
+ };
4409
4409
  }
4410
4410
 
4411
4411
  i.duration = S * 1000;
4412
4412
 
4413
4413
  return i;
4414
- }
4414
+ };
4415
4415
 
4416
4416
  function hsl$1(hue$$1) {
4417
4417
  return function(start, end) {
@@ -4496,7 +4496,7 @@ var quantize = function(interpolator, n) {
4496
4496
  var samples = new Array(n);
4497
4497
  for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));
4498
4498
  return samples;
4499
- }
4499
+ };
4500
4500
 
4501
4501
  var noop$1 = {value: function() {}};
4502
4502
 
@@ -4714,7 +4714,7 @@ var dsv = function(delimiter) {
4714
4714
  format: format,
4715
4715
  formatRows: formatRows
4716
4716
  };
4717
- }
4717
+ };
4718
4718
 
4719
4719
  var csv = dsv(",");
4720
4720
 
@@ -4864,7 +4864,7 @@ var request = function(url, callback) {
4864
4864
  }
4865
4865
 
4866
4866
  return request;
4867
- }
4867
+ };
4868
4868
 
4869
4869
  function fixCallback(callback) {
4870
4870
  return function(error, xhr) {
@@ -4888,7 +4888,7 @@ var type = function(defaultMimeType, response) {
4888
4888
  }
4889
4889
  return r;
4890
4890
  };
4891
- }
4891
+ };
4892
4892
 
4893
4893
  var html = type("text/html", function(xhr) {
4894
4894
  return document.createRange().createContextualFragment(xhr.responseText);
@@ -4916,7 +4916,7 @@ var dsv$1 = function(defaultMimeType, parse) {
4916
4916
  r.row(row);
4917
4917
  return callback ? r.get(callback) : r;
4918
4918
  };
4919
- }
4919
+ };
4920
4920
 
4921
4921
  function responseOf(parse, row) {
4922
4922
  return function(request$$1) {
@@ -5047,7 +5047,7 @@ var timeout$1 = function(callback, delay, time) {
5047
5047
  callback(elapsed + delay);
5048
5048
  }, delay, time);
5049
5049
  return t;
5050
- }
5050
+ };
5051
5051
 
5052
5052
  var interval$1 = function(callback, delay, time) {
5053
5053
  var t = new Timer, total = delay;
@@ -5059,7 +5059,7 @@ var interval$1 = function(callback, delay, time) {
5059
5059
  callback(elapsed);
5060
5060
  }, delay, time);
5061
5061
  return t;
5062
- }
5062
+ };
5063
5063
 
5064
5064
  var t0$1 = new Date;
5065
5065
  var t1$1 = new Date;
@@ -5380,11 +5380,11 @@ var formatDecimal = function(x, p) {
5380
5380
  coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
5381
5381
  +x.slice(i + 1)
5382
5382
  ];
5383
- }
5383
+ };
5384
5384
 
5385
5385
  var exponent$1 = function(x) {
5386
5386
  return x = formatDecimal(Math.abs(x)), x ? x[1] : NaN;
5387
- }
5387
+ };
5388
5388
 
5389
5389
  var formatGroup = function(grouping, thousands) {
5390
5390
  return function(value, width) {
@@ -5403,7 +5403,7 @@ var formatGroup = function(grouping, thousands) {
5403
5403
 
5404
5404
  return t.reverse().join(thousands);
5405
5405
  };
5406
- }
5406
+ };
5407
5407
 
5408
5408
  var formatDefault = function(x, p) {
5409
5409
  x = x.toPrecision(p);
@@ -5418,7 +5418,7 @@ var formatDefault = function(x, p) {
5418
5418
  }
5419
5419
 
5420
5420
  return i0 > 0 ? x.slice(0, i0) + x.slice(i1 + 1) : x;
5421
- }
5421
+ };
5422
5422
 
5423
5423
  var prefixExponent;
5424
5424
 
@@ -5433,7 +5433,7 @@ var formatPrefixAuto = function(x, p) {
5433
5433
  : i > n ? coefficient + new Array(i - n + 1).join("0")
5434
5434
  : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i)
5435
5435
  : "0." + new Array(1 - i).join("0") + formatDecimal(x, Math.max(0, p + i - 1))[0]; // less than 1y!
5436
- }
5436
+ };
5437
5437
 
5438
5438
  var formatRounded = function(x, p) {
5439
5439
  var d = formatDecimal(x, p);
@@ -5443,7 +5443,7 @@ var formatRounded = function(x, p) {
5443
5443
  return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient
5444
5444
  : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1)
5445
5445
  : coefficient + new Array(exponent - coefficient.length + 2).join("0");
5446
- }
5446
+ };
5447
5447
 
5448
5448
  var formatTypes = {
5449
5449
  "": formatDefault,
@@ -5467,7 +5467,7 @@ var re = /^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i
5467
5467
 
5468
5468
  var formatSpecifier = function(specifier) {
5469
5469
  return new FormatSpecifier(specifier);
5470
- }
5470
+ };
5471
5471
 
5472
5472
  function FormatSpecifier(specifier) {
5473
5473
  if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier);
@@ -5649,7 +5649,7 @@ var formatLocale = function(locale) {
5649
5649
  format: newFormat,
5650
5650
  formatPrefix: formatPrefix
5651
5651
  };
5652
- }
5652
+ };
5653
5653
 
5654
5654
  var locale$1;
5655
5655
 
@@ -5671,16 +5671,16 @@ function defaultLocale(definition) {
5671
5671
 
5672
5672
  var precisionFixed = function(step) {
5673
5673
  return Math.max(0, -exponent$1(Math.abs(step)));
5674
- }
5674
+ };
5675
5675
 
5676
5676
  var precisionPrefix = function(step, value) {
5677
5677
  return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent$1(value) / 3))) * 3 - exponent$1(Math.abs(step)));
5678
- }
5678
+ };
5679
5679
 
5680
5680
  var precisionRound = function(step, max) {
5681
5681
  step = Math.abs(step), max = Math.abs(max) - step;
5682
5682
  return Math.max(0, exponent$1(max) - exponent$1(step)) + 1;
5683
- }
5683
+ };
5684
5684
 
5685
5685
  function localDate(d) {
5686
5686
  if (0 <= d.y && d.y < 100) {
@@ -6407,11 +6407,11 @@ var constant$4 = function(x) {
6407
6407
  return function() {
6408
6408
  return x;
6409
6409
  };
6410
- }
6410
+ };
6411
6411
 
6412
6412
  var number$1 = function(x) {
6413
6413
  return +x;
6414
- }
6414
+ };
6415
6415
 
6416
6416
  var unit = [0, 1];
6417
6417
 
@@ -6548,7 +6548,7 @@ var tickFormat = function(domain, count, specifier) {
6548
6548
  }
6549
6549
  }
6550
6550
  return exports.format(specifier);
6551
- }
6551
+ };
6552
6552
 
6553
6553
  function linearish(scale) {
6554
6554
  var domain = scale.domain;
@@ -6630,7 +6630,7 @@ var nice = function(domain, interval) {
6630
6630
  domain[i0] = interval.floor(x0);
6631
6631
  domain[i1] = interval.ceil(x1);
6632
6632
  return domain;
6633
- }
6633
+ };
6634
6634
 
6635
6635
  function deinterpolate(a, b) {
6636
6636
  return (b = Math.log(b / a))
@@ -7039,17 +7039,17 @@ function calendar(year$$1, month$$1, week, day$$1, hour$$1, minute$$1, second$$1
7039
7039
 
7040
7040
  var time = function() {
7041
7041
  return calendar(year, month, sunday, day, hour, minute, second, millisecond, exports.timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]);
7042
- }
7042
+ };
7043
7043
 
7044
7044
  var utcTime = function() {
7045
7045
  return calendar(utcYear, utcMonth, utcSunday, utcDay, utcHour, utcMinute, second, millisecond, exports.utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]);
7046
- }
7046
+ };
7047
7047
 
7048
7048
  var colors = function(s) {
7049
7049
  return s.match(/.{6}/g).map(function(x) {
7050
7050
  return "#" + x;
7051
7051
  });
7052
- }
7052
+ };
7053
7053
 
7054
7054
  var category10 = colors("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");
7055
7055
 
@@ -7074,7 +7074,7 @@ var rainbow$1 = function(t) {
7074
7074
  rainbow.s = 1.5 - 1.5 * ts;
7075
7075
  rainbow.l = 0.8 - 0.9 * ts;
7076
7076
  return rainbow + "";
7077
- }
7077
+ };
7078
7078
 
7079
7079
  function ramp(range) {
7080
7080
  var n = range.length;
@@ -7134,7 +7134,7 @@ var namespace = function(name) {
7134
7134
  var prefix = name += "", i = prefix.indexOf(":");
7135
7135
  if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1);
7136
7136
  return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name;
7137
- }
7137
+ };
7138
7138
 
7139
7139
  function creatorInherit(name) {
7140
7140
  return function() {
@@ -7157,7 +7157,7 @@ var creator = function(name) {
7157
7157
  return (fullname.local
7158
7158
  ? creatorFixed
7159
7159
  : creatorInherit)(fullname);
7160
- }
7160
+ };
7161
7161
 
7162
7162
  var nextId = 0;
7163
7163
 
@@ -7305,7 +7305,7 @@ var selection_on = function(typename, value, capture) {
7305
7305
  if (capture == null) capture = false;
7306
7306
  for (i = 0; i < n; ++i) this.each(on(typenames[i], value, capture));
7307
7307
  return this;
7308
- }
7308
+ };
7309
7309
 
7310
7310
  function customEvent(event1, listener, that, args) {
7311
7311
  var event0 = exports.event;
@@ -7322,7 +7322,7 @@ var sourceEvent = function() {
7322
7322
  var current = exports.event, source;
7323
7323
  while (source = current.sourceEvent) current = source;
7324
7324
  return current;
7325
- }
7325
+ };
7326
7326
 
7327
7327
  var point$5 = function(node, event) {
7328
7328
  var svg = node.ownerSVGElement || node;
@@ -7336,13 +7336,13 @@ var point$5 = function(node, event) {
7336
7336
 
7337
7337
  var rect = node.getBoundingClientRect();
7338
7338
  return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];
7339
- }
7339
+ };
7340
7340
 
7341
7341
  var mouse = function(node) {
7342
7342
  var event = sourceEvent();
7343
7343
  if (event.changedTouches) event = event.changedTouches[0];
7344
7344
  return point$5(node, event);
7345
- }
7345
+ };
7346
7346
 
7347
7347
  function none$2() {}
7348
7348
 
@@ -7350,7 +7350,7 @@ var selector = function(selector) {
7350
7350
  return selector == null ? none$2 : function() {
7351
7351
  return this.querySelector(selector);
7352
7352
  };
7353
- }
7353
+ };
7354
7354
 
7355
7355
  var selection_select = function(select) {
7356
7356
  if (typeof select !== "function") select = selector(select);
@@ -7365,7 +7365,7 @@ var selection_select = function(select) {
7365
7365
  }
7366
7366
 
7367
7367
  return new Selection(subgroups, this._parents);
7368
- }
7368
+ };
7369
7369
 
7370
7370
  function empty() {
7371
7371
  return [];
@@ -7375,7 +7375,7 @@ var selectorAll = function(selector) {
7375
7375
  return selector == null ? empty : function() {
7376
7376
  return this.querySelectorAll(selector);
7377
7377
  };
7378
- }
7378
+ };
7379
7379
 
7380
7380
  var selection_selectAll = function(select) {
7381
7381
  if (typeof select !== "function") select = selectorAll(select);
@@ -7390,7 +7390,7 @@ var selection_selectAll = function(select) {
7390
7390
  }
7391
7391
 
7392
7392
  return new Selection(subgroups, parents);
7393
- }
7393
+ };
7394
7394
 
7395
7395
  var selection_filter = function(match) {
7396
7396
  if (typeof match !== "function") match = matcher$1(match);
@@ -7404,15 +7404,15 @@ var selection_filter = function(match) {
7404
7404
  }
7405
7405
 
7406
7406
  return new Selection(subgroups, this._parents);
7407
- }
7407
+ };
7408
7408
 
7409
7409
  var sparse = function(update) {
7410
7410
  return new Array(update.length);
7411
- }
7411
+ };
7412
7412
 
7413
7413
  var selection_enter = function() {
7414
7414
  return new Selection(this._enter || this._groups.map(sparse), this._parents);
7415
- }
7415
+ };
7416
7416
 
7417
7417
  function EnterNode(parent, datum) {
7418
7418
  this.ownerDocument = parent.ownerDocument;
@@ -7434,7 +7434,7 @@ var constant$5 = function(x) {
7434
7434
  return function() {
7435
7435
  return x;
7436
7436
  };
7437
- }
7437
+ };
7438
7438
 
7439
7439
  var keyPrefix = "$"; // Protect against keys like “__proto__”.
7440
7440
 
@@ -7549,11 +7549,11 @@ var selection_data = function(value, key) {
7549
7549
  update._enter = enter;
7550
7550
  update._exit = exit;
7551
7551
  return update;
7552
- }
7552
+ };
7553
7553
 
7554
7554
  var selection_exit = function() {
7555
7555
  return new Selection(this._exit || this._groups.map(sparse), this._parents);
7556
- }
7556
+ };
7557
7557
 
7558
7558
  var selection_merge = function(selection) {
7559
7559
 
@@ -7570,7 +7570,7 @@ var selection_merge = function(selection) {
7570
7570
  }
7571
7571
 
7572
7572
  return new Selection(merges, this._parents);
7573
- }
7573
+ };
7574
7574
 
7575
7575
  var selection_order = function() {
7576
7576
 
@@ -7584,7 +7584,7 @@ var selection_order = function() {
7584
7584
  }
7585
7585
 
7586
7586
  return this;
7587
- }
7587
+ };
7588
7588
 
7589
7589
  var selection_sort = function(compare) {
7590
7590
  if (!compare) compare = ascending$2;
@@ -7603,7 +7603,7 @@ var selection_sort = function(compare) {
7603
7603
  }
7604
7604
 
7605
7605
  return new Selection(sortgroups, this._parents).order();
7606
- }
7606
+ };
7607
7607
 
7608
7608
  function ascending$2(a, b) {
7609
7609
  return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
@@ -7614,13 +7614,13 @@ var selection_call = function() {
7614
7614
  arguments[0] = this;
7615
7615
  callback.apply(null, arguments);
7616
7616
  return this;
7617
- }
7617
+ };
7618
7618
 
7619
7619
  var selection_nodes = function() {
7620
7620
  var nodes = new Array(this.size()), i = -1;
7621
7621
  this.each(function() { nodes[++i] = this; });
7622
7622
  return nodes;
7623
- }
7623
+ };
7624
7624
 
7625
7625
  var selection_node = function() {
7626
7626
 
@@ -7632,17 +7632,17 @@ var selection_node = function() {
7632
7632
  }
7633
7633
 
7634
7634
  return null;
7635
- }
7635
+ };
7636
7636
 
7637
7637
  var selection_size = function() {
7638
7638
  var size = 0;
7639
7639
  this.each(function() { ++size; });
7640
7640
  return size;
7641
- }
7641
+ };
7642
7642
 
7643
7643
  var selection_empty = function() {
7644
7644
  return !this.node();
7645
- }
7645
+ };
7646
7646
 
7647
7647
  var selection_each = function(callback) {
7648
7648
 
@@ -7653,7 +7653,7 @@ var selection_each = function(callback) {
7653
7653
  }
7654
7654
 
7655
7655
  return this;
7656
- }
7656
+ };
7657
7657
 
7658
7658
  function attrRemove(name) {
7659
7659
  return function() {
@@ -7709,13 +7709,13 @@ var selection_attr = function(name, value) {
7709
7709
  ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === "function"
7710
7710
  ? (fullname.local ? attrFunctionNS : attrFunction)
7711
7711
  : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));
7712
- }
7712
+ };
7713
7713
 
7714
7714
  var window = function(node) {
7715
7715
  return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node
7716
7716
  || (node.document && node) // node is a Window
7717
7717
  || node.defaultView; // node is a Document
7718
- }
7718
+ };
7719
7719
 
7720
7720
  function styleRemove(name) {
7721
7721
  return function() {
@@ -7747,7 +7747,7 @@ var selection_style = function(name, value, priority) {
7747
7747
  : window(node = this.node())
7748
7748
  .getComputedStyle(node, null)
7749
7749
  .getPropertyValue(name);
7750
- }
7750
+ };
7751
7751
 
7752
7752
  function propertyRemove(name) {
7753
7753
  return function() {
@@ -7776,7 +7776,7 @@ var selection_property = function(name, value) {
7776
7776
  ? propertyFunction
7777
7777
  : propertyConstant)(name, value))
7778
7778
  : this.node()[name];
7779
- }
7779
+ };
7780
7780
 
7781
7781
  function classArray(string) {
7782
7782
  return string.trim().split(/^|\s+/);
@@ -7852,7 +7852,7 @@ var selection_classed = function(name, value) {
7852
7852
  ? classedFunction : value
7853
7853
  ? classedTrue
7854
7854
  : classedFalse)(names, value));
7855
- }
7855
+ };
7856
7856
 
7857
7857
  function textRemove() {
7858
7858
  this.textContent = "";
@@ -7878,7 +7878,7 @@ var selection_text = function(value) {
7878
7878
  ? textFunction
7879
7879
  : textConstant)(value))
7880
7880
  : this.node().textContent;
7881
- }
7881
+ };
7882
7882
 
7883
7883
  function htmlRemove() {
7884
7884
  this.innerHTML = "";
@@ -7904,7 +7904,7 @@ var selection_html = function(value) {
7904
7904
  ? htmlFunction
7905
7905
  : htmlConstant)(value))
7906
7906
  : this.node().innerHTML;
7907
- }
7907
+ };
7908
7908
 
7909
7909
  function raise$1() {
7910
7910
  if (this.nextSibling) this.parentNode.appendChild(this);
@@ -7912,7 +7912,7 @@ function raise$1() {
7912
7912
 
7913
7913
  var selection_raise = function() {
7914
7914
  return this.each(raise$1);
7915
- }
7915
+ };
7916
7916
 
7917
7917
  function lower() {
7918
7918
  if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);
@@ -7920,14 +7920,14 @@ function lower() {
7920
7920
 
7921
7921
  var selection_lower = function() {
7922
7922
  return this.each(lower);
7923
- }
7923
+ };
7924
7924
 
7925
7925
  var selection_append = function(name) {
7926
7926
  var create = typeof name === "function" ? name : creator(name);
7927
7927
  return this.select(function() {
7928
7928
  return this.appendChild(create.apply(this, arguments));
7929
7929
  });
7930
- }
7930
+ };
7931
7931
 
7932
7932
  function constantNull() {
7933
7933
  return null;
@@ -7939,7 +7939,7 @@ var selection_insert = function(name, before) {
7939
7939
  return this.select(function() {
7940
7940
  return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);
7941
7941
  });
7942
- }
7942
+ };
7943
7943
 
7944
7944
  function remove() {
7945
7945
  var parent = this.parentNode;
@@ -7948,13 +7948,13 @@ function remove() {
7948
7948
 
7949
7949
  var selection_remove = function() {
7950
7950
  return this.each(remove);
7951
- }
7951
+ };
7952
7952
 
7953
7953
  var selection_datum = function(value) {
7954
7954
  return arguments.length
7955
7955
  ? this.property("__data__", value)
7956
7956
  : this.node().__data__;
7957
- }
7957
+ };
7958
7958
 
7959
7959
  function dispatchEvent(node, type, params) {
7960
7960
  var window$$1 = window(node),
@@ -7987,7 +7987,7 @@ var selection_dispatch = function(type, params) {
7987
7987
  return this.each((typeof params === "function"
7988
7988
  ? dispatchFunction
7989
7989
  : dispatchConstant)(type, params));
7990
- }
7990
+ };
7991
7991
 
7992
7992
  var root = [null];
7993
7993
 
@@ -8037,13 +8037,13 @@ var select = function(selector) {
8037
8037
  return typeof selector === "string"
8038
8038
  ? new Selection([[document.querySelector(selector)]], [document.documentElement])
8039
8039
  : new Selection([[selector]], root);
8040
- }
8040
+ };
8041
8041
 
8042
8042
  var selectAll = function(selector) {
8043
8043
  return typeof selector === "string"
8044
8044
  ? new Selection([document.querySelectorAll(selector)], [document.documentElement])
8045
8045
  : new Selection([selector == null ? [] : selector], root);
8046
- }
8046
+ };
8047
8047
 
8048
8048
  var touch = function(node, touches, identifier) {
8049
8049
  if (arguments.length < 3) identifier = touches, touches = sourceEvent().changedTouches;
@@ -8055,7 +8055,7 @@ var touch = function(node, touches, identifier) {
8055
8055
  }
8056
8056
 
8057
8057
  return null;
8058
- }
8058
+ };
8059
8059
 
8060
8060
  var touches = function(node, touches) {
8061
8061
  if (touches == null) touches = sourceEvent().touches;
@@ -8065,7 +8065,7 @@ var touches = function(node, touches) {
8065
8065
  }
8066
8066
 
8067
8067
  return points;
8068
- }
8068
+ };
8069
8069
 
8070
8070
  var emptyOn = dispatch("start", "end", "interrupt");
8071
8071
  var emptyTween = [];
@@ -8095,7 +8095,7 @@ var schedule = function(node, name, id, index, group, timing) {
8095
8095
  timer: null,
8096
8096
  state: CREATED
8097
8097
  });
8098
- }
8098
+ };
8099
8099
 
8100
8100
  function init(node, id) {
8101
8101
  var schedule = node.__transition;
@@ -8233,7 +8233,7 @@ var interrupt = function(node, name) {
8233
8233
 
8234
8234
  for (i in schedules) {
8235
8235
  if ((schedule = schedules[i]).name !== name) { empty = false; continue; }
8236
- active = schedule.state === STARTED;
8236
+ active = schedule.state > STARTING && schedule.state < ENDING;
8237
8237
  schedule.state = ENDED;
8238
8238
  schedule.timer.stop();
8239
8239
  if (active) schedule.on.call("interrupt", node, node.__data__, schedule.index, schedule.group);
@@ -8241,13 +8241,13 @@ var interrupt = function(node, name) {
8241
8241
  }
8242
8242
 
8243
8243
  if (empty) delete node.__transition;
8244
- }
8244
+ };
8245
8245
 
8246
8246
  var selection_interrupt = function(name) {
8247
8247
  return this.each(function() {
8248
8248
  interrupt(this, name);
8249
8249
  });
8250
- }
8250
+ };
8251
8251
 
8252
8252
  function tweenRemove(id, name) {
8253
8253
  var tween0, tween1;
@@ -8314,7 +8314,7 @@ var transition_tween = function(name, value) {
8314
8314
  }
8315
8315
 
8316
8316
  return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));
8317
- }
8317
+ };
8318
8318
 
8319
8319
  function tweenValue(transition, name, value) {
8320
8320
  var id = transition._id;
@@ -8335,7 +8335,7 @@ var interpolate$1 = function(a, b) {
8335
8335
  : b instanceof color ? interpolateRgb
8336
8336
  : (c = color(b)) ? (b = c, interpolateRgb)
8337
8337
  : interpolateString)(a, b);
8338
- }
8338
+ };
8339
8339
 
8340
8340
  function attrRemove$1(name) {
8341
8341
  return function() {
@@ -8405,7 +8405,7 @@ var transition_attr = function(name, value) {
8405
8405
  ? (fullname.local ? attrFunctionNS$1 : attrFunction$1)(fullname, i, tweenValue(this, "attr." + name, value))
8406
8406
  : value == null ? (fullname.local ? attrRemoveNS$1 : attrRemove$1)(fullname)
8407
8407
  : (fullname.local ? attrConstantNS$1 : attrConstant$1)(fullname, i, value));
8408
- }
8408
+ };
8409
8409
 
8410
8410
  function attrTweenNS(fullname, value) {
8411
8411
  function tween() {
@@ -8436,7 +8436,7 @@ var transition_attrTween = function(name, value) {
8436
8436
  if (typeof value !== "function") throw new Error;
8437
8437
  var fullname = namespace(name);
8438
8438
  return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));
8439
- }
8439
+ };
8440
8440
 
8441
8441
  function delayFunction(id, value) {
8442
8442
  return function() {
@@ -8458,7 +8458,7 @@ var transition_delay = function(value) {
8458
8458
  ? delayFunction
8459
8459
  : delayConstant)(id, value))
8460
8460
  : get$1(this.node(), id).delay;
8461
- }
8461
+ };
8462
8462
 
8463
8463
  function durationFunction(id, value) {
8464
8464
  return function() {
@@ -8480,7 +8480,7 @@ var transition_duration = function(value) {
8480
8480
  ? durationFunction
8481
8481
  : durationConstant)(id, value))
8482
8482
  : get$1(this.node(), id).duration;
8483
- }
8483
+ };
8484
8484
 
8485
8485
  function easeConstant(id, value) {
8486
8486
  if (typeof value !== "function") throw new Error;
@@ -8495,7 +8495,7 @@ var transition_ease = function(value) {
8495
8495
  return arguments.length
8496
8496
  ? this.each(easeConstant(id, value))
8497
8497
  : get$1(this.node(), id).ease;
8498
- }
8498
+ };
8499
8499
 
8500
8500
  var transition_filter = function(match) {
8501
8501
  if (typeof match !== "function") match = matcher$1(match);
@@ -8509,7 +8509,7 @@ var transition_filter = function(match) {
8509
8509
  }
8510
8510
 
8511
8511
  return new Transition(subgroups, this._parents, this._name, this._id);
8512
- }
8512
+ };
8513
8513
 
8514
8514
  var transition_merge = function(transition) {
8515
8515
  if (transition._id !== this._id) throw new Error;
@@ -8527,7 +8527,7 @@ var transition_merge = function(transition) {
8527
8527
  }
8528
8528
 
8529
8529
  return new Transition(merges, this._parents, this._name, this._id);
8530
- }
8530
+ };
8531
8531
 
8532
8532
  function start$1(name) {
8533
8533
  return (name + "").trim().split(/^|\s+/).every(function(t) {
@@ -8558,7 +8558,7 @@ var transition_on = function(name, listener) {
8558
8558
  return arguments.length < 2
8559
8559
  ? get$1(this.node(), id).on.on(name)
8560
8560
  : this.each(onFunction(id, name, listener));
8561
- }
8561
+ };
8562
8562
 
8563
8563
  function removeFunction(id) {
8564
8564
  return function() {
@@ -8570,7 +8570,7 @@ function removeFunction(id) {
8570
8570
 
8571
8571
  var transition_remove = function() {
8572
8572
  return this.on("end.remove", removeFunction(this._id));
8573
- }
8573
+ };
8574
8574
 
8575
8575
  var transition_select = function(select$$1) {
8576
8576
  var name = this._name,
@@ -8589,7 +8589,7 @@ var transition_select = function(select$$1) {
8589
8589
  }
8590
8590
 
8591
8591
  return new Transition(subgroups, this._parents, name, id);
8592
- }
8592
+ };
8593
8593
 
8594
8594
  var transition_selectAll = function(select$$1) {
8595
8595
  var name = this._name,
@@ -8612,13 +8612,13 @@ var transition_selectAll = function(select$$1) {
8612
8612
  }
8613
8613
 
8614
8614
  return new Transition(subgroups, parents, name, id);
8615
- }
8615
+ };
8616
8616
 
8617
8617
  var Selection$1 = selection.prototype.constructor;
8618
8618
 
8619
8619
  var transition_selection = function() {
8620
8620
  return new Selection$1(this._groups, this._parents);
8621
- }
8621
+ };
8622
8622
 
8623
8623
  function styleRemove$1(name, interpolate$$1) {
8624
8624
  var value00,
@@ -8674,7 +8674,7 @@ var transition_style = function(name, value, priority) {
8674
8674
  : this.styleTween(name, typeof value === "function"
8675
8675
  ? styleFunction$1(name, i, tweenValue(this, "style." + name, value))
8676
8676
  : styleConstant$1(name, i, value), priority);
8677
- }
8677
+ };
8678
8678
 
8679
8679
  function styleTween(name, value, priority) {
8680
8680
  function tween() {
@@ -8693,7 +8693,7 @@ var transition_styleTween = function(name, value, priority) {
8693
8693
  if (value == null) return this.tween(key, null);
8694
8694
  if (typeof value !== "function") throw new Error;
8695
8695
  return this.tween(key, styleTween(name, value, priority == null ? "" : priority));
8696
- }
8696
+ };
8697
8697
 
8698
8698
  function textConstant$1(value) {
8699
8699
  return function() {
@@ -8712,7 +8712,7 @@ var transition_text = function(value) {
8712
8712
  return this.tween("text", typeof value === "function"
8713
8713
  ? textFunction$1(tweenValue(this, "text", value))
8714
8714
  : textConstant$1(value == null ? "" : value + ""));
8715
- }
8715
+ };
8716
8716
 
8717
8717
  var transition_transition = function() {
8718
8718
  var name = this._name,
@@ -8734,7 +8734,7 @@ var transition_transition = function() {
8734
8734
  }
8735
8735
 
8736
8736
  return new Transition(groups, this._parents, name, id1);
8737
- }
8737
+ };
8738
8738
 
8739
8739
  var id = 0;
8740
8740
 
@@ -8818,7 +8818,7 @@ var selection_transition = function(name) {
8818
8818
  }
8819
8819
 
8820
8820
  return new Transition(groups, this._parents, name, id);
8821
- }
8821
+ };
8822
8822
 
8823
8823
  selection.prototype.interrupt = selection_interrupt;
8824
8824
  selection.prototype.transition = selection_transition;
@@ -8840,13 +8840,13 @@ var active = function(node, name) {
8840
8840
  }
8841
8841
 
8842
8842
  return null;
8843
- }
8843
+ };
8844
8844
 
8845
8845
  var slice$4 = Array.prototype.slice;
8846
8846
 
8847
8847
  var identity$5 = function(x) {
8848
8848
  return x;
8849
- }
8849
+ };
8850
8850
 
8851
8851
  var top = 1;
8852
8852
  var right = 2;
@@ -9102,7 +9102,7 @@ var cluster = function() {
9102
9102
  };
9103
9103
 
9104
9104
  return cluster;
9105
- }
9105
+ };
9106
9106
 
9107
9107
  var node_each = function(callback) {
9108
9108
  var node = this, current, next = [node], children, i, n;
@@ -9116,7 +9116,7 @@ var node_each = function(callback) {
9116
9116
  }
9117
9117
  } while (next.length);
9118
9118
  return this;
9119
- }
9119
+ };
9120
9120
 
9121
9121
  var node_eachBefore = function(callback) {
9122
9122
  var node = this, nodes = [node], children, i;
@@ -9127,7 +9127,7 @@ var node_eachBefore = function(callback) {
9127
9127
  }
9128
9128
  }
9129
9129
  return this;
9130
- }
9130
+ };
9131
9131
 
9132
9132
  var node_eachAfter = function(callback) {
9133
9133
  var node = this, nodes = [node], next = [], children, i, n;
@@ -9141,7 +9141,7 @@ var node_eachAfter = function(callback) {
9141
9141
  callback(node);
9142
9142
  }
9143
9143
  return this;
9144
- }
9144
+ };
9145
9145
 
9146
9146
  var node_sum = function(value) {
9147
9147
  return this.eachAfter(function(node) {
@@ -9151,7 +9151,7 @@ var node_sum = function(value) {
9151
9151
  while (--i >= 0) sum += children[i].value;
9152
9152
  node.value = sum;
9153
9153
  });
9154
- }
9154
+ };
9155
9155
 
9156
9156
  var node_sort = function(compare) {
9157
9157
  return this.eachBefore(function(node) {
@@ -9159,7 +9159,7 @@ var node_sort = function(compare) {
9159
9159
  node.children.sort(compare);
9160
9160
  }
9161
9161
  });
9162
- }
9162
+ };
9163
9163
 
9164
9164
  var node_path = function(end) {
9165
9165
  var start = this,
@@ -9175,7 +9175,7 @@ var node_path = function(end) {
9175
9175
  end = end.parent;
9176
9176
  }
9177
9177
  return nodes;
9178
- }
9178
+ };
9179
9179
 
9180
9180
  function leastCommonAncestor(a, b) {
9181
9181
  if (a === b) return a;
@@ -9198,7 +9198,7 @@ var node_ancestors = function() {
9198
9198
  nodes.push(node);
9199
9199
  }
9200
9200
  return nodes;
9201
- }
9201
+ };
9202
9202
 
9203
9203
  var node_descendants = function() {
9204
9204
  var nodes = [];
@@ -9206,7 +9206,7 @@ var node_descendants = function() {
9206
9206
  nodes.push(node);
9207
9207
  });
9208
9208
  return nodes;
9209
- }
9209
+ };
9210
9210
 
9211
9211
  var node_leaves = function() {
9212
9212
  var leaves = [];
@@ -9216,7 +9216,7 @@ var node_leaves = function() {
9216
9216
  }
9217
9217
  });
9218
9218
  return leaves;
9219
- }
9219
+ };
9220
9220
 
9221
9221
  var node_links = function() {
9222
9222
  var root = this, links = [];
@@ -9226,7 +9226,7 @@ var node_links = function() {
9226
9226
  }
9227
9227
  });
9228
9228
  return links;
9229
- }
9229
+ };
9230
9230
 
9231
9231
  function hierarchy(data, children) {
9232
9232
  var root = new Node(data),
@@ -9317,11 +9317,11 @@ var shuffle$1 = function(array) {
9317
9317
  head: head,
9318
9318
  tail: node
9319
9319
  };
9320
- }
9320
+ };
9321
9321
 
9322
9322
  var enclose = function(circles) {
9323
9323
  return encloseN(shuffle$1(circles), []);
9324
- }
9324
+ };
9325
9325
 
9326
9326
  function encloses(a, b) {
9327
9327
  var dx = b.x - a.x,
@@ -9552,7 +9552,7 @@ function packEnclose(circles) {
9552
9552
  var siblings = function(circles) {
9553
9553
  packEnclose(circles);
9554
9554
  return circles;
9555
- }
9555
+ };
9556
9556
 
9557
9557
  function optional(f) {
9558
9558
  return f == null ? null : required(f);
@@ -9571,7 +9571,7 @@ var constant$6 = function(x) {
9571
9571
  return function() {
9572
9572
  return x;
9573
9573
  };
9574
- }
9574
+ };
9575
9575
 
9576
9576
  function defaultRadius(d) {
9577
9577
  return Math.sqrt(d.value);
@@ -9611,7 +9611,7 @@ var index = function() {
9611
9611
  };
9612
9612
 
9613
9613
  return pack;
9614
- }
9614
+ };
9615
9615
 
9616
9616
  function radiusLeaf(radius) {
9617
9617
  return function(node) {
@@ -9654,7 +9654,7 @@ var roundNode = function(node) {
9654
9654
  node.y0 = Math.round(node.y0);
9655
9655
  node.x1 = Math.round(node.x1);
9656
9656
  node.y1 = Math.round(node.y1);
9657
- }
9657
+ };
9658
9658
 
9659
9659
  var treemapDice = function(parent, x0, y0, x1, y1) {
9660
9660
  var nodes = parent.children,
@@ -9667,7 +9667,7 @@ var treemapDice = function(parent, x0, y0, x1, y1) {
9667
9667
  node = nodes[i], node.y0 = y0, node.y1 = y1;
9668
9668
  node.x0 = x0, node.x1 = x0 += node.value * k;
9669
9669
  }
9670
- }
9670
+ };
9671
9671
 
9672
9672
  var partition = function() {
9673
9673
  var dx = 1,
@@ -9717,7 +9717,7 @@ var partition = function() {
9717
9717
  };
9718
9718
 
9719
9719
  return partition;
9720
- }
9720
+ };
9721
9721
 
9722
9722
  var keyPrefix$1 = "$";
9723
9723
  var preroot = {depth: -1};
@@ -9788,7 +9788,7 @@ var stratify = function() {
9788
9788
  };
9789
9789
 
9790
9790
  return stratify;
9791
- }
9791
+ };
9792
9792
 
9793
9793
  function defaultSeparation$1(a, b) {
9794
9794
  return a.parent === b.parent ? 1 : 2;
@@ -10024,7 +10024,7 @@ var tree = function() {
10024
10024
  };
10025
10025
 
10026
10026
  return tree;
10027
- }
10027
+ };
10028
10028
 
10029
10029
  var treemapSlice = function(parent, x0, y0, x1, y1) {
10030
10030
  var nodes = parent.children,
@@ -10037,7 +10037,7 @@ var treemapSlice = function(parent, x0, y0, x1, y1) {
10037
10037
  node = nodes[i], node.x0 = x0, node.x1 = x1;
10038
10038
  node.y0 = y0, node.y1 = y0 += node.value * k;
10039
10039
  }
10040
- }
10040
+ };
10041
10041
 
10042
10042
  var phi = (1 + Math.sqrt(5)) / 2;
10043
10043
 
@@ -10188,7 +10188,7 @@ var index$1 = function() {
10188
10188
  };
10189
10189
 
10190
10190
  return treemap;
10191
- }
10191
+ };
10192
10192
 
10193
10193
  var binary = function(parent, x0, y0, x1, y1) {
10194
10194
  var nodes = parent.children,
@@ -10233,11 +10233,11 @@ var binary = function(parent, x0, y0, x1, y1) {
10233
10233
  partition(k, j, valueRight, xk, y0, x1, y1);
10234
10234
  }
10235
10235
  }
10236
- }
10236
+ };
10237
10237
 
10238
10238
  var sliceDice = function(parent, x0, y0, x1, y1) {
10239
10239
  (parent.depth & 1 ? treemapSlice : treemapDice)(parent, x0, y0, x1, y1);
10240
- }
10240
+ };
10241
10241
 
10242
10242
  var resquarify = (function custom(ratio) {
10243
10243
 
@@ -10307,17 +10307,17 @@ var center$1 = function(x, y) {
10307
10307
  };
10308
10308
 
10309
10309
  return force;
10310
- }
10310
+ };
10311
10311
 
10312
10312
  var constant$7 = function(x) {
10313
10313
  return function() {
10314
10314
  return x;
10315
10315
  };
10316
- }
10316
+ };
10317
10317
 
10318
10318
  var jiggle = function() {
10319
10319
  return (Math.random() - 0.5) * 1e-6;
10320
- }
10320
+ };
10321
10321
 
10322
10322
  function x$1(d) {
10323
10323
  return d.x + d.vx;
@@ -10387,9 +10387,16 @@ var collide = function(radius) {
10387
10387
  }
10388
10388
  }
10389
10389
 
10390
- force.initialize = function(_) {
10391
- var i, n = (nodes = _).length; radii = new Array(n);
10390
+ function initialize() {
10391
+ if (!nodes) return;
10392
+ var i, n = nodes.length;
10393
+ radii = new Array(n);
10392
10394
  for (i = 0; i < n; ++i) radii[i] = +radius(nodes[i], i, nodes);
10395
+ }
10396
+
10397
+ force.initialize = function(_) {
10398
+ nodes = _;
10399
+ initialize();
10393
10400
  };
10394
10401
 
10395
10402
  force.iterations = function(_) {
@@ -10401,16 +10408,22 @@ var collide = function(radius) {
10401
10408
  };
10402
10409
 
10403
10410
  force.radius = function(_) {
10404
- return arguments.length ? (radius = typeof _ === "function" ? _ : constant$7(+_), force) : radius;
10411
+ return arguments.length ? (radius = typeof _ === "function" ? _ : constant$7(+_), initialize(), force) : radius;
10405
10412
  };
10406
10413
 
10407
10414
  return force;
10408
- }
10415
+ };
10409
10416
 
10410
10417
  function index$2(d, i) {
10411
10418
  return i;
10412
10419
  }
10413
10420
 
10421
+ function find(nodeById, nodeId) {
10422
+ var node = nodeById.get(nodeId);
10423
+ if (!node) throw new Error("missing: " + nodeId);
10424
+ return node;
10425
+ }
10426
+
10414
10427
  var link = function(links) {
10415
10428
  var id = index$2,
10416
10429
  strength = defaultStrength,
@@ -10460,8 +10473,8 @@ var link = function(links) {
10460
10473
 
10461
10474
  for (i = 0; i < m; ++i) {
10462
10475
  link = links[i], link.index = i;
10463
- if (typeof link.source !== "object") link.source = nodeById.get(link.source);
10464
- if (typeof link.target !== "object") link.target = nodeById.get(link.target);
10476
+ if (typeof link.source !== "object") link.source = find(nodeById, link.source);
10477
+ if (typeof link.target !== "object") link.target = find(nodeById, link.target);
10465
10478
  ++count[link.source.index], ++count[link.target.index];
10466
10479
  }
10467
10480
 
@@ -10515,7 +10528,7 @@ var link = function(links) {
10515
10528
  };
10516
10529
 
10517
10530
  return force;
10518
- }
10531
+ };
10519
10532
 
10520
10533
  function x$2(d) {
10521
10534
  return d.x;
@@ -10655,7 +10668,7 @@ var simulation = function(nodes) {
10655
10668
  return arguments.length > 1 ? (event.on(name, _), simulation) : event.on(name);
10656
10669
  }
10657
10670
  };
10658
- }
10671
+ };
10659
10672
 
10660
10673
  var manyBody = function() {
10661
10674
  var nodes,
@@ -10765,7 +10778,7 @@ var manyBody = function() {
10765
10778
  };
10766
10779
 
10767
10780
  return force;
10768
- }
10781
+ };
10769
10782
 
10770
10783
  var x$3 = function(x) {
10771
10784
  var strength = constant$7(0.1),
@@ -10805,7 +10818,7 @@ var x$3 = function(x) {
10805
10818
  };
10806
10819
 
10807
10820
  return force;
10808
- }
10821
+ };
10809
10822
 
10810
10823
  var y$3 = function(y) {
10811
10824
  var strength = constant$7(0.1),
@@ -10845,7 +10858,7 @@ var y$3 = function(y) {
10845
10858
  };
10846
10859
 
10847
10860
  return force;
10848
- }
10861
+ };
10849
10862
 
10850
10863
  function nopropagation() {
10851
10864
  exports.event.stopImmediatePropagation();
@@ -10854,7 +10867,7 @@ function nopropagation() {
10854
10867
  var noevent = function() {
10855
10868
  exports.event.preventDefault();
10856
10869
  exports.event.stopImmediatePropagation();
10857
- }
10870
+ };
10858
10871
 
10859
10872
  var dragDisable = function(view) {
10860
10873
  var root = view.document.documentElement,
@@ -10865,7 +10878,7 @@ var dragDisable = function(view) {
10865
10878
  root.__noselect = root.style.MozUserSelect;
10866
10879
  root.style.MozUserSelect = "none";
10867
10880
  }
10868
- }
10881
+ };
10869
10882
 
10870
10883
  function yesdrag(view, noclick) {
10871
10884
  var root = view.document.documentElement,
@@ -10886,7 +10899,7 @@ var constant$8 = function(x) {
10886
10899
  return function() {
10887
10900
  return x;
10888
10901
  };
10889
- }
10902
+ };
10890
10903
 
10891
10904
  function DragEvent(target, type, subject, id, active, x, y, dx, dy, dispatch) {
10892
10905
  this.target = target;
@@ -11042,13 +11055,13 @@ var drag = function() {
11042
11055
  };
11043
11056
 
11044
11057
  return drag;
11045
- }
11058
+ };
11046
11059
 
11047
11060
  var constant$9 = function(x) {
11048
11061
  return function() {
11049
11062
  return x;
11050
11063
  };
11051
- }
11064
+ };
11052
11065
 
11053
11066
  function x$4(d) {
11054
11067
  return d[0];
@@ -11941,7 +11954,7 @@ Diagram.prototype = {
11941
11954
  s0 = s1;
11942
11955
  e1 = edges[halfedges[j]];
11943
11956
  s1 = e1.left === site ? e1.right : e1.left;
11944
- if (i < s0.index && i < s1.index && triangleArea(site, s0, s1) < 0) {
11957
+ if (s0 && s1 && i < s0.index && i < s1.index && triangleArea(site, s0, s1) < 0) {
11945
11958
  triangles.push([site.data, s0.data, s1.data]);
11946
11959
  }
11947
11960
  }
@@ -11959,8 +11972,33 @@ Diagram.prototype = {
11959
11972
  target: edge.right.data
11960
11973
  };
11961
11974
  });
11975
+ },
11976
+
11977
+ find: function(x, y, radius) {
11978
+ var that = this,
11979
+ i0, i1 = that._found || 0,
11980
+ cell = that.cells[i1] || that.cells[i1 = 0],
11981
+ dx = x - cell.site[0],
11982
+ dy = y - cell.site[1],
11983
+ d2 = dx * dx + dy * dy;
11984
+
11985
+ do {
11986
+ cell = that.cells[i0 = i1], i1 = null;
11987
+ cell.halfedges.forEach(function(e) {
11988
+ var edge = that.edges[e], v = edge.left;
11989
+ if ((v === cell.site || !v) && !(v = edge.right)) return;
11990
+ var vx = x - v[0],
11991
+ vy = y - v[1],
11992
+ v2 = vx * vx + vy * vy;
11993
+ if (v2 < d2) d2 = v2, i1 = v.index;
11994
+ });
11995
+ } while (i1 !== null);
11996
+
11997
+ that._found = i0;
11998
+
11999
+ return radius == null || d2 <= radius * radius ? cell.site : null;
11962
12000
  }
11963
- }
12001
+ };
11964
12002
 
11965
12003
  var voronoi = function() {
11966
12004
  var x$$1 = x$4,
@@ -12005,13 +12043,13 @@ var voronoi = function() {
12005
12043
  };
12006
12044
 
12007
12045
  return voronoi;
12008
- }
12046
+ };
12009
12047
 
12010
12048
  var constant$10 = function(x) {
12011
12049
  return function() {
12012
12050
  return x;
12013
12051
  };
12014
- }
12052
+ };
12015
12053
 
12016
12054
  function ZoomEvent(target, type, transform) {
12017
12055
  this.target = target;
@@ -12077,7 +12115,7 @@ function nopropagation$1() {
12077
12115
  var noevent$1 = function() {
12078
12116
  exports.event.preventDefault();
12079
12117
  exports.event.stopImmediatePropagation();
12080
- }
12118
+ };
12081
12119
 
12082
12120
  // Ignore right-click, since that should open the context menu.
12083
12121
  function defaultFilter$1() {
@@ -12430,19 +12468,19 @@ var zoom = function() {
12430
12468
  };
12431
12469
 
12432
12470
  return zoom;
12433
- }
12471
+ };
12434
12472
 
12435
12473
  var constant$11 = function(x) {
12436
12474
  return function() {
12437
12475
  return x;
12438
12476
  };
12439
- }
12477
+ };
12440
12478
 
12441
12479
  var BrushEvent = function(target, type, selection) {
12442
12480
  this.target = target;
12443
12481
  this.type = type;
12444
12482
  this.selection = selection;
12445
- }
12483
+ };
12446
12484
 
12447
12485
  function nopropagation$2() {
12448
12486
  exports.event.stopImmediatePropagation();
@@ -12451,7 +12489,7 @@ function nopropagation$2() {
12451
12489
  var noevent$2 = function() {
12452
12490
  exports.event.preventDefault();
12453
12491
  exports.event.stopImmediatePropagation();
12454
- }
12492
+ };
12455
12493
 
12456
12494
  var MODE_DRAG = {name: "drag"};
12457
12495
  var MODE_SPACE = {name: "space"};
@@ -12576,7 +12614,7 @@ function brushY() {
12576
12614
 
12577
12615
  var brush = function() {
12578
12616
  return brush$1(XY);
12579
- }
12617
+ };
12580
12618
 
12581
12619
  function brush$1(dim) {
12582
12620
  var extent = defaultExtent$1,
@@ -13108,7 +13146,7 @@ var chord = function() {
13108
13146
  };
13109
13147
 
13110
13148
  return chord;
13111
- }
13149
+ };
13112
13150
 
13113
13151
  var slice$5 = Array.prototype.slice;
13114
13152
 
@@ -13116,7 +13154,7 @@ var constant$12 = function(x) {
13116
13154
  return function() {
13117
13155
  return x;
13118
13156
  };
13119
- }
13157
+ };
13120
13158
 
13121
13159
  function defaultSource(d) {
13122
13160
  return d.source;
@@ -13199,7 +13237,7 @@ var ribbon = function() {
13199
13237
  };
13200
13238
 
13201
13239
  return ribbon;
13202
- }
13240
+ };
13203
13241
 
13204
13242
  // Adds floating point numbers with twice the normal precision.
13205
13243
  // Reference: J. R. Shewchuk, Adaptive Precision Floating-Point Arithmetic and
@@ -13210,7 +13248,7 @@ var ribbon = function() {
13210
13248
 
13211
13249
  var adder = function() {
13212
13250
  return new Adder;
13213
- }
13251
+ };
13214
13252
 
13215
13253
  function Adder() {
13216
13254
  this.reset();
@@ -13348,7 +13386,7 @@ var geoStream = function(object, stream) {
13348
13386
  } else {
13349
13387
  streamGeometry(object, stream);
13350
13388
  }
13351
- }
13389
+ };
13352
13390
 
13353
13391
  var areaRingSum = adder();
13354
13392
 
@@ -13418,7 +13456,7 @@ var area$2 = function(object) {
13418
13456
  areaSum.reset();
13419
13457
  geoStream(object, areaStream);
13420
13458
  return areaSum * 2;
13421
- }
13459
+ };
13422
13460
 
13423
13461
  function spherical(cartesian) {
13424
13462
  return [atan2(cartesian[1], cartesian[0]), asin$1(cartesian[2])];
@@ -13623,7 +13661,7 @@ var bounds = function(feature) {
13623
13661
  return lambda0$1 === Infinity || phi0 === Infinity
13624
13662
  ? [[NaN, NaN], [NaN, NaN]]
13625
13663
  : [[lambda0$1, phi0], [lambda1, phi1]];
13626
- }
13664
+ };
13627
13665
 
13628
13666
  var W0;
13629
13667
  var W1;
@@ -13771,13 +13809,13 @@ var centroid$1 = function(object) {
13771
13809
  }
13772
13810
 
13773
13811
  return [atan2(y, x) * degrees$1, asin$1(z / sqrt$1(m)) * degrees$1];
13774
- }
13812
+ };
13775
13813
 
13776
13814
  var constant$13 = function(x) {
13777
13815
  return function() {
13778
13816
  return x;
13779
13817
  };
13780
- }
13818
+ };
13781
13819
 
13782
13820
  var compose = function(a, b) {
13783
13821
 
@@ -13790,7 +13828,7 @@ var compose = function(a, b) {
13790
13828
  };
13791
13829
 
13792
13830
  return compose;
13793
- }
13831
+ };
13794
13832
 
13795
13833
  function rotationIdentity(lambda, phi) {
13796
13834
  return [lambda > pi$4 ? lambda - tau$4 : lambda < -pi$4 ? lambda + tau$4 : lambda, phi];
@@ -13864,7 +13902,7 @@ var rotation = function(rotate) {
13864
13902
  };
13865
13903
 
13866
13904
  return forward;
13867
- }
13905
+ };
13868
13906
 
13869
13907
  // Generates a circle centered at [0°, 0°], with a given radius and precision.
13870
13908
  function circleStream(stream, radius, delta, direction, t0, t1) {
@@ -13932,7 +13970,7 @@ var circle$1 = function() {
13932
13970
  };
13933
13971
 
13934
13972
  return circle;
13935
- }
13973
+ };
13936
13974
 
13937
13975
  var clipBuffer = function() {
13938
13976
  var lines = [],
@@ -13955,7 +13993,7 @@ var clipBuffer = function() {
13955
13993
  return result;
13956
13994
  }
13957
13995
  };
13958
- }
13996
+ };
13959
13997
 
13960
13998
  var clipLine = function(a, b, x0, y0, x1, y1) {
13961
13999
  var ax = a[0],
@@ -14015,11 +14053,11 @@ var clipLine = function(a, b, x0, y0, x1, y1) {
14015
14053
  if (t0 > 0) a[0] = ax + t0 * dx, a[1] = ay + t0 * dy;
14016
14054
  if (t1 < 1) b[0] = ax + t1 * dx, b[1] = ay + t1 * dy;
14017
14055
  return true;
14018
- }
14056
+ };
14019
14057
 
14020
14058
  var pointEqual = function(a, b) {
14021
14059
  return abs(a[0] - b[0]) < epsilon$4 && abs(a[1] - b[1]) < epsilon$4;
14022
- }
14060
+ };
14023
14061
 
14024
14062
  function Intersection(point, points, other, entry) {
14025
14063
  this.x = point;
@@ -14104,7 +14142,7 @@ var clipPolygon = function(segments, compareIntersection, startInside, interpola
14104
14142
  } while (!current.v);
14105
14143
  stream.lineEnd();
14106
14144
  }
14107
- }
14145
+ };
14108
14146
 
14109
14147
  function link$1(array) {
14110
14148
  if (!(n = array.length)) return;
@@ -14302,7 +14340,7 @@ var extent$1 = function() {
14302
14340
  return arguments.length ? (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1], cache = cacheStream = null, clip) : [[x0, y0], [x1, y1]];
14303
14341
  }
14304
14342
  };
14305
- }
14343
+ };
14306
14344
 
14307
14345
  var lengthSum = adder();
14308
14346
  var lambda0$2;
@@ -14351,7 +14389,7 @@ var length$2 = function(object) {
14351
14389
  lengthSum.reset();
14352
14390
  geoStream(object, lengthStream);
14353
14391
  return +lengthSum;
14354
- }
14392
+ };
14355
14393
 
14356
14394
  var coordinates = [null, null];
14357
14395
  var object$1 = {type: "LineString", coordinates: coordinates};
@@ -14360,7 +14398,7 @@ var distance = function(a, b) {
14360
14398
  coordinates[0] = a;
14361
14399
  coordinates[1] = b;
14362
14400
  return length$2(object$1);
14363
- }
14401
+ };
14364
14402
 
14365
14403
  function graticuleX(y0, y1, dy) {
14366
14404
  var y = range(y0, y1 - epsilon$4, dy).concat(y1);
@@ -14372,7 +14410,7 @@ function graticuleY(x0, x1, dx) {
14372
14410
  return function(y) { return x.map(function(x) { return [x, y]; }); };
14373
14411
  }
14374
14412
 
14375
- var graticule = function() {
14413
+ function graticule() {
14376
14414
  var x1, x0, X1, X0,
14377
14415
  y1, y0, Y1, Y0,
14378
14416
  dx = 10, dy = dx, DX = 90, DY = 360,
@@ -14461,6 +14499,10 @@ var graticule = function() {
14461
14499
  .extentMinor([[-180, -80 - epsilon$4], [180, 80 + epsilon$4]]);
14462
14500
  }
14463
14501
 
14502
+ function graticule10() {
14503
+ return graticule()();
14504
+ }
14505
+
14464
14506
  var interpolate$2 = function(a, b) {
14465
14507
  var x0 = a[0] * radians,
14466
14508
  y0 = a[1] * radians,
@@ -14494,11 +14536,11 @@ var interpolate$2 = function(a, b) {
14494
14536
  interpolate.distance = d;
14495
14537
 
14496
14538
  return interpolate;
14497
- }
14539
+ };
14498
14540
 
14499
14541
  var identity$7 = function(x) {
14500
14542
  return x;
14501
- }
14543
+ };
14502
14544
 
14503
14545
  var areaSum$1 = adder();
14504
14546
  var areaRingSum$1 = adder();
@@ -14765,11 +14807,9 @@ function circle$2(radius) {
14765
14807
  + "z";
14766
14808
  }
14767
14809
 
14768
- var index$3 = function() {
14810
+ var index$3 = function(projection, context) {
14769
14811
  var pointRadius = 4.5,
14770
- projection,
14771
14812
  projectionStream,
14772
- context,
14773
14813
  contextStream;
14774
14814
 
14775
14815
  function path(object) {
@@ -14812,8 +14852,8 @@ var index$3 = function() {
14812
14852
  return path;
14813
14853
  };
14814
14854
 
14815
- return path.projection(null).context(null);
14816
- }
14855
+ return path.projection(projection).context(context);
14856
+ };
14817
14857
 
14818
14858
  var sum$2 = adder();
14819
14859
 
@@ -14878,7 +14918,7 @@ var polygonContains = function(polygon, point) {
14878
14918
  // same side as the South pole.
14879
14919
 
14880
14920
  return (angle < -epsilon$4 || angle < epsilon$4 && sum$2 < -epsilon$4) ^ (winding & 1);
14881
- }
14921
+ };
14882
14922
 
14883
14923
  var clip = function(pointVisible, clipLine, interpolate, start) {
14884
14924
  return function(rotate, sink) {
@@ -14997,7 +15037,7 @@ var clip = function(pointVisible, clipLine, interpolate, start) {
14997
15037
 
14998
15038
  return clip;
14999
15039
  };
15000
- }
15040
+ };
15001
15041
 
15002
15042
  function validSegment(segment) {
15003
15043
  return segment.length > 1;
@@ -15274,28 +15314,27 @@ var clipCircle = function(radius, delta) {
15274
15314
  }
15275
15315
 
15276
15316
  return clip(visible, clipLine, interpolate, smallRadius ? [0, -radius] : [-pi$4, radius - pi$4]);
15277
- }
15317
+ };
15278
15318
 
15279
- var transform$1 = function(prototype) {
15319
+ var transform$1 = function(methods) {
15280
15320
  return {
15281
- stream: transform$2(prototype)
15321
+ stream: transformer(methods)
15282
15322
  };
15283
- }
15323
+ };
15284
15324
 
15285
- function transform$2(prototype) {
15286
- function T() {}
15287
- var p = T.prototype = Object.create(Transform$1.prototype);
15288
- for (var k in prototype) p[k] = prototype[k];
15325
+ function transformer(methods) {
15289
15326
  return function(stream) {
15290
- var t = new T;
15291
- t.stream = stream;
15292
- return t;
15327
+ var s = new TransformStream;
15328
+ for (var key in methods) s[key] = methods[key];
15329
+ s.stream = stream;
15330
+ return s;
15293
15331
  };
15294
15332
  }
15295
15333
 
15296
- function Transform$1() {}
15334
+ function TransformStream() {}
15297
15335
 
15298
- Transform$1.prototype = {
15336
+ TransformStream.prototype = {
15337
+ constructor: TransformStream,
15299
15338
  point: function(x, y) { this.stream.point(x, y); },
15300
15339
  sphere: function() { this.stream.sphere(); },
15301
15340
  lineStart: function() { this.stream.lineStart(); },
@@ -15304,41 +15343,33 @@ Transform$1.prototype = {
15304
15343
  polygonEnd: function() { this.stream.polygonEnd(); }
15305
15344
  };
15306
15345
 
15307
- function fit(project, extent, object) {
15346
+ function fitExtent(projection, extent, object) {
15308
15347
  var w = extent[1][0] - extent[0][0],
15309
15348
  h = extent[1][1] - extent[0][1],
15310
- clip = project.clipExtent && project.clipExtent();
15349
+ clip = projection.clipExtent && projection.clipExtent();
15311
15350
 
15312
- project
15351
+ projection
15313
15352
  .scale(150)
15314
15353
  .translate([0, 0]);
15315
15354
 
15316
- if (clip != null) project.clipExtent(null);
15355
+ if (clip != null) projection.clipExtent(null);
15317
15356
 
15318
- geoStream(object, project.stream(boundsStream$1));
15357
+ geoStream(object, projection.stream(boundsStream$1));
15319
15358
 
15320
15359
  var b = boundsStream$1.result(),
15321
15360
  k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])),
15322
15361
  x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2,
15323
15362
  y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2;
15324
15363
 
15325
- if (clip != null) project.clipExtent(clip);
15364
+ if (clip != null) projection.clipExtent(clip);
15326
15365
 
15327
- return project
15366
+ return projection
15328
15367
  .scale(k * 150)
15329
15368
  .translate([x, y]);
15330
15369
  }
15331
15370
 
15332
- function fitSize(project) {
15333
- return function(size, object) {
15334
- return fit(project, [[0, 0], size], object);
15335
- };
15336
- }
15337
-
15338
- function fitExtent(project) {
15339
- return function(extent, object) {
15340
- return fit(project, extent, object);
15341
- };
15371
+ function fitSize(projection, size, object) {
15372
+ return fitExtent(projection, [[0, 0], size], object);
15342
15373
  }
15343
15374
 
15344
15375
  var maxDepth = 16;
@@ -15346,10 +15377,10 @@ var cosMinDistance = cos$1(30 * radians); // cos(minimum angular distance)
15346
15377
 
15347
15378
  var resample = function(project, delta2) {
15348
15379
  return +delta2 ? resample$1(project, delta2) : resampleNone(project);
15349
- }
15380
+ };
15350
15381
 
15351
15382
  function resampleNone(project) {
15352
- return transform$2({
15383
+ return transformer({
15353
15384
  point: function(x, y) {
15354
15385
  x = project(x, y);
15355
15386
  this.stream.point(x[0], x[1]);
@@ -15440,7 +15471,7 @@ function resample$1(project, delta2) {
15440
15471
  };
15441
15472
  }
15442
15473
 
15443
- var transformRadians = transform$2({
15474
+ var transformRadians = transformer({
15444
15475
  point: function(x, y) {
15445
15476
  this.stream.point(x * radians, y * radians);
15446
15477
  }
@@ -15508,9 +15539,13 @@ function projectionMutator(projectAt) {
15508
15539
  return arguments.length ? (projectResample = resample(projectTransform, delta2 = _ * _), reset()) : sqrt$1(delta2);
15509
15540
  };
15510
15541
 
15511
- projection.fitExtent = fitExtent(projection);
15542
+ projection.fitExtent = function(extent, object) {
15543
+ return fitExtent(projection, extent, object);
15544
+ };
15512
15545
 
15513
- projection.fitSize = fitSize(projection);
15546
+ projection.fitSize = function(size, object) {
15547
+ return fitSize(projection, size, object);
15548
+ };
15514
15549
 
15515
15550
  function recenter() {
15516
15551
  projectRotate = compose(rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma), project);
@@ -15545,11 +15580,27 @@ function conicProjection(projectAt) {
15545
15580
  return p;
15546
15581
  }
15547
15582
 
15583
+ function cylindricalEqualAreaRaw(phi0) {
15584
+ var cosPhi0 = cos$1(phi0);
15585
+
15586
+ function forward(lambda, phi) {
15587
+ return [lambda * cosPhi0, sin$1(phi) / cosPhi0];
15588
+ }
15589
+
15590
+ forward.invert = function(x, y) {
15591
+ return [x / cosPhi0, asin$1(y * cosPhi0)];
15592
+ };
15593
+
15594
+ return forward;
15595
+ }
15596
+
15548
15597
  function conicEqualAreaRaw(y0, y1) {
15549
- var sy0 = sin$1(y0),
15550
- n = (sy0 + sin$1(y1)) / 2,
15551
- c = 1 + sy0 * (2 * n - sy0),
15552
- r0 = sqrt$1(c) / n;
15598
+ var sy0 = sin$1(y0), n = (sy0 + sin$1(y1)) / 2;
15599
+
15600
+ // Are the parallels symmetrical around the Equator?
15601
+ if (abs(n) < epsilon$4) return cylindricalEqualAreaRaw(y0);
15602
+
15603
+ var c = 1 + sy0 * (2 * n - sy0), r0 = sqrt$1(c) / n;
15553
15604
 
15554
15605
  function project(x, y) {
15555
15606
  var r = sqrt$1(c - 2 * n * sin$1(y)) / n;
@@ -15558,7 +15609,7 @@ function conicEqualAreaRaw(y0, y1) {
15558
15609
 
15559
15610
  project.invert = function(x, y) {
15560
15611
  var r0y = r0 - y;
15561
- return [atan2(x, r0y) / n, asin$1((c - (x * x + r0y * r0y) * n * n) / (2 * n))];
15612
+ return [atan2(x, abs(r0y)) / n * sign$1(r0y), asin$1((c - (x * x + r0y * r0y) * n * n) / (2 * n))];
15562
15613
  };
15563
15614
 
15564
15615
  return project;
@@ -15568,7 +15619,7 @@ var conicEqualArea = function() {
15568
15619
  return conicProjection(conicEqualAreaRaw)
15569
15620
  .scale(155.424)
15570
15621
  .center([0, 33.6442]);
15571
- }
15622
+ };
15572
15623
 
15573
15624
  var albers = function() {
15574
15625
  return conicEqualArea()
@@ -15577,7 +15628,7 @@ var albers = function() {
15577
15628
  .translate([480, 250])
15578
15629
  .rotate([96, 0])
15579
15630
  .center([-0.6, 38.7]);
15580
- }
15631
+ };
15581
15632
 
15582
15633
  // The projections must have mutually exclusive clip regions on the sphere,
15583
15634
  // as this will avoid emitting interleaving lines and polygons.
@@ -15662,9 +15713,13 @@ var albersUsa = function() {
15662
15713
  return reset();
15663
15714
  };
15664
15715
 
15665
- albersUsa.fitExtent = fitExtent(albersUsa);
15716
+ albersUsa.fitExtent = function(extent, object) {
15717
+ return fitExtent(albersUsa, extent, object);
15718
+ };
15666
15719
 
15667
- albersUsa.fitSize = fitSize(albersUsa);
15720
+ albersUsa.fitSize = function(size, object) {
15721
+ return fitSize(albersUsa, size, object);
15722
+ };
15668
15723
 
15669
15724
  function reset() {
15670
15725
  cache = cacheStream = null;
@@ -15672,7 +15727,7 @@ var albersUsa = function() {
15672
15727
  }
15673
15728
 
15674
15729
  return albersUsa.scale(1070);
15675
- }
15730
+ };
15676
15731
 
15677
15732
  function azimuthalRaw(scale) {
15678
15733
  return function(x, y) {
@@ -15711,7 +15766,7 @@ var azimuthalEqualArea = function() {
15711
15766
  return projection(azimuthalEqualAreaRaw)
15712
15767
  .scale(124.75)
15713
15768
  .clipAngle(180 - 1e-3);
15714
- }
15769
+ };
15715
15770
 
15716
15771
  var azimuthalEquidistantRaw = azimuthalRaw(function(c) {
15717
15772
  return (c = acos(c)) && c / sin$1(c);
@@ -15725,7 +15780,7 @@ var azimuthalEquidistant = function() {
15725
15780
  return projection(azimuthalEquidistantRaw)
15726
15781
  .scale(79.4188)
15727
15782
  .clipAngle(180 - 1e-3);
15728
- }
15783
+ };
15729
15784
 
15730
15785
  function mercatorRaw(lambda, phi) {
15731
15786
  return [lambda, log$1(tan((halfPi$3 + phi) / 2))];
@@ -15738,7 +15793,7 @@ mercatorRaw.invert = function(x, y) {
15738
15793
  var mercator = function() {
15739
15794
  return mercatorProjection(mercatorRaw)
15740
15795
  .scale(961 / tau$4);
15741
- }
15796
+ };
15742
15797
 
15743
15798
  function mercatorProjection(project) {
15744
15799
  var m = projection(project),
@@ -15789,7 +15844,7 @@ function conicConformalRaw(y0, y1) {
15789
15844
 
15790
15845
  project.invert = function(x, y) {
15791
15846
  var fy = f - y, r = sign$1(n) * sqrt$1(x * x + fy * fy);
15792
- return [atan2(x, fy) / n, 2 * atan(pow$1(f / r, 1 / n)) - halfPi$3];
15847
+ return [atan2(x, abs(fy)) / n * sign$1(fy), 2 * atan(pow$1(f / r, 1 / n)) - halfPi$3];
15793
15848
  };
15794
15849
 
15795
15850
  return project;
@@ -15799,7 +15854,7 @@ var conicConformal = function() {
15799
15854
  return conicProjection(conicConformalRaw)
15800
15855
  .scale(109.5)
15801
15856
  .parallels([30, 30]);
15802
- }
15857
+ };
15803
15858
 
15804
15859
  function equirectangularRaw(lambda, phi) {
15805
15860
  return [lambda, phi];
@@ -15810,7 +15865,7 @@ equirectangularRaw.invert = equirectangularRaw;
15810
15865
  var equirectangular = function() {
15811
15866
  return projection(equirectangularRaw)
15812
15867
  .scale(152.63);
15813
- }
15868
+ };
15814
15869
 
15815
15870
  function conicEquidistantRaw(y0, y1) {
15816
15871
  var cy0 = cos$1(y0),
@@ -15826,7 +15881,7 @@ function conicEquidistantRaw(y0, y1) {
15826
15881
 
15827
15882
  project.invert = function(x, y) {
15828
15883
  var gy = g - y;
15829
- return [atan2(x, gy) / n, g - sign$1(n) * sqrt$1(x * x + gy * gy)];
15884
+ return [atan2(x, abs(gy)) / n * sign$1(gy), g - sign$1(n) * sqrt$1(x * x + gy * gy)];
15830
15885
  };
15831
15886
 
15832
15887
  return project;
@@ -15836,7 +15891,7 @@ var conicEquidistant = function() {
15836
15891
  return conicProjection(conicEquidistantRaw)
15837
15892
  .scale(131.154)
15838
15893
  .center([0, 13.9389]);
15839
- }
15894
+ };
15840
15895
 
15841
15896
  function gnomonicRaw(x, y) {
15842
15897
  var cy = cos$1(y), k = cos$1(x) * cy;
@@ -15849,8 +15904,50 @@ var gnomonic = function() {
15849
15904
  return projection(gnomonicRaw)
15850
15905
  .scale(144.049)
15851
15906
  .clipAngle(60);
15907
+ };
15908
+
15909
+ function scaleTranslate(k, tx, ty) {
15910
+ return k === 1 && tx === 0 && ty === 0 ? identity$7 : transformer({
15911
+ point: function(x, y) {
15912
+ this.stream.point(x * k + tx, y * k + ty);
15913
+ }
15914
+ });
15852
15915
  }
15853
15916
 
15917
+ var identity$8 = function() {
15918
+ var k = 1, tx = 0, ty = 0, transform = identity$7, // scale and translate
15919
+ x0 = null, y0, x1, y1, clip = identity$7, // clip extent
15920
+ cache,
15921
+ cacheStream,
15922
+ projection;
15923
+
15924
+ function reset() {
15925
+ cache = cacheStream = null;
15926
+ return projection;
15927
+ }
15928
+
15929
+ return projection = {
15930
+ stream: function(stream) {
15931
+ return cache && cacheStream === stream ? cache : cache = transform(clip(cacheStream = stream));
15932
+ },
15933
+ clipExtent: function(_) {
15934
+ return arguments.length ? (clip = _ == null ? (x0 = y0 = x1 = y1 = null, identity$7) : clipExtent(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];
15935
+ },
15936
+ scale: function(_) {
15937
+ return arguments.length ? (transform = scaleTranslate(k = +_, tx, ty), reset()) : k;
15938
+ },
15939
+ translate: function(_) {
15940
+ return arguments.length ? (transform = scaleTranslate(k, tx = +_[0], ty = +_[1]), reset()) : [tx, ty];
15941
+ },
15942
+ fitExtent: function(extent, object) {
15943
+ return fitExtent(projection, extent, object);
15944
+ },
15945
+ fitSize: function(size, object) {
15946
+ return fitSize(projection, size, object);
15947
+ }
15948
+ };
15949
+ };
15950
+
15854
15951
  function orthographicRaw(x, y) {
15855
15952
  return [cos$1(y) * sin$1(x), sin$1(y)];
15856
15953
  }
@@ -15861,7 +15958,7 @@ var orthographic = function() {
15861
15958
  return projection(orthographicRaw)
15862
15959
  .scale(249.5)
15863
15960
  .clipAngle(90 + epsilon$4);
15864
- }
15961
+ };
15865
15962
 
15866
15963
  function stereographicRaw(x, y) {
15867
15964
  var cy = cos$1(y), k = 1 + cos$1(x) * cy;
@@ -15876,7 +15973,7 @@ var stereographic = function() {
15876
15973
  return projection(stereographicRaw)
15877
15974
  .scale(250)
15878
15975
  .clipAngle(142);
15879
- }
15976
+ };
15880
15977
 
15881
15978
  function transverseMercatorRaw(lambda, phi) {
15882
15979
  return [log$1(tan((halfPi$3 + phi) / 2)), -lambda];
@@ -15901,7 +15998,7 @@ var transverseMercator = function() {
15901
15998
 
15902
15999
  return rotate([0, 0, 90])
15903
16000
  .scale(159.155);
15904
- }
16001
+ };
15905
16002
 
15906
16003
  exports.version = version;
15907
16004
  exports.bisect = bisectRight;
@@ -16262,6 +16359,8 @@ exports.geoEquirectangularRaw = equirectangularRaw;
16262
16359
  exports.geoGnomonic = gnomonic;
16263
16360
  exports.geoGnomonicRaw = gnomonicRaw;
16264
16361
  exports.geoGraticule = graticule;
16362
+ exports.geoGraticule10 = graticule10;
16363
+ exports.geoIdentity = identity$8;
16265
16364
  exports.geoInterpolate = interpolate$2;
16266
16365
  exports.geoLength = length$2;
16267
16366
  exports.geoMercator = mercator;