The hard part is over - we can now look at our result in OmniGraffle. First, we need to rename the dotfile.txt file from Part 2 to something that OmniGraffle will recognize as a dot file - a name like mytag.dot (e.g., ai.dot) should do the trick. When we open this file in OmniGraffle, the default is to render it in hierarchical fashion:
By going to the Inspectors menu and selecting Automatic Layout, we get a series of options to change the layout of our graph:
Selecting the Force-directed option with the default settings, and clicking on Layout Graph yields the following result:
It is possible to make the layout "more square" by selecting the Canvas Size inspector, and choosing a square canvas size before applying the Force-directed option:
The settings in the Automatic Layout inspector allow for a wide range of results - the best way to find out what they are is to experiment. Also, all the graph objects behave like standard OmniGraffle objects - selecting any of them and changing their properties with the appropriate inspectors allows for endless display customizations.
Epilogue: What to do if OmniGraffle won't read your file
The most likely explanation is that one (or more) of the tags in your file use "illegal" characters in their names. These include (but are not limited to): asterisks, slashes, etc. The simplest way to fix this is to use TextWrangler to open the dotfile.txt file, and perform a find/replace on all offending characters. Thus, replacing all instances of * with _a_ will work fine most of the time. The only thing to look out for are replacements that would yield a tag name already in use. Thus, if a file already contained both *computation and _a_computation as tags, the suggested replacement would clearly not work properly, and a different replacement would be in order. After generating the graph, you can change the labels in OmniGraffle back to the original tag names.
Another explanation is that del.icio.us has changed the formatting of its web pages between when I wrote this, and when you are reading it. If so, simple changes to the Anthracite procedures (particularly in gettags) should take care of this problem - I frankly doubt del.icio.us will change its format so much that both procedures would need to be rewritten from scratch.
Finally, a recommendation for those of you who might want to try using Graphviz.
The defaults for Graphviz tend to produce graphs with unacceptable amounts
of overlap between labels. To solve this, I suggest adding the following line
immediately after digraph delicious {
:
graph [overlap = scale];
This will tell Graphviz to avoid label overlaps.
I hope you have found this tutorial useful. If you have any questions or comments, please email me at rubenrp@hippasus.com.