diff --git a/README.md b/README.md index 0fee095..8da2f19 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Each *node* must be an object. The following properties are assigned by the [San * *node*.sourceLinks - the array of outgoing [links](#sankey_links) which have this node as their source * *node*.targetLinks - the array of incoming [links](#sankey_links) which have this node as their target -* *node*.value - the node’s value; if not defined, this is the sum of *link*.value for the node’s incoming [links](#sankey_links) +* *node*.value - the node’s value; this is the sum of *link*.value for the node’s incoming [links](#sankey_links) (or *node*.minValue if defined and is greater) * *node*.index - the node’s zero-based index within the array of nodes * *node*.depth - the node’s zero-based graph depth, derived from the graph topology * *node*.height - the node’s zero-based graph height, derived from the graph topology diff --git a/src/sankey.js b/src/sankey.js index 9a47f51..f8895ca 100644 --- a/src/sankey.js +++ b/src/sankey.js @@ -135,7 +135,7 @@ export default function() { node.value = Math.max( sum(node.sourceLinks, value), sum(node.targetLinks, value), - typeof node.value !== 'undefined' ? node.value : 0 + typeof node.minValue !== 'undefined' ? node.minValue : 0 ); }); }