Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Save and load a flowchart on jsPlumb

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

like image 529
Diogo Cardoso Avatar asked Sep 13 '11 17:09

Diogo Cardoso


1 Answers

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.

like image 91
lukas.pukenis Avatar answered Sep 29 '22 22:09

lukas.pukenis