Open YouGuessedMyName opened 1 week ago
I think the reason is that g.from_nx
calls g.add_node
with no argument for color
, which leads to the nodes getting the default argument color="#97c2fc"
, which overrides anything you set in set_options
. I think the library should not behave like this, the default argument for color
being "#97c2fc"
is dumb.
Thank you Linus, if anyone else is also facing this issue, you can edit the node colors as expected if you generate a graph using g.add_node(1, color=None)
. The 'None' makes sure that the default color is not overwritten and VisJs actually applies the layout specified in set_options
. The default value of the color argument of add_node should definitely be changed to 'None' in the source code.
To reproduce, run the following (not in a notebook):
Expected behavior: Florence family graph with purple background nodes. Actual behavior: Florence family graph with default blue background nodes.