在jsPlumb上保存并加载流程图 [英] Save and load a flowchart on jsPlumb

查看:494
本文介绍了在jsPlumb上保存并加载流程图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

jsPlumb 上保存和加载流程图的最佳方法是什么?

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

推荐答案

我设法通过简单地将所有元素放在一个对象数组中来保存图表,其中每个对象都有目标节点,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.

这篇关于在jsPlumb上保存并加载流程图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆