d3-rails 3.5.2 → 3.5.5

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: 232c84ecce17e1d7f13f4548d41ea61e6d36512e
4
- data.tar.gz: 5927be0430202eb134dd659e9db92b79a6a2f7c9
3
+ metadata.gz: 88cdeb9247703e587f949972dda80fe6fc798f07
4
+ data.tar.gz: 63f9c3337fa8d07d5174c329be657876137ba62e
5
5
  SHA512:
6
- metadata.gz: 966fcb2b9551092b9b0e22d680633afdfb4d69f55c5372f5a8095b9c33bd0dcd5fa87db02c16ba030604d883fe40a0718a24ba26d1cdb2419cd6bb732f498343
7
- data.tar.gz: d0befe60f2ebbe200107c4ff48ee56b7d2675cbd85ece0f4af394b6e3cc018d58dfa51ca8e4593ea8c2ae8ffc627385ce4cff6666365bd76fcd115632e288d10
6
+ metadata.gz: bd103dec7008780fe6ce3a33868a868b7b006d788ce5fe9101edeb12abc1daff5e583329fa0ea8d78c6725a1e15a350d55e7c33751805c5327bada19440c28b3
7
+ data.tar.gz: 0304c80b02a782b647fc428799739ac9db81adc833641b697a61acbfa900cf2a017aea33a636ce7226d5073590874e99317e037380ef33858e183c9be5e17a18
@@ -1,3 +1,7 @@
1
+ ## 3.5.5 (8 March 2015)
2
+
3
+ * Upgrade D3 to 3.5.5
4
+
1
5
  ## 3.5.2 (16 December 2014)
2
6
 
3
7
  * Upgrade D3 to 3.5.2
data/README.md CHANGED
@@ -6,7 +6,7 @@ d3-rails provides D3 for Rails 3.1 and higher.
6
6
 
7
7
  ## Version
8
8
 
9
- d3-rails comes with version 3.5.2 of D3.js. and will track the always
9
+ d3-rails comes with version 3.5.5 of D3.js. and will track the always
10
10
  mirror the version of D3 it comes with.
11
11
 
12
12
 
@@ -1,36 +1,46 @@
1
1
  !function() {
2
2
  var d3 = {
3
- version: "3.5.2"
4
- };
5
- if (!Date.now) Date.now = function() {
6
- return +new Date();
3
+ version: "3.5.5"
7
4
  };
8
5
  var d3_arraySlice = [].slice, d3_array = function(list) {
9
6
  return d3_arraySlice.call(list);
10
7
  };
11
- var d3_document = document, d3_documentElement = d3_document.documentElement, d3_window = window;
12
- try {
13
- d3_array(d3_documentElement.childNodes)[0].nodeType;
14
- } catch (e) {
15
- d3_array = function(list) {
16
- var i = list.length, array = new Array(i);
17
- while (i--) array[i] = list[i];
18
- return array;
19
- };
8
+ var d3_document = this.document;
9
+ function d3_documentElement(node) {
10
+ return node && (node.ownerDocument || node.document || node).documentElement;
11
+ }
12
+ function d3_window(node) {
13
+ return node && (node.ownerDocument && node.ownerDocument.defaultView || node.document && node || node.defaultView);
14
+ }
15
+ if (d3_document) {
16
+ try {
17
+ d3_array(d3_document.documentElement.childNodes)[0].nodeType;
18
+ } catch (e) {
19
+ d3_array = function(list) {
20
+ var i = list.length, array = new Array(i);
21
+ while (i--) array[i] = list[i];
22
+ return array;
23
+ };
24
+ }
20
25
  }
21
- try {
22
- d3_document.createElement("div").style.setProperty("opacity", 0, "");
23
- } catch (error) {
24
- var d3_element_prototype = d3_window.Element.prototype, d3_element_setAttribute = d3_element_prototype.setAttribute, d3_element_setAttributeNS = d3_element_prototype.setAttributeNS, d3_style_prototype = d3_window.CSSStyleDeclaration.prototype, d3_style_setProperty = d3_style_prototype.setProperty;
25
- d3_element_prototype.setAttribute = function(name, value) {
26
- d3_element_setAttribute.call(this, name, value + "");
27
- };
28
- d3_element_prototype.setAttributeNS = function(space, local, value) {
29
- d3_element_setAttributeNS.call(this, space, local, value + "");
30
- };
31
- d3_style_prototype.setProperty = function(name, value, priority) {
32
- d3_style_setProperty.call(this, name, value + "", priority);
33
- };
26
+ if (!Date.now) Date.now = function() {
27
+ return +new Date();
28
+ };
29
+ if (d3_document) {
30
+ try {
31
+ d3_document.createElement("DIV").style.setProperty("opacity", 0, "");
32
+ } catch (error) {
33
+ var d3_element_prototype = this.Element.prototype, d3_element_setAttribute = d3_element_prototype.setAttribute, d3_element_setAttributeNS = d3_element_prototype.setAttributeNS, d3_style_prototype = this.CSSStyleDeclaration.prototype, d3_style_setProperty = d3_style_prototype.setProperty;
34
+ d3_element_prototype.setAttribute = function(name, value) {
35
+ d3_element_setAttribute.call(this, name, value + "");
36
+ };
37
+ d3_element_prototype.setAttributeNS = function(space, local, value) {
38
+ d3_element_setAttributeNS.call(this, space, local, value + "");
39
+ };
40
+ d3_style_prototype.setProperty = function(name, value, priority) {
41
+ d3_style_setProperty.call(this, name, value + "", priority);
42
+ };
43
+ }
34
44
  }
35
45
  d3.ascending = d3_ascending;
36
46
  function d3_ascending(a, b) {
@@ -443,6 +453,9 @@
443
453
  }
444
454
  });
445
455
  d3.behavior = {};
456
+ function d3_identity(d) {
457
+ return d;
458
+ }
446
459
  d3.rebind = function(target, source) {
447
460
  var i = 1, n = arguments.length, method;
448
461
  while (++i < n) target[method = arguments[i]] = d3_rebind(target, source, source[method]);
@@ -549,8 +562,12 @@
549
562
  return n.querySelector(s);
550
563
  }, d3_selectAll = function(s, n) {
551
564
  return n.querySelectorAll(s);
552
- }, d3_selectMatcher = d3_documentElement.matches || d3_documentElement[d3_vendorSymbol(d3_documentElement, "matchesSelector")], d3_selectMatches = function(n, s) {
553
- return d3_selectMatcher.call(n, s);
565
+ }, d3_selectMatches = function(n, s) {
566
+ var d3_selectMatcher = n.matches || n[d3_vendorSymbol(n, "matchesSelector")];
567
+ d3_selectMatches = function(n, s) {
568
+ return d3_selectMatcher.call(n, s);
569
+ };
570
+ return d3_selectMatches(n, s);
554
571
  };
555
572
  if (typeof Sizzle === "function") {
556
573
  d3_select = function(s, n) {
@@ -560,7 +577,7 @@
560
577
  d3_selectMatches = Sizzle.matchesSelector;
561
578
  }
562
579
  d3.selection = function() {
563
- return d3_selectionRoot;
580
+ return d3.select(d3_document.documentElement);
564
581
  };
565
582
  var d3_selectionPrototype = d3.selection.prototype = [];
566
583
  d3_selectionPrototype.select = function(selector) {
@@ -720,7 +737,10 @@
720
737
  for (priority in name) this.each(d3_selection_style(priority, name[priority], value));
721
738
  return this;
722
739
  }
723
- if (n < 2) return d3_window.getComputedStyle(this.node(), null).getPropertyValue(name);
740
+ if (n < 2) {
741
+ var node = this.node();
742
+ return d3_window(node).getComputedStyle(node, null).getPropertyValue(name);
743
+ }
724
744
  priority = "";
725
745
  }
726
746
  return this.each(d3_selection_style(name, value, priority));
@@ -786,11 +806,14 @@
786
806
  });
787
807
  };
788
808
  function d3_selection_creator(name) {
789
- return typeof name === "function" ? name : (name = d3.ns.qualify(name)).local ? function() {
809
+ function create() {
810
+ var document = this.ownerDocument, namespace = this.namespaceURI;
811
+ return namespace ? document.createElementNS(namespace, name) : document.createElement(name);
812
+ }
813
+ function createNS() {
790
814
  return this.ownerDocument.createElementNS(name.space, name.local);
791
- } : function() {
792
- return this.ownerDocument.createElementNS(this.namespaceURI, name);
793
- };
815
+ }
816
+ return typeof name === "function" ? name : (name = d3.ns.qualify(name)).local ? createNS : create;
794
817
  }
795
818
  d3_selectionPrototype.insert = function(name, before) {
796
819
  name = d3_selection_creator(name);
@@ -1015,16 +1038,27 @@
1015
1038
  };
1016
1039
  }
1017
1040
  d3.select = function(node) {
1018
- var group = [ typeof node === "string" ? d3_select(node, d3_document) : node ];
1019
- group.parentNode = d3_documentElement;
1041
+ var group;
1042
+ if (typeof node === "string") {
1043
+ group = [ d3_select(node, d3_document) ];
1044
+ group.parentNode = d3_document.documentElement;
1045
+ } else {
1046
+ group = [ node ];
1047
+ group.parentNode = d3_documentElement(node);
1048
+ }
1020
1049
  return d3_selection([ group ]);
1021
1050
  };
1022
1051
  d3.selectAll = function(nodes) {
1023
- var group = d3_array(typeof nodes === "string" ? d3_selectAll(nodes, d3_document) : nodes);
1024
- group.parentNode = d3_documentElement;
1052
+ var group;
1053
+ if (typeof nodes === "string") {
1054
+ group = d3_array(d3_selectAll(nodes, d3_document));
1055
+ group.parentNode = d3_document.documentElement;
1056
+ } else {
1057
+ group = nodes;
1058
+ group.parentNode = null;
1059
+ }
1025
1060
  return d3_selection([ group ]);
1026
1061
  };
1027
- var d3_selectionRoot = d3.select(d3_documentElement);
1028
1062
  d3_selectionPrototype.on = function(type, listener, capture) {
1029
1063
  var n = arguments.length;
1030
1064
  if (n < 3) {
@@ -1072,9 +1106,11 @@
1072
1106
  mouseenter: "mouseover",
1073
1107
  mouseleave: "mouseout"
1074
1108
  });
1075
- d3_selection_onFilters.forEach(function(k) {
1076
- if ("on" + k in d3_document) d3_selection_onFilters.remove(k);
1077
- });
1109
+ if (d3_document) {
1110
+ d3_selection_onFilters.forEach(function(k) {
1111
+ if ("on" + k in d3_document) d3_selection_onFilters.remove(k);
1112
+ });
1113
+ }
1078
1114
  function d3_selection_onListener(listener, argumentz) {
1079
1115
  return function(e) {
1080
1116
  var o = d3.event;
@@ -1096,11 +1132,14 @@
1096
1132
  }
1097
1133
  };
1098
1134
  }
1099
- var d3_event_dragSelect = "onselectstart" in d3_document ? null : d3_vendorSymbol(d3_documentElement.style, "userSelect"), d3_event_dragId = 0;
1100
- function d3_event_dragSuppress() {
1101
- var name = ".dragsuppress-" + ++d3_event_dragId, click = "click" + name, w = d3.select(d3_window).on("touchmove" + name, d3_eventPreventDefault).on("dragstart" + name, d3_eventPreventDefault).on("selectstart" + name, d3_eventPreventDefault);
1135
+ var d3_event_dragSelect, d3_event_dragId = 0;
1136
+ function d3_event_dragSuppress(node) {
1137
+ var name = ".dragsuppress-" + ++d3_event_dragId, click = "click" + name, w = d3.select(d3_window(node)).on("touchmove" + name, d3_eventPreventDefault).on("dragstart" + name, d3_eventPreventDefault).on("selectstart" + name, d3_eventPreventDefault);
1138
+ if (d3_event_dragSelect == null) {
1139
+ d3_event_dragSelect = "onselectstart" in node ? false : d3_vendorSymbol(node.style, "userSelect");
1140
+ }
1102
1141
  if (d3_event_dragSelect) {
1103
- var style = d3_documentElement.style, select = style[d3_event_dragSelect];
1142
+ var style = d3_documentElement(node).style, select = style[d3_event_dragSelect];
1104
1143
  style[d3_event_dragSelect] = "none";
1105
1144
  }
1106
1145
  return function(suppressClick) {
@@ -1121,26 +1160,29 @@
1121
1160
  d3.mouse = function(container) {
1122
1161
  return d3_mousePoint(container, d3_eventSource());
1123
1162
  };
1124
- var d3_mouse_bug44083 = /WebKit/.test(d3_window.navigator.userAgent) ? -1 : 0;
1163
+ var d3_mouse_bug44083 = this.navigator && /WebKit/.test(this.navigator.userAgent) ? -1 : 0;
1125
1164
  function d3_mousePoint(container, e) {
1126
1165
  if (e.changedTouches) e = e.changedTouches[0];
1127
1166
  var svg = container.ownerSVGElement || container;
1128
1167
  if (svg.createSVGPoint) {
1129
1168
  var point = svg.createSVGPoint();
1130
- if (d3_mouse_bug44083 < 0 && (d3_window.scrollX || d3_window.scrollY)) {
1131
- svg = d3.select("body").append("svg").style({
1132
- position: "absolute",
1133
- top: 0,
1134
- left: 0,
1135
- margin: 0,
1136
- padding: 0,
1137
- border: "none"
1138
- }, "important");
1139
- var ctm = svg[0][0].getScreenCTM();
1140
- d3_mouse_bug44083 = !(ctm.f || ctm.e);
1141
- svg.remove();
1142
- }
1143
- if (d3_mouse_bug44083) point.x = e.pageX, point.y = e.pageY; else point.x = e.clientX,
1169
+ if (d3_mouse_bug44083 < 0) {
1170
+ var window = d3_window(container);
1171
+ if (window.scrollX || window.scrollY) {
1172
+ svg = d3.select("body").append("svg").style({
1173
+ position: "absolute",
1174
+ top: 0,
1175
+ left: 0,
1176
+ margin: 0,
1177
+ padding: 0,
1178
+ border: "none"
1179
+ }, "important");
1180
+ var ctm = svg[0][0].getScreenCTM();
1181
+ d3_mouse_bug44083 = !(ctm.f || ctm.e);
1182
+ svg.remove();
1183
+ }
1184
+ }
1185
+ if (d3_mouse_bug44083) point.x = e.pageX, point.y = e.pageY; else point.x = e.clientX,
1144
1186
  point.y = e.clientY;
1145
1187
  point = point.matrixTransform(container.getScreenCTM().inverse());
1146
1188
  return [ point.x, point.y ];
@@ -1157,13 +1199,13 @@
1157
1199
  }
1158
1200
  };
1159
1201
  d3.behavior.drag = function() {
1160
- var event = d3_eventDispatch(drag, "drag", "dragstart", "dragend"), origin = null, mousedown = dragstart(d3_noop, d3.mouse, d3_behavior_dragMouseSubject, "mousemove", "mouseup"), touchstart = dragstart(d3_behavior_dragTouchId, d3.touch, d3_behavior_dragTouchSubject, "touchmove", "touchend");
1202
+ var event = d3_eventDispatch(drag, "drag", "dragstart", "dragend"), origin = null, mousedown = dragstart(d3_noop, d3.mouse, d3_window, "mousemove", "mouseup"), touchstart = dragstart(d3_behavior_dragTouchId, d3.touch, d3_identity, "touchmove", "touchend");
1161
1203
  function drag() {
1162
1204
  this.on("mousedown.drag", mousedown).on("touchstart.drag", touchstart);
1163
1205
  }
1164
1206
  function dragstart(id, position, subject, move, end) {
1165
1207
  return function() {
1166
- var that = this, target = d3.event.target, parent = that.parentNode, dispatch = event.of(that, arguments), dragged = 0, dragId = id(), dragName = ".drag" + (dragId == null ? "" : "-" + dragId), dragOffset, dragSubject = d3.select(subject()).on(move + dragName, moved).on(end + dragName, ended), dragRestore = d3_event_dragSuppress(), position0 = position(parent, dragId);
1208
+ var that = this, target = d3.event.target, parent = that.parentNode, dispatch = event.of(that, arguments), dragged = 0, dragId = id(), dragName = ".drag" + (dragId == null ? "" : "-" + dragId), dragOffset, dragSubject = d3.select(subject(target)).on(move + dragName, moved).on(end + dragName, ended), dragRestore = d3_event_dragSuppress(target), position0 = position(parent, dragId);
1167
1209
  if (origin) {
1168
1210
  dragOffset = origin.apply(that, arguments);
1169
1211
  dragOffset = [ dragOffset.x - position0[0], dragOffset.y - position0[1] ];
@@ -1208,12 +1250,6 @@
1208
1250
  function d3_behavior_dragTouchId() {
1209
1251
  return d3.event.changedTouches[0].identifier;
1210
1252
  }
1211
- function d3_behavior_dragTouchSubject() {
1212
- return d3.event.target;
1213
- }
1214
- function d3_behavior_dragMouseSubject() {
1215
- return d3_window;
1216
- }
1217
1253
  d3.touches = function(container, touches) {
1218
1254
  if (arguments.length < 2) touches = d3_eventSource().touches;
1219
1255
  return touches ? d3_array(touches).map(function(touch) {
@@ -1268,6 +1304,15 @@
1268
1304
  y: 0,
1269
1305
  k: 1
1270
1306
  }, translate0, center0, center, size = [ 960, 500 ], scaleExtent = d3_behavior_zoomInfinity, duration = 250, zooming = 0, mousedown = "mousedown.zoom", mousemove = "mousemove.zoom", mouseup = "mouseup.zoom", mousewheelTimer, touchstart = "touchstart.zoom", touchtime, event = d3_eventDispatch(zoom, "zoomstart", "zoom", "zoomend"), x0, x1, y0, y1;
1307
+ if (!d3_behavior_zoomWheel) {
1308
+ d3_behavior_zoomWheel = "onwheel" in d3_document ? (d3_behavior_zoomDelta = function() {
1309
+ return -d3.event.deltaY * (d3.event.deltaMode ? 120 : 1);
1310
+ }, "wheel") : "onmousewheel" in d3_document ? (d3_behavior_zoomDelta = function() {
1311
+ return d3.event.wheelDelta;
1312
+ }, "mousewheel") : (d3_behavior_zoomDelta = function() {
1313
+ return -d3.event.detail;
1314
+ }, "MozMousePixelScroll");
1315
+ }
1271
1316
  function zoom(g) {
1272
1317
  g.on(mousedown, mousedowned).on(d3_behavior_zoomWheel + ".zoom", mousewheeled).on("dblclick.zoom", dblclicked).on(touchstart, touchstarted);
1273
1318
  }
@@ -1422,7 +1467,7 @@
1422
1467
  center0 = null;
1423
1468
  }
1424
1469
  function mousedowned() {
1425
- var that = this, target = d3.event.target, dispatch = event.of(that, arguments), dragged = 0, subject = d3.select(d3_window).on(mousemove, moved).on(mouseup, ended), location0 = location(d3.mouse(that)), dragRestore = d3_event_dragSuppress();
1470
+ var that = this, target = d3.event.target, dispatch = event.of(that, arguments), dragged = 0, subject = d3.select(d3_window(that)).on(mousemove, moved).on(mouseup, ended), location0 = location(d3.mouse(that)), dragRestore = d3_event_dragSuppress(that);
1426
1471
  d3_selection_interrupt.call(that);
1427
1472
  zoomstarted(dispatch);
1428
1473
  function moved() {
@@ -1437,7 +1482,7 @@
1437
1482
  }
1438
1483
  }
1439
1484
  function touchstarted() {
1440
- var that = this, dispatch = event.of(that, arguments), locations0 = {}, distance0 = 0, scale0, zoomName = ".zoom-" + d3.event.changedTouches[0].identifier, touchmove = "touchmove" + zoomName, touchend = "touchend" + zoomName, targets = [], subject = d3.select(that), dragRestore = d3_event_dragSuppress();
1485
+ var that = this, dispatch = event.of(that, arguments), locations0 = {}, distance0 = 0, scale0, zoomName = ".zoom-" + d3.event.changedTouches[0].identifier, touchmove = "touchmove" + zoomName, touchend = "touchend" + zoomName, targets = [], subject = d3.select(that), dragRestore = d3_event_dragSuppress(that);
1441
1486
  started();
1442
1487
  zoomstarted(dispatch);
1443
1488
  subject.on(mousedown, null).on(touchstart, started);
@@ -1508,7 +1553,7 @@
1508
1553
  }
1509
1554
  function mousewheeled() {
1510
1555
  var dispatch = event.of(this, arguments);
1511
- if (mousewheelTimer) clearTimeout(mousewheelTimer); else translate0 = location(center0 = center || d3.mouse(this)),
1556
+ if (mousewheelTimer) clearTimeout(mousewheelTimer); else translate0 = location(center0 = center || d3.mouse(this)),
1512
1557
  d3_selection_interrupt.call(this), zoomstarted(dispatch);
1513
1558
  mousewheelTimer = setTimeout(function() {
1514
1559
  mousewheelTimer = null;
@@ -1525,14 +1570,7 @@
1525
1570
  }
1526
1571
  return d3.rebind(zoom, event, "on");
1527
1572
  };
1528
- var d3_behavior_zoomInfinity = [ 0, Infinity ];
1529
- var d3_behavior_zoomDelta, d3_behavior_zoomWheel = "onwheel" in d3_document ? (d3_behavior_zoomDelta = function() {
1530
- return -d3.event.deltaY * (d3.event.deltaMode ? 120 : 1);
1531
- }, "wheel") : "onmousewheel" in d3_document ? (d3_behavior_zoomDelta = function() {
1532
- return d3.event.wheelDelta;
1533
- }, "mousewheel") : (d3_behavior_zoomDelta = function() {
1534
- return -d3.event.detail;
1535
- }, "MozMousePixelScroll");
1573
+ var d3_behavior_zoomInfinity = [ 0, Infinity ], d3_behavior_zoomDelta, d3_behavior_zoomWheel;
1536
1574
  d3.color = d3_color;
1537
1575
  function d3_color() {}
1538
1576
  d3_color.prototype.toString = function() {
@@ -1677,7 +1715,9 @@
1677
1715
  }
1678
1716
  }
1679
1717
  }
1680
- if (color = d3_rgb_names.get(format)) return rgb(color.r, color.g, color.b);
1718
+ if (color = d3_rgb_names.get(format.toLowerCase())) {
1719
+ return rgb(color.r, color.g, color.b);
1720
+ }
1681
1721
  if (format != null && format.charAt(0) === "#" && !isNaN(color = parseInt(format.slice(1), 16))) {
1682
1722
  if (format.length === 4) {
1683
1723
  r = (color & 3840) >> 4;
@@ -1840,6 +1880,7 @@
1840
1880
  plum: 14524637,
1841
1881
  powderblue: 11591910,
1842
1882
  purple: 8388736,
1883
+ rebeccapurple: 6697881,
1843
1884
  red: 16711680,
1844
1885
  rosybrown: 12357519,
1845
1886
  royalblue: 4286945,
@@ -1878,20 +1919,17 @@
1878
1919
  };
1879
1920
  }
1880
1921
  d3.functor = d3_functor;
1881
- function d3_identity(d) {
1882
- return d;
1883
- }
1884
1922
  d3.xhr = d3_xhrType(d3_identity);
1885
1923
  function d3_xhrType(response) {
1886
1924
  return function(url, mimeType, callback) {
1887
- if (arguments.length === 2 && typeof mimeType === "function") callback = mimeType,
1925
+ if (arguments.length === 2 && typeof mimeType === "function") callback = mimeType,
1888
1926
  mimeType = null;
1889
1927
  return d3_xhr(url, mimeType, response, callback);
1890
1928
  };
1891
1929
  }
1892
1930
  function d3_xhr(url, mimeType, response, callback) {
1893
1931
  var xhr = {}, dispatch = d3.dispatch("beforesend", "progress", "load", "error"), headers = {}, request = new XMLHttpRequest(), responseType = null;
1894
- if (d3_window.XDomainRequest && !("withCredentials" in request) && /^(http(s)?:)?\/\//.test(url)) request = new XDomainRequest();
1932
+ if (this.XDomainRequest && !("withCredentials" in request) && /^(http(s)?:)?\/\//.test(url)) request = new XDomainRequest();
1895
1933
  "onload" in request ? request.onload = request.onerror = respond : request.onreadystatechange = function() {
1896
1934
  request.readyState > 3 && respond();
1897
1935
  };
@@ -2076,8 +2114,8 @@
2076
2114
  return dsv;
2077
2115
  };
2078
2116
  d3.csv = d3.dsv(",", "text/csv");
2079
- d3.tsv = d3.dsv(" ", "text/tab-separated-values");
2080
- var d3_timer_queueHead, d3_timer_queueTail, d3_timer_interval, d3_timer_timeout, d3_timer_active, d3_timer_frame = d3_window[d3_vendorSymbol(d3_window, "requestAnimationFrame")] || function(callback) {
2117
+ d3.tsv = d3.dsv(" ", "text/tab-separated-values");
2118
+ var d3_timer_queueHead, d3_timer_queueTail, d3_timer_interval, d3_timer_timeout, d3_timer_active, d3_timer_frame = this[d3_vendorSymbol(this, "requestAnimationFrame")] || function(callback) {
2081
2119
  setTimeout(callback, 17);
2082
2120
  };
2083
2121
  d3.timer = function(callback, delay, then) {
@@ -2722,7 +2760,7 @@
2722
2760
  return n ? (date.y = d3_time_expandYear(+n[0]), i + n[0].length) : -1;
2723
2761
  }
2724
2762
  function d3_time_parseZone(date, string, i) {
2725
- return /^[+-]\d{4}$/.test(string = string.slice(i, i + 5)) ? (date.Z = -string,
2763
+ return /^[+-]\d{4}$/.test(string = string.slice(i, i + 5)) ? (date.Z = -string,
2726
2764
  i + 5) : -1;
2727
2765
  }
2728
2766
  function d3_time_expandYear(d) {
@@ -2915,7 +2953,7 @@
2915
2953
  var λ00, φ00, λ0, cosφ0, sinφ0;
2916
2954
  d3_geo_area.point = function(λ, φ) {
2917
2955
  d3_geo_area.point = nextPoint;
2918
- λ0 = (λ00 = λ) * d3_radians, cosφ0 = Math.cos(φ = (φ00 = φ) * d3_radians / 2 + π / 4),
2956
+ λ0 = (λ00 = λ) * d3_radians, cosφ0 = Math.cos(φ = (φ00 = φ) * d3_radians / 2 + π / 4),
2919
2957
  sinφ0 = Math.sin(φ);
2920
2958
  };
2921
2959
  function nextPoint(λ, φ) {
@@ -4744,7 +4782,7 @@
4744
4782
  return _ ? center([ -_[1], _[0] ]) : (_ = center(), [ _[1], -_[0] ]);
4745
4783
  };
4746
4784
  projection.rotate = function(_) {
4747
- return _ ? rotate([ _[0], _[1], _.length > 2 ? _[2] + 90 : 90 ]) : (_ = rotate(),
4785
+ return _ ? rotate([ _[0], _[1], _.length > 2 ? _[2] + 90 : 90 ]) : (_ = rotate(),
4748
4786
  [ _[0], _[1], _[2] - 90 ]);
4749
4787
  };
4750
4788
  return rotate([ 0, 0, 90 ]);
@@ -5598,7 +5636,7 @@
5598
5636
  };
5599
5637
  quadtree.extent = function(_) {
5600
5638
  if (!arguments.length) return x1 == null ? null : [ [ x1, y1 ], [ x2, y2 ] ];
5601
- if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = +_[0][0], y1 = +_[0][1], x2 = +_[1][0],
5639
+ if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = +_[0][0], y1 = +_[0][1], x2 = +_[1][0],
5602
5640
  y2 = +_[1][1];
5603
5641
  return quadtree;
5604
5642
  };
@@ -5638,7 +5676,7 @@
5638
5676
  (function find(node, x1, y1, x2, y2) {
5639
5677
  if (x1 > x3 || y1 > y3 || x2 < x0 || y2 < y0) return;
5640
5678
  if (point = node.point) {
5641
- var point, dx = x - point[0], dy = y - point[1], distance2 = dx * dx + dy * dy;
5679
+ var point, dx = x - node.x, dy = y - node.y, distance2 = dx * dx + dy * dy;
5642
5680
  if (distance2 < minDistance2) {
5643
5681
  var distance = Math.sqrt(minDistance2 = distance2);
5644
5682
  x0 = x - distance, y0 = y - distance;
@@ -6352,8 +6390,8 @@
6352
6390
  neighbors[o.target.index].push(o.source);
6353
6391
  }
6354
6392
  }
6355
- var candidates = neighbors[i], j = -1, m = candidates.length, x;
6356
- while (++j < m) if (!isNaN(x = candidates[j][dimension])) return x;
6393
+ var candidates = neighbors[i], j = -1, l = candidates.length, x;
6394
+ while (++j < l) if (!isNaN(x = candidates[j][dimension])) return x;
6357
6395
  return Math.random() * size;
6358
6396
  }
6359
6397
  return force.resume();
@@ -7302,7 +7340,7 @@
7302
7340
  return d3_layout_treemapPad(node, x);
7303
7341
  }
7304
7342
  var type;
7305
- pad = (padding = x) == null ? d3_layout_treemapPadNull : (type = typeof x) === "function" ? padFunction : type === "number" ? (x = [ x, x, x, x ],
7343
+ pad = (padding = x) == null ? d3_layout_treemapPadNull : (type = typeof x) === "function" ? padFunction : type === "number" ? (x = [ x, x, x, x ],
7306
7344
  padConstant) : padConstant;
7307
7345
  return treemap;
7308
7346
  };
@@ -7602,7 +7640,7 @@
7602
7640
  scale.tickFormat = function(n, format) {
7603
7641
  if (!arguments.length) return d3_scale_logFormat;
7604
7642
  if (arguments.length < 2) format = d3_scale_logFormat; else if (typeof format !== "function") format = d3.format(format);
7605
- var k = Math.max(.1, n / scale.ticks().length), f = positive ? (e = 1e-12, Math.ceil) : (e = -1e-12,
7643
+ var k = Math.max(.1, n / scale.ticks().length), f = positive ? (e = 1e-12, Math.ceil) : (e = -1e-12,
7606
7644
  Math.floor), e;
7607
7645
  return function(d) {
7608
7646
  return d / pow(f(log(d) + e)) <= k ? format(d) : "";
@@ -7702,7 +7740,7 @@
7702
7740
  };
7703
7741
  scale.rangePoints = function(x, padding) {
7704
7742
  if (arguments.length < 2) padding = 0;
7705
- var start = x[0], stop = x[1], step = domain.length < 2 ? (start = (start + stop) / 2,
7743
+ var start = x[0], stop = x[1], step = domain.length < 2 ? (start = (start + stop) / 2,
7706
7744
  0) : (stop - start) / (domain.length - 1 + padding);
7707
7745
  range = steps(start + step * padding / 2, step);
7708
7746
  rangeBand = 0;
@@ -7714,7 +7752,7 @@
7714
7752
  };
7715
7753
  scale.rangeRoundPoints = function(x, padding) {
7716
7754
  if (arguments.length < 2) padding = 0;
7717
- var start = x[0], stop = x[1], step = domain.length < 2 ? (start = stop = Math.round((start + stop) / 2),
7755
+ var start = x[0], stop = x[1], step = domain.length < 2 ? (start = stop = Math.round((start + stop) / 2),
7718
7756
  0) : (stop - start) / (domain.length - 1 + padding) | 0;
7719
7757
  range = steps(start + Math.round(step * padding / 2 + (stop - start - (domain.length - 1 + padding) * step) / 2), step);
7720
7758
  rangeBand = 0;
@@ -8137,7 +8175,7 @@
8137
8175
  return points.length < 4 ? d3_svg_lineLinear(points) : points[1] + d3_svg_lineHermite(points.slice(1, -1), d3_svg_lineCardinalTangents(points, tension));
8138
8176
  }
8139
8177
  function d3_svg_lineCardinalClosed(points, tension) {
8140
- return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite((points.push(points[0]),
8178
+ return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite((points.push(points[0]),
8141
8179
  points), d3_svg_lineCardinalTangents([ points[points.length - 2] ].concat(points, [ points[1] ]), tension));
8142
8180
  }
8143
8181
  function d3_svg_lineCardinal(points, tension) {
@@ -8575,12 +8613,8 @@
8575
8613
  return function() {
8576
8614
  var lock, active;
8577
8615
  if ((lock = this[ns]) && (active = lock[lock.active])) {
8578
- if (--lock.count) {
8579
- delete lock[lock.active];
8580
- lock.active += .5;
8581
- } else {
8582
- delete this[ns];
8583
- }
8616
+ if (--lock.count) delete lock[lock.active]; else delete this[ns];
8617
+ lock.active += .5;
8584
8618
  active.event && active.event.interrupt.call(this, this.__data__, active.index);
8585
8619
  }
8586
8620
  };
@@ -8597,7 +8631,7 @@
8597
8631
  d3_transitionPrototype.node = d3_selectionPrototype.node;
8598
8632
  d3_transitionPrototype.size = d3_selectionPrototype.size;
8599
8633
  d3.transition = function(selection, name) {
8600
- return selection && selection.transition ? d3_transitionInheritId ? selection.transition(name) : selection : d3_selectionRoot.transition(selection);
8634
+ return selection && selection.transition ? d3_transitionInheritId ? selection.transition(name) : selection : d3.selection().transition(selection);
8601
8635
  };
8602
8636
  d3.transition.prototype = d3_transitionPrototype;
8603
8637
  d3_transitionPrototype.select = function(selector) {
@@ -8726,7 +8760,7 @@
8726
8760
  }
8727
8761
  function styleString(b) {
8728
8762
  return b == null ? styleNull : (b += "", function() {
8729
- var a = d3_window.getComputedStyle(this, null).getPropertyValue(name), i;
8763
+ var a = d3_window(this).getComputedStyle(this, null).getPropertyValue(name), i;
8730
8764
  return a !== b && (i = d3_interpolate(a, b), function(t) {
8731
8765
  this.style.setProperty(name, i(t), priority);
8732
8766
  });
@@ -8737,7 +8771,7 @@
8737
8771
  d3_transitionPrototype.styleTween = function(name, tween, priority) {
8738
8772
  if (arguments.length < 3) priority = "";
8739
8773
  function styleTween(d, i) {
8740
- var f = tween.call(this, d, i, d3_window.getComputedStyle(this, null).getPropertyValue(name));
8774
+ var f = tween.call(this, d, i, d3_window(this).getComputedStyle(this, null).getPropertyValue(name));
8741
8775
  return f && function(t) {
8742
8776
  this.style.setProperty(name, f(t), priority);
8743
8777
  };
@@ -8899,7 +8933,7 @@
8899
8933
  var g = d3.select(this);
8900
8934
  var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = scale.copy();
8901
8935
  var ticks = tickValues == null ? scale1.ticks ? scale1.ticks.apply(scale1, tickArguments_) : scale1.domain() : tickValues, tickFormat = tickFormat_ == null ? scale1.tickFormat ? scale1.tickFormat.apply(scale1, tickArguments_) : d3_identity : tickFormat_, tick = g.selectAll(".tick").data(ticks, scale1), tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick").style("opacity", ε), tickExit = d3.transition(tick.exit()).style("opacity", ε).remove(), tickUpdate = d3.transition(tick.order()).style("opacity", 1), tickSpacing = Math.max(innerTickSize, 0) + tickPadding, tickTransform;
8902
- var range = d3_scaleRange(scale1), path = g.selectAll(".domain").data([ 0 ]), pathUpdate = (path.enter().append("path").attr("class", "domain"),
8936
+ var range = d3_scaleRange(scale1), path = g.selectAll(".domain").data([ 0 ]), pathUpdate = (path.enter().append("path").attr("class", "domain"),
8903
8937
  d3.transition(path));
8904
8938
  tickEnter.append("line");
8905
8939
  tickEnter.append("text");
@@ -9103,8 +9137,8 @@
9103
9137
  g.selectAll(".extent,.e>rect,.w>rect").attr("height", yExtent[1] - yExtent[0]);
9104
9138
  }
9105
9139
  function brushstart() {
9106
- var target = this, eventTarget = d3.select(d3.event.target), event_ = event.of(target, arguments), g = d3.select(target), resizing = eventTarget.datum(), resizingX = !/^(n|s)$/.test(resizing) && x, resizingY = !/^(e|w)$/.test(resizing) && y, dragging = eventTarget.classed("extent"), dragRestore = d3_event_dragSuppress(), center, origin = d3.mouse(target), offset;
9107
- var w = d3.select(d3_window).on("keydown.brush", keydown).on("keyup.brush", keyup);
9140
+ var target = this, eventTarget = d3.select(d3.event.target), event_ = event.of(target, arguments), g = d3.select(target), resizing = eventTarget.datum(), resizingX = !/^(n|s)$/.test(resizing) && x, resizingY = !/^(e|w)$/.test(resizing) && y, dragging = eventTarget.classed("extent"), dragRestore = d3_event_dragSuppress(target), center, origin = d3.mouse(target), offset;
9141
+ var w = d3.select(d3_window(target)).on("keydown.brush", keydown).on("keyup.brush", keyup);
9108
9142
  if (d3.event.changedTouches) {
9109
9143
  w.on("touchmove.brush", brushmove).on("touchend.brush", brushend);
9110
9144
  } else {