forked from donalus/INST377
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRoundtree_JavaScript.html
More file actions
257 lines (244 loc) · 9.89 KB
/
Copy pathRoundtree_JavaScript.html
File metadata and controls
257 lines (244 loc) · 9.89 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
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
<html>
<head>
<!-- CSS -->
<style type="text/css">
div {
margin-bottom: 20px;
}
table {
border: 1px solid black;
}
table td,table th{
border: 1px solid black;
}
</style>
<!-- Data -->
<script>
// Don't copy this to any other places in this file. You can just use the "organizations" variable to do your assignment.
var organizations = [
{
"Region": "East Asia & Pacific",
"Country": "New Zealand",
"Country Income Level": "High income",
"Organization Name": "200 Square",
"Organization Type": "For-profit",
"Sectors": "Housing, construction & real estate",
"Description": "200 Square is an online real estate agent in New Zealand.",
"City": "Wellington",
"State/Region": "Wellington",
"Founding Year": 2010,
"Size": "1 to 10",
"Type of Data Used": "Housing, Education",
"profileID": "731"
},
{
"Region": "Europe & Central Asia",
"Country": "United Kingdom",
"Country Income Level": "High income",
"Organization Name": "21c Consultancy",
"Organization Type": "For-profit",
"Sectors": "IT and geospatial",
"Description": "21c is ICT innovation consultancy which advises international actors, institutions and governments around the world on technological trends which can affect the way they deliver services.",
"City": "London",
"State/Region": "",
"Founding Year": 2015,
"Size": "1 to 10",
"Type of Data Used": "",
"profileID": "1694"
},
{
"Region": "Europe & Central Asia",
"Country": "Russian Federation",
"Country Income Level": "High income",
"Organization Name": "2GIS",
"Organization Type": "For-profit",
"Sectors": "IT and geospatial",
"Description": "2GIS is a city information service combined with a map. ",
"City": "Novosibirsk",
"State/Region": "Novosibirsk Oblast",
"Founding Year": 1999,
"Size": "1000+",
"Type of Data Used": "Transportation, Geospatial, Business",
"profileID": "1025"
},
{
"Region": "North America",
"Country": "United States",
"Country Income Level": "High income",
"Organization Name": "2nd City Zoning",
"Organization Type": "Nonprofit",
"Sectors": "Housing, construction & real estate",
"Description": "An Open City App, 2nd City Zoning is an interactive map that lets you find out how your building is zoned, learn where to locate your business and explore zoning patterns throughout the city.",
"City": "Chicago",
"State/Region": "Illinois",
"Founding Year": 2013,
"Size": "1 to 10",
"Type of Data Used": "Housing",
"profileID": "1693"
},
{
"Region": "North America",
"Country": "United States",
"Country Income Level": "High income",
"Organization Name": "3 Round Stones Inc",
"Organization Type": "For-profit",
"Sectors": "IT and geospatial",
"Description": "3 Round Stones' Open Source platform is used by the Fortune 2000 and US Government Agencies to collect, publish and reuse data, both public and proprietary.",
"City": "Arlington",
"State/Region": "Virginia",
"Founding Year": 2010,
"Size": "1 to 10",
"Type of Data Used": "Weather, Science and research, Health/healthcare, Geospatial, Environment, Energy, Demographic and social, Business",
"profileID": "580"
},
{
"Region": "North America",
"Country": "United States",
"Country Income Level": "High income",
"Organization Name": "360 Yield Center",
"Organization Type": "For-profit",
"Sectors": "Agriculture",
"Description": "Taking a 360-degree view of key yield-limiting variables, 360 Yield Center develops strategies for better-performing crops and better on-farm profits.",
"City": "Morton",
"State/Region": "Illinois",
"Founding Year": 2014,
"Size": "51 to 200",
"Type of Data Used": "Agriculture, Environment, Weather",
"profileID": "1692"
},
{
"Region": "Europe & Central Asia",
"Country": "Denmark",
"Country Income Level": "High income",
"Organization Name": "3Strikes - City Stories",
"Organization Type": "For-profit",
"Sectors": "Arts, culture and tourism",
"Description": "City Stories provides a platform that allows users to explore local stories and simultaneously contribute their own.",
"City": "Aarhus",
"State/Region": "Central Denmark Region",
"Founding Year": 2015,
"Size": "1 to 10",
"Type of Data Used": "Arts and culture",
"profileID": "2278"
},
{
"Region": "Europe & Central Asia",
"Country": "Finland",
"Country Income Level": "High income",
"Organization Name": "3Tier (Europe) ",
"Organization Type": "For-profit",
"Sectors": "Energy and climate",
"Description": "3TIER is a global environmental and industrial measurement company providing weather-driven renewable energy risk assessment and forecasting for wind, solar, and hydro power projects.",
"City": "Helsinki",
"State/Region": "Uusimaa",
"Founding Year": 2012,
"Size": "11 to 50",
"Type of Data Used": "Other, Environment",
"profileID": "952"
},
{
"Region": "North America",
"Country": "United States",
"Country Income Level": "High income",
"Organization Name": "5PSolutions",
"Organization Type": "For-profit",
"Sectors": "IT and geospatial",
"Description": "5PSolutions are artisans of mobile platforms.",
"City": "Fairfax",
"State/Region": "Virginia",
"Founding Year": 2007,
"Size": "1 to 10",
"Type of Data Used": "Environment",
"profileID": "534"
},
{
"Region": "North America",
"Country": "United States",
"Country Income Level": "High income",
"Organization Name": "AAA National",
"Organization Type": "Other",
"Sectors": "Transportation and logistics",
"Description": "AAA provides services such as travel, automotive, insurance, financial, and discounts.",
"City": "Irving",
"State/Region": "Texas",
"Founding Year": 1902,
"Size": "201 to 1000",
"Type of Data Used": "Transportation",
"profileID": "1691"
},
{
"Region": "North America",
"Country": "United States",
"Country Income Level": "High income",
"Organization Name": "AAASHTO",
"Organization Type": "Other",
"Sectors": "Transportation and logistics",
"Description": "AASHTO works to educate the public and key decision makers about the critical role that transportation plays in securing a good quality of life and sound economy. AASHTO serves as a liaison between state departments of transportation and the Federal government.",
"City": "Washington",
"State/Region": "DC",
"Founding Year": 1913,
"Size": "51 to 200",
"Type of Data Used": "Transportation",
"profileID": "1690"
},
{
"Region": "Latin America & Caribbean",
"Country": "Chile",
"Country Income Level": "High income",
"Organization Name": "ABRELATAM",
"Organization Type": "Nonprofit",
"Sectors": "Governance",
"Description": "ABRELATAM is an conference that seeks to accelerate the process of opening information through Open Data transparency and promote the Latin America.",
"City": "Santiago",
"State/Region": "",
"Founding Year": 2015,
"Size": "",
"Type of Data Used": "",
"profileID": "1687"
}
];
</script>
</head>
<body>
<!-- Feel free to add empty tags. Data shouldn't be here. -->
<div id="org_table">
<table id="table">
</table>
</div>
<script>
// outputs the first item of the organizations array. Just for testing.
// console.log(organizations[0]);
var rows= ''
var header_row= "<tr><th>Region</th><th>Country</th><th>Country Income Level</th><th>Organization Name</th><th>Organization Type</th><th>Sectors</th><th>Description</th><th>City</th><th>State/Region</th><th>Founding Year</th><th>Size</th><th>Type of Data Used</th><th>profileID</th></tr>"
console.log("test");
//loops through JSON data
for (var i = 0; i < organizations.length; i++) {
var region = organizations[i]["Region"]
var country = organizations[i]["Country"]
var country_income = organizations[i]["Country Income Level"]
var org_name = organizations[i]["Organization Name"]
var org_type = organizations[i]["Organization Type"]
var sectors = organizations[i]["Sectors"]
var description = organizations[i]["Description"]
var city = organizations[i]["City"]
var state = organizations[i]["State/Region"]
var year = organizations[i]["Founding Year"]
var size = organizations[i]["Size"]
var data = organizations[i]["Type of Data Used"]
var profile_id = organizations[i]["profileID"]
rows = rows + '<tr><td>' + region + '</td><td>'+country+ '</td><td>'+country_income+ '</td><td>'+
org_name+'</td><td>'+org_type+'</td><td>'+sectors+'</td><td>'+description+'</td><td>'+city+
'</td><td>'+state+ '</td><td>'+year+'</td><td>'+size+'</td><td>'+data+'</td><td>'+profile_id+
'</td></tr>'
}
document.getElementById("table").innerHTML = header_row + rows //grabs element with the id "table" and changes data in the tage to the Header_row + rows.
/* They're are 2 nonprofit companies
They're are 8 organizations that are less than 10 years old
They're 6 organizations located in North America
they're 3 organizations that use the 'transportation'type of data.
All organization located in Virginia were involved in the IT and geospatial sectors and were size 1-10.
*/
// Your JavaScript code goes here
</script>
</body>
</html>