visions.utils.graph

visions.utils.graph.output_graph(G, file_name, sort=True)[source]

Output a graph to a file, either as image or as dot file.

Parameters
  • G (DiGraph) – the DiGraph to write or plot

  • file_name (Union[Path, str]) – the file name to write to. Extension can be svg, png or dot.

  • sort (bool) – create a copy of the graph with sorted keys

Return type

None

Returns

Nothing

Raises

ValueError when the file_name does not end on .svg, png or dot