jsexauer / networkx_viewer

Interactive GUI for NetworkX graphs
GNU General Public License v3.0
137 stars 27 forks source link

Dragging around DiGraph and MultiDiGraph nodes #14

Open giuseppe-sec-eng opened 8 years ago

giuseppe-sec-eng commented 8 years ago

For example:

import networkx as nx
from networkx_viewer import Viewer

G = nx.MultiGraph()

G.add_edge('a','b')
G.add_edge('b','c')
G.add_edge('c','a',0,{'fill':'grey'})
G.add_edge('a','c',0,{'fill':'grey'})
G.add_edge('c','d')
G.add_edge('c','d',1,{'dash':(2,2)})
G.node['a']['outline'] = 'blue'
G.node['d']['label_fill'] = 'red'

app = Viewer(G)
app.mainloop()

If we then drag node a around we will notice that the directed edge from c to a does not maintain the link and remain in the original position.