Skip to content

Commit 01b85af

Browse files
committed
feat(site): add labels to x-axis and y-axis
1 parent 9730011 commit 01b85af

2 files changed

Lines changed: 65 additions & 6 deletions

File tree

site/index.html

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin>
2424
<link rel="preconnect" href="https://cdn.tailwindcss.com" crossorigin>
2525
<link rel="preconnect" href="https://player.twitch.tv" crossorigin>
26+
<script src="https://player.twitch.tv/js/embed/v1.js"></script>
2627
<script src="https://cdn.tailwindcss.com"></script>
2728
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
2829
<script src="config.js"></script>
@@ -85,11 +86,10 @@
8586
<span class="text-sm font-medium">coder/balatrollm</span>
8687
</a>
8788
</div>
88-
<div class="relative w-full overflow-hidden rounded-lg shadow-lg dark:shadow-2xl dark:ring-1 dark:ring-white/5"
89+
<div id="twitch-stream-container"
90+
class="relative w-full overflow-hidden rounded-lg shadow-lg dark:shadow-2xl dark:ring-1 dark:ring-white/5 hidden"
8991
style="padding-bottom: 56.25%">
90-
<iframe src="https://player.twitch.tv/?channel=S1M0N38&parent=balatrobench.com&parent=localhost"
91-
title="S1M0N38 Twitch Stream" class="absolute top-0 left-0 w-full h-full" allow="fullscreen" allowfullscreen>
92-
</iframe>
92+
<div id="twitch-player" class="absolute top-0 left-0 w-full h-full"></div>
9393
</div>
9494
<!-- Quotes Section -->
9595
<div id="quote-container" class="mt-8 text-center transition-opacity duration-1000 ease-in-out min-h-12">
@@ -112,6 +112,16 @@
112112

113113
<div
114114
class="overflow-x-auto bg-white dark:bg-zinc-800 rounded-lg shadow-lg dark:shadow-2xl dark:ring-1 dark:ring-white/5">
115+
<!-- Hint for clickable rows -->
116+
<p class="text-center text-sm text-zinc-500 dark:text-zinc-400 py-3 px-4 border-b border-zinc-200 dark:border-zinc-700">
117+
<span class="inline-flex items-center gap-1.5">
118+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4">
119+
<path fill-rule="evenodd" d="M2 8a.75.75 0 0 1 .75-.75h8.69L8.22 4.03a.75.75 0 0 1 1.06-1.06l4.5 4.5a.75.75 0 0 1 0 1.06l-4.5 4.5a.75.75 0 0 1-1.06-1.06l3.22-3.22H2.75A.75.75 0 0 1 2 8Z" clip-rule="evenodd" />
120+
</svg>
121+
Click on a row to explore individual model runs
122+
</span>
123+
</p>
124+
115125
<table id="leaderboard" class="w-full table-auto">
116126
<caption class="sr-only">Model leaderboard with rounds, tool-call reliability, tokens, time, and cost</caption>
117127
<thead class="bg-zinc-100 dark:bg-zinc-700">

site/script.js

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,13 @@ function createRoundHistogram(runs, canvasId) {
553553
scales: {
554554
x: {
555555
stacked: true,
556-
...axisOptions
556+
...axisOptions,
557+
title: {
558+
display: true,
559+
text: 'Round reached',
560+
color: themeColors.text,
561+
font: { size: 12 }
562+
}
557563
},
558564
y: {
559565
stacked: true,
@@ -563,6 +569,12 @@ function createRoundHistogram(runs, canvasId) {
563569
...axisOptions.ticks,
564570
precision: 0,
565571
stepSize: 1
572+
},
573+
title: {
574+
display: true,
575+
text: 'Count',
576+
color: themeColors.text,
577+
font: { size: 12 }
566578
}
567579
}
568580
}
@@ -657,7 +669,14 @@ function createPerformanceBarChart(entries) {
657669
y: {
658670
beginAtZero: true,
659671
max: yAxisMax,
660-
...axisOptions
672+
...axisOptions,
673+
title: {
674+
display: true,
675+
text: 'Average round',
676+
color: themePalette.text,
677+
font: { size: 14 },
678+
padding: { bottom: 10 }
679+
}
661680
}
662681
},
663682
elements: {
@@ -1232,6 +1251,33 @@ async function loadLeaderboard(leaderboardPath, detailBasePath, displayMode = 'm
12321251
}
12331252

12341253
// Load data when page loads
1254+
1255+
// ============================================================================
1256+
// Twitch Stream - Show only when live
1257+
// ============================================================================
1258+
1259+
function initTwitchPlayer() {
1260+
const container = document.getElementById('twitch-stream-container');
1261+
if (!container || typeof Twitch === 'undefined') return;
1262+
1263+
const player = new Twitch.Player('twitch-player', {
1264+
channel: 'S1M0N38',
1265+
width: '100%',
1266+
height: '100%',
1267+
parent: ['balatrobench.com', 'localhost'],
1268+
muted: true,
1269+
autoplay: true,
1270+
});
1271+
1272+
player.addEventListener(Twitch.Player.ONLINE, () => {
1273+
container.classList.remove('hidden');
1274+
});
1275+
1276+
player.addEventListener(Twitch.Player.OFFLINE, () => {
1277+
container.classList.add('hidden');
1278+
});
1279+
}
1280+
12351281
document.addEventListener('DOMContentLoaded', () => {
12361282
// Detect page type
12371283
PAGE_TYPE = detectPageType();
@@ -1241,6 +1287,9 @@ document.addEventListener('DOMContentLoaded', () => {
12411287

12421288
// Initialize quotes rotation (if on a page with quotes)
12431289
initQuotesRotation();
1290+
1291+
// Initialize Twitch player (show only when live)
1292+
initTwitchPlayer();
12441293
});
12451294

12461295
// ============================================================================

0 commit comments

Comments
 (0)