I am using python version 3.12 and streamlit version 1.35. I am trying to select data from a plotly chart which contains normal x and y values. The values are loaded from a csv file. I am also using caching to reduce runtime.
When I click a point on the plotly chart , i am not getting a dictionary of selections , instead the whole page reruns and the dictionary Displayed is empty. I am wondering what could be the issue. When i do this on a different app , it works.
Is there a limit on the number of points on the plot under which selections can work or maybe its a different issue?
Constrain your conditions. Do it step by step. Don’t rely 100% on your logic. Anything can happen in programming.
Take data1, use it in app1. Is there an issue? Try the same data on app2. Is there an issue? Then move forward with data2, test with app1 and app2, etc.
Hi there, I seem to have figured out something. So, when I use numpy.random.choice in any part of the code which renders the plots, the selections don’t work. I have removed the random choice and now it works
Not sure if this is an issue with streamlit or is just my code.
Thanks for the suggestion to go step by step! Appreciate!
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.