Sankey graph nodes not sorted

Hi Team,

I am building a sankey graph like shown below:

image

I see that the revision nodes are not always sorted(expecting latest first), even though the data is sorted.
Any way I can achieve the sorting here?

Thanks,
Aishwarya

You may have noticed that the SankeyLayout is actually a LayeredDigraphLayout in the Sankey diagram sample: Sankey Diagram

LayeredDigraphLayout is designed to try to reduce the number of link crossings between layers, in order to produce a diagram that is easier for humans to read. But if you have the nodes and the links defined in a particular order, you can disable such re-ordering by overriding LayeredDigraphLayout.reduceCrossings, which takes no arguments, to be a no-op.

If you are willing to add a data property on the node data that can be sorted, you could use the OrderedLayeredDigraphLayout in this sample: Minimal GoJS Sample You’ll need to adapt the code to sort nodes/vertexes based on the data property in your model.