Hi Bassel,
On further analysis of your query, we suspect that you need to prevent the refreshing of the nodes, when modifying the layout data source and calling diagram.refresh() or doLayout methods. The nodes will be rearranged based on the modified datasource to perform layouting, this is the default behavior of the diagram. We have created a sample to add data into the existing datasource and while calling the diagram.refresh() method, only the newly added data will get added into the nodes. All the other nodes will be repositioned on the previous position. We have attached the sample link for your reference.
If we misunderstood your requirement, please share more details or replicate the issue in the shared sample. This will be helpful for us to proceed further.
Regards,
Sivakumar