diff --git a/src/seismic_hazard_forecasting.py b/src/seismic_hazard_forecasting.py index 55a2807..0d00306 100644 --- a/src/seismic_hazard_forecasting.py +++ b/src/seismic_hazard_forecasting.py @@ -536,6 +536,11 @@ verbose: {verbose}") meta_elem = ET.SubElement(root, "metadata") meta_elem.text = json.dumps(bbox_dict) + # (Optional) Also store the bounding box as a data attribute for quick access + root.set("data-bbox", json.dumps(bbox_dict)) + tree.write(svg_path, encoding="utf-8", xml_declaration=True) + logger.info(f"Embedded bbox into {svg_path} → {bbox_dict}") + # ----------------------------------------- # END Inject bounding box (BBOX) metadata into the SVG # -----------------------------------------