-
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] Add search to chart switcher #77631
[Lens] Add search to chart switcher #77631
Conversation
Jenkins, test this |
Pinging @elastic/kibana-app (Team:KibanaApp) |
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 design is adding a lot of whitespace to our chart switcher, instead of increasing its density like most of our competitors do when they want to support more chart types. Some of our competitors have up to 32 chart types that they can fit into one screen without scrolling, which I think is a feature. Did I miss some context for this change @cchaos?
}, | ||
{ | ||
id: 'line', | ||
icon: LensIconChartLine, | ||
shortLabel: i18n.translate('xpack.lens.xyVisualization.shortLineLabel', { | ||
defaultMessage: 'Vertical', | ||
}), |
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's not really a "vertical line chart", is it? I would rather have repetition and have the category name be "Line" and the visualization is "Line".
I checked the pr this morning |
I've responded to this spacing/scrolling problem in #75403 (comment):
The original ask was:
This PR does just that. It adds sections with headings to demarcate those sections. It sounds like the main concern is that these sections adds "white space" and increases scrolling. The only remedies I see are to:
There was discussion in #75403 on what those sections would be. I'd suggest continuing to think scalability of those headings and what other charts will be introduced and therefore what the sections should encompass. From a design standpoint, less white space and scrolling does not equal more scanability/readability. You can increase the size of the popover, but I wouldn't decrease spacing. |
Is there any urgency to make this design change? Can we delay this decision until we have new chart types to add, which is post Lens by Default? |
Issue and PR originated from the percentage mode feature (see this comment: #70703 (comment)) . With the percentage chart types the popover is getting a little messy, but I wouldn’t say it’s completely unusable in the current state. If we are fine with the current look and feel, I wouldn’t object postponing this. In general I like the sections though and I think it’s worth giving it a little more thought now because IMHO we are not far away from an improvement over the current status. What about removing the section headers, but keeping a little spacing between the icon groups? This together with an increased height for the popover should be enough to get the current set of visualizations in there without scrolling. It’s still cleaner than the current popover because of distinct groups making it easier to find the right chart type. |
I agree with @flash1293 let's try not to postpone this
sounds good |
...visualizationType, | ||
selection: getSelection(visualizationType.visualizationId, visualizationType.id), | ||
})), | ||
.filter( |
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.
Nitpick: moving the filter
within the Object.values().map()
loop there's less work
@@ -9687,15 +9687,12 @@ | |||
"xpack.lens.xySuggestions.unstackedChartTitle": "スタックが解除されました", | |||
"xpack.lens.xySuggestions.yAxixConjunctionSign": " と ", | |||
"xpack.lens.xyVisualization.areaLabel": "エリア", | |||
"xpack.lens.xyVisualization.barHorizontalLabel": "横棒", |
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.
Not sure why these files are still touched by the change
Good point @cchaos |
Works as expected, tested and reviewed 👌 |
@elasticmachine merge upstream |
I think what we'll want is a
|
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 title and description of this PR are out of date, but it works well for the smaller scope we agreed on. I also agree with @cchaos about adding an alternate "long name" which should be searchable, so that I can type horiz
and get results.
…ana into lens/chart-switcher-update
Thanks @wylieconlon updated the description |
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.
Did not test the latest code, but LGTM from previous test and reading the diff
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.
LGTM, just a couple design tweaks.
x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch.scss
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch.tsx
Outdated
Show resolved
Hide resolved
@cchaos thanks, I addressed those, could you check again? |
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.
Thanks @flash1293 ! LGTM!
💚 Build SucceededMetrics [docs]async chunks size
History
To update your PR or re-run it, just comment with: |
Not seeing any reason to not ship this in 7.10, changed the labels |
Fixes #75403
Adds a search to the chart switcher:
This PR adds a property to the visualization types -
searchLabel
. This optional label can be used to let a visualization type match the current search even if the short label is not matching it.It also changes the title shown in the collapsed state of the chart picker as suggested in the issue.
The search is performing a simple
.includes()
match on the lowercased string to the label and the search label of the visualizations - if one of them matches, the visualization gets shown.If all visualizations are filtered, a callout is displayed: