Articles in this section

How to exclude node from layout and position it in Angular Diagram?

In Syncfusion® Angular Diagram, when arranging nodes using a layout algorithm, there might be situations where you want certain nodes to be positioned manually rather than being automatically arranged by the algorithm. To achieve this, you can set the excludeFromLayout property to true for the nodes you wish to position manually. This will prevent the layout algorithm from affecting their placement.

To get started, you need to define created event in the diagram, then set the excludeFromLayout property to true for each node you want to position manually. Finally, specify the desired offset values for those nodes to control their exact placement.

public created() {
 for (var i = 0; i < this.diagram.nodes.length; i++) {
   var node = this.diagram.nodes[i];
   if ((node.data as any).Name === 'Robert') {
     //Excludes node from layout
     node.excludeFromLayout = true;
     node.offsetX = 150;
     node.offsetY = 150;
   }
 }
} 

You can find a working example of this implementation on StackBlitz in the provided link: Click here for sample

Conclusion

I hope you enjoyed about how to exclude node from layout and position it in Angular Diagram. You can refer to our Angular Diagram feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our Angular Diagram example to understand how to create and manipulate data. For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls. If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied