How to Customize Size of Expand/Collapse Icon in Angular Diagram?
This article explains how to customize the size of the Expand/Collapse icon in an Angular Diagram. The Angular Diagram allows you to expand or collapse the subtrees of a layout. The node’s isExpanded property enables you to expand or collapse its children. The following code example demonstrates how to expand or 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;
}
Refer to the working sample for additional details and implementation: Sample
Conclusion
We hope you enjoyed learning how to customize the size of the 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, BoldDesk Support, or feedback portal. We are always happy to assist you!