@@ -126,15 +126,16 @@ exports.lsInner = function(gd) {
126126
127127 var freefinished = [ ] ;
128128 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' ) ,
131132 ya = Plotly . Axes . getFromId ( gd , subplot , 'y' ) ;
132133
133134 // reset scale in case the margins have changed
134135 xa . setScale ( ) ;
135136 ya . setScale ( ) ;
136137
137- if ( plotinfo . bg ) {
138+ if ( plotinfo . bg && fullLayout . _has ( 'cartesian' ) ) {
138139 plotinfo . bg
139140 . call ( Drawing . setRect ,
140141 xa . _offset - gs . p , ya . _offset - gs . p ,
@@ -254,27 +255,29 @@ exports.lsInner = function(gd) {
254255 rightpos += xa . _offset - gs . l ;
255256 }
256257
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+ }
278281
279282 plotinfo . xaxislayer . attr ( 'transform' , originx ) ;
280283 plotinfo . yaxislayer . attr ( 'transform' , originy ) ;
@@ -375,19 +378,22 @@ exports.doTicksRelayout = function(gd) {
375378
376379exports . doModeBar = function ( gd ) {
377380 var fullLayout = gd . _fullLayout ;
378- var subplotIds , i ;
381+ var subplotIds , scene , i ;
379382
380383 ModeBar . manage ( gd ) ;
381384 initInteractions ( gd ) ;
382385
383386 subplotIds = Plots . getSubplotIds ( fullLayout , 'gl3d' ) ;
384387 for ( i = 0 ; i < subplotIds . length ; i ++ ) {
385- var scene = fullLayout [ subplotIds [ i ] ] . _scene ;
388+ scene = fullLayout [ subplotIds [ i ] ] . _scene ;
386389 scene . updateFx ( fullLayout . dragmode , fullLayout . hovermode ) ;
387390 }
388391
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+ }
391397
392398 return Plots . previousPromises ( gd ) ;
393399} ;
0 commit comments