specless.io.draw_graph

specless.io.draw_graph(graph: DiGraph, filepath: str, should_display: bool = True, img_format: str = 'png', cleanup: bool = True) None[source]

Draw a class that is derived from a networkx DiGraph and save it to a file.

Parameters:
  • graph (nx.DiGraph) – The graph to draw.

  • filepath (str) – The path to the file where the graph will be saved.

  • should_display (bool, optional) – Whether to display the graph. Default is True.

  • img_format (str, optional) – The format of the image file. Default is ‘png’.

  • cleanup (bool, optional) – Whether to clean up temporary files. Default is True.