Skip to content

fix(legend): avoid re-rendering #2646

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

markov00
Copy link
Member

Improve legend rendering efficiency by avoiding unnecessary re-renders when the legend configuration changes. This change enhances performance and maintains the integrity of the displayed legend items.

@markov00 markov00 requested a review from Copilot April 10, 2025 21:09
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

packages/charts/src/state/chart_selectors.ts:148

  • Removing the export from ChartSelectorsFactory may lead to breakages if it is expected to be used externally. Confirm that this type is intended for internal use only.
type ChartSelectorsFactory = () => ChartSelectors;

packages/charts/src/chart_types/xy_chart/state/selectors/get_legend_item_extra_values.ts:24

  • Using legendValues.length directly assumes that legendValues is always an array; ensure that getLegendConfigSelector always returns an array to prevent potential runtime errors.
type === ScaleType.Ordinal || legendValues.length === 0

@elastic-datavis
Copy link
Contributor

✅ Successful Deployment (build#4691) - fb432d0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant