@@ -363,7 +363,27 @@ describe('Test sunburst calc:', function() {
363363 expect ( cd [ 8 ] . color ) . toEqual ( 'rgba(255, 255, 255, 1)' ) ;
364364 } ) ;
365365
366- it ( 'should use *marker.colors* numbers with colorscale' , function ( ) {
366+ it ( 'should use *marker.colors* numbers with default colorscale' , function ( ) {
367+ _calc ( {
368+ marker : { colors : [ - 4 , - 3 , - 2 , - 1 , 0 , 1 , 2 , 3 , 4 ] } ,
369+ labels : [ 'Eve' , 'Cain' , 'Seth' , 'Enos' , 'Noam' , 'Abel' , 'Awan' , 'Enoch' , 'Azura' ] ,
370+ parents : [ '' , 'Eve' , 'Eve' , 'Seth' , 'Seth' , 'Eve' , 'Eve' , 'Awan' , 'Eve' ]
371+ } ) ;
372+
373+ var cd = gd . calcdata [ 0 ] ;
374+ expect ( cd . length ) . toEqual ( 9 ) ;
375+ expect ( cd [ 0 ] . color ) . toEqual ( 'rgb(5, 10, 172)' ) ;
376+ expect ( cd [ 1 ] . color ) . toEqual ( 'rgb(41, 55, 199)' ) ;
377+ expect ( cd [ 2 ] . color ) . toEqual ( 'rgb(77, 101, 226)' ) ;
378+ expect ( cd [ 3 ] . color ) . toEqual ( 'rgb(120, 146, 238)' ) ;
379+ expect ( cd [ 4 ] . color ) . toEqual ( 'rgb(190, 190, 190)' ) ;
380+ expect ( cd [ 5 ] . color ) . toEqual ( 'rgb(223, 164, 122)' ) ;
381+ expect ( cd [ 6 ] . color ) . toEqual ( 'rgb(221, 123, 80)' ) ;
382+ expect ( cd [ 7 ] . color ) . toEqual ( 'rgb(200, 66, 54)' ) ;
383+ expect ( cd [ 8 ] . color ) . toEqual ( 'rgb(178, 10, 28)' ) ;
384+ } ) ;
385+
386+ it ( 'should use *marker.colors* numbers with desired colorscale' , function ( ) {
367387 _calc ( {
368388 marker : { colors : [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ] , colorscale : 'Portland' } ,
369389 labels : [ 'Eve' , 'Cain' , 'Seth' , 'Enos' , 'Noam' , 'Abel' , 'Awan' , 'Enoch' , 'Azura' ] ,
0 commit comments