-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
874 lines (762 loc) · 29.6 KB
/
index.html
File metadata and controls
874 lines (762 loc) · 29.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RISC-V Processor Leaderboard</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
:root {
--primary: #2563eb;
--primary-dark: #1d4ed8;
--bg: #f8fafc;
--card-bg: #ffffff;
--text: #1e293b;
--text-muted: #64748b;
--border: #e2e8f0;
--success: #22c55e;
--warning: #f59e0b;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: inherit;
}
body {
font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
background: var(--bg);
color: var(--text);
line-height: 1.6;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 2rem;
}
header {
text-align: center;
margin-bottom: 2rem;
}
h1 {
font-size: 2.5rem;
margin-bottom: 0.5rem;
color: var(--text);
}
.subtitle {
color: var(--text-muted);
font-size: 1.1rem;
}
.filters {
background: var(--card-bg);
border-radius: 12px;
padding: 1.5rem;
margin-bottom: 2rem;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
display: flex;
flex-wrap: wrap;
gap: 1rem;
align-items: center;
}
.filter-group {
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.filter-group label {
font-size: 0.875rem;
font-weight: 500;
color: var(--text-muted);
}
select {
padding: 0.5rem 1rem;
border: 1px solid var(--border);
border-radius: 6px;
font-size: 1rem;
font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
background: white;
cursor: pointer;
min-width: 150px;
}
select:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.metrics-info {
background: var(--card-bg);
border-radius: 12px;
padding: 1.5rem;
margin-bottom: 2rem;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.metrics-info h2 {
font-size: 1.25rem;
margin-bottom: 1rem;
}
.metrics-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1rem;
}
.metric-card {
padding: 0.75rem;
background: var(--bg);
border-radius: 8px;
border-left: 3px solid var(--primary);
}
.metric-card .name {
font-weight: 600;
margin-bottom: 0.25rem;
}
.metric-card .desc {
font-size: 0.875rem;
color: var(--text-muted);
}
.metric-card .better {
font-size: 0.75rem;
margin-top: 0.25rem;
color: var(--success);
font-weight: 500;
}
.leaderboard-section {
background: var(--card-bg);
border-radius: 12px;
padding: 1.5rem;
margin-bottom: 2rem;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.leaderboard-section h2 {
font-size: 1.5rem;
margin-bottom: 1rem;
display: flex;
align-items: center;
gap: 0.5rem;
}
.table-container {
overflow-x: auto;
}
table {
width: 100%;
border-collapse: collapse;
font-size: 0.95rem;
font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
}
th, td {
padding: 0.75rem 1rem;
text-align: left;
border-bottom: 1px solid var(--border);
}
th {
background: var(--bg);
font-weight: 600;
color: var(--text-muted);
font-size: 0.875rem;
cursor: pointer;
user-select: none;
white-space: nowrap;
}
th:hover {
background: #e2e8f0;
}
th.sorted-asc::after {
content: ' ▲';
font-size: 0.75rem;
}
th.sorted-desc::after {
content: ' ▼';
font-size: 0.75rem;
}
th.no-sort {
cursor: default;
}
th.no-sort:hover {
background: var(--bg);
}
tr:hover {
background: #f1f5f9;
}
.rank {
font-weight: 700;
width: 60px;
}
.rank-1 { color: #fbbf24; }
.rank-2 { color: #9ca3af; }
.rank-3 { color: #b45309; }
.medal {
font-size: 1.25rem;
}
.team-name {
font-weight: 500;
}
.loading {
text-align: center;
padding: 3rem;
color: var(--text-muted);
}
.no-data {
text-align: center;
padding: 2rem;
color: var(--text-muted);
font-style: italic;
}
.charts-section {
background: var(--card-bg);
border-radius: 12px;
padding: 1.5rem;
margin-bottom: 2rem;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.charts-section h2 {
font-size: 1.5rem;
margin-bottom: 1rem;
}
.charts-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
gap: 1.5rem;
}
.chart-container {
background: var(--bg);
border-radius: 8px;
padding: 1rem;
position: relative;
height: 280px;
}
.chart-container h3 {
font-size: 1rem;
margin-bottom: 0.5rem;
color: var(--text);
}
footer {
text-align: center;
padding: 2rem;
color: var(--text-muted);
font-size: 0.875rem;
}
@media (max-width: 768px) {
.container {
padding: 1rem;
}
h1 {
font-size: 1.75rem;
}
.filters {
flex-direction: column;
align-items: stretch;
}
select {
width: 100%;
}
}
</style>
</head>
<body>
<div class="container">
<header>
<h1>RISC-V Processor Leaderboard</h1>
<p class="subtitle">Implementing 5-stage pipelined RISC-V (RV32I) processors in undergraduate computer architecture courses</p>
<p><a href="https://github.com/unarylab/comparch_leaderboard-RISC-V" target="_blank">View GitHub repo</a> by <a href="https://www.unarylab.com" target="_blank">UnaryLab</a></p>
</header>
<div class="metrics-info">
<h2>Metrics</h2>
<div class="metrics-grid">
<div class="metric-card">
<div class="name">IPC</div>
<div class="desc">Instructions Per Cycle</div>
<div class="better">↑ Higher is better</div>
</div>
<div class="metric-card">
<div class="name">Cycle Count</div>
<div class="desc">Total program cycles</div>
<div class="better">↓ Lower is better</div>
</div>
<div class="metric-card">
<div class="name">Frequency</div>
<div class="desc">Synthesis frequency (MHz)</div>
<div class="better">↑ Higher is better</div>
</div>
<div class="metric-card">
<div class="name">Area</div>
<div class="desc">Chip area (mm²)</div>
<div class="better">↓ Lower is better</div>
</div>
<div class="metric-card">
<div class="name">Power</div>
<div class="desc">Power consumption (mW)</div>
<div class="better">↓ Lower is better</div>
</div>
</div>
</div>
<div class="filters">
<h2>Filters</h2>
<div class="filter-group">
<select id="year-filter">
<option value="all">All Years</option>
</select>
</div>
<div class="filter-group">
<select id="semester-filter">
<option value="all">All Semesters</option>
</select>
</div>
</div>
<div class="leaderboard-section">
<h2 id="leaderboard-title">Leaderboard</h2>
<div class="table-container">
<div id="leaderboard-content" class="loading">Loading data...</div>
</div>
</div>
<div class="charts-section">
<h2>Distribution</h2>
<div class="charts-grid">
<div class="chart-container">
<canvas id="chart-ipc"></canvas>
</div>
<div class="chart-container">
<canvas id="chart-cycle_count"></canvas>
</div>
<div class="chart-container">
<canvas id="chart-frequency_mhz"></canvas>
</div>
<div class="chart-container">
<canvas id="chart-area_mm2"></canvas>
</div>
<div class="chart-container">
<canvas id="chart-power_mw"></canvas>
</div>
</div>
</div>
</div>
<script>
// Configuration
const METRICS = {
ipc: { name: 'IPC', higherIsBetter: true },
cycle_count: { name: 'Cycle Count', higherIsBetter: false },
frequency_mhz: { name: 'Frequency (MHz)', higherIsBetter: true },
area_mm2: { name: 'Area (mm²)', higherIsBetter: false },
power_mw: { name: 'Power (mW)', higherIsBetter: false }
};
let allData = [];
let currentSort = { column: null, ascending: true };
let charts = {};
// Parse CSV text to array of objects
function parseCSV(text) {
const lines = text.trim().split('\n');
const headers = lines[0].split(',').map(h => h.trim());
const data = [];
for (let i = 1; i < lines.length; i++) {
const values = parseCSVLine(lines[i]);
if (values.length === headers.length) {
const row = {};
headers.forEach((header, idx) => {
row[header] = values[idx];
});
// Convert numeric fields (handle empty values)
['ipc', 'cycle_count', 'frequency_mhz', 'area_mm2', 'power_mw'].forEach(key => {
if (row[key] && row[key].trim() !== '') {
row[key] = parseFloat(row[key]);
} else {
row[key] = null;
}
});
data.push(row);
}
}
return data;
}
// Handle CSV values with commas inside quotes
function parseCSVLine(line) {
const values = [];
let current = '';
let inQuotes = false;
for (let i = 0; i < line.length; i++) {
const char = line[i];
if (char === '"') {
inQuotes = !inQuotes;
} else if (char === ',' && !inQuotes) {
values.push(current.trim());
current = '';
} else {
current += char;
}
}
values.push(current.trim());
return values;
}
// Parse filename to get year, semester, university
function parseFilename(filename) {
const name = filename.replace('.csv', '');
const parts = name.split('-');
if (parts.length >= 3) {
return {
year: parts[0],
semester: parts[1],
university: parts.slice(2).join('-').toUpperCase()
};
}
return null;
}
// Fetch all CSV files from database directory
async function loadAllData() {
try {
// Fetch the list of CSV files from database directory
const response = await fetch('database/');
if (!response.ok) {
// If directory listing fails, try known files
return await loadKnownFiles();
}
const html = await response.text();
const csvFiles = [...html.matchAll(/href="([^"]+\.csv)"/g)].map(m => m[1]);
if (csvFiles.length === 0) {
return await loadKnownFiles();
}
return await loadCSVFiles(csvFiles);
} catch (e) {
console.log('Falling back to known files:', e);
return await loadKnownFiles();
}
}
// Load from a predefined list (fallback)
async function loadKnownFiles() {
// This list is auto-generated and can be updated
const knownFiles = await fetchFileList();
return await loadCSVFiles(knownFiles);
}
// Fetch file list from generated JSON
async function fetchFileList() {
try {
const response = await fetch('database/files.json');
if (response.ok) {
return await response.json();
}
} catch (e) {
console.log('files.json not found, using hardcoded list');
}
// Fallback hardcoded list
return ['2026-spring-ucf.csv', '2026-fall-ucf.csv'];
}
// Load CSV files
async function loadCSVFiles(files) {
const allRows = [];
for (const file of files) {
try {
const response = await fetch(`database/${file}`);
if (!response.ok) continue;
const text = await response.text();
const info = parseFilename(file);
if (info) {
const rows = parseCSV(text);
rows.forEach(row => {
row.year = info.year;
row.semester = info.semester;
row.university = info.university;
});
allRows.push(...rows);
}
} catch (e) {
console.error(`Failed to load ${file}:`, e);
}
}
return allRows;
}
// Populate filter dropdowns
function populateFilters(data) {
const years = [...new Set(data.map(d => d.year))].sort().reverse();
const semesters = [...new Set(data.map(d => d.semester))];
const yearSelect = document.getElementById('year-filter');
years.forEach(year => {
const option = document.createElement('option');
option.value = year;
option.textContent = year;
yearSelect.appendChild(option);
});
const semesterSelect = document.getElementById('semester-filter');
const semesterOrder = { spring: 1, summer: 2, fall: 3 };
semesters.sort((a, b) => (semesterOrder[a] || 99) - (semesterOrder[b] || 99));
semesters.forEach(sem => {
const option = document.createElement('option');
option.value = sem;
option.textContent = sem.charAt(0).toUpperCase() + sem.slice(1);
semesterSelect.appendChild(option);
});
}
// Filter data based on current selections
function filterData(data) {
const year = document.getElementById('year-filter').value;
const semester = document.getElementById('semester-filter').value;
return data.filter(row => {
if (year !== 'all' && row.year !== year) return false;
if (semester !== 'all' && row.semester !== semester) return false;
return true;
});
}
// Format number for display
function formatValue(value, metric) {
if (value === null || value === undefined || isNaN(value)) {
return '-';
}
if (metric === 'cycle_count') {
return value.toLocaleString();
} else if (metric === 'ipc' || metric === 'area_mm2') {
return value.toFixed(2);
} else {
return value.toFixed(0);
}
}
// Render leaderboard table
function renderTable(data) {
const container = document.getElementById('leaderboard-content');
if (data.length === 0) {
container.innerHTML = '<div class="no-data">No data available for the selected filters.</div>';
return;
}
// Sort data by current column (default to IPC if none selected)
let sortedData = [...data];
const sortColumn = currentSort.column || 'ipc';
if (sortColumn === 'semester') {
// Sort by year (and semester within year)
const semesterOrder = { spring: 1, summer: 2, fall: 3 };
sortedData.sort((a, b) => {
const yearDiff = parseInt(a.year) - parseInt(b.year);
if (yearDiff !== 0) {
return currentSort.ascending ? yearDiff : -yearDiff;
}
const semDiff = (semesterOrder[a.semester] || 0) - (semesterOrder[b.semester] || 0);
return currentSort.ascending ? semDiff : -semDiff;
});
// No ranking for semester sort - just use row index
sortedData.forEach((row, idx) => {
row.rank = idx + 1;
});
} else if (METRICS[sortColumn]) {
const config = METRICS[sortColumn];
// Determine sort direction
let ascending;
if (currentSort.column === null) {
// Default: best values first
ascending = !config.higherIsBetter;
} else {
ascending = currentSort.ascending;
}
// Sort with null values at the end
sortedData.sort((a, b) => {
const aVal = a[sortColumn];
const bVal = b[sortColumn];
// Handle null values - put them at the end
if (aVal === null && bVal === null) return 0;
if (aVal === null) return 1;
if (bVal === null) return -1;
const diff = aVal - bVal;
return ascending ? diff : -diff;
});
// Assign ranks based on current sort (only for non-null values)
let currentRank = 1;
let prevValue = null;
sortedData.forEach((row, idx) => {
if (row[sortColumn] === null) {
row.rank = '-';
} else {
if (prevValue !== null && row[sortColumn] !== prevValue) {
currentRank = idx + 1;
}
row.rank = currentRank;
prevValue = row[sortColumn];
}
});
}
const year = document.getElementById('year-filter').value;
const semester = document.getElementById('semester-filter').value;
const showSemester = year === 'all' || semester === 'all';
// Update title
const title = document.getElementById('leaderboard-title');
if (year !== 'all' && semester !== 'all') {
title.textContent = `${semester.charAt(0).toUpperCase() + semester.slice(1)} ${year} Leaderboard`;
} else {
title.textContent = 'All-Time Leaderboard';
}
// Build table HTML
let html = '<table><thead><tr>';
html += '<th class="no-sort">Rank</th>';
html += '<th class="no-sort">Team</th>';
// Metric columns (sortable)
Object.entries(METRICS).forEach(([key, config]) => {
const isCurrentSort = (currentSort.column === key) || (currentSort.column === null && key === 'ipc');
const sortClass = isCurrentSort
? (currentSort.ascending ? 'sorted-asc' : 'sorted-desc')
: '';
html += `<th data-column="${key}" class="${sortClass}">${config.name}</th>`;
});
// Semester at the end (sortable by year)
if (showSemester) {
const isSemesterSort = currentSort.column === 'semester';
const semSortClass = isSemesterSort
? (currentSort.ascending ? 'sorted-asc' : 'sorted-desc')
: '';
html += `<th data-column="semester" class="${semSortClass}">Semester</th>`;
}
html += '<th class="no-sort">University</th>';
html += '</tr></thead><tbody>';
sortedData.forEach(row => {
const rankClass = (typeof row.rank === 'number' && row.rank <= 3) ? `rank-${row.rank}` : '';
let medal = '';
if (row.rank === 1) medal = '<span class="medal">🥇</span> ';
else if (row.rank === 2) medal = '<span class="medal">🥈</span> ';
else if (row.rank === 3) medal = '<span class="medal">🥉</span> ';
html += '<tr>';
html += `<td class="rank ${rankClass}">${medal}${row.rank}</td>`;
html += `<td class="team-name">${row.team_name}</td>`;
Object.keys(METRICS).forEach(key => {
html += `<td>${formatValue(row[key], key)}</td>`;
});
// Semester at the end
if (showSemester) {
const semDisplay = row.semester.charAt(0).toUpperCase() + row.semester.slice(1);
html += `<td>${semDisplay} ${row.year}</td>`;
}
html += `<td>${row.university || '-'}</td>`;
html += '</tr>';
});
html += '</tbody></table>';
container.innerHTML = html;
// Add click handlers for sortable columns
container.querySelectorAll('th[data-column]').forEach(th => {
th.addEventListener('click', () => {
const column = th.dataset.column;
if (currentSort.column === column) {
// Toggle direction
currentSort.ascending = !currentSort.ascending;
} else {
// New column - default to best values first (or ascending for semester)
currentSort.column = column;
if (column === 'semester') {
currentSort.ascending = true; // Oldest first by default
} else {
currentSort.ascending = !METRICS[column].higherIsBetter;
}
}
renderTable(filterData(allData));
});
});
}
// Chart colors
const CHART_COLORS = [
'rgba(37, 99, 235, 0.7)', // blue
'rgba(34, 197, 94, 0.7)', // green
'rgba(249, 115, 22, 0.7)', // orange
'rgba(168, 85, 247, 0.7)', // purple
'rgba(236, 72, 153, 0.7)', // pink
'rgba(20, 184, 166, 0.7)', // teal
'rgba(245, 158, 11, 0.7)', // amber
'rgba(239, 68, 68, 0.7)', // red
'rgba(99, 102, 241, 0.7)', // indigo
'rgba(16, 185, 129, 0.7)', // emerald
'rgba(251, 146, 60, 0.7)', // orange light
'rgba(139, 92, 246, 0.7)', // violet
];
// Render point cloud charts
function renderCharts(data) {
if (data.length === 0) return;
Object.entries(METRICS).forEach(([key, config], metricIndex) => {
const canvas = document.getElementById(`chart-${key}`);
if (!canvas) return;
// Destroy existing chart if any
if (charts[key]) {
charts[key].destroy();
}
// Prepare data points - each team is a point (filter out null values)
const validData = data.filter(row => row[key] !== null);
const chartData = validData.map((row, idx) => ({
x: idx + 1,
y: row[key],
label: row.team_name
}));
// Create chart
charts[key] = new Chart(canvas, {
type: 'scatter',
data: {
datasets: [{
label: config.name,
data: chartData,
backgroundColor: validData.map((_, i) => CHART_COLORS[i % CHART_COLORS.length]),
borderColor: validData.map((_, i) => CHART_COLORS[i % CHART_COLORS.length].replace('0.7', '1')),
borderWidth: 2,
pointRadius: 8,
pointHoverRadius: 12
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
title: {
display: true,
text: config.name + (config.higherIsBetter ? ' (↑ Higher is better)' : ' (↓ Lower is better)'),
font: {
family: "'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif",
size: 14
}
},
legend: {
display: false
},
tooltip: {
callbacks: {
label: function(context) {
const point = context.raw;
return `${point.label}: ${formatValue(point.y, key)}`;
}
}
}
},
scales: {
x: {
display: false,
min: 0,
max: validData.length + 1
},
y: {
title: {
display: true,
text: config.name,
font: {
family: "'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif"
}
},
ticks: {
font: {
family: "'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif"
}
}
}
}
}
});
});
}
// Update display when filters change
function updateDisplay() {
currentSort = { column: null, ascending: true }; // Reset sort when filter changes
const filtered = filterData(allData);
renderCharts(filtered);
renderTable(filtered);
}
// Initialize
async function init() {
allData = await loadAllData();
if (allData.length === 0) {
document.getElementById('leaderboard-content').innerHTML =
'<div class="no-data">No data found. Please add CSV files to the database directory.</div>';
return;
}
populateFilters(allData);
// Add event listeners
document.getElementById('year-filter').addEventListener('change', updateDisplay);
document.getElementById('semester-filter').addEventListener('change', updateDisplay);
// Initial render
updateDisplay();
}
init();
</script>
</body>
</html>