pyvis icon indicating copy to clipboard operation
pyvis copied to clipboard

Example for Google Colab Notebooks

Open K-Bizzle24 opened this issue 3 years ago • 2 comments

It appears the base implementation for using pyvis in a notebook does not work with Google Colab due to a localhost issue. If anyone could give me an example of a workaround or point me in the right direction, that would be very helpful. Thank you!

K-Bizzle24 avatar Feb 26 '22 17:02 K-Bizzle24

Hello, I have a similar issue, I'm using VSCode remote (meaning that my VSCode is connected to external server handling the notebook). And doing

from pyvis import network as net
import networkx as nx
net = Network()
net.add_nodes(unique_attrb)
net.show("example.html")

Just show an empty space in the notebook. image

Not sure how to debug this.

lambda-science avatar Mar 01 '22 10:03 lambda-science

Try using an IPython IFrame directly (e.g., IPython.display.IFrame(src='network.html',width=900, height=600) )and see if it will render. I don't use CoLab or VSCode :(.

jhunpingco avatar Apr 12 '22 15:04 jhunpingco