Hello,
The function graph_tool.draw.interactive_window is great for exploring a graph interactively. Often I just need some part of a graph, for which I can easily define a filter (or view). My question is: Is it possible to switch between the full graph and a filtered subset of the graph interactively? I tried something like the code below but it didn't work:
def my_key_press_callback(self, g, keyval, picked, pos, vprops, eprops): if (chr(keyval)=='1'): self.g = g1 self.queue_draw() if (chr(keyval)=='2'): self.g = g2 self.queue_draw()
g1 = gt.load_graph("mygraph.xml.gz") g2 = gt.GraphView(g1, vfilt=SOMEFILTER) gt.interactive_window(g1, key_press_callback=my_key_press_callback)
Any suggestions are appreciated.
Best regards Rolf