A factory class for creating dot graphs, subgraphs, nodes, and edges.

Constructors

Methods

  • Creates a new dot graph.

    Example: "digraph myGraph { ... }"

    Parameters

    • Optionallabel: string

      The label of the graph.

    • directed: boolean = true

      Whether the graph is directed.

    • strict: boolean = false

      Whether the graph is strict. A strict graph may not have multiple edges between the same nodes: they are merged into a single edge.

    • statements: DotStatement[] = []

      The list of statements inside the graph.

    Returns DotGraph

    The created dot graph.

  • Creates a new dot attributes statement for graphs.

    Example: "graph [label="Hello"];"

    Parameters

    • attrs: Record<string, string>

      The list of attributes.

    Returns DotAttributes

    The created dot attributes statement.

  • Creates a new dot subgraph.

    Example: "subgraph cluster_0 { ... }"

    Parameters

    • Optionallabel: string

      The label of the subgraph.

    • statements: DotStatement[] = []

      The list of statements inside the subgraph.

    Returns DotSubgraph

    The created dot subgraph.