Flowcharting, Directed Graphs with Graphviz

_images/beeptest.png

Why Flowchart ?

Not long ago, when designing brand new programs I often found it hard to get started ... before a online friend (Boru) recommended Graphviz.

Now, as long as I start graphing something, (usually the main aims of the program), I find that the smaller parts always seem to just fill themselves in and the design is off and running.

Why Graphviz ?

Graphviz http://www.graphviz.org is open source graph visualization software.

Graph visualization is a way of representing structural information as diagrams of abstract graphs and networks. It has important applications in networking, bioinformatics, software engineering, database and web design, machine learning, and in visual interfaces for other technical domains.

The Graphviz layout programs take descriptions of graphs in a simple text language, and make diagrams in useful formats, such as images and SVG for web pages; PDF or Postscript for inclusion in other documents; or display in an interactive graph browser. Graphviz has many useful features for concrete diagrams, such as options for colors, fonts, tabular node layouts, line styles, hyperlinks, and custom shapes.

These are the advantages that are important to me

  • Open Source, Graphviz is unlikely to disappear or become unusable
  • Text based, so the source is easily versioned in my SCM along with the application source code, keeping them together
  • Great documentation
  • Beautiful automatic graph layouts
  • Very configurable with many features

My method so far when designing a program is to list the main operations and then produce the graph. This is the least complex method I have found which produces the least cluttered graph. I can then play around until I’m sure I have what I want, with Graphviz providing the graph to assist my understanding of what I’m trying to create.

As they say, a picture is worth a thousand words.

Dotme flowchart generator

Because I use so many flowcharts, I have made a flowchart template generator using a shell script called ‘dotme’.

How does it work ?
  • download and uncompress dotme.tar.gz somewhere
  • configure the three user variable lines in “dotme” to suit your unix system, make it executable and place it in your path
  • type ‘dotme’ in any directory you wish to create a flowchart and you will be asked for a flowchart name, enter it. We will call it ‘flowchart’ for this example.
  • dotme will then create ‘flowchart.dot’ and a Makefile in the directory so make sure you don’t already have a Makefile in it !
  • type ‘make’ and Graphviz will compile the ‘flowchart.dot’ creating a ‘flowchart.png’ which will then be displayed.
  • alter the code in ‘flowchart.dot’ to suit your program, run make to display it ... repeat until you’re finished.
Requirements:
  • Graphviz
  • sh
  • make
  • xli, qiv or any picture viewer

Download the dotme tarball

Table Of Contents

Previous topic

Known Issues

Next topic

GNU Free Documentation License

This Page