@@ -445,7 +445,7 @@ describe('the range slider', function() {
445
445
it ( 'should not mutate layoutIn' , function ( ) {
446
446
var layoutIn = { xaxis : { rangeslider : { visible : true } } } ,
447
447
layoutOut = { xaxis : { rangeslider : { } } } ,
448
- expected = { xaxis : { rangeslider : { visible : true } } } ;
448
+ expected = { xaxis : { rangeslider : { visible : true } } } ;
449
449
450
450
_supply ( layoutIn , layoutOut , 'xaxis' ) ;
451
451
expect ( layoutIn ) . toEqual ( expected ) ;
@@ -457,7 +457,6 @@ describe('the range slider', function() {
457
457
expected = {
458
458
visible : true ,
459
459
autorange : true ,
460
- range : [ - 1 , 6 ] ,
461
460
thickness : 0.15 ,
462
461
bgcolor : '#fff' ,
463
462
borderwidth : 0 ,
@@ -475,7 +474,6 @@ describe('the range slider', function() {
475
474
expected = {
476
475
visible : true ,
477
476
autorange : true ,
478
- range : [ - 1 , 6 ] ,
479
477
thickness : 0.15 ,
480
478
bgcolor : '#fff' ,
481
479
borderwidth : 0 ,
@@ -507,7 +505,6 @@ describe('the range slider', function() {
507
505
expected = {
508
506
visible : true ,
509
507
autorange : true ,
510
- range : [ - 1 , 6 ] ,
511
508
thickness : 0.15 ,
512
509
bgcolor : '#fff' ,
513
510
borderwidth : 0 ,
@@ -519,34 +516,12 @@ describe('the range slider', function() {
519
516
expect ( layoutOut . xaxis . rangeslider ) . toEqual ( expected ) ;
520
517
} ) ;
521
518
522
- it ( 'should expand the rangeslider range to axis range' , function ( ) {
523
- var layoutIn = { xaxis : { rangeslider : { range : [ 5 , 6 ] } } } ,
524
- layoutOut = { xaxis : { range : [ 1 , 10 ] , type : 'linear' } } ,
525
- expected = {
526
- visible : true ,
527
- autorange : false ,
528
- range : [ 1 , 10 ] ,
529
- thickness : 0.15 ,
530
- bgcolor : '#fff' ,
531
- borderwidth : 0 ,
532
- bordercolor : '#444' ,
533
- _input : layoutIn . xaxis . rangeslider
534
- } ;
535
-
536
- _supply ( layoutIn , layoutOut , 'xaxis' ) ;
537
-
538
- // don't compare the whole layout, because we had to run setConvert which
539
- // attaches all sorts of other stuff to xaxis
540
- expect ( layoutOut . xaxis . rangeslider ) . toEqual ( expected ) ;
541
- } ) ;
542
-
543
519
it ( 'should set autorange to true when range input is invalid' , function ( ) {
544
520
var layoutIn = { xaxis : { rangeslider : { range : 'not-gonna-work' } } } ,
545
521
layoutOut = { xaxis : { } } ,
546
522
expected = {
547
523
visible : true ,
548
524
autorange : true ,
549
- range : [ - 1 , 6 ] ,
550
525
thickness : 0.15 ,
551
526
bgcolor : '#fff' ,
552
527
borderwidth : 0 ,
@@ -729,6 +704,17 @@ describe('the range slider', function() {
729
704
. then ( function ( ) {
730
705
assertRange ( [ - 0.26 , 4.26 ] , [ - 0.26 , 4.26 ] ) ;
731
706
707
+ // smaller than xaxis.range - won't be accepted
708
+ return Plotly . relayout ( gd , { 'xaxis.rangeslider.range' : [ 0 , 2 ] } ) ;
709
+ } )
710
+ . then ( function ( ) {
711
+ assertRange ( [ - 0.26 , 4.26 ] , [ - 0.26 , 4.26 ] ) ;
712
+
713
+ // will be accepted (and autorange is disabled by impliedEdits)
714
+ return Plotly . relayout ( gd , { 'xaxis.rangeslider.range' : [ - 2 , 12 ] } ) ;
715
+ } )
716
+ . then ( function ( ) {
717
+ assertRange ( [ - 0.26 , 4.26 ] , [ - 2 , 12 ] ) ;
732
718
} )
733
719
. then ( done ) ;
734
720
} ) ;
0 commit comments