Spaces:
Running
Running
💄 Adapted displaying options in the leaderboard and color scheme
Browse files- frontend/layout.py +167 -29
- frontend/leaderboard.py +2 -2
- frontend/styles.css +69 -13
frontend/layout.py
CHANGED
|
@@ -20,7 +20,40 @@ def create_leaderboard_tab(refresh_callback: Callable = None) -> gr.TabItem:
|
|
| 20 |
"""Create the leaderboard tab layout"""
|
| 21 |
|
| 22 |
with gr.TabItem("Leaderboard", elem_id="leaderboard-tab", id=0) as tab:
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
new_data = (
|
| 25 |
refresh_callback().reset_index(drop=True)
|
| 26 |
if refresh_callback
|
|
@@ -40,22 +73,37 @@ def create_leaderboard_tab(refresh_callback: Callable = None) -> gr.TabItem:
|
|
| 40 |
else:
|
| 41 |
ranks.append(str(i))
|
| 42 |
new_data.insert(0, ("", "Rank"), ranks)
|
| 43 |
-
|
| 44 |
filtered = new_data.copy()
|
| 45 |
|
| 46 |
-
|
|
|
|
| 47 |
search = search.lower()
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
-
|
| 51 |
-
# filtered = filtered[filtered["Few-shot (y/n)"] == few_shot]
|
| 52 |
|
| 53 |
-
|
| 54 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
-
return make_html_table(filtered)
|
| 57 |
-
|
| 58 |
-
def make_html_table(df: pd.DataFrame) -> str:
|
| 59 |
html = "<div class='leaderboard-container'><table class='leaderboard-table sortable-table'>"
|
| 60 |
|
| 61 |
if isinstance(df.columns, pd.MultiIndex):
|
|
@@ -68,9 +116,13 @@ def create_leaderboard_tab(refresh_callback: Callable = None) -> gr.TabItem:
|
|
| 68 |
col_idx = 0
|
| 69 |
|
| 70 |
for i, (top, sub) in enumerate(df.columns):
|
| 71 |
-
# Skip hidden columns
|
| 72 |
-
if (top, sub) in
|
|
|
|
|
|
|
|
|
|
| 73 |
continue
|
|
|
|
| 74 |
# Handle blank top headers directly (span both rows)
|
| 75 |
if top == "" or top is None:
|
| 76 |
# close any previous group first
|
|
@@ -101,8 +153,11 @@ def create_leaderboard_tab(refresh_callback: Callable = None) -> gr.TabItem:
|
|
| 101 |
html += "<tr>"
|
| 102 |
# col_idx continues from first row
|
| 103 |
for top, sub in df.columns:
|
| 104 |
-
# Skip hidden columns
|
| 105 |
-
if (top, sub) in
|
|
|
|
|
|
|
|
|
|
| 106 |
continue
|
| 107 |
if top not in ("", None):
|
| 108 |
html += f"<th class='sortable-header' data-column='{col_idx}' onclick='sortTable({col_idx})'>{sub} <span class='sort-indicator'></span></th>"
|
|
@@ -114,7 +169,7 @@ def create_leaderboard_tab(refresh_callback: Callable = None) -> gr.TabItem:
|
|
| 114 |
html += "<thead><tr>"
|
| 115 |
col_idx = 0
|
| 116 |
for col in df.columns:
|
| 117 |
-
if col not in
|
| 118 |
html += f"<th class='sortable-header' data-column='{col_idx}' onclick='sortTable({col_idx})'>{col} <span class='sort-indicator'></span></th>"
|
| 119 |
col_idx += 1
|
| 120 |
html += "</tr></thead>"
|
|
@@ -136,8 +191,11 @@ def create_leaderboard_tab(refresh_callback: Callable = None) -> gr.TabItem:
|
|
| 136 |
# Second pass: render cells
|
| 137 |
html += "<tr>"
|
| 138 |
for col, val in zip(df.columns, row):
|
| 139 |
-
# Skip hidden columns
|
| 140 |
-
if col in
|
|
|
|
|
|
|
|
|
|
| 141 |
continue
|
| 142 |
|
| 143 |
# Determine CSS class based on column type
|
|
@@ -172,7 +230,7 @@ def create_leaderboard_tab(refresh_callback: Callable = None) -> gr.TabItem:
|
|
| 172 |
tag_str = str(hf_space_tag).strip().lower()
|
| 173 |
if hf_space_tag and tag_str and tag_str not in ['none', 'nan', '', '.']:
|
| 174 |
# Put title on the link itself, not the td
|
| 175 |
-
html += f"<td class='{css_class}'><a href='https://huggingface.co/spaces/{hf_space_tag}' target='_blank' style='color: #20C2D9; text-decoration: none;'{title_attr}>{val}</a></td>"
|
| 176 |
else:
|
| 177 |
html += f"<td class='{css_class}'{title_attr}>{val}</td>"
|
| 178 |
|
|
@@ -382,27 +440,95 @@ def create_leaderboard_tab(refresh_callback: Callable = None) -> gr.TabItem:
|
|
| 382 |
result_data.insert(0, ("", "Rank"), ranks)
|
| 383 |
|
| 384 |
# result_data.columns = result_data.columns.map(str)
|
| 385 |
-
# Leaderboard at full width
|
| 386 |
-
search = gr.Textbox(show_label=False, placeholder="Search by model name…", elem_id="leaderboard-search", container=False, max_lines=1, type="text")
|
| 387 |
|
| 388 |
-
#
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 392 |
|
| 393 |
# Refresh button
|
| 394 |
refresh_btn = gr.Button(
|
| 395 |
"↻", variant="secondary", size="lg", elem_classes=["refresh-button"]
|
| 396 |
)
|
| 397 |
|
| 398 |
-
# table = gr.Dataframe(result_data,
|
| 399 |
-
# column_widths=column_widths,
|
| 400 |
# elem_classes=["leaderboard-table"],
|
| 401 |
# interactive=False,
|
| 402 |
# )
|
| 403 |
table = gr.HTML(make_html_table(result_data))
|
| 404 |
|
| 405 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 406 |
|
| 407 |
# Connect refresh button
|
| 408 |
def refresh_data():
|
|
@@ -714,7 +840,19 @@ function() {
|
|
| 714 |
}
|
| 715 |
"""
|
| 716 |
|
| 717 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 718 |
# Tab container
|
| 719 |
with gr.Tabs(elem_classes="tab-nav") as tabs:
|
| 720 |
|
|
|
|
| 20 |
"""Create the leaderboard tab layout"""
|
| 21 |
|
| 22 |
with gr.TabItem("Leaderboard", elem_id="leaderboard-tab", id=0) as tab:
|
| 23 |
+
|
| 24 |
+
def get_default_columns(df: pd.DataFrame) -> list:
|
| 25 |
+
"""
|
| 26 |
+
Get the list of columns that should be visible by default.
|
| 27 |
+
|
| 28 |
+
Visible by default:
|
| 29 |
+
- Rank, Type, Model, Organization, Publication
|
| 30 |
+
- Avg. AUC, Avg. ΔAUC-PR
|
| 31 |
+
- All ROC-AUC columns
|
| 32 |
+
- All ΔAUC-PR columns
|
| 33 |
+
- # Parameters
|
| 34 |
+
|
| 35 |
+
Hidden by default:
|
| 36 |
+
- Model Description, Publication Link, HF_Space_Tag
|
| 37 |
+
- Pretrained, Pretraining Data, Zero-shot, Few-shot, N-shot
|
| 38 |
+
- Date Added
|
| 39 |
+
"""
|
| 40 |
+
default_visible = []
|
| 41 |
+
|
| 42 |
+
for col in df.columns:
|
| 43 |
+
col_group = col[0] if isinstance(col, tuple) else ""
|
| 44 |
+
col_name = col[1] if isinstance(col, tuple) else col
|
| 45 |
+
|
| 46 |
+
# Always show these columns
|
| 47 |
+
if col_name in ["Rank", "Type", "Model", "Organization", "Publication",
|
| 48 |
+
"Avg. AUC", "Avg. ΔAUC-PR", "# Parameters"]:
|
| 49 |
+
default_visible.append(col)
|
| 50 |
+
# Show all ROC-AUC and ΔAUC-PR task columns
|
| 51 |
+
elif col_group in ["ROC-AUC", "ΔAUC-PR"]:
|
| 52 |
+
default_visible.append(col)
|
| 53 |
+
|
| 54 |
+
return default_visible
|
| 55 |
+
|
| 56 |
+
def apply_filters(search, type_filter, min_auc, selected_columns):
|
| 57 |
new_data = (
|
| 58 |
refresh_callback().reset_index(drop=True)
|
| 59 |
if refresh_callback
|
|
|
|
| 73 |
else:
|
| 74 |
ranks.append(str(i))
|
| 75 |
new_data.insert(0, ("", "Rank"), ranks)
|
| 76 |
+
|
| 77 |
filtered = new_data.copy()
|
| 78 |
|
| 79 |
+
# Search filter: search across Model, Organization, and Publication
|
| 80 |
+
if search and search.strip():
|
| 81 |
search = search.lower()
|
| 82 |
+
mask = (
|
| 83 |
+
filtered[("", "Model")].astype(str).str.lower().str.contains(search, na=False) |
|
| 84 |
+
filtered[("", "Organization")].astype(str).str.lower().str.contains(search, na=False) |
|
| 85 |
+
filtered[("", "Publication")].astype(str).str.lower().str.contains(search, na=False)
|
| 86 |
+
)
|
| 87 |
+
filtered = filtered[mask]
|
| 88 |
+
|
| 89 |
+
# Type filter
|
| 90 |
+
if type_filter and len(type_filter) > 0:
|
| 91 |
+
filtered = filtered[filtered[("", "Type")].isin(type_filter)]
|
| 92 |
+
|
| 93 |
+
# Min AUC filter
|
| 94 |
+
if min_auc and min_auc > 0:
|
| 95 |
+
filtered = filtered[filtered[("", "Avg. AUC")] >= min_auc]
|
| 96 |
|
| 97 |
+
return make_html_table(filtered, selected_columns)
|
|
|
|
| 98 |
|
| 99 |
+
def make_html_table(df: pd.DataFrame, selected_columns=None) -> str:
|
| 100 |
+
# If no column selection provided, show default columns
|
| 101 |
+
if selected_columns is None:
|
| 102 |
+
selected_columns = get_default_columns(df)
|
| 103 |
+
|
| 104 |
+
# Always hide these columns (used for links and tooltips)
|
| 105 |
+
always_hidden = [("", "HF_Space_Tag"), ("", "Publication Link"), ("", "Model Description")]
|
| 106 |
|
|
|
|
|
|
|
|
|
|
| 107 |
html = "<div class='leaderboard-container'><table class='leaderboard-table sortable-table'>"
|
| 108 |
|
| 109 |
if isinstance(df.columns, pd.MultiIndex):
|
|
|
|
| 116 |
col_idx = 0
|
| 117 |
|
| 118 |
for i, (top, sub) in enumerate(df.columns):
|
| 119 |
+
# Skip always-hidden columns
|
| 120 |
+
if (top, sub) in always_hidden:
|
| 121 |
+
continue
|
| 122 |
+
# Skip columns not in selected_columns
|
| 123 |
+
if (top, sub) not in selected_columns:
|
| 124 |
continue
|
| 125 |
+
|
| 126 |
# Handle blank top headers directly (span both rows)
|
| 127 |
if top == "" or top is None:
|
| 128 |
# close any previous group first
|
|
|
|
| 153 |
html += "<tr>"
|
| 154 |
# col_idx continues from first row
|
| 155 |
for top, sub in df.columns:
|
| 156 |
+
# Skip always-hidden columns
|
| 157 |
+
if (top, sub) in always_hidden:
|
| 158 |
+
continue
|
| 159 |
+
# Skip columns not in selected_columns
|
| 160 |
+
if (top, sub) not in selected_columns:
|
| 161 |
continue
|
| 162 |
if top not in ("", None):
|
| 163 |
html += f"<th class='sortable-header' data-column='{col_idx}' onclick='sortTable({col_idx})'>{sub} <span class='sort-indicator'></span></th>"
|
|
|
|
| 169 |
html += "<thead><tr>"
|
| 170 |
col_idx = 0
|
| 171 |
for col in df.columns:
|
| 172 |
+
if col not in always_hidden and col in selected_columns:
|
| 173 |
html += f"<th class='sortable-header' data-column='{col_idx}' onclick='sortTable({col_idx})'>{col} <span class='sort-indicator'></span></th>"
|
| 174 |
col_idx += 1
|
| 175 |
html += "</tr></thead>"
|
|
|
|
| 191 |
# Second pass: render cells
|
| 192 |
html += "<tr>"
|
| 193 |
for col, val in zip(df.columns, row):
|
| 194 |
+
# Skip always-hidden columns
|
| 195 |
+
if col in always_hidden:
|
| 196 |
+
continue
|
| 197 |
+
# Skip columns not in selected_columns
|
| 198 |
+
if col not in selected_columns:
|
| 199 |
continue
|
| 200 |
|
| 201 |
# Determine CSS class based on column type
|
|
|
|
| 230 |
tag_str = str(hf_space_tag).strip().lower()
|
| 231 |
if hf_space_tag and tag_str and tag_str not in ['none', 'nan', '', '.']:
|
| 232 |
# Put title on the link itself, not the td
|
| 233 |
+
html += f"<td class='{css_class}'><a href='https://huggingface.co/spaces/{hf_space_tag}/blob/main/README.md' target='_blank' style='color: #20C2D9; text-decoration: none;'{title_attr}>{val}</a></td>"
|
| 234 |
else:
|
| 235 |
html += f"<td class='{css_class}'{title_attr}>{val}</td>"
|
| 236 |
|
|
|
|
| 440 |
result_data.insert(0, ("", "Rank"), ranks)
|
| 441 |
|
| 442 |
# result_data.columns = result_data.columns.map(str)
|
|
|
|
|
|
|
| 443 |
|
| 444 |
+
# Search bar
|
| 445 |
+
search = gr.Textbox(
|
| 446 |
+
show_label=False,
|
| 447 |
+
placeholder="Search by model, organization, or publication…",
|
| 448 |
+
elem_id="leaderboard-search",
|
| 449 |
+
container=False,
|
| 450 |
+
max_lines=1,
|
| 451 |
+
type="text"
|
| 452 |
+
)
|
| 453 |
+
|
| 454 |
+
# Filters in an accordion
|
| 455 |
+
with gr.Accordion("Filters & Column Selection", open=False):
|
| 456 |
+
with gr.Row():
|
| 457 |
+
# Type filter (multi-select checkboxes)
|
| 458 |
+
type_filter = gr.CheckboxGroup(
|
| 459 |
+
choices=["0️⃣", "1️⃣", "⤵️", "🔼"],
|
| 460 |
+
label="Model Type",
|
| 461 |
+
value=["0️⃣", "1️⃣", "⤵️", "🔼"], # All selected by default
|
| 462 |
+
interactive=True
|
| 463 |
+
)
|
| 464 |
+
|
| 465 |
+
# Min AUC filter
|
| 466 |
+
min_auc = gr.Number(
|
| 467 |
+
label="Minimum Avg. AUC",
|
| 468 |
+
value=0,
|
| 469 |
+
minimum=0,
|
| 470 |
+
maximum=1,
|
| 471 |
+
step=0.01
|
| 472 |
+
)
|
| 473 |
+
|
| 474 |
+
# Column selection dropdown
|
| 475 |
+
# Get all column names for the dropdown
|
| 476 |
+
all_columns = [col for col in result_data.columns
|
| 477 |
+
if col not in [("", "HF_Space_Tag"), ("", "Publication Link"), ("", "Model Description")]]
|
| 478 |
+
default_columns = get_default_columns(result_data)
|
| 479 |
+
|
| 480 |
+
# Format column names for display
|
| 481 |
+
column_choices = []
|
| 482 |
+
column_values = []
|
| 483 |
+
for col in all_columns:
|
| 484 |
+
if isinstance(col, tuple):
|
| 485 |
+
display_name = f"{col[0]} - {col[1]}" if col[0] else col[1]
|
| 486 |
+
else:
|
| 487 |
+
display_name = str(col)
|
| 488 |
+
column_choices.append(display_name)
|
| 489 |
+
column_values.append(col)
|
| 490 |
+
|
| 491 |
+
# Create mapping from display name to actual column
|
| 492 |
+
column_display_to_actual = dict(zip(column_choices, column_values))
|
| 493 |
+
default_display_names = [
|
| 494 |
+
display_name for display_name, col in column_display_to_actual.items()
|
| 495 |
+
if col in default_columns
|
| 496 |
+
]
|
| 497 |
+
|
| 498 |
+
column_selector = gr.CheckboxGroup(
|
| 499 |
+
choices=column_choices,
|
| 500 |
+
value=default_display_names,
|
| 501 |
+
label="Select Columns to Display",
|
| 502 |
+
interactive=True
|
| 503 |
+
)
|
| 504 |
|
| 505 |
# Refresh button
|
| 506 |
refresh_btn = gr.Button(
|
| 507 |
"↻", variant="secondary", size="lg", elem_classes=["refresh-button"]
|
| 508 |
)
|
| 509 |
|
| 510 |
+
# table = gr.Dataframe(result_data,
|
| 511 |
+
# column_widths=column_widths,
|
| 512 |
# elem_classes=["leaderboard-table"],
|
| 513 |
# interactive=False,
|
| 514 |
# )
|
| 515 |
table = gr.HTML(make_html_table(result_data))
|
| 516 |
|
| 517 |
+
# Wire up the filter components
|
| 518 |
+
def apply_filters_wrapper(search, type_filter, min_auc, selected_display_names):
|
| 519 |
+
# Convert display names back to actual column tuples
|
| 520 |
+
selected_columns = [column_display_to_actual[name] for name in selected_display_names]
|
| 521 |
+
return apply_filters(search, type_filter, min_auc, selected_columns)
|
| 522 |
+
|
| 523 |
+
# Connect all inputs to apply_filters
|
| 524 |
+
for component in [search, type_filter, min_auc, column_selector]:
|
| 525 |
+
component.change(
|
| 526 |
+
fn=apply_filters_wrapper,
|
| 527 |
+
inputs=[search, type_filter, min_auc, column_selector],
|
| 528 |
+
outputs=table
|
| 529 |
+
)
|
| 530 |
+
|
| 531 |
+
refresh_btn.click(apply_filters_wrapper, [search, type_filter, min_auc, column_selector], table)
|
| 532 |
|
| 533 |
# Connect refresh button
|
| 534 |
def refresh_data():
|
|
|
|
| 840 |
}
|
| 841 |
"""
|
| 842 |
|
| 843 |
+
# Create custom theme with cyan accent color
|
| 844 |
+
theme = gr.themes.Default(
|
| 845 |
+
primary_hue="cyan",
|
| 846 |
+
secondary_hue="cyan",
|
| 847 |
+
).set(
|
| 848 |
+
checkbox_background_color_selected="#20C2D9",
|
| 849 |
+
checkbox_border_color="#20C2D9",
|
| 850 |
+
checkbox_border_color_focus="#20C2D9",
|
| 851 |
+
checkbox_border_color_hover="#20C2D9",
|
| 852 |
+
radio_circle="#20C2D9",
|
| 853 |
+
)
|
| 854 |
+
|
| 855 |
+
with gr.Blocks(css=css, js=js, title="Tox21 Leaderboard", theme=theme) as app:
|
| 856 |
# Tab container
|
| 857 |
with gr.Tabs(elem_classes="tab-nav") as tabs:
|
| 858 |
|
frontend/leaderboard.py
CHANGED
|
@@ -78,10 +78,11 @@ def format_leaderboard_data(raw_data: dict) -> pd.DataFrame:
|
|
| 78 |
("", "Model Description"): config["model_description"],
|
| 79 |
("", "Avg. AUC"): results["overall_score"]["roc_auc"],
|
| 80 |
("", "Avg. ΔAUC-PR"): results["overall_score"].get("delta_auprc"),
|
|
|
|
| 81 |
}
|
| 82 |
print(results["overall_score"])
|
| 83 |
|
| 84 |
-
# === Insert task columns immediately after
|
| 85 |
for task_key, task_result in results.items():
|
| 86 |
if task_key != "overall_score":
|
| 87 |
row[("ROC-AUC", task_key)] = task_result.get("roc_auc", "")
|
|
@@ -93,7 +94,6 @@ def format_leaderboard_data(raw_data: dict) -> pd.DataFrame:
|
|
| 93 |
# === Then continue with the rest of the metadata columns ===
|
| 94 |
|
| 95 |
row.update({
|
| 96 |
-
("", "# Parameters"): config.get("model_size", ""),
|
| 97 |
("", "Pretrained"): pretrained,
|
| 98 |
("", "Pretraining Data"): config.get("pretraining_data", ""),
|
| 99 |
("", "Zero-shot"): zero_shot,
|
|
|
|
| 78 |
("", "Model Description"): config["model_description"],
|
| 79 |
("", "Avg. AUC"): results["overall_score"]["roc_auc"],
|
| 80 |
("", "Avg. ΔAUC-PR"): results["overall_score"].get("delta_auprc"),
|
| 81 |
+
("", "# Parameters"): config.get("model_size", ""), # Moved here after Avg. ΔAUC-PR
|
| 82 |
}
|
| 83 |
print(results["overall_score"])
|
| 84 |
|
| 85 |
+
# === Insert task columns immediately after # Parameters ===
|
| 86 |
for task_key, task_result in results.items():
|
| 87 |
if task_key != "overall_score":
|
| 88 |
row[("ROC-AUC", task_key)] = task_result.get("roc_auc", "")
|
|
|
|
| 94 |
# === Then continue with the rest of the metadata columns ===
|
| 95 |
|
| 96 |
row.update({
|
|
|
|
| 97 |
("", "Pretrained"): pretrained,
|
| 98 |
("", "Pretraining Data"): config.get("pretraining_data", ""),
|
| 99 |
("", "Zero-shot"): zero_shot,
|
frontend/styles.css
CHANGED
|
@@ -46,24 +46,24 @@ body, .gradio-container {
|
|
| 46 |
}
|
| 47 |
|
| 48 |
a {
|
| 49 |
-
color:
|
| 50 |
-
text-decoration:
|
| 51 |
}
|
| 52 |
|
| 53 |
/* Visited link */
|
| 54 |
a:visited {
|
| 55 |
-
color: #
|
| 56 |
}
|
| 57 |
|
| 58 |
/* Hover */
|
| 59 |
a:hover {
|
| 60 |
-
color: #
|
| 61 |
-
text-decoration:
|
| 62 |
}
|
| 63 |
|
| 64 |
/* Active (when clicked) */
|
| 65 |
a:active {
|
| 66 |
-
color: #
|
| 67 |
}
|
| 68 |
|
| 69 |
|
|
@@ -76,6 +76,15 @@ a:active {
|
|
| 76 |
--text-color: black;
|
| 77 |
--scroll-thumb: #cbd5e1;
|
| 78 |
--scroll-thumb-hover: #7E848C;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
}
|
| 80 |
|
| 81 |
.dark {
|
|
@@ -218,16 +227,16 @@ a:active {
|
|
| 218 |
|
| 219 |
/* Prettier search bar */
|
| 220 |
#leaderboard-search {
|
| 221 |
-
width:
|
| 222 |
min-width: 320px;
|
| 223 |
-
padding:
|
| 224 |
font-size: 16px !important;
|
| 225 |
-
border-radius:
|
| 226 |
-
border:
|
| 227 |
background-repeat: no-repeat;
|
| 228 |
background-position: 14px center;
|
| 229 |
background-size: 18px;
|
| 230 |
-
box-shadow:
|
| 231 |
display: block !important;
|
| 232 |
margin: 6px auto 6px auto !important;
|
| 233 |
transition: all 0.2s ease;
|
|
@@ -235,7 +244,7 @@ a:active {
|
|
| 235 |
|
| 236 |
#leaderboard-search:focus {
|
| 237 |
border-color: #6366f1 !important;
|
| 238 |
-
box-shadow: 0 0 0
|
| 239 |
outline: none !important;
|
| 240 |
}
|
| 241 |
|
|
@@ -402,7 +411,7 @@ a:active {
|
|
| 402 |
|
| 403 |
/* === Checkbox input itself === */
|
| 404 |
.form-container-checkbox input[type="checkbox"] {
|
| 405 |
-
accent-color: #
|
| 406 |
transform: scale(1.1);
|
| 407 |
margin-left: 4px;
|
| 408 |
cursor: pointer;
|
|
@@ -427,6 +436,53 @@ a:active {
|
|
| 427 |
border: none !important;
|
| 428 |
}
|
| 429 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 430 |
|
| 431 |
|
| 432 |
|
|
|
|
| 46 |
}
|
| 47 |
|
| 48 |
a {
|
| 49 |
+
color: #20C2D9;
|
| 50 |
+
text-decoration: none;
|
| 51 |
}
|
| 52 |
|
| 53 |
/* Visited link */
|
| 54 |
a:visited {
|
| 55 |
+
color: #20C2D9;
|
| 56 |
}
|
| 57 |
|
| 58 |
/* Hover */
|
| 59 |
a:hover {
|
| 60 |
+
color: #20C2D9;
|
| 61 |
+
text-decoration: none;
|
| 62 |
}
|
| 63 |
|
| 64 |
/* Active (when clicked) */
|
| 65 |
a:active {
|
| 66 |
+
color: #20C2D9;
|
| 67 |
}
|
| 68 |
|
| 69 |
|
|
|
|
| 76 |
--text-color: black;
|
| 77 |
--scroll-thumb: #cbd5e1;
|
| 78 |
--scroll-thumb-hover: #7E848C;
|
| 79 |
+
|
| 80 |
+
/* Override Gradio's theme colors for checkboxes and radio buttons */
|
| 81 |
+
--checkbox-border-color: #20C2D9;
|
| 82 |
+
--checkbox-border-color-focus: #20C2D9;
|
| 83 |
+
--checkbox-border-color-hover: #20C2D9;
|
| 84 |
+
--checkbox-background-color-selected: #20C2D9;
|
| 85 |
+
--radio-circle: #20C2D9;
|
| 86 |
+
--color-accent: #20C2D9;
|
| 87 |
+
--color-accent-soft: #20C2D9;
|
| 88 |
}
|
| 89 |
|
| 90 |
.dark {
|
|
|
|
| 227 |
|
| 228 |
/* Prettier search bar */
|
| 229 |
#leaderboard-search {
|
| 230 |
+
width: 100% !important;
|
| 231 |
min-width: 320px;
|
| 232 |
+
padding: 10px 14px !important;
|
| 233 |
font-size: 16px !important;
|
| 234 |
+
border-radius: 8px !important;
|
| 235 |
+
border: 1px solid #d1d5db !important;
|
| 236 |
background-repeat: no-repeat;
|
| 237 |
background-position: 14px center;
|
| 238 |
background-size: 18px;
|
| 239 |
+
box-shadow: none;
|
| 240 |
display: block !important;
|
| 241 |
margin: 6px auto 6px auto !important;
|
| 242 |
transition: all 0.2s ease;
|
|
|
|
| 244 |
|
| 245 |
#leaderboard-search:focus {
|
| 246 |
border-color: #6366f1 !important;
|
| 247 |
+
box-shadow: 0 0 0 2px rgba(99,102,241,0.1) !important;
|
| 248 |
outline: none !important;
|
| 249 |
}
|
| 250 |
|
|
|
|
| 411 |
|
| 412 |
/* === Checkbox input itself === */
|
| 413 |
.form-container-checkbox input[type="checkbox"] {
|
| 414 |
+
accent-color: #20C2D9;
|
| 415 |
transform: scale(1.1);
|
| 416 |
margin-left: 4px;
|
| 417 |
cursor: pointer;
|
|
|
|
| 436 |
border: none !important;
|
| 437 |
}
|
| 438 |
|
| 439 |
+
/* === Radio button input itself === */
|
| 440 |
+
.form-container-radio input[type="radio"] {
|
| 441 |
+
accent-color: #20C2D9;
|
| 442 |
+
transform: scale(1.1);
|
| 443 |
+
cursor: pointer;
|
| 444 |
+
}
|
| 445 |
+
|
| 446 |
+
/* === Global styles for all checkboxes and radio buttons === */
|
| 447 |
+
input[type="checkbox"],
|
| 448 |
+
input[type="radio"] {
|
| 449 |
+
accent-color: #20C2D9 !important;
|
| 450 |
+
}
|
| 451 |
+
|
| 452 |
+
/* === Gradio-specific checkbox and radio button overrides === */
|
| 453 |
+
.gradio-container input[type="checkbox"],
|
| 454 |
+
.gradio-container input[type="radio"],
|
| 455 |
+
label input[type="checkbox"],
|
| 456 |
+
label input[type="radio"],
|
| 457 |
+
.gr-checkbox input[type="checkbox"],
|
| 458 |
+
.gr-radio input[type="radio"],
|
| 459 |
+
.gr-check-radio input[type="checkbox"],
|
| 460 |
+
.gr-check-radio input[type="radio"] {
|
| 461 |
+
accent-color: #20C2D9 !important;
|
| 462 |
+
}
|
| 463 |
+
|
| 464 |
+
/* Additional Gradio 5.x specific selectors */
|
| 465 |
+
.svelte-1gfkn6j input[type="checkbox"],
|
| 466 |
+
.svelte-1gfkn6j input[type="radio"],
|
| 467 |
+
input[type="checkbox"]:checked,
|
| 468 |
+
input[type="radio"]:checked {
|
| 469 |
+
accent-color: #20C2D9 !important;
|
| 470 |
+
border-color: #20C2D9 !important;
|
| 471 |
+
background-color: #20C2D9 !important;
|
| 472 |
+
}
|
| 473 |
+
|
| 474 |
+
/* Override any Gradio checkbox/radio SVG or background */
|
| 475 |
+
input[type="checkbox"]::before,
|
| 476 |
+
input[type="radio"]::before {
|
| 477 |
+
background-color: #20C2D9 !important;
|
| 478 |
+
}
|
| 479 |
+
|
| 480 |
+
/* Target Gradio's custom checkbox/radio wrapper */
|
| 481 |
+
.wrap input[type="checkbox"],
|
| 482 |
+
.wrap input[type="radio"] {
|
| 483 |
+
accent-color: #20C2D9 !important;
|
| 484 |
+
}
|
| 485 |
+
|
| 486 |
|
| 487 |
|
| 488 |
|