-
Notifications
You must be signed in to change notification settings - Fork 121
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
feat(xy): render sorting #2524
feat(xy): render sorting #2524
Conversation
buildkite update screenshots |
...ages/charts/src/chart_types/xy_chart/state/selectors/get_tooltip_values_highlighted_geoms.ts
Outdated
Show resolved
Hide resolved
packages/charts/src/chart_types/xy_chart/state/utils/utils.test.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Marco Vettorello <vettorello.marco@gmail.com>
buildkite update screenshots |
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.
Looks good to me, thanks.
With this change, and my applied changes, we need to specify this as a breaking change. In the mixed stacked/nonstacked environment, the color assigned is inverted: first, the stacked then the non-stacked, the same way you read the chart left-right.
Please mark this as breaking change when merging.
# [68.0.0](v67.0.1...v68.0.0) (2024-10-08) ### Features * **xy:** render sorting ([#2524](#2524)) ([c514571](c514571)) ### BREAKING CHANGES * **xy:** The way mixed stacked/nonstacked series are colored now is different from the previous behaviour. Now we color them not by their insert index but by the way we display them in the rendering: from the left to right, bottom top, stacked, nonstacked. This align correctly also the legend colors by default. This does **not** affect colors assigned via a `SeriesColorAccessor`.
Summary
Adds render sorting for xy charts. See demo story here.
Details
Render order
Settings.renderSort
functionLegend items order
Settings.legendSort
, original array is based on render order.Tooltip items order
Tooltip.sort
, original array is based on render order.Breaking changes
The way mixed stacked/nonstacked series are colored now is different from the previous behaviour. Now we color them not by their insert index but by the way we display them in the rendering: from the left to right, bottom top, stacked, nonstacked. This align correctly also the legend colors by default. This does not affect colors assigned via a
SeriesColorAccessor
.Issues
Related to elastic/kibana#191988
Checklist
:xy
,:partition
):interactions
,:axis
)closes #123
,fixes #123
)packages/charts/src/index.ts