-
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
[Discover] Add "Chart options" menu #112453
[Discover] Add "Chart options" menu #112453
Conversation
…nt-chart-options-menu
…nt-chart-options-menu
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
dear @gchaps , just a question about wording, is "Chart options" fine? thx ... ah yes, also a ping, because this will be a change to document :) |
src/plugins/discover/public/application/apps/main/components/chart/discover_chart.tsx
Outdated
Show resolved
Hide resolved
src/plugins/discover/public/application/apps/main/components/chart/discover_chart.tsx
Outdated
Show resolved
Hide resolved
In general code looks good to me, I would suggest two more things: In the original ticket and meeting we've discussed moving the "time range" (currently above the chart) into the x-axis label of the chart. That way we get that space free for the view switcher. I think we should still do that within this PR. There is currently a tooltip assigned stating "To change the time, use the global time filter." I don't think we need to cary that over to the axis legend (if that would even be possible). Moving that over also has the nice advantage we can improve the movile view. Currently it looks like this: I think it would be better if the date is in the x-axis label and instead we could keep the hit count left aligned and the chart setting right aligned within the same row. |
@timroes yes, this looks much better, however, the x-axis is a bit long, and can be truncated depending on window width So I wonder, is info like "order_date per 30 seconds" really necessary? |
@elasticmachine merge upstream |
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 this is looking nice! Just a couple of nits since we're already in there:
-
I noticed there's more space between the chart and the x-axis label than between the x-axis label and the table. Can we reduce the former?
-
There's also unequal white space on the sides of the chart. This one might be trickier to solve but at the very least I would ask that we set padding-right to zero for
.dscHistogram
Also noticed that the x-axis label is not wrapping in small screens.
@kertal I agree, I think we should just get rid of the actual field name and interval and only have the timestamp there, nothing else. If we are still worried about them being cut off on smaller screens then, I think what we could use the |
@timroes think this is fine, also for smaller screens: @andreadelrio note that we should keep padding of |
…ertal/kibana into kertal-pr-implement-chart-options-menu
@elasticmachine merge upstream |
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 Chrome Linux. Seems to work finde. Code LGTM assuming green CI.
I think there is just some minor change we need to be aware of, but I think they are all fine:
When you hide the chart you now no longer see the timerange, since it's hidden too. I think that is okay, and we need that original space still for the view switcher later.
When showing a chart again, the shown time range is calculated again. That is currently fine, since we anyway do a full new request when showing the chart. If we'd just load the chart data again when showing the chart again, and not the documents, we'd still keep updating the shown time range. Though in that case we'd anyway show the chart on a different time range than the documents, if we'd implement that, and the quesiton would anyway be: what should that timerange represent. Thus I am also fine with that behavior.
src/plugins/discover/public/application/apps/main/components/chart/discover_chart.tsx
Outdated
Show resolved
Hide resolved
…hart/discover_chart.tsx Co-authored-by: Tim Roes <mail@timroes.de>
@andreadelrio Yes, but I don't think there's a good way to solve this, since it's the label of the x-axis. What we could do is rendering those outside the canvas, then we would have all options |
@andreadelrio @timroes so, that's how it could look like, when showing the time range outside the canvas |
@kertal thanks for exploring that route. I'd add negative margin-top to
|
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!
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: cc @kertal |
Co-authored-by: Tim Roes <mail@timroes.de>
Summary
This PR implements the "Charts options" menu in the top section of the main area of Discover. With the upcoming ML's Data Visualizer this area gets crowded (it was already, especially in mobile view). So now it looks like this:
Hiding the chart and assigning it's interval were merged into this new element
The warning that the selected interval was invalid is also inside the Chart options menu (Usually selecting Milliseconds as interval with a long time range triggers this warning):
Additionally the "Count" label of the y-axis was removed (since it's obvious what's displayed)
Fixes #112149
Checklist
Delete any items that are not applicable to this PR.