module graph.graphviz_helper
#
Short summary#
module mlstatpy.graph.graphviz_helper
graphviz helper
Functions#
function |
truncated documentation |
---|---|
Draws a graph using Graphviz. |
|
Converts a graph into a GraphViz file format. |
|
Run GraphViz. |
Documentation#
graphviz helper
- mlstatpy.graph.graphviz_helper.draw_graph_graphviz(vertices, edges, image=None, engine='dot')#
Draws a graph using Graphviz.
- Paramètres:
edges – see below
vertices – see below
image – output image, None, just returns the output
engine – dot or neato
- Renvoie:
Graphviz output or the dot text if image is None
The function creates a file
<image>.gv
if image is not None.edges = [ (1,2, label, color), (3,4), (1,3), ... ] , liste d'arcs vertices = [ (1, label, color), (2), ... ] , liste de noeuds image = nom d'image (format png)
- mlstatpy.graph.graphviz_helper.edges2gv(vertices, edges)#
Converts a graph into a GraphViz file format.
- Paramètres:
edges – see below
vertices – see below
- Renvoie:
gv format
The function creates a file
<image>.gv
.<<<
from mlstatpy.graph.graphviz_helper import edges2gv gv = edges2gv([(1, "eee", "red")], [(1, 2, "blue"), (3, 4), (1, 3)]) print(gv)
>>>
digraph{ "1" [label="eee",fillcolor=red,color=red]; 2 ; 3 ; 4 ; "1" -> "2" [label="blue"]; "3" -> "4"; "1" -> "3"; }