Using Dia for diagrams

Using Dia for diagrams


Everybody needs diagrams. Most users need to create one more often than they think: that flowchart for a presentation, that sketch of the bird feeder to build this weekend, or a time line. Getting more technical, there are always circuits and blueprints and the like. Stop wasting time with an office app, the GIMP, or a paint program: use Dia, an easy yet powerful made-for-diagrams editor.

Getting Dia

If you're running GNU/Linux, then just snag Dia from your distribution's repositories. If you're using Windows, then it's more complicated: your best bet is following these instructions to install Dia on Windows. Open Dia up, and--well, nothing fantastic happens. Just like most programs, you'll see a canvas, a toolbox, and a toolbar to open, save, copy, get help, etc. The canvas has pretty little squares, to check the scale and orientation of things you draw. The toolbox might seem a bit different. Even still, it really doesn't seem to be quite enough.

Let's explore what you can do with it.

Dia when you first open itDia when you first open it

Getting started

I already mentioned the canvas. If you've ever used Paint, Powerpoint, OpenOffice Impress, the GIMP, or any similar program (and I'm sure you have), you'll know exactly what to do: you draw stuff on it. To decide what you want to draw you use the toolbox, which is the window with all the icons in it. Make a line: click the "line" icon in the toolbox (it looks like a backslash with a dot at each end), click on the canvas, and drag somewhere else on the canvas.

If you don't like the way it looks, grab one of the ends of it (with the yellow square), and click and drag to resize it. I told you this was easy!

The different parts of DiaThe different parts of Dia

This line is straight, with nothing special at the end, and it's pretty much boring. (If you have an arrow at the end of your line, don't worry, this will make sense anyway.) So, suppose you want it to be more interesting: at the bottom of the toolbox there are three wider icons, with three straight lines in them. They stand for the beginning, middle, and end of the line. Click on one, and change it to an arrow (if it was already an arrow, change it to something else). Make a new line, and then change the middle and right icons. Make another line. See the pattern? It's not about left and right, it's about start and finish.

To make a rectangle, you could draw four lines; however, that's tedious at best, and inaccurate at worst. Conveniently, Dia has a rectangle tool. It looks like a rectangle, right above the line tool. Try drawing a rectangle on the canvas.

Now be brave, and draw an ellipse.

Dia after some fun with the toolboxDia after some fun with the toolbox

Note that the rectangle and ellipse have the same line style as the one you picked for the line. If you don't like it, change it the same way you changed the lines.

Play around with all the other tools in your toolbox. Hovering over the icon will say what it does, if you're confused.

Getting advanced

If you try to make polygons with the polygon button, you might get a bit thrown -- you might be wondering how to make anything other than triangles!

If you want to make interesting polygons, right click your polygon, and select "Add Corner." Now you have an extra point to play with, and your polygon just turned into a quadrilateral. Do it again, and you will get a pentagon. Do it 138 times, and--whoever's close by will laugh at you!

Adding a corner to a polygonAdding a corner to a polygon

The right-click menu has a few more tricks up its sleeve. Right click a shape/line again and hit "Properties". Now you can play with the width and color and more (the color is in hex format, which is outside the scope of this article. Read about it in this tutorial about hex notation).

The The "Properties" menu

For ellipses and rectangles, the menu has even more options: "Fixed aspect" and "Circle" (or "Square"). Remember that "fixed aspect" just means the proportions are the same when you change the size, and doesn't guarantee the squareness of it.

The menu of object sheetsThe menu of object sheets

The last "advanced: creating objects. In Dia's lingo, "object" means "a predefined bunch of lines that means something specific". So in your toolbox, look at the spot that says "Misc". Now look below it: you'll see a clock, a folder, etc. Make a clock just like you would with anything else: click and drag. Try a folder too.

You might be wondering why Dia offers an "folder" object to draw... which brings up the entire point of objects. They're meant to be extensions of Dia for different (more specialized) tasks. "Misc" could be useful for making a diagram of a filesystem. Click "Misc", then "Other sheets", and you'll see a menu of a lot of possible objects. Try "Flowchart." Suddenly, you have a lot of handy flowchart objects.

Five-minute flowchartFive-minute flowchart

Conclusion

Now you know enough about Dia to get a lot of tasks done. It's pretty intuitive to start, and just playing with it for a few minutes makes it even more so. However, there's still a lot you could learn which I haven't even touched on.

One thing is that Dia supports Python scripts. That is definitely outside the scope of this article, but there's a nifty guide on how to use Python with Dia. Speaking about guides, have a look at Dia's official tutorial.

To get better, the best step is to stop reading this article and play with Dia. Enjoy!

Category: 
Tagging: 
License: 

Comments

jtappin's picture
Submitted by jtappin on

While I've only had a quick look at dia, it doesn't really look to offer as much capability as the granddaddy of all drawing tools -- xfig.

mjjzf's picture
Submitted by mjjzf on

I agree. It is ugly as sin, but it works - and Dia is not noticeably easier to use (which would be the selling argument) than Xfig.
__
FSF member no. 6426

Golodh's picture
Submitted by Golodh on

Well, XFig is a drawing package first, and yes, you can also use it to draw diagrams. Dia on the other hand is a specialised package for drawing diagrams.

Dia has two advantages over Xfig when it comes to diagrams

1) Dia is multi-platform, and not just Linux-based. Well, an enterprising soul may be able to get XFig to work under Windows but it's not worth it, IMO, since Dia does what you need for diagrams. And for general-purpose work I'd generally prefer the Gimp.

2) Dia, being an object-oriented vector drawing package, redraws the connectors when you move the diagram boxes about. Xfig, being just a drawing package, doesn't. This is fairly basic and indispensible functionality when drawing large diagrams (unless you already know what the diagram looks like and only need a tool to draw it).

Dia also has disadvantages. The worst one being that it (in version 0.96.1) crashed a few times when I used it to draw (fairly large) diagrams. Poof ... diagram gone. That behaviour one might tolerate in beta software, but not in a release version. It gives OSS software a poor name.

As the Dia website says, Dia is basically a knock-off from Visio. That's not something to be ashamed of though. Dia is great for those who don't need the quality and functionality of Visio (or who don't wish to pay its hefty price), and who are willing to save every five minutes or so.

jtienhaara's picture
Submitted by jtienhaara on

Nice intro to Dia, Timmy!

I used to be an xfig devotee, and refused to switch to anything for UML diagrams until Dia came along.

I have since tried everything under the sun and no free/open source drawing program comes anywhere close to Dia IMHO for power & ease of use; and many commercial applications fall behind too.

There are 4 things I love about Dia:

1) It's simple and intuitive to do most tasks.
2) Layers.
3) Snapping (to objects, to grids, etc).
4) Tons of file formats to export to.

I would argue that xfig is a lot less powerful, and Graphviz is a lot more involved. And Visio is a whole lot less free! So Dia fills an important niche.

But to each his own! These days I use Dia even for laying out rooms & choosing paint colours, something it was definitely not designed for, but it's pretty darned good at. :)

Cheers,

Johann

Codifex's picture
Submitted by Codifex on

I just had the pleasure of installing and running Dia for the first time. (It looks to be a derivative of Gimp.)

At first, I thought it was a little anemic as far as usefulness goes... that is until I began exploring the floating toolbar.

There are lots of useful "sheets" that contain object shapes from electronic, flowchart, network, and electrical to types I've never heard of before.

It's just what the doctor ordered for my personal project diagramming tasks.

Thanks to the Dia team!
Codifex

I'd rather be flamed with the truth than be left blissfully ignorant.

Author information

Timmy Macdonald's picture

Biography

Timmy Macdonald is a Christian, Ubuntu user and Pythoneer. When he's not studying, coding, or playing a musical instrument, he writes on his blog: http://blog.tsmacdonald.com. Any time left over is spent plotting the demise of the third person.

Most forwarded

Interview with Dave Mohyla, of DTIDATA

Dave Mohyla is the president and founder of dtidata.com, a hard drive recovery facility based in Tampa, Florida.

TM: Where are you based? What does your company do?
DTI Data recovery is based in South Pasadena, Florida which is a suburb of Tampa. We have been here for over 10 years. We operate a bio-metrically secured class 100 clean room where we perform hard drive recovery on all types of hard disks, from laptop hard drives to multi drive RAID systems.

Anybody up to writing good directory software?

Since the very beginning, directories (of any kind) have had a very central role in the internet. (I have recently grown fond of Free Web Directory. Even Slashdot can be considered a directory: a collection of great news and invaluable user-generated comments. As far as software is concerned, doing a quick search on Google about software directories will return the free (as in freedom) software directories like Savannah, SourceForge, Freshmeat and so on, followed by shareware and freeware sites such as FileBuzz, PCWin Download Center and All Freeware (great if you're looking for shareware and freeware, but definitely less comprehensive than their free-as-in-freedom counterparts).

Interview with Mark Shuttleworth

Mark Shuttleworth is the founder of Thawte, the first Certification Authority to sell public SSL certificates. After selling Thawte to Verisign, Mark moved on to training as an astronaut in Russia and visiting space. Once he got back he founded Ubuntu, the leading GNU/Linux distribution. He agreed on releasing a quick interview to Free Software Magazine.

Is better education the key to finding better software?

I read David Jonathon's article Anybody Up To Writing Good Directory Software? the other day, which got me thinking about software directories in general. As David mentioned, many of the software directories one finds when doing a quick google search are free as in beer, not as in freedom. But what interests me is the software directories that already exist, providing a combination of both free as in beer software, and open source software. Sites such as Freeware Downloads and Shareware Download don't advertise themselves as providing free as in liberty software, but each of them have a good selection of open source software available... if you know where to look.

Most emailed

Free Open Document label templates

If you’ve ever spent hours at work doing mailings, cursed your printer for printing outside the lines on your labels, or moaned “There has got to be a better way to do this,” here’s the solution you’ve been looking for. Working smarter, not harder! Worldlabel.com, a manufacture of labels offers Open Office / Libre Office labels templates for downloading in ODF format which will save you time, effort, and (if you want) make really cool-looking labels

Creating a user-centric site in Drupal

A little while ago, while talking in the #drupal mailing list, I showed my latest creation to one of the core developers there. His reaction was "Wow, I am always surprised what people use Drupal for". His surprise is somehow justified: I did create a site for a bunch of entertainers in Perth, a company set to use Drupal to take over the world with Entertainers.Biz.

Update: since writing this article, I have updated the system so that the whole booking process happens online. I will update the article accordingly!

So, why, why do people and companies develop free software?

More and more people are discovering free software. Many people only do so after weeks, or even months, of using it. I wonder, for example, how many Firefox users actually know how free Firefox really is—many of them realise that you can get it for free, but find it hard to believe that anybody can modify it and even redistribute it legally.

When the discovery is made, the first instinct is to ask: why do they do it? Programming is hard work. Even though most (if not all) programmers are driven by their higher-than-normal IQs and their amazing passion for solving problems, it’s still hard to understand why so many of them would donate so much of their time to creating something that they can’t really show off to anybody but their colleagues or geek friends.

Sure, anybody can buy laptops, and just program. No need to get a full-on lab or spend thousands of dollars in equipment. But... is that the full story?

Fun articles

Santa Claus - the most successful open source project

It dawned on me the other day, as I was shopping for the dozens of gifts it seems I have to buy every December, that Santa Claus is the most successful open source project in history. (Bridget @ Illiterarty would agree with that). Santa Claus is essentially a marketing development that is embodied by everyone who stuffs a sock, gives a gift, hosts a dinner or wishes Merry Christmas over the holiday season.

Most emailed

Editorial

When I first started thinking about Free Software Magazine, I was feeling enthusiastic about the dream. I had Dave, Gianluca, and Alan willing to help me, I had established members of the free software community willing to help me out, I had writers volunteering their time and energy for free, and I had a generous offer from OpenHosting for servers, all before I'd proved myself. There was a sense of excitement in the air, and I thought maybe, just maybe, I could make this work.

Free Software Magazine uses Apollo project management software and CRM for its everyday activities!