#!/usr/bin/env python # coding: utf-8 # In[ ]: import ipycytoscape # In[ ]: import json with open("DAGData.json") as fi: json_file = json.load(fi) # In[ ]: cytoscapeobj = ipycytoscape.CytoscapeWidget() cytoscapeobj.graph.add_graph_from_json(json_file) # In[ ]: 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' } }]) # In[ ]: cytoscapeobj