@@ -381,75 +381,62 @@ describe('Test relayout on polar subplots:', function() {
381
381
}
382
382
383
383
function toggle ( astr , vals , exps , selector , fn ) {
384
- return Plotly . relayout ( gd , astr , vals [ 0 ] ) . then ( function ( ) {
385
- fn ( selector , exps [ 0 ] , astr + ' ' + vals [ 0 ] ) ;
386
- return Plotly . relayout ( gd , astr , vals [ 1 ] ) ;
387
- } )
388
- . then ( function ( ) {
389
- fn ( selector , exps [ 1 ] , astr + ' ' + vals [ 1 ] ) ;
390
- return Plotly . relayout ( gd , astr , vals [ 0 ] ) ;
391
- } )
392
- . then ( function ( ) {
393
- fn ( selector , exps [ 0 ] , astr + ' ' + vals [ 0 ] ) ;
394
- } ) ;
384
+ return function ( ) {
385
+ return Plotly . relayout ( gd , astr , vals [ 0 ] ) . then ( function ( ) {
386
+ fn ( selector , exps [ 0 ] , astr + ' ' + vals [ 0 ] ) ;
387
+ return Plotly . relayout ( gd , astr , vals [ 1 ] ) ;
388
+ } )
389
+ . then ( function ( ) {
390
+ fn ( selector , exps [ 1 ] , astr + ' ' + vals [ 1 ] ) ;
391
+ return Plotly . relayout ( gd , astr , vals [ 0 ] ) ;
392
+ } )
393
+ . then ( function ( ) {
394
+ fn ( selector , exps [ 0 ] , astr + ' ' + vals [ 0 ] ) ;
395
+ } ) ;
396
+ } ;
395
397
}
396
398
397
- Plotly . plot ( gd , fig ) . then ( function ( ) {
398
- return toggle (
399
- 'polar.radialaxis.showline' ,
400
- [ true , false ] , [ null , 'none' ] ,
401
- '.radial-line > line' , assertDisplay
402
- ) ;
403
- } )
404
- . then ( function ( ) {
405
- return toggle (
406
- 'polar.radialaxis.showgrid' ,
407
- [ true , false ] , [ null , 'none' ] ,
408
- '.radial-grid' , assertDisplay
409
- ) ;
410
- } )
411
- . then ( function ( ) {
412
- return toggle (
413
- 'polar.radialaxis.showticklabels' ,
414
- [ true , false ] , [ 6 , 0 ] ,
415
- '.radial-axis > .xtick > text' , assertCnt
416
- ) ;
417
- } )
418
- . then ( function ( ) {
419
- return toggle (
420
- 'polar.radialaxis.ticks' ,
421
- [ 'outside' , '' ] , [ 6 , 0 ] ,
422
- '.radial-axis > path.xtick' , assertCnt
423
- ) ;
424
- } )
425
- . then ( function ( ) {
426
- return toggle (
427
- 'polar.angularaxis.showline' ,
428
- [ true , false ] , [ null , 'none' ] ,
429
- '.angular-line > path' , assertDisplay
430
- ) ;
431
- } )
432
- . then ( function ( ) {
433
- return toggle (
434
- 'polar.angularaxis.showgrid' ,
435
- [ true , false ] , [ 8 , 0 ] ,
436
- '.angular-grid > .angularaxis > path' , assertCnt
437
- ) ;
438
- } )
439
- . then ( function ( ) {
440
- return toggle (
441
- 'polar.angularaxis.showticklabels' ,
442
- [ true , false ] , [ 8 , 0 ] ,
443
- '.angular-axis > .angularaxistick > text' , assertCnt
444
- ) ;
445
- } )
446
- . then ( function ( ) {
447
- return toggle (
448
- 'polar.angularaxis.ticks' ,
449
- [ 'outside' , '' ] , [ 8 , 0 ] ,
450
- '.angular-axis > path.angularaxistick' , assertCnt
451
- ) ;
452
- } )
399
+ Plotly . plot ( gd , fig )
400
+ . then ( toggle (
401
+ 'polar.radialaxis.showline' ,
402
+ [ true , false ] , [ null , 'none' ] ,
403
+ '.radial-line > line' , assertDisplay
404
+ ) )
405
+ . then ( toggle (
406
+ 'polar.radialaxis.showgrid' ,
407
+ [ true , false ] , [ null , 'none' ] ,
408
+ '.radial-grid' , assertDisplay
409
+ ) )
410
+ . then ( toggle (
411
+ 'polar.radialaxis.showticklabels' ,
412
+ [ true , false ] , [ 6 , 0 ] ,
413
+ '.radial-axis > .xtick > text' , assertCnt
414
+ ) )
415
+ . then ( toggle (
416
+ 'polar.radialaxis.ticks' ,
417
+ [ 'outside' , '' ] , [ 6 , 0 ] ,
418
+ '.radial-axis > path.xtick' , assertCnt
419
+ ) )
420
+ . then ( toggle (
421
+ 'polar.angularaxis.showline' ,
422
+ [ true , false ] , [ null , 'none' ] ,
423
+ '.angular-line > path' , assertDisplay
424
+ ) )
425
+ . then ( toggle (
426
+ 'polar.angularaxis.showgrid' ,
427
+ [ true , false ] , [ 8 , 0 ] ,
428
+ '.angular-grid > .angularaxis > path' , assertCnt
429
+ ) )
430
+ . then ( toggle (
431
+ 'polar.angularaxis.showticklabels' ,
432
+ [ true , false ] , [ 8 , 0 ] ,
433
+ '.angular-axis > .angularaxistick > text' , assertCnt
434
+ ) )
435
+ . then ( toggle (
436
+ 'polar.angularaxis.ticks' ,
437
+ [ 'outside' , '' ] , [ 8 , 0 ] ,
438
+ '.angular-axis > path.angularaxistick' , assertCnt
439
+ ) )
453
440
. catch ( failTest )
454
441
. then ( done ) ;
455
442
} ) ;
0 commit comments