How to Render Tree with Collapsed Child Nodes in Angular Diagram?
In our Syncfusion® Angular Diagram, layout nodes can be both expanded and collapsed. By default, child nodes are expanded. If you want to display a complex hierarchical tree with child nodes collapsed, set the parent node’s isExpanded property to false.
app.component.ts
public getNodeDefaults(node: NodeModel): NodeModel{
// Setting isExpand False
if (
(node.data as any).Name === 'node12' ||
(node.data as any).Name === 'node27'
) {
node.isExpanded = false;
}
return node;
}
Refer to the below sample for your reference
Sample: Click here
Conclusion
I hope you enjoyed learning about how to render tree with collapsed child nodes 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!