Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -207,43 +207,18 @@ if fetch_data:
|
|
207 |
# π Sidebar Quick Stats
|
208 |
stats_html = f"""
|
209 |
<div class="sidebar-contrast-block">
|
210 |
-
<h4 style="color: lightgray;"
|
211 |
<p style="color:lightgray;">Total Records: <b>{len(metadata_df)}</b></p>
|
212 |
<p style="color:lightgray;">Incomplete Records: <b>{incomplete_count}</b></p>
|
213 |
<p style="color:lightgray;">Overall Completeness: <b>{overall_percent:.1f}%</b></p>
|
214 |
</div>
|
215 |
"""
|
216 |
-
stats_placeholder.markdown(stats_html, unsafe_allow_html=True
|
217 |
-
|
218 |
-
# π Field Completeness Breakdown (modern expander)
|
219 |
-
with st.sidebar.expander("π Field Completeness Breakdown", expanded=True):
|
220 |
-
st.dataframe(
|
221 |
-
completeness_table.style.background_gradient(cmap="Greens").format("{:.1f}%"),
|
222 |
-
use_container_width=True,
|
223 |
-
height=240
|
224 |
-
)
|
225 |
-
|
226 |
-
# ------------------- Helpful Resources -------------------
|
227 |
-
st.sidebar.markdown("""
|
228 |
-
<div class="sidebar-section">
|
229 |
-
<h3>π Helpful Resources</h3>
|
230 |
-
<div class="sidebar-links">
|
231 |
-
<ul style='padding-left: 1em'>
|
232 |
-
<li><a href="https://www.loc.gov/apis/" target="_blank">LOC API Info</a></li>
|
233 |
-
<li><a href="https://www.loc.gov/" target="_blank">Library of Congress Homepage</a></li>
|
234 |
-
<li><a href="https://www.loc.gov/collections/" target="_blank">LOC Digital Collections</a></li>
|
235 |
-
<li><a href="https://www.loc.gov/marc/" target="_blank">MARC Metadata Standards</a></li>
|
236 |
-
<li><a href="https://labs.loc.gov/about-labs/digital-strategy/" target="_blank">LOC Digital Strategy</a></li>
|
237 |
-
</ul>
|
238 |
-
</div>
|
239 |
-
</div>
|
240 |
-
""", unsafe_allow_html=True)
|
241 |
-
|
242 |
|
243 |
|
244 |
|
245 |
# Render collapsible green completeness table in sidebar
|
246 |
-
with st.sidebar.expander("
|
247 |
st.dataframe(
|
248 |
completeness_table.style.background_gradient(cmap="Greens").format("{:.1f}%"),
|
249 |
use_container_width=True,
|
|
|
207 |
# π Sidebar Quick Stats
|
208 |
stats_html = f"""
|
209 |
<div class="sidebar-contrast-block">
|
210 |
+
<h4 style="color: lightgray;">Quick Stats</h4>
|
211 |
<p style="color:lightgray;">Total Records: <b>{len(metadata_df)}</b></p>
|
212 |
<p style="color:lightgray;">Incomplete Records: <b>{incomplete_count}</b></p>
|
213 |
<p style="color:lightgray;">Overall Completeness: <b>{overall_percent:.1f}%</b></p>
|
214 |
</div>
|
215 |
"""
|
216 |
+
stats_placeholder.markdown(stats_html, unsafe_allow_html=True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
|
218 |
|
219 |
|
220 |
# Render collapsible green completeness table in sidebar
|
221 |
+
with st.sidebar.expander("Field Completeness Breakdown", expanded=True):
|
222 |
st.dataframe(
|
223 |
completeness_table.style.background_gradient(cmap="Greens").format("{:.1f}%"),
|
224 |
use_container_width=True,
|