soxofaan / d3-plugin-captain-sankey

Friendly (subtree) fork of the "sankey" plugin from https://github.com/d3/d3-plugins
Other
42 stars 25 forks source link

Improve the layout algorithm in computeNodeDepths #2

Closed soxofaan closed 9 years ago

soxofaan commented 9 years ago

In computeNodeDepths, the node position recalculation is based on a weighted average of the centers of the source/target nodes of incoming/outgoing links.

It would probably be better to use the centers of only the node fractions corresponding with the links

soxofaan commented 9 years ago

Some examples of the layout optimisation: left: original algorithm, right: updated algorithm

issue-2-dataset02 issue-2-dataset05