This plugin provides the ability to convert a jsPlumb diagram into a Json & vice-versa. Hence, providing the ever missing feature of persistence in jsPlumb.
This plugin adds the following methods, to the jsPlumb global variable :
- save(options,plumbInstance) //Returns a Javascript Object
where options contains the following :
1. selector (required) - a valid jquery selector to select the nodes/blocks associated with the connection
- load(options, plumbInstance)
where options contains the following :
1. savedObj (required) - the javascript object that is saved
2. containerSelector (required) - a valid jquery selector pointing to the container in which the diagram is to be loaded
The plugin saves the graph connection details, anchors, overlays & style.
var savedObj = jsPlumb.save({selector : ".window" }); //If no plumbInstance is passed then global jsPlumb variable is used
jsPlumb.load({savedObj : savedObj, containerSelector : "#kitchensink-demo"}); //If no plumbInstance is passed then global jsPlumb variable is used
Note:Please make sure to load this plugin, after jsPlumb is loaded.