springy icon indicating copy to clipboard operation
springy copied to clipboard

Prettier Faster Sorting for Large Trees

Open microuser opened this issue 11 years ago • 3 comments

For graphs with text labelled segments, having the arrows flow from left to right makes more readable. The random() function was replaced with a random near diagonal. This assumes that the data node parents are created before node children. This also tends to create a more stable and quicker sort.

microuser avatar Jan 31 '14 23:01 microuser

I worry that tailoring the random function for certain graphs types might damage other uses. For example, graphs with cycles aren't going to benefit because by necessity they will have arrows in both directions. So I'd personally prefer this setting to be optional rather than the default setup.

Also won't most branch-heavy trees still find equilibrium with the root in the center and the leaves spread out in all directions, regardless of how they are initially arranged? (Perhaps you could do something interesting by applying a force that tries to orient all edges down and towards the right, though I'm not sure it would be easy to balance with the other forces...)

tdhsmith avatar Feb 11 '14 21:02 tdhsmith

Doesn't address the sorting speed, but I just committed an option in springyui.js to flip edge labels when they are upside-down.

EDIT: See my commit note - I guess this is reverting something recently changed. Whoops.

tdhsmith avatar Feb 11 '14 22:02 tdhsmith

Hey sorry, just to clarify—the aim of this is to arrange nodes roughly from left to right?

dhotson avatar Feb 26 '14 11:02 dhotson