Show scored totals beside leaderboard ranks
Browse files- index.html +35 -17
index.html
CHANGED
|
@@ -207,8 +207,10 @@
|
|
| 207 |
tr.anchor{background:var(--anchor-soft)}
|
| 208 |
tr.anchor:hover{background:#fbf0dc}
|
| 209 |
tr.tier2{opacity:.62}
|
| 210 |
-
.rk{width:
|
| 211 |
-
.rk.top{color:var(--accent);font-size:15px}
|
|
|
|
|
|
|
| 212 |
.cid{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12.5px;font-weight:600}
|
| 213 |
.skel{color:#93a1b5;font-size:11px;font-family:ui-monospace,monospace}
|
| 214 |
.smiwrap{display:flex;align-items:center;gap:6px;max-width:250px}
|
|
@@ -254,7 +256,9 @@
|
|
| 254 |
padding:5px 10px;font-size:11px;cursor:pointer;color:#33465f}
|
| 255 |
#m3 .ft button:hover{border-color:var(--accent);color:var(--accent)}
|
| 256 |
#m3 .ft button.on{border-color:var(--accent);background:var(--accent);color:#fff}
|
| 257 |
-
.who{color:var(--muted);font-size:12.5px}
|
|
|
|
|
|
|
| 258 |
/* Long model identifiers wrapped onto four lines and made every row three times
|
| 259 |
taller than it needed to be. Truncate; the full value is on the tooltip. */
|
| 260 |
td:nth-child(3), td:nth-child(4){max-width:150px}
|
|
@@ -698,16 +702,30 @@ function applyLang(){
|
|
| 698 |
function setLang(l, auto){ LANG = (l==="ko")?"ko":"en"; if(!auto) LANG_AUTO=false; applyLang(); }
|
| 699 |
document.querySelectorAll("#langbar button").forEach(b=>b.onclick=()=>setLang(b.dataset.lang,false));
|
| 700 |
|
| 701 |
-
function sortVal(e, k){
|
| 702 |
if(k==="rank") return e.rank ?? 1e9; // unranked rows sink when sorting by rank
|
| 703 |
if(k==="cand") return String(e.candidate_id||"").toLowerCase();
|
| 704 |
if(k==="user") return String(e.hf_user||e.display_name||"").toLowerCase();
|
| 705 |
if(k==="who") return String(e.model_name||"").toLowerCase();
|
| 706 |
if(k==="total") return e.total ?? -1;
|
| 707 |
-
return (e.axes||{})[k] ?? -1;
|
| 708 |
-
}
|
| 709 |
-
|
| 710 |
-
function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 711 |
const d = t(), W = DATA.season.weights, max = Math.max(1, ...DATA.entries.map(e=>e.total||0));
|
| 712 |
$("#wts").innerHTML = Object.entries(W)
|
| 713 |
.map(([k,v])=>`<span>${(d.ov_axes[k]||k)} <b>${v}</b></span>`).join("");
|
|
@@ -732,14 +750,13 @@ function render(){
|
|
| 732 |
|
| 733 |
$("#rows").innerHTML = rows.length ? rows.map(e=>{
|
| 734 |
const a = e.axes||{};
|
| 735 |
-
const cls = [e.is_anchor?"anchor":"", e.tier===2?"tier2":""].join(" ").trim();
|
| 736 |
-
const _who = e.hf_user || e.display_name || "";
|
| 737 |
-
const user = e.is_anchor ? '<span class="who">\u2014</span>'
|
| 738 |
-
:
|
| 739 |
-
|
| 740 |
-
|
| 741 |
-
const
|
| 742 |
-
const who = `<span class="who" title="${_m}">${_m}</span>`;
|
| 743 |
// the structure is the name now; a withheld one shows its ends, middle blanked.
|
| 744 |
// Only a published structure gets a copy button - there is nothing to copy otherwise.
|
| 745 |
const isPub = e.visibility === "public" && !!e.smiles;
|
|
@@ -754,7 +771,8 @@ function render(){
|
|
| 754 |
: `<span class="cid">${e.candidate_id}</span>`);
|
| 755 |
const tag = e.is_anchor ? `<span class="tag a">${d.anchor}</span>`
|
| 756 |
: (e.tier===2 ? `<span class="tag r">${d.relegated}</span>` : "");
|
| 757 |
-
const rk = e.rank==null ? "—"
|
|
|
|
| 758 |
return `<tr class="${cls}">
|
| 759 |
<td class="rk ${e.rank===1?"top":""}">${rk}</td>
|
| 760 |
<td>${id}${tag}</td><td>${user}</td><td>${who}</td>
|
|
|
|
| 207 |
tr.anchor{background:var(--anchor-soft)}
|
| 208 |
tr.anchor:hover{background:#fbf0dc}
|
| 209 |
tr.tier2{opacity:.62}
|
| 210 |
+
.rk{width:58px;color:var(--muted);font-weight:700;white-space:nowrap}
|
| 211 |
+
.rk.top{color:var(--accent);font-size:15px}
|
| 212 |
+
.rk .rkscore{display:block;margin-top:2px;font-size:10.5px;font-weight:800;
|
| 213 |
+
color:var(--ink);letter-spacing:0}
|
| 214 |
.cid{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12.5px;font-weight:600}
|
| 215 |
.skel{color:#93a1b5;font-size:11px;font-family:ui-monospace,monospace}
|
| 216 |
.smiwrap{display:flex;align-items:center;gap:6px;max-width:250px}
|
|
|
|
| 256 |
padding:5px 10px;font-size:11px;cursor:pointer;color:#33465f}
|
| 257 |
#m3 .ft button:hover{border-color:var(--accent);color:var(--accent)}
|
| 258 |
#m3 .ft button.on{border-color:var(--accent);background:var(--accent);color:#fff}
|
| 259 |
+
.who{color:var(--muted);font-size:12.5px}
|
| 260 |
+
.hf-user{color:var(--accent);font-weight:700;text-decoration:none;white-space:nowrap}
|
| 261 |
+
.hf-user:hover{text-decoration:underline}
|
| 262 |
/* Long model identifiers wrapped onto four lines and made every row three times
|
| 263 |
taller than it needed to be. Truncate; the full value is on the tooltip. */
|
| 264 |
td:nth-child(3), td:nth-child(4){max-width:150px}
|
|
|
|
| 702 |
function setLang(l, auto){ LANG = (l==="ko")?"ko":"en"; if(!auto) LANG_AUTO=false; applyLang(); }
|
| 703 |
document.querySelectorAll("#langbar button").forEach(b=>b.onclick=()=>setLang(b.dataset.lang,false));
|
| 704 |
|
| 705 |
+
function sortVal(e, k){
|
| 706 |
if(k==="rank") return e.rank ?? 1e9; // unranked rows sink when sorting by rank
|
| 707 |
if(k==="cand") return String(e.candidate_id||"").toLowerCase();
|
| 708 |
if(k==="user") return String(e.hf_user||e.display_name||"").toLowerCase();
|
| 709 |
if(k==="who") return String(e.model_name||"").toLowerCase();
|
| 710 |
if(k==="total") return e.total ?? -1;
|
| 711 |
+
return (e.axes||{})[k] ?? -1;
|
| 712 |
+
}
|
| 713 |
+
|
| 714 |
+
function esc(s){
|
| 715 |
+
return String(s ?? "").replace(/[&<>"']/g, c=>({
|
| 716 |
+
"&":"&", "<":"<", ">":">", '"':""", "'":"'"
|
| 717 |
+
})[c]);
|
| 718 |
+
}
|
| 719 |
+
|
| 720 |
+
function hfProfile(user){
|
| 721 |
+
if(!user) return "";
|
| 722 |
+
const label = esc(user);
|
| 723 |
+
const url = `https://huggingface.co/${encodeURIComponent(user)}`;
|
| 724 |
+
return `<a class="hf-user" href="${url}" target="_blank" rel="noopener noreferrer"`
|
| 725 |
+
+ ` title="Hugging Face: ${label}">🤗 ${label}</a>`;
|
| 726 |
+
}
|
| 727 |
+
|
| 728 |
+
function render(){
|
| 729 |
const d = t(), W = DATA.season.weights, max = Math.max(1, ...DATA.entries.map(e=>e.total||0));
|
| 730 |
$("#wts").innerHTML = Object.entries(W)
|
| 731 |
.map(([k,v])=>`<span>${(d.ov_axes[k]||k)} <b>${v}</b></span>`).join("");
|
|
|
|
| 750 |
|
| 751 |
$("#rows").innerHTML = rows.length ? rows.map(e=>{
|
| 752 |
const a = e.axes||{};
|
| 753 |
+
const cls = [e.is_anchor?"anchor":"", e.tier===2?"tier2":""].join(" ").trim();
|
| 754 |
+
const _who = e.hf_user || e.display_name || "";
|
| 755 |
+
const user = e.is_anchor ? '<span class="who">\u2014</span>'
|
| 756 |
+
: (e.hf_user ? hfProfile(e.hf_user)
|
| 757 |
+
: `<span title="${esc(_who)}">${esc(e.display_name||"\u2013")}</span>`);
|
| 758 |
+
const _m = e.is_anchor ? (e.note || d.ref) : (e.model_name || "\u2013");
|
| 759 |
+
const who = `<span class="who" title="${esc(_m)}">${esc(_m)}</span>`;
|
|
|
|
| 760 |
// the structure is the name now; a withheld one shows its ends, middle blanked.
|
| 761 |
// Only a published structure gets a copy button - there is nothing to copy otherwise.
|
| 762 |
const isPub = e.visibility === "public" && !!e.smiles;
|
|
|
|
| 771 |
: `<span class="cid">${e.candidate_id}</span>`);
|
| 772 |
const tag = e.is_anchor ? `<span class="tag a">${d.anchor}</span>`
|
| 773 |
: (e.tier===2 ? `<span class="tag r">${d.relegated}</span>` : "");
|
| 774 |
+
const rk = e.rank==null ? "—"
|
| 775 |
+
: `#${e.rank}<span class="rkscore">${f1(e.total)}${LANG==="ko"?"점":" pts"}</span>`;
|
| 776 |
return `<tr class="${cls}">
|
| 777 |
<td class="rk ${e.rank===1?"top":""}">${rk}</td>
|
| 778 |
<td>${id}${tag}</td><td>${user}</td><td>${who}</td>
|