Spaces:
Sleeping
Sleeping
change top margin of umap a bit
Browse files- streamlit_hf/home.py +17 -0
streamlit_hf/home.py
CHANGED
|
@@ -203,6 +203,21 @@ section[data-testid="stMain"] div[data-testid="stVerticalBlockBorderWrapper"]:ha
|
|
| 203 |
section[data-testid="stMain"] div[data-testid="stVerticalBlockBorderWrapper"]:has(iframe) > div {
|
| 204 |
overflow: visible !important;
|
| 205 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 206 |
/*
|
| 207 |
* Home metrics strip (four st.metric above nav cards): centre each metric in its column.
|
| 208 |
* Scope with :not(:has([id^="ff-nav-slot-"])) so the nav-card row (which also uses 4 columns) is excluded.
|
|
@@ -509,6 +524,7 @@ if bundle is not None and df_features is not None:
|
|
| 509 |
subtitle=_UMAP_HOME_SUBTITLE,
|
| 510 |
)
|
| 511 |
fig_u.update_layout(margin=dict(l=20, r=8, t=92, b=20), title_font_size=15)
|
|
|
|
| 512 |
st.plotly_chart(
|
| 513 |
fig_u,
|
| 514 |
width="stretch",
|
|
@@ -564,6 +580,7 @@ elif bundle is not None:
|
|
| 564 |
subtitle=_UMAP_HOME_SUBTITLE_RANK_MISSING,
|
| 565 |
)
|
| 566 |
fig_u.update_layout(margin=dict(l=24, r=12, t=92, b=24), title_font_size=15)
|
|
|
|
| 567 |
st.plotly_chart(fig_u, width="stretch", config={"displayModeBar": True, "displaylogo": False})
|
| 568 |
with _umap_help_col2:
|
| 569 |
ui.plot_help_popover(
|
|
|
|
| 203 |
section[data-testid="stMain"] div[data-testid="stVerticalBlockBorderWrapper"]:has(iframe) > div {
|
| 204 |
overflow: visible !important;
|
| 205 |
}
|
| 206 |
+
/* Home overview UMAP: lift only this chart slightly for better visual top alignment with left text. */
|
| 207 |
+
section[data-testid="stMain"] div[data-testid="stElementContainer"]:has(span.ff-home-umap-lift-marker) {
|
| 208 |
+
margin-bottom: 0 !important;
|
| 209 |
+
}
|
| 210 |
+
section[data-testid="stMain"] div[data-testid="stElementContainer"]:has(span.ff-home-umap-lift-marker) + div[data-testid="stElementContainer"]:has([data-testid="stPlotlyChart"]) {
|
| 211 |
+
margin-top: -16px !important;
|
| 212 |
+
}
|
| 213 |
+
/* Reduce whitespace between nav cards and the Overview/UMAP section. */
|
| 214 |
+
section[data-testid="stMain"] div[data-testid="stElementContainer"]:has(.ff-section-label) {
|
| 215 |
+
margin-top: -0.55rem !important;
|
| 216 |
+
margin-bottom: 0.1rem !important;
|
| 217 |
+
}
|
| 218 |
+
section[data-testid="stMain"] div[data-testid="stElementContainer"]:has(.ff-section-label) + div[data-testid="stHorizontalBlock"] {
|
| 219 |
+
margin-top: -0.35rem !important;
|
| 220 |
+
}
|
| 221 |
/*
|
| 222 |
* Home metrics strip (four st.metric above nav cards): centre each metric in its column.
|
| 223 |
* Scope with :not(:has([id^="ff-nav-slot-"])) so the nav-card row (which also uses 4 columns) is excluded.
|
|
|
|
| 524 |
subtitle=_UMAP_HOME_SUBTITLE,
|
| 525 |
)
|
| 526 |
fig_u.update_layout(margin=dict(l=20, r=8, t=92, b=20), title_font_size=15)
|
| 527 |
+
st.markdown('<span class="ff-home-umap-lift-marker"></span>', unsafe_allow_html=True)
|
| 528 |
st.plotly_chart(
|
| 529 |
fig_u,
|
| 530 |
width="stretch",
|
|
|
|
| 580 |
subtitle=_UMAP_HOME_SUBTITLE_RANK_MISSING,
|
| 581 |
)
|
| 582 |
fig_u.update_layout(margin=dict(l=24, r=12, t=92, b=24), title_font_size=15)
|
| 583 |
+
st.markdown('<span class="ff-home-umap-lift-marker"></span>', unsafe_allow_html=True)
|
| 584 |
st.plotly_chart(fig_u, width="stretch", config={"displayModeBar": True, "displaylogo": False})
|
| 585 |
with _umap_help_col2:
|
| 586 |
ui.plot_help_popover(
|