mxGraph - Displaying a diagram by loading a XML

前端 未结 2 365
闹比i
闹比i 2021-01-28 04:15

With the help of How to get the XML from mxGrpah diagram? able to get the dynamic XML from the graph editor. Now, I need to display the diagram by loading a XML (reverse algorit

2条回答
  •  我在风中等你
    2021-01-28 04:52

    Many thanks @NickAth, Also, I tried my own analysis found that the following solution is working fine.

    var xml = {xml};
    var ui = new EditorUi(new Editor());
    var doc = mxUtils.parseXml(xml);
    ui.editor.setGraphXml(doc.documentElement);
    

提交回复
热议问题