Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -117,6 +117,8 @@ search_query = collections[selected]
|
|
117 |
# Define the collection URL
|
118 |
collection_url = f"https://www.loc.gov/search/?q={search_query}&fo=json"
|
119 |
|
|
|
|
|
120 |
|
121 |
# Helpful Resources (styled and moved below dropdown)
|
122 |
st.sidebar.markdown("### Helpful Resources", unsafe_allow_html=True)
|
@@ -209,9 +211,10 @@ if fetch_data:
|
|
209 |
# Show summary statistics in sidebar
|
210 |
# β
Quick Stats (after metadata_df is created and populated)
|
211 |
if not metadata_df.empty:
|
212 |
-
|
213 |
-
|
214 |
-
|
|
|
215 |
|
216 |
st.sidebar.write(f"Incomplete Records: {len(metadata_df[metadata_df.isnull().any(axis=1)])}")
|
217 |
|
|
|
117 |
# Define the collection URL
|
118 |
collection_url = f"https://www.loc.gov/search/?q={search_query}&fo=json"
|
119 |
|
120 |
+
# Create an empty placeholder for Quick Stats
|
121 |
+
stats_placeholder = st.sidebar.empty()
|
122 |
|
123 |
# Helpful Resources (styled and moved below dropdown)
|
124 |
st.sidebar.markdown("### Helpful Resources", unsafe_allow_html=True)
|
|
|
211 |
# Show summary statistics in sidebar
|
212 |
# β
Quick Stats (after metadata_df is created and populated)
|
213 |
if not metadata_df.empty:
|
214 |
+
stats_placeholder.markdown("<h3 class='sidebar-stats'>π Quick Stats</h3>", unsafe_allow_html=True)
|
215 |
+
stats_placeholder.markdown(f"<p style='color:lightgray;'>Total Records: <b>{len(metadata_df)}</b></p>", unsafe_allow_html=True)
|
216 |
+
stats_placeholder.markdown(f"<p style='color:lightgray;'>Incomplete Records: <b>{len(metadata_df[metadata_df.isnull().any(axis=1)])}</b></p>", unsafe_allow_html=True)
|
217 |
+
|
218 |
|
219 |
st.sidebar.write(f"Incomplete Records: {len(metadata_df[metadata_df.isnull().any(axis=1)])}")
|
220 |
|