Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 102 additions & 20 deletions assignment_1/table_manager.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<!-- Data -->
<script>

// Don't copy this to any other places in this file. You can just use the "organizations" variable to do your assignment.
// 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",
Expand All @@ -19,7 +19,7 @@
"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.",
"Description": "200 Square is an online real estate agent in New Zealand.",
"City": "Wellington",
"State/Region": "Wellington",
"Founding Year": 2010,
Expand All @@ -34,7 +34,7 @@
"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.",
"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,
Expand All @@ -49,7 +49,7 @@
"Organization Name": "2GIS",
"Organization Type": "For-profit",
"Sectors": "IT and geospatial",
"Description": "2GIS is a city information service combined with a map. ",
"Description": "2GIS is a city information service combined with a map. ",
"City": "Novosibirsk",
"State/Region": "Novosibirsk Oblast",
"Founding Year": 1999,
Expand All @@ -64,7 +64,7 @@
"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.",
"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,
Expand Down Expand Up @@ -94,7 +94,7 @@
"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.",
"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,
Expand Down Expand Up @@ -124,7 +124,7 @@
"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.",
"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,
Expand All @@ -139,7 +139,7 @@
"Organization Name": "5PSolutions",
"Organization Type": "For-profit",
"Sectors": "IT and geospatial",
"Description": "5PSolutions are artisans of mobile platforms.",
"Description": "5PSolutions are artisans of mobile platforms.",
"City": "Fairfax",
"State/Region": "Virginia",
"Founding Year": 2007,
Expand All @@ -154,7 +154,7 @@
"Organization Name": "AAA National",
"Organization Type": "Other",
"Sectors": "Transportation and logistics",
"Description": "AAA provides services such as travel, automotive, insurance, financial, and discounts.",
"Description": "AAA provides services such as travel, automotive, insurance, financial, and discounts.",
"City": "Irving",
"State/Region": "Texas",
"Founding Year": 1902,
Expand Down Expand Up @@ -184,32 +184,114 @@
"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.",
"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>

</script>
</head>

<body>
<!-- Feel free to add empty tags. Data shouldn't be here. -->
<div id="org_table"></div>
<div id="org_table">
<table id="table">
<tr>
<td></td>
<td></td>
</tr>

<script>
// outputs the first item of the organizations array. Just for testing.
console.log(organizations[0]);
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
</div>

// Your JavaScript code goes here
<script>
// Your JavaScript code goes here
// outputs the first item of the organizations array. Just for testing.
console.log(organizations[0]);

var row0 = document.getElementById("table").rows[0].cells;
var row1 = document.getElementById("table").rows[1].cells;
var row2 = document.getElementById("table").rows[2].cells;
var row3 = document.getElementById("table").rows[3].cells;
var row4 = document.getElementById("table").rows[4].cells;

</script>
//each list corresponds to the question that needs to be answered
var nonproOrgs = [];
var lessThanTen = [];
var northAmerican = [];
var transportData = [];
//fifth list is the bonus question that I find interesting
var highIncome = [];


for (var key of Object.keys(organizations)) {
var orgKeys = organizations[key];


//1
if (orgKeys["Organization Type"] == "Nonprofit") {
nonproOrgs.push(orgKeys["Organization Type"]);
}

row0[0].innerHTML = "Nonprofit Organizations:";
row0[1].innerHTML = nonproOrgs.length;

//2
if (orgKeys["Founding Year"] > 2008) {
lessThanTen.push(orgKeys["Founding Year"]);
}

row1[0].innerHTML = "Less Than 10 Years Old:";
row1[1].innerHTML = lessThanTen.length;

//3
if (orgKeys["Region"] == "North America") {
northAmerican.push(orgKeys["Region"]);
}

row2[0].innerHTML = "Count in North America:";
row2[1].innerHTML = northAmerican.length;

//4
if (orgKeys["Type of Data Used"] == "Transportation") {
transportData.push(orgKeys["Type of Data Used"]);
}

row3[0].innerHTML = "Count using Transportation Data:";
row3[1].innerHTML = transportData.length;

//5
//How many organizations have a high income level?
if (orgKeys["Country Income Level"] == "High income") {
highIncome.push(orgKeys["Organization Type"]);
}

row4[0].innerHTML = "High Income Level:";
row4[1].innerHTML = highIncome.length;

}

</script>
</body>
</html>
</html>
Empty file added git/introductions/gurukar.md
Empty file.