@@ -1620,6 +1620,11 @@ describe('Test gl2d plots', function() {
1620
1620
centerX = bBox . left + 200 ;
1621
1621
centerY = bBox . top + 200 ;
1622
1622
1623
+ // no change - too small
1624
+ mouseTo ( [ centerX , centerY ] , [ centerX - 5 , centerY + 5 ] ) ;
1625
+ expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( [ 0 , 16 ] , 3 ) ;
1626
+ expect ( gd . layout . yaxis . range ) . toBeCloseToArray ( [ 0 , 16 ] , 3 ) ;
1627
+
1623
1628
// 2D
1624
1629
mouseTo ( [ centerX - 50 , centerY ] , [ centerX + 50 , centerY + 50 ] ) ;
1625
1630
expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( [ 4 , 12 ] , 3 ) ;
@@ -1634,11 +1639,6 @@ describe('Test gl2d plots', function() {
1634
1639
mouseTo ( [ centerX , centerY - 50 ] , [ centerX - 5 , centerY + 50 ] ) ;
1635
1640
expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( [ 6 , 8 ] , 3 ) ;
1636
1641
expect ( gd . layout . yaxis . range ) . toBeCloseToArray ( [ 5 , 7 ] , 3 ) ;
1637
-
1638
- // no change - too small
1639
- mouseTo ( [ centerX , centerY ] , [ centerX - 5 , centerY + 5 ] ) ;
1640
- expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( [ 0 , 16 ] , 3 ) ;
1641
- expect ( gd . layout . yaxis . range ) . toBeCloseToArray ( [ 0 , 16 ] , 3 ) ;
1642
1642
} )
1643
1643
. catch ( fail )
1644
1644
. then ( done ) ;
@@ -1671,6 +1671,11 @@ describe('Test gl2d plots', function() {
1671
1671
expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( [ - 8 , 24 ] , 3 ) ;
1672
1672
expect ( gd . layout . yaxis . range ) . toBeCloseToArray ( [ 0 , 16 ] , 3 ) ;
1673
1673
1674
+ // no change - too small
1675
+ mouseTo ( [ centerX , centerY ] , [ centerX - 5 , centerY + 5 ] ) ;
1676
+ expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( [ - 8 , 24 ] , 3 ) ;
1677
+ expect ( gd . layout . yaxis . range ) . toBeCloseToArray ( [ 0 , 16 ] , 3 ) ;
1678
+
1674
1679
// now there should only be 2D zooming
1675
1680
// dy>>dx
1676
1681
mouseTo ( [ centerX , centerY ] , [ centerX - 1 , centerY - 50 ] ) ;
@@ -1682,11 +1687,6 @@ describe('Test gl2d plots', function() {
1682
1687
expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( [ 4 , 6 ] , 3 ) ;
1683
1688
expect ( gd . layout . yaxis . range ) . toBeCloseToArray ( [ 9 , 10 ] , 3 ) ;
1684
1689
1685
- // no change - too small
1686
- mouseTo ( [ centerX , centerY ] , [ centerX - 5 , centerY + 5 ] ) ;
1687
- expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( [ - 8 , 24 ] , 3 ) ;
1688
- expect ( gd . layout . yaxis . range ) . toBeCloseToArray ( [ 0 , 16 ] , 3 ) ;
1689
-
1690
1690
return Plotly . relayout ( gd , {
1691
1691
'xaxis.autorange' : true ,
1692
1692
'yaxis.autorange' : true
0 commit comments