@uriel wrote:
I am trying to test linking between 2 nodes,
using the robot class I try to link between two ports.Instead of creating the link gojs just move the start node to the position of the other node.
what am I doing wrong?let robot = new GoJsRobot(diagram);
let startNode = diagram.findNodeForKey(SUB_PROCESS_NODE_KEY);
let otherNode = diagram.findNodeForKey(SERVICE_TASK_NODE_KEY);let startPort = startNode.ports.first(); let otherPort = otherNode.ports.first(); let fromPoint = { x: startPort.getDocumentPoint(Spot.Center).x, y: startPort.getDocumentPoint(Spot.Center).y }; let toPoint = { x: otherPort.getDocumentPoint(Spot.Center).x, y: otherPort.getDocumentPoint(Spot.Center).y }; robot.mouseDown(fromPoint.x, fromPoint.y, 0, {}); robot.mouseMove(toPoint.x, toPoint.y, 200, {}); robot.mouseUp(toPoint.x, toPoint.y, 250, {});
Posts: 2
Participants: 2