Gojs coordinate system (Cypress automation)

im using cypress automation testing where i have a use case, i drop the node from toolbar to the gojs canvas.
I need to check a test case wether the drop is being made to right coordinate.
In test case i mention, the pageX and pageY, to drop the node, but i need to convert that to pageX and PageY to canvas coordinates and check, How do we do it?

Here x and y are the mouse event pageX and PageY in canvas. (following is cypress code)

  cy.get("div").trigger("mousemove", {x:50,y:50}).click(50, 50);

The test case need to check whether, it actual exists in canvas or not, so i need to convert x and y coordinate to canvas coordinate.

Have you looked at the dragover event handler code in this sample? HTML Drag and Drop, and external Clipboard pasting

Hi Walter, i was using Robot

  cy.window().then((win) => {
      const loc = myDiagram.transformDocToView(pageX,pageY);   //throws error 

I need to use the loc for further processing

myDiagram contains the script from robotjs mentioned in the below link
Reference from: Simulating Input Events

I’m I doing wrong?

Diagram | GoJS API
takes and returns a Point