# HG changeset patch # User Steve Losh # Date 1478476880 0 # Node ID f5713558cc484a8e12be2c1497278080755a088a # Parent 23445296a0189e197f348bc1f5c0e5cb199cb530 Update documentation diff -r 23445296a018 -r f5713558cc48 .ffignore --- a/.ffignore Sun Nov 06 23:50:02 2016 +0000 +++ b/.ffignore Mon Nov 07 00:01:20 2016 +0000 @@ -0,0 +1,1 @@ +docs/build diff -r 23445296a018 -r f5713558cc48 docs/02-usage.markdown --- a/docs/02-usage.markdown Sun Nov 06 23:50:02 2016 +0000 +++ b/docs/02-usage.markdown Mon Nov 07 00:01:20 2016 +0000 @@ -345,4 +345,28 @@ (C B A D) (B C A D) +An error will be signaled if the digraph contains a cycle. + [topologically sorted]: https://en.wikipedia.org/wiki/Topological_sorting + +Drawing +------- + +If you have [Graphviz][] installed, you can draw digraph objects to images with +the [cl-dot][] library by loading the optional `cl-digraph.dot` system: + + :::lisp + (ql:quickload 'cl-digraph.dot) + + (defparameter *d* + (digraph:make-digraph :initial-vertices '(a b c d foo bar))) + + (loop :for (from to) :in '((a b) (a c) (b d) (foo bar) (bar bar)) + :do (digraph:insert-edge *d* from to)) + + (digraph.dot:draw *d* :filename "digraph.png" :format :png) + +![Digraph PNG](http://i.imgur.com/TtyGQfM.png) + +[Graphviz]: http://www.graphviz.org/ +[cl-dot]: https://github.com/michaelw/cl-dot