views:

77

answers:

1

Hi I need to work on drawing a hierarchical tree structure (HV-Drawing – Binary Tree) with orthogonal lines(straight rectangular connecting lines) between root and children ( like the following: http://lab.kapit.fr/display/visualizationlayouts/Hierarchical+Tree+layout ). I want to know if there are any open source examples of the algorithm of drawing trees like that so that I can implement the same algorithm in actionscript. Thanks Palash

A: 

I did a C# version and put the code up on CodeProject. It's at:

http://www.codeproject.com/KB/WPF/LayeredTreeDraw.aspx

There's a generic part which gives the positions of all the nodes and a WPF specific implementation which actually draws everything using either straight lines or the orthogonal lines you're looking for.

Darrell Plank