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. The coordinates returned are with respect to the current SVG space (after the application of all geometry attributes on all the elements contained in the target element).

MDN Reference