Utilities

Draw

class Draw(digraph=False)

Prepares for drawing a graph/digraph. Creates a graphviz object and sets the initial graph attributes

set_names(names)

Provide figure with names (from SymbolGraph) instead of ids

Parameters:

names – array [] of names for each vertex id

get_name(v)

Use when drawing the figure, should not normally be called direcctly.

Parameters:

v – vertex id

Return type:

string

node_attr(**kwargs)

Set graphviz attributes for nodes

Parameters:

**kwargs – List of graphviz keywords (e.g. color=’black’)

edge_attr(**kwargs)

Set graphviz attributes for edges

Parameters:

**kwargs – List of graphviz keywords (e.g. penwidth=’0.75’)

draw(G, path=[])

Draws the graph using the configured attributes and, optionally, showing the provided path

Parameters:
  • G – Graph object

  • path – list of vertices on the path