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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -17
app.py CHANGED
@@ -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
  # ---------------------------------------------------------------------------
 
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
  # ---------------------------------------------------------------------------