SPeCS Packages Documentation
    Preparing search index...

    A subgraph statement in a dot graph.

    A subgraph label may start with 'cluster' to represent a cluster, which is a special kind of subgraph that is visible in rendering.

    A cluster acts like a container of nodes, and may be used to model nodes with children.

    Implements

    Index

    Constructors

    Properties

    label?: string

    The label of the subgraph.

    statementList: DotStatement[]

    The list of statements inside the subgraph.

    Accessors

    • get isCluster(): boolean

      Whether the subgraph may be interpreted as a cluster by the rendering engine.

      For that, it must have a label that starts with 'cluster'.

      Returns boolean

      Whether the subgraph is a cluster.

    Methods

    • Adds an attribute to the edges of the subgraph.

      Parameters

      • key: string

        The key of the attribute.

      • value: string

        The value of the attribute.

      Returns this

      This subgraph statement, for chaining.

    • Adds multiple attributes to the edges of the subgraph.

      Parameters

      • attrs: Record<string, string>

        The attributes to add.

      Returns this

      This subgraph statement, for chaining.

    • Adds an attribute to the subgraph.

      Parameters

      • key: string

        The key of the attribute.

      • value: string

        The value of the attribute.

      Returns this

      This subgraph statement, for chaining.

    • Adds multiple attributes to the subgraph.

      Parameters

      • attrs: Record<string, string>

        The attributes to add.

      Returns this

      This subgraph statement, for chaining.

    • Adds an attribute to the nodes of the subgraph.

      Parameters

      • key: string

        The key of the attribute.

      • value: string

        The value of the attribute.

      Returns this

      This subgraph statement, for chaining.

    • Adds multiple attributes to the nodes of the subgraph.

      Parameters

      • attrs: Record<string, string>

        The attributes to add.

      Returns this

      This subgraph statement, for chaining.

    • Converts the subgraph statement to a dot string.

      Parameters

      • directed: boolean

        Whether the graph is directed.

      • indentation: number = 0

        The number of spaces to indent.

      Returns string

      The dot string of the subgraph statement.