[Feature request] Enable persistance in Cytoscape component
Description
Persistence is now being integrated into dash core components, https://dash.plotly.com/persistence. This would be a very useful feature in Cytoscape when dealing with multi-page dash applications. Seems to be small additions to the code, as explained in "For component developers" section on the dash web-page.
That sounds pretty interesting! I'm looking at the PR (https://github.com/plotly/dash-core-components/pull/854) and I'm wondering which props we will want to extract and apply. Other than elements, what would you suggest?
@ManInFez I'll try to work on a PR adding that feature once I have a better understanding, but I can't think of a good demo for showcasing/testing persistence. Is there a specific app you have in mind? If so I'd be happy to review & merge a PR if you are interested in adding it to the demos!
I have a multipage app which uses cytoscape as as a selection-widget for the overarching data objects. When switching pages, the selection is lost. It can be partially mitigated by using the Store-component, but since the selectedNodeData component in cytoscape is missing the nodes where selected=True on creation, it is a bit lacking. Also, it complicates the callback structure and creates more data traffic than necessary.
I can try to get a smaller demo set up, to test on :)
Hmm, I guess i'll start with elements, stylesheet and layout in this case.
Here is a test-case https://github.com/plotly/dash-cytoscape/pull/121 @xhlulu