CCockrum commited on
Commit
357bd92
Β·
verified Β·
1 Parent(s): cce15e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -7
app.py CHANGED
@@ -119,7 +119,7 @@ collections = {
119
  metadata_df = pd.DataFrame()
120
 
121
  # Add a key to the selectbox to ensure it refreshes properly
122
- selected = st.sidebar.selectbox("Select a collection", list(collections.keys()), key="collection_selector")
123
  search_query = collections[selected]
124
 
125
  # Define the collection URL
@@ -201,17 +201,27 @@ if fetch_data:
201
  completeness_df = pd.DataFrame({"Field": completeness.index, "Completeness (%)": completeness.values})
202
  completeness_table = completeness_df.set_index("Field")
203
 
204
- # πŸ“Š Sidebar Quick Stats
205
  stats_html = f"""
206
- <div class="sidebar-contrast-block">
207
- <h4 style="color: lightgray;">Quick Stats</h4>
208
- <p style="color:lightgray;">Total Records: <b>{len(metadata_df)}</b></p>
209
- <p style="color:lightgray;">Incomplete Records: <b>{incomplete_count}</b></p>
210
- <p style="color:lightgray;">Overall Completeness: <b>{overall_percent:.1f}%</b></p>
 
 
 
 
 
 
 
 
211
  </div>
212
  """
213
  stats_placeholder.markdown(stats_html, unsafe_allow_html=True)
214
 
 
 
215
  # Calculate Top 10 Subjects
216
  if 'subject' in metadata_df.columns:
217
  top_subjects = (
 
119
  metadata_df = pd.DataFrame()
120
 
121
  # Add a key to the selectbox to ensure it refreshes properly
122
+ selected = st.sidebar.radio("Select a Collection", list(collections.keys()), key="collection_selector")
123
  search_query = collections[selected]
124
 
125
  # Define the collection URL
 
201
  completeness_df = pd.DataFrame({"Field": completeness.index, "Completeness (%)": completeness.values})
202
  completeness_table = completeness_df.set_index("Field")
203
 
204
+ # Sidebar Quick Stats
205
  stats_html = f"""
206
+ <div style='
207
+ background-color: #2b2b2b;
208
+ padding: 1.5rem;
209
+ border-radius: 12px;
210
+ margin-bottom: 1.5rem;
211
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
212
+ '>
213
+ <h4 style='color: #90EE90; margin-bottom: 1rem;'>πŸ“Š Quick Stats</h4>
214
+ <div style='color: lightgray; line-height: 1.8; font-size: 0.95rem;'>
215
+ <b>Total Records:</b> {len(metadata_df)}<br>
216
+ <b>Incomplete Records:</b> {incomplete_count}<br>
217
+ <b>Overall Completeness:</b> {overall_percent:.1f}%
218
+ </div>
219
  </div>
220
  """
221
  stats_placeholder.markdown(stats_html, unsafe_allow_html=True)
222
 
223
+ stats_placeholder.markdown(stats_html, unsafe_allow_html=True)
224
+
225
  # Calculate Top 10 Subjects
226
  if 'subject' in metadata_df.columns:
227
  top_subjects = (