import ipycytoscape
import json
with open("DAGData.json") as fi:
json_file = json.load(fi)
cytoscapeobj = ipycytoscape.CytoscapeWidget()
cytoscapeobj.graph.add_graph_from_json(json_file)
cytoscapeobj.set_layout(name='dagre', nodeSpacing=10, edgeLengthVal=10)
cytoscapeobj.set_style([{
'selector': 'node',
'css': {
'background-color': '#11479e'
}
},
{
'selector': 'node:parent',
'css': {
'background-opacity': 0.333
}
},
{
'selector': 'edge',
'style': {
'width': 4,
'line-color': '#9dbaea',
'target-arrow-shape': 'triangle',
'target-arrow-color': '#9dbaea',
'curve-style': 'bezier'
}
}])
cytoscapeobj