calculateBBox = (shape, root) => {
  const { x, y } = Geometry.getDOMBBox(root, true) ?? { x: 0, y: 0 };
  const bboxList = shape.boundingBox();

  return bboxList.map((bbox) => {
    const padded = Geometry.padding(bbox, 3);

    return {
      ...padded,
      x: padded.x - x,
      y: padded.y - y,
    };
  });
}
Calculate BBox for the shape
@param {RelationShape} shape
@param {HTMLOrSVGElement} root