Skip to content

Implement fixed heatmap legend range for issue #224#255

Merged
FedericoTartarini merged 3 commits intoCenterForTheBuiltEnvironment:developmentfrom
LeoLuosifen:Kira_Liu
Oct 14, 2025
Merged

Implement fixed heatmap legend range for issue #224#255
FedericoTartarini merged 3 commits intoCenterForTheBuiltEnvironment:developmentfrom
LeoLuosifen:Kira_Liu

Conversation

@Kira-Liu00
Copy link
Contributor

Summary

This PR addresses and resolves open issue #224 (Dynamic heatmap legend in Natural Ventilation tab). In the previous implementation, the heat map color scale range(legend) dynamically changes with filters, leading to poor comparability and increased cognitive load. The current modification calculates and fixes the color scale range based on the full-year data, explicitly passing it to the plotting function to ensure consistent color meaning across different filter conditions, thereby improving comparability and user experience.

Changes

  • Preserve a full-year data copy before applying filters and pre-compute the annual zmin/zmax for the target variable.
  • Explicitly pass the fixed range to the Heatmap and remove the logic of recalculating the range after filtering, in order to prevent the legend from shifting.
  • Added/refactored helper methods for retrieving full-year data and variable ranges (e.g., get_full_year_df() / unified get_max_min_value()), to avoid redundant calculations.
  • Standardized range conversion and anchor handling under SI/IP units (using 0-30°C / 32–86 °F as lower/upper anchors when necessary) to ensure consistent representation across locations.
  • Modified the heatmap/heatmap_with_filter interface to support passing in a zmin/zmax from external calls.

WechatIMG629
截屏2025-10-08 下午3 23 37

@coderabbitai
Copy link

coderabbitai bot commented Oct 8, 2025

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.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@Kira-Liu00 Kira-Liu00 marked this pull request as ready for review October 8, 2025 05:38
@Kira-Liu00
Copy link
Contributor Author

Hi @FedericoTartarini - This PR addresses #224 Dynamic heatmap legend in Natural Ventilation tab. When you have a moment, could you please review? Thank you!

@Kira-Liu00
Copy link
Contributor Author

Hi @FedericoTartarini - Just wanted to check — if there’s no issue with the latest pull request, would it be fine to merge it? Of course, please let us know if you’d like us to make any additional changes before merging.

@FedericoTartarini
Copy link
Contributor

FedericoTartarini commented Oct 14, 2025

I am very sorry I forgot to approve the request. I have just run the checks and they are not passing because the code is not formatted properly. Could you please implement that and then I will accept the request?

@FedericoTartarini FedericoTartarini merged commit adc5764 into CenterForTheBuiltEnvironment:development Oct 14, 2025
3 checks passed
@Kira-Liu00
Copy link
Contributor Author

Hi, @FedericoTartarini - We have already done the ruff check. Could you please take a check when you have a moment?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants