Creates a new default DOT formatter.
Optional
getNodeAttrs: ((node: BaseNode.Class<BaseNode.Data, BaseNode.ScratchData>) => Record<string, string>)The attributes to add to each node. If not provided, the default attributes are used.
Optional
getEdgeAttrs: ((edge: BaseEdge.Class<BaseEdge.Data, BaseEdge.ScratchData>) => Record<string, string>)The attributes to add to each edge. If not provided, the default attributes are used.
Optional
getContainer: ((node: BaseNode.Class<BaseNode.Data, BaseNode.ScratchData>) => undefined | BaseNode.Class<BaseNode.Data, BaseNode.ScratchData>)Given a node, returns the node that will contain it.
Optional
getGraphAttrs: (() => Record<string, string>)Given a node, returns the node that will contain it. By default that is the parent of the node, but subclasses may override this method to visualize other parent-like relationships.
The attributes to add to each edge.
The attributes to add to the graph.
The attributes to add to each node.
Adds attributes to each edge. Only overrides the attributes that are explicitly set by the function, leaving the others unchanged.
For completely overriding the previous attributes, just set getEdgeAttrs directly.
The same formatter, for chaining.
Adds attributes to the graph. Only overrides the attributes that are explicitly set by the function, leaving the others unchanged.
For completely overriding the previous attributes, just set getGraphAttrs directly.
The function that adds attributes to the graph.
The same formatter, for chaining.
Adds attributes to each node. Only overrides the attributes that are explicitly set by the function, leaving the others unchanged.
For completely overriding the previous attributes, just set getNodeAttrs directly.
The same formatter, for chaining.
Converts a node with children into a DOT subgraph.
The resulting DOT subgraph.
Retrieves all nodes that are contained by a node. This method is based on getContainer.
The nodes that are contained by the given node.
Converts a graph to a DOT string.
The graph to convert.
The resulting DOT string.
Checks if a node is contained by another node. This is based on getContainer.
Whether the node is contained by another node.
Checks if a node contains other nodes. This is based on getContainer.
Whether the node contains other nodes.
Static
defaultStatic
defaultStatic
defaultStatic
default
The default formatter for converting a graph into a DOT string.
All nodes and all edges are present in the resulting graph. Nodes that are parents are represented as clusters, with an appropriate hack (invisible point node) to make the edges connect correctly.