Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

onClick callback signature #260

Open
kczx3 opened this issue Nov 1, 2021 · 6 comments
Open

onClick callback signature #260

kczx3 opened this issue Nov 1, 2021 · 6 comments
Milestone

Comments

@kczx3
Copy link

kczx3 commented Nov 1, 2021

Issue Description

Are the arguments passed to the onClick callback function documented anywhere? I can't seem to find it anywhere on the documentation site.

Additional Context / Screenshots

@AshishMotanamGurunadham
Copy link
Contributor

@kczx3 onClick callback is completely upto the consumer, we just accept a call back function and set it up as needed. You can refer to below example to get good view about callback function.

https://github.com/cerner/terra-graphs/blob/main/packages/carbon-graphs/dev/examples/popup.js

@kczx3
Copy link
Author

kczx3 commented Nov 3, 2021

I think it would be a good idea to document the callback function signature including the types of each argument.

@kczx3
Copy link
Author

kczx3 commented Nov 3, 2021

If I had to guess, the last argument is actually a D3 Selection, not a "DOM object" as is mentioned here:

const dataPointActionHandler = (value, index, target) => {

@AshishMotanamGurunadham
Copy link
Contributor

Yes, you can also see that in the method documentation.

@kczx3
Copy link
Author

kczx3 commented Nov 8, 2021

:) Would still be good to have on your published documentation site though rather than hidden in the source.

@chrismichalewicz
Copy link

UXPLATFORM-6606 was logged to track this internally.

@xenoworf xenoworf added this to the Backlog milestone May 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants