How to add custom properties to the node in JavaScript Diagram?
TheaddInfo
property of the node allows you to store additional information for that particular node in JavaScript Diagram.
Please refer to the following code example demonstrating how to add a custom property to a node using addInfo
:
var nodes = [
{
id: 'node 1', offsetX: 300, offsetY: 250,height:100,width:100,
addInfo: [
{
version: 'node1',
capacity: 'abcd'
}],
annotations: [{ content: 'SDLC' }],
style:{fill:'#6BA5D7'}
},
{
id: 'node2', offsetX: 150, offsetY: 250,height:100,width:100,
addInfo: [
{
version: 'node2',
capacity: 'xyz'
}
],
annotations: [{ content: 'Support' }],
style:{fill:'#6BA5D7'}
},
];
The following Sample shows how to add custom property to nodes.
Conclusion
I hope you enjoyed learning about how to add custom properties to the node in JavaScript Diagram.
You can refer to our JavaScript 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 JavaScript 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!