From 71a3d3e4f6bf2dd726743e59910fa56685da467d Mon Sep 17 00:00:00 2001 From: Kushan Joshi <0o3ko0@gmail.com> Date: Wed, 8 Jun 2016 18:07:20 +0530 Subject: [PATCH 1/2] Patch d3's mousewheeled function (closes #2773) --- js/lib/d3.v3.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/js/lib/d3.v3.js b/js/lib/d3.v3.js index e05ce8547..425122a37 100644 --- a/js/lib/d3.v3.js +++ b/js/lib/d3.v3.js @@ -1820,8 +1820,7 @@ d3.behavior.zoom = function() { } function zoomended(dispatch) { - if (!--zooming) dispatch({type: "zoomend"}); - center0 = null; + if (!--zooming) dispatch({type: "zoomend"}), center0 = null; } function mousedowned() { @@ -1964,7 +1963,7 @@ d3.behavior.zoom = function() { function mousewheeled() { var dispatch = event.of(this, arguments); if (mousewheelTimer) clearTimeout(mousewheelTimer); - else translate0 = location(center0 = center || d3.mouse(this)), d3_selection_interrupt.call(this), zoomstarted(dispatch); + else d3_selection_interrupt.call(this), translate0 = location(center0 = center || d3.mouse(this)), zoomstarted(dispatch); mousewheelTimer = setTimeout(function() { mousewheelTimer = null; zoomended(dispatch); }, 50); d3_eventPreventDefault(); scaleTo(Math.pow(2, d3_behavior_zoomDelta() * .002) * view.k); From 5f7f37825e69f211692038899a0cadde95c22f14 Mon Sep 17 00:00:00 2001 From: Kushan Joshi <0o3ko0@gmail.com> Date: Wed, 8 Jun 2016 18:13:47 +0530 Subject: [PATCH 2/2] add commit 71a3d3e to d3's patch list --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c22d5a80a..8b9d9bc39 100644 --- a/Makefile +++ b/Makefile @@ -315,7 +315,7 @@ D3_FILES = \ d3: node_modules/.bin/smash $(D3_FILES) > js/lib/d3.v3.js - @echo 'd3 rebuilt. Please reapply 7e2485d, 4da529f, and 223974d' + @echo 'd3 rebuilt. Please reapply 7e2485d, 4da529f, 223974d and 71a3d3e' lodash: node_modules/.bin/lodash --development --output js/lib/lodash.js include="includes,toPairs,assign,bind,chunk,clone,compact,debounce,difference,each,every,extend,filter,find,first,forEach,forOwn,groupBy,indexOf,intersection,isEmpty,isEqual,isFunction,keys,last,map,omit,reject,some,throttle,union,uniq,values,without,flatten,value,chain,cloneDeep,merge,pick,reduce" exports="global,node"