-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
160 lines (149 loc) · 5.08 KB
/
index.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
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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Intended Nationally Determined Contributions (INDCs)</title>
<link href="https://fonts.googleapis.com/css?family=Fira+Sans" rel="stylesheet">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/css/tachyons.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/jq-2.2.4/dt-1.10.15/datatables.min.css"/>
<style>
table.dataTable tr.odd {
background-color: #eeeeee;
}
a {
color: #ff6300;
}
hr {
border: none;
height: 4px;
background-color: #333;
margin-top: 20px;
margin-bottom: 5px;
}
</style>
</head>
<body class="mb5 sans-serif">
<div class="ph4 mw9 pt3">
<h1>Intended Nationally Determined Contributions</h1>
</div>
<div class="mw9 ph3-ns">
<div class="cf ph2-ns">
<div class="fl w-100 w-50-ns pa2">
<h2><span id="submitted"></span> INDCs submitted</h2>
<hr>
</div>
<div class="fl w-100 w-50-ns pa2">
<h2> </h2>
<hr>
</div>
</div>
</div>
<div class="mw9 ph3-ns">
<div class="cf ph2-ns">
<div class="fl w-100 w-50-ns pa2">
<p id="description" class="measure-wide"></p>
<h4 class="mt0 mid-gray">Sources</h4>
<ul class="list pl0" id="sources">
</div>
<div class="fl w-100 w-50-ns pa2 pt3">
<a class="f6 link dim ba ph3 pv2 mb2 dib black inline-flex items-center"" href="https://github.com/openclimatedata/indcs"><svg class="dib h2 w2" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M8 0C3.58 0 0 3.582 0 8c0 3.535 2.292 6.533 5.47 7.59.4.075.547-.172.547-.385 0-.19-.007-.693-.01-1.36-2.226.483-2.695-1.073-2.695-1.073-.364-.924-.89-1.17-.89-1.17-.725-.496.056-.486.056-.486.803.056 1.225.824 1.225.824.714 1.223 1.873.87 2.33.665.072-.517.278-.87.507-1.07-1.777-.2-3.644-.888-3.644-3.953 0-.873.31-1.587.823-2.147-.083-.202-.358-1.015.077-2.117 0 0 .672-.215 2.2.82.638-.178 1.323-.266 2.003-.27.68.004 1.364.092 2.003.27 1.527-1.035 2.198-.82 2.198-.82.437 1.102.163 1.915.08 2.117.513.56.823 1.274.823 2.147 0 3.073-1.87 3.75-3.653 3.947.287.246.543.735.543 1.48 0 1.07-.01 1.933-.01 2.195 0 .215.144.463.55.385C13.71 14.53 16 11.534 16 8c0-4.418-3.582-8-8-8"/></svg><span class="ml3">GitHub Repository</span></a>
</div>
<div class="fl w-100 w-50-ns pa2">
<h4 class="mt0 mid-gray">Download</h4>
<dl class="lh-title mt0">
<dt class="dib b">Data: </dt><dd class="dib ml1"><a href="data/indcs.csv">indcs.csv</a></dd>
</dl>
<dl class="lh-title mt0">
<dt class="dib b">Metadata: </dt><dd class="dib ml1"><a class="" href="datapackage.json">datapackage.json</a></dd>
</dl>
<dl class="lh-title mt0">
<dt class="dib b">Zipped Package: </dt><dd class="dib ml1"><a class="" href="https://github.com/openclimatedata/indcs/archive/master.zip">master.zip</a>
</dd></dt>
</dl>
</div>
</div>
</div>
<div class="ph4 mw9">
<h2 class="mt0">Data</h2>
<hr>
<table id="data" width="100%" cellspacing="0">
<thead>
<tr>
<th>Code</th>
<th>Party</th>
<th>FilType</th>
<th>Language</th>
<th>Filename</th>
<th>SubmissionDate</th>
<th>EncodedAbsUrl</th>
<th>OriginalFilename</th>
</tr>
</thead>
</table>
</div>
<div class="ph4 mw8">
<h2>Columns</h2>
<hr>
<table id="metadata" width="100%" cellspacing="0">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
</table>
</div>
<script src="https://d3js.org/d3-selection.v1.min.js"></script>
<script src="https://d3js.org/d3-collection.v1.min.js"></script>
<script src="https://d3js.org/d3-dispatch.v1.min.js"></script>
<script src="https://d3js.org/d3-dsv.v1.min.js"></script>
<script src="https://d3js.org/d3-request.v1.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/jq-2.2.4/dt-1.10.15/datatables.min.js"></script>
<script>
d3.json("datapackage.json", function(metadata) {
$('table#metadata').DataTable({
data: metadata.resources[0].schema.fields,
columns: [
{ data: 'name' },
{ data: 'type' },
{ data: 'description' }
],
ordering: false,
paging: false,
info: false,
searching: false,
scrollX: true
})
metadata.sources.forEach(function(source) {
d3.select("#sources").append("li").html(
"<a href='" + source["web"] + "'>" + source["title"]) + "</a>"
})
d3.select("#description").html(metadata.description)
d3.csv(metadata.resources[0].path, function(data) {
var columns = metadata.resources[0].schema.fields.map(function(field) {
return { data: field.name }
})
$('table#data').DataTable({
data: data,
columns: columns,
columnDefs: [{
"targets": 6,
"render": function ( data, type, row, meta ) {
return '<a href="' + data + '">' + data + '</a>'
}
}],
scrollX: true,
order: [[5, true]]
})
var count = data.map(function(item) { return item.Code }).filter(
function(value, index, self) {
return self.indexOf(value) === index;
}).length
d3.select("#submitted").html(count)
})
})
</script>
</body>