-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindices_agencies.js
More file actions
39 lines (31 loc) · 1.06 KB
/
indices_agencies.js
File metadata and controls
39 lines (31 loc) · 1.06 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
Promise.all([d3.csv("indices_agencies.csv")])
.then(function(agencies){
agenciesLoaded(agencies)
})
function agenciesLoaded(agencies){
//console.log(agencies)
var list = agencies[0]
list = list.sort(function(a,b){
var textA = a["Institution"].toUpperCase();
var textB = b["Institution"].toUpperCase();
return (textA < textB) ? -1 : (textA > textB) ? 1 : 0;
})
//console.log(list)
var table = d3.select("#indices_agencies").append("table")
var row = table.append("tr")
row.append("th").html("INDEX")
row.append("th").html("AGENCY/INSITUTION")
row.append("th").html("LINKS")
row.append("th").html("")
for(var i in list){
//console.log(list[i])
if(list[i]["Index Name"]!=undefined){
var entry = list[i]
var row = table.append("tr")
row.append("td").html(entry["Index Name"])
row.append("td").html("<strong>"+entry["Institution"]+"</strong>")
row.append("td").html("<a href="+entry["URL"]+" target=\"blank\">Index</a>")
row.append("td").html("<a href="+entry["Data and Methods"]+" target=\"blank\">Method</a>")
}
}
}