@@ -1083,6 +1083,7 @@ describe('A bar plot', function() {
10831083 . catch ( failTest )
10841084 . then ( done ) ;
10851085 } ) ;
1086+
10861087 it ( 'should show bar texts (outside case)' , function ( done ) {
10871088 var data = [ {
10881089 y : [ 10 , - 20 , 30 ] ,
@@ -1736,6 +1737,39 @@ describe('A bar plot', function() {
17361737 . catch ( failTest )
17371738 . then ( done ) ;
17381739 } ) ;
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+ } ) ;
17391773} ) ;
17401774
17411775describe ( 'bar visibility toggling:' , function ( ) {
0 commit comments