Hello!
I wonder, is there (possibly even a ‘hacky’) way to save (to streamlit cache or to a file) window coordinates the user mouseclicks on in a displayed widget/chart?
Basically I would love something like ‘onmousedown’ event…?
My aim is to let the app know which displayed box the user clicks on. No input widget can possibly achieve that (there will be too many boxes displayed, so no list selection can help).
I have tried something like this (does not work):
import streamlit
import matplotlib.pyplot as pltdef onclick(event):
print(event.xdata, event.ydata)
streamlit.write(“click”)fig,ax = plt.subplots()
ax.plot(range(10))
fig.canvas.mpl_connect(‘button_press_event’, onclick)
streamlit.write(fig)
streamlit.write(“script paint”)