How to Customize Size of Expand/Collapse Icon in Vue Diagram?
The Vue Diagram allows you to expand/collapse the subtrees of a layout. The node’s isExpanded
property enables you to expand/collapse its children. The following code example demonstrates 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.
const getNodeDefaults={(obj) => {
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/ewzla7-xexkzw?file=src%2FApp.vue
Conclusion
I hope you enjoyed learning how to customize the size of the expand/collapse icon in the Vue Diagram.
You can refer to our Vue Diagram feature tour page to learn about its other groundbreaking feature representations and documentation, and how to quickly get started with configuration specifications. You can also explore our Vue 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!