cytoscape / cytoscape.js

Graph theory (network) library for visualisation and analysis
https://js.cytoscape.org
MIT License
10.02k stars 1.64k forks source link

Connected edge not rendered after hiding and showing node with `display: none` #3070

Closed drauggres closed 10 months ago

drauggres commented 1 year ago

Environment info

Current (buggy) behaviour

When you hide nodes with style('display', 'none') and show them again with style('display', 'element') sometimes not all edges are rendered.

Note: If you move node with invisible edge it will trigger edge rendering and edge will become visible.

Desired behaviour

After hiding and showing nodes all connected edges should become visible.

Minimum steps to reproduce

What do you need to do to reproduce the issue?

https://jsbin.com/tucolapoqi

Attention to the bottom edge: from "ladybug" to "aphid".

UPD: Also you can reproduce same behavior by doing it in sequence:

For reviewers

Reviewers should ensure that the following tasks are carried out for incorporated issues:

maxkfranz commented 1 year ago

Thanks, @drauggres, for your reproducible demo. One thing that may help to expedite things would be to update your demo so that it could be done in manual steps, so that each step could be inspected.

Buttons that run each step, like these, would help:

drauggres commented 1 year ago

Thanks, @drauggres, for your reproducible demo. One thing that may help to expedite things would be to update your demo so that it could be done in manual steps, so that each step could be inspected.

Buttons that run each step, like these, would help:

  • (1) hide "bird"
  • (2) hide "ladybug"
  • (3) show "bird"
  • (4) show "ladybug"

Done. ~https://jsbin.com/pikuwamuve/edit?html,css,js,output~

UPD: https://jsbin.com/moqoboveri/1/edit Steps to reproduce:

  1. click "hide bird"
  2. click "hide ladybug"
  3. click "show bird"
  4. click "show ladybug"
  5. BUG: the "ladybug -> aphid" edge is not visible
  6. (optional) click "hide bird" and buggy edge will appear
stale[bot] commented 1 year ago

This issue has been automatically marked as stale, because it has not had activity within the past 14 days. It will be closed if no further activity occurs within the next 7 days. If a feature request is important to you, please consider making a pull request. Thank you for your contributions.

maxkfranz commented 1 year ago

@mikekucera, I've tagged you on this like we discussed. This might also be related to the sorted z-order draw cache that you worked with in the other issue.