2

I would like to have a button to save and one to restore my graph manipulated. I have tested this code but it doesn't work. Can you help me please? I would like to save and restore in differents moments of the graph.

$("#clickMe").click(function () {
    var jsonBlob = new Blob([ JSON.stringify( cy.json() ) ], { type: 'application/javascript;charset=utf-8' });    
saveAs( jsonBlob, 'graph.json' );
});    
Mr K
  • 21
  • 1
  • Hi Mr K, what exactly didn't work for you? This looks like the code from [this](https://stackoverflow.com/questions/39168928/cytoscape-save-graph-as-image-by-button) question, which apparently worked. Please consider adding more information about what went wrong for you. Thanks – Stephan T. Feb 21 '19 at 06:48
  • Also, do you want to restore the graph from another session in the browser (open new window with cy -> build graph -> save -> close window -> open new window with cy -> restore old graph) or just from the same session(open new window with cy -> build graph -> save -> change graph -> restore old graph)? – Stephan T. Feb 21 '19 at 07:08

0 Answers0