Convert coordinates to spot

How do you convert GoJS document coordinates to a Spot?

I’m trying to align my diagram’s position to a certain coordinate like so:

const spot = new Spot(selection.x, selection.y);
diagram.alignDocument(spot, spot);

Selection contains the correct document coordinates, however, the above is not working because Spot expects coordinate values from 0 to 1 only. Thank you in advance for any tips!

I don’t understand what you want. Do you not want to set Diagram.position to selection?

Why do you want a Spot and call Diagram.alignDocument? Spots are relative points within some rectangular area. I don’t know what rectangle you want to use to locate the document contents.