stiemannkj1 stiemannkj1 - 1 year ago 75
Javascript Question

How can I create a AlloyUI DiagramBuilder from the JSON returned by DiagramBuilder.toJSON()?

returns a JSON representation of the diagram. How can I use this JSON object to create a new
with the same diagram?

Answer Source

You can pass the jsonData.nodes to the fields attribute of the DiagramBuilder:

var diagramBuilderJSON = diagramBuilder.toJSON();
new A.DiagramBuilder({ fields : diagramBuilderJSON.nodes }).render();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download