Suppose I have a interface to drag, drop and connect nodes like in http://www.gojs.net/latest/samples/pageflow.html. And the use have added some of the new nodes to the diagram.
Then is it possible to serialize the diagram that is customized by the user to JSON?
Yes, call the model.toJson method: http://www.gojs.net/latest/api/symbols/Model.html#toJson
var jsonData = myDiagram.model.toJson();
To load the same json call, fromJson() http://www.gojs.net/latest/api/symbols/Model.html#.fromJson
var newModel = Model.fromJson(jsonData);
Jonathan is basically right.
But when loading I don’t know if you can call a static method as if it were on an instance. I think you need to do what the samples and documentation do:
myDiagram.model = go.Model.fromJson(jsonData);
Oops, my bad sorry. Forgot the namespace!
Is it possible to store node positional information too?