Copy Selected Nodes and Links and Add them to new Diagram

Like to ‘export’ a collection of links and nodes from one diagram and ‘import’ this collection into a new diagram.

I currently can save JSON into a DB (using MongoDB) and then retrieve JSON without issue (complete node/link arrays) - but this is for only one diagram at a time.

What I hope to do, however, is too allow users to create ‘templates’ of nodes and links and then import these saved JSON templates into other diagrams (I am using the state chart: State Chart ).

Hope this makes sense. I want the ability to save layouts and then add each of these layouts into one larger layout/diagram. What is the best way to accomplish this?

Instead of replacing the Diagram’s model, why don’t you just add the collection of nodes and links to an existing Diagram? You might want to use a second Diagram and call Diagram.copyParts.