com.phronemophobic.clj-graphviz
layout
(layout graph)
(layout graph layout-algorithm)
Layout graph
and return basic layout info.
render-graph
(render-graph {:keys [nodes edges default-attributes flags], :as graph})
(render-graph {:keys [nodes edges default-attributes flags], :as graph} {:keys [filename format layout-algorithm], :as options})
Layout a graph and save an image to filename
.
A graph is map of the keys: :nodes
, :edges
, and :flags
.
:nodes
: A sequence of nodes. Redundant if all nodes have edges.
:edges
: A sequences of tuples (from, to) of nodes.
:subgraphs
: A sequence of subgraphs which have the same specifications as graphs (except without :flags
).
:flags
: flags should be a subset of #{:directed :strict}
:default-attributes
: A map node-types to their default attributes
Options is map of the keys: :filename
, :format
, :layout-algorithm
.
:filename
: The name of the file to save the image to. (default graph.png)
:format
: One of :png
:jpeg
:jpg
:gif
:svg
:pdf
:bmp
:eps
:ico
:ps
:ps2
:tif
:tiff
:wbmp
:layout-algorithm
: one of the following:
:dot
(default) A Sugiyama-style hierarchical layout STT81, GKNV93.
:neato
A “symmetric” layout algorithm based on stress reduction. This is a variation of multidimensional
scaling KS80, Coh87. The default implementation uses stress majorization GKN04. An alternate
implementation uses the Kamada-Kawai algorithm KK89
:fdp
An implementation of the Fruchterman-Reingold force-directed algorithm FR91 for “symmetric”
layouts. This layout is similar to neato, but there are performance and feature differences.
:sfdp
A multiscale force-directed layout using a spring-electrical model Hu05.
:twopi
A radial layout as described by Wills Wil97.
:circo
A circular layout combining aspects of the work of Six and Tollis ST99, ST00 and Kaufmann and
Wiese KW.
:patchwork
An implementation of squarified treemaps BHvW00.