-
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] Improve color stop UI #119165
[Lens] Improve color stop UI #119165
Conversation
x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_panel.tsx
Outdated
Show resolved
Hide resolved
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.
Had a first round of code review.
Locally I've test it and managed to break it only on the metric visualization. 👍
Test the metric visualization, which makes an intense use of the rangeMin
/rangeMax
props.
x-pack/plugins/lens/public/shared_components/color_palette/palette_configuration.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/shared_components/color_palette/color_ranges.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/shared_components/color_palette/color_ranges.tsx
Outdated
Show resolved
Hide resolved
@@ -83,7 +83,7 @@ export function remapStopsByNewInterval( | |||
return (controlStops || []).map(({ color, stop }) => { | |||
return { | |||
color, | |||
stop: newMin + ((stop - oldMin) * newInterval) / oldInterval, | |||
stop: newMin + ((stop - oldMin) * 100 * newInterval) / 100 / oldInterval, |
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.
I think the * 100 / 100
can be removed here as there's no actual change.
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.
It help to fix some problems with correct rounding
x-pack/plugins/lens/public/shared_components/coloring/palette_configuration.tsx
Outdated
Show resolved
Hide resolved
start: roundValue(start + (step * 100 * index) / 100), | ||
end: roundValue(start + (step * 100 * (index + 1)) / 100), |
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.
Also here I think the * 100 / 100
are superfluous. The roundValue
will apply already some internally
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.
no because firstly we should use *100
and after that * index / 100
in another case we have problem. You can check it try with that expression 11596411699.2 * 3 * 100 / 100
and 11596411699.2 * 100 * 3/ 100
you will get different results. And the second more correct.
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.
But that's not a different result, it is just how float values work. But even when slightly different after the 5th digit, the roundValue
will take care of it.
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.
sometimes I got .5999999
instead of .60000
if i use the first options, with the second always .6000
.
x-pack/plugins/lens/public/shared_components/color_palette/color_ranges.tsx
Outdated
Show resolved
Hide resolved
@VladLasitsa just a minor comment on the SVG icons: you can reduce the size by half, most of the time, if you use https://jakearchibald.github.io/svgomg/ to cleanup the SVG path: the resulting SVG is exactly the same but optimized |
Thank you @markov00, I am used this tool and decrease size of all my SVGs. |
@elasticmachine merge upstream |
@VladLasitsa first two tests look unrelated flakiness, the last one is probably legit
|
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Test Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
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.
A few nits I found but let's split them out into a follow-up issue:
- On metric, turning off auto max value will not round the value:
- On metric, turning off auto min value will log a warning: `The specified value "-Infinity" cannot be parsed, or is out of range.
Besides that it looks good to me - @dej611 @stratoula could you give it another look as well?
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.
Good catch @stratoula - I think we can merge in this PR and fix this problem along with my nits in a follow-up (to make sure it's safe and sound before FF) |
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.
Definitely @flash1293. I am approving as we are going to have a followup PR!
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 review only
Hey gang. I'm only just now seeing this PR (got a notification because it closed out the originating issue). Really great work here! I'm excited to see these enhancements added. I know this has already been merged, but in testing after the fact, I had a handful of comments/questions. Would we be able to address the following in a follow-up PR?
CCing @ghudgins and @flash1293, in case they have any comments on the above. |
Thanks for these @MichaelMarcialis , I will pull these into a separate issue together with my comments above, we can discuss there. |
Closes: #116422
Summary
This PR changes UI of color stops in Lens.
How it looks now:
Also was added new functionality:
Tasks: