@@ -554,9 +554,9 @@ describe('annotations autorange', function() {
554554 it ( 'should adapt to relayout calls' , function ( done ) {
555555 Plotly . plot ( gd , mock ) . then ( function ( ) {
556556 assertRanges (
557- [ 0.97 , 2.03 ] , [ 0.97 , 2.03 ] ,
558- [ '2000-10-01 08:23:18.0583 ' , '2001-06-05 19:20:23.301 ' ] , [ - 0.245 , 4.245 ] ,
559- [ 0.9 , 2.1 ] , [ 0.86 , 2.14 ]
557+ [ 0.91 , 2.09 ] , [ 0.91 , 2.09 ] ,
558+ [ '2000-11-13 ' , '2001-04-21 ' ] , [ - 0.069 , 3.917 ] ,
559+ [ 0.88 , 2.05 ] , [ 0.92 , 2.08 ]
560560 ) ;
561561
562562 return Plotly . relayout ( gd , {
@@ -567,9 +567,9 @@ describe('annotations autorange', function() {
567567 } )
568568 . then ( function ( ) {
569569 assertRanges (
570- [ 1.44 , 2.02 ] , [ 0.97 , 2.03 ] ,
571- [ '2001-01-18 15:06:04.0449 ' , '2001-03-27 14:01:20.8989 ' ] , [ - 0.245 , 4.245 ] ,
572- [ 1.44 , 2.1 ] , [ 0.86 , 2.14 ]
570+ [ 1.44 , 2.02 ] , [ 0.91 , 2.09 ] ,
571+ [ '2001-01-18' , '2001-03-27' ] , [ - 0.069 , 3.917 ] ,
572+ [ 1.44 , 2.1 ] , [ 0.92 , 2.08 ]
573573 ) ;
574574
575575 return Plotly . relayout ( gd , {
@@ -581,8 +581,8 @@ describe('annotations autorange', function() {
581581 . then ( function ( ) {
582582 assertRanges (
583583 [ 1.44 , 2.02 ] , [ 0.99 , 1.52 ] ,
584- [ '2001-01-31 23:59:59.999' , '2001-02-01 00:00:00.001' ] , [ - 0.245 , 4.245 ] ,
585- [ 0.5 , 2.5 ] , [ 0.86 , 2.14 ]
584+ [ '2001-01-31 23:59:59.999' , '2001-02-01 00:00:00.001' ] , [ - 0.069 , 3.917 ] ,
585+ [ 0.5 , 2.5 ] , [ 0.92 , 2.08 ]
586586 ) ;
587587
588588 return Plotly . relayout ( gd , {
@@ -596,9 +596,9 @@ describe('annotations autorange', function() {
596596 } )
597597 . then ( function ( ) {
598598 assertRanges (
599- [ 0.97 , 2.03 ] , [ 0.97 , 2.03 ] ,
600- [ '2000-10-01 08:23:18.0583 ' , '2001-06-05 19:20:23.301 ' ] , [ - 0.245 , 4.245 ] ,
601- [ 0.9 , 2.1 ] , [ 0.86 , 2.14 ]
599+ [ 0.91 , 2.09 ] , [ 0.91 , 2.09 ] ,
600+ [ '2000-11-13 ' , '2001-04-21 ' ] , [ - 0.069 , 3.917 ] ,
601+ [ 0.88 , 2.05 ] , [ 0.92 , 2.08 ]
602602 ) ;
603603 } )
604604 . catch ( failTest )
@@ -619,10 +619,10 @@ describe('annotations autorange', function() {
619619 } )
620620 . then ( function ( ) {
621621 assertRanges (
622- [ - 1.09 , 2.09 ] , [ 0.94 , 3.06 ] ,
622+ [ - 1.09 , 2.25 ] , [ 0.84 , 3.06 ] ,
623623 // the other axes shouldn't change
624- [ '2000-10-01 08:23:18.0583 ' , '2001-06-05 19:20:23.301 ' ] , [ - 0.245 , 4.245 ] ,
625- [ 0.9 , 2.1 ] , [ 0.86 , 2.14 ]
624+ [ '2000-11-13 ' , '2001-04-21 ' ] , [ - 0.069 , 3.917 ] ,
625+ [ 0.88 , 2.05 ] , [ 0.92 , 2.08 ]
626626 ) ;
627627 } )
628628 . catch ( failTest )
@@ -961,7 +961,8 @@ describe('annotation effects', function() {
961961 showarrow : false ,
962962 text : 'blah<br>blah blah' ,
963963 xref : 'paper' ,
964- yref : 'paper'
964+ yref : 'paper' ,
965+ xshift : 5 , yshift : 5
965966 } ] )
966967 . then ( function ( ) {
967968 var bbox = textBox ( ) . getBoundingClientRect ( ) ;
@@ -981,7 +982,8 @@ describe('annotation effects', function() {
981982 xref : 'paper' ,
982983 yref : 'paper' ,
983984 xanchor : 'left' ,
984- yanchor : 'top'
985+ yanchor : 'top' ,
986+ xshift : 5 , yshift : 5
985987 } ] )
986988 . then ( function ( ) {
987989 // with offsets 0, 0 because the anchor doesn't change now
@@ -999,7 +1001,8 @@ describe('annotation effects', function() {
9991001 xref : 'paper' ,
10001002 yref : 'paper' ,
10011003 ax : 30 ,
1002- ay : 30
1004+ ay : 30 ,
1005+ xshift : 5 , yshift : 5
10031006 } ] )
10041007 . then ( function ( ) {
10051008 return checkDragging ( arrowDrag , 0 , 0 , 1 ) ;
@@ -1014,7 +1017,8 @@ describe('annotation effects', function() {
10141017 x : 0 ,
10151018 y : 0 ,
10161019 showarrow : false ,
1017- text : 'blah<br>blah blah'
1020+ text : 'blah<br>blah blah' ,
1021+ xshift : 5 , yshift : 5
10181022 } ] )
10191023 . then ( function ( ) {
10201024 return checkDragging ( textDrag , 0 , 0 , 100 ) ;
@@ -1029,7 +1033,8 @@ describe('annotation effects', function() {
10291033 y : 0 ,
10301034 text : 'blah<br>blah blah' ,
10311035 ax : 30 ,
1032- ay : - 30
1036+ ay : - 30 ,
1037+ xshift : 5 , yshift : 5
10331038 } ] )
10341039 . then ( function ( ) {
10351040 return checkDragging ( arrowDrag , 0 , 0 , 100 ) ;
@@ -1127,7 +1132,7 @@ describe('annotation effects', function() {
11271132 }
11281133
11291134 makePlot ( [
1130- { x : 50 , y : 50 , text : 'hi' , width : 50 , ax : 0 , ay : - 40 } ,
1135+ { x : 50 , y : 50 , text : 'hi' , width : 50 , ax : 0 , ay : - 40 , xshift : - 50 , yshift : 50 } ,
11311136 { x : 20 , y : 20 , text : 'bye' , height : 40 , showarrow : false } ,
11321137 { x : 80 , y : 80 , text : 'why?' , ax : 0 , ay : - 40 }
11331138 ] , { } ) // turn off the default editable: true
@@ -1136,7 +1141,7 @@ describe('annotation effects', function() {
11361141 gd . on ( 'plotly_clickannotation' , function ( evt ) { clickData . push ( evt ) ; } ) ;
11371142
11381143 gdBB = gd . getBoundingClientRect ( ) ;
1139- pos0Head = [ gdBB . left + 250 , gdBB . top + 250 ] ;
1144+ pos0Head = [ gdBB . left + 200 , gdBB . top + 200 ] ;
11401145 pos0 = [ pos0Head [ 0 ] , pos0Head [ 1 ] - 40 ] ;
11411146 pos1 = [ gdBB . left + 160 , gdBB . top + 340 ] ;
11421147 pos2Head = [ gdBB . left + 340 , gdBB . top + 160 ] ;
0 commit comments