Algorithm for genogram
I am developing a ruby program that should be able to draw a genog开发者_开发知识库ram on a web page.
I am therefore looking for an algorithm for drawing a genogram or a similar tree-structure. I prefer an algorithm in ruby but also other languages will do or some references explaning the principles behind such an algorithm
A recursive algorithm in c++ has been published here but it is not documented in a way that allows me to use it.
Any help about how to implement a genogram would be much apriciated
AFAIK, the canonical work on rendering trees is "Drawing Dynamic Trees" by Sven Moen. You should be able to find the paper or an implementation of his polyline algorithm with a bit of googling.
You could also have a look at Graphviz as that can handle trees as well as arbitrary graphs.
精彩评论