tags:

views:

26

answers:

1

While doing software development I periodically come across the need to draw some graphs for my own use. Sometimes they illustrate relationships in a DB, sometimes they illustrate relationships of code files or classes, other times there are other objects... Anyway, the basic need is the same - I've got some set of nodes & edges that I would like to lay out neatly, add some informative colors/texts/styles and optionally print it out in the end (over several pages if necessary).

Is there a tool that would allow me to do this easily? Features that I would expect:

  • Import basic node/edge information from a file (the raw data that I have extracted from the DB/code/whatever);
  • Automatically layout some or all nodes in the graph;
  • Allow to manually adjust node and edge placements;
    • Node group manipulation features (relayout, rotate, scale) would also be very nice;
  • Ability to manipulate visual aspects of the picture - change lines, colors and fonts; add arbitrary texts and pictures (possibly attaching them to nodes/edges);
  • Ability to modify node contents (sometimes I need just a simple text; sometimes it's a little table; sometimes it's a bulleted list; etc.)
  • Save/load/print (including to several pages with overlapping areas for gluing together)/export to image (both vector and raster with anti-aliasing).

Added: Here is a sample graph I tried to visualise most recently. I'd like to get a useable layout that needs minimal tweaking before it can be printed.

+1  A: 

Graphviz is a long-standing popular one. I really like yEd's layout engine, which I feed GML data to (but it supports other formats).

Mau
Nice answer and question, it's really useful... I really like the layout of the second one,too beautiful!
Fire-Dragon-DoL
I just tried them both on a little graph of PHP file dependencies (which file includes which file). There were something like 130 files (of which half was independant) and around the same number of dependencies. Graphviz practically lined them all up, creating an extremely wide/tall graph. yEd was a little bit better, but still didn't even come close to anything useable. I'd expect something better.
Vilx-
I think yEd has different layout types, maybe try a few?
Mau
I did. OK, I'll try to anonymize the file and post it here.
Vilx-
OK, see the edit. Can you get yEd to lay it out properly? I can't even get the labels to appear on the nodes.
Vilx-
I'm not an expert of graphml, but I think that file defines no labels (ids are not labels). If you select organic layout and set min node distance >= 20, the result is decent.
Mau
Actually, for analysing dependencies I think the hierarchical layout might be more useful.There doesn't seem to be an attribute/element in standard graphml that yEd recognises. However if you add a label, and save the file, you can see how it embeds it, and do the same for other nodes (a bit cumbersome).
Mau
Graphviz has a range of different layout algorithms http://www.graphviz.org/Gallery.php including sfdp for really huge graphs.
Andy Dent