ViewGraph is a small ocaml library that helps to view a graph from a dot file in a Lablgtk canvas, and interact with it.

It reads dot files and uses the dot tool for the layout of the nodes. You can have a look to Graphviz to know more about the dot tool and file format.

It also uses the ocaml graph library ocamlgraph.


More information

ViewGraph is a library, but it comes with a test file that compiles with the library to show the main features. So you can also compile it, and try to use it like this :

make; ./viewgraph

If you don't have any dot file, you can for instance use some examples from graphviz gallery but please remove the size attibutes (they are not handdled yet : see below).

Notice also that if you are already using ocamlgraph to build some graphs, it is quite easy to generate dot files by using Graph.Graphviz.Dot.

To have more information about the code :

make doc

and browse the documentation starting from doc/index.html.

Some more things TODO



A first version of this library has been integrated in the version 1.0 of ocamlgraph. Then, it has been rewritten in a new module dGraph available from version 1.2. The images are much nicier since they use native GTK objects instead of PNG images. But because dGraph doesn't provide the features that I need, I still keep ViewGraph and I'll try to enhance it when I'll have some time...