f5713558cc48

Update documentation
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Mon, 07 Nov 2016 00:01:20 +0000
parents 23445296a018
children f5d201dead81
branches/tags (none)
files .ffignore docs/02-usage.markdown

Changes

--- 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
--- 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