I have the following code to generate and plot a graph with ipycytoscape:
from ipycytoscape import CytoscapeWidget
import networkx as nx
cyto = CytoscapeWidget()
nodes = [1,2,3,4,5,6,7,8]
children = [[2],[3,4],[5,6],[6,7],[8],[],[8],[]]
G2 = nx.Graph()
G2.add_nodes_from(nodes)
for i,child in enumerate(children):
for c in child:
G2.add_edge(i+1, c)
cyto.graph.add_graph_from_networkx(G2, directed=True)
cyto.set_layout(name='dagre', nodeSpacing=10, edgeLengthVal=10)
display(cyto)
Now if I add a layout, whatever it is
cyto_style = [{ 'selector' : 'node',
'style': {'font-family': 'arial',
'font-size': '10px',
'label': 'data(id)'}}]
cyto.set_style(cyto_style)
display(cyto)
THE ARROWS DISAPPEAR !!! NO DIRECTIONALITY PLOTTING. What should i do to make the arrows stay there as they were before adding style?