def htg2image(htg: networkx.DiGraph, fname_image: str, layout_engine: str = "dot"): """ Creates an image file from the *HTG*. **arguments**: * *HTG*: HTG * *fname_image*: name of output file * *layout_engine*: one of "dot", "neato", "fdp", "sfdp", "circo", "twopi" **example**:: >>> htg2image(cgraph, "mapk_htg.pdf") """ graph = htg.copy() convert_nodes_to_anonymous_strings(graph) digraph2image(graph, fname_image, layout_engine)
def condensationgraph2image(cgraph: networkx.DiGraph, fname_image: str, layout_engine: str = "dot"): """ Creates an image file from the condensation graph. **arguments**: * *cgraph*: condensation graph * *fname_image*: name of output file * *layout_engine*: one of "dot", "neato", "fdp", "sfdp", "circo", "twopi" **example**:: >>> condensationgraph2image(cgraph, "dot", "mapk_cgraph.pdf") """ graph = cgraph.copy() convert_nodes_to_anonymous_strings(graph) digraph2image(graph, fname_image, layout_engine)
def htg2dot(htg: networkx.DiGraph, fname_dot: str = None) -> str: """ Creates a *dot* file of the *HTG*. **arguments**: * *HTG*: HTG * *fname_dot*: name of *dot* file or *None* **returns**: * *text_dot*: text content of dot file **example**:: >>> htg2dot(cgraph, "mapk_htg.dot") """ graph = htg.copy() convert_nodes_to_anonymous_strings(graph) return digraph2dot(graph, fname_dot)
def condensationgraph2dot(cgraph: networkx.DiGraph, fname_dot: str = None): """ Creates a *dot* file from a condensation graph. **arguments**: * *cgraph*: state transition graph * *fname_dot*: name of *dot* file or *None* **returns**: * *text_dot*: file as string if not *FnameDOT is None*, otherwise it returns *None* **example**:: >>> condensationgraph2dot(cgraph, "mapk_cgraph.dot") """ graph = cgraph.copy() convert_nodes_to_anonymous_strings(graph) return digraph2dot(graph, fname_dot)