Skip to content

Commit

Permalink
stfu
Browse files Browse the repository at this point in the history
  • Loading branch information
a1ho committed Feb 12, 2024
2 parents a424785 + 1b71765 commit 2b93fee
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 52 deletions.
85 changes: 33 additions & 52 deletions src/components/App.svelte
Original file line number Diff line number Diff line change
@@ -1,62 +1,43 @@
<script>
import { onMount } from 'svelte';
import * as d3 from 'd3';
let data = [];
onMount(async () => {
const res = await fetch(
'https://raw.githubusercontent.com/mf02511/Median-Earnings-by-College-Major/main/src/components/major_earnings.csv',
);
const csv = await res.text();
await d3.csvParse(csv, (d, i, columns) => {
for (let j = 0; j < 27; j++) {
data[i][columns[j]] = d[columns[j]]
}
});
data = data;
import * as d3 from 'd3';
import { onMount } from 'svelte';
let data = [];
onMount(async () => {
const res = await fetch(
'https://raw.githubusercontent.com/mf02511/Median-Earnings-by-College-Major/main/src/components/major_earnings.csv',
);
const csv = await res.text();
await d3.csvParse(csv, (d, i, columns) => {
let row = {}
for (let j = 0; j < 27; j++) {
row[columns[j]] = d[columns[j]]
}
data.push(row)
});
data=data;
});
$: console.log(data);
$: console.log(data)
</script>

<main>
<h1>Median Earnings by College Degree</h1>

<h1>Median Earnings by College Majors</h1>
<p></p>
</main>

<style>
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;700&display=swap');
:root {
--color-bg: #ffffff;
--color-outline: #c2c2c2;
--color-shadow: hsl(0, 0%, 0%, 0.1);
--color-text: #3f4252;
--color-bg-1: hsla(0, 0%, 0%, 0.2);
--color-shadow-1: hsl(0, 0%, 96%);
}
*,
*::before,
*::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
main {
text-align: center;
font-family: 'Nunito', sans-serif;
font-weight: 300;
line-height: 2;
font-size: 24px;
color: var(--color-text);
}
h1 {
font-size: 2em;
font-weight: 300;
line-height: 2;
}
@import url('https://fonts.googleapis.com/css2?family=Assistant:wght@200;400;600;700;800&display=swap');
main {
text-align: center;
font-family: 'Assistant', sans-serif;
}
h1 {
font-size: 72px;
font-weight: 200;
}
</style>
9 changes: 9 additions & 0 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<script>
<<<<<<< HEAD
import App from '../components/App.svelte';
</script>

<App />
=======
import App from '../components/App.svelte';
</script>
<h1></h1>
<p></p>

<App />
>>>>>>> 1b71765b0a9bd30cd3c634d3ad3b81c59d555757

0 comments on commit 2b93fee

Please sign in to comment.