yotkadata / meteo_hist

A web app to create interactive temperature and precipitation graphs for places around the world
https://yotka.org/meteo-hist/
Other
47 stars 4 forks source link

[Feature request] Add support to query string in URL #1

Closed jenkin closed 1 year ago

jenkin commented 1 year ago

Actual behavior

If you set up parameters and create a chart, URL doesn't change and sharing a specific location is not possible.

Expected behavior

On create, URL query string updates with all chosen parameters values. If page is loaded with a valid query string, parameters are initialized with chosen values.

Bonus

Add a "share this" button and/or an embed code for current location.

yotkadata commented 1 year ago

Thanks @jenkin, it's definitely a good idea! The current setting using a rather simple Streamlit app doesn't allow this feature. But when I have time, I'll look into st.experimental_get_query_params. It should be possible with it.

yotkadata commented 1 year ago

I just added that feature: https://github.com/yotkadata/meteo_hist/commit/922f6e7c7785d38d1c6d71227a594e79e3e62d11

When you create a graph, you'll find a share link below.

jenkin commented 1 year ago

Awesome, thanks!