-
Hi and big thanks to Max for creating this project! In this article Max says to clear out and reload a graph (which is necessary to do if the new graph has some of the same element IDs as the old one), the thing to do is: But I've noticed (at least on the latest versions of Chrome and Safari) doing that seems to trigger this old chestnut of a bug: #1511 (exact same symptoms: only some of the pictures show up; if you click on the node it makes the other show up--but then some of the originals disappear). You can always fix it by calling something like: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Could you put together a small demo of your issue? There’s a jsbin demo that you can fork to easily put something together
http://jsbin.com/fiqugiq
… On Sep 9, 2021, at 7:19 AM, Suges ***@***.***> wrote:
Hi and big thanks to Max for creating this project!
In this <https://stackoverflow.com/questions/35770055/replace-all-elements-and-redraw-graph-softly-in-cytoscape-js> article Max says to clear out and reload a graph (which is necessary to do if the new graph has some of the same element IDs as the old one), the thing to do is: cy.elements().remove(); cy.add( newEleJsons );.
But I've noticed (at least on the latest versions of Chrome and Safari) doing that seems to trigger this old chestnut of a bug: #1511 <#1511> (exact same symptoms: only some of the pictures show up; if you click on the node it makes the other show up--but then some of the originals disappear).
You can always fix it by calling something like: const x = cy.json(); cy.json({ elements: x });, but I thought I'd just bring it up here if anyone's interested.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#2920>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAHRO43SPCJQ4LWO64HT753UBCJ3JANCNFSM5DW4VP6Q>.
|
Beta Was this translation helpful? Give feedback.
-
I think I actually just squashed the bug while getting ready to transfer it to jsbin. I accidentally had two event listeners on my "load a drawing" button; I think we're good here, thanks for your response! |
Beta Was this translation helpful? Give feedback.
I think I actually just squashed the bug while getting ready to transfer it to jsbin.
I accidentally had two event listeners on my "load a drawing" button;
cy.elements().remove(); cy.add( newEleJsons )
was getting triggered twice in rapid succession. Since I removed the second trigger Cytoscape settled right down.I think we're good here, thanks for your response!