mgyigit commited on
Commit
1b78511
·
verified ·
1 Parent(s): 4978f25

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -24
app.py CHANGED
@@ -107,7 +107,7 @@ def get_plot_explanation(benchmark_type, x_metric, y_metric, aspect, dataset, si
107
  if benchmark_type == "function":
108
  return (
109
  f"Heat‑map shows model scores for **{aspect.upper()}** terms with **{single_metric}**. "
110
- "Darker squares → better predictions."
111
  )
112
  if benchmark_type == "family":
113
  return (
@@ -137,35 +137,31 @@ def generate_plot_and_explanation(benchmark_type, methods_selected, x_metric, y_
137
  # Custom CSS for frozen first column and clearer table styles
138
  # ---------------------------------------------------------------------------
139
  CUSTOM_CSS = """
140
- /* Freeze first column & improve scrolling for static Dataframe output */
141
- #leaderboard-table .dataframe-wrap {
142
- overflow-x: auto;
143
- overflow-y: auto;
144
- max-height: 650px; /* taller table */
145
- }
146
- #leaderboard-table table {
147
- border-collapse: collapse;
148
- }
149
- #leaderboard-table thead th,
150
- #leaderboard-table tbody td {
151
- padding: 4px 6px;
152
- }
153
- #leaderboard-table thead th:first-child,
154
- #leaderboard-table tbody td:first-child {
155
  position: sticky;
156
  left: 0;
157
  background: white;
158
- z-index: 3; /* stay on top */
159
- box-shadow: 2px 0 2px -2px #aaa; /* subtle divider */
160
  }
161
- /* striped rows */
162
- #leaderboard-table tbody tr:nth-child(odd) {
 
163
  background: #fafafa;
164
  }
165
- /* center numeric columns */
166
- #leaderboard-table tbody td:not(:first-child) {
 
167
  text-align: center;
168
  }
 
 
 
 
 
 
 
169
  """
170
 
171
  # ---------------------------------------------------------------------------
@@ -234,7 +230,7 @@ with block:
234
  datatype=baseline_datatype,
235
  interactive=False,
236
  elem_id="leaderboard-table",
237
- # make table longer
238
  )
239
 
240
  # callbacks
@@ -376,4 +372,4 @@ with block:
376
  )
377
 
378
  # ---------------------------------------------------------------------------
379
- block.launch()
 
107
  if benchmark_type == "function":
108
  return (
109
  f"Heat‑map shows model scores for **{aspect.upper()}** terms with **{single_metric}**. "
110
+ "Darker squares → better predictions."
111
  )
112
  if benchmark_type == "family":
113
  return (
 
137
  # Custom CSS for frozen first column and clearer table styles
138
  # ---------------------------------------------------------------------------
139
  CUSTOM_CSS = """
140
+ /* freeze first column */
141
+ #leaderboard-table table tr th:first-child,
142
+ #leaderboard-table table tr td:first-child {
 
 
 
 
 
 
 
 
 
 
 
 
143
  position: sticky;
144
  left: 0;
145
  background: white;
146
+ z-index: 2;
 
147
  }
148
+
149
+ /* striped rows for readability */
150
+ #leaderboard-table table tr:nth-child(odd) {
151
  background: #fafafa;
152
  }
153
+
154
+ /* centre numeric cells */
155
+ #leaderboard-table td:not(:first-child) {
156
  text-align: center;
157
  }
158
+
159
+ /* scrollable and taller table */
160
+ #leaderboard-table .dataframe-wrap {
161
+ max-height: 1200px;
162
+ overflow-y: auto;
163
+ overflow-x: auto;
164
+ }
165
  """
166
 
167
  # ---------------------------------------------------------------------------
 
230
  datatype=baseline_datatype,
231
  interactive=False,
232
  elem_id="leaderboard-table",
233
+ pinned_columns=1,
234
  )
235
 
236
  # callbacks
 
372
  )
373
 
374
  # ---------------------------------------------------------------------------
375
+ block.launch()