fonsp / PlutoImageCoordinatePicker.jl

Get the coordinate where you clicked back through `@bind` in a Pluto.jl notebook
The Unlicense
7 stars 0 forks source link

Support ImageCoordinatePicker(image) from Images.jl #3

Open chelate opened 1 month ago

chelate commented 1 month ago

What I found is that the java script seems to not like the 64 encoded images, but the html doesnt mind. Therefore if you place your image first, and then add the java interaction on top, it seems to work. I will share my solution when it is working suffienciently well for me.

fonsp commented 1 month ago

What is not working? Can you share a notebook file and a screenshot that shows what is broken (not just your fix)?

chelate commented 1 month ago

Sorry! I opened this issue while I was "in the zone" without really mentally leaving my problem context.

With a URL it works ok in my notebook as per the documentation examples. I couldn't figure out how to turn a julia RGB matrix as an appropriate Vector{UInt8} to serve as direct input.

In trying to get it working I wrote a slightly different functionality that I could use, maybe this is helpful for expanding this package beyond a single function? The behaviour isn't perfect and the type annotations are too specific, but getting the javascript to interpolate a matrix without understanding js was the hard part.

working_image_selector.txt

I guess definitely close or at least rename this issue.

chelate commented 1 month ago

oh and heres a screenshot of my attempt. Yes, I guess its not supposed to work. Love the coot chicks by the way. Yet another Dutch easter egg in your code, they remind me of the park near where I used to live in Bergen op Zoom. :)

Screenshot 2024-06-06 at 11 23 25