Hi Ahman,
The ConnectorCollectionChanged event has been triggered while establishing the connection between the nodes. When the ConnectorCollectionChanged event’s state is in “changed”, you can create/update the labels for the nodes. Please refer to the below code example.
Code example:
function connectorCollectionChange(args) {
if (args.state === "changed" && args.changeType === "insert") {
if (args.element.labels.length > 0) {
diagram.updateLabel(args.element.name, args.element.labels[0], { text: "connector1" });
} else {
diagram.updateLabel(args.element.name, { text: "connector1" });
}
}
}
Regards,
Naganathan K G