@@ -72,8 +72,10 @@ function sankeyModel(layout, d, i) {
7272 linkSpec = trace . link ,
7373 arrangement = trace . arrangement ,
7474 horizontal = trace . orientation === 'h' ,
75- nodePad = trace . nodepad ,
76- nodeThickness = trace . nodethickness ,
75+ nodePad = trace . node . pad ,
76+ nodeThickness = trace . node . thickness ,
77+ nodelineColor = trace . node . line . color ,
78+ nodelineWidth = trace . node . line . width ,
7779 valueFormat = trace . valueformat ,
7880 valueSuffix = trace . valuesuffix ,
7981 textFont = trace . textfont ;
@@ -124,6 +126,8 @@ function sankeyModel(layout, d, i) {
124126 width : width ,
125127 height : height ,
126128 nodePad : nodePad ,
129+ nodelineColor : nodelineColor ,
130+ nodelineWidth : nodelineWidth ,
127131 valueFormat : valueFormat ,
128132 valueSuffix : valueSuffix ,
129133 textFont : textFont ,
@@ -184,6 +188,8 @@ function nodeModel(uniqueKeys, d, n) {
184188 traceId : d . key ,
185189 node : n ,
186190 nodePad : d . nodePad ,
191+ nodelineColor : d . nodelineColor ,
192+ nodelineWidth : d . nodelineWidth ,
187193 textFont : d . textFont ,
188194 size : d . horizontal ? d . height : d . width ,
189195 visibleWidth : Math . ceil ( d . horizontal ? visibleThickness : visibleLength ) ,
@@ -445,17 +451,24 @@ module.exports = function(svg, styledData, layout, callbacks) {
445451 sankeyLink . enter ( )
446452 . append ( 'path' )
447453 . classed ( 'sankeyLink' , true )
454+ . attr ( 'd' , linkPath )
448455 . call ( attachPointerEvents , sankey , callbacks . linkEvents ) ;
449456
450457 sankeyLink
451458 . style ( 'stroke' , function ( d ) { return d . link . dy > 1 ? 'rgba(0,0,0,0)' : d . tinyColorHue ; } )
452459 . style ( 'stroke-width' , function ( d ) { return d . link . dy > 1 ? 2 : 1 ; } )
453460 . style ( 'stroke-opacity' , function ( d ) { return d . tinyColorAlpha ; } )
454461 . style ( 'fill' , function ( d ) { return d . tinyColorHue ; } )
455- . style ( 'fill-opacity' , function ( d ) { return d . tinyColorAlpha ; } )
462+ . style ( 'fill-opacity' , function ( d ) { return d . tinyColorAlpha ; } ) ;
463+
464+ sankeyLink . transition ( )
465+ . ease ( c . ease ) . duration ( c . duration )
456466 . attr ( 'd' , linkPath ) ;
457467
458- sankeyLink . exit ( ) . remove ( ) ;
468+ sankeyLink . exit ( ) . transition ( )
469+ . ease ( c . ease ) . duration ( c . duration )
470+ . style ( 'opacity' , 0 )
471+ . remove ( ) ;
459472
460473 var sankeyNodeSet = sankey . selectAll ( '.sankeyNodeSet' )
461474 . data ( repeat , keyFun ) ;
@@ -508,11 +521,12 @@ module.exports = function(svg, styledData, layout, callbacks) {
508521 nodeRect . enter ( )
509522 . append ( 'rect' )
510523 . classed ( 'nodeRect' , true )
511- . style ( 'stroke-width' , 0.5 )
512- . call ( Color . stroke , 'rgba(0, 0, 0, 1)' )
513524 . call ( sizeNode ) ;
514525
515526 nodeRect
527+ . style ( 'stroke-width' , function ( d ) { return d . nodelineWidth ; } )
528+ . style ( 'stroke' , function ( d ) { return Color . tinyRGB ( tinycolor ( d . nodelineColor ) ) ; } )
529+ . style ( 'stroke-opacity' , function ( d ) { return Color . opacity ( d . nodelineColor ) ; } )
516530 . style ( 'fill' , function ( d ) { return d . tinyColorHue ; } )
517531 . style ( 'fill-opacity' , function ( d ) { return d . tinyColorAlpha ; } ) ;
518532
0 commit comments