Darren Wiens
commited on
add download button
Browse files
app.py
CHANGED
@@ -29,7 +29,7 @@ show_dt = st.checkbox("Show timestamp", True)
|
|
29 |
|
30 |
fetch_data = st.checkbox("Refresh data", False)
|
31 |
|
32 |
-
if st.button("
|
33 |
smoke_url = "https://firesmoke.ca/forecasts/current/dispersion.nc"
|
34 |
smoke_nc = "./data/dispersion.nc"
|
35 |
if not os.path.isfile(smoke_nc) or fetch_data:
|
@@ -94,7 +94,12 @@ if st.button("Plot Data"):
|
|
94 |
last_dt = dts[-1]
|
95 |
|
96 |
st.image(buffer, caption=f"{first_dt} to {last_dt}")
|
|
|
|
|
|
|
97 |
|
98 |
with st.expander("Data Sources"):
|
99 |
st.markdown(f"Smoke forecast: [FireSmoke Canada](https://firesmoke.ca/)")
|
100 |
-
st.markdown(
|
|
|
|
|
|
29 |
|
30 |
fetch_data = st.checkbox("Refresh data", False)
|
31 |
|
32 |
+
if st.button("Create GIF"):
|
33 |
smoke_url = "https://firesmoke.ca/forecasts/current/dispersion.nc"
|
34 |
smoke_nc = "./data/dispersion.nc"
|
35 |
if not os.path.isfile(smoke_nc) or fetch_data:
|
|
|
94 |
last_dt = dts[-1]
|
95 |
|
96 |
st.image(buffer, caption=f"{first_dt} to {last_dt}")
|
97 |
+
st.download_button(
|
98 |
+
label="Download GIF", data=buffer, file_name="firesmoke.gif", mime="image/gif"
|
99 |
+
)
|
100 |
|
101 |
with st.expander("Data Sources"):
|
102 |
st.markdown(f"Smoke forecast: [FireSmoke Canada](https://firesmoke.ca/)")
|
103 |
+
st.markdown(
|
104 |
+
f"Administrative boundaries: [Natural Earth, 1:50M Admin 1 – States, provinces](https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/cultural/ne_50m_admin_1_states_provinces.zip)"
|
105 |
+
)
|