Skip to content

Commit 38f83c9

Browse files
author
Nick Canzoneri
committed
Change projection days from a slider to a number input to allow larger max values
1 parent 76a5a76 commit 38f83c9

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# additional_projections_chart,
88
display_header,
99
display_sidebar,
10-
display_n_days_slider,
10+
display_n_days_input,
1111
draw_census_table,
1212
draw_projected_admissions_table,
1313
draw_raw_sir_simulation_table,
@@ -42,7 +42,7 @@
4242
# PRESENTATION
4343
# Two more combination variable initialization / input element creation
4444
as_date = st.checkbox(label="Present result as dates instead of days", value=False)
45-
display_n_days_slider(st, p, DEFAULTS)
45+
display_n_days_input(st, p, DEFAULTS)
4646

4747
# begin format data
4848
admissions_df = build_admissions_df(p=p) # p.n_days, *p.dispositions)

src/penn_chime/presentation.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,14 +226,13 @@ def display_sidebar(st, d: Constants) -> Parameters:
226226
)
227227

228228

229-
def display_n_days_slider(st, p: Parameters, d: Constants):
230-
"""Display n_days_slider."""
231-
p.n_days = st.slider(
229+
def display_n_days_input(st, p: Parameters, d: Constants):
230+
"""Display n_days_input."""
231+
p.n_days = st.number_input(
232232
"Number of days to project",
233233
min_value=30,
234-
max_value=200,
235234
value=d.n_days,
236-
step=1,
235+
step=10,
237236
format="%i",
238237
)
239238

0 commit comments

Comments
 (0)