Type Parameters

Hierarchy

  • default<G>
    • clavaFlowDotFormatter

Constructors

Properties

getContainer: ((node: Class<Data, ScratchData>) => undefined | Class<Data, ScratchData>)

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.

getEdgeAttrs: ((edge: Class<Data, ScratchData>) => Record<string, string>)

The attributes to add to each edge.

getGraphAttrs: (() => Record<string, string>)

The attributes to add to the graph.

getNodeAttrs: ((node: Class<Data, ScratchData>) => Record<string, string>)

The attributes to add to each node.

cfgDefaultEdgeColor: string
cfgEdgeTransparency: string
cfgEndNodeSize: string
cfgNodeColor: string
cfgNodeDarkColor: string
codeFontSize: string = "10"
falseColor: string = "#d10202"
functionColor: string
functionDarkColor: string
functionFontSize: string
jumpScopeTransparency: string = "8f"
keywordColor: string = "#4040e0"
locationFontColor: string = "#c0c0c0"
locationFontSize: string = "9"
symbolColor: string = "#8080a0"
trueColor: string = "#7bc706"

Methods

  • 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.

    Parameters

    • f: ((edge: Class<Data, ScratchData>) => Record<string, string>)

      The function that adds attributes to each edge.

        • (edge): Record<string, string>
        • Parameters

          • edge: Class<Data, ScratchData>

          Returns Record<string, string>

    Returns this

    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.

    Parameters

    • f: (() => Record<string, string>)

      The function that adds attributes to the graph.

        • (): Record<string, string>
        • Returns Record<string, string>

    Returns this

    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.

    Parameters

    • f: ((node: Class<Data, ScratchData>) => Record<string, string>)

      The function that adds attributes to each node.

        • (node): Record<string, string>
        • Parameters

          • node: Class<Data, ScratchData>

          Returns Record<string, string>

    Returns this

    The same formatter, for chaining.

  • Converts a node with children into a DOT subgraph.

    Parameters

    • node: Class<Data, ScratchData>

      The node to convert.

    Returns DotSubgraph

    The resulting DOT subgraph.

  • Retrieves all nodes that are contained by a node. This method is based on getContainer.

    Parameters

    • node: Class<Data, ScratchData>

      The node to get the contained nodes of.

    Returns NodeCollection<Class<Data, ScratchData>, Data, ScratchData>

    The nodes that are contained by the given node.

  • Converts an edge into a DOT edge.

    Parameters

    • edge: Class<Data, ScratchData>

      The edge to convert.

    Returns DotEdge

    The resulting DOT edge.

  • Converts a graph to a DOT string.

    Parameters

    • graph: G

      The graph to convert.

    Returns string

    The resulting DOT string.

  • Checks if a node is contained by another node. This is based on getContainer.

    Parameters

    • node: Class<Data, ScratchData>

      The node to check.

    Returns boolean

    Whether the node is contained by another node.

  • Checks if a node contains other nodes. This is based on getContainer.

    Parameters

    • node: Class<Data, ScratchData>

      The node to check.

    Returns boolean

    Whether the node contains other nodes.

  • Converts a node without children into a DOT node.

    Parameters

    • node: Class<Data, ScratchData>

      The node to convert.

    Returns DotNode

    The resulting DOT node.

  • Converts a graph into a DOT graph.

    Parameters

    • graph: G

      The graph to convert.

    Returns DotGraph

    The resulting DOT graph.

  • Prioritizes the parent of the node as the container. Otherwise, for a ControlFlowNode, its function is used.

    Parameters

    • node: Class<Data, ScratchData>

      The node to find the container of.

    Returns undefined | Class<Data, ScratchData>

    The parent of the node.

  • Parameters

    • edge: Class<Data, ScratchData>

      The edge to get the attributes for.

    Returns Record<string, string>

    The attributes of the edge.

  • The default attributes of a graph.

    Returns Record<string, string>

    The attributes of the graph.

  • Parameters

    • node: Class<Data, ScratchData>

      The node to get the attributes for.

    Returns Record<string, string>

    The attributes of the node.