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 intends to resolve VEuPathDB/web-components#454. Made a mistake to resolve this in a very complex manner but later much simpler solution was found. Also, it is worth noting that while I was working on the colormap range, I noticed that the decimal points in the colormap's tick labels were often too long, so I have set it up to be 2 decimal points at a web-components PR, VEuPathDB/web-components#464. Finally, I found that seriesGradientColorscale was not typed so I also fixed it.
Two logics are currently utilized to find out the colormap range: a) no filter case: taking Min/Max between displayMin/Max and rangeMin/Max using the metadata of the overlay variable; b) with filter(s) (subsetted): taking Min/Max between computed data-based Min/Max and displayMin/Max from the metadata of the overlay variable. I saw that there is a work in progress to have a filter-aware metadata by Danielle, but it appeared to me that it is still underway.
Some screenshots are attached in the following (GEMS1 data): BMI-for-age-z-score has displayMin/Max of (-30, 20) and rangeMin/Max of (-15.3, 273.91).
a) No filter is used: in this case, range becomes (-30, 273.91)

b) with filters: data-based Min/Max is (-11.05, 143.33)

c) Age, matched case for the overlay variable with filters: Sequential colormap. No displayMin/Max; data-based Min/Max is (33, 56), thus final range becomes the data-based Min/Max
