Saturday 21 August 2021

Network customization using ipycytoscape

I am using ipycytoscape for building networks, but it is not clear to me how to let node size being dependent on node's degree and add labels to each node. My network has two columns, one for Nodes and one for Target.

Data
Nodes      Target
A           B
B           C
B           D
C           B
E          nan


G = nx.from_pandas_edgelist(df, source='Nodes', target='Target') 

Currently I am building the graph as follows:

cytoscapeobj = ipycytoscape.CytoscapeWidget()
cytoscapeobj.graph.add_graph_from_networkx(G, labels) # labels however is not adding any label to the node, so probably the location is wrong
cytoscapeobj

I know about customization using set style:

cytoscapeobj.set_style(my_style)

but I do not know how to change it in order to visualize labels and node's size depending on node's degree. Has anyone ever had experience with ipycytoscape?



from Network customization using ipycytoscape

No comments:

Post a Comment