cl-graphviz

CFFI interface for Graphviz

Introduction

cl-graphviz provides an easy to use CFFI based interface for Graphviz and seamlessly integrates into cl-graph.

The project consists of a Verrazano generated CFFI interface and some helper functions to walk the interesting Graphviz structures. With the help of asdf-system-connections cl-graphviz is integrated with cl-graph, and you can layout a cl-graph:

CL-GRAPH> (let ((g (make-container 'dot-graph :default-edge-type :undirected)))
            (loop for (a b) in '((a b) (b c) (b d) (d e) (e f) (d f)) do
                  (add-edge-between-vertexes g a b))
            (layout-graph-with-graphviz g)
            (format t "~A" (graph->dot g nil)))
graph G {
graph [bb="0,0, 580,388"];

0 [height=0.5, width=0.75, pos="143,370"];
1 [height=0.5, width=0.75, pos="143,282"];
2 [height=0.5, width=0.75, pos="27,194"];
3 [height=0.5, width=0.75, pos="259,194"];
4 [height=0.5, width=0.75, pos="148,106"];
5 [height=0.5, width=0.75, pos="260,18"];
0--1 [label="#<DOT-EDGE <#<A> #<B> NIL>>",pos="143,352 143,337 143,315 143,300"];
1--2 [label="#<DOT-EDGE <#<B> #<C> NIL>>",pos="117,277 87,271 39,260 28,246 21,236 21,223 23,212"];
1--3 [label="#<DOT-EDGE <#<B> #<D> NIL>>",pos="170,278 190,273 219,264 237,246 246,237 252,223 255,212"];
3--4 [label="#<DOT-EDGE <#<D> #<E> NIL>>",pos="233,189 204,183 159,171 148,158 141,148 142,135 143,124"];
3--5 [label="#<DOT-EDGE <#<D> #<F> NIL>>",pos="285,188 311,181 348,170 357,158 383,120 383,91 357,54 348,42 311,31 286,24"];
4--5 [label="#<DOT-EDGE <#<E> #<F> NIL>>",pos="144,88 143,77 143,63 150,54 161,40 205,29 234,23"];
}
NIL
CL-GRAPH> 

Tips for Graphviz

Mailing Lists

Download

No releases are planned, use the force! (this time the darcs side seems to work better :)

darcs

You can browse the darcs repository or get the tree with:

darcs get --partial http://common-lisp.net/project/cl-graphviz/darcs/cl-graphviz
Valid XHTML 1.0 Strict