Update app.py
Browse files
app.py
CHANGED
|
@@ -68,6 +68,12 @@ section.main > div { padding-top: 0.5rem; }
|
|
| 68 |
</style>
|
| 69 |
"""
|
| 70 |
st.markdown(DARK_CSS, unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
|
| 72 |
# -------------------- CONFIG --------------------
|
| 73 |
SLOTS = [
|
|
@@ -284,7 +290,19 @@ with tab_dash:
|
|
| 284 |
"Expected": expected,
|
| 285 |
"Actual": slot_counts
|
| 286 |
})
|
| 287 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 288 |
|
| 289 |
st.markdown("### Less Attendance (Last 7 days)")
|
| 290 |
low_df = pd.DataFrame(columns=["member_id","checkins_7d"])
|
|
|
|
| 68 |
</style>
|
| 69 |
"""
|
| 70 |
st.markdown(DARK_CSS, unsafe_allow_html=True)
|
| 71 |
+
st.markdown("""
|
| 72 |
+
<style>
|
| 73 |
+
h2, .stMarkdown h2 { letter-spacing: .3px; font-weight: 800; }
|
| 74 |
+
hr.sep { border: 0; height: 1px; background: rgba(255,255,255,0.08); margin: 8px 0 16px; }
|
| 75 |
+
</style>
|
| 76 |
+
""", unsafe_allow_html=True)
|
| 77 |
|
| 78 |
# -------------------- CONFIG --------------------
|
| 79 |
SLOTS = [
|
|
|
|
| 290 |
"Expected": expected,
|
| 291 |
"Actual": slot_counts
|
| 292 |
})
|
| 293 |
+
import altair as alt
|
| 294 |
+
df_long = df.melt("Slot", var_name="Type", value_name="Count")
|
| 295 |
+
chart = (
|
| 296 |
+
alt.Chart(df_long)
|
| 297 |
+
.mark_bar()
|
| 298 |
+
.encode(
|
| 299 |
+
x=alt.X("Slot:N", sort=list(df["Slot"])),
|
| 300 |
+
y=alt.Y("Count:Q"),
|
| 301 |
+
color=alt.Color("Type:N"),
|
| 302 |
+
tooltip=["Slot","Type","Count"]
|
| 303 |
+
)
|
| 304 |
+
)
|
| 305 |
+
st.altair_chart(chart, use_container_width=True)
|
| 306 |
|
| 307 |
st.markdown("### Less Attendance (Last 7 days)")
|
| 308 |
low_df = pd.DataFrame(columns=["member_id","checkins_7d"])
|