Collect data from an image

I’m using a plotly.graph_objs._image to show an image.
When my mouse hover the image it show the X position oof the mous, the Y position of the mouse and the RGB color of the pixel.
I wan’t to collect and store those informations when i use a click but i am not able to found theses informations and not able to detect a mouse click on the image.

Hi @Hugo_Lavezac, welcome to the Streamlit community!

By default, plotly charts within Streamlit don’t return information back to Python, as this isn’t part of the base plotly library. @andfanilo wrote an example using Plotly towards make a bi-directional Streamlit component to do this, which you can read here:

I think it would be an awesome contribution to the community if someone undertook writing a full set of bidirectional communications between Streamlit and Plotly!

Best,
Randy

2 Likes