-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
62 lines (41 loc) · 1.32 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import streamlit as st
import numpy as np
import pandas as pd
# import plotly.express as px
# import plotly.graph_objects as go
# my files
import data
import static
st.set_page_config(layout="wide")
st.header("NSW Covid Dashboard")
with st.beta_expander("This page -does- will do stuff"):
st.write(
"""
Currently just a simple static graph of daily cases in NSW. More to follow:
- interactive version of cases
- vaccine plots
- extrapolation of cases and the effect of Vaccines
Now all this is done already on much better dashboards, so this is just for my own self.
Wear a mask.
"""
)
# col1, col2, col3, col4 = st.beta_columns(4)
# for i, col in enumerate(st.beta_columns(3)):
# col.button(f"R_{i+1}")
# col.bar_chart(np.random.random((10, 3)))
# we will need session state sooner or later, see
# https://docs.streamlit.io/en/stable/add_state_app.html
@st.cache(ttl=1600, suppress_st_warning=True)
def get_data():
df = data.get_data()
print(f"using dataframe with shape {df.shape}")
return df
df = get_data()
fig = static.make_plot(df)
st.markdown("""
The orange line is the number of cases Full Infectious + Partly + Unknown cases which are likely isolating.
""")
st.pyplot(fig)
st.subheader("Raw Data")
st.write("this data is a bit too busy....")
st.write(df)