I need to convert from a javascript click event to the coordinate space of an SVG element. I am currently using techniques like https://stackoverflow.com/a/48354404/995935 , but https://developer.mozilla.org/en-US/docs/Web/API/SVGPoint says that SVGpoint is "no longer recommended" and "may cease to work at any time".
Unfortunately, it does not mention what API should be used to replace it.
How should I rewrite the code sample
function screenToSVG(screenX, screenY) {
var p = svg.createSVGPoint()
p.x = screenX
p.y = screenY
return p.matrixTransform(svg.getScreenCTM().inverse());
}
to avoid deprecated APIs?