com.walmartlabs.system-viz

Visualize a component system using Graphviz.

visualize-system

(visualize-system system)(visualize-system system options)

Visualizes the system as a graph, using Graphviz. A temporary file is created to store the Graphviz program; this is then fed through the dot command line tool to generate a PDF file.

Visualization recognizes three special keys:

:graphviz/highlight
Adds node attributes to highlight the component in the graph. By default, skyblue color and 24 point font.
:graphviz/color
Sets the color of the component to the provided color value, and sets the style of the node to be filled.
:graphviz/attrs
A map of keys and values; these are added as node attributes.

The resulting PDF file may optionally be opened, or its location output to the console.

Generally, this should be invoked before the call to system-start.

Options:

:format
The output format as a keyword; defaults to :pdf, but :png or :svg are also good choices.
:open
if true (the default), then the generated image file will be opened. If false, then the path to the image file will be printed to *out*.
:horizontal
If true (the default is false), then the image will be laid out horizontally instead of vertically.
:highlight
A map of Graphviz attributes and values to be applied to components where :graphviz/highlight is true.
:decorator
A function that accepts a component key and component map, and returns nil, or a map of additional attributes.
:save-as
If provided, then this is the path to which the graphviz source file will be saved. If not provided, the graphviz source file is generated as a temporary file.

Returns the system unchanged.