@@ -126,15 +126,16 @@ exports.lsInner = function(gd) {
126
126
127
127
var freefinished = [ ] ;
128
128
subplotSelection . each ( function ( subplot ) {
129
- var plotinfo = fullLayout . _plots [ subplot ] ,
130
- xa = Plotly . Axes . getFromId ( gd , subplot , 'x' ) ,
129
+ var plotinfo = fullLayout . _plots [ subplot ] ;
130
+
131
+ var xa = Plotly . Axes . getFromId ( gd , subplot , 'x' ) ,
131
132
ya = Plotly . Axes . getFromId ( gd , subplot , 'y' ) ;
132
133
133
134
// reset scale in case the margins have changed
134
135
xa . setScale ( ) ;
135
136
ya . setScale ( ) ;
136
137
137
- if ( plotinfo . bg ) {
138
+ if ( plotinfo . bg && fullLayout . _has ( 'cartesian' ) ) {
138
139
plotinfo . bg
139
140
. call ( Drawing . setRect ,
140
141
xa . _offset - gs . p , ya . _offset - gs . p ,
@@ -254,27 +255,29 @@ exports.lsInner = function(gd) {
254
255
rightpos += xa . _offset - gs . l ;
255
256
}
256
257
257
- plotinfo . xlines
258
- . attr ( 'transform' , originx )
259
- . attr ( 'd' , (
260
- ( showbottom ? ( xpathPrefix + bottompos + xpathSuffix ) : '' ) +
261
- ( showtop ? ( xpathPrefix + toppos + xpathSuffix ) : '' ) +
262
- ( showfreex ? ( xpathPrefix + freeposx + xpathSuffix ) : '' ) ) ||
263
- // so it doesn't barf with no lines shown
264
- 'M0,0' )
265
- . style ( 'stroke-width' , xlw + 'px' )
266
- . call ( Color . stroke , xa . showline ?
267
- xa . linecolor : 'rgba(0,0,0,0)' ) ;
268
- plotinfo . ylines
269
- . attr ( 'transform' , originy )
270
- . attr ( 'd' , (
271
- ( showleft ? ( 'M' + leftpos + ypathSuffix ) : '' ) +
272
- ( showright ? ( 'M' + rightpos + ypathSuffix ) : '' ) +
273
- ( showfreey ? ( 'M' + freeposy + ypathSuffix ) : '' ) ) ||
274
- 'M0,0' )
275
- . attr ( 'stroke-width' , ylw + 'px' )
276
- . call ( Color . stroke , ya . showline ?
277
- ya . linecolor : 'rgba(0,0,0,0)' ) ;
258
+ if ( fullLayout . _has ( 'cartesian' ) ) {
259
+ plotinfo . xlines
260
+ . attr ( 'transform' , originx )
261
+ . attr ( 'd' , (
262
+ ( showbottom ? ( xpathPrefix + bottompos + xpathSuffix ) : '' ) +
263
+ ( showtop ? ( xpathPrefix + toppos + xpathSuffix ) : '' ) +
264
+ ( showfreex ? ( xpathPrefix + freeposx + xpathSuffix ) : '' ) ) ||
265
+ // so it doesn't barf with no lines shown
266
+ 'M0,0' )
267
+ . style ( 'stroke-width' , xlw + 'px' )
268
+ . call ( Color . stroke , xa . showline ?
269
+ xa . linecolor : 'rgba(0,0,0,0)' ) ;
270
+ plotinfo . ylines
271
+ . attr ( 'transform' , originy )
272
+ . attr ( 'd' , (
273
+ ( showleft ? ( 'M' + leftpos + ypathSuffix ) : '' ) +
274
+ ( showright ? ( 'M' + rightpos + ypathSuffix ) : '' ) +
275
+ ( showfreey ? ( 'M' + freeposy + ypathSuffix ) : '' ) ) ||
276
+ 'M0,0' )
277
+ . attr ( 'stroke-width' , ylw + 'px' )
278
+ . call ( Color . stroke , ya . showline ?
279
+ ya . linecolor : 'rgba(0,0,0,0)' ) ;
280
+ }
278
281
279
282
plotinfo . xaxislayer . attr ( 'transform' , originx ) ;
280
283
plotinfo . yaxislayer . attr ( 'transform' , originy ) ;
@@ -375,19 +378,22 @@ exports.doTicksRelayout = function(gd) {
375
378
376
379
exports . doModeBar = function ( gd ) {
377
380
var fullLayout = gd . _fullLayout ;
378
- var subplotIds , i ;
381
+ var subplotIds , scene , i ;
379
382
380
383
ModeBar . manage ( gd ) ;
381
384
initInteractions ( gd ) ;
382
385
383
386
subplotIds = Plots . getSubplotIds ( fullLayout , 'gl3d' ) ;
384
387
for ( i = 0 ; i < subplotIds . length ; i ++ ) {
385
- var scene = fullLayout [ subplotIds [ i ] ] . _scene ;
388
+ scene = fullLayout [ subplotIds [ i ] ] . _scene ;
386
389
scene . updateFx ( fullLayout . dragmode , fullLayout . hovermode ) ;
387
390
}
388
391
389
- // no need to do this for gl2d subplots,
390
- // Plots.linkSubplots takes care of it all.
392
+ subplotIds = Plots . getSubplotIds ( fullLayout , 'gl2d' ) ;
393
+ for ( i = 0 ; i < subplotIds . length ; i ++ ) {
394
+ scene = fullLayout . _plots [ subplotIds [ i ] ] . _scene2d ;
395
+ scene . updateFx ( fullLayout . dragmode ) ;
396
+ }
391
397
392
398
return Plots . previousPromises ( gd ) ;
393
399
} ;
0 commit comments