How can i reverse engineer a Diagram in GoJs?

For example, i have created a hand drawn shape and i want to extract the figure array along with the locations of the nodes, how can i do something like that?

{ "position": "0 0", "model": { "class": "go.GraphLinksModel", "nodeDataArray": [ {"loc":"183 148", "category": "PolygonDrawing", "geo":"F M0 145 L75 2 L131 87 L195 0 L249 143z", "key":-1} ], "linkDataArray": [ ] } }

Do you still have a question, or was calling Model.toJson sufficient for your needs?

Alternatively, you can look at all of the Diagram.nodes and Diagram.links and extract what you need.