Skip to content
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

Issue with ColorScale.getColorForValue() when min === max #303

Closed
jorgenherje opened this issue Sep 13, 2023 · 1 comment
Closed

Issue with ColorScale.getColorForValue() when min === max #303

jorgenherje opened this issue Sep 13, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@jorgenherje
Copy link
Collaborator

jorgenherje commented Sep 13, 2023

When min === max the color scale is not able to call ColorScale.getColorForValue() without crash.

The ColorScale.getColorForValue()-method calls ColorPalette.getInterpolatedColor(normalizedValue) which throws the error.

Seems like the interpolation does not handle min equal max, and this provides error when coloring by parameters. Both when calling ColorScale.getColorForValue() directly and ColorScale.getAsPlotlyColorScaleMarkerObject().

Note: Only tested with ColorScaleType.Continuous


An example with test data contains parameters where min == max, and the following gives issue:

image

@jorgenherje jorgenherje added the bug Something isn't working label Sep 13, 2023
@github-project-automation github-project-automation bot moved this to Backlog 📝 in Webviz Sep 13, 2023
@rubenthoms
Copy link
Collaborator

Fixed by #304.

@github-project-automation github-project-automation bot moved this from Backlog 📝 to Done 🏁 in Webviz Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done 🏁
Development

No branches or pull requests

2 participants