cytoscape / ipycytoscape

A Cytoscape Jupyter widget
https://ipycytoscape.readthedocs.io/en/master/
BSD 3-Clause "New" or "Revised" License
264 stars 62 forks source link

Graph display is not cleared when nodes, edges and adjacency are cleared #255

Closed SebastienDorgan closed 3 years ago

SebastienDorgan commented 3 years ago

Bug report

Bug summary I add a graph using

self.cyto.graph.add_graph_from_networkx(G)

where self.cyto is an instance of CytoscapeWidget. The graph is correctly displayed image

To clear I use:

def clear_graph(self):
    self.cyto.graph.edges.clear()
    self.cyto.graph.nodes.clear()
    self.cyto.graph._adj.clear(

But the graph is still displayed

Environment Python 3.8.5

ipycytoscape 1.2.0 pyhd8ed1ab_0 conda-forge ipython 7.22.0 py38hb070fc8_0
ipywidgets 7.6.3 pyhd3deb0d_0 conda-forge

SebastienDorgan commented 3 years ago

Installing ipycytoscape from the source solved the problem

marimeireles commented 3 years ago

I believe this was fixed by the newest release. Thanks for opening the issue!