Articles in this section
Category / Section

How to Customize Size of Expand/Collapse Icon in Angular Diagram?

2 mins read

The Angular Diagram allows to expand/collapse the subtrees of a layout. The node’s isExpanded property allows you to expand/collapse its children. The following code example shows how to expand/collapse the children of a node.
The icon for expand and collapse can be customized by setting the shape property to one of the following options: “None,” “Plus,” “Minus,” “ArrowUp,” “ArrowDown,” “Path,” or “Template.” To increase the size of the icon, you can adjust the height and width properties of the expand/collapse icon.

public getNodeDefaults(obj: NodeModel | any, diagram: Diagram): NodeModel {
   obj.expandIcon = {
     height: 20,
     width: 20,
     shape: 'Minus',
     fill: 'lightgray',
     offset: {
       x: 0.5,
       y: 0.85,
     },
     borderWidth : 3,
   };
   obj.collapseIcon.offset = {
     x: 0.5,
     y: 0.85,
   };
   obj.collapseIcon.height = 20;
   obj.collapseIcon.width = 20;
   obj.collapseIcon.shape = 'Plus';
   obj.borderColor = 'white';
   obj.backgroundColor = '#6BA5D7'; 
   obj.style = {
     fill: 'transparent',
     strokeWidth: 2,
   };
   return obj;
 }

Sample: https://stackblitz.com/edit/github-dayb7m-nc3scy?file=src%2Fapp.component.ts,index.html

Conclusion
I hope you enjoyed learning how to customize size of expand/collapse icon 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)
Please  to leave a comment
Access denied
Access denied