Hacker News new | ask | show | jobs
by paphillips 1611 days ago
I've used GraphViz a number of times and highly recommend it as a standard tool on your belt. Having a stand-alone executable that can export to SVG is great.

The most complex thing I've done with it [1]: a tool (MIT-license) that builds diagrams of the data and addressing pipeline for a DSP processor, and lets one 'scrub through' the assembler code frame by frame and see the values propagate through the blocks.

Also PlantUML [2] uses it for most diagrams.

Getting layout and positioning the way you want can be tricky but is usually achievable with patience and hidden objects.

[1] https://github.com/paphillips/DFB [2] https://plantuml.com/graphviz-dot

2 comments

My graphviz-fu got so much better when I started using invisible objects for the grid-like layouts. At that point you're just using graphviz for positioning/spacing/styling instead of creating the overall topology.
This sounds interesting, can you expand on that a bit please?
You're handing graphviz a list of relationships. Sometimes you know the ideal way to visualize this is a tree, or something with right angles, but graphviz isn't laying it out that neatly. So you create extra nodes, and edges to those nodes, so that graphviz considers it a "balanced" tree or grid. Then you use styling to turn those nodes invisible (showing just the nodes/edges you want). Once I have this correct I usually contain it within a "cluster", and then link that cluster to the larger diagram.
if you want X nodes falling near in the graph you just put them into a box with white lines and they move as one from this point. Can be made with the cluster environment.
You can use invisible clusters also to group things