From cce0cd258dbc1d78bedd00a66f530c7d1ef8e2d7 Mon Sep 17 00:00:00 2001 From: Mieszko Makuch Date: Wed, 7 May 2025 12:59:21 +0200 Subject: [PATCH] ISEPOS-2373 Also store the bounding box as a data attribute for quick access --- src/seismic_hazard_forecasting.py | 5 +++++ 1 file changed, 5 insertions(+) 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 # -----------------------------------------