Updated 2017-05-04 06:11:32 by medranocalvo

Tcldot is the Tcl package for Graphviz: the Graph Visualization Software. It makes the dot graph renderer (for directed graphs) and the neato renderer (for undirected graphs) available to Tcl scripts.

See http://www.graphviz.org/pdf/tcldot.3tcl.pdf for the documentation.

Graphviz is available for Windows, Unix and MacOS X.

Example edit

Let's take a simple directory hierarchy:
 |   |---doc
 |   |---bin
 |   |---config
 |   |   |---ps
 |   |   |---pw
 |   |        |---pure
 |   |
 |   |---step1
 |       |---substep

The Tcl script starts like this:
 package require Tk
 package require tcldot

 # a canvas to put the redered output into:
 set c [canvas .canv]
 pack $c

The first step is to make a description of this hierarchy in the dot language (find a summary here: [1]). Note, that in this simple case, all directory names are unique. In reality, this would normally not be the case and the description would be more complicated.
 set graph [dotstring {
   digraph G {
   dir1 -> CVS;
   dir1 -> src -> doc;
   dir1 -> vfs-> bin;
   vfs -> config -> ps;
   config -> pw -> pure;
   vfs -> step1 -> substep;
   dir1 -> www -> cgi;

Hmm, does not work. Gives a syntax error for the description ...

The next step would be (is) to simply call the renderer:
 $graph render $canv DOT

[Place the picture of the graph here ...]

For another example, see XML Graph to canvas

schlenk If you need Tcldot for Windows, send me an email, i might find the dll and the VC6 project file.