Dot Writer
DotWriter produces source text for dot, the widely supported graph description language. Such source text can be passed to numerous renderers, most notably Graphviz, to produce graph visualizations.
DotWriter is not able to generate every sentence recognized by dot, but it is able to access every semantic feature afforded by dot. All APIs automatically escape identifiers as necessary, always choosing to provide a minimal text when several semantically equivalent texts are available. Support is deliberately omitted for the _compass point, since omitting the compass point of a node in an edge specification is equivalent to specifying _ as the compass point.
DotWriter exposes the ability to generate dot source files through a hierarchy of contextual emitters rooted at AttributeWriter. These emitters are provided to a lambda through dependency injection, and care should be taken in the implementation of a lambda only to use the injected emitter (and not some other lexically available emitter created in an outer dynamic scope).
Author
Todd L Smith
See also
Parameters
The name of the graph.
If true, then a directed graph will be generated; otherwise, an undirected graph will be generated.
The number of characters to emit per line. Only applies to formatting of block comments.
The accumulator for the generated source code.
If true, draw with light colors on a dark background.
This name is embedded in a copyright claim within the document.
Constructors
Types
An AttributeWriter provides the ability to write generally available dot elements, e.g., indentation, comments, identifiers, attributes, etc.
CompassPoint represents one of the compass points allowed for edge attachments to node ports. The names of the enumeration values are chosen to match dot keywords and must not be changed.
DecoratedNode represents a decorated node that includes an optional port and an optional CompassPoint. It exists only for edge specification, as dot does not permit decorated nodes to appear on their own.
A GraphWriter provides the capability of writing entire graphs, and as such is able to emit default attribute blocks, nodes, and edges.
Functions
Emit a block comment, such as a copyright banner or statement of purpose.
Emit an entire graph.