mokamoto commited on
Commit
66f69ed
·
1 Parent(s): f781593

tables with nicer styling

Browse files
results.html CHANGED
@@ -97,26 +97,26 @@
97
  </tr>
98
  <tr>
99
  <th>Dataset</th>
100
- <th class="has-text-centered tooltip-trigger column-border-left" data-title="FiNER-Open Research Dataset" data-tooltip="FiNER-Open Research Dataset: A manually annotated dataset for financial named entity recognition, containing 47,851 financial news articles with annotations for person, location, and organization entities.">FiNER</th>
101
- <th class="has-text-centered tooltip-trigger" data-title="FinRED" data-tooltip="FinRED: A specialized relation extraction dataset for the financial domain, created from financial news and earnings call transcripts, with financial relations mapped using distance supervision based on Wikidata triplets.">FR</th>
102
- <th class="has-text-centered tooltip-trigger" data-title="FinEntity" data-tooltip="FinEntity: Dataset for financial entity recognition and entity linking from diverse financial documents. Features 5,554 entity annotations with company, person, and product types linked to a knowledge base.">FE</th>
103
- <th class="has-text-centered tooltip-trigger" data-title="ReFINED" data-tooltip="ReFINED: Information retrieval and extraction benchmark spanning financial domains, derived from datasets including FiQA, CoFiF, ConvFinQA, and SemEval tasks with 10,700+ pairs of queries and relevant documents.">RF</th>
104
- <th class="has-text-centered tooltip-trigger column-border-left" data-title="FiQA Task 1" data-tooltip="FiQA Task 1 focuses on aspect-based financial sentiment analysis. Given a financial text, such as microblog posts or news headlines, systems predict sentiment scores on a continuous scale from -1 (negative) to 1 (positive). Evaluation metrics include MSE, MAE, and R-squared.">FQ1</th>
105
- <th class="has-text-centered tooltip-trigger column-border-left" data-tooltip="Financial Phrase Bank contains 4,840 sentences from English-language financial news articles, categorized as positive, negative, or neutral. Each sentence reflects the sentiment an investor might perceive regarding its influence on stock prices. Annotated by 16 finance experts using majority voting.">FPB</th>
106
- <th class="has-text-centered tooltip-trigger" data-tooltip="Manually-annotated dataset focusing on subjectivity in Earnings Call Transcripts QA sessions. Includes 49,446 annotations across 2,747 QA pairs labeled on six subjectivity features: Assertive, Cautious, Optimistic, Specific, Clear, and Relevant.">SQA</th>
107
- <th class="has-text-centered tooltip-trigger" data-tooltip="Expert-annotated dataset of financial corpora with sentiment labels from ratings agencies and news publishers. Contains 10K+ positive/negative texts and 1K neutral samples.">FNXL</th>
108
- <th class="has-text-centered tooltip-trigger column-border-left" data-tooltip="For text sections identified as causal, this task extracts the Cause and Effect spans, handling both unicausal and multicausal cases in financial texts.">CD</th>
109
- <th class="has-text-centered tooltip-trigger" data-tooltip="Determines if a given financial text section contains a causal relation, labeled as 1 if causal and 0 otherwise.">CC</th>
110
- <th class="has-text-centered tooltip-trigger column-border-left" data-title="Banking77" data-tooltip="A fine-grained dataset designed for intent detection within the banking domain, comprising 13,083 customer service queries annotated with 77 unique intents.">Bank77</th>
111
- <th class="has-text-centered tooltip-trigger" data-title="FinBench" data-tooltip="A dataset designed to evaluate machine learning models using tabular data and profile text inputs for financial risk prediction, covering default, fraud, and churn with 333,000 labeled instances.">FBench</th>
112
- <th class="has-text-centered tooltip-trigger" data-tooltip="A dataset of Federal Open Market Committee speeches, meeting minutes, and press conference transcripts (1996-2022) for hawkish-dovish classification of monetary policy stance.">FOMC</th>
113
- <th class="has-text-centered tooltip-trigger" data-tooltip="An expert-annotated dataset for detecting fine-grained investor claims within financial narratives, focusing on numerals in analyst reports and earnings call transcripts.">NumC</th>
114
- <th class="has-text-centered tooltip-trigger tooltip-right" data-tooltip="A dataset of 11,412 human-annotated financial news headlines focused on commodities (particularly gold), spanning 2000-2019, with binary indicators for price mentions and movements.">Headlines</th>
115
- <th class="has-text-centered tooltip-trigger column-border-left" data-tooltip="Large-scale dataset for numerical reasoning over financial data, consisting of 8,281 question-answer pairs from financial reports. Focuses on questions requiring interpretation of financial data and multi-step reasoning. Licensed under CC BY-NC 4.0.">FinQA</th>
116
- <th class="has-text-centered tooltip-trigger tooltip-right" data-tooltip="Multi-turn question answering dataset with 3,892 conversations and 14,115 questions exploring chains of numerical reasoning in financial dialogues. Released under MIT License.">ConvFQA</th>
117
- <th class="has-text-centered tooltip-trigger tooltip-right" data-tooltip="Large-scale QA dataset for hybrid data sources (tables and text) from financial reports, emphasizing numerical reasoning operations. Licensed under CC BY 4.0.">TaTQA</th>
118
- <th class="has-text-centered tooltip-trigger tooltip-right column-border-left" data-title="ECTSum" data-tooltip="A dataset focused on extractive summarization of earnings call transcripts, containing 2,425 transcripts from investor calls. Each instance includes a transcript, company name, and the ground truth summary. The data spans diverse sectors from S&P 500 companies.">EarCall</th>
119
- <th class="has-text-centered tooltip-trigger tooltip-right" data-tooltip="A dataset comprising 4,750 financial disclosures from 10-K or 10-Q filings of public companies. Each entry contains a company name, filing date, source domain, and disclosure text with its expert-crafted abstract.">FinD</th>
120
  </tr>
121
  </thead>
122
  <tbody>
@@ -2400,5 +2400,6 @@
2400
  <script src="static/js/results.js"></script>
2401
  <script src="static/js/tooltips.js"></script>
2402
  <script src="static/js/fixed-tooltips.js"></script>
 
2403
  </body>
2404
  </html>
 
97
  </tr>
98
  <tr>
99
  <th>Dataset</th>
100
+ <th class="has-text-centered tooltip-trigger column-border-left" data-title="FiNER-Open Research Dataset" data-tooltip="FiNER-Open Research Dataset: A manually annotated dataset for financial named entity recognition, containing 47,851 financial news articles with annotations for person, location, and organization entities.">FiNER<span class="metric-label">F1</span></th>
101
+ <th class="has-text-centered tooltip-trigger" data-title="FinRED" data-tooltip="FinRED: A specialized relation extraction dataset for the financial domain, created from financial news and earnings call transcripts, with financial relations mapped using distance supervision based on Wikidata triplets.">FR<span class="metric-label">F1</span></th>
102
+ <th class="has-text-centered tooltip-trigger" data-title="FinEntity" data-tooltip="FinEntity: Dataset for financial entity recognition and entity linking from diverse financial documents. Features 5,554 entity annotations with company, person, and product types linked to a knowledge base.">FE<span class="metric-label">Acc</span></th>
103
+ <th class="has-text-centered tooltip-trigger" data-title="ReFINED" data-tooltip="ReFINED: Information retrieval and extraction benchmark spanning financial domains, derived from datasets including FiQA, CoFiF, ConvFinQA, and SemEval tasks with 10,700+ pairs of queries and relevant documents.">RF<span class="metric-label">MAP</span></th>
104
+ <th class="has-text-centered tooltip-trigger column-border-left" data-title="FiQA Task 1" data-tooltip="FiQA Task 1 focuses on aspect-based financial sentiment analysis. Given a financial text, such as microblog posts or news headlines, systems predict sentiment scores on a continuous scale from -1 (negative) to 1 (positive). Evaluation metrics include MSE, MAE, and R-squared.">FQ1<span class="metric-label">MSE</span></th>
105
+ <th class="has-text-centered tooltip-trigger column-border-left" data-tooltip="Financial Phrase Bank contains 4,840 sentences from English-language financial news articles, categorized as positive, negative, or neutral. Each sentence reflects the sentiment an investor might perceive regarding its influence on stock prices. Annotated by 16 finance experts using majority voting.">FPB<span class="metric-label">F1</span></th>
106
+ <th class="has-text-centered tooltip-trigger" data-tooltip="Manually-annotated dataset focusing on subjectivity in Earnings Call Transcripts QA sessions. Includes 49,446 annotations across 2,747 QA pairs labeled on six subjectivity features: Assertive, Cautious, Optimistic, Specific, Clear, and Relevant.">SQA<span class="metric-label">F1</span></th>
107
+ <th class="has-text-centered tooltip-trigger" data-tooltip="Expert-annotated dataset of financial corpora with sentiment labels from ratings agencies and news publishers. Contains 10K+ positive/negative texts and 1K neutral samples.">FNXL<span class="metric-label">Acc</span></th>
108
+ <th class="has-text-centered tooltip-trigger column-border-left" data-tooltip="For text sections identified as causal, this task extracts the Cause and Effect spans, handling both unicausal and multicausal cases in financial texts.">CD<span class="metric-label">F1</span></th>
109
+ <th class="has-text-centered tooltip-trigger" data-tooltip="Determines if a given financial text section contains a causal relation, labeled as 1 if causal and 0 otherwise.">CC<span class="metric-label">F1</span></th>
110
+ <th class="has-text-centered tooltip-trigger column-border-left" data-title="Banking77" data-tooltip="A fine-grained dataset designed for intent detection within the banking domain, comprising 13,083 customer service queries annotated with 77 unique intents.">Bank77<span class="metric-label">Acc</span></th>
111
+ <th class="has-text-centered tooltip-trigger" data-title="FinBench" data-tooltip="A dataset designed to evaluate machine learning models using tabular data and profile text inputs for financial risk prediction, covering default, fraud, and churn with 333,000 labeled instances.">FBench<span class="metric-label">F1</span></th>
112
+ <th class="has-text-centered tooltip-trigger" data-tooltip="A dataset of Federal Open Market Committee speeches, meeting minutes, and press conference transcripts (1996-2022) for hawkish-dovish classification of monetary policy stance.">FOMC<span class="metric-label">F1</span></th>
113
+ <th class="has-text-centered tooltip-trigger" data-tooltip="An expert-annotated dataset for detecting fine-grained investor claims within financial narratives, focusing on numerals in analyst reports and earnings call transcripts.">NumC<span class="metric-label">Acc</span></th>
114
+ <th class="has-text-centered tooltip-trigger tooltip-right" data-tooltip="A dataset of 11,412 human-annotated financial news headlines focused on commodities (particularly gold), spanning 2000-2019, with binary indicators for price mentions and movements.">Headlines<span class="metric-label">F1</span></th>
115
+ <th class="has-text-centered tooltip-trigger column-border-left" data-tooltip="Large-scale dataset for numerical reasoning over financial data, consisting of 8,281 question-answer pairs from financial reports. Focuses on questions requiring interpretation of financial data and multi-step reasoning. Licensed under CC BY-NC 4.0.">FinQA<span class="metric-label">Acc</span></th>
116
+ <th class="has-text-centered tooltip-trigger tooltip-right" data-tooltip="Multi-turn question answering dataset with 3,892 conversations and 14,115 questions exploring chains of numerical reasoning in financial dialogues. Released under MIT License.">ConvFQA<span class="metric-label">EM</span></th>
117
+ <th class="has-text-centered tooltip-trigger tooltip-right" data-tooltip="Large-scale QA dataset for hybrid data sources (tables and text) from financial reports, emphasizing numerical reasoning operations. Licensed under CC BY 4.0.">TaTQA<span class="metric-label">EM</span></th>
118
+ <th class="has-text-centered tooltip-trigger tooltip-right column-border-left" data-title="ECTSum" data-tooltip="A dataset focused on extractive summarization of earnings call transcripts, containing 2,425 transcripts from investor calls. Each instance includes a transcript, company name, and the ground truth summary. The data spans diverse sectors from S&P 500 companies.">EarCall<span class="metric-label">ROUGE</span></th>
119
+ <th class="has-text-centered tooltip-trigger tooltip-right" data-tooltip="A dataset comprising 4,750 financial disclosures from 10-K or 10-Q filings of public companies. Each entry contains a company name, filing date, source domain, and disclosure text with its expert-crafted abstract.">FinD<span class="metric-label">ROUGE</span></th>
120
  </tr>
121
  </thead>
122
  <tbody>
 
2400
  <script src="static/js/results.js"></script>
2401
  <script src="static/js/tooltips.js"></script>
2402
  <script src="static/js/fixed-tooltips.js"></script>
2403
+ <script src="static/js/tooltip-fix.js"></script>
2404
  </body>
2405
  </html>
static/css/results.css CHANGED
@@ -9,13 +9,44 @@
9
  }
10
  .results-table {
11
  width: 100%;
12
- overflow-x: auto;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  }
14
  .table-container {
15
- padding: 1.5rem;
16
  background-color: white;
17
  border-radius: 6px;
18
- box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1);
 
 
 
 
19
  }
20
  .results-title {
21
  margin-bottom: 1.5rem;
@@ -58,12 +89,27 @@ body {
58
  pointer-events: none;
59
  }
60
 
 
 
 
 
 
 
 
 
61
  .tooltip-trigger:hover::first-line {
62
  font-weight: bold;
63
  font-size: 0.95rem;
64
  text-decoration: underline;
65
  }
66
 
 
 
 
 
 
 
 
67
  /* Add a class for manually marking right-aligned tooltips */
68
  .tooltip-right:hover::after {
69
  left: auto !important;
@@ -74,37 +120,100 @@ body {
74
 
75
  /* Table borders */
76
  .column-border-right {
77
- border-right: 2px solid #dbdbdb;
78
  }
79
  .column-border-left {
80
- border-left: 2px solid #ccc;
81
  }
82
  .row-border-bottom {
83
- border-bottom: 2px solid #999;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  }
85
 
86
  /* Performance highlighting colors */
87
  .performance-best {
88
- background-color: #48c774 !important;
 
 
89
  }
90
  .performance-strong {
91
- background-color: #b5f2c3 !important;
 
 
92
  }
93
  .performance-medium {
94
- background-color: #b5f2c3 !important; /* Same as strong for consistency */
 
95
  }
96
  .performance-low {
97
- background-color: #ebffef !important;
98
  }
99
 
100
  /* Legend styles */
101
  .performance-legend {
102
- margin-top: 1rem;
 
 
 
 
103
  }
104
  .performance-legend-item {
105
- display: inline-block;
106
- padding: 0 0.5rem;
107
- margin-right: 0.5rem;
 
 
 
 
108
  }
109
 
110
  /* Responsive tooltip positioning */
@@ -119,4 +228,14 @@ body {
119
  margin-right: 0;
120
  margin-top: 5px;
121
  }
122
- }
 
 
 
 
 
 
 
 
 
 
 
9
  }
10
  .results-table {
11
  width: 100%;
12
+ table-layout: fixed;
13
+ border-collapse: collapse;
14
+ }
15
+ .results-table th,
16
+ .results-table td {
17
+ text-align: center;
18
+ padding: 0.4rem 0.2rem;
19
+ vertical-align: middle;
20
+ width: 50px;
21
+ max-width: 50px;
22
+ font-size: 0.75rem;
23
+ white-space: nowrap;
24
+ overflow: hidden;
25
+ text-overflow: ellipsis;
26
+ }
27
+ .results-table th {
28
+ background-color: #e0e0e0;
29
+ color: #333;
30
+ font-weight: 600;
31
+ position: sticky;
32
+ top: 0;
33
+ text-align: center;
34
+ }
35
+ .results-table tr:nth-child(even) {
36
+ background-color: #f0f6ff;
37
+ }
38
+ .results-table tr:hover {
39
+ background-color: #e5eeff;
40
  }
41
  .table-container {
42
+ padding: 0.75rem;
43
  background-color: white;
44
  border-radius: 6px;
45
+ box-shadow: 0 4px 6px rgba(10, 10, 10, 0.15);
46
+ margin-bottom: 2rem;
47
+ font-size: 0.9rem;
48
+ max-width: 100%;
49
+ overflow-x: auto;
50
  }
51
  .results-title {
52
  margin-bottom: 1.5rem;
 
89
  pointer-events: none;
90
  }
91
 
92
+ .tooltip-trigger::after {
93
+ display: none;
94
+ }
95
+
96
+ .tooltip-trigger:hover::after {
97
+ display: block;
98
+ }
99
+
100
  .tooltip-trigger:hover::first-line {
101
  font-weight: bold;
102
  font-size: 0.95rem;
103
  text-decoration: underline;
104
  }
105
 
106
+ .tooltip-trigger .first-line,
107
+ .tooltip-trigger::first-line {
108
+ font-weight: normal;
109
+ font-size: inherit;
110
+ text-decoration: none;
111
+ }
112
+
113
  /* Add a class for manually marking right-aligned tooltips */
114
  .tooltip-right:hover::after {
115
  left: auto !important;
 
120
 
121
  /* Table borders */
122
  .column-border-right {
123
+ border-right: 2px solid #b8d3ff;
124
  }
125
  .column-border-left {
126
+ border-left: 2px solid #b8d3ff;
127
  }
128
  .row-border-bottom {
129
+ border-bottom: 2px solid #004d99;
130
+ }
131
+
132
+ /* Metric labels in headers */
133
+ .metric-label {
134
+ display: block;
135
+ font-size: 0.65rem;
136
+ font-weight: normal;
137
+ margin-top: 0.1rem;
138
+ font-style: italic;
139
+ opacity: 0.75;
140
+ }
141
+ /* Model name column styling */
142
+ .results-table td:first-child {
143
+ font-weight: 600;
144
+ text-align: left;
145
+ background-color: #f8f9fa;
146
+ position: sticky;
147
+ left: 0;
148
+ z-index: 1;
149
+ box-shadow: 2px 0 5px rgba(0,0,0,0.05);
150
+ /* width: 110px; */
151
+ /* max-width: 110px; */
152
+ /* min-width: 110px; */
153
+ }
154
+
155
+ /* Adjust column widths for task groups */
156
+ .results-table th[colspan="4"],
157
+ .results-table th[colspan="3"],
158
+ .results-table th[colspan="5"],
159
+ .results-table th[colspan="2"] {
160
+ min-width: auto;
161
+ }
162
+
163
+ /* Fix for text classification tables */
164
+ /* .results-table th[colspan="4"] {
165
+ width: 220px;
166
+ max-width: 220px;
167
+ }
168
+
169
+ .results-table th[colspan="1"] {
170
+ width: 60px;
171
+ max-width: 60px;
172
+ } */
173
+
174
+ /* Ensure model column in all tabs has enough width */
175
+ .results-table th:first-child {
176
+ /* width: 110px; */
177
+ min-width: 110px;
178
+ /* max-width: 110px; */
179
+ text-align: left;
180
  }
181
 
182
  /* Performance highlighting colors */
183
  .performance-best {
184
+ background-color: #1f93ff !important;
185
+ color: white !important;
186
+ font-weight: bold !important;
187
  }
188
  .performance-strong {
189
+ background-color: #70b7ff !important;
190
+ color: #003366 !important;
191
+ font-weight: 600 !important;
192
  }
193
  .performance-medium {
194
+ background-color: #a8d1ff !important;
195
+ color: #003366 !important;
196
  }
197
  .performance-low {
198
+ background-color: #e1efff !important;
199
  }
200
 
201
  /* Legend styles */
202
  .performance-legend {
203
+ margin-top: 1.5rem;
204
+ margin-bottom: 0.5rem;
205
+ display: flex;
206
+ justify-content: center;
207
+ flex-wrap: wrap;
208
  }
209
  .performance-legend-item {
210
+ display: inline-flex;
211
+ align-items: center;
212
+ padding: 0.5rem 1rem;
213
+ margin: 0.25rem 0.5rem;
214
+ border-radius: 4px;
215
+ font-size: 0.9rem;
216
+ box-shadow: 0 1px 3px rgba(0,0,0,0.1);
217
  }
218
 
219
  /* Responsive tooltip positioning */
 
228
  margin-right: 0;
229
  margin-top: 5px;
230
  }
231
+ }@media (min-width: 768px) {
232
+ .container {
233
+ max-width: 1500px !important;
234
+ }
235
+ }
236
+
237
+ /* Add line breaks to longer model names */
238
+ .results-table td:first-child {
239
+ word-break: break-word;
240
+ hyphens: auto;
241
+ }
static/css/tooltips.css CHANGED
@@ -7,7 +7,7 @@ th[data-tooltip]:hover::after {
7
 
8
  /* Custom tooltips created by JS */
9
  .custom-tooltip {
10
- position: fixed;
11
  z-index: 9999;
12
  background-color: rgba(0, 0, 0, 0.9);
13
  color: white;
@@ -20,6 +20,7 @@ th[data-tooltip]:hover::after {
20
  text-align: left;
21
  pointer-events: none;
22
  word-wrap: break-word;
 
23
  }
24
 
25
  .custom-tooltip strong {
 
7
 
8
  /* Custom tooltips created by JS */
9
  .custom-tooltip {
10
+ position: absolute;
11
  z-index: 9999;
12
  background-color: rgba(0, 0, 0, 0.9);
13
  color: white;
 
20
  text-align: left;
21
  pointer-events: none;
22
  word-wrap: break-word;
23
+ transition: opacity 0.2s ease-in-out;
24
  }
25
 
26
  .custom-tooltip strong {
static/js/fixed-tooltips.js ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ document.addEventListener('DOMContentLoaded', function() {
2
+ // Fix table column widths
3
+ function fixTableColumnWidths() {
4
+ const tables = document.querySelectorAll('.results-table table');
5
+
6
+ tables.forEach(table => {
7
+ // Force table layout to fixed
8
+ table.style.tableLayout = 'fixed';
9
+
10
+ // Get all the dataset header cells
11
+ const datasetHeaders = table.querySelectorAll('thead tr:first-child th:not(:first-child)');
12
+
13
+ // Set dataset column titles to have no width impact
14
+ datasetHeaders.forEach(header => {
15
+ // Remove any explicit width
16
+ header.style.width = 'auto';
17
+
18
+ // Create a wrapper for the text that won't affect layout
19
+ if (!header.querySelector('.tooltip-text-wrapper')) {
20
+ const textContent = header.textContent;
21
+ header.innerHTML = `<span class="tooltip-text-wrapper" style="display:inline-block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;">${header.innerHTML}</span>`;
22
+ }
23
+
24
+ // Force all tooltips to be positioned absolute or fixed
25
+ if (header.hasAttribute('data-tooltip')) {
26
+ header.style.position = 'relative';
27
+ }
28
+ });
29
+
30
+ // Get the total number of metric columns (excluding model name column)
31
+ let totalMetricColumns = 0;
32
+ const metricCells = table.querySelectorAll('thead tr:nth-child(2) th:not(:first-child)');
33
+ totalMetricColumns = metricCells.length;
34
+
35
+ if (totalMetricColumns > 0) {
36
+ // Calculate equal width for data columns
37
+ const equalWidth = `${(100 / totalMetricColumns).toFixed(2)}%`;
38
+
39
+ // Apply equal width to all metric header cells
40
+ metricCells.forEach(cell => {
41
+ cell.style.width = equalWidth;
42
+ cell.style.minWidth = '40px';
43
+ cell.style.maxWidth = 'none'; // Let it take its share
44
+ });
45
+
46
+ // Apply equal width to all data cells
47
+ const dataCells = table.querySelectorAll('tbody td:not(:first-child)');
48
+ dataCells.forEach(cell => {
49
+ cell.style.width = equalWidth;
50
+ cell.style.minWidth = '40px';
51
+ cell.style.maxWidth = 'none'; // Let it take its share
52
+ });
53
+ }
54
+
55
+ // Set the model column to have a fixed width
56
+ const modelColumn = table.querySelectorAll('thead tr th:first-child, tbody td:first-child');
57
+ modelColumn.forEach(cell => {
58
+ cell.style.width = '160px';
59
+ cell.style.minWidth = '160px';
60
+ cell.style.maxWidth = '160px';
61
+ });
62
+ });
63
+ }
64
+
65
+ // Create a style element for additional fixes
66
+ const style = document.createElement('style');
67
+ style.textContent = `
68
+ /* Fix table layout issues */
69
+ .results-table table {
70
+ table-layout: fixed !important;
71
+ width: 100% !important;
72
+ }
73
+
74
+ /* Ensure tooltips don't affect column widths */
75
+ .tooltip-trigger::after,
76
+ [data-tooltip]::after {
77
+ position: absolute !important;
78
+ content: attr(data-tooltip);
79
+ width: 300px !important;
80
+ max-width: 300px !important;
81
+ white-space: normal !important;
82
+ pointer-events: none;
83
+ display: none !important;
84
+ }
85
+
86
+ /* Make sure dataset title cells don't grow too wide */
87
+ .results-table thead tr:first-child th:not(:first-child) {
88
+ white-space: nowrap;
89
+ overflow: hidden;
90
+ text-overflow: ellipsis;
91
+ }
92
+ `;
93
+ document.head.appendChild(style);
94
+
95
+ // Run immediately
96
+ fixTableColumnWidths();
97
+
98
+ // Also run after a short delay
99
+ setTimeout(fixTableColumnWidths, 200);
100
+
101
+ // Run again after images and other resources might have loaded
102
+ window.addEventListener('load', function() {
103
+ fixTableColumnWidths();
104
+ setTimeout(fixTableColumnWidths, 500);
105
+ });
106
+
107
+ // Also run when tabs are clicked
108
+ const tabs = document.querySelectorAll('.tabs li');
109
+ tabs.forEach(tab => {
110
+ tab.addEventListener('click', () => {
111
+ setTimeout(fixTableColumnWidths, 200);
112
+ });
113
+ });
114
+
115
+ // Also run on window resize
116
+ window.addEventListener('resize', fixTableColumnWidths);
117
+ });
static/js/tooltip-fix.js ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ document.addEventListener('DOMContentLoaded', function() {
2
+ // Fix for tooltips that stay bold after hover
3
+ const tooltipTriggers = document.querySelectorAll('.tooltip-trigger');
4
+
5
+ tooltipTriggers.forEach(trigger => {
6
+ trigger.addEventListener('mouseleave', function() {
7
+ // Force style reset after hover
8
+ setTimeout(() => {
9
+ this.style.fontWeight = '';
10
+ this.style.fontSize = '';
11
+ this.style.textDecoration = '';
12
+ }, 50);
13
+ });
14
+ });
15
+ });
static/js/tooltips.js CHANGED
@@ -64,20 +64,47 @@ document.addEventListener('DOMContentLoaded', () => {
64
  customTooltip.innerHTML = `<strong>${title}</strong><br><br>${tooltipContent}`;
65
  document.body.appendChild(customTooltip);
66
 
67
- // Position tooltip to RIGHT of element
68
  const rect = tooltip.getBoundingClientRect();
69
- console.log(`Element position: top=${rect.top}, left=${rect.left}`);
70
 
71
- customTooltip.style.top = `${window.scrollY + rect.top}px`;
 
 
72
 
73
- // Check if there's enough space on the left
74
- if (rect.left > 320) {
75
- // Position on left if there's room
76
- customTooltip.style.left = `${rect.left - 310}px`;
77
- } else {
78
- // Position on right if there's not enough room on left
79
- customTooltip.style.left = `${rect.right + 10}px`;
 
 
 
 
 
 
80
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  console.log(`Tooltip position: top=${customTooltip.style.top}, left=${customTooltip.style.left}`);
82
  });
83
 
 
64
  customTooltip.innerHTML = `<strong>${title}</strong><br><br>${tooltipContent}`;
65
  document.body.appendChild(customTooltip);
66
 
67
+ // Position tooltip near the element
68
  const rect = tooltip.getBoundingClientRect();
69
+ console.log(`Element position: top=${rect.top}, left=${rect.left}, width=${rect.width}, height=${rect.height}`);
70
 
71
+ // Position tooltip below and centered on the element
72
+ const tooltipWidth = 300; // Width of our tooltip in pixels
73
+ const verticalOffset = 5; // Small gap between element and tooltip
74
 
75
+ // Set tooltip position below the element
76
+ customTooltip.style.top = `${window.scrollY + rect.bottom + verticalOffset}px`;
77
+
78
+ // Center the tooltip horizontally on the element
79
+ const tooltipLeft = rect.left + (rect.width / 2) - (tooltipWidth / 2);
80
+
81
+ // But make sure it stays within the viewport bounds
82
+ const viewportWidth = window.innerWidth;
83
+ let adjustedLeft = tooltipLeft;
84
+
85
+ // Check right edge
86
+ if (tooltipLeft + tooltipWidth > viewportWidth - 20) {
87
+ adjustedLeft = viewportWidth - tooltipWidth - 20;
88
  }
89
+
90
+ // Check left edge
91
+ if (adjustedLeft < 20) {
92
+ adjustedLeft = 20;
93
+ }
94
+
95
+ customTooltip.style.left = `${adjustedLeft}px`;
96
+
97
+ // Add a small arrow at the top pointing to the element
98
+ const arrow = document.createElement('div');
99
+ arrow.style.position = 'absolute';
100
+ arrow.style.top = '-8px';
101
+ arrow.style.left = `${Math.max(0, Math.min(tooltipWidth - 20, rect.left + (rect.width / 2) - adjustedLeft - 8))}px`;
102
+ arrow.style.width = '0';
103
+ arrow.style.height = '0';
104
+ arrow.style.borderLeft = '8px solid transparent';
105
+ arrow.style.borderRight = '8px solid transparent';
106
+ arrow.style.borderBottom = '8px solid rgba(0, 0, 0, 0.9)';
107
+ customTooltip.appendChild(arrow);
108
  console.log(`Tooltip position: top=${customTooltip.style.top}, left=${customTooltip.style.left}`);
109
  });
110