JSFiddle - React, Tailwind, and code Playground

HTML

<svg with="200" height="200">
    <g id="my_group">
        <rect id="my_rect" x="50" y="50" width="100" height="100" transform="rotate(45 100 100)"/>
    </g>
</svg>

JavaScript

var rect=document.getElementById("my_rect");
console.log("rect=",my_rect.getBBox());

var group=document.getElementById("my_group");
console.log("group=",my_group.getBBox());