DiagramBuilder.toJSON()
returns a JSON representation of the diagram. How can I use this JSON object to create a new DiagramBuilder
with the same diagram?
You can pass the jsonData.nodes
to the fields
attribute of the DiagramBuilder
:
var diagramBuilderJSON = diagramBuilder.toJSON();
new A.DiagramBuilder({ fields : diagramBuilderJSON.nodes }).render();