Negative results: drop table tag/opacity, match non-records dot styling on chart
Browse files- static/index.html +10 -18
static/index.html
CHANGED
|
@@ -1834,16 +1834,9 @@ function renderLeaderboard(entries) {
|
|
| 1834 |
ranked.forEach((e, i) => {
|
| 1835 |
const rank = i + 1;
|
| 1836 |
const isBest = rank === 1;
|
| 1837 |
-
const isNeg = e.status === 'negative';
|
| 1838 |
const tr = document.createElement('tr');
|
| 1839 |
if (isBest) tr.classList.add('best-row');
|
| 1840 |
-
|
| 1841 |
-
const symbol = isNeg
|
| 1842 |
-
? '<span class="rank-badge rank-badge--default" style="background:#f3f4f6;color:#9ca3af">—</span>'
|
| 1843 |
-
: (rank === 1 ? '🥇' : rank === 2 ? '🥈' : rank === 3 ? '🥉' : `<span class="rank-badge rank-badge--default">${rank}</span>`);
|
| 1844 |
-
const negTag = isNeg
|
| 1845 |
-
? ' <span style="display:inline-block;padding:1px 7px;margin-left:6px;font-size:10px;font-weight:700;letter-spacing:0.04em;text-transform:uppercase;background:#f3f4f6;color:#6b7280;border:1px solid #e5e7eb;border-radius:999px;vertical-align:1px">negative</span>'
|
| 1846 |
-
: '';
|
| 1847 |
const d = new Date(e.date);
|
| 1848 |
const dateStr = d.toLocaleDateString('en-US', { month: 'short', day: 'numeric' }) + ', ' +
|
| 1849 |
d.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit', hour12: false });
|
|
@@ -1852,7 +1845,7 @@ function renderLeaderboard(entries) {
|
|
| 1852 |
<td class="rank-cell"><span class="rank-badge">${symbol}</span></td>
|
| 1853 |
<td class="score-cell ${isBest ? 'score-cell--best' : ''}">${e.score.toLocaleString()}</td>
|
| 1854 |
<td>${escapeHtml(e.bpc || '')}</td>
|
| 1855 |
-
<td>${escapeHtml(e.method || '')}
|
| 1856 |
<td><span class="agent-tag ${isBest ? 'agent-tag--record' : ''}">${escapeHtml(e.agent)}</span></td>
|
| 1857 |
<td class="run-cell">${escapeHtml(e.run)}</td>
|
| 1858 |
<td class="date-cell">${dateStr}${liveBadge}</td>
|
|
@@ -2025,9 +2018,10 @@ function renderChart(entries) {
|
|
| 2025 |
{ label: 'Running Best', data: bestLineData, borderColor: HF_ORANGE, backgroundColor: HF_ORANGE_DIM, borderWidth: 2.5, stepped: 'after', fill: true, pointRadius: 0, pointHoverRadius: 0, tension: 0, order: 2 },
|
| 2026 |
{ label: 'Records', data: bestScatter, type: 'scatter', backgroundColor: HF_ORANGE, borderColor: '#fff', borderWidth: 2, pointRadius: 7, pointHoverRadius: 9, pointStyle: 'circle', order: 1 },
|
| 2027 |
{ label: 'Non-Records', data: nonBestData, type: 'scatter', backgroundColor: NON_BEST_COLOR, borderColor: '#fff', borderWidth: 1.5, pointRadius: 5, pointHoverRadius: 7, pointStyle: 'circle', order: 0 },
|
| 2028 |
-
// Negatives:
|
| 2029 |
-
//
|
| 2030 |
-
|
|
|
|
| 2031 |
...baselineDatasets,
|
| 2032 |
],
|
| 2033 |
},
|
|
@@ -2054,18 +2048,16 @@ function renderChart(entries) {
|
|
| 2054 |
title: items => {
|
| 2055 |
const it = items[0];
|
| 2056 |
if (it.datasetIndex >= 4) return `baseline · ${it.dataset.label}`;
|
| 2057 |
-
if (it.datasetIndex === 3) return `negative · ${it.raw?.agent || ''}`;
|
| 2058 |
return it.raw?.agent || '';
|
| 2059 |
},
|
| 2060 |
label: it => {
|
| 2061 |
if (it.datasetIndex >= 4) {
|
| 2062 |
return [`Bytes: ${it.raw.y.toLocaleString()}`];
|
| 2063 |
}
|
| 2064 |
-
|
| 2065 |
-
|
| 2066 |
-
|
| 2067 |
-
|
| 2068 |
-
const d = new Date(it.raw.x);
|
| 2069 |
return [`Bytes: ${it.raw.y.toLocaleString()}`, `Date: ${d.toLocaleString()}`];
|
| 2070 |
}
|
| 2071 |
},
|
|
|
|
| 1834 |
ranked.forEach((e, i) => {
|
| 1835 |
const rank = i + 1;
|
| 1836 |
const isBest = rank === 1;
|
|
|
|
| 1837 |
const tr = document.createElement('tr');
|
| 1838 |
if (isBest) tr.classList.add('best-row');
|
| 1839 |
+
const symbol = rank === 1 ? '🥇' : rank === 2 ? '🥈' : rank === 3 ? '🥉' : `<span class="rank-badge rank-badge--default">${rank}</span>`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1840 |
const d = new Date(e.date);
|
| 1841 |
const dateStr = d.toLocaleDateString('en-US', { month: 'short', day: 'numeric' }) + ', ' +
|
| 1842 |
d.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit', hour12: false });
|
|
|
|
| 1845 |
<td class="rank-cell"><span class="rank-badge">${symbol}</span></td>
|
| 1846 |
<td class="score-cell ${isBest ? 'score-cell--best' : ''}">${e.score.toLocaleString()}</td>
|
| 1847 |
<td>${escapeHtml(e.bpc || '')}</td>
|
| 1848 |
+
<td>${escapeHtml(e.method || '')}</td>
|
| 1849 |
<td><span class="agent-tag ${isBest ? 'agent-tag--record' : ''}">${escapeHtml(e.agent)}</span></td>
|
| 1850 |
<td class="run-cell">${escapeHtml(e.run)}</td>
|
| 1851 |
<td class="date-cell">${dateStr}${liveBadge}</td>
|
|
|
|
| 2018 |
{ label: 'Running Best', data: bestLineData, borderColor: HF_ORANGE, backgroundColor: HF_ORANGE_DIM, borderWidth: 2.5, stepped: 'after', fill: true, pointRadius: 0, pointHoverRadius: 0, tension: 0, order: 2 },
|
| 2019 |
{ label: 'Records', data: bestScatter, type: 'scatter', backgroundColor: HF_ORANGE, borderColor: '#fff', borderWidth: 2, pointRadius: 7, pointHoverRadius: 9, pointStyle: 'circle', order: 1 },
|
| 2020 |
{ label: 'Non-Records', data: nonBestData, type: 'scatter', backgroundColor: NON_BEST_COLOR, borderColor: '#fff', borderWidth: 1.5, pointRadius: 5, pointHoverRadius: 7, pointStyle: 'circle', order: 0 },
|
| 2021 |
+
// Negatives: same look as Non-Records (full grey dot, same size).
|
| 2022 |
+
// The only difference is the nonBestLabels plugin doesn't draw an
|
| 2023 |
+
// always-on label for them; tooltip on hover identifies them.
|
| 2024 |
+
{ label: 'Negatives', data: negativeData, type: 'scatter', backgroundColor: NON_BEST_COLOR, borderColor: '#fff', borderWidth: 1.5, pointRadius: 5, pointHoverRadius: 7, pointStyle: 'circle', order: 0 },
|
| 2025 |
...baselineDatasets,
|
| 2026 |
],
|
| 2027 |
},
|
|
|
|
| 2048 |
title: items => {
|
| 2049 |
const it = items[0];
|
| 2050 |
if (it.datasetIndex >= 4) return `baseline · ${it.dataset.label}`;
|
|
|
|
| 2051 |
return it.raw?.agent || '';
|
| 2052 |
},
|
| 2053 |
label: it => {
|
| 2054 |
if (it.datasetIndex >= 4) {
|
| 2055 |
return [`Bytes: ${it.raw.y.toLocaleString()}`];
|
| 2056 |
}
|
| 2057 |
+
// Negative scatter (idx 3) uses _origDate (the real timestamp)
|
| 2058 |
+
// since the chart x is clamped into the run-range to keep the
|
| 2059 |
+
// dot visible.
|
| 2060 |
+
const d = it.raw._origDate ? new Date(it.raw._origDate) : new Date(it.raw.x);
|
|
|
|
| 2061 |
return [`Bytes: ${it.raw.y.toLocaleString()}`, `Date: ${d.toLocaleString()}`];
|
| 2062 |
}
|
| 2063 |
},
|