-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Lens] Fix transition to custom palette inconsistency when in number mode #110852
Conversation
Pinging @elastic/kibana-vis-editors (Team:VisEditors) |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
expected head sha didn’t match current head ref. |
// as of max reduce its value by 1/colors.length for correct continuity checks | ||
const maxRange = stops.length | ||
? rangeMax | ||
: dataRangeArguments[1] - (dataRangeArguments[1] - dataRangeArguments[0]) / colors.length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be just dataRangeArguments[0] / colors.length
? I mean:
x-(x-y) = x-x+y = y
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The division has precedence over subtraction.
It basically does x - (x-y)/z
(i.e. 100 - (100 - 0)/5
=> 100 - 20 = 80
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I thought it is in the brackets, nvm then!
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
Tested on FF and couldn't reproduce the bug from the issue. I left one comment but overall this looks great! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, bug is fixed 👍
Do you think it makes sense to port it to |
Yes, why not? |
…mode (elastic#110852) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
…mode (elastic#110852) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
Fixes #110771
When the palette configuration is in number mode and the user transitions from a default palette to a custom one, all cells were coloured with the last color stop's value.
While fixing this issue, I found out there was also another issue in palette transition when the
continuity
was not set toabove
.This PR addresses both issues.
I've added some extra tests as all this code is pretty complicated and we had issues in the past of inconsistencies.
Checklist
Delete any items that are not applicable to this PR.