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

How to add onClick event to each point #6

Open
velusian opened this issue Jan 17, 2022 · 2 comments
Open

How to add onClick event to each point #6

velusian opened this issue Jan 17, 2022 · 2 comments

Comments

@velusian
Copy link

Hello, I'm trying to add an "onClick" event to each point, but cannot find any documentation on how to do so. The latest version of d3fc is 15.2 but I can only found docs on v. 13. Can you please help?
Thank you!

@ColinEberhardt
Copy link
Owner

You get click events with DOM (or SVG nodes), however, they don't exist for Canvas or WebGL. This plot uses WebGL, so hence they are not triggered!

You'll have to 'synthesise' this event yourself, by monitoring mouse location and clicks - see:

https://github.com/ColinEberhardt/d3fc-webgl-hathi-explorer/blob/master/index.js#L117

@velusian
Copy link
Author

OK thank you Colin, I knew this technique for Canvas but not for WebGL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants