dag: Improve the graph layout algorithm
commitfb252d07fb5cf634a2a426642e201d8d9935629f
authorDavid Aguilar <davvid@gmail.com>
Wed, 28 Dec 2011 08:15:35 +0000 (28 00:15 -0800)
committerDavid Aguilar <davvid@gmail.com>
Wed, 28 Dec 2011 08:15:57 +0000 (28 00:15 -0800)
tree77d394741f330c08dffea8839c0fdc3361b30026
parent331619b1281d7b3178c11ccb5f49e797f6f92907
dag: Improve the graph layout algorithm

Walk the nodes from parent to children so that the nodes have
a stronger tendency to stay left-aligned.

Special-case the single-parent case to favor aligning nodes
relative to their parents.

What's really nice is that merges pull nodes towards the left which
is exactly what you'd expect ("merging features into master")
when visualizing branchy histories.

The previous algorithm basically did this in the reverse
order and caused branches to diverge more along the X axis
due to the order of traversal.

Signed-off-by: David Aguilar <davvid@gmail.com>
cola/dag/view.py