<DiagramComponent id="diagram"
ref={diagram => (diagramInstance = diagram)} width={"100%"} height={"640px"}
connectionChange={(args)=> {
args.cancel =true;
if(eventName === 'sourcePointChange') {
args.connector.sourcePoint = startPoint;
} else if(eventName === 'targetPointChange'){
args.connector.targetPoint = startPoint;
}
}}
//event triggered while moving connector sourcePoint
sourcePointChange={(args)=> {
if(args.state === 'Start') {
eventName = args.name;
startPoint = args.newValue;
}
}}
targetPointChange={(args)=> {
//event triggered while moving connector targetPoint
if(args.state === 'Start') {
eventName = args.name;
startPoint = args.newValue;
}
}}
>
</DiagramComponent> |
mouseEnter={args => {
if (args.actualObject && !args.actualObject.segments) {
ischange = false;
}
}}
mouseLeave={args => {
ischange = true;
}}
sourcePointChange={args => {
if (args.state === "Start" && ischange) {
eventName = args.name;
startPoint = args.newValue;
}
}}
targetPointChange={args => {
//event triggered while moving connector targetPoint
if (args.state === "Start" && ischange) {
eventName = args.name;
startPoint = args.newValue;
}
}} |