Skip to content

Getting image coordinates for a click #1706

Answered by jonatanklosko
kipcole9 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey Kip! So you are looking for something like a click event on an image with the mouse metadata? There isn't a built-in way do this with kino/livebook, but technically you should be able to build a custom component using Kino.JS.Live where you render an image, then capture any events, or even allow for more complex interactions like region selection, etc. One thing to be careful with is the actual coordinates, we would either need to render the full-sized image with possible scrolls, or adjust the coordinates in case the image is scale to fit the page.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by kipcole9
Comment options

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

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