Giter Club home page Giter Club logo

Comments (4)

giswqs avatar giswqs commented on May 18, 2024 1

This is a known issue related to upraneelnihar/streamlit-multiapps#2. The reason for using st.experimental_set_query_params(**app_state) is to create direct link to preselected sidebar menu, such as the link below. Changing it to t.experimental_set_query_params(**st.session_state.to_dict()) would lose the direct link functionality.

https://share.streamlit.io/giswqs/streamlit-geospatial/app.py?radio=Home&page=Create+Timelapse

from streamlit-geospatial.

huamichaelchen avatar huamichaelchen commented on May 18, 2024

This is what I have tested on my own multi-page app,

Instead of st.experimental_set_query_params(**app_state), I switched to st.experimental_set_query_params(**st.session_state.to_dict())

from streamlit-geospatial.

huamichaelchen avatar huamichaelchen commented on May 18, 2024

Ah, I see. Yup, the same thing happening on my end. Let me poke around ;)

from streamlit-geospatial.

huamichaelchen avatar huamichaelchen commented on May 18, 2024

This is a known issue related to upraneelnihar/streamlit-multiapps#2. The reason for using st.experimental_set_query_params(**app_state) is to create direct link to preselected sidebar menu, such as the link below. Changing it to t.experimental_set_query_params(**st.session_state.to_dict()) would lose the direct link functionality.

https://share.streamlit.io/giswqs/streamlit-geospatial/app.py?radio=Home&page=Create+Timelapse

Not quite sure what happened... But this is how I get it to work for both the "direct link visit" issue and avoid the "double click on the radio button to switch back and forth" issue.

        pressed = st.session_state.radio 
        app_state["page"] = pressed

        st.experimental_set_query_params(**st.session_state.to_dict())
        functions[titles.index(title)]()

It seems that app_state["page"] = st.session_state.radio is the culprit? Because when I have the following:

        app_state["page"] = st.session_state.radio
        st.experimental_set_query_params(**app_state)

Direct visit works, but I have to click on the radio button twice in order to switch to a separate page. It almost as if app_state["page"] = st.session_state.radio assignment ignored the first time a radio button is pressed.

Frankly, a bit confused...

from streamlit-geospatial.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.