Open LelandBarnard opened 1 year ago
Hey! Maybe a bit late but I found that this line: https://github.com/WestHealth/pyvis/blame/ccb7ce745ee4159ce45eac70b9848ab965fc0906/pyvis/options.py#L58
Was the only line changed in years. So basically the smoothing was always enabled (compared to before) without a recommended or documented way to toggle the smoothness. The only solution I found was to just set smoothing off manually:
from pyvis.network import Network
network = Network()
network.options.edges.smooth.enabled = False
This will result in your network graph to be displayed with straight edges.
Your code:
import pyvis.network
import networkx as nx
from IPython.display import display, HTML
g = pyvis.network.Network(notebook = True, bgcolor = 'black', font_color = 'white', height="600px", width="90%", cdn_resources='remote')
g.options.edges.smooth.enabled = False
nxg = nx.complete_graph(8)
g.from_nx(nxg)
display(HTML(g.generate_html()))
Following a recent update, whenever I display a graph in a jupyter notebook now the edges are displayed as bowed or curved lines, rather than straight lines as they used to. Here is a test example:
which produces this output:
How can I get it to display with straight edges as it used to?