Skip to content

Commit c2738d0

Browse files
committed
Added survey table
1 parent 7748e32 commit c2738d0

File tree

2 files changed

+121
-37
lines changed

2 files changed

+121
-37
lines changed

docs/index.html

Lines changed: 121 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,14 @@ <h2 class="title is-3">Citation</h2>
183183
<div class="content">
184184
<p>If you use this collection in your research, please cite our paper:</p>
185185
<pre><code>@article{heider2025survey,
186-
title={A Survey of Datasets for Computer Vision in Agriculture:
187-
A catalogue of high-quality RGB image datasets of
188-
natural field scenes},
189-
author={Heider, Nico and Gunreben, Lorenz and Zürner, Sebastian
190-
and Schieck, Martin},
191-
journal={tba},
192-
year={2025}
193-
}</code></pre>
186+
title={A Survey of Datasets for Computer Vision in Agriculture:
187+
A catalogue of high-quality RGB image datasets of
188+
natural field scenes},
189+
author={Heider, Nico and Gunreben, Lorenz and Zürner, Sebastian
190+
and Schieck, Martin},
191+
journal={tba},
192+
year={2025}
193+
}</code></pre>
194194
</div>
195195
</div>
196196
<div class="column is-half">
@@ -217,17 +217,17 @@ <h2 class="title is-3 has-text-centered">Dataset Collection</h2>
217217
<table class="table is-striped is-hoverable is-fullwidth" id="datasetTable">
218218
<thead>
219219
<tr>
220-
<th onclick="sortTable(0, this)">Label<br><span class="sort-icon"></span></th>
221-
<th onclick="sortTable(1, this)">Year<br><span class="sort-icon"></span></th>
222-
<th onclick="sortTable(2, this)">Author<br><span class="sort-icon"></span></th>
223-
<th onclick="sortTable(3, this)">Plant (English)<br><span class="sort-icon"></span></th>
224-
<th onclick="sortTable(4, this)">Plant (Latin)<br><span class="sort-icon"></span></th>
225-
<th onclick="sortTable(5, this)">Plant Part<br><span class="sort-icon"></span></th>
226-
<th onclick="sortTable(6, this)">Task<br><span class="sort-icon"></span></th>
227-
<th onclick="sortTable(7, this)">Annotation<br><span class="sort-icon"></span></th>
228-
<th onclick="sortTable(8, this)">Annotated Images<br><span class="sort-icon"></span></th>
229-
<th onclick="sortTable(9, this)">Paper URL<br><span class="sort-icon"></span></th>
230-
<th onclick="sortTable(10, this)">Dataset URL<br><span class="sort-icon"></span></th>
220+
<th onclick="sortDatasetTable(0, this)">Label<br><span class="sort-icon"></span></th>
221+
<th onclick="sortDatasetTable(1, this)">Year<br><span class="sort-icon"></span></th>
222+
<th onclick="sortDatasetTable(2, this)">Author<br><span class="sort-icon"></span></th>
223+
<th onclick="sortDatasetTable(3, this)">Plant (English)<br><span class="sort-icon"></span></th>
224+
<th onclick="sortDatasetTable(4, this)">Plant (Latin)<br><span class="sort-icon"></span></th>
225+
<th onclick="sortDatasetTable(5, this)">Plant Part<br><span class="sort-icon"></span></th>
226+
<th onclick="sortDatasetTable(6, this)">Task<br><span class="sort-icon"></span></th>
227+
<th onclick="sortDatasetTable(7, this)">Annotation<br><span class="sort-icon"></span></th>
228+
<th onclick="sortDatasetTable(8, this)">Annotated Images<br><span class="sort-icon"></span></th>
229+
<th onclick="sortDatasetTable(9, this)">Paper URL<br><span class="sort-icon"></span></th>
230+
<th onclick="sortDatasetTable(10, this)">Dataset URL<br><span class="sort-icon"></span></th>
231231
</tr>
232232
</thead>
233233
<tbody>
@@ -238,18 +238,18 @@ <h2 class="title is-3 has-text-centered">Dataset Collection</h2>
238238
</section>
239239

240240

241-
<!-- Dataset Table Section -->
241+
<!-- Survey Table Section -->
242242
<section class="section">
243243
<div class="container">
244244
<h2 class="title is-3 has-text-centered">Other Surveys</h2>
245245
<div class="table-container" style="overflow-x: auto;">
246246
<table class="table is-striped is-hoverable is-fullwidth" id="surveyTable">
247247
<thead>
248248
<tr>
249-
<th onclick="sortTable(0, this)">Titel<br><span class="sort-icon"></span></th>
250-
<th onclick="sortTable(1, this)">Year<br><span class="sort-icon"></span></th>
251-
<th onclick="sortTable(2, this)">Author<br><span class="sort-icon"></span></th>
252-
<th onclick="sortTable(9, this)">Paper URL<br><span class="sort-icon"></span></th>
249+
<th onclick="sortSurveyTable(0, this)">Title<br><span class="sort-icon"></span></th>
250+
<th onclick="sortSurveyTable(1, this)">Year<br><span class="sort-icon"></span></th>
251+
<th onclick="sortSurveyTable(2, this)">Author<br><span class="sort-icon"></span></th>
252+
<th onclick="sortSurveyTable(3, this)">Paper URL<br><span class="sort-icon"></span></th>
253253
</tr>
254254
</thead>
255255
<tbody>
@@ -290,8 +290,8 @@ <h2 class="title is-3">Acknowledgements</h2>
290290

291291

292292
<script>
293-
// Function to load and parse CSV file
294-
async function loadCSV() {
293+
// Function to load and parse TSV file for datasets
294+
async function loadTSV() {
295295
const response = await fetch("static/files/dataset_table.tsv");
296296
const csvText = await response.text();
297297

@@ -325,18 +325,50 @@ <h2 class="title is-3">Acknowledgements</h2>
325325
}
326326
}
327327

328-
// Call the CSV loading function on page load
329-
document.addEventListener("DOMContentLoaded", loadCSV);
328+
// Function to load and parse TSV file for surveys
329+
async function loadSurveyTSV() {
330+
const response = await fetch("static/files/survey_table.tsv");
331+
const csvText = await response.text();
332+
333+
const rows = csvText.trim().split("\n");
334+
const tableBody = document.querySelector("#surveyTable tbody");
330335

331-
// Sorting function (remains the same as before)
332-
function sortTable(n, header) {
336+
for (let i = 1; i < rows.length; i++) { // Start from 1 to skip header
337+
const cols = rows[i].split("\t");
338+
const row = document.createElement("tr");
339+
340+
cols.forEach((col, index) => {
341+
const cell = document.createElement("td");
342+
if (index === 3) { // Paper URL column
343+
const a = document.createElement("a");
344+
a.href = col.trim();
345+
a.target = "_blank";
346+
a.textContent = "Link";
347+
cell.appendChild(a);
348+
} else {
349+
cell.textContent = col.trim();
350+
}
351+
row.appendChild(cell);
352+
});
353+
tableBody.appendChild(row);
354+
}
355+
}
356+
357+
// Call the CSV loading functions on page load
358+
document.addEventListener("DOMContentLoaded", () => {
359+
loadTSV();
360+
loadSurveyTSV();
361+
});
362+
363+
// Sorting function for dataset table
364+
function sortDatasetTable(n, header) {
333365
const table = document.getElementById("datasetTable");
334366
let rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0;
335367
switching = true;
336368
dir = "asc";
337369

338-
document.querySelectorAll('.sort-icon').forEach(icon => {
339-
icon.innerHTML = "&#8597;";
370+
document.querySelectorAll('#datasetTable .sort-icon').forEach(icon => {
371+
icon.innerHTML = "";
340372
});
341373

342374
while (switching) {
@@ -348,8 +380,8 @@ <h2 class="title is-3">Acknowledgements</h2>
348380
x = rows[i].getElementsByTagName("TD")[n];
349381
y = rows[i + 1].getElementsByTagName("TD")[n];
350382

351-
const xContent = n === 8 ? parseInt(x.innerHTML.replace(/\D/g, '')) || 0 : x.innerHTML.toLowerCase();
352-
const yContent = n === 8 ? parseInt(y.innerHTML.replace(/\D/g, '')) || 0 : y.innerHTML.toLowerCase();
383+
const xContent = n === 8 ? parseInt(x.innerHTML.replace(/\D/g, '')) || 0 : x.textContent.toLowerCase();
384+
const yContent = n === 8 ? parseInt(y.innerHTML.replace(/\D/g, '')) || 0 : y.textContent.toLowerCase();
353385

354386
if ((dir === "asc" && xContent > yContent) ||
355387
(dir === "desc" && xContent < yContent)) {
@@ -367,11 +399,63 @@ <h2 class="title is-3">Acknowledgements</h2>
367399
switching = true;
368400
}
369401
}
370-
402+
403+
const icon = header.querySelector('.sort-icon');
404+
icon.innerHTML = (dir === "asc") ? "↑" : "↓";
405+
}
406+
407+
// Sorting function for survey table
408+
function sortSurveyTable(n, header) {
409+
const table = document.getElementById("surveyTable");
410+
let rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0;
411+
switching = true;
412+
dir = "asc";
413+
414+
document.querySelectorAll('#surveyTable .sort-icon').forEach(icon => {
415+
icon.innerHTML = "↕";
416+
});
417+
418+
while (switching) {
419+
switching = false;
420+
rows = table.rows;
421+
422+
for (i = 1; i < (rows.length - 1); i++) {
423+
shouldSwitch = false;
424+
x = rows[i].getElementsByTagName("TD")[n];
425+
y = rows[i + 1].getElementsByTagName("TD")[n];
426+
427+
// For sorting, we treat all columns as text except year.
428+
// If the year column is at index 1, we can parse it as an integer.
429+
let xContent, yContent;
430+
if (n === 1) {
431+
xContent = parseInt(x.textContent) || 0;
432+
yContent = parseInt(y.textContent) || 0;
433+
} else {
434+
xContent = x.textContent.toLowerCase();
435+
yContent = y.textContent.toLowerCase();
436+
}
437+
438+
if ((dir === "asc" && xContent > yContent) ||
439+
(dir === "desc" && xContent < yContent)) {
440+
shouldSwitch = true;
441+
break;
442+
}
443+
}
444+
445+
if (shouldSwitch) {
446+
rows[i].parentNode.insertBefore(rows[i + 1], rows[i]);
447+
switching = true;
448+
switchcount++;
449+
} else if (switchcount === 0 && dir === "asc") {
450+
dir = "desc";
451+
switching = true;
452+
}
453+
}
454+
371455
const icon = header.querySelector('.sort-icon');
372-
icon.innerHTML = (dir === "asc") ? "&#8593;" : "&#8595;";
456+
icon.innerHTML = (dir === "asc") ? "" : "";
373457
}
374-
</script>
458+
</script>
375459

376460
</body>
377461
</html>

0 commit comments

Comments
 (0)