-
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] Synchronize cursor position for X-axis across all Lens visualizations in a dashboard #106845
Conversation
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
Pinging @elastic/kibana-app (Team:KibanaApp) |
@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 Firefox 👍
Lens Code review seems fine to me.
const isDateHistogram = | ||
Boolean(dataTables.length) && | ||
dataTables.every((dataTable) => | ||
dataTable.columns.find((c) => Boolean(c.meta.sourceParams?.appliedTimeRange)) |
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.
nit: maybe .some
is more suited than find
here?
No big deal, in terms of perf I think they are equivalent, it's just about semantic
x-pack/plugins/lens/public/pie_visualization/render_function.tsx
Outdated
Show resolved
Hide resolved
It works well for all charts, sometimes it is laggy, not sure how it will perform with big dashboards and a lot of data. |
@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 a dashboard with 10 synchronizing visualizations on Safari. Works really well 🆗 Code LGTM!
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 LGTM!
@stratoula I've added a small debounce to be sure that that PR will not be a reason of any performance issues. |
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, thanx Alex :D
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 is fantastic! 🎉
Ideally this would be simpler if we on the charts side had a registry of all the charts on a page. This in not in the near future so I'm glad you were able to achieve this as is.
I just have just one comment, see below 👇
xDomain={adjustedXDomain} | ||
rotation={rotation} | ||
theme={[themeOverrides, theme]} | ||
theme={[theme, themeOverrides]} |
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 is flipped, the lower the index the higher the priority. So in this case themeOverrides
is used only when the value does not exist on the theme
.
Are you running into issue with this? There may be an issue where if a value is undefined
on the first object this will not be overridden by the second.
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.
Interestingly, after the modifying, it began to work as expected. The same approach is used elsewhere, so if you're right the problem is everywhere
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.
Yeah. Also if the theme
is a full theme, (i.e. defines all available property) that means the overrides are pointless and will never be used.
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
Unknown metric groupsAPI count
API count missing comments
Non-exported public API item count
History
To update your PR or re-run it, just comment with: cc @alexwizp |
…zations in a dashboard (elastic#106845) * [Lens] Synchronize cursor position for X-axis across all Lens visualizations in a dashboard Closes: elastic#77530 * add mocks for active_cursor service * fix jest tests * fix jest tests * apply PR comments * fix cursor style * update heatmap, jest * add tests * fix wrong import * replace cursor for timelion * update tsvb_dashboard baseline * fix CI * update baseline * Update active_cursor_utils.ts * add debounce * remove cursor from heatmap and pie * add tests for debounce * return theme order back Co-authored-by: Kibana Machine <[email protected]>
…zations in a dashboard (#106845) (#107691) * [Lens] Synchronize cursor position for X-axis across all Lens visualizations in a dashboard Closes: #77530 * add mocks for active_cursor service * fix jest tests * fix jest tests * apply PR comments * fix cursor style * update heatmap, jest * add tests * fix wrong import * replace cursor for timelion * update tsvb_dashboard baseline * fix CI * update baseline * Update active_cursor_utils.ts * add debounce * remove cursor from heatmap and pie * add tests for debounce * return theme order back Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
…zations in a dashboard (elastic#106845) * [Lens] Synchronize cursor position for X-axis across all Lens visualizations in a dashboard Closes: elastic#77530 * add mocks for active_cursor service * fix jest tests * fix jest tests * apply PR comments * fix cursor style * update heatmap, jest * add tests * fix wrong import * replace cursor for timelion * update tsvb_dashboard baseline * fix CI * update baseline * Update active_cursor_utils.ts * add debounce * remove cursor from heatmap and pie * add tests for debounce * return theme order back Co-authored-by: Kibana Machine <[email protected]>
Closes: #77530
Summary
[Lens] Synchronize cursor position for X-axis across all Lens visualizations in a dashboard #106845
Implementation notes
activeCursor
service has been moved to thecharts
plugin and exposed through a contract.TSVB
,Lens
,vis_type_xy
andTimelion
useactiveCursor
service from chart pluginuse_active_cursor
hook was createdScreens
Screen.Recording.2021-07-28.at.12.05.44.PM.mov
Screen.Recording.2021-07-28.at.12.09.11.PM.mov
Screen.Recording.2021-07-28.at.12.11.47.PM.mov