Skip to content

Commit 35ac9dd

Browse files
committed
Merge branch '3.0.6'
2 parents 183060d + a716468 commit 35ac9dd

43 files changed

Lines changed: 424 additions & 301 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ all: \
2727
src/end.js
2828

2929
d3.core.js: \
30+
src/core/core.js \
3031
src/core/format-$(LOCALE).js \
3132
src/compat/date.js \
3233
src/compat/style.js \
33-
src/core/core.js \
3434
src/core/class.js \
3535
src/core/array.js \
3636
src/core/map.js \

component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"name": "d3",
3-
"version": "3.0.5",
3+
"version": "3.0.6",
44
"main": "./d3.js"
55
}

d3.js

Lines changed: 97 additions & 113 deletions
Large diffs are not rendered by default.

d3.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

globals.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
var document = global.document = require("jsdom").jsdom("<html><head></head><body></body></html>"),
2-
window = global.window = document.createWindow(),
3-
navigator = global.navigator = window.navigator,
4-
getComputedStyle = global.getComputedStyle = window.getComputedStyle,
5-
CSSStyleDeclaration = global.CSSStyleDeclaration = window.CSSStyleDeclaration;
2+
window = global.window = document.createWindow();
63

74
// https://github.com/chad3814/CSSStyleDeclaration/issues/3
8-
var CSSStyleDeclaration_setProperty = CSSStyleDeclaration.prototype.setProperty;
9-
CSSStyleDeclaration.prototype.setProperty = function(name, value, priority) {
5+
var CSSStyleDeclaration_prototype = window.CSSStyleDeclaration.prototype,
6+
CSSStyleDeclaration_setProperty = CSSStyleDeclaration_prototype.setProperty;
7+
CSSStyleDeclaration_prototype.setProperty = function(name, value, priority) {
108
return CSSStyleDeclaration_setProperty.call(this, name + "", value == null ? null : value + "", priority == null ? null : priority + "");
119
};

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var globals = ["document", "window", "navigator", "CSSStyleDeclaration", "getComputedStyle", "d3"],
1+
var globals = ["document", "window", "d3"],
22
globalValues = {};
33

44
globals.forEach(function(g) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "d3",
3-
"version": "3.0.5",
3+
"version": "3.0.6",
44
"description": "A small, free JavaScript library for manipulating documents based on data.",
55
"keywords": [
66
"dom",

src/behavior/drag.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ d3.behavior.drag = function() {
1616
origin_ = point(),
1717
moved = 0;
1818

19-
var w = d3.select(window)
19+
var w = d3.select(d3_window)
2020
.on(touchId != null ? "touchmove.drag-" + touchId : "mousemove.drag", dragmove)
2121
.on(touchId != null ? "touchend.drag-" + touchId : "mouseup.drag", dragend, true);
2222

src/behavior/zoom.js

Lines changed: 10 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@ d3.behavior.zoom = function() {
1212
touchtime; // time of last touchstart (to detect double-tap)
1313

1414
function zoom() {
15-
this
16-
.on("mousedown.zoom", mousedown)
17-
.on("mousewheel.zoom", mousewheel)
15+
this.on("mousedown.zoom", mousedown)
1816
.on("mousemove.zoom", mousemove)
19-
.on("DOMMouseScroll.zoom", mousewheel)
17+
.on(d3_behavior_zoomWheel + ".zoom", mousewheel)
2018
.on("dblclick.zoom", dblclick)
2119
.on("touchstart.zoom", touchstart)
2220
.on("touchmove.zoom", touchmove)
@@ -95,10 +93,10 @@ d3.behavior.zoom = function() {
9593
event_ = event.of(target, arguments),
9694
eventTarget = d3.event.target,
9795
moved = 0,
98-
w = d3.select(window).on("mousemove.zoom", mousemove).on("mouseup.zoom", mouseup),
96+
w = d3.select(d3_window).on("mousemove.zoom", mousemove).on("mouseup.zoom", mouseup),
9997
l = location(d3.mouse(target));
10098

101-
window.focus();
99+
d3_window.focus();
102100
d3_eventCancel();
103101

104102
function mousemove() {
@@ -175,34 +173,10 @@ d3.behavior.zoom = function() {
175173
return d3.rebind(zoom, event, "on");
176174
};
177175

178-
var d3_behavior_zoomDiv, // for interpreting mousewheel events
179-
d3_behavior_zoomInfinity = [0, Infinity]; // default scale extent
180-
181-
function d3_behavior_zoomDelta() {
182-
183-
// mousewheel events are totally broken!
184-
// https://bugs.webkit.org/show_bug.cgi?id=40441
185-
// not only that, but Chrome and Safari differ in re. to acceleration!
186-
if (!d3_behavior_zoomDiv) {
187-
d3_behavior_zoomDiv = d3.select("body").append("div")
188-
.style("visibility", "hidden")
189-
.style("top", 0)
190-
.style("height", 0)
191-
.style("width", 0)
192-
.style("overflow-y", "scroll")
193-
.append("div")
194-
.style("height", "2000px")
195-
.node().parentNode;
196-
}
197-
198-
var e = d3.event, delta;
199-
try {
200-
d3_behavior_zoomDiv.scrollTop = 1000;
201-
d3_behavior_zoomDiv.dispatchEvent(e);
202-
delta = 1000 - d3_behavior_zoomDiv.scrollTop;
203-
} catch (error) {
204-
delta = e.wheelDelta || (-e.detail * 5);
205-
}
176+
var d3_behavior_zoomInfinity = [0, Infinity]; // default scale extent
206177

207-
return delta;
208-
}
178+
// https://developer.mozilla.org/en-US/docs/Mozilla_event_reference/wheel
179+
var d3_behavior_zoomDelta, d3_behavior_zoomWheel
180+
= "onwheel" in document ? (d3_behavior_zoomDelta = function() { return -d3.event.deltaY * (d3.event.deltaMode ? 120 : 1); }, "wheel")
181+
: "onmousewheel" in document ? (d3_behavior_zoomDelta = function() { return d3.event.wheelDelta; }, "mousewheel")
182+
: (d3_behavior_zoomDelta = function() { return -d3.event.detail; }, "MozMousePixelScroll");

src/compat/style.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
try {
2-
document.createElement("div").style.setProperty("opacity", 0, "");
2+
d3_document.createElement("div").style.setProperty("opacity", 0, "");
33
} catch (error) {
4-
var d3_style_prototype = CSSStyleDeclaration.prototype,
4+
var d3_style_prototype = d3_window.CSSStyleDeclaration.prototype,
55
d3_style_setProperty = d3_style_prototype.setProperty;
66
d3_style_prototype.setProperty = function(name, value, priority) {
77
d3_style_setProperty.call(this, name, value + "", priority);

0 commit comments

Comments
 (0)