Save and load a flowchart on jsPlumb

Diogo Cardoso picture Diogo Cardoso · Sep 13, 2011 · Viewed 12.1k times · Source

What's the best approach to save and load an flowchart on jsPlumb?

Answer

lukas.pukenis picture lukas.pukenis · May 27, 2012

I managed to save the chart by simply having all the elements inside an array of objects, where each object has source and target nodes, x, y coordinates.

When saving, simply do JSON.stringify(whole_object), and if loading, simply JSON.parse() and manually position the nodes as well as connect them.