我正在尝试评估rappid库是否允许我创建我的图表,将其保存为JSON格式,然后从同一格式重新加载它,以便稍后在不更改布局的情况下查看和编辑。任何使用过这个库的人提供的任何建议/技巧都将不胜感激。https://resources.jointjs.com/docs/jointjs/v1.1/joint.html#dia.Graph.JSON未指定此https://www.jointjs.com/#Rappid-More-Info
发布于 2017-08-09 15:53:12
graph.fromJSON
/ graph.toJSON
就是你要找的。
var jsonString = JSON.stringify(graph)
// ... send jsonString to the server,
// store it to the localStorage or do whatever you want
// ... later on
graph.fromJSON(JSON.parse(jsonString))
https://stackoverflow.com/questions/45567912
复制相似问题