@@ -1430,22 +1430,21 @@ describe('Test geo zoom/pan/drag interactions:', function() {
1430
1430
} ) ;
1431
1431
}
1432
1432
1433
- function assertEventData ( eventKeys ) {
1433
+ function assertEventData ( msg , eventKeys ) {
1434
1434
if ( eventKeys === 'dblclick' ) {
1435
- expect ( dblClickCnt ) . toBe ( 1 , 'double click got fired' ) ;
1436
- expect ( eventData ) . toBeDefined ( 'relayout is fired on double clicks' ) ;
1437
- }
1438
- else {
1435
+ expect ( dblClickCnt ) . toBe ( 1 , msg + 'double click got fired' ) ;
1436
+ expect ( eventData ) . toBeDefined ( msg + 'relayout is fired on double clicks' ) ;
1437
+ } else {
1439
1438
expect ( dblClickCnt ) . toBe ( 0 , 'double click not fired' ) ;
1440
1439
1441
1440
if ( Array . isArray ( eventKeys ) ) {
1442
1441
expect ( Object . keys ( eventData || { } ) . length )
1443
- . toBe ( Object . keys ( eventKeys ) . length , '# of event data keys' ) ;
1442
+ . toBe ( Object . keys ( eventKeys ) . length , msg + '# of event data keys' ) ;
1444
1443
eventKeys . forEach ( function ( k ) {
1445
- expect ( ( eventData || { } ) [ k ] ) . toBeDefined ( 'event data key ' + k ) ;
1444
+ expect ( ( eventData || { } ) [ k ] ) . toBeDefined ( msg + 'event data key ' + k ) ;
1446
1445
} ) ;
1447
1446
} else {
1448
- expect ( eventData ) . toBeUndefined ( ) ;
1447
+ expect ( eventData ) . toBeUndefined ( msg + 'relayout not fired' ) ;
1449
1448
}
1450
1449
}
1451
1450
@@ -1488,45 +1487,47 @@ describe('Test geo zoom/pan/drag interactions:', function() {
1488
1487
fig . layout . height = 500 ;
1489
1488
fig . layout . dragmode = 'pan' ;
1490
1489
1491
- function _assert ( attr , proj , eventKeys ) {
1490
+ function _assert ( step , attr , proj , eventKeys ) {
1491
+ var msg = '[' + step + '] ' ;
1492
+
1492
1493
var geoLayout = gd . _fullLayout . geo ;
1493
1494
var rotation = geoLayout . projection . rotation ;
1494
1495
var center = geoLayout . center ;
1495
1496
var scale = geoLayout . projection . scale ;
1496
1497
1497
- expect ( rotation . lon ) . toBeCloseTo ( attr [ 0 ] [ 0 ] , 1 , 'rotation.lon' ) ;
1498
- expect ( rotation . lat ) . toBeCloseTo ( attr [ 0 ] [ 1 ] , 1 , 'rotation.lat' ) ;
1499
- expect ( center . lon ) . toBeCloseTo ( attr [ 1 ] [ 0 ] , 1 , 'center.lon' ) ;
1500
- expect ( center . lat ) . toBeCloseTo ( attr [ 1 ] [ 1 ] , 1 , 'center.lat' ) ;
1501
- expect ( scale ) . toBeCloseTo ( attr [ 2 ] , 1 , 'zoom' ) ;
1498
+ expect ( rotation . lon ) . toBeCloseTo ( attr [ 0 ] [ 0 ] , 1 , msg + 'rotation.lon' ) ;
1499
+ expect ( rotation . lat ) . toBeCloseTo ( attr [ 0 ] [ 1 ] , 1 , msg + 'rotation.lat' ) ;
1500
+ expect ( center . lon ) . toBeCloseTo ( attr [ 1 ] [ 0 ] , 1 , msg + 'center.lon' ) ;
1501
+ expect ( center . lat ) . toBeCloseTo ( attr [ 1 ] [ 1 ] , 1 , msg + 'center.lat' ) ;
1502
+ expect ( scale ) . toBeCloseTo ( attr [ 2 ] , 1 , msg + 'zoom' ) ;
1502
1503
1503
1504
var geo = geoLayout . _subplot ;
1504
1505
var rotate = geo . projection . rotate ( ) ;
1505
1506
var translate = geo . projection . translate ( ) ;
1506
1507
var _center = geo . projection . center ( ) ;
1507
1508
var _scale = geo . projection . scale ( ) ;
1508
1509
1509
- expect ( rotate [ 0 ] ) . toBeCloseTo ( proj [ 0 ] [ 0 ] , 0 , 'rotate[0]' ) ;
1510
- expect ( rotate [ 1 ] ) . toBeCloseTo ( proj [ 0 ] [ 1 ] , 0 , 'rotate[1]' ) ;
1511
- expect ( translate [ 0 ] ) . toBeCloseTo ( proj [ 1 ] [ 0 ] , 0 , 'translate[0]' ) ;
1512
- expect ( translate [ 1 ] ) . toBeCloseTo ( proj [ 1 ] [ 1 ] , 0 , 'translate[1]' ) ;
1513
- expect ( _center [ 0 ] ) . toBeCloseTo ( proj [ 2 ] [ 0 ] , 0 , 'center[0]' ) ;
1514
- expect ( _center [ 1 ] ) . toBeCloseTo ( proj [ 2 ] [ 1 ] , 0 , 'center[1]' ) ;
1515
- expect ( _scale ) . toBeCloseTo ( proj [ 3 ] , 0 , 'scale' ) ;
1510
+ expect ( rotate [ 0 ] ) . toBeCloseTo ( proj [ 0 ] [ 0 ] , 0 , msg + 'rotate[0]' ) ;
1511
+ expect ( rotate [ 1 ] ) . toBeCloseTo ( proj [ 0 ] [ 1 ] , 0 , msg + 'rotate[1]' ) ;
1512
+ expect ( translate [ 0 ] ) . toBeCloseTo ( proj [ 1 ] [ 0 ] , 0 , msg + 'translate[0]' ) ;
1513
+ expect ( translate [ 1 ] ) . toBeCloseTo ( proj [ 1 ] [ 1 ] , 0 , msg + 'translate[1]' ) ;
1514
+ expect ( _center [ 0 ] ) . toBeCloseTo ( proj [ 2 ] [ 0 ] , 0 , msg + 'center[0]' ) ;
1515
+ expect ( _center [ 1 ] ) . toBeCloseTo ( proj [ 2 ] [ 1 ] , 0 , msg + 'center[1]' ) ;
1516
+ expect ( _scale ) . toBeCloseTo ( proj [ 3 ] , 0 , msg + 'scale' ) ;
1516
1517
1517
- assertEventData ( eventKeys ) ;
1518
+ assertEventData ( msg , eventKeys ) ;
1518
1519
}
1519
1520
1520
1521
plot ( fig ) . then ( function ( ) {
1521
- _assert ( [
1522
+ _assert ( 'base' , [
1522
1523
[ - 90 , 0 ] , [ - 90 , 0 ] , 1
1523
1524
] , [
1524
1525
[ 90 , 0 ] , [ 350 , 260 ] , [ 0 , 0 ] , 101.9
1525
1526
] , undefined ) ;
1526
1527
return drag ( [ [ 350 , 250 ] , [ 400 , 250 ] ] ) ;
1527
1528
} )
1528
1529
. then ( function ( ) {
1529
- _assert ( [
1530
+ _assert ( 'after east-west drag' , [
1530
1531
[ - 124.4 , 0 ] , [ - 124.4 , 0 ] , 1
1531
1532
] , [
1532
1533
[ 124.4 , 0 ] , [ 350 , 260 ] , [ 0 , 0 ] , 101.9
@@ -1536,7 +1537,7 @@ describe('Test geo zoom/pan/drag interactions:', function() {
1536
1537
return drag ( [ [ 400 , 250 ] , [ 400 , 300 ] ] ) ;
1537
1538
} )
1538
1539
. then ( function ( ) {
1539
- _assert ( [
1540
+ _assert ( 'after north-south drag' , [
1540
1541
[ - 124.4 , 0 ] , [ - 124.4 , 28.1 ] , 1
1541
1542
] , [
1542
1543
[ 124.4 , 0 ] , [ 350 , 310 ] , [ 0 , 0 ] , 101.9
@@ -1546,32 +1547,31 @@ describe('Test geo zoom/pan/drag interactions:', function() {
1546
1547
return scroll ( [ 350 , 250 ] , [ - 200 , - 200 ] ) ;
1547
1548
} )
1548
1549
. then ( function ( ) {
1549
- _assert ( [
1550
1550
[ - 124.4 , 0 ] , [ - 124.4 , 29.5 ] , 1.3
1551
+ _assert ( 'after off-center scroll' , [
1551
1552
] , [
1552
1553
[ 124.4 , 0 ] , [ 350 , 329.2 ] , [ 0 , 0 ] , 134.4
1553
1554
] , [
1554
1555
'geo.projection.rotation.lon' ,
1555
1556
'geo.center.lon' , 'geo.center.lat' ,
1556
1557
'geo.projection.scale'
1557
1558
] ) ;
1558
- // something that causes a replot
1559
1559
return Plotly . relayout ( gd , 'geo.showocean' , false ) ;
1560
1560
} )
1561
1561
. then ( function ( ) {
1562
- _assert ( [
1563
1562
[ - 124.4 , 0 ] , [ - 124.4 , 29.5 ] , 1.3
1563
+ _assert ( 'after some relayout call that causes a replot' , [
1564
1564
] , [
1565
1565
// converts translate (px) to center (lonlat)
1566
- [ 124.4 , 0 ] , [ 350 , 260 ] , [ 0 , 29.5 ] , 134.4
1566
+ [ 151.2 , 0 ] , [ 350 , 260 ] , [ 0 , 29.5 ] , 134.4
1567
1567
] , [
1568
1568
'geo.showocean'
1569
1569
] ) ;
1570
1570
return dblClick ( [ 350 , 250 ] ) ;
1571
1571
} )
1572
1572
. then ( function ( ) {
1573
1573
// resets to initial view
1574
- _assert ( [
1574
+ _assert ( 'after double click' , [
1575
1575
[ - 90 , 0 ] , [ - 90 , 0 ] , 1
1576
1576
] , [
1577
1577
[ 90 , 0 ] , [ 350 , 260 ] , [ 0 , 0 ] , 101.9
@@ -1587,36 +1587,38 @@ describe('Test geo zoom/pan/drag interactions:', function() {
1587
1587
1588
1588
// of layout width = height = 500
1589
1589
1590
- function _assert ( attr , proj , eventKeys ) {
1590
+ function _assert ( step , attr , proj , eventKeys ) {
1591
+ var msg = '[' + step + '] ' ;
1592
+
1591
1593
var geoLayout = gd . _fullLayout . geo ;
1592
1594
var rotation = geoLayout . projection . rotation ;
1593
1595
var scale = geoLayout . projection . scale ;
1594
1596
1595
- expect ( rotation . lon ) . toBeCloseTo ( attr [ 0 ] [ 0 ] , 0 , 'rotation.lon' ) ;
1596
- expect ( rotation . lat ) . toBeCloseTo ( attr [ 0 ] [ 1 ] , 0 , 'rotation.lat' ) ;
1597
- expect ( scale ) . toBeCloseTo ( attr [ 1 ] , 1 , 'zoom' ) ;
1597
+ expect ( rotation . lon ) . toBeCloseTo ( attr [ 0 ] [ 0 ] , 0 , msg + 'rotation.lon' ) ;
1598
+ expect ( rotation . lat ) . toBeCloseTo ( attr [ 0 ] [ 1 ] , 0 , msg + 'rotation.lat' ) ;
1599
+ expect ( scale ) . toBeCloseTo ( attr [ 1 ] , 1 , msg + 'zoom' ) ;
1598
1600
1599
1601
var geo = geoLayout . _subplot ;
1600
1602
var rotate = geo . projection . rotate ( ) ;
1601
1603
var _scale = geo . projection . scale ( ) ;
1602
1604
1603
- expect ( rotate [ 0 ] ) . toBeCloseTo ( proj [ 0 ] [ 0 ] , 0 , 'rotate[0]' ) ;
1604
- expect ( rotate [ 1 ] ) . toBeCloseTo ( proj [ 0 ] [ 1 ] , 0 , 'rotate[1]' ) ;
1605
- expect ( _scale ) . toBeCloseTo ( proj [ 1 ] , 0 , 'scale' ) ;
1605
+ expect ( rotate [ 0 ] ) . toBeCloseTo ( proj [ 0 ] [ 0 ] , 0 , msg + 'rotate[0]' ) ;
1606
+ expect ( rotate [ 1 ] ) . toBeCloseTo ( proj [ 0 ] [ 1 ] , 0 , msg + 'rotate[1]' ) ;
1607
+ expect ( _scale ) . toBeCloseTo ( proj [ 1 ] , 0 , msg + 'scale' ) ;
1606
1608
1607
- assertEventData ( eventKeys ) ;
1609
+ assertEventData ( msg , eventKeys ) ;
1608
1610
}
1609
1611
1610
1612
plot ( fig ) . then ( function ( ) {
1611
- _assert ( [
1613
+ _assert ( 'base' , [
1612
1614
[ - 75 , 45 ] , 1
1613
1615
] , [
1614
1616
[ 75 , - 45 ] , 160
1615
1617
] , undefined ) ;
1616
1618
return drag ( [ [ 250 , 250 ] , [ 300 , 250 ] ] ) ;
1617
1619
} )
1618
1620
. then ( function ( ) {
1619
- _assert ( [
1621
+ _assert ( 'after east-west drag' , [
1620
1622
[ - 103.7 , 49.3 ] , 1
1621
1623
] , [
1622
1624
[ 103.7 , - 49.3 ] , 160
@@ -1626,7 +1628,7 @@ describe('Test geo zoom/pan/drag interactions:', function() {
1626
1628
return drag ( [ [ 250 , 250 ] , [ 300 , 300 ] ] ) ;
1627
1629
} )
1628
1630
. then ( function ( ) {
1629
- _assert ( [
1631
+ _assert ( 'after NW-SE drag' , [
1630
1632
[ - 135.5 , 73.8 ] , 1
1631
1633
] , [
1632
1634
[ 135.5 , - 73.8 ] , 160
@@ -1636,19 +1638,18 @@ describe('Test geo zoom/pan/drag interactions:', function() {
1636
1638
return scroll ( [ 300 , 300 ] , [ - 200 , - 200 ] ) ;
1637
1639
} )
1638
1640
. then ( function ( ) {
1639
- _assert ( [
1641
+ _assert ( 'after scroll' , [
1640
1642
[ - 126.2 , 67.1 ] , 1.3
1641
1643
] , [
1642
1644
[ 126.2 , - 67.1 ] , 211.1
1643
1645
] , [
1644
1646
'geo.projection.rotation.lon' , 'geo.projection.rotation.lat' ,
1645
1647
'geo.projection.scale'
1646
1648
] ) ;
1647
- // something that causes a replot
1648
1649
return Plotly . relayout ( gd , 'geo.showocean' , false ) ;
1649
1650
} )
1650
1651
. then ( function ( ) {
1651
- _assert ( [
1652
+ _assert ( 'after some relayout call that causes a replot' , [
1652
1653
[ - 126.2 , 67.1 ] , 1.3
1653
1654
] , [
1654
1655
[ 126.2 , - 67.1 ] , 211.1
@@ -1659,7 +1660,7 @@ describe('Test geo zoom/pan/drag interactions:', function() {
1659
1660
} )
1660
1661
. then ( function ( ) {
1661
1662
// resets to initial view
1662
- _assert ( [
1663
+ _assert ( 'after double click' , [
1663
1664
[ - 75 , 45 ] , 1
1664
1665
] , [
1665
1666
[ 75 , - 45 ] , 160
@@ -1676,39 +1677,41 @@ describe('Test geo zoom/pan/drag interactions:', function() {
1676
1677
1677
1678
// of layout width = height = 500
1678
1679
1679
- function _assert ( attr , proj , eventKeys ) {
1680
+ function _assert ( step , attr , proj , eventKeys ) {
1681
+ var msg = '[' + step + '] ' ;
1682
+
1680
1683
var geoLayout = gd . _fullLayout . geo ;
1681
1684
var center = geoLayout . center ;
1682
1685
var scale = geoLayout . projection . scale ;
1683
1686
1684
- expect ( center . lon ) . toBeCloseTo ( attr [ 0 ] [ 0 ] , - 0.5 , 'center.lon' ) ;
1685
- expect ( center . lat ) . toBeCloseTo ( attr [ 0 ] [ 1 ] , - 0.5 , 'center.lat' ) ;
1686
- expect ( scale ) . toBeCloseTo ( attr [ 1 ] , 1 , 'zoom' ) ;
1687
+ expect ( center . lon ) . toBeCloseTo ( attr [ 0 ] [ 0 ] , - 0.5 , msg + 'center.lon' ) ;
1688
+ expect ( center . lat ) . toBeCloseTo ( attr [ 0 ] [ 1 ] , - 0.5 , msg + 'center.lat' ) ;
1689
+ expect ( scale ) . toBeCloseTo ( attr [ 1 ] , 1 , msg + 'zoom' ) ;
1687
1690
1688
1691
var geo = geoLayout . _subplot ;
1689
1692
var translate = geo . projection . translate ( ) ;
1690
1693
var _center = geo . projection . center ( ) ;
1691
1694
var _scale = geo . projection . scale ( ) ;
1692
1695
1693
- expect ( translate [ 0 ] ) . toBeCloseTo ( proj [ 0 ] [ 0 ] , - 0.75 , 'translate[0]' ) ;
1694
- expect ( translate [ 1 ] ) . toBeCloseTo ( proj [ 0 ] [ 1 ] , - 0.75 , 'translate[1]' ) ;
1695
- expect ( _center [ 0 ] ) . toBeCloseTo ( proj [ 1 ] [ 0 ] , - 0.5 , 'center[0]' ) ;
1696
- expect ( _center [ 1 ] ) . toBeCloseTo ( proj [ 1 ] [ 1 ] , - 0.5 , 'center[1]' ) ;
1697
- expect ( _scale ) . toBeCloseTo ( proj [ 2 ] , - 1 , 'scale' ) ;
1696
+ expect ( translate [ 0 ] ) . toBeCloseTo ( proj [ 0 ] [ 0 ] , - 0.75 , msg + 'translate[0]' ) ;
1697
+ expect ( translate [ 1 ] ) . toBeCloseTo ( proj [ 0 ] [ 1 ] , - 0.75 , msg + 'translate[1]' ) ;
1698
+ expect ( _center [ 0 ] ) . toBeCloseTo ( proj [ 1 ] [ 0 ] , - 0.5 , msg + 'center[0]' ) ;
1699
+ expect ( _center [ 1 ] ) . toBeCloseTo ( proj [ 1 ] [ 1 ] , - 0.5 , msg + 'center[1]' ) ;
1700
+ expect ( _scale ) . toBeCloseTo ( proj [ 2 ] , - 1 , msg + 'scale' ) ;
1698
1701
1699
- assertEventData ( eventKeys ) ;
1702
+ assertEventData ( msg , eventKeys ) ;
1700
1703
}
1701
1704
1702
1705
plot ( fig ) . then ( function ( ) {
1703
- _assert ( [
1706
+ _assert ( 'base' , [
1704
1707
[ 15 , 57.5 ] , 1 ,
1705
1708
] , [
1706
1709
[ 247 , 260 ] , [ 0 , 57.5 ] , 292.2
1707
1710
] , undefined ) ;
1708
1711
return drag ( [ [ 250 , 250 ] , [ 200 , 200 ] ] ) ;
1709
1712
} )
1710
1713
. then ( function ( ) {
1711
- _assert ( [
1714
+ _assert ( 'after SW-NE drag' , [
1712
1715
[ 30.9 , 46.2 ] , 1
1713
1716
] , [
1714
1717
// changes translate(), but not center()
@@ -1719,18 +1722,17 @@ describe('Test geo zoom/pan/drag interactions:', function() {
1719
1722
return scroll ( [ 300 , 300 ] , [ - 200 , - 200 ] ) ;
1720
1723
} )
1721
1724
. then ( function ( ) {
1722
- _assert ( [
1725
+ _assert ( 'after scroll' , [
1723
1726
[ 34.3 , 43.6 ] , 1.3
1724
1727
] , [
1725
1728
[ 164.1 , 181.2 ] , [ 0 , 57.5 ] , 385.5
1726
1729
] , [
1727
1730
'geo.center.lon' , 'geo.center.lon' , 'geo.projection.scale'
1728
1731
] ) ;
1729
- // something that causes a replot
1730
1732
return Plotly . relayout ( gd , 'geo.showlakes' , true ) ;
1731
1733
} )
1732
1734
. then ( function ( ) {
1733
- _assert ( [
1735
+ _assert ( 'after some relayout call that causes a replot' , [
1734
1736
[ 34.3 , 43.6 ] , 1.3
1735
1737
] , [
1736
1738
// changes are now reflected in 'center'
@@ -1741,7 +1743,7 @@ describe('Test geo zoom/pan/drag interactions:', function() {
1741
1743
return dblClick ( [ 250 , 250 ] ) ;
1742
1744
} )
1743
1745
. then ( function ( ) {
1744
- _assert ( [
1746
+ _assert ( 'after double click' , [
1745
1747
[ 15 , 57.5 ] , 1 ,
1746
1748
] , [
1747
1749
[ 247 , 260 ] , [ 0 , 57.5 ] , 292.2
@@ -1758,37 +1760,39 @@ describe('Test geo zoom/pan/drag interactions:', function() {
1758
1760
// layout width = 870
1759
1761
// layout height = 598
1760
1762
1761
- function _assert ( attr , proj , eventKeys ) {
1763
+ function _assert ( step , attr , proj , eventKeys ) {
1764
+ var msg = '[' + step + '] ' ;
1765
+
1762
1766
var geoLayout = gd . _fullLayout . geo ;
1763
1767
var center = geoLayout . center ;
1764
1768
var scale = geoLayout . projection . scale ;
1765
1769
1766
- expect ( center . lon ) . toBeCloseTo ( attr [ 0 ] [ 0 ] , 1 , 'center.lon' ) ;
1767
- expect ( center . lat ) . toBeCloseTo ( attr [ 0 ] [ 1 ] , 1 , 'center.lat' ) ;
1768
- expect ( scale ) . toBeCloseTo ( attr [ 1 ] , 1 , 'zoom' ) ;
1770
+ expect ( center . lon ) . toBeCloseTo ( attr [ 0 ] [ 0 ] , 1 , msg + 'center.lon' ) ;
1771
+ expect ( center . lat ) . toBeCloseTo ( attr [ 0 ] [ 1 ] , 1 , msg + 'center.lat' ) ;
1772
+ expect ( scale ) . toBeCloseTo ( attr [ 1 ] , 1 , msg + 'zoom' ) ;
1769
1773
1770
1774
// albersUsa projection does not have a center() method
1771
1775
var geo = geoLayout . _subplot ;
1772
1776
var translate = geo . projection . translate ( ) ;
1773
1777
var _scale = geo . projection . scale ( ) ;
1774
1778
1775
- expect ( translate [ 0 ] ) . toBeCloseTo ( proj [ 0 ] [ 0 ] , - 1 , 'translate[0]' ) ;
1776
- expect ( translate [ 1 ] ) . toBeCloseTo ( proj [ 0 ] [ 1 ] , - 1 , 'translate[1]' ) ;
1777
- expect ( _scale ) . toBeCloseTo ( proj [ 1 ] , - 1.5 , 'scale' ) ;
1779
+ expect ( translate [ 0 ] ) . toBeCloseTo ( proj [ 0 ] [ 0 ] , - 1 , msg + 'translate[0]' ) ;
1780
+ expect ( translate [ 1 ] ) . toBeCloseTo ( proj [ 0 ] [ 1 ] , - 1 , msg + 'translate[1]' ) ;
1781
+ expect ( _scale ) . toBeCloseTo ( proj [ 1 ] , - 1.5 , msg + 'scale' ) ;
1778
1782
1779
- assertEventData ( eventKeys ) ;
1783
+ assertEventData ( msg , eventKeys ) ;
1780
1784
}
1781
1785
1782
1786
plot ( fig ) . then ( function ( ) {
1783
- _assert ( [
1787
+ _assert ( 'base' , [
1784
1788
[ - 96.6 , 38.7 ] , 1 ,
1785
1789
] , [
1786
1790
[ 416 , 309 ] , 738.5
1787
1791
] , undefined ) ;
1788
1792
return drag ( [ [ 250 , 250 ] , [ 200 , 200 ] ] ) ;
1789
1793
} )
1790
1794
. then ( function ( ) {
1791
- _assert ( [
1795
+ _assert ( 'after NW-SE drag' , [
1792
1796
[ - 91.8 , 34.8 ] , 1 ,
1793
1797
] , [
1794
1798
[ 366 , 259 ] , 738.5
@@ -1798,18 +1802,17 @@ describe('Test geo zoom/pan/drag interactions:', function() {
1798
1802
return scroll ( [ 300 , 300 ] , [ - 200 , - 200 ] ) ;
1799
1803
} )
1800
1804
. then ( function ( ) {
1801
- _assert ( [
1805
+ _assert ( 'after scroll' , [
1802
1806
[ - 94.5 , 35.0 ] , 1.3
1803
1807
] , [
1804
1808
[ 387.1 , 245.9 ] , 974.4
1805
1809
] , [
1806
1810
'geo.center.lon' , 'geo.center.lon' , 'geo.projection.scale'
1807
1811
] ) ;
1808
- // something that causes a replot
1809
1812
return Plotly . relayout ( gd , 'geo.showlakes' , true ) ;
1810
1813
} )
1811
1814
. then ( function ( ) {
1812
- _assert ( [
1815
+ _assert ( 'after some relayout call that causes a replot' , [
1813
1816
[ - 94.5 , 35.0 ] , 1.3
1814
1817
] , [
1815
1818
// new center values are reflected in translate()
@@ -1820,7 +1823,7 @@ describe('Test geo zoom/pan/drag interactions:', function() {
1820
1823
return dblClick ( [ 250 , 250 ] ) ;
1821
1824
} )
1822
1825
. then ( function ( ) {
1823
- _assert ( [
1826
+ _assert ( 'after double click' , [
1824
1827
[ - 96.6 , 38.7 ] , 1 ,
1825
1828
] , [
1826
1829
[ 416 , 309 ] , 738.5
0 commit comments