How to Render Complex Tree With Collapsed Child Node in React Diagram?
In our Syncfusion® React 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.
index.js
getNodeDefaults={(node) => {
// Setting isExpand False
if (node.data.Name === 'node12' || node.data.Name === 'node27') {
node.isExpanded = false;
}
return node;
}
Refer the below sample for your reference
Sample: Click here
Conclusion
I hope you enjoyed learning about how to how to render complex tree with collapsed child node in React Diagram.
You can refer to our React Diagram Featuretour feature tour page to know about its other groundbreaking feature representations and documentations.
You can also explore our React Diagram Example to understand how to present 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 React Spreadsheet and other components.
If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!