-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broken graph state after removing node #322
Comments
BTW, same error with edges: In the same 'DAG exampe' notebook, run
Clearly, there is an issue calling |
Hey @ktaletsk, thanks for opening the issue and sorry for taking a while to reply to it. |
Yeah this doesn't look right, thanks for the report. I don't have much bandwidth for this right now but I can get back to this in a couple of weeks :) Feel free to submit a PR to fix this if you get the time before that. |
@marimeireles @MridulS here are some findings upon debugging the issue
With that, I think we should search for an error somewhere in the Jupyter widget.
I tried commenting out setting the model - the first line in the function - and the behavior was better, yet still incorrect. I was able to remove only the requested node from the list, and the state of the graph was as expected - no nodes with incorrectly set "removed: true". However, the widget was not updated automatically and I had to manually rerun the cell with the widget to get the new state. I would like to continue debugging, but I have 2 issues:
|
@marimeireles @MridulS I would like to fix this issue, but I'm stuck. Could you give some feedback on my comment above? |
I have run into this issue as well trying to update ipycytoscape widgets rendered in Jupyter. Removing any single node removes all the nodes rendered in the graph and sets each node to removed=True. Setting the nodes back manually to removed=False does not re-add them. Is there intention to address this bug? |
Bug report
cytoscapeobj.graph.remove_node(node)
removes more nodes than just the node passed as the parameter. This also affectscytoscapeobj.graph.remove_node_by_id(node_id)
which uses it.ipycytoscape/ipycytoscape/cytoscape.py
Lines 287 to 305 in c72f39d
Issues seems to lie specificly in this call:
ipycytoscape/ipycytoscape/cytoscape.py
Line 296 in c72f39d
Code for reproduction
Open 'DAG example' notebook.
Execute all existing cells in order. The graph would look like this
Observe the list of existing nodes
n3
(the bottom-right child node in the left-most graph)The graph now looks like this:
Alternatively, you can remove the node from the list of nodes (which is what
cytoscapeobj.graph.remove_node
does internally) to the same effect:cytoscapeobj.graph.remove_node_by_id('n3')
:Is this the intended behavior?
Actual outcome
Nodes with ids "higher" than node requested to be deleted are getting
removed=True
on them and disappear from the graph.Expected outcome
Maybe it would make more sense to make this optional, and only delete a single node by default?
Version Info
The text was updated successfully, but these errors were encountered: