-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[E & A] Implement colormap configurability #994
Comments
Once we close this, we can close a related GHG ticket: https://github.com/US-GHG-Center/feature-requests/issues/3 |
Hey @dzole0311 👋 Based on the team conversations we had this week I updated the designs of the Colormap options selector:
Link to Figma 👉 https://www.figma.com/design/9INQauBWhiRxvOWDGhRrxO/US-GHG-Center?node-id=1781-3165&t=8tmNwMDSmSA7hY3c-1 |
Thanks @faustoperez - should be easy to add the 'Reset' option. I couldn't find the icon in the USWDS icon list. Is it coming from there? If not, could we switch to one from the USWDS collection? |
I didn't find any suitable icon on the USWDS list, that's why I proposed one from Collecticons. If this is a concern, let's skip the icon for now 🙂 |
@faustoperez - when reading the legend, I am unable to see at a glance, what the units are. They are only part of the list of properties under the dataset title. Would you consider to somehow associate them more closely with the legend? Sorry this comment is coming so late... |
That's a good call Jonas, I did play with the position of the units on this card design. In the previous design sometimes the legend was truncated depending on the actual length of the colormap values. I wanted to leave space on the colormap legend in case we had long numbers, or divergent scales with a zero in the center. We could revise these decisions in a future iteration. |
**Related Ticket:** #994 ### Description of Changes I made the colormap default to be returned along with other settings values - I think this saves some redundancies of retrieving the value of colormap, and fits well with the existing pattern. I eliminated reconciling functions from data-util (and used the function from data-util-no-faux-module) so there is no confusion about which function is being called.
**Related Ticket:** #994 ### Description of Changes Implements the color map configuration of E&A layers. Changes: - Adds curated list of supported color maps taken from the back-end, split into diverging and sequential groups - Supports other valid color map names from the list of color maps: https://openveda.cloud/api/raster/colorMaps - Adds support for reversing the colors - Adds reset all button which currently only resets the "Reverse" option, but will also apply to the "Rescale" functionality which is to be added next - Added a loading skeleton to the colormap in the timeline sidebar when a layer is added. This prevents a visual flash because it might take a second to fetch the color map from the back-end (cc @faustoperez ) The precedence of the color maps are as follows: 1. Start with what is configured in the sourceParams of the dataset 2. If it's not defined, check for the dashboard render configuration coming from STAC endpoint 3. If still undefined, check for asset-specific renders using the sourceParams' assets. This is a special edge case for some datasets that have multiple assets (multiple assets under one collection item) 4. If all else fails, default to `viridis` Please let me know your thoughts on that or if you spot something strange ### Notes & Questions About Changes - I additionally pushed a shell script that I used to build the `colorMaps.ts` file, I hope that's okay. It fetches all the `rgba` values for each supported colorMap from titiler. We could extend it and integrate it within our Github workflow in the future, so that the colors are fetched on each new release (although it's unlikely they will change that often) ### Validation / Testing - Verify that the color map list is correctly split into diverging and sequential groups - Check that reversing the color map works as expected and toggles correctly - Test the "Reset All" button to ensure that it resets the "Reverse" option and works as intended - Check that the precedence of the color maps is followed in the correct order: 1. Start with sourceParams of the dataset 2. Fallback to dashboard render configuration from the STAC endpoint 3. If undefined, check for asset-specific renders using sourceParams' assets 4. Finally, default to `viridis` if all else fails - Verify that the changes do not break any existing functionality related to rendering of the tiles on the map (selected color map must match the tile colors) - Test across different datasets with both single and multiple assets to confirm edge cases are handled as described
Context
An implementation ticket for the design ticket here: #929
Acceptance Criteria
The text was updated successfully, but these errors were encountered: