Skip to content

Commit 710791d

Browse files
committed
fix nonlinear axes in select
1 parent bc04a15 commit 710791d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/plots/cartesian/axes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ axes.setConvert = function(ax) {
634634
ax.c2l = (ax.type==='log') ? toLog : num;
635635
ax.l2c = (ax.type==='log') ? fromLog : num;
636636
ax.l2d = function(v) { return ax.c2d(ax.l2c(v)); };
637-
ax.p2d = function(v) { return ax.p2l(ax.l2d(v)); };
637+
ax.p2d = function(v) { return ax.l2d(ax.p2l(v)); };
638638

639639
// set scaling to pixels
640640
ax.setScale = function(){

src/plots/cartesian/select.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) {
8686
return function(v) { return ax.p2d(v[index]); };
8787
}
8888

89+
function ascending(a, b){ return a - b; }
90+
8991
dragOptions.moveFn = function(dx0, dy0) {
9092
var poly,
9193
ax;
@@ -146,7 +148,7 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) {
146148
axLetter = ax._id.charAt(0);
147149
ranges[ax._id] = [
148150
ax.p2d(poly[axLetter + 'min']),
149-
ax.p2d(poly[axLetter + 'max'])].sort();
151+
ax.p2d(poly[axLetter + 'max'])].sort(ascending);
150152
}
151153
}
152154
else {

0 commit comments

Comments
 (0)