@@ -338,6 +338,39 @@ describe('ternary plots', function() {
338
338
. then ( done ) ;
339
339
} ) ;
340
340
341
+ it ( 'should be able to relayout axis tickfont attributes' , function ( done ) {
342
+ var gd = createGraphDiv ( ) ;
343
+ var fig = Lib . extendDeep ( { } , require ( '@mocks/ternary_simple.json' ) ) ;
344
+
345
+ function _assert ( family , color , size ) {
346
+ var tick = d3 . select ( 'g.aaxis > g.ytick > text' ) . node ( ) ;
347
+
348
+ expect ( tick . style [ 'font-family' ] ) . toBe ( family , 'font family' ) ;
349
+ expect ( parseFloat ( tick . style [ 'font-size' ] ) ) . toBe ( size , 'font size' ) ;
350
+ expect ( tick . style . fill ) . toBe ( color , 'font color' ) ;
351
+ }
352
+
353
+ Plotly . plot ( gd , fig ) . then ( function ( ) {
354
+ _assert ( '"Open Sans", verdana, arial, sans-serif' , 'rgb(204, 204, 204)' , 12 ) ;
355
+
356
+ return Plotly . relayout ( gd , 'ternary.aaxis.tickfont.size' , 5 ) ;
357
+ } )
358
+ . then ( function ( ) {
359
+ _assert ( '"Open Sans", verdana, arial, sans-serif' , 'rgb(204, 204, 204)' , 5 ) ;
360
+
361
+ return Plotly . relayout ( gd , 'ternary.aaxis.tickfont' , {
362
+ family : 'Roboto' ,
363
+ color : 'red' ,
364
+ size : 20
365
+ } ) ;
366
+ } )
367
+ . then ( function ( ) {
368
+ _assert ( 'Roboto' , 'rgb(255, 0, 0)' , 20 ) ;
369
+ } )
370
+ . catch ( fail )
371
+ . then ( done ) ;
372
+ } ) ;
373
+
341
374
function countTernarySubplot ( ) {
342
375
return d3 . selectAll ( '.ternary' ) . size ( ) ;
343
376
}
0 commit comments