Giter Site home page Giter Site logo

Comments (12)

benmaier avatar benmaier commented on June 12, 2024

so the error only occurs after the styling process?

from netwulf.

floklimm avatar floklimm commented on June 12, 2024

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)

from netwulf.

benmaier avatar benmaier commented on June 12, 2024

weird, it works for me. I called

import netwulf as wulf
_, __, G = wulf.load("./matNetwork_error.txt")
wulf.visualize(G)

and I get the following result:

Screen Shot 2019-11-25 at 18 38 17

Which version of netwulf do you have installed? You can find out like this:

print(wulf.__version__)

from netwulf.

benmaier avatar benmaier commented on June 12, 2024

the current version is 0.1.4. In case you're not on the current version you can update it like this:

pip install --upgrade netwulf

from netwulf.

floklimm avatar floklimm commented on June 12, 2024

I am also on 0.1.4

I will try to create a minimal working example and then report back.

from netwulf.

benmaier avatar benmaier commented on June 12, 2024

when you said "(and it doesn't throw an error", does that mean you have checked the javascript console for error messages?

from netwulf.

floklimm avatar floklimm commented on June 12, 2024

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
Uncaught TypeError: Cannot read property 'constructor' of undefined
at Xt (sweetalert2.all.min.js:1)
at restart_if_valid_JSON (vis.js:541)
at vis.js:437
at Object. (d3.v4.min.js:7)
at _.call (d3.v4.min.js:4)
at XMLHttpRequest.e (d3.v4.min.js:7)

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:
python 3.6.8
networkx 2.2
wulf 0.1.4

I am running it in an Anaconda Jupiter Notebook on a Mac.

from netwulf.

benmaier avatar benmaier commented on June 12, 2024

which browser?

from netwulf.

benmaier avatar benmaier commented on June 12, 2024

very weird, your code works on my machine for both python 3.6 and python 3.7 as well as both Chrome and Safari

from netwulf.

benmaier avatar benmaier commented on June 12, 2024

(thanks for raising the issue though, I heard from several people that they had problems, so this definitely helps)

from netwulf.

floklimm avatar floklimm commented on June 12, 2024

I just checked and the problem seems to occur only with Chrome. Firefox and Safari work without any problem!

from netwulf.

benmaier avatar benmaier commented on June 12, 2024

weird

from netwulf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.