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

Network.show_buttons() and network.set_options() behave unexpectedly when ran on the same network. #290

Open YouGuessedMyName opened 1 week ago

YouGuessedMyName commented 1 week ago

To reproduce, run (not in a notebook).

from pyvis.network import Network
import networkx as nx

g = Network()

g.from_nx(nx.florentine_families_graph())
g.show_buttons(filter_=['nodes'])
g.set_options("""
var options = {
    "nodes": {
        "color": {
            "background": "rgba(252,39,99,1)"
        }
    }
}""")

html = g.generate_html("example2.html")
with open("example2.html", mode='w', encoding='utf-8') as fp:
        fp.write(html)

Expected behavior: The Florence family graph, with interactive node sliders/color pickers. Actual behavior: An empty graph with no interactive node sliders/color pickers.

linusheck commented 6 days ago

This might be the same issue as https://github.com/WestHealth/pyvis/issues/81