Skip to content

Commit

Permalink
Merge pull request #2 from newcrom/T2254
Browse files Browse the repository at this point in the history
plotly#2254: Front: Fixes for new chromatogram
  • Loading branch information
ifdotpy authored Feb 5, 2024
2 parents a22e323 + 9d59c3c commit 7e48ee9
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions src/plots/cartesian/dragbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,24 +398,27 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
} else {
noZoom();
}
} else if(!yActive || dy < Math.min(Math.max(dx * 0.6, MINDRAG), MINZOOM)) {
// look for small drags in one direction or the other,
// and only drag the other axis

if(dx < MINDRAG || !xActive) {
noZoom();
} else {
box.t = 0;
box.b = ph;
zoomMode = 'x';
corners.attr('d', xCorners(box, y0));
}
} else if(!xActive || dx < Math.min(dy * 0.6, MINZOOM)) {
box.l = 0;
box.r = pw;
zoomMode = 'y';
corners.attr('d', yCorners(box, x0));
} else {
}
// !!! To disable single axis scaling
// else if(!yActive || dy < Math.min(Math.max(dx * 0.6, MINDRAG), MINZOOM)) {
// // look for small drags in one direction or the other,
// // and only drag the other axis
//
// if(dx < MINDRAG || !xActive) {
// noZoom();
// } else {
// box.t = 0;
// box.b = ph;
// zoomMode = 'x';
// corners.attr('d', xCorners(box, y0));
// }
// } else if(!xActive || dx < Math.min(dy * 0.6, MINZOOM)) {
// box.l = 0;
// box.r = pw;
// zoomMode = 'y';
// corners.attr('d', yCorners(box, x0));
// }
else {
zoomMode = 'xy';
corners.attr('d', xyCorners(box));
}
Expand Down

0 comments on commit 7e48ee9

Please sign in to comment.