Sorting nodes

Is there a way to display a graph with sorted nodes ?

I assume you want to position some of the nodes in your diagram in a particular order. So this is basically a layout issue.

Clearly, if you are explicitly positioning the nodes, either programmatically or by the user’s dragging, this is not an issue – you can sort the nodes however you want.

If you are using ForceDirectedLayout, there is not supposed to be any control over the relative ordering of nodes.

If you are using TreeLayout or GridLayout or CircularLayout, there are explicit properties for Sorting (order) and the Comparer function.

If you are using LayeredDigraphLayout, the normal answer is that the nodes are not supposed to be orderable, because it is trying to reduce the number of crossings between layers. However, it is possible to override some methods if you want to implement some kind of sorting on your own.

I hope I have covered all of the cases that you are interested in.