Skip to content

Commit 174a150

Browse files
authored
Update menu and fix charts
Update menu and fix charts
2 parents 79ad11f + 3c7929e commit 174a150

File tree

4 files changed

+41
-57
lines changed

4 files changed

+41
-57
lines changed

src/chime_dash/app/components/menu.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,13 @@ def get_html(self) -> List[ComponentMeta]:
2323
"Predictive Healthcare",
2424
href="http://predictivehealthcare.pennmedicine.org/",
2525
external_link=True,
26+
target="_blank",
2627
),
2728
dbc.DropdownMenuItem(
28-
"Contact Us",
29-
href="http://predictivehealthcare.pennmedicine.org/contact/",
30-
external_link=True,
31-
),
32-
dbc.DropdownMenuItem(
33-
"User Docs",
29+
"How to Use CHIME",
3430
href="https://code-for-philly.gitbook.io/chime/",
3531
external_link=True,
36-
),
37-
dbc.DropdownMenuItem(
38-
"GitHub",
39-
href="https://github.com/CodeForPhilly/chime",
40-
external_link=True,
41-
),
42-
dbc.DropdownMenuItem(
43-
"Slack",
44-
href="https://codeforphilly.org/chat?channel=covid19-chime-penn",
32+
target="_blank",
4533
),
4634
],
4735
in_navbar=True,
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
title: "CHIME: COVID-19 Hospital Impact Model for Epidemics"
2-
description: "*This tool was developed by the [Predictive Healthcare team](http://predictivehealthcare.pennmedicine.org/) at Penn Medicine to assist hospitals and public health officials with hospital capacity planning, but can be used anywhere in the world. Customize it for your region by modifying inputs in the left pane, or read the [User Documentation](https://code-for-philly.gitbook.io/chime/) to learn more.*"
2+
description: "
3+
**Notice**: *There is a high degree of uncertainty about the details of COVID-19 infection, transmission, and the effectiveness of social distancing measures. Long-term projections made using this simplified model of outbreak progression should be treated with extreme caution.*\n
4+
5+
This tool was developed by [Predictive Healthcare](http://predictivehealthcare.pennmedicine.org/) at Penn Medicine to assist hospitals and public health officials with hospital capacity planning. Please read [How to Use CHIME](https://code-for-philly.gitbook.io/chime/) to customize inputs for your region."

src/penn_chime/charts.py

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,23 @@ def build_admits_chart(
3030
.encode(x=alt.X(**x), y=alt.Y(**y), color=color, tooltip=tooltip)
3131
.mark_line(point=True)
3232
.encode(
33-
x=alt.X(**x_kwargs),
34-
y=alt.Y("value:Q", title="Daily admissions", scale=y_scale),
35-
color="key:N",
36-
tooltip=[
37-
tooltip_dict[as_date],
38-
alt.Tooltip("value:Q", format=".0f", title="Admissions"),
39-
"key:N",
40-
],
33+
x=alt.X(**x),
34+
y=alt.Y(**y),
35+
color=color,
36+
tooltip=tooltip,
4137
)
42-
.configure_legend(orient="bottom")
43-
.interactive()
4438
)
4539
bar = (
4640
alt.Chart()
4741
.encode(x=alt.X(**x))
4842
.transform_filter(alt.datum.day == 0)
4943
.mark_rule(color="black", opacity=0.35, size=2)
5044
)
51-
return alt.layer(points, bar, data=admits_floor_df)
45+
return (
46+
alt.layer(points, bar, data=admits_floor_df)
47+
.configure_legend(orient="bottom")
48+
.interactive()
49+
)
5250

5351

5452
def build_census_chart(
@@ -71,25 +69,23 @@ def build_census_chart(
7169
.encode(x=alt.X(**x), y=alt.Y(**y), color=color, tooltip=tooltip)
7270
.mark_line(point=True)
7371
.encode(
74-
x=alt.X(**x_kwargs),
75-
y=alt.Y("value:Q", title="Census", scale=y_scale),
76-
color="key:N",
77-
tooltip=[
78-
idx,
79-
alt.Tooltip("value:Q", format=".0f", title="Census"),
80-
"key:N",
81-
],
72+
x=alt.X(**x),
73+
y=alt.Y(**y),
74+
color=color,
75+
tooltip=tooltip,
8276
)
83-
.configure_legend(orient="bottom")
84-
.interactive()
8577
)
8678
bar = (
8779
alt.Chart()
8880
.encode(x=alt.X(**x))
8981
.transform_filter(alt.datum.day == 0)
9082
.mark_rule(color="black", opacity=0.35, size=2)
9183
)
92-
return alt.layer(points, bar, data=census_floor_df)
84+
return (
85+
alt.layer(points, bar, data=census_floor_df)
86+
.configure_legend(orient="bottom")
87+
.interactive()
88+
)
9389

9490

9591
def build_sim_sir_w_date_chart(
@@ -112,21 +108,23 @@ def build_sim_sir_w_date_chart(
112108
.encode(x=alt.X(**x), y=alt.Y(**y), color=color, tooltip=tooltip)
113109
.mark_line()
114110
.encode(
115-
x=alt.X(**x_kwargs),
116-
y=alt.Y("value:Q", title="Case Volume", scale=y_scale),
117-
tooltip=["key:N", "value:Q"],
118-
color="key:N",
111+
x=alt.X(**x),
112+
y=alt.Y(**y),
113+
color=color,
114+
tooltip=tooltip,
119115
)
120-
.configure_legend(orient="bottom")
121-
.interactive()
122116
)
123117
bar = (
124118
alt.Chart()
125119
.encode(x=alt.X(**x))
126120
.transform_filter(alt.datum.day == 0)
127121
.mark_rule(color="black", opacity=0.35, size=2)
128122
)
129-
return alt.layer(points, bar, data=sim_sir_w_date_floor_df)
123+
return (
124+
alt.layer(points, bar, data=sim_sir_w_date_floor_df)
125+
.configure_legend(orient="bottom")
126+
.interactive()
127+
)
130128

131129

132130
def build_descriptions(

src/penn_chime/presentation.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,17 @@ def display_header(st, m, p):
5151
""",
5252
unsafe_allow_html=True,
5353
)
54-
st.markdown(
55-
"""[Documentation]({docs_url}) | [Github](https://github.com/CodeForPhilly/chime/) |
56-
[Slack](https://codeforphilly.org/chat?channel=covid19-chime-penn)""".format(
57-
docs_url=DOCS_URL
58-
)
59-
)
60-
st.markdown(
61-
"""*This tool was developed by the [Predictive Healthcare team](http://predictivehealthcare.pennmedicine.org/) at
62-
Penn Medicine to assist hospitals and public health officials with hospital capacity planning.*"""
63-
)
6454
st.markdown(
6555
"""**Notice**: *There is a high
66-
degree of uncertainty about the details of COVID-19 infection, transmission, and the effectiveness of social distancing
67-
measures. Long-term projections made using this simplified model of outbreak progression should be treated with extreme caution.*
56+
degree of uncertainty about the details of COVID-19 infection, transmission, and the effectiveness of social distancing
57+
measures. Long-term projections made using this simplified model of outbreak progression should be treated with extreme caution.*
6858
"""
6959
)
60+
st.markdown(
61+
"""
62+
This tool was developed by [Predictive Healthcare](http://predictivehealthcare.pennmedicine.org/) at
63+
Penn Medicine to assist hospitals and public health officials with hospital capacity planning.
64+
Please read [How to Use CHIME]({docs_url}) to customize inputs for your region.""".format(docs_url=DOCS_URL))
7065

7166
st.markdown(
7267
"""The estimated number of currently infected individuals is **{total_infections:.0f}**. This is based on current inputs for

0 commit comments

Comments
 (0)