Note that it does not handle any cycles in the membership relationships, nor does it handle dynamic modifications of such relationships. The latter could be implemented, but if you need it I’m leaving that up to you.
Why would you want to modify some JSON-formatted text, when you really should be modifying the Diagram.model? Or did you mean that you modified the JSON text and then reloaded the whole model and set Diagram.model?
If you aren’t creating a new Model and setting Diagram.model, don’t forget to execute a transaction.
This is my insertNode method which works fine and adds node in the model, but same is not reflected on canvas.
Things work fine if i don’t use customLayout i.e. Comment the line below in code
<span =“Apple-tab-span” style=“white-space:pre”> layout: goMake(CustomLayout),
Please let me know if i am missing something in the implementation.
My aim is to insert a new node while using Custom Layout.
Did you notice the additional code in the load() function that updated the _members and _supers properties on the data? I think you need to adapt that code so that when you add or remove a node data object those data properties are updated throughout the model data.