GraphWriter

inner class GraphWriter : DotWriter.AttributeWriter

A GraphWriter provides the capability of writing entire graphs, and as such is able to emit default attribute blocks, nodes, and edges.

Author

Todd L Smith

Constructors

Link copied to clipboard
fun GraphWriter()

Functions

Link copied to clipboard
fun adjust(rhs: String): String

Answer an adjusted rhs (right hand side), taking into account which format the rhs takes, and whether dark mode is active.

fun adjust(    condition: Boolean,     trueString: String,     falseString: String): String

Answer an adjusted rhs (right hand side), taking into account which format the rhs takes, and whether dark mode is active. This method takes a boolean, which if true processes the second argument, otherwise the third.

Link copied to clipboard
fun attribute(lhs: String, rhs: String)

Emit a simple attribute statement.

Link copied to clipboard
fun blockComment(comment: String)

Emit a block comment. A best effort will be made to keep the lines of the block comment within the specified limit, accounting for indentation and comment overhead.

Link copied to clipboard

Emit an appropriately indented default attribute block.

Link copied to clipboard
fun edge(    source: DotWriter.DecoratedNode,     target: DotWriter.DecoratedNode,     block: (DotWriter.AttributeWriter) -> Unit?)
fun edge(    source: DotWriter.DecoratedNode,     target: (DotWriter.GraphWriter) -> Unit,     block: (DotWriter.AttributeWriter) -> Unit?)
fun edge(    source: (DotWriter.GraphWriter) -> Unit,     target: DotWriter.DecoratedNode,     block: (DotWriter.AttributeWriter) -> Unit?)
fun edge(    source: (DotWriter.GraphWriter) -> Unit,     target: (DotWriter.GraphWriter) -> Unit,     block: (DotWriter.AttributeWriter) -> Unit?)
fun edge(    source: (DotWriter.GraphWriter) -> Unit,     target: String,     block: (DotWriter.AttributeWriter) -> Unit?)
fun edge(    source: String,     target: (DotWriter.GraphWriter) -> Unit,     block: (DotWriter.AttributeWriter) -> Unit?)

Emit an edge.

fun edge(    source: String,     target: String,     block: (DotWriter.AttributeWriter) -> Unit?)

Emit an edge with attributes.

Link copied to clipboard
fun emit(text: String)

Emit arbitrary text. Updates justEmittedLinefeed appropriately, based on whether the last character of the specified text is a linefeed.

Link copied to clipboard
fun endOfLineComment(comment: String)

Emit an end-of-line comment.

Link copied to clipboard
fun indent()

Emit an appropriate amount of indentation, as horizontal tabs. It is assumed that the most recently written character is a line feed.

Link copied to clipboard
fun interleaved(nodes: List<Any>, block: (DotWriter.AttributeWriter) -> Unit?)

Emit interleaved nodes and edges. If no nodes are specified, then do nothing.

Link copied to clipboard
fun node(nodeName: String, block: (DotWriter.AttributeWriter) -> Unit?)

Emit a node with attributes.

Link copied to clipboard
fun subgraph(block: (DotWriter.GraphWriter) -> Unit)

Write an appropriately indented anonymous subgraph block.

fun subgraph(subgraphName: String, block: (DotWriter.GraphWriter) -> Unit)

Write an appropriately indented named subgraph block.