Skip to content
Open

yea #86

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
212 changes: 212 additions & 0 deletions Ejoh_assignment1
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
<html>
<head>
<!-- CSS -->
div {
margin-bottom: 20px;
}
</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"></div>

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

</body>
</html>
107 changes: 104 additions & 3 deletions assignment_1/table_manager.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,116 @@
<body>
<!-- Feel free to add empty tags. Data shouldn't be here. -->
<div id="org_table"></div>

<table id="org_table_two"></table>
<script>
// outputs the first item of the organizations array. Just for testing.
console.log(organizations[0]);
var i=0
var count_one=0;
var count_two=0;
var count_three=0;
var count_four=0;
var count_five=0;
for (i=0;i<organizations.length;i++){

if (organizations[i]["Organization Type"]=== 'Nonprofit'){

count_one++;

}

if (organizations[i]["Founding Year"] <= 2008){
count_two++;

}

if (organizations[i]["Region"] === 'North America' ){
count_three++;

}

if (organizations[i]["Type of Data Used"] ==='Transportation' ){
count_four++;

}

if (organizations[i]["Size"] != '1 to 10' ){
count_five++;

}
}
var the_table=document.getElementById("org_table_two");






var header = the_table.createTHead();
var row = header.insertRow(0);
var cell = row.insertCell(0);
cell.innerHTML = "<b>Questions </b>";






var cell_two = row.insertCell(1);
cell_two.innerHTML = "<b>Number</b>";

var row_one=the_table.insertRow(1);
var question_one=row_one.insertCell(0);
var non_profit_org=row_one.insertCell(1);
question_one.innerHTML="# of non profit?";
non_profit_org.innerHTML=count_one;






var row_two=the_table.insertRow(2);
var question_two=row_two.insertCell(0);
var answer_two=row_two.insertCell(1);
question_two.innerHTML="North American";
answer_two.innerHTML=count_three;






var row_three=the_table.insertRow(3);
var question_three=row_three.insertCell(0);
var answer_three=row_three.insertCell(1);
question_three.innerHTML="Less than 10 years old?";
answer_three.innerHTML=count_two;






var row_four=the_table.insertRow(4);
var question_four=row_four.insertCell(0);
var answer_four=row_four.insertCell(1);
question_four.innerHTML="Transportation type?";
answer_four.innerHTML=count_four;






// Your JavaScript code goes here
var row_five=the_table.insertRow(5);
var question_five=row_five.insertCell(0);
var answer_five=row_five.insertCell(1);
question_five.innerHTML="How many small orgs?";
answer_five.innerHTML=count_five;


</script>

</body>
</html>
</html>