fix: implement dash-leaflet #235, address #272#276
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thanks Tobias,
it looks good! I could not test it but hopefully this will be faster to load and easier to navigate.
Now we just need to add a search bar to put the name of the city/weather station the user is looking for ;)
Best,
Giovanni
…________________________________
From: Toby Kramer ***@***.***>
Sent: 21 May 2026 4:35 PM
To: CenterForTheBuiltEnvironment/clima ***@***.***>
Cc: giobetti ***@***.***>; Mention ***@***.***>
Subject: [CenterForTheBuiltEnvironment/clima] fix: implement dash-leaflet #235, address #272 (PR #276)
Hi @FedericoTartarini<https://github.com/FedericoTartarini>,
I implemented #235<#235> as a fix for #272<#272> and the remaining error from #273<#273> where the select page took ages to load. Using Dash-Leaflet and GeoJSON, everything seems to load much faster (at least locally).
This is a PR into development. Test it and see how you like it. I made minor tweaks to the default cluster colors (Sorry, I had to add a CSS file 😜) to match the overall tool UI.
Using this new way of visualizing weather files on the map, along with updating our repository of OneBuilding climate file URLs I did two weeks ago, we’ll have almost double the weather files in Clima with this update (compared to 2022 when we last pulled from OneBuilding).
Note: There are about 18k future weather files for Canada (around 32x per location with different iterations). I added a one-liner to filter them out for now. This issue<#275> describes why. I think at this point this is the best solution to avoid confusion.
Let me know if you have any questions! PR summary below✌🏼
@stefanoschiavon<https://github.com/stefanoschiavon> @giobetti<https://github.com/giobetti>
PR Summary
* Replaced px.scatter_mapbox (Plotly) with dash-leaflet dl.GeoJSON(cluster=True) on the select page. The previous approach serialised all ~100K location markers into a single Plotly figure JSON on every page visit (~50 MB); the new approach serves a static, browser-cached gzip file (~1.5 MB) and renders only the visible clusters at any zoom level (= much, much faster)
* Added scripts/build_locations_geojson.py to pre-process both source files (epw_location.json + one_building.csv) into a single assets/data/locations.geojson.gz. Future-climate scenario files (_Future/ URLs, ~18K rows (Canada only) are excluded for now and will be handled in a dedicated feature.
* As before, all marker tooltips show name, lat/lon, and source for all locations; OneBuilding markers additionally show period, elevation, time zone, 99% Heating DB, and 1% Cooling DB.
* Two marker colours are preserved: purple (#3a0ca3) for EnergyPlus, blue (#4895ef) for OneBuilding.
* I tried to align the cluster colors with overall tool looks
Use
* Select page map loads immediately on / with clustered markers visible
* Zooming in breaks clusters into individual points with correct colours
* Hovering a point shows the full tooltip
* Clicking a point opens the confirmation modal with the location name
* Clicking Yes downloads the EPW and enables all other tabs as before
* Uploading a local EPW file still works
Screenshot.2026-05-21.at.4.11.38.PM.png (view on web)<https://github.com/user-attachments/assets/3f3f8ef0-ea25-43ee-8187-ec9b93cd847b>
________________________________
You can view, comment on, or merge this pull request online at:
#276
Commit Summary
* 9e8febb<9e8febb> fix: implement dash-leaflet #235, address #272
File Changes
(9 files<https://github.com/CenterForTheBuiltEnvironment/clima/pull/276/files>)
* M Pipfile<https://github.com/CenterForTheBuiltEnvironment/clima/pull/276/files#diff-230078d672f10d17463a8a6265cad825b790885898256a3365be90685caac58d> (1)
* M Pipfile.lock<https://github.com/CenterForTheBuiltEnvironment/clima/pull/276/files#diff-a86c67a0a29ed0e95909b9b7c420140f302d17399ee6dcce4e1a51a14d27fd51> (44)
* M app.py<https://github.com/CenterForTheBuiltEnvironment/clima/pull/276/files#diff-568470d013cd12e4f388206520da39ab9a4e4c3c6b95846cbc281abc1ba3c959> (12)
* A assets/cluster.css<https://github.com/CenterForTheBuiltEnvironment/clima/pull/276/files#diff-55a3dc2dd6dd139f4d495f5098af831c8a34d9f29edc88bf5f3ded77d5164550> (6)
* A assets/dashExtensions_default.js<https://github.com/CenterForTheBuiltEnvironment/clima/pull/276/files#diff-fbb2e4ed6775290d624e52d8820d0b7c29506a03d4b0042bf3b28910d9086e36> (33)
* A assets/data/locations.geojson.gz<https://github.com/CenterForTheBuiltEnvironment/clima/pull/276/files#diff-652e15214980322e05cc1bed7062a62d9d051eaeaba3019a6271c2b477bac108> (0)
* M pages/lib/global_element_ids.py<https://github.com/CenterForTheBuiltEnvironment/clima/pull/276/files#diff-4704862b016148d93c4f32f94bb9e94ee2efb23d9576842933c4fac7698482b7> (1)
* M pages/select.py<https://github.com/CenterForTheBuiltEnvironment/clima/pull/276/files#diff-65910ce6ea0cd4bd224cfcd46939d0b3e9db79d419c9e05c2ab9b6fb052be00f> (151)
* A scripts/build_locations_geojson.py<https://github.com/CenterForTheBuiltEnvironment/clima/pull/276/files#diff-71515013efb949b76416ccbd8ebf18fac4f363df2ee5312b21d2b0ac47ed0dc5> (88)
Patch Links:
* https://github.com/CenterForTheBuiltEnvironment/clima/pull/276.patch
* https://github.com/CenterForTheBuiltEnvironment/clima/pull/276.diff
—
Reply to this email directly, view it on GitHub<#276>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AIWZJAE6DBFTUQZ2SARVXXD434H3JAVCNFSM6AAAAACZHZB2VSVHI2DSMVQWIX3LMV43ASLTON2WKOZUGQ4TKNBRGEZDENY>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
|
@t-kramer great work! Greenlight from me. |
Hi @FedericoTartarini,
I implemented #235 as a fix for #272 and the remaining error from #273 where the select page took ages to load. Using Dash-Leaflet and GeoJSON, everything seems to load much faster (at least locally).
This is a PR into
development. Test it and see how you like it. I made minor tweaks to the default cluster colors (Sorry, I had to add a CSS file 😜) to match the overall tool UI.Using this new way of visualizing weather files on the map, along with updating our repository of OneBuilding climate file URLs I did two weeks ago, we’ll have almost double the weather files in Clima with this update (compared to 2022 when we last pulled from OneBuilding).
Note: There are about 18k future weather files for Canada (around 32x per location with different iterations). I added a one-liner to filter them out for now. This issue describes why. I think at this point this is the best solution to avoid confusion.
Let me know if you have any questions! PR summary below✌🏼
@stefanoschiavon @giobetti
PR Summary
Use