JSFiddle - React, Tailwind, and code Playground

HTML

<svg width="500" height="500">
    <g id="g1">
        <circle id="c1" r="100" fill="red"></circle>
        <rect id="r1" width="50" height="50" fill="green">   </rect>
    </g>
</svg>

JavaScript

var circle =document.getElementById('c1');
var rect = document.getElementById('r1');
var group = document.getElementById('g1');

var BBox = rect.getBBox();

BBox.setAttribute('x',-(BBox.width/2));
BBox.setAttribute('y',-(BBox.height/2));

rect.setAttribute('transform','scale(2)');
circle.setAttribute('transform','scale(1)');
group.setAttribute('transform','translate(200,150)');