@@ -1083,6 +1083,7 @@ describe('A bar plot', function() {
1083
1083
. catch ( failTest )
1084
1084
. then ( done ) ;
1085
1085
} ) ;
1086
+
1086
1087
it ( 'should show bar texts (outside case)' , function ( done ) {
1087
1088
var data = [ {
1088
1089
y : [ 10 , - 20 , 30 ] ,
@@ -1736,6 +1737,39 @@ describe('A bar plot', function() {
1736
1737
. catch ( failTest )
1737
1738
. then ( done ) ;
1738
1739
} ) ;
1740
+
1741
+ it ( 'should be able to react with new text colors' , function ( done ) {
1742
+ Plotly . react ( gd , [ {
1743
+ type : 'bar' ,
1744
+ y : [ 1 , 2 , 3 ] ,
1745
+ text : [ 'A' , 'B' , 'C' ] ,
1746
+ textposition : 'inside'
1747
+ } ] )
1748
+ . then ( assertTextFontColors ( [ 'rgb(255, 255, 255)' , 'rgb(255, 255, 255)' , 'rgb(255, 255, 255)' ] ) )
1749
+ . then ( function ( ) {
1750
+ gd . data [ 0 ] . insidetextfont = { color : 'red' } ;
1751
+ return Plotly . react ( gd , gd . data ) ;
1752
+ } )
1753
+ . then ( assertTextFontColors ( [ 'rgb(255, 0, 0)' , 'rgb(255, 0, 0)' , 'rgb(255, 0, 0)' ] ) )
1754
+ . then ( function ( ) {
1755
+ delete gd . data [ 0 ] . insidetextfont . color ;
1756
+ gd . data [ 0 ] . textfont = { color : 'blue' } ;
1757
+ return Plotly . react ( gd , gd . data ) ;
1758
+ } )
1759
+ . then ( assertTextFontColors ( [ 'rgb(0, 0, 255)' , 'rgb(0, 0, 255)' , 'rgb(0, 0, 255)' ] ) )
1760
+ . then ( function ( ) {
1761
+ gd . data [ 0 ] . textposition = 'outside' ;
1762
+ return Plotly . react ( gd , gd . data ) ;
1763
+ } )
1764
+ . then ( assertTextFontColors ( [ 'rgb(0, 0, 255)' , 'rgb(0, 0, 255)' , 'rgb(0, 0, 255)' ] ) )
1765
+ . then ( function ( ) {
1766
+ gd . data [ 0 ] . outsidetextfont = { color : 'red' } ;
1767
+ return Plotly . react ( gd , gd . data ) ;
1768
+ } )
1769
+ . then ( assertTextFontColors ( [ 'rgb(255, 0, 0)' , 'rgb(255, 0, 0)' , 'rgb(255, 0, 0)' ] ) )
1770
+ . catch ( failTest )
1771
+ . then ( done ) ;
1772
+ } ) ;
1739
1773
} ) ;
1740
1774
1741
1775
describe ( 'bar visibility toggling:' , function ( ) {
0 commit comments