I’m trying to generate a call tree for code I’m working on (I didn’t write it) to help me understand it. I want to be able to manually enter each function and the functions it calls (as children), thus building the tree. But I’d like it to automatically organize and position the chart so that nothing overlaps without my having to move everything around every time I add something. For example, here’s the structure of the kind of data I’d want to put in, in crappy Lispesque format:
( initAll //root node
( //root node's children - functions it calls
( initDisplay () ) //this child is a leaf
( initControlBar
( //initControlBar's children - functions it calls
( addButtons () )
( setUpControlBarEvents () )
)
)
( alertUserSystemReady () )
)
)
I guess it could be a graph tool (trees being a subset of graphs, of course), but I don’t imagine a graph tool would have the ability to automagically put things on the right level. What I like about organizing this data as a tree is that there are distinct levels, which helps me visualize what’s going on.
I’ve tried yEd and LucidChart, but both were too manual for me. Since the tree is going to go pretty deep, I need something that can automatically restructure with the tree data. I also tried Graphviz, but couldn’t get it working (I’m on Windows and didn’t know what to do after the install).
Google isn’t helping much on the tree editor end – it’s giving me pages like http://bioinfo.unice.fr/biodiv/Tree_editors.html which just have way too many to choose from. In this case I think using others’ experience would be better, so I came here.
So, anybody know of any tools that would get me closer to my goal? Thanks!
Use the
dotlanguage to represent the graph in a file, and then graphviz to visualize it. Thedotengine (one of those supplied with graphviz) will draw a hierarchical graph as you describe. Here is an example chart:(source: graphviz.org)
The syntax of the file you need to create is like this (taken from the file used for the above graph):
The same file can be passed to different engines for different types of graph, but the
dotengine is the one commonly used for code structure and dependencies.