Skip to content

Commit

Permalink
Prevent a page from scrolling when using mouse wheel for label rotation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bertjan Broeksema committed Nov 27, 2014
1 parent 4d1d5f9 commit 5bd0e01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions d3.parcoords.js
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ pc.createAxes = function() {
__.dimensionTitleRotation += delta;
pc.svg.selectAll("text.label")
.attr("transform", "translate(0,-5) rotate(" + __.dimensionTitleRotation + ")");
d3.event.preventDefault();
});

flags.axes= true;
Expand Down Expand Up @@ -565,6 +566,7 @@ pc.updateAxes = function() {
__.dimensionTitleRotation += delta;
pc.svg.selectAll("text.label")
.attr("transform", "translate(0,-5) rotate(" + __.dimensionTitleRotation + ")");
d3.event.preventDefault();
});

// Update
Expand Down
2 changes: 2 additions & 0 deletions src/axis.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pc.createAxes = function() {
__.dimensionTitleRotation += delta;
pc.svg.selectAll("text.label")
.attr("transform", "translate(0,-5) rotate(" + __.dimensionTitleRotation + ")");
d3.event.preventDefault();
});

flags.axes= true;
Expand Down Expand Up @@ -78,6 +79,7 @@ pc.updateAxes = function() {
__.dimensionTitleRotation += delta;
pc.svg.selectAll("text.label")
.attr("transform", "translate(0,-5) rotate(" + __.dimensionTitleRotation + ")");
d3.event.preventDefault();
});

// Update
Expand Down

0 comments on commit 5bd0e01

Please sign in to comment.