Я не совсем уверен, о чем вы просите, но вы использовали класс Robot для имитации пользовательского ввода?https://gojs.net/latest/extensions/Robot.html
// a shared Robot that can be used by all commands for this one Diagram
robot = new Robot(myDiagram); // defined in Robot.js
Затем можно выполнить такие операции, как:
function clickLambda() {
var lambda = myDiagram.findNodeForKey("Lambda");
if (lambda === null) return;
var loc = lambda.location;
// click on Lambda
robot.mouseDown(loc.x + 10, loc.y + 10, 0, { });
robot.mouseUp(loc.x + 10, loc.y + 10, 100, { });
// Clicking is just a sequence of input events.
// There is no command in CommandHandler for such a basic gesture.
}
или:
function dragFromPalette() {
// simulate a drag-and-drop between Diagrams:
var dragdrop = { sourceDiagram: myPalette, targetDiagram: myDiagram };
robot.mouseDown(5, 5, 0, dragdrop); // this should be where the Alpha node is in the source myPalette
robot.mouseMove(60, 60, 100, dragdrop);
robot.mouseUp(100, 100, 200, dragdrop); // this is where the node will be dropped in the target myDiagram
// If successful in dragging a node from the Palette into the Diagram,
// the DraggingTool will perform a transaction.
}