[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
dej611
left a comment
There was a problem hiding this comment.
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
| return { | ||
| color, | ||
| stop: newMin + ((stop - oldMin) * newInterval) / oldInterval, | ||
| stop: newMin + ((stop - oldMin) * 100 * newInterval) / 100 / oldInterval, |
There was a problem hiding this comment.
I think the * 100 / 100 can be removed here as there's no actual change.
There was a problem hiding this comment.
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.
Also here I think the * 100 / 100 are superfluous. The roundValue will apply already some internally
There was a problem hiding this comment.
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.
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.
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.
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?
|
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) |
stratoula
left a comment
There was a problem hiding this comment.
Definitely @flash1293. I am approving as we are going to have a followup PR!
|
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: