示例#1
0
# This should not be hidden in prod, but removed
# In dev, this should be shown
st.markdown(hide_menu_style, unsafe_allow_html=True)

p = display_sidebar(st, DEFAULTS)
m = SimSirModel(p)

display_header(st, m, p)

if st.checkbox("Show more info about this tool"):
    notes = "The total size of the susceptible population will be the entire catchment area for Penn Medicine entities (HUP, PAH, PMC, CCH)"
    show_more_info_about_this_tool(st=st, model=m, parameters=p, defaults=DEFAULTS, notes=notes)

st.subheader("New Admissions")
st.markdown("Projected number of **daily** COVID-19 admissions at Penn hospitals")
new_admit_chart = new_admissions_chart(alt, m.admits_df, parameters=p)
st.altair_chart(
    new_admissions_chart(alt, m.admits_df, parameters=p),
    use_container_width=True,
)

st.markdown(chart_descriptions(new_admit_chart, p.labels))

if st.checkbox("Show Projected Admissions in tabular form"):
    if st.checkbox("Show Daily Counts"):
        draw_projected_admissions_table(st, m.admits_df, p.labels, 1, as_date=p.as_date)
    else:
        admissions_day_range = st.slider(
            label="Interval of Days",
            key="admissions_day_range_slider",
            min_value=1,
示例#2
0
文件: app.py 项目: JHON-EDV/chime
    )

# PRESENTATION
# Two more combination variable initialization / input element creation
as_date = st.checkbox(label="Present result as dates instead of days", value=False)
display_n_days_slider(st, p, DEFAULTS)

# begin format data
admissions_df = build_admissions_df(p=p) # p.n_days, *p.dispositions)
census_df = build_census_df(admissions_df, parameters=p)
# end format data

st.subheader("New Admissions")
st.markdown("Projected number of **daily** COVID-19 admissions at Penn hospitals")
st.altair_chart(
    new_admissions_chart(alt, admissions_df, parameters=p, as_date=as_date), use_container_width=True
)
if st.checkbox("Show Projected Admissions in tabular form"):
    draw_projected_admissions_table(st, admissions_df, as_date=as_date)
st.subheader("Admitted Patients (Census)")
st.markdown(
    "Projected **census** of COVID-19 patients, accounting for arrivals and discharges at Penn hospitals"
)
st.altair_chart(
    admitted_patients_chart(alt=alt, census=census_df, parameters=p, as_date=as_date), use_container_width=True
)
if st.checkbox("Show Projected Census in tabular form"):
    draw_census_table(st, census_df, as_date=as_date)
st.markdown(
    """**Click the checkbox below to view additional data generated by this simulation**"""
)