2008-08-13T15:13:39Z
Dave Pawson.
link
Home
Graphviz is great
OK OK, so I am a little behind the times. I really don't know how long ago those guys came up with Graphviz but it leaves me totally gobsmacked.
One of its many uses is to trace out paths through ... you name it. In my case it was the menu system in a new handheld device.
After getting lost I turned to dot and started scribbling. Unfortunately I don't use it (the language) often enough to know the ins and outs and usually have to copy one of my older files. For this device the complexity becomes apparent when you realise that I had to start dropping all the 'back' functional links, simply to reduce the complexity. Graphviz makes a really great job though, and couple it with SVG and the zoom functions to make a tool that just 'does the job'. This is the resultant first cut SVG (zoom out to see it). It did leave me with a problem though
I looked at it and wanted to chunk it. Create a number of 'charts', each linked one with another. My thoughts immediately turned to XML. I searched for a parser and only found this from someone who looks as if it were an exercise in using JavaCC. The code loaded but failed to do much with my dot file as input. Not knowing JavaCC I was stumped. I've looked at Antlr before but quickly realised how ignorant I was of this side of CS. Anyone know of a pragmatic introduction to compilers without the bullshit? Joe posted this, although I wonder if it's some CS prof boasting? Any alternative suggestions please? Sourceforge has this code up, using Antlr, but again I'm wary.
That left me with a hole. I could do it once (emacs), but I'm too lazy to repeat it each time I add something. My solution was to reduce the parsing cost. I took the dot file to simpler levels and ran a Python transform in a day which does the job. All that did was leave me with an itch! Then I looked at the XML and saw that as a master, with dot as an output for the SVG, and html for a navigable 'smaller' view. The missing key is about 153 jpegs of the screen. Nice to have, but not essential. The XML lets me run some Schematron and find those widow 'nodes' and duplicates that I didn't spot. Dot is nice to write - but XML is easier to process.
Keywords: dot
Comments (View)Return to main index