946 words on Software
I few days ago I wrote about GraphViz and how it’s an amazing software that lets you create interesting graphs from simple text input files. I also lamented how its documentation is pretty much unreadable and actually controlling the output enough to get good-looking graphs is impossible, both in terms of the ‘control’ and the ‘good looks’ you get.
While trying to figure out a thing or two about GraphViz, some search results told me that OmniGraffle can import the GraphViz file format. OmniGraffle is one of those applications which has earned a rather high reputation in the Mac software world for being a tool that makes it easy to create good looking diagrams. So far I only had a single excuse to actually try and use OmniGraffle and this seemed like a good opportunity for digging in a bit more deeply.
Two things made OmniGraffle stand out in my opinion: First, the fact that it makes it easy to create reasonable diagrams by defaulting to all sorts of smart ‘magnetic’ behaviour when joining up graphs and thus letting you focus on the the graph you want to draw rather than forcing you to put all your attention towards getting the lines in it ‘just right’. Second, the fact that OmniGraffle is also tuned for a reasonable amount of ‘pretty’. Not the bling-bling style ‘pretty’ one would find in magazines, but the pretty of having shadows where you need them.
I was quite surprised to learn that OmniGraffle reads GraphViz files and contains GraphViz’ automatic layout algorithms as I consider both these approaches to graphing as somewhat orthogonal. It’s all the better that one application tries to handle both. Trying to use the ‘best of both worlds’ I could turn a mess of a graph into something reasonably looking.
What’s particularly nice about OmniGraffle is that it doesn’t just import the GraphViz files but it also lets you edit them in the application, re-applying the GraphViz algorithms as you go. Particularly when using the ‘force-based’ layout mode it gives you a few extra abilities to adjust line lengths. These can be used to tweak the graph a little.
While this is already a great improvement on ‘pure’ GraphViz, particularly once you take into account in the better looks OmniGraffle gives your graphs as well, it still leaves plenty of room for improvement. One issue is that you may have machine-generated GraphViz files. You can easily add a few nodes to those. But OmniGraffle cannot ‘update’ its current graph based on an updated GraphViz file. While this seems quite natural in the GraphViz view of things, it means that you must be really really really sure your graph is final before starting to make it pretty. Of course that’s not how things work and you may end up having to do things several times. Given how dynamic the layout of thes graphs is, it’s very likely that you will not be able to reproduce your previous work when doing this.
The next problem (again coming from GraphViz, I suppose) is that it’s really hard to ‘pin down’ objects. Sometimes you really need some node to be right in the middle or you may want to move one node up a centimetre to make its edges not cross other nodes in a bad way. It’d be really handy to just fix a node at its desired location for that.
The same goes for the order of some nodes grouped around another one. It seems like the GraphViz algorithm just finds a local optimum for the layout. Meaning that other, much better layouts may exist which are just ‘out of reach’. I have often seen examples for this where a number of nodes are grouped around bigger nodes and a change of the order of those nodes would have given a much better layout with less edge-crossings. Unfortunately this kind of rearranging is mostly impossible (I have a theory that one may be able to adjust it by rearranging the lines in the GraphViz file, but that’s not really feasible if said file is automatically generated).
A further limitation of OmniGraffle is that the ranges for its adjustment sliders seem to be wrong as soon as you’re working with graphs that aren’t tiny. The usable part of the ‘repulsion’ slider seems to be in the first 5% of its range, i.e. pretty much impossible to control. That’s particularly problematic as OmniGraffle can end up stalling for a long time when the setting is picked too large (as I assume the layout process is started with rather unreasonable parameters then).
Finally, OmniGraffle does not support the full range of GraphViz options (say node shapes or images in the nodes as used in my UTI graph), meaning that it’s difficult to communicate layout intent through your GraphViz file from the script creating it. A workaround for that is setting different colours and sizes for the element and using OmniGraffle’s cool selection features to select all objects with the same style.
My conclusion is that the automatic layout / GraphViz support makes OmniGraffle a very interesting tool for creating graphs. I am particularly surprised that they managed (dared to attempt) including some GraphViz algorithms into their application. But now that I’ve seen this I want more. As usual, none of what I want will be particularly easy to implement but it improve graph making.
Let me close with an illustration of what can be achieved. Taking a moderately elaborate GraphViz file which already makes an attempt to style things a little one could get a result like this:
Tinkering a with OmniGraffle on this can clarify the result quite a bit:
tikz (the latex package) is what it is all about
I don’t see how this can do the same graph layout that GraphViz or OmniGraffle does, but it still looks like an interesting tool.
Hm, just wondering if the actual Instaviz and Omnigraffle Pro build not really fit. My network drawing via Instaviz just have outlines and connecting lines - the result in Omnigraffle just shows me numbers. These are matching to the amount of drawn objects. Is there a hidden trick to reuse the GraphViz format in OmniGraffle?
Once I have a graph in Omnigraffle, how do I save/export to .dot langueage?
I don’t think you can export to GraphViz format from OmniGraffle, because GraphViz supports only a small subset of OmniGraffle’s features.
It’s more that OmniGraffle can import those GraphViz files.
Received data seems to be invalid. The wanted file does probably not exist or the guys at last.fm changed something.