Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -239,49 +239,30 @@ if fetch_data:
|
|
239 |
completeness_df = pd.DataFrame({"Field": completeness.index, "Completeness (%)": completeness.values})
|
240 |
completeness_table = completeness_df.set_index("Field")
|
241 |
|
242 |
-
#
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
quick_stats_df_reset.style
|
248 |
-
.background_gradient(cmap="Reds", subset=["Value"]) # π₯ red theme
|
249 |
-
.format({"Value": "{:.1f}"})
|
250 |
-
.set_properties(**{
|
251 |
-
"text-align": "center",
|
252 |
-
"color": "lightgray",
|
253 |
-
"font-size": "1rem",
|
254 |
-
"font-weight": "bold",
|
255 |
-
"border-color": "#2b2b2b",
|
256 |
-
})
|
257 |
-
)
|
258 |
|
259 |
-
#
|
260 |
st.sidebar.markdown("""
|
261 |
<div style='
|
262 |
-
background-color: #
|
263 |
padding: 1.5rem;
|
264 |
border-radius: 12px;
|
265 |
margin-bottom: 1.5rem;
|
266 |
-
box-shadow: 0 8px
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
onmouseout="this.style.transform='scale(1)'; this.style.boxShadow='0 8px 16px rgba(0,0,0,0.3)';"
|
271 |
-
>
|
272 |
-
<h4 style='color: #ff7f7f; margin-bottom: 1rem;'>π Quick Stats</h4>
|
273 |
""", unsafe_allow_html=True)
|
274 |
|
275 |
-
|
276 |
-
st.sidebar.dataframe(
|
277 |
-
styled_stats,
|
278 |
-
use_container_width=True,
|
279 |
-
height=250,
|
280 |
-
hide_index=True
|
281 |
-
)
|
282 |
|
283 |
-
|
284 |
-
st.sidebar.
|
|
|
285 |
|
286 |
# Calculate Top 10 Subjects
|
287 |
if 'subject' in metadata_df.columns:
|
|
|
239 |
completeness_df = pd.DataFrame({"Field": completeness.index, "Completeness (%)": completeness.values})
|
240 |
completeness_table = completeness_df.set_index("Field")
|
241 |
|
242 |
+
# Sidebar Quick Stats (fancy card version)
|
243 |
+
quick_stats_df = pd.DataFrame({
|
244 |
+
"Metric": ["Total Records", "Incomplete Records", "Overall Completeness (%)"],
|
245 |
+
"Value": [len(metadata_df), incomplete_count, round(overall_percent, 1)]
|
246 |
+
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
|
248 |
+
# Card-like background container
|
249 |
st.sidebar.markdown("""
|
250 |
<div style='
|
251 |
+
background-color: #2b2b2b;
|
252 |
padding: 1.5rem;
|
253 |
border-radius: 12px;
|
254 |
margin-bottom: 1.5rem;
|
255 |
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
|
256 |
+
'>
|
257 |
+
<h4 style='color: #FFA500; margin-bottom: 1rem;'>π Quick Stats</h4>
|
258 |
+
</div>
|
|
|
|
|
|
|
259 |
""", unsafe_allow_html=True)
|
260 |
|
261 |
+
quick_stats_df_reset = quick_stats_df.reset_index(drop=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
262 |
|
263 |
+
styled_stats = quick_stats_df_reset.style.background_gradient(cmap="Oranges", subset=["Value"]).format({"Value": "{:.1f}"})
|
264 |
+
st.sidebar.table(styled_stats)
|
265 |
+
|
266 |
|
267 |
# Calculate Top 10 Subjects
|
268 |
if 'subject' in metadata_df.columns:
|