Squeak SmalltalkJoker Squeak Smalltalk : Projects : prevnext Graphviz

For those of you familiar with the AT&T Research Project called 
GraphViz, I will cut to the chase and announce that I have developed 
a lightweight "builder style" Squeak interface to this open-source 
package.

Download the GraphViz monticello package from 
http://squeak.saltypickle.com.  I will post the package on SM soon. 
The program is limited to working on Win32 right now.  Anyone wanting 
to provide Mac or nix modifications is welcomed to do so.

"To generate a sample directed graph" graph := GraphViz new.

graph beDirected. graph add: #A -> #B. graph add: #B -> #J. graph 
add: #A -> #D.

graph openAsMorph. "See attached png screen shot for the output"

*Background from the GraphViz web site*

Graph visualization is a way of representing structural information 
as diagrams of abstract graphs and networks. Automatic graph drawing 
has many important applications in software engineering, database and 
web design, networking, and in visual interfaces for many other 
domains.

The Graphviz layout programs take descriptions of graphs in a simple 
text language, and make diagrams in several useful formats such as 
images and SVG for web pages, Postscript for inclusion in PDF or 
other documents; or display in an interactive graph browser. 
(Graphviz also supports GXL, an XML dialect.)

Graphviz has many useful features for concrete diagrams, such as 
options for colors, fonts, tabular node layouts, line styles, 
hyperlinks, and custom shapes.

In practice, graphs are usually generated from an external data 
sources, but they can also be created and edited manually, either as 
raw text files or within a graphical editor. (Graphviz was not 
intended to be a Visio replacement, so it is probably frustrating to 
try to use it that way.)

Reference: http://www.graphviz.org

*Additional Information*

So basically, the Squeak interface provided here makes it fairly 
straightforward to generate the "dot" language file that the GraphViz 
command line programs use as input to create the graphs.  For 
references on the "dot" language you can go to the graphviz web site 
mentioned above.

Several examples are provided in the Squeak package if you look at 
the class side of GraphViz or inspect my test cases.  Graphing 
Smalltalk class hierarchies and/or class references has been a source 
of delight as well as using this program to graph many relationships 
pertinent to my business data.

Lastly, GraphViz will generate SVG output formats as well.  I found a 
very cool Java-based Zoomable User Interface built specially to 
navigate large graphs generated by GraphViz called ZGRViewer 
(http://zvtm.sourceforge.net/zgrviewer.html).  If you do the 
following:

graph := GraphViz new.

graph beDirected. graph add: #A -> #B. graph add: #B -> #J. graph 
add: #A -> #D. graph writeToFile.

generator := graph class defaultGeneratorClass new. generator 
runDotOn: graph outputFormat: #svg.

Then you can open the Java ZGRViewer program and surf around the 
graph file this is generated by Squeak.  Very cool for looking at 
large models!

If you have any questions or want to add other enhancements let me 
know.  I've just started using this myself so I will say it certainly 
is for daredevils, but sure is loads of fun.

Regards,

John