Thursday, July 29, 2010

Dia - free diagram drawing utility (like Visio)

Dia is a diagramming tool, a bit like Microsoft Visio, but free. You create a diagram out of shapes and lines and if you move shapes around it automatically keeps all the lines pointing to the right shapes.

In the following diagram I've just used the basic box shape, basic line connector and some text objects (I'm using version 0.97.1). Dia comes with a bunch of other pre-created shapes for drawing UML diagrams, network diagrams, etc.


The text objects are also connected to the shapes and also move around automatically. It took me a while to figure this out as dragging a text object onto a shape's connection point didn't appear to 'latch-on' as I expected it to, but this is just a wrinkle of the UI - let go and the point should change from green to red to show it's bound to a shape. The text objects will also bind to connection points on lines and you can bind both a text object and a line-end to the same connection point if you want.

A little time-saver: if you click on a connection point when adding a line or text object, then the line or text object will be created and bound to that point.

I've bound the line-ends to the connection points in the centre of the boxes (not shown). The lines automatically move around the box edges so you don't have to alter the connection point bindings if you move shapes around.

I tried putting the boxes and lines on different layers. While this worked, I got errors when I reloaded the diagram and all the objects were all disconnected. I've moved them all back to a single layer for now. Hopefully this will be addressed in a future release.

Dia can also auto-scale the diagram to fit a page. Use File > Page Setup and use Fit To 1 by 1, for example. Check the paper size and orientation too. Note that if you want to export the diagram to an image format later you might need to swap back to specifying a scaling otherwise the image can come out a little 'blocky'.

No comments: