Open tbloch1 opened 3 years ago
Hi, any update on this? I would like to put a slider to control the minimum value of edge weights to show. Thanks in advance! :)
Found a workaround: wrap the net.show()
inside a display
.
Here's some demo code:
from ipywidgets import interact, Dropdown
from pyvis.network import Network
widg = widgets.Dropdown(options = range(10))
@interact(x=widg)
def pyvis_test(x):
net = Network(notebook=True)
net.add_nodes([1,2,3])
net.add_edges([[1,2],[2,3],[3,1]])
# net.show('graph.html')
display(net.show('graph.html'))
When calling a function that creates a network through
interact()
, the network is not rendered/loaded.MWE:
Output:
Expected output (what I get from just calling
pyvis_test(x=1)
):Having not found many similar issues online, my only guess is that it has something to do with a bad interaction between how the widgets are created/displayed (which I think is HTML) and then displaying the network.
If I load the saved graph, then it loads fine. So it's constructing that fine, it's just an issue with displaying it.