I'm using networkx to create a diGraph
object, populate it with nodes and edges (including several characteristics), and then write a gefx file that I'm visualising with Gephi.
import networkx as nx
dg = nx.DiGraph()
dg.add_node(attribute1, 2, etc...)
dg.add_edge(attribute1, 2, etc...)
nx.write_gexf("output.gexf")
This process works perfectly. Now I need to assign locations to the nodes. I have seen that networkx can somehow do it (http://networkx.github.com/documentation/latest/examples/drawing/house_with_colors.html) and also I know there is a viz tag for gexf files (http://gexf.net/format/viz.html). I have a dictionary with the nodes names and their coordinates. Any idea to put all this together?
My option until now is to read the gexf file already generated, look for the nodes and create the viz:position
tag.
However, it isn't very effective and I would like to somehow do it directly when adding the nodes.