Capture 'click' event on a track-data #1090
Answered
by
sehilyi
miguelocana
asked this question in
Q&A
-
Hi, is it possible to capture the 'click' event on a track-data element? For instance, to redirect to a URL. |
Beta Was this translation helpful? Give feedback.
Answered by
sehilyi
Oct 17, 2024
Replies: 1 comment 1 reply
-
Hi @miguelocana! You can subscribe to the "click" event through JS API (doc). You can find a similar example in our Gosling React Example repository, where it uses the "rangeSelect" event instead: Be sure to turn on the click event in your track specification, i.e., experimental: {
mouseEvents: true
}, |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
miguelocana
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @miguelocana!
You can subscribe to the "click" event through JS API (doc).
You can find a similar example in our Gosling React Example repository, where it uses the "rangeSelect" event instead:
https://github.com/gosling-lang/gosling-react-example/blob/e11178bc255af6bb4653f9923052e326bf55b720/src/example/MouseEvents.jsx#L19-L37
Be sure to turn on the click event in your track specification, i.e.,
Example: https://github.com/gosling-lang/gosling-react-example/blob/e11178bc255af6bb4653f9923052e326bf55b720/src/example/MouseEvents.jsx#L83C14-L89C17