Sync Diagram Properties

I have a functionality to export diagram data to json file and re load the diagram into browser by importing the previously exported json data.

Added new properties to diagram after exporting the data to file. Now new properties are not shown in loaded diagram, if I import the previously exported json file.

Is there a way to automatically sync the diagram properties or Do I need to add the properties by writing a custom logic.

If you are talking about properties of the Diagram class, or of some Tool class or CommandHandler or AnimationManager, then yes you need to write code to handle those explicitly. That’s because those classes do not support data binding.

You could pattern your code after what the Draggable Link sample does, Draggable Link. It adds some code to save state to the Model.modelData object just before calling Model.toJson, and then restores that state just after replacing the Diagram.model with the result of Model.fromJson.