Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide parameters in URL #2

Open
jgieseler opened this issue Sep 6, 2021 · 2 comments · Fixed by #8
Open

Provide parameters in URL #2

jgieseler opened this issue Sep 6, 2021 · 2 comments · Fixed by #8
Assignees
Labels
enhancement New feature or request

Comments

@jgieseler
Copy link
Owner

Introduce the possibility to provide parameters that are set in the left bar directly in the URL. This would enable the user to:

  • save a specific layout as a bookmark (handy so that one doesn't have to set all the parameters again and again)
  • share a specific layout with others

URL could e.g. look like this: https://solar-mach.github.io/?date=20200417&time=0130&bodies=Earth,BepiColombo,PSP&vsw=400,300,500

@jgieseler jgieseler added the enhancement New feature or request label Sep 6, 2021
@jgieseler jgieseler self-assigned this Sep 6, 2021
@jgieseler jgieseler linked a pull request Dec 16, 2021 that will close this issue
@jgieseler jgieseler reopened this Dec 16, 2021
@jgieseler
Copy link
Owner Author

In general, the functionality is working now. A URL like https://share.streamlit.io/jgieseler/solar-mach?date=20210407&time=1630&plot_nr=1&bodies=STEREO+A&bodies=Earth&bodies=BepiColombo&bodies=Parker+Solar+Probe&bodies=Solar+Orbiter&speeds=400&speeds=400&speeds=400&speeds=400&speeds=400& is clunky but doing its job.

Still an open issue is that the URL parameters so far only work with the full share.streamlit.io/jgieseler/solar-mach URL, but not with the "official" solar-mach.github.io address that is redirecting through an iframe element in the index.html.

@jgieseler
Copy link
Owner Author

jgieseler commented Oct 31, 2022

Maybe it's worth trying to replace the current system using st.experimental_get_query_params() and st.session_state with the one provided by https://pypi.org/project/streamlit-ext/. Because with that in theory the URL should be updated with the current set of settings "on the fly", and in addition adding new parameters would be much easier. (st.experimental_get_query_params() is an experimental feature anyhow.)

@jgieseler jgieseler reopened this Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant