Skip to content

Capture 'click' event on a track-data #1090

Answered by sehilyi
miguelocana asked this question in Q&A
Discussion options

You must be logged in to vote

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.,

experimental: {
    mouseEvents: true
},

Example: https://github.com/gosling-lang/gosling-react-example/blob/e11178bc255af6bb4653f9923052e326bf55b720/src/example/MouseEvents.jsx#L83C14-L89C17

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@miguelocana
Comment options

Answer selected by miguelocana
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants