@@ -85,6 +85,8 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
8585 var editX , editY ;
8686 // graph-wide optimization flags
8787 var hasScatterGl , hasOnlyLargeSploms , hasSplom , hasSVG ;
88+ // collected changes to be made to the plot by relayout at the end
89+ var updates ;
8890
8991 function recomputeAxisLists ( ) {
9092 xa0 = plotinfo . xaxis ;
@@ -291,9 +293,6 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
291293 // zoom takes over minDrag, so it also has to take over gd._dragged
292294 var zoomDragged ;
293295
294- // collected changes to be made to the plot by relayout at the end
295- var updates = { } ;
296-
297296 function zoomPrep ( e , startX , startY ) {
298297 var dragBBox = dragger . getBoundingClientRect ( ) ;
299298 x0 = startX - dragBBox . left ;
@@ -386,6 +385,8 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
386385 }
387386
388387 function zoomDone ( ) {
388+ updates = { } ;
389+
389390 // more strict than dragged, which allows you to come back to where you started
390391 // and still count as dragged
391392 if ( Math . min ( box . h , box . w ) < MINDRAG * 2 ) {
@@ -936,6 +937,7 @@ function zoomAxRanges(axList, r0Fraction, r1Fraction, updates, linkedAxes) {
936937 axi . l2r ( axRangeLinear0 + axRangeLinearSpan * r0Fraction ) ,
937938 axi . l2r ( axRangeLinear0 + axRangeLinearSpan * r1Fraction )
938939 ] ;
940+
939941 updates [ axi . _name + '.range[0]' ] = axi . range [ 0 ] ;
940942 updates [ axi . _name + '.range[1]' ] = axi . range [ 1 ] ;
941943 }
0 commit comments