Exporting and importing JSON data to Cytoscape.js
Based on this question and answer , I've made this JSFiddle . What I'm trying to do is to find a way to properly export / import JSON data to cytoscape.js. I'm using JSON.stringify(cy.json()) to get JSON data from elements, and on the other hand I'm cleaning the cy area and using cy.add(text-input) to add the elements back. I.e.: you can add a node, copy it's JSON data generated, then you can refresh the browser and paste the JSON data from node directly, tryng to add it to cy . But I couldn't get this to work, and I can't really figure out where I'm wrong (probably using the cy.add function).