@@ -85,6 +85,8 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
85
85
var editX , editY ;
86
86
// graph-wide optimization flags
87
87
var hasScatterGl , hasOnlyLargeSploms , hasSplom , hasSVG ;
88
+ // collected changes to be made to the plot by relayout at the end
89
+ var updates ;
88
90
89
91
function recomputeAxisLists ( ) {
90
92
xa0 = plotinfo . xaxis ;
@@ -291,9 +293,6 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
291
293
// zoom takes over minDrag, so it also has to take over gd._dragged
292
294
var zoomDragged ;
293
295
294
- // collected changes to be made to the plot by relayout at the end
295
- var updates = { } ;
296
-
297
296
function zoomPrep ( e , startX , startY ) {
298
297
var dragBBox = dragger . getBoundingClientRect ( ) ;
299
298
x0 = startX - dragBBox . left ;
@@ -386,6 +385,8 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
386
385
}
387
386
388
387
function zoomDone ( ) {
388
+ updates = { } ;
389
+
389
390
// more strict than dragged, which allows you to come back to where you started
390
391
// and still count as dragged
391
392
if ( Math . min ( box . h , box . w ) < MINDRAG * 2 ) {
@@ -936,6 +937,7 @@ function zoomAxRanges(axList, r0Fraction, r1Fraction, updates, linkedAxes) {
936
937
axi . l2r ( axRangeLinear0 + axRangeLinearSpan * r0Fraction ) ,
937
938
axi . l2r ( axRangeLinear0 + axRangeLinearSpan * r1Fraction )
938
939
] ;
940
+
939
941
updates [ axi . _name + '.range[0]' ] = axi . range [ 0 ] ;
940
942
updates [ axi . _name + '.range[1]' ] = axi . range [ 1 ] ;
941
943
}
0 commit comments