[Lens] Synchronize cursor position for X-axis across all Lens visualizations in a dashboard#106845
[Lens] Synchronize cursor position for X-axis across all Lens visualizations in a dashboard#106845alexwizp merged 24 commits intoelastic:masterfrom
Conversation
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
|
Pinging @elastic/kibana-app (Team:KibanaApp) |
|
@elasticmachine merge upstream |
dej611
left a comment
There was a problem hiding this comment.
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.
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 |
mbondyra
left a comment
There was a problem hiding this comment.
tested on a dashboard with 10 synchronizing visualizations on Safari. Works really well 🆗 Code LGTM!
@stratoula I've added a small debounce to be sure that that PR will not be a reason of any performance issues. |
nickofthyme
left a comment
There was a problem hiding this comment.
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.
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.
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.
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 <42973632+kibanamachine@users.noreply.github.com>
…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 <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
…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 <42973632+kibanamachine@users.noreply.github.com>

Closes: #77530
Summary
[Lens] Synchronize cursor position for X-axis across all Lens visualizations in a dashboard #106845
Implementation notes
activeCursorservice has been moved to thechartsplugin and exposed through a contract.TSVB,Lens,vis_type_xyandTimelionuseactiveCursorservice from chart pluginuse_active_cursorhook 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