-
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
[XY] Allow multiple split accessors #134566
[XY] Allow multiple split accessors #134566
Conversation
cleans filters and query
# Conflicts: # x-pack/plugins/lens/public/shared_components/axis_title_settings.tsx # x-pack/plugins/lens/public/xy_visualization/xy_config_panel/axis_settings_popover.tsx # x-pack/plugins/translations/translations/fr-FR.json
…to chart_expressions-xy
# Conflicts: # packages/kbn-optimizer/limits.yml # x-pack/plugins/lens/public/index.ts
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, Vlad. Code LGTM 👍
Tested locally, works fine. But I could miss some exceptional cases.
Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors) |
@elasticmachine merge upstream |
expected head sha didn’t match current head ref. |
…y-split_accessors
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 couldn't find any issues with behavior, but the performance is very bad (see comments in the code.
I configured a chart with 200 split series (using multi field top values) and getColorAssignments
takes over 13s, most of it spent in getAllSeries
.
On top of this I noticed that the normalizeTable
function is even slower, but that's a separate issue, I'm going to open a bug issue for that.
src/plugins/chart_expressions/expression_xy/public/helpers/data_layers.tsx
Outdated
Show resolved
Hide resolved
return { | ||
layerId, | ||
xAccessor: xAccessor === EMPTY_ACCESSOR ? undefined : xAccessor, | ||
yAccessor, | ||
splitAccessor: splitAccessor === EMPTY_ACCESSOR ? undefined : splitAccessor, | ||
splitAccessor: splitAccessors[0] === EMPTY_ACCESSOR ? undefined : splitAccessors, |
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.
Would splitAccessors[0]
be EMPTY_ACCESSOR
here or would it be an empty string? In generateSeriesId
you are not adding an empty EMPTY_ACCESSOR
if there is no split
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.
src/plugins/chart_expressions/expression_xy/public/helpers/color_assignment.ts
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
Performance is much better, but it's still much slower than necessary. It's a recurring pattern, I found it in two places: kibana/src/plugins/chart_expressions/expression_xy/public/components/legend_action.tsx Line 57 in 8e9ba98
kibana/src/plugins/chart_expressions/expression_xy/public/helpers/color_assignment.ts Line 79 in cac1728
If you need to calculate something over a large array (like rows or all fields in a data view), do not use It doesn't matter much for quick smoke tests with a few hundred data points at max, but it's very important to keep this in mind |
Got it. Changed |
@elasticmachine merge upstream |
When using a multi field top values in Lens for breakdown, the legend filter actions aren't shown anymore (filtering by clicking in the chart doesn't work as well) |
Fixed |
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 and everything seems to work well now, LGTM
💚 Build SucceededMetrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @VladLasitsa |
Completes part of #127115
Summary
Allows multiple split accessors for one layer. (
splitAccessor
->splitAccessors
).Some refactoring in code related to
splitAccessors
.Testing notes: