CCockrum commited on
Commit
e52af29
Β·
verified Β·
1 Parent(s): 4e07134

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -18
app.py CHANGED
@@ -241,25 +241,19 @@ if fetch_data:
241
  completeness_table = completeness_df.set_index("Field")
242
 
243
  # Sidebar Quick Stats
244
- stats_html = f"""
245
- <div style='
246
- background-color: #2b2b2b;
247
- padding: 1.5rem;
248
- border-radius: 12px;
249
- margin-bottom: 1.5rem;
250
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
251
- '>
252
- <h4 style='color: #90EE90; margin-bottom: 1rem;'>πŸ“Š Quick Stats</h4>
253
- <div style='color: lightgray; line-height: 1.8; font-size: 0.95rem;'>
254
- <b>Total Records:</b> {len(metadata_df)}<br>
255
- <b>Incomplete Records:</b> {incomplete_count}<br>
256
- <b>Overall Completeness:</b> {overall_percent:.1f}%
257
- </div>
258
- </div>
259
- """
260
- stats_placeholder.markdown(stats_html, unsafe_allow_html=True)
261
 
262
- stats_placeholder.markdown(stats_html, unsafe_allow_html=True)
263
 
264
  # Calculate Top 10 Subjects
265
  if 'subject' in metadata_df.columns:
 
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: