@@ -1807,4 +1807,68 @@ describe('treemap uniformtext', function() {
18071807 . catch ( failTest )
18081808 . then ( done ) ;
18091809 } ) ;
1810+
1811+ it ( 'should uniform text scales after transition' , function ( done ) {
1812+ Plotly . plot ( gd , {
1813+ data : [ {
1814+ type : 'treemap' ,
1815+ parents : [
1816+ '' ,
1817+ 'Oscar' ,
1818+ 'Oscar' ,
1819+ 'Oscar' ,
1820+ 'Oscar' ,
1821+ 'Oscar' ,
1822+ 'Oscar' ,
1823+ 'Uniform' ,
1824+ 'Uniform' ,
1825+ 'Uniform' ,
1826+ 'Uniform' ,
1827+ 'Uniform' ,
1828+ 'Uniform'
1829+ ] ,
1830+ labels : [
1831+ 'Oscar' ,
1832+ 'Papa' ,
1833+ 'Quebec' ,
1834+ 'Romeo' ,
1835+ 'Sierra' ,
1836+ 'Tango' ,
1837+ 'Uniform' ,
1838+ 'Victor' ,
1839+ 'Whiskey' ,
1840+ 'X ray' ,
1841+ 'Yankee' ,
1842+ 'Zulu'
1843+ ] ,
1844+ textinfo : 'label'
1845+ } ] ,
1846+ layout : {
1847+ width : 350 ,
1848+ height : 350 ,
1849+ uniformtext : {
1850+ mode : 'hide' ,
1851+ minsize : 10
1852+ }
1853+ }
1854+ } )
1855+ . then ( assertTextSizes ( 'before click' , {
1856+ fontsizes : [ 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 ] ,
1857+ scales : [ 0.84 , 0.84 , 0.84 , 0 , 0.84 , 0.84 , 0 , 0.84 , 0 , 0.84 , 0.84 , 0 ] ,
1858+ } ) )
1859+ . then ( click ( gd , 2 ) ) // click on Uniform
1860+ . then ( delay ( constants . CLICK_TRANSITION_TIME + 1 ) )
1861+ . then ( assertTextSizes ( 'after click child' , {
1862+ fontsizes : [ 12 , 12 , 12 , 12 , 12 , 12 , 12 ] ,
1863+ scales : [ 0.86 , 0.86 , 0.86 , 0.86 , 0.86 , 0.86 , 0.86 ] ,
1864+ } ) )
1865+ . then ( click ( gd , 1 ) ) // click on Oscar
1866+ . then ( delay ( constants . CLICK_TRANSITION_TIME + 1 ) )
1867+ . then ( assertTextSizes ( 'after click parent' , {
1868+ fontsizes : [ 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 ] ,
1869+ scales : [ 0.84 , 0.84 , 0.84 , 0 , 0.84 , 0.84 , 0 , 0.84 , 0 , 0.84 , 0.84 , 0 ] ,
1870+ } ) )
1871+ . catch ( failTest )
1872+ . then ( done ) ;
1873+ } ) ;
18101874} ) ;
0 commit comments