@@ -1361,6 +1361,7 @@ describe('bar visibility toggling:', function() {
1361
1361
spyOn ( gd . _fullData [ 0 ] . _module , 'crossTraceCalc' ) . and . callThrough ( ) ;
1362
1362
1363
1363
_assert ( 'base' , [ 0.5 , 3.5 ] , [ - 2.222 , 2.222 ] , 0 ) ;
1364
+ expect ( gd . _fullLayout . legend . traceorder ) . toBe ( 'normal' ) ;
1364
1365
return Plotly . restyle ( gd , 'visible' , false , [ 1 ] ) ;
1365
1366
} )
1366
1367
. then ( function ( ) {
@@ -1369,6 +1370,11 @@ describe('bar visibility toggling:', function() {
1369
1370
} )
1370
1371
. then ( function ( ) {
1371
1372
_assert ( 'both invisible' , [ 0.5 , 3.5 ] , [ 0 , 2.105 ] , 0 ) ;
1373
+ return Plotly . restyle ( gd , 'visible' , 'legendonly' ) ;
1374
+ } )
1375
+ . then ( function ( ) {
1376
+ _assert ( 'both legendonly' , [ 0.5 , 3.5 ] , [ 0 , 2.105 ] , 0 ) ;
1377
+ expect ( gd . _fullLayout . legend . traceorder ) . toBe ( 'normal' ) ;
1372
1378
return Plotly . restyle ( gd , 'visible' , true , [ 1 ] ) ;
1373
1379
} )
1374
1380
. then ( function ( ) {
@@ -1391,6 +1397,7 @@ describe('bar visibility toggling:', function() {
1391
1397
spyOn ( gd . _fullData [ 0 ] . _module , 'crossTraceCalc' ) . and . callThrough ( ) ;
1392
1398
1393
1399
_assert ( 'base' , [ 0.5 , 3.5 ] , [ 0 , 5.263 ] , 0 ) ;
1400
+ expect ( gd . _fullLayout . legend . traceorder ) . toBe ( 'reversed' ) ;
1394
1401
return Plotly . restyle ( gd , 'visible' , false , [ 1 ] ) ;
1395
1402
} )
1396
1403
. then ( function ( ) {
@@ -1399,6 +1406,11 @@ describe('bar visibility toggling:', function() {
1399
1406
} )
1400
1407
. then ( function ( ) {
1401
1408
_assert ( 'both invisible' , [ 0.5 , 3.5 ] , [ 0 , 2.105 ] , 0 ) ;
1409
+ return Plotly . restyle ( gd , 'visible' , 'legendonly' ) ;
1410
+ } )
1411
+ . then ( function ( ) {
1412
+ _assert ( 'both legendonly' , [ 0.5 , 3.5 ] , [ 0 , 2.105 ] , 0 ) ;
1413
+ expect ( gd . _fullLayout . legend . traceorder ) . toBe ( 'reversed' ) ;
1402
1414
return Plotly . restyle ( gd , 'visible' , true , [ 1 ] ) ;
1403
1415
} )
1404
1416
. then ( function ( ) {
0 commit comments