Using python and networkx, you may create some beautiful graphs and store them as graphml file:
1 2 3 4 5 6 7 8 9 10 |
graph = nx.DiGraph() graph.add_node('Node1') graph.add_node('Node2') graph.add_node('Node3') graph.add_node('Node4') graph.add_edge('Node1', 'Node2') graph.add_edge('Node1', 'Node3') graph.add_edge('Node2', 'Node4') graph.add_edge('Node3', 'Node4') nx.write_graphml(graph, 'dependency.graphml') |
This will give us the following graphml:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<?xml version='1.0' encoding='utf-8'?> <graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd"> <graph edgedefault="directed"> <node id="Node1" /> <node id="Node3" /> <node id="Node2" /> <node id="Node4" /> <edge source="Node1" target="Node3" /> <edge source="Node1" target="Node2" /> <edge source="Node3" target="Node4" /> <edge source="Node2" target="Node4" /> </graph> </graphml> |
Unfortunately, rendering them the standard way by using draw and Graphviz is producing a bitmap file that I do not want to include in my[…]