added isochrone color palettes and opacity control#340
Open
s4chinjha wants to merge 2 commits intovalhalla:masterfrom
Open
added isochrone color palettes and opacity control#340s4chinjha wants to merge 2 commits intovalhalla:masterfrom
s4chinjha wants to merge 2 commits intovalhalla:masterfrom
Conversation
|
Preview is ready! 🚀 You can view it here: https://valhalla-app-tests.gis-ops.com/340 |
Contributor
Author
|
Hii @nilsnolde |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.tsAdded 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.