WestHealth / pyvis

Python package for creating and visualizing interactive network graphs.
http://pyvis.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
940 stars 162 forks source link

`write_html` opens browser to relative rather than absolute path, doesn't handle absolute paths as name #278

Open norweeg opened 3 months ago

norweeg commented 3 months ago
from pyvis.network import Network
from itertools import combinations

nodes = [n for n in range(10)]
edges = list(combinations(nodes, 2))

nt = Network()
nt.add_nodes(nodes)
nt.add_edges(edges)
# correctly writes file, but opens browser to relative path ./complete_graph.html, which is invalid
nt.write_html("complete_graph.html")
python 3.12.1
ipython 8.21.0
ipykernel 6.29.2
jupyter_client 8.6.0
pyvis 0.3.1

additionally, write_html does not handle fully qualified paths at all