Skip to content

Commit

Permalink
specify minimum value of node with node.minValue
Browse files Browse the repository at this point in the history
  • Loading branch information
sillitoe committed Mar 5, 2019
1 parent e8df1bf commit c03678f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/sankey.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
});
}
Expand Down

0 comments on commit c03678f

Please sign in to comment.