getBBox

fun getBBox(options: SVGBoundingBoxOptions = definedExternally): DOMRect(source)

The SVGGraphicsElement.getBBox() method allows us to determine the coordinates of the smallest rectangle in which the object fits.

MDN Reference