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

CircosPlot with networkx 2.4 (group_labels) #603

Open
eduardacenteno opened this issue Apr 30, 2020 · 2 comments
Open

CircosPlot with networkx 2.4 (group_labels) #603

eduardacenteno opened this issue Apr 30, 2020 · 2 comments

Comments

@eduardacenteno
Copy link
Collaborator

  • nxviz version: 0.6.2
  • networkx version: 2.4
  • Python version: 3.7.3
  • Operating System: Windows

Description

Hey, so. I upgraded my networkx today to 2.4 and since the CircosPlot group_label parameter stopped working.
It was giving me an error on line 821, saying that "Graph doesn't have node" because of

[self.graph.node[n][self.node_color] for n in self.nodes])))

What I Did

I was able to solve it by tweaking the function in plots.py to the following:

sorted(list(set([list(self.graph.nodes.values())[n][self.node_color] for n in np.arange(len(self.nodes))])))

Now it works fine!! Legend for groups is generated fine!

Not sure if anyone else had this problem, but in case.. here is a possible solution!!

@ericmjl
Copy link
Owner

ericmjl commented Apr 30, 2020

@eduardacenteno thanks a ton - yes, this is the correct fix.

Would you be open to submitting a PR to the library?

I've been gradually upgrading all of my NetworkX projects to v2.4 with this breaking change, but haven't had the bandwidth yet to make it over to nxviz.

@eduardacenteno
Copy link
Collaborator Author

@ericmjl

Sure, I'll fork it and submit a PR with the corrected version :)

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

2 participants