Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -401,14 +401,22 @@ def parse_and_generate_plot(df_data: list, indices_str: str):
|
|
| 401 |
|
| 402 |
def build_app() -> gr.Blocks:
|
| 403 |
row_css = """
|
|
|
|
| 404 |
body { background-color: #f5f7fa !important; }
|
|
|
|
| 405 |
|
| 406 |
-
/*
|
| 407 |
-
.
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
|
|
|
|
|
|
|
|
|
| 411 |
}
|
|
|
|
|
|
|
|
|
|
| 412 |
.search-box {
|
| 413 |
background: white !important; padding: 16px !important;
|
| 414 |
border-radius: 6px; border: 2px solid #e1e4e8 !important;
|
|
@@ -422,14 +430,46 @@ def build_app() -> gr.Blocks:
|
|
| 422 |
padding: 10px !important; box-shadow: none !important;
|
| 423 |
}
|
| 424 |
.search-box input.scroll-hide:focus { border-color: #0366d6 !important; outline: none !important; }
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
.
|
| 428 |
-
background
|
|
|
|
| 429 |
}
|
| 430 |
-
.
|
| 431 |
-
|
| 432 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 433 |
.gradio-container table.metrics-table th, .gradio-container table.metrics-table td {
|
| 434 |
padding: 10px 14px; border: 1.5px solid #e1e4e8; white-space: nowrap;
|
| 435 |
font-size: 13px; text-align: left; color: #24292e !important;
|
|
@@ -441,33 +481,15 @@ def build_app() -> gr.Blocks:
|
|
| 441 |
}
|
| 442 |
.gradio-container table.metrics-table tbody tr:nth-child(even) { background-color: #f6f8fa; }
|
| 443 |
.gradio-container table.metrics-table tbody tr:hover { background-color: #e1e4e8; }
|
| 444 |
-
.gradio-container table.metrics-table { border-collapse: collapse; width: 100%; background: white; }
|
| 445 |
.gradio-container table.metrics-table a { color: #0366d6 !important; text-decoration: none; }
|
| 446 |
.gradio-container table.metrics-table a:hover { text-decoration: underline; }
|
| 447 |
|
| 448 |
-
/*
|
| 449 |
-
.
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
border: 2px solid #e1e4e8; border-radius: 6px;
|
| 454 |
-
background: white; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
|
| 455 |
-
}
|
| 456 |
-
.filter-section {
|
| 457 |
-
background: white !important; padding: 0 !important; border-radius: 6px;
|
| 458 |
-
border: 2px solid #e1e4e8 !important; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
|
| 459 |
-
}
|
| 460 |
-
.filter-section .wrap, .filter-section .block, .filter-section .container, .filter-section .group { background: transparent !important; }
|
| 461 |
-
.filter-section .wrap { padding: 20px !important; }
|
| 462 |
-
.gradio-container .accordion {
|
| 463 |
-
background: white !important; border: 2px solid #e1e4e8 !important;
|
| 464 |
-
border-radius: 6px !important; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
|
| 465 |
}
|
| 466 |
-
.info-section { padding: 16px; background: white !important; }
|
| 467 |
-
.info-section a { color: #0366d6 !important; }
|
| 468 |
-
.gradio-container h1 { color: #24292e !important; font-weight: 700; margin-bottom: 24px; }
|
| 469 |
-
.gradio-container h3 { color: #24292e !important; font-weight: 600; margin-bottom: 16px; }
|
| 470 |
-
.gradio-container input[type="checkbox"] { accent-color: #0366d6 !important; }
|
| 471 |
"""
|
| 472 |
|
| 473 |
with gr.Blocks(title="MoE-CAP Dashboard", css=row_css, theme=gr.themes.Default()) as demo:
|
|
|
|
| 401 |
|
| 402 |
def build_app() -> gr.Blocks:
|
| 403 |
row_css = """
|
| 404 |
+
/* General Body */
|
| 405 |
body { background-color: #f5f7fa !important; }
|
| 406 |
+
.gradio-container { max-width: 100% !important; padding: 20px !important; background-color: #f5f7fa !important; }
|
| 407 |
|
| 408 |
+
/* Headers and Text */
|
| 409 |
+
.gradio-container h1 { color: #24292e !important; font-weight: 700; margin-bottom: 24px; }
|
| 410 |
+
.gradio-container h3 { color: #24292e !important; font-weight: 600; margin-bottom: 16px; }
|
| 411 |
+
.gradio-container label, .gradio-container p, .gradio-container span, .gradio-container div { color: #24292e !important; }
|
| 412 |
+
|
| 413 |
+
/* Input Fields & Blocks */
|
| 414 |
+
.gradio-container .block, .gradio-container .form, .gradio-container .gr-box, .gradio-container .gr-input {
|
| 415 |
+
background-color: white !important; border-color: #e1e4e8 !important;
|
| 416 |
}
|
| 417 |
+
.gradio-container input[type="checkbox"] { accent-color: #0366d6 !important; }
|
| 418 |
+
|
| 419 |
+
/* Search Box Styling */
|
| 420 |
.search-box {
|
| 421 |
background: white !important; padding: 16px !important;
|
| 422 |
border-radius: 6px; border: 2px solid #e1e4e8 !important;
|
|
|
|
| 430 |
padding: 10px !important; box-shadow: none !important;
|
| 431 |
}
|
| 432 |
.search-box input.scroll-hide:focus { border-color: #0366d6 !important; outline: none !important; }
|
| 433 |
+
|
| 434 |
+
/* Filter Section Styling */
|
| 435 |
+
.filter-section {
|
| 436 |
+
background: white !important; padding: 0 !important; border-radius: 6px;
|
| 437 |
+
border: 2px solid #e1e4e8 !important; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
|
| 438 |
}
|
| 439 |
+
.filter-section .wrap, .filter-section .block, .filter-section .container, .filter-section .group { background: transparent !important; }
|
| 440 |
+
.filter-section .wrap { padding: 20px !important; }
|
| 441 |
+
|
| 442 |
+
/* ACCORDION STYLING */
|
| 443 |
+
.gradio-container .accordion {
|
| 444 |
+
background: white !important; border: 2px solid #e1e4e8 !important;
|
| 445 |
+
border-radius: 6px !important; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
|
| 446 |
+
}
|
| 447 |
+
.info-section { padding: 16px; background: white !important; }
|
| 448 |
+
.info-section a { color: #0366d6 !important; }
|
| 449 |
+
|
| 450 |
+
/* --- FIX FOR DARK MODE / NIGHT MODE --- */
|
| 451 |
+
/* This forces the accordion button text and icons to stay dark */
|
| 452 |
+
.gradio-container .accordion button,
|
| 453 |
+
.gradio-container .accordion span {
|
| 454 |
+
color: #24292e !important;
|
| 455 |
+
}
|
| 456 |
+
/* This forces the expand arrow to be dark */
|
| 457 |
+
.gradio-container .accordion svg {
|
| 458 |
+
fill: #24292e !important;
|
| 459 |
+
color: #24292e !important;
|
| 460 |
+
}
|
| 461 |
+
/* --------------------------------------- */
|
| 462 |
+
|
| 463 |
+
/* Table Container & Plot */
|
| 464 |
+
.table-container {
|
| 465 |
+
overflow-x: auto; overflow-y: auto; max-height: 75vh;
|
| 466 |
+
border: 2px solid #e1e4e8; border-radius: 6px;
|
| 467 |
+
background: white; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
|
| 468 |
+
}
|
| 469 |
+
.gradio-container .plot-container { width: 100% !important; }
|
| 470 |
+
|
| 471 |
+
/* Table Internal Styling */
|
| 472 |
+
.gradio-container table.metrics-table { border-collapse: collapse; width: 100%; background: white; }
|
| 473 |
.gradio-container table.metrics-table th, .gradio-container table.metrics-table td {
|
| 474 |
padding: 10px 14px; border: 1.5px solid #e1e4e8; white-space: nowrap;
|
| 475 |
font-size: 13px; text-align: left; color: #24292e !important;
|
|
|
|
| 481 |
}
|
| 482 |
.gradio-container table.metrics-table tbody tr:nth-child(even) { background-color: #f6f8fa; }
|
| 483 |
.gradio-container table.metrics-table tbody tr:hover { background-color: #e1e4e8; }
|
|
|
|
| 484 |
.gradio-container table.metrics-table a { color: #0366d6 !important; text-decoration: none; }
|
| 485 |
.gradio-container table.metrics-table a:hover { text-decoration: underline; }
|
| 486 |
|
| 487 |
+
/* Row number column styling */
|
| 488 |
+
.metrics-table th:first-child, .metrics-table td:first-child {
|
| 489 |
+
width: 60px !important; text-align: center !important;
|
| 490 |
+
padding: 8px !important; font-weight: 600 !important;
|
| 491 |
+
background-color: #f0f0f0 !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 492 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 493 |
"""
|
| 494 |
|
| 495 |
with gr.Blocks(title="MoE-CAP Dashboard", css=row_css, theme=gr.themes.Default()) as demo:
|