We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4490811 commit e8df1bfCopy full SHA for e8df1bf
src/sankey.js
@@ -132,12 +132,11 @@ export default function() {
132
// Compute the value (size) of each node by summing the associated links.
133
function computeNodeValues(graph) {
134
graph.nodes.forEach(function(node) {
135
- if ( typeof node.value === 'undefined' ) {
136
- node.value = Math.max(
137
- sum(node.sourceLinks, value),
138
- sum(node.targetLinks, value)
139
- );
140
- }
+ node.value = Math.max(
+ sum(node.sourceLinks, value),
+ sum(node.targetLinks, value),
+ typeof node.value !== 'undefined' ? node.value : 0
+ );
141
});
142
}
143
0 commit comments