JSFiddle - React, Tailwind, and code Playground
HTML
<svg id="root" width="100%" height="650px" >
<g>
<rect id="rec" x="17%" y="120" width="82%" height="150" style="fill:black;">
</g>
</svg>
CoffeeScript
root = document.getElementById('root')
rec = document.getElementById('rec')
point = root.createSVGPoint()
# This is the top-left relative to the SVG element
ctm = rec.getCTM()
console.log point.matrixTransform(ctm)
# This is the top-left relative to the document
ctm = rec.getScreenCTM()
console.log point.matrixTransform(ctm)