Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Agreed 100%. I don't care if graphviz looks a bit dated -- it's straightforward and easy to generate. (I wouldn't say "no" to having more layout algorithms, though!)

My favourite personal use of Graphviz: A few years ago I inherited a large, legacy codebase that was very hard to understand -- full of global state modified from dozens of functions, obscure function names, etc. I used a C parser (forget which one) to convert the code to a set of ASTs, and then hacked up a Web-based, interactive graph generator, using Graphviz to create the interactive SVGs. The "app" let you click on a function (node) and zoom in to examine its callers, callees, global accesses, global mutations, etc., with a "radius" parameter to decide how much of the large graph you wanted to see. Every node was clickable, and would ask the Web app to generate a new graph centered on that node.

It was an awful, throwaway hack, and was only about 90% accurate due to parsing/preprocessor challenges. (At times I resorted to annotating the code with magic comments to facilitate graph generation -- not a sustainable approach.) But a day spent hacking with Graphviz dramatically improved my learning rate, and it was also useful in helping describe the code to others.



I imagine you used cflow and dot

I have done the same and it totally saved my ass on legacy code that I was tasked with extending or fixing.

I just pumped the output of dot to a static web page. It was awesome.

Also, I rendered the entire graph as a single page, and started printing it tiled to multiple 8.5x11 sheets. One of the women I worked with that did all our document versioning and tracking saw me taping the sheets together, and asked me for a copy of the document. An hour later she walked into my office with a single page print from a 42" plotter. That hung like artwork on my office wall for about eight years.

She was a wonderful soul for that. And the print was beautiful.


I never thought of getting a big plot or print of our graph. That is a great idea. :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: