@@ -371,17 +371,20 @@ proto.init_interactions = function() {
371
371
var _this = this ,
372
372
dragger = _this . layers . plotbg . select ( 'path' ) . node ( ) ,
373
373
gd = _this . graphDiv ,
374
- plot = _this . layers . frontplot ;
374
+ zoomContainer = _this . layers . zoom ;
375
375
376
376
// use plotbg for the main interactions
377
377
var dragOptions = {
378
378
element : dragger ,
379
379
gd : gd ,
380
- plotinfo : { plot : plot } ,
381
- xaxes : _this . xaxis ,
382
- yaxes : _this . yaxis ,
380
+ plotinfo : { plot : zoomContainer } ,
383
381
doubleclick : doubleClick ,
382
+ subplot : _this . id ,
384
383
prepFn : function ( e , startX , startY ) {
384
+ // these aren't available yet when init_interactions
385
+ // is called
386
+ dragOptions . xaxes = [ _this . xaxis ] ;
387
+ dragOptions . yaxes = [ _this . yaxis ] ;
385
388
var dragModeNow = gd . _fullLayout . dragmode ;
386
389
if ( e . shiftKey ) {
387
390
if ( dragModeNow === 'pan' ) dragModeNow = 'zoom' ;
@@ -425,15 +428,15 @@ proto.init_interactions = function() {
425
428
path0 = 'M0,' + _this . h + 'L' + ( _this . w / 2 ) + ', 0L' + _this . w + ',' + _this . h + 'Z' ;
426
429
dimmed = false ;
427
430
428
- zb = _this . layers . zoom . append ( 'path' )
431
+ zb = zoomContainer . append ( 'path' )
429
432
. attr ( 'class' , 'zoombox' )
430
433
. style ( {
431
434
'fill' : lum > 0.2 ? 'rgba(0,0,0,0)' : 'rgba(255,255,255,0)' ,
432
435
'stroke-width' : 0
433
436
} )
434
437
. attr ( 'd' , path0 ) ;
435
438
436
- corners = _this . layers . zoom . append ( 'path' )
439
+ corners = zoomContainer . append ( 'path' )
437
440
. attr ( 'class' , 'zoombox-corners' )
438
441
. style ( {
439
442
fill : Plotly . Color . background ,
0 commit comments