@@ -1696,7 +1696,8 @@ describe('Test axes', function() {
1696
1696
1697
1697
return Plotly . relayout ( gd , 'xaxis.autorange' , true ) ;
1698
1698
} ) . then ( function ( ) {
1699
- expect ( gd . _fullLayout . xaxis . range ) . toBeCloseToArray ( [ 0.37 , 3.22 ] , 1 ) ;
1699
+
1700
+ expect ( gd . _fullLayout . xaxis . range ) . toBeCloseToArray ( [ 0.27 , 3.23 ] , 1 ) ;
1700
1701
} )
1701
1702
. then ( done , done . fail ) ;
1702
1703
} ) ;
@@ -1721,13 +1722,13 @@ describe('Test axes', function() {
1721
1722
width : 600 ,
1722
1723
height : 600
1723
1724
} ) . then ( function ( ) {
1724
- expect ( gd . _fullLayout . xaxis . range ) . toBeCloseToArray ( [ - 0.110 , 2 ] ) ;
1725
+ expect ( gd . _fullLayout . xaxis . range ) . toBeCloseToArray ( [ - 0.13 , 2 ] ) ;
1725
1726
1726
1727
return Plotly . relayout ( gd , {
1727
1728
'xaxis.insiderange' : [ 1 , 3 ]
1728
1729
} ) ;
1729
1730
} ) . then ( function ( ) {
1730
- expect ( gd . _fullLayout . xaxis . range ) . toBeCloseToArray ( [ 0.889 , 3 ] ) ;
1731
+ expect ( gd . _fullLayout . xaxis . range ) . toBeCloseToArray ( [ 0.866 , 3 ] ) ;
1731
1732
} ) . then ( done , done . fail ) ;
1732
1733
} ) ;
1733
1734
} ) ;
@@ -4907,32 +4908,32 @@ describe('Test axes', function() {
4907
4908
} )
4908
4909
. then ( function ( ) {
4909
4910
_assert ( 'on labels (defaults)' , {
4910
- ticks : [ 110 .75, 350 , 589 .25] ,
4911
- gridLines : [ 110 .75, 350 , 589 .25] ,
4911
+ ticks : [ 108 .75, 348 , 587 .25] ,
4912
+ gridLines : [ 108 .75, 348 , 587 .25] ,
4912
4913
tickLabels : [ 106.421 , 345.671 , 585.25 ]
4913
4914
} ) ;
4914
4915
return Plotly . relayout ( gd , 'xaxis.tickson' , 'boundaries' ) ;
4915
4916
} )
4916
4917
. then ( function ( ) {
4917
4918
_assert ( 'inside on boundaries' , {
4918
- ticks : [ 230.369 , 469.619 ] , // N.B. first and last tick are clipped
4919
- gridLines : [ 230.369 , 469.619 ] ,
4919
+ ticks : [ 228.367 , 467.617 ] , // N.B. first and last tick are clipped
4920
+ gridLines : [ 228.367 , 467.617 ] ,
4920
4921
tickLabels : [ 106.421875 , 345.671875 , 585.25 ]
4921
4922
} ) ;
4922
4923
return Plotly . relayout ( gd , 'xaxis.ticks' , 'outside' ) ;
4923
4924
} )
4924
4925
. then ( function ( ) {
4925
4926
_assert ( 'outside on boundaries' , {
4926
- ticks : [ 230.369 , 469.619 ] ,
4927
- gridLines : [ 230.369 , 469.619 ] ,
4927
+ ticks : [ 228.367 , 467.617 ] ,
4928
+ gridLines : [ 228.367 , 467.617 ] ,
4928
4929
tickLabels : [ 106.421875 , 345.671875 , 585.25 ]
4929
4930
} ) ;
4930
4931
return Plotly . restyle ( gd , 'x' , [ [ 1 , 2 , 1 ] ] ) ;
4931
4932
} )
4932
4933
. then ( function ( ) {
4933
4934
_assert ( 'fallback to *labels* on non-category axes' , {
4934
- ticks : [ 110 .75, 206.449 , 302.149 , 397 .85, 493.549 , 589 .25] ,
4935
- gridLines : [ 110 .75, 206.449 , 302.149 , 397 .85, 493.549 , 589 .25] ,
4935
+ ticks : [ 108 .75, 204.433 , 300.133 , 395 .85, 491.533 , 587 .25] ,
4936
+ gridLines : [ 108 .75, 204.433 , 300.133 , 395 .85, 491.533 , 587 .25] ,
4936
4937
tickLabels : [ 106.421 , 197.121 , 292.821 , 388.521 , 484.221 , 584.921 ]
4937
4938
} ) ;
4938
4939
} )
@@ -6901,6 +6902,18 @@ describe('Test axes', function() {
6901
6902
expect ( positions ) . toEqual ( expPositions ) ;
6902
6903
}
6903
6904
6905
+ function _assertClose ( expPositions ) {
6906
+ var ax = gd . _fullLayout . xaxis ;
6907
+
6908
+ // minor positions
6909
+ var positions =
6910
+ ax . _vals
6911
+ . filter ( function ( d ) { return d . minor ; } )
6912
+ . map ( function ( d ) { return d . x ; } ) ;
6913
+
6914
+ expect ( positions ) . toBeCloseToArray ( expPositions ) ;
6915
+ }
6916
+
6904
6917
it ( 'minor tickvals' , function ( done ) {
6905
6918
Plotly . newPlot ( gd , {
6906
6919
data : [ {
@@ -7127,7 +7140,7 @@ describe('Test axes', function() {
7127
7140
}
7128
7141
} )
7129
7142
. then ( function ( ) {
7130
- _assert ( [ - 0.22184874961635648 , - 0.1549019599857433 , - 0.09691001300805657 , - 0.04575749056067513 , 0.4771212547196623 , 0.6020599913279623 , 0.7781512503836435 , 0.8450980400142567 , 0.9030899869919434 , 0.9542425094393249 , 1.4771212547196624 , 1.6020599913279623 , 1.7781512503836434 , 1.8450980400142567 , 1.9030899869919433 , 1.9542425094393248 , 2.477121254719662 , 2.6020599913279625 , 2.7781512503836434 , 2.845098040014257 , 2.9030899869919433 , 2.9542425094393248 , 3.477121254719662 , 3.6020599913279625 , 3.7781512503836434 , 3.845098040014257 , 3.9030899869919433 , 3.9542425094393248 ] ) ;
7143
+ _assertClose ( [ - 0.22184874961635648 , - 0.1549019599857433 , - 0.09691001300805657 , - 0.04575749056067513 , 0.4771212547196623 , 0.6020599913279623 , 0.7781512503836435 , 0.8450980400142567 , 0.9030899869919434 , 0.9542425094393249 , 1.4771212547196624 , 1.6020599913279623 , 1.7781512503836434 , 1.8450980400142567 , 1.9030899869919433 , 1.9542425094393248 , 2.477121254719662 , 2.6020599913279625 , 2.7781512503836434 , 2.845098040014257 , 2.9030899869919433 , 2.9542425094393248 , 3.477121254719662 , 3.6020599913279625 , 3.7781512503836434 , 3.845098040014257 , 3.9030899869919433 , 3.9542425094393248 ] ) ;
7131
7144
} )
7132
7145
. then ( done , done . fail ) ;
7133
7146
} ) ;
@@ -7169,7 +7182,7 @@ describe('Test axes', function() {
7169
7182
}
7170
7183
} )
7171
7184
. then ( function ( ) {
7172
- _assert ( [ - 0.017728766960431602 , - 0.00877392430750515 , 0.008600171761917567 , 0.017033339298780367 , 0.025305865264770258 , 0.03342375548694973 , 0.049218022670181646 , 0.056904851336472634 , 0.06445798922691853 , 0.07188200730612543 , 0.08635983067474828 , 0.09342168516223513 , 0.10037054511756296 , 0.10720996964786844 , 0.12057393120584996 , 0.1271047983648077 , 0.13353890837021762 , 0.13987908640123659 , 0.15228834438305658 , 0.15836249209524975 , 0.1643528557844372 , 0.17026171539495752 , 0.18184358794477265 , 0.18752072083646318 , 0.1931245983544617 , 0.1986570869544227 , 0.20951501454263102 , 0.21484384804769796 , 0.22010808804005513 , 0.22530928172586287 , 0.23552844690754896 , 0.24054924828259974 , 0.24551266781414988 , 0.250420002308894 , 0.2600713879850748 , 0.2648178230095364 , 0.26951294421791616 , 0.2741578492636797 , 0.28330122870354935 , 0.2878017299302258 , 0.29225607135647574 , 0.29666519026153076 , 0.30535136944662333 , 0.3096301674258983 , 0.31386722036915293 , 0.31806333496276107 ] ) ;
7185
+ _assertClose ( [ - 0.017728766960431602 , - 0.00877392430750515 , 0.008600171761917567 , 0.017033339298780367 , 0.025305865264770258 , 0.03342375548694973 , 0.049218022670181646 , 0.056904851336472634 , 0.06445798922691853 , 0.07188200730612543 , 0.08635983067474828 , 0.09342168516223513 , 0.10037054511756296 , 0.10720996964786844 , 0.12057393120584996 , 0.1271047983648077 , 0.13353890837021762 , 0.13987908640123659 , 0.15228834438305658 , 0.15836249209524975 , 0.1643528557844372 , 0.17026171539495752 , 0.18184358794477265 , 0.18752072083646318 , 0.1931245983544617 , 0.1986570869544227 , 0.20951501454263102 , 0.21484384804769796 , 0.22010808804005513 , 0.22530928172586287 , 0.23552844690754896 , 0.24054924828259974 , 0.24551266781414988 , 0.250420002308894 , 0.2600713879850748 , 0.2648178230095364 , 0.26951294421791616 , 0.2741578492636797 , 0.28330122870354935 , 0.2878017299302258 , 0.29225607135647574 , 0.29666519026153076 , 0.30535136944662333 , 0.3096301674258983 , 0.31386722036915293 , 0.31806333496276107 ] ) ;
7173
7186
} )
7174
7187
. then ( done , done . fail ) ;
7175
7188
} ) ;
@@ -7191,7 +7204,7 @@ describe('Test axes', function() {
7191
7204
}
7192
7205
} )
7193
7206
. then ( function ( ) {
7194
- _assert ( [ - 0.30102999566398125 , 0.30102999566398114 , 0.6989700043360187 , 1.3010299956639813 , 1.6989700043360187 , 2.3010299956639813 , 2.6989700043360187 , 3.3010299956639813 , 3.6989700043360187 , 4.301029995663981 , 4.698970004336019 , 5.301029995663981 , 5.698970004336019 , 6.301029995663981 , 6.698970004336019 , 7.301029995663981 ] ) ;
7207
+ _assertClose ( [ - 0.30102999566398125 , 0.30102999566398114 , 0.6989700043360187 , 1.3010299956639813 , 1.6989700043360187 , 2.3010299956639813 , 2.6989700043360187 , 3.3010299956639813 , 3.6989700043360187 , 4.301029995663981 , 4.698970004336019 , 5.301029995663981 , 5.698970004336019 , 6.301029995663981 , 6.698970004336019 , 7.301029995663981 ] ) ;
7195
7208
} )
7196
7209
. then ( done , done . fail ) ;
7197
7210
} ) ;
@@ -7213,7 +7226,7 @@ describe('Test axes', function() {
7213
7226
}
7214
7227
} )
7215
7228
. then ( function ( ) {
7216
- _assert ( [ 0.17609125905568124 , 0.3979400086720376 , 0.5440680443502756 , 0.6532125137753436 , 0.7403626894942437 , 0.8129133566428552 , 0.8750612633916998 , 0.9294189257142923 , 0.9777236052888472 , 1.0211892990699374 , 1.0413926851582243 , 1.0606978403536107 ] ) ;
7229
+ _assertClose ( [ 0.17609125905568124 , 0.3979400086720376 , 0.5440680443502756 , 0.6532125137753436 , 0.7403626894942437 , 0.8129133566428552 , 0.8750612633916998 , 0.9294189257142923 , 0.9777236052888472 , 1.0211892990699374 , 1.0413926851582243 , 1.0606978403536107 ] ) ;
7217
7230
} )
7218
7231
. then ( done , done . fail ) ;
7219
7232
} ) ;
@@ -8139,11 +8152,11 @@ describe('more react tests', function() {
8139
8152
8140
8153
Plotly . newPlot ( gd , fig1 )
8141
8154
. then ( function ( ) {
8142
- expect ( gd . _fullLayout . xaxis . range ) . toBeCloseToArray ( [ - 0.110 , 2 ] ) ;
8155
+ expect ( gd . _fullLayout . xaxis . range ) . toBeCloseToArray ( [ - 0.134 , 2 ] ) ;
8143
8156
8144
8157
return Plotly . react ( gd , fig2 ) ;
8145
8158
} ) . then ( function ( ) {
8146
- expect ( gd . _fullLayout . xaxis . range ) . toBeCloseToArray ( [ - 0.164 , 2 ] ) ;
8159
+ expect ( gd . _fullLayout . xaxis . range ) . toBeCloseToArray ( [ - 0.192 , 2 ] ) ;
8147
8160
} ) . then ( done , done . fail ) ;
8148
8161
} ) ;
8149
8162
} ) ;
0 commit comments