Convenience tools for Graphviz dot file creation.
-
[macro] WITH-NEW-DOT-FILE (FILE &KEY (NAME "D") (TYPE :DIGRAPH) (IF-EXISTS :SUPERSEDE)) &BODY BODY
Open
FILE
for writing, put Graphviz boilerplate there and runBODY
with*GV-STREAM*
bound as a write stream to the file.TYPE
controls what goes in the boilerplate - the boilerplate isgraph|digraph <NAME> { (...) }
IF-EXISTS
is as inOPEN
.
-
[function] LINK FROM TO &OPTIONAL (TYPE 'LINK)
Print a graphviz link.
FROM
andTO
are node names.TYPE
is used as "type" attribute to the link
-
[function] LABEL ID NAME ATTRS
Print a graphviz node
ID
withLABEL
and other attributes to*GV-STREAM*
.ATTRs should be a list of name-values (plist style).
-
[variable] *GV-STREAM* #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDOUT* {1002477363}>
String to user for graphviz print operations.
-
[function] LINK-TO-MANY FROM TO &OPTIONAL (TYPE 'LINK)
Print a graphviz link from one node (
FROM
) to several (TO
, a list).
-
[function] DRAW-SOME-DEPS FILE ROOT-NODE-NAMES SINK-NAMES TO-NAME-FN FROM-NAME-FN EXPAND-FN
Make a graphviz
FILE
containing dependencies generated fromROOT-NODE-NAMES
usingEXPAND-FN
.EXPAND-FN
takes an existing node and returns list of pairs to add.SINK-NAMES
are no longer expanded.TO-NAME-FN
andFROM-NAME-FN
are used to convert node objects to name or create node object from its name.See examples
DRAW-SYSTEM-DEPS
andDRAW-PACKAGE-DEPS
.
-
[function] DRAW-PACKAGE-DEPS FILE PACKAGE-LIST KNOWN
Draw dependencies of CL packages from
PACKAGE-LIST
into graphvizFILE
.The COMMON-LISP package is not shown as a dependency for simple view.
Example:
(gv:draw-package-deps "/tmp/hunchentoot.gv" '(drakma hunchentoot) ())
-
[function] DRAW-SYSTEM-DEPS FILE SYSTEMS-LIST SINKS
Draw dependencies of an ASDF systems in
SYSTEMS-LIST
to a graphvizFILE
.Example: draw dependencies of Hunchentoot asdf package, do not expand cffi and cl+ssl.
(gv:draw-system-deps "/tmp/hunchentoot.gv" '(hunchentoot) '(cl+ssl))