@@ -1741,9 +1741,9 @@ describe('funnelarea uniformtext', function() {
17411741 var pos0 = transform . indexOf ( 'scale(' ) ;
17421742 var scale = 1 ;
17431743 if ( pos0 !== - 1 ) {
1744- pos0 += 'scale' . length ;
1744+ pos0 += 'scale( ' . length ;
17451745 var pos1 = transform . indexOf ( ')' , pos0 ) ;
1746- scale = + ( transform . substring ( pos0 + 1 , pos1 - 1 ) ) ;
1746+ scale = + ( transform . substring ( pos0 , pos1 ) ) ;
17471747 }
17481748
17491749 expect ( opts . scales [ i ] ) . toBeCloseTo ( scale , 1 , 'scale for element ' + i , msg ) ;
@@ -1755,6 +1755,7 @@ describe('funnelarea uniformtext', function() {
17551755 var fig = {
17561756 data : [ {
17571757 type : 'funnelarea' ,
1758+ baseratio : 1 ,
17581759 labels : [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ] ,
17591760 values : [ 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ] ,
17601761 sort : false ,
@@ -1768,64 +1769,64 @@ describe('funnelarea uniformtext', function() {
17681769 '.' ,
17691770 '|' ,
17701771 '=' ,
1771- '$ ' ,
1772- 'long lablel '
1772+ 'longest word in German ' ,
1773+ 'Rindfleischetikettierungsueberwachungsaufgabenuebertragungsgesetz '
17731774 ] ,
17741775
17751776 textinfo : 'text' ,
17761777 textangle : 0 ,
17771778 showlegend : false
17781779 } ] ,
17791780 layout : {
1780- width : 350 ,
1781- height : 350
1781+ width : 450 ,
1782+ height : 450
17821783 }
17831784 } ;
17841785
17851786 Plotly . plot ( gd , fig )
17861787 . then ( assertTextSizes ( 'without uniformtext' , {
17871788 fontsizes : [ 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 ] ,
1788- scales : [ 0.40 , 1 , 0.62 , 0.70 , 0.82 , 0.98 , 1 , 0.91 ] ,
1789+ scales : [ 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0.69 ] ,
17891790 } ) )
17901791 . then ( function ( ) {
17911792 fig . layout . uniformtext = { mode : 'hide' } ; // default with minsize=0
17921793 return Plotly . react ( gd , fig ) ;
17931794 } )
17941795 . then ( assertTextSizes ( 'using mode: "hide"' , {
17951796 fontsizes : [ 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 ] ,
1796- scales : [ 0.4 , 0.4 , 0.4 , 0.4 , 0.4 , 0.4 , 0.4 , 0.4 ] ,
1797+ scales : [ 0.69 , 0.69 , 0.69 , 0.69 , 0.69 , 0.69 , 0.69 , 0.69 ] ,
17971798 } ) )
17981799 . then ( function ( ) {
17991800 fig . layout . uniformtext . minsize = 9 ; // set a minsize less than trace font size
18001801 return Plotly . react ( gd , fig ) ;
18011802 } )
18021803 . then ( assertTextSizes ( 'using minsize: 9' , {
18031804 fontsizes : [ 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 ] ,
1804- scales : [ 0 , 0.4 , 0 , 0 , 0.4 , 0.4 , 0.4 , 0.4 ] ,
1805+ scales : [ 0.69 , 0.69 , 0.69 , 0.69 , 0.69 , 0.69 , 0.69 , 0 ] ,
18051806 } ) )
18061807 . then ( function ( ) {
18071808 fig . layout . uniformtext . minsize = 32 ; // set a minsize greater than trace font size
18081809 return Plotly . react ( gd , fig ) ;
18091810 } )
18101811 . then ( assertTextSizes ( 'using minsize: 32' , {
18111812 fontsizes : [ 32 , 32 , 32 , 32 , 32 , 32 , 32 , 32 ] ,
1812- scales : [ 0 , 0.15 , 0 , 0 , 0 , 0 , 0 , 0 ] ,
1813+ scales : [ 0 , 0.26 , 0 , 0 , 0 , 0 , 0 , 0 ] ,
18131814 } ) )
18141815 . then ( function ( ) {
1815- fig . layout . uniformtext . minsize = 16 ; // set a minsize greater than trace font size
1816+ fig . layout . uniformtext . minsize = 13 ; // set a minsize greater than trace font size
18161817 return Plotly . react ( gd , fig ) ;
18171818 } )
1818- . then ( assertTextSizes ( 'using minsize: 16 ' , {
1819- fontsizes : [ 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 ] ,
1820- scales : [ 0 , 0.3 , 0 , 0 , 0 , 0 , 0.3 , 0 ] ,
1819+ . then ( assertTextSizes ( 'using minsize: 13 ' , {
1820+ fontsizes : [ 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 ] ,
1821+ scales : [ 0.64 , 0.64 , 0.64 , 0.64 , 0.64 , 0.64 , 0.64 , 0 ] ,
18211822 } ) )
18221823 . then ( function ( ) {
18231824 fig . layout . uniformtext . mode = 'show' ;
18241825 return Plotly . react ( gd , fig ) ;
18251826 } )
18261827 . then ( assertTextSizes ( 'using mode: "show"' , {
1827- fontsizes : [ 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 ] ,
1828- scales : [ 0.3 , 0.3 , 0.3 , 0.3 , 0.3 , 0.3 , 0.3 , 0.3 ] ,
1828+ fontsizes : [ 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 ] ,
1829+ scales : [ 0.64 , 0.64 , 0.64 , 0.64 , 0.64 , 0.64 , 0.64 , 0.64 ] ,
18291830 } ) )
18301831 . catch ( failTest )
18311832 . then ( done ) ;
0 commit comments