本文介紹了在 jsPlumb 上保存和加載流程圖的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
在 jsPlumb 上保存和加載流程圖的最佳方法是什么?
What's the best approach to save and load an flowchart on jsPlumb?
推薦答案
我設法通過簡單地將所有元素包含在一個對象數(shù)組中來保存圖表,其中每個對象都有 source 和 目標節(jié)點,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.
保存時,只需執(zhí)行JSON.stringify(whole_object)
,如果加載,則只需JSON.parse()
并手動定位節(jié)點并連接它們.
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 上保存和加載流程圖的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!