在 jsPlumb 上保存和加载流程图
在 jsPlumb 上保存和加载流程图的最佳方法是什么?
What's the best approach to save and load an flowchart on jsPlumb?
推荐答案
我设法通过简单地将所有元素包含在一个对象数组中来保存图表,其中每个对象都有 source 和 目标节点,x,y坐标.
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.
保存时,只需执行JSON.stringify(whole_object)
,如果加载,则只需JSON.parse()
并手动定位节点并连接它们.
When saving, simply do JSON.stringify(whole_object)
, and if loading, simply JSON.parse()
and manually position the nodes as well as connect them.
相关文章