@@ -41,26 +41,26 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
4141 return Lib . coerce ( traceIn , traceOut , attributes , attr , dflt ) ;
4242 }
4343
44- coerce ( 'node.label' ) ;
44+ coerce ( 'node.label' , [ ] ) ;
4545 coerce ( 'node.pad' ) ;
4646 coerce ( 'node.thickness' ) ;
4747 coerce ( 'node.line.color' ) ;
4848 coerce ( 'node.line.width' ) ;
4949
5050 var defaultNodePalette = function ( i ) { return colors [ i % colors . length ] ; } ;
5151
52- coerce ( 'node.color' , traceIn . node . label . map ( function ( d , i ) {
52+ coerce ( 'node.color' , traceOut . node . label . map ( function ( d , i ) {
5353 return Color . addOpacity ( defaultNodePalette ( i ) , 0.8 ) ;
5454 } ) ) ;
5555
5656 coerce ( 'link.label' ) ;
57- coerce ( 'link.source' ) ;
58- coerce ( 'link.target' ) ;
59- coerce ( 'link.value' ) ;
57+ coerce ( 'link.source' , [ ] ) ;
58+ coerce ( 'link.target' , [ ] ) ;
59+ coerce ( 'link.value' , [ ] ) ;
6060 coerce ( 'link.line.color' ) ;
6161 coerce ( 'link.line.width' ) ;
6262
63- coerce ( 'link.color' , traceIn . link . value . map ( function ( ) {
63+ coerce ( 'link.color' , traceOut . link . value . map ( function ( ) {
6464 return tinycolor ( layout . paper_bgcolor ) . getLuminance ( ) < 0.333 ?
6565 'rgba(255, 255, 255, 0.6)' :
6666 'rgba(0, 0, 0, 0.2)' ;
@@ -78,10 +78,11 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
7878 Lib . coerceFont ( coerce , 'textfont' , Lib . extendFlat ( { } , layout . font ) ) ;
7979
8080 var missing = function ( n , i ) {
81- return traceIn . link . source . indexOf ( i ) === - 1 &&
82- traceIn . link . target . indexOf ( i ) === - 1 ;
81+ return traceOut . link . source . indexOf ( i ) === - 1 &&
82+ traceOut . link . target . indexOf ( i ) === - 1 ;
8383 } ;
84- if ( traceIn . node . label . some ( missing ) ) {
84+
85+ if ( traceOut . node . label . some ( missing ) ) {
8586 Lib . log ( 'Some of the nodes are neither sources nor targets, please remove them.' ) ;
8687 }
8788
0 commit comments