-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
900c053
commit dd31a44
Showing
15 changed files
with
381 additions
and
70 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import Image from "next/image"; | ||
import React from 'react'; | ||
import | ||
// import collegediversity fro../m '../../../../public/data/collegediversity.json' assert {type: 'json'}; | ||
// import historicaltuition from '../../../../public/data/historicaltuition.json'; | ||
// import salarypotential fro../m '../../../../public/data/salarypotential.json'; | ||
// import tuitioncost fro../m '../../../../public/data/tuitioncost.json'; | ||
|
||
|
||
import Nav from '../../components/nav';import { promises as fs } from 'fs'; | ||
|
||
export default async function School(collegename) { | ||
// const file = await fs.readFile(process.cwd() + '../../../public/data/collegediversity.json', 'utf8'); | ||
// const data = JSON.parse(file); | ||
const dictionary = new Map(); | ||
async function fetchData(collegename) { | ||
try { | ||
for (var i = 0; i < arr.length; i++){ | ||
//document.write("<br><br>array index: " + i); | ||
var obj = collegediversity[i]; | ||
if (obj["name"] === collegename) { | ||
dictionary.set(obj["catagory"],obj["enrollment"]); | ||
} | ||
} | ||
|
||
if(response.catagory == "Woman") { | ||
throw new Error("Could not fetch resource"); | ||
} | ||
} | ||
|
||
catch(error){ | ||
console.error(error); | ||
} | ||
} | ||
return ( | ||
<main className="overflow-y-hidden m-0 p-0 min-h-screen overflow-hidden"> | ||
<Nav /> | ||
<section className="grid grid-cols-1 place-items-center" id="welcome"> | ||
<div className=" text- text-6xl font-bold py-64"> | ||
<h1 className="text-center transition ease-in-out hover:-translate-x-4 hover:cursor-pointer duration-300 ">Colleges</h1> | ||
</div> | ||
</section> | ||
|
||
{/* Collge Info */} | ||
<section className="text-center"> | ||
<div class="container"> | ||
<h1 className="text-4xl font-bold">University of Phoenix-Arizona</h1> | ||
</div > | ||
<div className="" id=""> | ||
<h1 className="text-4xl font-bold">State: {collegediversity[0].state}</h1> | ||
</div> | ||
<div className="" id=""> | ||
enenrollment <h1 className="text-4xl font-bold">Total Enrollment: {collegediversity[0].state}</h1> | ||
</div> | ||
<h1>Racial Distribution of Pheonix-Arizona University</h1> | ||
<div> | ||
<canvas id = "pie-chart"></canvas> | ||
</div> | ||
<script src = "chart.min.js"></script> | ||
<script> | ||
new Chart(document.getElementById('pie-chart'), { | ||
type: 'pie', | ||
data : { | ||
lables : ['Black','American Indian / Alaska Native','Asian', 'Hispanic','Native Hawaiian / Pacific Islander','White','Mixed'], | ||
datasets: [{ | ||
backgroundColor: ["#e63946", "#254BDD", | ||
"#ffbe0b", "#1d3557", "#326998","#99FFFF","#FF6666" | ||
], | ||
data: [ ] | ||
}] | ||
} | ||
}) | ||
</script> | ||
</section> | ||
</main> | ||
); | ||
} | ||
/* | ||
async function fetchData() { | ||
try { | ||
const response = await fetch('../../../public/data/tuitioncost.json') | ||
if(response.catagory == "Woman") { | ||
throw new Error("Could not fetch resource"); | ||
} | ||
const data = await resoponse.json(); | ||
console.log(dat) | ||
} | ||
catch(error){ | ||
console.error(error) | ||
} | ||
}*/ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import Image from "next/image"; | ||
import React from 'react'; | ||
import collegediversity from '../../../../public/data/collegediversity.json' assert {type: 'json'}; | ||
import historicaltuition from '../../../../public/data/historicaltuition.json'; | ||
import salarypotential from '../../../../public/data/salarypotential.json'; | ||
import tuitioncost from '../../../../public/data/tuitioncost.json'; | ||
import { promises as fs } from 'fs'; | ||
import Nav from '../../components/nav'; | ||
|
||
export default async function School(collegename) { | ||
// const file = await fs.readFile(process.cwd() + '../../../public/data/collegediversity.json', 'utf8'); | ||
// const data = JSON.parse(file); | ||
async function fetchData(collegename) { | ||
const dictionary = new Map(); | ||
try { | ||
for (var i = 0; i < arr.length; i++){ | ||
//document.write("<br><br>array index: " + i); | ||
var obj = collegediversity[i]; | ||
if (obj["name"] === collegename) { | ||
dictionary.set(obj["catagory"],obj["enrollment"]); | ||
} | ||
} | ||
|
||
if(response.catagory == "Woman") { | ||
throw new Error("Could not fetch resource"); | ||
} | ||
} | ||
|
||
catch(error){ | ||
console.error(error); | ||
} | ||
} | ||
return ( | ||
<main className="overflow-y-hidden m-0 p-0 min-h-screen overflow-hidden"> | ||
<Nav /> | ||
<section className="grid grid-cols-1 place-items-center" id="welcome"> | ||
<div className=" text- text-6xl font-bold py-64"> | ||
<h1 className="text-center transition ease-in-out hover:-translate-x-4 hover:cursor-pointer duration-300 ">School</h1> | ||
</div> | ||
</section> | ||
|
||
{/* Collge Info */} | ||
<section className="text-center"> | ||
<div class="container"> | ||
<h1 className="text-4xl font-bold">University of Phoenix-Arizona</h1> | ||
</div > | ||
<div className="" id=""> | ||
<h1 className="text-4xl font-bold">State: {collegediversity[0].state}</h1> | ||
</div> | ||
<div className="" id=""> | ||
<h1 className="text-4xl font-bold">Total Enrollment: {collegediversity[0].enrollment}</h1> | ||
</div> | ||
</section> | ||
</main> | ||
); | ||
} | ||
/* | ||
async function fetchData() { | ||
try { | ||
const response = await fetch('../../../public/data/tuitioncost.json') | ||
if(response.catagory == "Woman") { | ||
throw new Error("Could not fetch resource"); | ||
} | ||
const data = await resoponse.json(); | ||
console.log(dat) | ||
} | ||
catch(error){ | ||
console.error(error) | ||
} | ||
}*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
@import url("https://fonts.googleapis.com/css?family=Open+Sans&display=swap"); | ||
|
||
* { | ||
box-sizing: border-box; | ||
} | ||
|
||
body { | ||
background-color: #f9fafb; | ||
font-family: "Open Sans", sans-serif; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
min-height: 100vh; | ||
margin: 0; | ||
} | ||
.container { | ||
background-color: #fff; | ||
border-radius: 10px; | ||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); | ||
width: 740px; | ||
} | ||
h1 { | ||
text-align: center; | ||
margin: 20px 0; | ||
color: #565656; | ||
} | ||
|
||
@media all and (max-width: 780px) { | ||
.container { | ||
width: auto; | ||
} | ||
} | ||
|
||
@media all and (max-width: 400px) { | ||
.container { | ||
padding: 0px 20px; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.