Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directed Graph Problem. #10

Open
jvahue opened this issue Oct 19, 2015 · 0 comments
Open

Directed Graph Problem. #10

jvahue opened this issue Oct 19, 2015 · 0 comments

Comments

@jvahue
Copy link

jvahue commented Oct 19, 2015

v1.10
Ok here is the problem. I have a DiGraph (see Suggestions Issue - oh that was another wish to get an arrow or whatever for Directional graphs) where two nodes point to each other.

nw = nx.DiGraph()
nw.add_edges_from([(1,2), (2,3), (2,4), (1,4), (3,5), (3,2)])
app = Viewer(nw)
app.mainloop()

In a DiGraph 2->3 and 3->2 so the first zoom cause the problem. Maybe both edges get drawn but only one is zoomed.

Here is a quick hack to fix this in GraphCanvas._plot_graph:

        # remove redundant edges
        e0 = graph.edges()
        e1 = []
        for f,t in e0:
            if (f,t) not in e1 and (t,f) not in e1:
                e1.append((f,t))

        # Create edges
        #for frm, to in set(graph.edges()):
        for frm, to in set(e1):
            self._draw_edge(frm, to)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant