strathausen / dracula

JavaScript layout and representation of connected graphs.
https://www.graphdracula.net
MIT License
834 stars 132 forks source link

Vertical Tree Problem #35

Closed machineghost closed 6 years ago

machineghost commented 8 years ago

I'm trying to create a basic vertical tree, ie.

 A
 |
 v
 B
 |
 v
 C

Eventually there will be an actual tree (ie. C will go to D, E, etc.) but so far I can't even get the above to work. Even when I use a TournamentTree or OrderedTree, the order I pass doesn't matter; I always get:

 A
 |
 v
 B     --->   C

Well, technically the order does affect what node goes in positions A/B/C, but the point is that I can only make an L-shaped graph, not a vertical one.

Is there any way to tell Dracula to use one vertical level per single-edge pair of nodes (although obviously when there's an actual branch I still want all children of that branch to be on the same vertical level)?

strathausen commented 6 years ago

This would be just by writing a new layouter... have a look at the existing ones to see how it's done!