import ipycytoscape
data = {
'nodes': [
{ 'data': { 'id': '1', 'tooltip': 'a'} },
{ 'data': { 'id': '2', 'tooltip': 'b'} },
{ 'data': { 'id': '3', 'tooltip': 'c' } }
],
'edges': [
{
'data': {
'source': '1',
'target': '2',
'tooltip': '4'
}
},
{
'data': {
'source': '1',
'target': '3',
'tooltip': '6'
}
}
]
}
cytoscapeobj = ipycytoscape.CytoscapeWidget(nodeSpacing=10)
cytoscapeobj.graph.add_graph_from_json(data)
cytoscapeobj.set_tooltip_source('tooltip')
Try clicking on the nodes in the graph below. When you click the associated tooltip will show up.
display(cytoscapeobj)
CytoscapeWidget(cytoscape_layout={'name': 'cola'}, cytoscape_style=[{'selector': 'node', 'css': {'background-c…