Hi! I’m new to Streamlit
So, in my project I have two tabs. In “tab1”, I have a “button” that, if clicked, calculates stuff and outputs graphics. Alright, that is already done.
In “tab2” I have a “selectbox” that also will output some stuff based on the selection of the user but, also, based on some variables that are calculated after the button is clicked on “tab1”
The problem is, as far as I know, everytime an user interacts with the “selectbox” it runs the whole code and all things that were calculated “tab1” disappear, I guess because they are all inside an “if button”.
My goal is to avoid it, the logic is:
1- If button on “tab1” => apply some lines of code that calculates things and show graphics on “tab1”
2- If something is selected on the “tab2”, after the button is clicked at least once => apply some other specific lines of code that outputs some information on “tab2” without clearing “tab1”
I don’t know If I made myself clear, I’m sorry if it’s confusing. I believe that the solution is something with session states or cache_data, but I’ve been trying with it and no success.
Thanks for your attention!