[charts] Allow `onItemClick` on the `Legend` component
-
Works on
ChartsLegendandPiecewiseColorLegend -
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
Deploy preview: https://deploy-preview-14231--material-ui-x.netlify.app/
Updated pages:
Generated by :no_entry_sign: dangerJS against 9268123b3e2d0b2d329f05a98686fb06c76c89c4
CodSpeed Performance Report
Merging #14231 will not alter performance
Comparing JCQuintas:12344-charts-legend-actions-eg-highlighting (9268123) with master (4f2a244)
Summary
✅ 3 untouched benchmarks
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 🤔
I'm wondering if we add just the onItem click are we shooting in our foot for a more interactive ContinuousColorLegend. It might be complicated to add range handlers if we already have a onItemClick.
Do you have a specific uscase in mind that would be possible to create with this onItemClick for continuous range?
Do you have a specific uscase in mind that would be possible to create with this
onItemClickfor continuous range?
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, click on 1.54 on the continuous scale the user could filter whatever they like (values between 0.54 to 2.54, but I left it as a comment mostly because I don't see much value in that 😅
Not really, it was just a thought that occurred to me when I noticed the continuous label is very different from the others.
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.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
Waiting for resolution of https://github.com/mui/mui-x/pull/14391 and https://github.com/mui/mui-x/pull/14392 before finalising this
This pull request has conflicts, please resolve those before we can evaluate the pull request.