Software Secret Weapons™  
Graphviz posted by Pavel Simakov on 2005-08-11 11:41:34 under Linguine Maps
view comments
 


Index  •  Intro  •  WSDL  •  Apache Ant  •  DTD's for XML  •  ObJectRelationalBridge  •  Hibernate  •  Gallery  •  FAQ  •  Help  •  JavaDoc  •  Download
Hibernate Configuration  •  Object Relational Impedance Mismatch  

Graphviz is a graph visualization software. It's a magical tool for any kind of diagramming. Diagramming is essential for many areas of software engineering as we can see in UML movement. But who is going to draw all those diagrams? Software engineers are busy writing code. Documentation specialists don't know much about code, classes, and UML. Managers know even less...

Graphviz will draw diagrams for you! The beauty of Graphviz that it will draw a pretty picture from formal definition of the drawing. And formal definition of the drawing is just a text file. No manual work! But who will create the drawing definition file? Software engineers? Documentation people? Managers? Its best to create drawing programmatically with Linguine Maps!

Graphviz Domain Specific Language
You can write code that drawing definition file! You can integrate this code into build process or create drawing as runtime! Here is how!

The Graphviz uses domain specific language? called DOT to capture an abstract definition of a graph. Here is an example of a simple graph with two related nodes as defined in DOT language.


digraph Entities {
  ranksep="equally";
  edge [fontname="Helvetica", fontsize=10,
         labelfontname="Helvetica", labelfontsize=10
       ];
  node [fontname="Helvetica",fontsize=10,shape=record];
  A [label="{A}", style=filled, fillcolor="yellow", 
      fontcolor="black", fontsize=14
    ];
  B [label="{B}", style=filled, fillcolor="red", 
      fontcolor="black", fontsize=14
     ];
  A -> B [arrowsize=1.0, label="A usea B", labelangle=-25, 
            labeldistance=0.3, labelfontsize=10, arrowtail=diamond
         ];  
}

And here is the resulting GIF file with the drawing after Graphviz processes DOT code above:

The drawing and layout is fully automatic! No manual work! Try it online! Convert your Apache Ant build files, XML DTD's, or object-relational mapping files into easy to understand diagrams.

Graphviz Todo

Graphviz has some minor weakness. Or it might be that I don’t know how to use it properly... What bothers me the most is a positioning of labels around the arrows.

  • arrow label text is always horizontal, even if arrow is vertical
  • I can't make labelangle work

Lets hope there is a fix for it.

No comments yet


Leave a comment


  Copyright © 2004-2007 by Pavel Simakov SourceForge.net Logo