JSFiddle example: http://jsfiddle.net/zpgt1aq0/3/
I'd like to order the nodes in my sankey diagram by value for each "column" of the diagram.
Here is an example of the ordering I'd like to display (created manually for the time being):
However, this is what the default sort gives me:
Some researching led me to the following two questions:
How to force y position of one branch in d3 sankey plugin?
Vertical sort of nodes in D3 Sankey diagram
but neither of these are exactly what I'm looking for.
I imagine this has to do with a combination of the ascendingDepth()
function and the removeCollisions()
piece of the computeNodeDepths()
function, but I can't seem to wrap my head around how to proceed.