<DiagramComponent
//DragEnter event.
dragEnter={(args) => {
let obj = args.element;
//check whether is a node
if (obj instanceof Node) {
//change the node annotation.
obj.annotations = [{
content: 'NewNode'
}]
obj.style = { fill: "#357BD2", strokeColor: "white" };
}
//check whether is a node
if(obj instanceof Connector) {
//change the connector properties
obj.style.strokeColor="red";
obj.constraints= ConnectorConstraints.Default &~ ConnectorConstraints.Drag;
}
}}
/> |