pyvis
pyvis copied to clipboard
Add initial position support to `Network.from_nx`
In Networkx, you can give the positions to draw nodes at with
nx.draw(G, pos=nx.spring_layout(G))
See https://networkx.org/documentation/stable/reference/generated/networkx.drawing.nx_pylab.draw.html#networkx.drawing.nx_pylab.draw for more.
In pyvis, it would be useful add a pos
argument to Network.from_nx
. This would then map the positions to the x
and y
arguments of Network.add_node
that are called in the implementation of from_nx
. This way we could have a dictionary of initial positions similar to Networkx.
Might duplicate or be similar to: https://github.com/WestHealth/pyvis/issues/17