Call applyIncrementalJson using manually generated string

Based on the GoJS document, I understand that most time model.applyIncrementalJson is called after model.toIncrementalJson and use the JSON-formatted string generated from it.

My question is: can we call model.applyIncrementalJson directly with some manually crafted string without calling model.toIncrementalJson? For example, I want to add 3 nodes, instead of calling model.addNodeData 3 times, can I put them into a JSON-formatted string and call model.applyIncrementalJson? Is it a valid use case? If yes, do you have any documentation on the format and allowed attributes of the incrementalJson string?


It might be valid, but it really isn’t desired, and it certainly would be less efficient than making the changes directly.

For your suggested scenario, you could do as you suggest and call Model.addNodeData three times. Or you could call Model.addNodeDataCollection once, passing it an Array with the three new node data objects. Either is about the same speed.

Hi Walter, thanks for your confirmation. Really appreciate your time!