Skip to content

Commit a30a79a

Browse files
committed
Merge branch '3.4.10'
2 parents 64f0156 + 0622785 commit a30a79a

File tree

8 files changed

+23
-43
lines changed

8 files changed

+23
-43
lines changed

bower.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.4.9",
3+
"version": "3.4.10",
44
"main": "d3.js",
55
"scripts": [
66
"d3.js"

component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"animation",
1111
"canvas"
1212
],
13-
"version": "3.4.9",
13+
"version": "3.4.10",
1414
"main": "d3.js",
1515
"scripts": [
1616
"d3.js"

d3.js

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
!function() {
22
var d3 = {
3-
version: "3.4.9"
3+
version: "3.4.10"
44
};
55
if (!Date.now) Date.now = function() {
66
return +new Date();
@@ -1227,9 +1227,9 @@
12271227
x: 0,
12281228
y: 0,
12291229
k: 1
1230-
}, translate0, center, size = [ 960, 500 ], scaleExtent = d3_behavior_zoomInfinity, 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;
1230+
}, translate0, center0, center, size = [ 960, 500 ], scaleExtent = d3_behavior_zoomInfinity, 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;
12311231
function zoom(g) {
1232-
g.on(mousedown, mousedowned).on(d3_behavior_zoomWheel + ".zoom", mousewheeled).on(mousemove, mousewheelreset).on("dblclick.zoom", dblclicked).on(touchstart, touchstarted);
1232+
g.on(mousedown, mousedowned).on(d3_behavior_zoomWheel + ".zoom", mousewheeled).on("dblclick.zoom", dblclicked).on(touchstart, touchstarted);
12331233
}
12341234
zoom.event = function(g) {
12351235
g.each(function() {
@@ -1371,7 +1371,7 @@
13711371
zoomed(dispatch);
13721372
}
13731373
function ended() {
1374-
subject.on(mousemove, d3_window === that ? mousewheelreset : null).on(mouseup, null);
1374+
subject.on(mousemove, null).on(mouseup, null);
13751375
dragRestore(dragged && d3.event.target === target);
13761376
zoomended(dispatch);
13771377
}
@@ -1449,22 +1449,17 @@
14491449
}
14501450
function mousewheeled() {
14511451
var dispatch = event.of(this, arguments);
1452-
if (mousewheelTimer) clearTimeout(mousewheelTimer); else d3_selection_interrupt.call(this),
1453-
zoomstarted(dispatch);
1452+
if (mousewheelTimer) clearTimeout(mousewheelTimer); else translate0 = location(center0 = center || d3.mouse(this)),
1453+
d3_selection_interrupt.call(this), zoomstarted(dispatch);
14541454
mousewheelTimer = setTimeout(function() {
14551455
mousewheelTimer = null;
14561456
zoomended(dispatch);
14571457
}, 50);
14581458
d3_eventPreventDefault();
1459-
var point = center || d3.mouse(this);
1460-
if (!translate0) translate0 = location(point);
14611459
scaleTo(Math.pow(2, d3_behavior_zoomDelta() * .002) * view.k);
1462-
translateTo(point, translate0);
1460+
translateTo(center0, translate0);
14631461
zoomed(dispatch);
14641462
}
1465-
function mousewheelreset() {
1466-
translate0 = null;
1467-
}
14681463
function dblclicked() {
14691464
var dispatch = event.of(this, arguments), p = d3.mouse(this), l = location(p), k = Math.log(view.k) / Math.LN2;
14701465
zoomstarted(dispatch);
@@ -9233,11 +9228,6 @@
92339228
d3.xml = d3_xhrType(function(request) {
92349229
return request.responseXML;
92359230
});
9236-
if (typeof define === "function" && define.amd) {
9237-
define(d3);
9238-
} else if (typeof module === "object" && module.exports) {
9239-
module.exports = d3;
9240-
} else {
9241-
this.d3 = d3;
9242-
}
9231+
if (typeof define === "function" && define.amd) define(d3); else if (typeof module === "object" && module.exports) module.exports = d3;
9232+
this.d3 = d3;
92439233
}();

d3.min.js

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

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.4.9",
3+
"version": "3.4.10",
44
"description": "A small, free JavaScript library for manipulating documents based on data.",
55
"keywords": [
66
"dom",

src/behavior/zoom.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import "behavior";
1111
d3.behavior.zoom = function() {
1212
var view = {x: 0, y: 0, k: 1},
1313
translate0, // translate when we started zooming (to avoid drift)
14-
center, // desired position of translate0 after zooming
14+
center0, // implicit desired position of translate0 after zooming
15+
center, // explicit desired position of translate0 after zooming
1516
size = [960, 500], // viewport size; required for zoom interpolation
1617
scaleExtent = d3_behavior_zoomInfinity,
1718
mousedown = "mousedown.zoom",
@@ -29,7 +30,6 @@ d3.behavior.zoom = function() {
2930
function zoom(g) {
3031
g .on(mousedown, mousedowned)
3132
.on(d3_behavior_zoomWheel + ".zoom", mousewheeled)
32-
.on(mousemove, mousewheelreset)
3333
.on("dblclick.zoom", dblclicked)
3434
.on(touchstart, touchstarted);
3535
}
@@ -174,7 +174,7 @@ d3.behavior.zoom = function() {
174174
}
175175

176176
function ended() {
177-
subject.on(mousemove, d3_window === that ? mousewheelreset : null).on(mouseup, null);
177+
subject.on(mousemove, null).on(mouseup, null);
178178
dragRestore(dragged && d3.event.target === target);
179179
zoomended(dispatch);
180180
}
@@ -291,20 +291,14 @@ d3.behavior.zoom = function() {
291291
function mousewheeled() {
292292
var dispatch = event.of(this, arguments);
293293
if (mousewheelTimer) clearTimeout(mousewheelTimer);
294-
else d3_selection_interrupt.call(this), zoomstarted(dispatch);
294+
else translate0 = location(center0 = center || d3.mouse(this)), d3_selection_interrupt.call(this), zoomstarted(dispatch);
295295
mousewheelTimer = setTimeout(function() { mousewheelTimer = null; zoomended(dispatch); }, 50);
296296
d3_eventPreventDefault();
297-
var point = center || d3.mouse(this);
298-
if (!translate0) translate0 = location(point);
299297
scaleTo(Math.pow(2, d3_behavior_zoomDelta() * .002) * view.k);
300-
translateTo(point, translate0);
298+
translateTo(center0, translate0);
301299
zoomed(dispatch);
302300
}
303301

304-
function mousewheelreset() {
305-
translate0 = null;
306-
}
307-
308302
function dblclicked() {
309303
var dispatch = event.of(this, arguments),
310304
p = d3.mouse(this),

src/end.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
if (typeof define === "function" && define.amd) {
2-
define(d3);
3-
} else if (typeof module === "object" && module.exports) {
4-
module.exports = d3;
5-
} else {
6-
this.d3 = d3;
7-
}
1+
if (typeof define === "function" && define.amd) define(d3);
2+
else if (typeof module === "object" && module.exports) module.exports = d3;
3+
this.d3 = d3;
84
}();

src/start.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
!function(){
2-
var d3 = {version: "3.4.9"}; // semver
2+
var d3 = {version: "3.4.10"}; // semver

0 commit comments

Comments
 (0)