-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] Color in dimension trigger #76871
[Lens] Color in dimension trigger #76871
Conversation
@elasticmachine merge upstream |
x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.tsx
Outdated
Show resolved
Hide resolved
Pinging @MichaelMarcialis for the style of color palettes inside of dimension triggers and Martas suggestion here: #76871 (comment) I see the point, I was following the mocks here but I think just not showing anything for splitted y axis metrics is better. |
This is looking great, @flash1293. While comparing your screenshots to @cchaos's latest (I think) mockups for chart coloring, I noticed that there were a few places that this PR deviates from those designs, including:
Was there a reason for these deviations? Am I looking at an older mockup, or is this just the first part of a multi-PR effort (as your initial comment appears to indicate)? Thanks! |
Is there any way we can fix this so that the focus states updated as part of @mbondyra's recent reordering PR can remain intact? Figma examples of what was she implemented can be found here: https://www.figma.com/file/q61JmGHmcammPfkxupNj1g/Intradimensional-Reordering-Version-1-In-Progress?node-id=1%3A2
Per my earlier comment, @cchaos's most recent mockups appear to omit this
Regarding applying a tooltip to these |
Thanks for the reviews. I tried to address all of the things, this is the summary:
I left it in with a little less prominent color. No strong opinion here. About the differences not addressed above:
I didn't find the right icon, maybe it's not released yet? If I'm using
I did that as a quick and dirty solution, but then I ended up liking it because it's not adding to the vertical space, preventing scrolling for a little bit longer. If you think it's not the right thing I can move to the style in Carolines mock. |
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.
Hey, @flash1293. Took a deeper look at the code and left a few comments for your review.
x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/color_indicator.tsx
Outdated
Show resolved
Hide resolved
<EuiFlexGroup className="lnsLayerPanel__paletteContainer" gutterSize="none" alignItems="center"> | ||
{accessorConfig.palette.map((color) => ( | ||
<EuiFlexItem | ||
key={color} | ||
className="lnsLayerPanel__paletteColor" | ||
grow={true} | ||
style={{ | ||
backgroundColor: color, | ||
}} | ||
/> | ||
))} | ||
</EuiFlexGroup> |
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.
Rather than rolling out a custom color palette component, would it be better to use EuiColorPaletteDisplay
instead (and override as necessary if needed)?
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.
This component is very new - the version supporting it is not available in Kibana yet. I'm fine with using it once it becomes available, but #82730 has to get merged first.
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.
Sounds good. Should I open an issue as a reminder? Or is that unnecessary?
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.
Don't bother, I will take care of it.
@@ -86,11 +86,11 @@ export const IndexPatternDimensionTriggerComponent = function IndexPatternDimens | |||
} | |||
anchorClassName="eui-displayBlock" | |||
> | |||
<EuiLink | |||
<EuiText |
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.
There are a few questions/concerns I have due to the change from EuiLink
to EuiText
:
- Since this element is no longer focusable, the styles applied by @mbondyra in a previous PR no longer set the focus styles (light blue background color behind text) appropriately for the child
.lnsLayerPanel__triggerLinkLabel
element. Can this be corrected? - I believe this
aria-label
now no longer applies to this element. Can we move to the appropriate location? - Should the
lnsLayerPanel__triggerLink
class name be changed, since it's no longer a link?
Thanks for the review, @MichaelMarcialis These are the changes I made:
|
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Page load bundle
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.
Thank you for addressing those suggested changes. This LGTM.
Personally, I like how you've positioned the palette here and can appreciate the vertical real estate savings. Was just checking to see if there was a different reason for the deviation. I say we keep it positioned as you currently have 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.
tested on Safari, works as expected. Code LGTM 🟢
Merging now, I will replace the custom palette code with the EUI component once it becomes available |
* master: (51 commits) [ML] Persisted URL state for the Data frame analytics jobs and models pages (elastic#83439) adds xpack.security.authc.selector.enabled setting (elastic#83551) skip flaky suite (elastic#77279) [ML] Improve support for script and aggregation fields in anomaly detection jobs (elastic#81923) [Workplace Search] Migrate SourcesLogic from ent-search (elastic#83544) [ML] Add UI test for feature importance features (elastic#82677) [Maps] Improve icons for all layer types (elastic#83503) Replace experimental badge with Beta (elastic#83468) [Fleet][EPM] Unified install and archive (elastic#83384) Move src/legacy/server/keystore to src/cli (elastic#83483) Used SO for saving the API key IDs that should be deleted (elastic#82211) [Uptime] Mock implementation to account for math flakiness test (elastic#83535) [Workplace Search] Enable check for org context based on URL (elastic#83487) [App Search] Added all Document related routes and logic (elastic#83324) [Alerting UI] Fix console error when setting connector params (elastic#83333) [Discover] Allow custom name for fields via index pattern field management (elastic#70039) [Uptime] Fix monitor list down histogram (elastic#83411) remove headers timeout hack, rely on nodejs timeouts (elastic#83419) [ML] Update console autocomplete for ML data frame evaluate API (elastic#83151) [Lens] Color in dimension trigger (elastic#76871) ...
Based on #79851
Fixes #68405
This unfinished PR adds color indicators for dimension in xy chart.
Please don't review in depth yet, this PR is not cleaned up yet.
Feature
The indicators are shown when possible. If the color can't be determined (because "break down by" is used), the "disabled" icon is shown. For dimensions containing a color palette picker, the currently picked palette is shown in the dimension picker.
The color indicator does not contain a color picker itself - to change the color you still have to open the dimension popover. As soon as the flyout dimension config PR lands, I think this is justifiable as it's just a single click away.
Implementation
This PR extends the chart config like this: https://github.com/elastic/kibana/pull/76871/files#diff-c46757b63dd572e7cff7c0aad72c3ec135b9969c39716d4db9df551fa962ce34R347-R361
When passing the accessors to the frame, it's possible to specify a color icon as well. Another option would be to provide a
renderColorIndicator
or something along those lines (maybe making it more than generic than being about colors) and using a separateNativeRenderer
. This would give the visualization more flexibility - I thought it would add unnecessary complexity in this specific situation, but I don't hold this opinion strongly.The logic to determine the current color of a dimension (https://github.com/elastic/kibana/pull/76871/files#diff-5dcc03dab8d34631c6ed65b6b38f8b97eed0394699532c6516111c735a8e30bfR177-R220) works like this:
Quick note about layout: To make the color indicator clickable like the dimension trigger rendered by the datasource, the
EuiLink
component rendering the button is moved out of the datasource into the frame - this means the datasource only has to render the text instead of having to handle the logic to actually open the popover: https://github.com/elastic/kibana/pull/76871/files#diff-9d5c4c19a499161633fc439fb1b86a6105bf7b2af2cdf638c52cec4f2a3c4f3cL93Other changes: