Skip to content

Commit

Permalink
fix nonlinear axes in select
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcjohnson committed Jan 6, 2016
1 parent bc04a15 commit 710791d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/plots/cartesian/axes.js
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ axes.setConvert = function(ax) {
ax.c2l = (ax.type==='log') ? toLog : num;
ax.l2c = (ax.type==='log') ? fromLog : num;
ax.l2d = function(v) { return ax.c2d(ax.l2c(v)); };
ax.p2d = function(v) { return ax.p2l(ax.l2d(v)); };
ax.p2d = function(v) { return ax.l2d(ax.p2l(v)); };

// set scaling to pixels
ax.setScale = function(){
Expand Down
4 changes: 3 additions & 1 deletion src/plots/cartesian/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) {
return function(v) { return ax.p2d(v[index]); };
}

function ascending(a, b){ return a - b; }

dragOptions.moveFn = function(dx0, dy0) {
var poly,
ax;
Expand Down Expand Up @@ -146,7 +148,7 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) {
axLetter = ax._id.charAt(0);
ranges[ax._id] = [
ax.p2d(poly[axLetter + 'min']),
ax.p2d(poly[axLetter + 'max'])].sort();
ax.p2d(poly[axLetter + 'max'])].sort(ascending);
}
}
else {
Expand Down

1 comment on commit 710791d

@etpinard
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed. thanks

Please sign in to comment.