We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Custom layout setup

I'm saving and loading diagram from json using diagram.saveDiagram() and load it diagram.loadDiagram()
When I put the node, click save, and then reload diagram, my nodes are alligned in Hierarchical layout, but I wan't to load nodes at that position they are dropped,
Refered to  this page Automatic Layout and didn't find tips, how to setup this.
Can you provide some example to save node's positions without aligning after diagram loaded from json?

3 Replies

SG Shyam G Syncfusion Team December 2, 2019 12:20 PM UTC

Hi Alex, 
 
We don’t have option to retain the node position in layout while serializing the diagram. We will validate it further and update you with more details soon. 
 
Regards, 
Shyam G 



SG Shyam G Syncfusion Team December 4, 2019 02:43 PM UTC

Hi Alex, 
 
We have logged “Nodes position is not retained in the layout while serializing the diagram” as a defect. The fix for this issue is estimated to be available on 11th December, 2019. 
 
You can track the status of the issue from the below feedback link.  
 
 
 
Regards, 
Shyam G 



SG Shyam G Syncfusion Team December 11, 2019 09:41 AM UTC

Hi Alex,  
 
Reported Issue: Nodes position is not retained in the layout while serializing the diagram. 
   
We are glad to announce that our patch release (v17.3.34) is rolled out successfully and In that release, we have added the fix for reported issue.       
 
Please upgrade to the latest version packages to resolve this issue.       
 
We should set layout type as None before loading the diagram to resolve your issue. Please refer to a code example below. 
 
Code example: 
 let saveloaddata= diagram.saveDiagram();
        saveloaddata=  JSON.parse(saveloaddata);
        saveloaddata.layout.type = "None";
        saveloaddata= JSON.stringify(saveloaddata)
        diagram.loadDiagram(saveloaddata);
 
 
 
 
Regards,  
Shyam G  


Loader.
Live Chat Icon For mobile
Up arrow icon