-
Notifications
You must be signed in to change notification settings - Fork 27
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
Problem with node attributes (specifically `bipartite') #36
Comments
so the error only occurs after the styling process? |
It does occur immediately when executing wulf.visualize(tempToPlot) (and it doesn't throw an error but just an empty canvas, as if you would have input an empty graph) |
the current version is 0.1.4. In case you're not on the current version you can update it like this:
|
I am also on 0.1.4 I will try to create a minimal working example and then report back. |
when you said "(and it doesn't throw an error", does that mean you have checked the javascript console for error messages? |
Please find below a minimal working example: ## import things
import networkx as nx
import netwulf as wulf
## construct a small bipartite network
B = nx.Graph()
nodeSet0 = [1, 2, 3, 4]
B.add_nodes_from(nodeSet0, bipartite=0)
B.add_nodes_from(['a', 'b', 'c'], bipartite=1)
B.add_edges_from([(1, 'a'), (1, 'b'), (2, 'b'), (2, 'c'), (3, 'c'), (4, 'a')])
G=nx.projected_graph(B,nodeSet0)
## visualise the with netwulf (fails)
wulf.visualize(G)
## removing the `bipartite' node attribute
copyOfGraph = G.copy()
for node in copyOfGraph:
del copyOfGraph.node[node]['bipartite']
## Now it works
wulf.visualize(copyOfGraph) The error message in the javascript console when it fails is As removing the node attributes fixes the problem it is not an urgent issue but I thought it should be documented somewhere in case other people run into the same problem. Versions: I am running it in an Anaconda Jupiter Notebook on a Mac. |
which browser? |
very weird, your code works on my machine for both python 3.6 and python 3.7 as well as both Chrome and Safari |
(thanks for raising the issue though, I heard from several people that they had problems, so this definitely helps) |
I just checked and the problem seems to occur only with Chrome. Firefox and Safari work without any problem! |
weird |
Netwulf seems to have a problem with some node attributes. It results in not plotting anything.
I have a network that is a monopartite projection of a bipartite network. Therefore every node has the attribute ('bipartite',0).
For using Netwulf I have to delete them manually.
Find attached two input files, one that works and a second one that doesn't work. (I had to rename them as txt)
It might be only the specific node attribute 'bipartite' or node attributes in general. So if people run into this error, just remove the attributes.
matNetwork_error.txt
matNetwork.txt
The text was updated successfully, but these errors were encountered: