Skip to content

added isochrone color palettes and opacity control#340

Open
s4chinjha wants to merge 2 commits intovalhalla:masterfrom
s4chinjha:isochrone-settings
Open

added isochrone color palettes and opacity control#340
s4chinjha wants to merge 2 commits intovalhalla:masterfrom
s4chinjha:isochrone-settings

Conversation

@s4chinjha
Copy link
Contributor

@s4chinjha s4chinjha commented Mar 1, 2026

This PR Closes #283 and adds an Isochrone Settings Section to the isochrone summary panel.

🛠️ Fixes Issue

As mentioned in issue #283, the default isochrone colors are way too opaque and are not very accessible (see also #191). There is also no way of changing opacity right now, which makes it harder to read the map underneath when multiple contours overlap.

👨‍💻 Changes proposed

New file - src/utils/isochrone-palettes.ts
Added a utility that defines the available color palettes and handles color interpolation across any number of contours.

Color Palette selector
Added an option for the user to choose from a few predefined color scales - Default, Viridis (colorblind-friendly), Plasma, and Blues.

The Default option keeps the existing API-provided colors so nothing changes for users who don't touch the setting.

Opacity slider
Added a slider (0–1) to control fill transparency. Useful when contours overlap or when the map details underneath need to stay readable.

Both controls update the map live - no need to redraw the isochrone after changing palette or opacity.

Palette is a global setting, not per-isochrone, so it will continue to work correctly when multiple isochrones are supported in the future.

Fixed rendering order so smaller contour rings are always visible on top of larger ones instead of being hidden underneath.

Updated tests to include the new store fields so all existing tests continue to pass.

@gisops-bot
Copy link

Preview is ready! 🚀 You can view it here: https://valhalla-app-tests.gis-ops.com/340

@s4chinjha s4chinjha marked this pull request as ready for review March 2, 2026 13:11
@s4chinjha
Copy link
Contributor Author

Hii @nilsnolde
Could you please review this Pr when you get a chance?
Thanks!

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.

Make isochrone color palette user definable

2 participants