vidhimudaliar commited on
Commit
309cfa9
·
verified ·
1 Parent(s): 39dec03

Delete rater_table.html

Browse files
Files changed (1) hide show
  1. rater_table.html +0 -152
rater_table.html DELETED
@@ -1,152 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta charset="UTF-8">
6
- <title>Rater Comparison with Videos</title>
7
- <meta name="viewport" content="width=device-width, initial-scale=1" />
8
- <base href="./">
9
- <link rel="stylesheet" href="./assets/css/shared.css" />
10
- <link rel="stylesheet" href="./assets/css/table.css" />
11
- </head>
12
-
13
- <body>
14
- <div class="app">
15
- <div class="header-row">
16
- <div>
17
- <p class="eyebrow">Rater Comparison</p>
18
- <h1>Rater Comparison with Embedded Videos</h1>
19
- <p class="note">Compare rater annotations side-by-side with embedded video clips.</p>
20
- </div>
21
- </div>
22
-
23
- <div class="search-row">
24
- <label class="search-box">
25
- <input type="search" id="search" placeholder="Search by video filename or label..." autocomplete="off">
26
- <span>🔍</span>
27
- </label>
28
- </div>
29
-
30
- <div class="table-card">
31
- <table id="raterTable">
32
- <thead>
33
- <tr>
34
- <th>Filename</th>
35
- <th>Label</th>
36
- <th>Amanuel</th>
37
- <th>Grant</th>
38
- <th>Vidhi</th>
39
- <th>Video</th>
40
- </tr>
41
- </thead>
42
- <tbody></tbody>
43
- </table>
44
- </div>
45
- </div>
46
-
47
- <script>
48
- const colors = [
49
- "#7BDFF2", "#B2F7EF", "#EFF7F6",
50
- "#F7D6E0", "#F2B5D4", "#D0A3BF",
51
- "#A3C4F3", "#BFD7FF", "#C3F0CA"
52
- ];
53
- const filenameColors = {};
54
-
55
- function getColorForFilename(name) {
56
- if (!filenameColors[name]) {
57
- filenameColors[name] = colors[Object.keys(filenameColors).length % colors.length];
58
- }
59
- return filenameColors[name];
60
- }
61
-
62
- const searchInput = document.getElementById("search");
63
-
64
- function filterTable() {
65
- const input = searchInput.value.toLowerCase();
66
- const rows = document.querySelectorAll("#raterTable tbody tr");
67
- rows.forEach(row => {
68
- const text = row.textContent.toLowerCase();
69
- row.style.display = text.includes(input) ? "" : "none";
70
- });
71
- }
72
-
73
- searchInput.addEventListener("input", filterTable);
74
-
75
- // ----------------------------
76
- // Load CSV directly (resolve path against current location)
77
- // ----------------------------
78
- const csvUrl = new URL('combined_rater_with_embed.csv', window.location.href).href;
79
- fetch(csvUrl)
80
- .then(resp => resp.text())
81
- .then(text => {
82
- const lines = text.trim().split("\n");
83
- const header = lines[0].split(",");
84
-
85
- const tbody = document.querySelector("#raterTable tbody");
86
- const grouped = {};
87
-
88
- for (let i = 1; i < lines.length; i++) {
89
- const cols = lines[i].split(",");
90
-
91
- const filename = cols[0];
92
- const video_path = cols[2];
93
- // compute absolute URL for the video file so the video element
94
- // can load correctly regardless of hosting path
95
- let video_url = video_path;
96
- try {
97
- video_url = new URL(video_path, window.location.href).href;
98
- } catch (e) {
99
- video_url = video_path;
100
- }
101
- const label = cols[3];
102
- const rater = cols[4];
103
- const start = cols[5];
104
- const end = cols[6];
105
-
106
- const key = filename + "||" + label;
107
-
108
- if (!grouped[key]) {
109
- grouped[key] = {
110
- filename,
111
- label,
112
- video_path,
113
- // store absolute video URL for rendering
114
- video_url,
115
- Amanuel: "NA",
116
- Grant: "NA",
117
- Vidhi: "NA"
118
- };
119
- }
120
-
121
- grouped[key][rater] = (start && end) ? `${start}-${end}` : "NA";
122
- }
123
-
124
- for (const key in grouped) {
125
- const item = grouped[key];
126
- const tr = document.createElement("tr");
127
-
128
- const color = getColorForFilename(item.filename);
129
-
130
- tr.style.background = `${color}15`; /* very light tint */
131
-
132
- tr.innerHTML = `
133
- <td>${item.filename}</td>
134
- <td>${item.label}</td>
135
- <td>${item.Amanuel}</td>
136
- <td>${item.Grant}</td>
137
- <td>${item.Vidhi}</td>
138
- <td>
139
- <video width="260" controls preload="metadata">
140
- <source src="${item.video_url || item.video_path}" type="video/mp4">
141
- Video not found
142
- </video>
143
- </td>
144
- `;
145
- tbody.appendChild(tr);
146
- }
147
- });
148
- </script>
149
-
150
- </body>
151
-
152
- </html>