mgyigit commited on
Commit
5ca345c
·
verified ·
1 Parent(s): 927b82c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -22
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,31 +137,35 @@ 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 */
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
  # ---------------------------------------------------------------------------
@@ -181,9 +185,14 @@ with block:
181
  gr.Image(
182
  value="./src/data/PROBE_workflow_figure.jpg",
183
  show_label=False,
184
- height=1000,
185
  container=False,
186
  )
 
 
 
 
 
187
 
188
  leaderboard = get_baseline_df(None, None)
189
  method_names = leaderboard['Method'].unique().tolist()
@@ -230,8 +239,7 @@ with block:
230
  datatype=baseline_datatype,
231
  interactive=False,
232
  elem_id="leaderboard-table",
233
- pinned_columns=1,
234
- max_height=1000,
235
  )
236
 
237
  # callbacks
@@ -373,4 +381,4 @@ with block:
373
  )
374
 
375
  # ---------------------------------------------------------------------------
376
- 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 & 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
  # ---------------------------------------------------------------------------
 
185
  gr.Image(
186
  value="./src/data/PROBE_workflow_figure.jpg",
187
  show_label=False,
188
+ height=150,
189
  container=False,
190
  )
191
+ # explanatory sentence just below the figure
192
+ gr.Markdown(
193
+ "For detailed explanations of the metrics and benchmarks, please refer to the “About” tab.",
194
+ elem_classes="leaderboard-note",
195
+ )
196
 
197
  leaderboard = get_baseline_df(None, None)
198
  method_names = leaderboard['Method'].unique().tolist()
 
239
  datatype=baseline_datatype,
240
  interactive=False,
241
  elem_id="leaderboard-table",
242
+ # make table longer
 
243
  )
244
 
245
  # callbacks
 
381
  )
382
 
383
  # ---------------------------------------------------------------------------
384
+ block.launch()