Commit ·
e0b240e
1
Parent(s): 14a45ea
Lead with bubble chart; list every modality on one line (scrollable); treemap moves to Zoom out tab
Browse files- app.py +15 -7
- assets/plots/dataset_bubble.html +0 -0
- style.css +11 -2
app.py
CHANGED
|
@@ -314,10 +314,10 @@ def _modality_strip_html(df: pd.DataFrame) -> str:
|
|
| 314 |
for name, n in counts.items():
|
| 315 |
hue = MODALITY_HUES.get(str(name), DEFAULT_HUE)
|
| 316 |
pct = (n / total) * 100
|
| 317 |
-
|
| 318 |
-
|
| 319 |
segments.append(
|
| 320 |
-
f'<span class="eeg-bar__seg" style="width:{pct:.2f}%;background:{hue}" '
|
| 321 |
f'title="{_html.escape(str(name))}: {n}"></span>'
|
| 322 |
)
|
| 323 |
legend.append(
|
|
@@ -576,10 +576,10 @@ with gr.Blocks(
|
|
| 576 |
elem_classes=["eeg-overview"],
|
| 577 |
):
|
| 578 |
gr.HTML(
|
| 579 |
-
'<p class="eeg-overview__lede">Each
|
| 580 |
-
'
|
| 581 |
-
'
|
| 582 |
-
+ _plot_iframe("
|
| 583 |
elem_classes=["eeg-plot"],
|
| 584 |
)
|
| 585 |
|
|
@@ -589,6 +589,14 @@ with gr.Blocks(
|
|
| 589 |
elem_classes=["eeg-overview"],
|
| 590 |
):
|
| 591 |
with gr.Tabs():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 592 |
with gr.Tab("Growth"):
|
| 593 |
gr.HTML(
|
| 594 |
'<p class="eeg-overview__lede">New datasets added to the '
|
|
|
|
| 314 |
for name, n in counts.items():
|
| 315 |
hue = MODALITY_HUES.get(str(name), DEFAULT_HUE)
|
| 316 |
pct = (n / total) * 100
|
| 317 |
+
# Every modality appears in the legend (user-facing single line),
|
| 318 |
+
# but sub-pixel bar segments get a min-width so they stay clickable.
|
| 319 |
segments.append(
|
| 320 |
+
f'<span class="eeg-bar__seg" style="width:{pct:.2f}%;background:{hue};min-width:2px" '
|
| 321 |
f'title="{_html.escape(str(name))}: {n}"></span>'
|
| 322 |
)
|
| 323 |
legend.append(
|
|
|
|
| 576 |
elem_classes=["eeg-overview"],
|
| 577 |
):
|
| 578 |
gr.HTML(
|
| 579 |
+
'<p class="eeg-overview__lede">Each bubble is one dataset, sized by '
|
| 580 |
+
'recordings and colored by experimental modality. Hover for details; '
|
| 581 |
+
'axes span subject count and recording duration.</p>'
|
| 582 |
+
+ _plot_iframe("dataset_bubble", height=820, title="Dataset bubble chart"),
|
| 583 |
elem_classes=["eeg-plot"],
|
| 584 |
)
|
| 585 |
|
|
|
|
| 589 |
elem_classes=["eeg-overview"],
|
| 590 |
):
|
| 591 |
with gr.Tabs():
|
| 592 |
+
with gr.Tab("Treemap"):
|
| 593 |
+
gr.HTML(
|
| 594 |
+
'<p class="eeg-overview__lede">Same catalog, nested rectangles '
|
| 595 |
+
'— area is proportional to recording count inside each '
|
| 596 |
+
'modality group.</p>'
|
| 597 |
+
+ _plot_iframe("dataset_treemap", height=900, title="Dataset treemap"),
|
| 598 |
+
elem_classes=["eeg-plot"],
|
| 599 |
+
)
|
| 600 |
with gr.Tab("Growth"):
|
| 601 |
gr.HTML(
|
| 602 |
'<p class="eeg-overview__lede">New datasets added to the '
|
assets/plots/dataset_bubble.html
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
style.css
CHANGED
|
@@ -236,16 +236,25 @@ html.dark .eeg-hero__logo { filter: invert(1) hue-rotate(180deg) brightness(1.05
|
|
| 236 |
|
| 237 |
.eeg-legend {
|
| 238 |
display: flex;
|
| 239 |
-
flex-wrap:
|
| 240 |
-
gap:
|
| 241 |
margin-top: 12px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 242 |
}
|
|
|
|
|
|
|
|
|
|
| 243 |
.eeg-legend__item {
|
| 244 |
display: inline-flex;
|
| 245 |
align-items: center;
|
| 246 |
gap: 6px;
|
| 247 |
font-size: 12.5px;
|
| 248 |
color: var(--ink);
|
|
|
|
| 249 |
}
|
| 250 |
.eeg-legend__swatch {
|
| 251 |
width: 10px; height: 10px;
|
|
|
|
| 236 |
|
| 237 |
.eeg-legend {
|
| 238 |
display: flex;
|
| 239 |
+
flex-wrap: nowrap;
|
| 240 |
+
gap: 14px;
|
| 241 |
margin-top: 12px;
|
| 242 |
+
overflow-x: auto;
|
| 243 |
+
white-space: nowrap;
|
| 244 |
+
padding-bottom: 4px; /* space for the horizontal scrollbar */
|
| 245 |
+
scrollbar-width: thin;
|
| 246 |
+
scrollbar-color: var(--outline) transparent;
|
| 247 |
}
|
| 248 |
+
.eeg-legend::-webkit-scrollbar { height: 6px; }
|
| 249 |
+
.eeg-legend::-webkit-scrollbar-thumb { background: var(--outline); border-radius: 999px; }
|
| 250 |
+
|
| 251 |
.eeg-legend__item {
|
| 252 |
display: inline-flex;
|
| 253 |
align-items: center;
|
| 254 |
gap: 6px;
|
| 255 |
font-size: 12.5px;
|
| 256 |
color: var(--ink);
|
| 257 |
+
flex-shrink: 0;
|
| 258 |
}
|
| 259 |
.eeg-legend__swatch {
|
| 260 |
width: 10px; height: 10px;
|