Spaces:
Running
Running
update
Browse files
app/src/content/embeds/d3-line.html
CHANGED
|
@@ -193,6 +193,28 @@
|
|
| 193 |
const primary = getComputedStyle(document.documentElement).getPropertyValue('--primary-color').trim() || '#E889AB';
|
| 194 |
const pool = [primary, '#4EA5B7', '#E38A42', '#CEC0FA', ...(d3.schemeTableau10||[])];
|
| 195 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 196 |
// State and data
|
| 197 |
let metricList = [];
|
| 198 |
let runList = [];
|
|
@@ -489,7 +511,7 @@
|
|
| 489 |
const xpx = xScale(nearest);
|
| 490 |
hoverLine.attr('x1', xpx).attr('x2', xpx).style('display', null).attr('stroke', 'rgba(0,0,0,0.25)');
|
| 491 |
// Tooltip content
|
| 492 |
-
let html = `<div><strong>${metricKey}</strong></div><div><strong>step</strong> ${nearest}</div>`;
|
| 493 |
series.forEach(s=>{
|
| 494 |
const m = new Map(s.values.map(v=>[v.step, v.value]));
|
| 495 |
const val = m.has(nearest) ? m.get(nearest) : null;
|
|
@@ -525,7 +547,7 @@
|
|
| 525 |
});
|
| 526 |
|
| 527 |
// Populate metric select (default to average_rank if present)
|
| 528 |
-
metricList.forEach((m)=>{ const o=document.createElement('option'); o.value=m; o.textContent=m; selectMetric.appendChild(o); });
|
| 529 |
const def = metricList.find(m => /average_rank/i.test(m)) || metricList[0];
|
| 530 |
if (def) selectMetric.value = def;
|
| 531 |
|
|
|
|
| 193 |
const primary = getComputedStyle(document.documentElement).getPropertyValue('--primary-color').trim() || '#E889AB';
|
| 194 |
const pool = [primary, '#4EA5B7', '#E38A42', '#CEC0FA', ...(d3.schemeTableau10||[])];
|
| 195 |
|
| 196 |
+
// Mapping from metric names to display titles
|
| 197 |
+
const metricTitleMapping = {
|
| 198 |
+
'docvqa_val_anls': 'DocVQA',
|
| 199 |
+
'infovqa_val_anls': 'InfoVQA',
|
| 200 |
+
'mme_total_score': 'MME Total',
|
| 201 |
+
'mmmu_val_mmmu_acc': 'MMMU',
|
| 202 |
+
'mmstar_average': 'MMStar',
|
| 203 |
+
'ocrbench_ocrbench_accuracy': 'OCRBench',
|
| 204 |
+
'scienceqa_exact_match': 'ScienceQA',
|
| 205 |
+
'textvqa_val_exact_match': 'TextVQA',
|
| 206 |
+
'average': 'Average (excl. MME)',
|
| 207 |
+
'average_rank': 'Average Rank',
|
| 208 |
+
'ai2d_exact_match': 'AI2D',
|
| 209 |
+
'chartqa_relaxed_overall': 'ChartQA',
|
| 210 |
+
'seedbench_seed_all': 'SeedBench'
|
| 211 |
+
};
|
| 212 |
+
|
| 213 |
+
// Function to get display name for metric
|
| 214 |
+
function getMetricDisplayName(metricKey) {
|
| 215 |
+
return metricTitleMapping[metricKey] || metricKey;
|
| 216 |
+
}
|
| 217 |
+
|
| 218 |
// State and data
|
| 219 |
let metricList = [];
|
| 220 |
let runList = [];
|
|
|
|
| 511 |
const xpx = xScale(nearest);
|
| 512 |
hoverLine.attr('x1', xpx).attr('x2', xpx).style('display', null).attr('stroke', 'rgba(0,0,0,0.25)');
|
| 513 |
// Tooltip content
|
| 514 |
+
let html = `<div><strong>${getMetricDisplayName(metricKey)}</strong></div><div><strong>step</strong> ${nearest}</div>`;
|
| 515 |
series.forEach(s=>{
|
| 516 |
const m = new Map(s.values.map(v=>[v.step, v.value]));
|
| 517 |
const val = m.has(nearest) ? m.get(nearest) : null;
|
|
|
|
| 547 |
});
|
| 548 |
|
| 549 |
// Populate metric select (default to average_rank if present)
|
| 550 |
+
metricList.forEach((m)=>{ const o=document.createElement('option'); o.value=m; o.textContent=getMetricDisplayName(m); selectMetric.appendChild(o); });
|
| 551 |
const def = metricList.find(m => /average_rank/i.test(m)) || metricList[0];
|
| 552 |
if (def) selectMetric.value = def;
|
| 553 |
|