Skip to content

fix: implement dash-leaflet #235, address #272#276

Open
t-kramer wants to merge 3 commits into
developmentfrom
dash-leaflet-implementation
Open

fix: implement dash-leaflet #235, address #272#276
t-kramer wants to merge 3 commits into
developmentfrom
dash-leaflet-implementation

Conversation

@t-kramer
Copy link
Copy Markdown
Contributor

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

  • 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

@t-kramer t-kramer added the enhancement New feature or request label May 21, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7e2a3883-306b-4fb9-8c86-e0a06e096327

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dash-leaflet-implementation

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@giobetti
Copy link
Copy Markdown
Contributor

giobetti commented May 21, 2026 via email

@stefanoschiavon
Copy link
Copy Markdown

@t-kramer great work! Greenlight from me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants