-
Notifications
You must be signed in to change notification settings - Fork 13
/
suggest_dataset.html
44 lines (37 loc) · 1.69 KB
/
suggest_dataset.html
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
---
title: Suggest dataset
layout: default
permalink: /suggest-dataset/
---
{% include breadcrumbs.html %}
<div class="row">
<div class="col-md-6">
<iframe src="https://docs.google.com/forms/d/e/1FAIpQLSfKb9xcn1Fk5oM7DTJunVIzVVNFh53BUaxmRmg9XbJ_A9vt0A/viewform?embedded=true" width="100%" height="700" frameborder="0" marginheight="0" marginwidth="0">Loading…</iframe>
</div>
<div class=col-md-6>
<p>Here are some datasets that people have suggested previously:</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Category</th>
<th>Dataset name</th>
</tr>
</thead>
<tbody id="suggested-datasets">
</tbody>
</table>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/datalib/1.9.3/datalib.min.js" integrity="sha512-0Wxch7yEHpq8eszzwYYczf6VJxBz9pDsx/K2LirpZ05WgDaoo7BK6uap/osDV21OO1KGNFhKJ2ujZXm0vk18pg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script>
let datasetTable = document.getElementById("suggested-datasets");
var data = dl.csv('https://docs.google.com/spreadsheets/d/e/2PACX-1vRKMpk4SkPuW28zYmJPF00Ol_C2rpXaVJHrsBEJipXfPMEY7OknbhmbaOlLcRU52fuAQZyep67p4vfo/pub?output=csv');
var catColName = data.columns[1];
var datasetColName = data.columns[2];
data.forEach(row => {
let category = row[catColName].replace(/(<([^>]+)>)/gi, "");;
let dataset = row[datasetColName].replace(/(<([^>]+)>)/gi, "");;
var newRow = `<tr><td>${category}</td><td>${dataset}</td></tr>`
datasetTable.insertAdjacentHTML( 'beforeend', newRow );
})
</script>