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

Error in visualising the graph for the simple example (http://bl.ocks.org/brinrosenthal/raw/f073040bf389c4c32f648f9107fc836e/) #19

Open godinezmaciask opened 6 years ago

godinezmaciask commented 6 years ago

I am using Python 3.5 and Networkx 2.1, I am able to do the imports and I converted the edges = G.edges() to a list and added positions for x,y for each node as in nodes_dict = [{"id":n,"x":pos[n][0]*10,"y":pos[n][1]*10} for n in nodes] to make it work.

When I try to display the graph using visJS_module.visjs_network(nodes_dict, edges_dict, time_stamp=0) it shows the plot area, but nothing else, it is not zoomable nor contains the graph.

m1webste commented 6 years ago

I've rewrote the example notebook to fix all of the edge to list and x,y position issues, and I've tested it with networkx versions 2.1 and 1.11, and with Python 2 and 3. The code should work exactly as is, perhaps you may need to change the visJS2jupyter import path. Let me know if this new notebook still isn't working! Thank you for your feed back so that we can improve our package (:

godinezmaciask commented 6 years ago

Thank you. The update worked for the graph dictionaries creation.

I did changed the import path, and I got this as an output <module 'visJS2jupyter.visJS_module' from '/anaconda3/envs/networkx/lib/python3.5/site-packages/visJS2jupyter/visJS_module.py'> is it not displaying because the impot thakes the .py script, rather than the .pyc as the examples?

godinezmaciask commented 6 years ago

I changed the path to take the .pyc and it doesn't display the graph either. I still have the same empty window

m1webste commented 6 years ago

If you have pip installed visJS2jupyter, you shouldn't need to change the import path (unless you have something else going on with anaconda/pypi, where it doesn't download the package to the right path or something). When I use the notebook exactly as is and print the path, mine looks like: <module 'visJS2jupyter.visJS_module' from 'C:\Users\m1web\Anaconda2\envs\ipykernel_py3\lib\site-packages\visJS2jupyter\visJS_module.py'>

I just re-checked the notebook, with python 3, networkx 2.1, and the latest version of visJS2jupyter, and unfortunately I am not able to recreate your problem.

m1webste commented 6 years ago

Two things off the top of my head I can think of that would cause a blank output cell:

Sometimes when you use "Run all" to run your cells instead of shift-enter'ing the cell containing the visJS2jupyter call, it can produce a blank cell.

If you are trying to visualize two graphs in one notebook, you have to change the parameter "graph_id", or else one of the cells will have a blank graph.

godinezmaciask commented 6 years ago

I do have basically the same path, I also tried giving the graph_id. Is it possible that it doesn't work because I am using Anaconda 3?

hamzaBT commented 6 years ago

I have the same problem

kkpsiren commented 6 years ago

After upgrading notebook I got the same problem

brinrosenthal commented 6 years ago

Hi everyone- this issue appears to be windows and/or browser based. We are working on finding a solution. Thanks!

aneesh-singla commented 5 years ago

Any Updates on this issue. I am using Ubuntu, anaconda 3.7, networkx 1.11. I am using the simple code (line by line) present at this link -> http://bl.ocks.org/m1webste/raw/be7be9d1b2c88e5549cf79b7edbc8444/ There is just no output - no graph, no network, etc (only blank screen type result)

wanted68 commented 5 years ago

Hi, I also have the same problem. I am using NetworkX 2.2, visJS2jupyter 0.1.16 and iPython 5.3.0.

wanted68 commented 5 years ago

This worked for me. [https://github.com/ucsd-ccbb/visJS2jupyter/issues/22]

camiloromers commented 5 years ago

I have the same problem. I just got an empty cell without any graph. Any solution?

Chaoste commented 5 years ago

As wanted68 pointed out, there is an github issue tackling the same problem but with a more specific error. I suggest you to look into your console (browser dev tools). There might be an error reported which says that the request of a local file was blocked. You can find a solution in the mentioned issue #22 .

kinoc commented 3 years ago

Using Firefox on Windows this extension seems to fix it for me: https://addons.mozilla.org/en-US/firefox/addon/ignore-x-frame-options-header https://github.com/ThomazPom/Moz-Ext-Ignore-X-Frame-Options Also check any ad-blocker settings to "allow all this tab".