I am trying to build an app in which the user has to select from a choice of images (which are actually altair chart objects). I have attached a screenshot of what it currently looks like. I would like for users to be able to click the chart directly and for me to collect the corresponding data. Is there a way to do this? If not, I would really appreciate any suggestions on how to make the selection cleaner, because in its current state it is not very intuitive.
With altair you can select portions of the graph and it can perform an interaction: https://altair-viz.github.io/user_guide/interactions.html
There is no way to communicate this back to streamlit directly using altair but this package should do the trick:
Thank you! Do you know of any way to select an entire chart? It seems like Altair will only let you click specific sections.
Nope! Though I thought Altair should allow you to select everything? Have never tried this. But take a look at the various st components, one of them might do the job: