Skip to content

Conversation

@elvbom
Copy link
Contributor

@elvbom elvbom commented Nov 12, 2025

✨ What’s Changed?

Add KPIs meets Paris and emissions to regions.

  • Add hooks and utils for regional KPIs
  • Fetch data from regional KPI endpoint instead of all regional data (incl data that is not used on ranked page)
  • Allowing for translations in map components for different entity types

Depend on Klimatbyran/municipality-data-pipeline#56 and Klimatbyran/garbo#1028

📸 Screenshots (if applicable)

Before
Screenshot 2025-11-12 at 16 33 04

After
Screenshot 2025-11-12 at 16 33 14

📋 Checklist

  • PR title starts with [#issue-number]; if no issue is applicable use: [fix], [feat], [prod], or [copy]
  • I've verified the change runs locally both on mobile and desktop
  • I've set the labels, issue, and milestone for the PR
  • [OPTIONAL] I've created sub-tasks or follow-up issues as needed (check if NA)

Closes #1083

@elvbom elvbom added the enhancement New feature or request label Nov 12, 2025
@elvbom elvbom marked this pull request as ready for review November 17, 2025 12:54
@elvbom elvbom added this to the X. Add regions milestone Nov 22, 2025
@elvbom elvbom moved this to In review in Klimatkollen main Nov 22, 2025
Copy link
Contributor

@kaylawoodbury kaylawoodbury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are looking great! 😄 🙌

The only thing I noted was a couple places where we could move the map specific colouring to use the utils.

@@ -1,4 +1,4 @@
export const MUNICIPALITY_MAP_COLORS = {
export const MAP_COLORS = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a util for colour gradients, I'm wondering if it makes sense to keep them together so the different rankings pages can all reference them regardless of the diagram/chart being use?

return value === true ? gradientEnd : gradientMidLow;
}

const mean = values.reduce((sum, val) => sum + val, 0) / values.length;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, I tried to extract this into a util called createStatisticalGradient() in the colorGradient.ts file for the company rankings, do you think it would work to use the same util for the map view as well?

@elvbom
Copy link
Contributor Author

elvbom commented Dec 2, 2025

Thanks for the feedback @kaylawoodbury ! Updated map and legend to use color gradients functions as well as moved default gradient colors to that file, let me know what you think :)

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

Status: In review

Development

Successfully merging this pull request may close these issues.

[Change Request]: add regional KPIs

3 participants