CCockrum commited on
Commit
20d01cc
Β·
verified Β·
1 Parent(s): e52af29

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -10
app.py CHANGED
@@ -240,20 +240,32 @@ if fetch_data:
240
  completeness_df = pd.DataFrame({"Field": completeness.index, "Completeness (%)": completeness.values})
241
  completeness_table = completeness_df.set_index("Field")
242
 
243
- # Sidebar Quick Stats
244
- # πŸ“Š Sidebar Quick Stats (new professional table version)
245
  quick_stats_df = pd.DataFrame({
246
  "Metric": ["Total Records", "Incomplete Records", "Overall Completeness (%)"],
247
  "Value": [len(metadata_df), incomplete_count, round(overall_percent, 1)]
248
  })
249
 
250
- with st.sidebar.expander("Quick Stats", expanded=True):
251
- st.dataframe(
252
- quick_stats_df.style.background_gradient(cmap="Oranges", subset=["Value"]).format({"Value": "{:.1f}"}),
253
- use_container_width=True,
254
- height=240
255
- )
256
-
 
 
 
 
 
 
 
 
 
 
 
 
 
257
 
258
  # Calculate Top 10 Subjects
259
  if 'subject' in metadata_df.columns:
@@ -316,7 +328,7 @@ if fetch_data:
316
 
317
  # FILL THE PLACEHOLDER created earlier
318
 
319
- st.subheader("πŸ“Š Field Completeness Breakdown")
320
 
321
  st.markdown("""
322
  <div style='
 
240
  completeness_df = pd.DataFrame({"Field": completeness.index, "Completeness (%)": completeness.values})
241
  completeness_table = completeness_df.set_index("Field")
242
 
243
+ # πŸ“Š Sidebar Quick Stats (fancy card version)
 
244
  quick_stats_df = pd.DataFrame({
245
  "Metric": ["Total Records", "Incomplete Records", "Overall Completeness (%)"],
246
  "Value": [len(metadata_df), incomplete_count, round(overall_percent, 1)]
247
  })
248
 
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: #90EE90; margin-bottom: 1rem;'>πŸ“Š Quick Stats</h4>
258
+ </div>
259
+ """, unsafe_allow_html=True)
260
+
261
+ st.sidebar.dataframe(
262
+ quick_stats_df.style
263
+ .hide(axis="index") # πŸ”₯ Hide index here!
264
+ .background_gradient(cmap="Oranges", subset=["Value"])
265
+ .format({"Value": "{:.1f}"}),
266
+ use_container_width=True,
267
+ height=240
268
+ )
269
 
270
  # Calculate Top 10 Subjects
271
  if 'subject' in metadata_df.columns:
 
328
 
329
  # FILL THE PLACEHOLDER created earlier
330
 
331
+ st.subheader("Field Completeness Breakdown")
332
 
333
  st.markdown("""
334
  <div style='