Skip to content
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

[charts] Fix Scatter series highlight when id is a number #12677

Conversation

JCQuintas
Copy link
Member

Issue was due to Object.keys() returning an array of strings even if the keys are numbers.

This fix stores the seriesId as a property inside the series object to avoid the issue mentioned above.

Fixes #12603

@JCQuintas JCQuintas added bug 🐛 Something doesn't work component: charts This is the name of the generic UI component, not the React module! labels Apr 4, 2024
@JCQuintas JCQuintas self-assigned this Apr 4, 2024
@mui-bot
Copy link

mui-bot commented Apr 4, 2024

Deploy preview: https://deploy-preview-12677--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 83ff373

Copy link
Member

@alexfauquette alexfauquette left a comment

Choose a reason for hiding this comment

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

The solution looks good.

While looking at your solution, I was thinking that maybe I made a mistake by mixing the series and the delaunay in the same ref.

What do you think about splitting them into two distinct refs. One for the series and one for the delaunay, such that the isSeries would not be necessary?

@JCQuintas
Copy link
Member Author

The solution looks good.

While looking at your solution, I was thinking that maybe I made a mistake by mixing the series and the delaunay in the same ref.

What do you think about splitting them into two distinct refs. One for the series and one for the delaunay, such that the isSeries would not be necessary?

Makes sense, I thought about that, but imagined there was a reason for it being this way. And since I still don't have a lot of context on the repo I decided to leave it as I had found it. 😅

@JCQuintas JCQuintas force-pushed the 12603-charts-highlighting-not-working-in-scatter-series-with-number-id branch from c5ba678 to 9f9b475 Compare April 4, 2024 15:31
@JCQuintas JCQuintas force-pushed the 12603-charts-highlighting-not-working-in-scatter-series-with-number-id branch from 9f9b475 to 83ff373 Compare April 4, 2024 15:36
Copy link
Member

@alexfauquette alexfauquette left a comment

Choose a reason for hiding this comment

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

Nice code improvement 👍

@JCQuintas JCQuintas merged commit 0b1d592 into mui:master Apr 5, 2024
17 checks passed
joakimtveter pushed a commit to joakimtveter/mui-x that referenced this pull request Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: charts This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[charts] Highlighting not working in Scatter series with number ID
3 participants