ucsd-ccbb / visJS2jupyter

visJS2jupyter is a tool to bring the interactivity of networks created with vis.js into jupyter notebook cells
MIT License
78 stars 17 forks source link

Examples not working anymore. #4

Closed jmbertoncelli closed 6 years ago

jmbertoncelli commented 6 years ago

add a node attributes to color-code by

cc = nx.clustering(G) degree = G.degree() bc = nx.betweenness_centrality(G) nx.set_node_attributes(G,'clustering_coefficient',cc) nx.set_node_attributes(G,'degree',degree) nx.set_node_attributes(G,'betweenness_centrality',bc)


TypeError Traceback (most recent call last)

in () 3 degree = G.degree() 4 bc = nx.betweenness_centrality(G) ----> 5 nx.set_node_attributes(G,'clustering_coefficient',cc) 6 nx.set_node_attributes(G,'degree',degree) 7 nx.set_node_attributes(G,'betweenness_centrality',bc) /root/miniconda2/envs/snake27.10/lib/python2.7/site-packages/networkx/classes/function.pyc in set_node_attributes(G, values, name) 646 except AttributeError: # `values` is a constant 647 for n in G: --> 648 G.nodes[n][name] = values 649 else: # `values` must be dict of dict 650 for n, d in values.items(): TypeError: unhashable type: 'dict'
jmbertoncelli commented 6 years ago

Does not work when using networkX 2.0 but works with networkX 1.11. Do you plan to upgrade your code to be compatible with nx 2.x?

jmbertoncelli commented 6 years ago

Any news about support for nx 2.x?

thanks

brinrosenthal commented 6 years ago

thank you for bringing this issue to our attention- we are working on upgrading the tool to be compatible with nx 2.0. We expect to have the new version ready within the next week.

jmbertoncelli commented 6 years ago

Thanks a lot for this excellent library! Would you keep me posted to when the update should be available on pypi?

Thanks a lot

Jm

Sent from my iPhone

On Oct 24, 2017, at 11:40 AM, brinrosenthal notifications@github.com<mailto:notifications@github.com> wrote:

thank you for bringing this issue to our attention- we are working on upgrading the tool to be compatible with nx 2.0. We expect to have the new version ready within the next week.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ucsd-ccbb/visJS2jupyter/issues/4#issuecomment-339053926, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AJNhY-cPAxRulgvZIZK5V5qRtc5kU3Gjks5svhMUgaJpZM4PxLeH.

brinrosenthal commented 6 years ago

Hi JM,

We've just updated to version 0.1.8, which is now compatible with nx2.0. We've also updated the notebooks so they are compatible as well (by casting nodeview/edgeview objects to lists). Hope you can use the tool now!

-SBR

jmbertoncelli commented 6 years ago

Thank you a bunch! JM

Sent from my iPad

On Nov 8, 2017, at 3:35 PM, brinrosenthal notifications@github.com<mailto:notifications@github.com> wrote:

Closed #4https://github.com/ucsd-ccbb/visJS2jupyter/issues/4.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ucsd-ccbb/visJS2jupyter/issues/4#event-1332785321, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AJNhYwXoCf0Cx3zBYCOtvSheH6BRSxIbks5s0h6dgaJpZM4PxLeH.