-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
[charts] Allow onItemClick
on the Legend
component
#14231
[charts] Allow onItemClick
on the Legend
component
#14231
Conversation
Deploy preview: https://deploy-preview-14231--material-ui-x.netlify.app/ Updated pages: |
CodSpeed Performance ReportMerging #14231 will not alter performanceComparing Summary
|
onClick
on the Legend
componentonItemClick
on the Legend
component
I'm wondering if we add just the onItem click are we shooting in our foot for a more interactive Do you have a specific uscase in mind that would be possible to create with this |
Not really, it was just a thought that occurred to me when I noticed the continuous label is very different from the others. I suspect behaviour could be derived for things like, |
Ok, then waiting for an explicit request from a user might be the best approach |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Signed-off-by: Jose C Quintas Jr <[email protected]>
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
…arts-legend-actions-eg-highlighting
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 nice. Just left minor comments
/** | ||
* The identifier of the pie item | ||
*/ | ||
itemId: PieItemId; |
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.
Not exactly since all the series provide both. For Bar, Line, and Scatter those itemId
will be the same as seriesId
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.
True, though I felt it unnecessary to mention The identifier of the pie item, uses the seriesId in other types
Initially I had type: pie
as a different shape, though I felt it to be a bit cumbersome and moved itemId
to the type: series
😅
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.
And what about itemId?: PieItemId;
with itemId
not provided is the series is not a pie?
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.
🤦
Co-authored-by: Alexandre Fauquette <[email protected]> Signed-off-by: Jose C Quintas Jr <[email protected]>
…arts-legend-actions-eg-highlighting
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.
👍
…arts-legend-actions-eg-highlighting
Signed-off-by: Jose C Quintas Jr <[email protected]> Co-authored-by: Alexandre Fauquette <[email protected]>
Works on
ChartsLegend
andPiecewiseColorLegend
Allows simple customisation of behavior, not sure it is worth documenting 🤔
Should we try to provide this for
ContinuousColorLegend
? We could try to extrapolate the current color or value the user is clicking on and pass it to the user 🤔Would be a middleground quick-win for #12344, though no actions yet