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
Legend onClick callback supports arrow functions #7410
Conversation
The `Legend` is no longer implicitly found through `this` and instead passed as an explicit argument to the callback functions.
@kurkle @benmccann I'm not sure the best way to document these callbacks. I've been doing a lot of typescript lately and am tempted to try typing out parts of our code. The type signature for the legend callbacks would be |
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.
lgtm. just one comment
I haven't used typescript enough to have much opinion on it, but I lean towards being favorable on it. I'm just starting my first project where I'm trying to write it all in TypeScript, but just started setting it up yesterday
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.
Feels like our events should always have the chart instance as a parameter. But I don't think we want to alter the callback signatures that much.
lgtm.
#7409 Legend callbacks support arrow functions The `Legend` is no longer implicitly found through `this` and instead passed as an explicit argument to the callback functions.
Work Done
onClick
,onHover
, andonLeave
callbacks receive the legend as a 3rd parameteronClick
,onHover
, andonLeave
callbacks receive the wrapped event as the 1st parameteronClick
andonHover
callbacks receive the chart as a 3rd parameteronClick
andonHover
callbacks receive the chart as a 3rd parameterResolves #7409