-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindexcm.html
274 lines (222 loc) · 13.1 KB
/
indexcm.html
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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
<html lang="en">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<head>
<div class="w3-top" id = 'sticknav'>
<div class="w3-bar w3-black w3-card">
<a class="w3-bar-item w3-button w3-padding-large w3-hide-medium w3-hide-large w3-right" href="javascript:void(0)" onclick="myFunction()" title="Toggle Navigation Menu"><i class="fa fa-bars"></i></a>
<a href="#" class="w3-bar-item w3-button w3-padding-large">HOME</a>
<a href="index.html" class="w3-bar-item w3-button w3-padding-large w3-hide-small">Directed Evolution</a>
<a href="page2.html" class="w3-bar-item w3-button w3-padding-large w3-hide-small" target="_self">Food Stuffs</a>
<div class="w3-dropdown-hover w3-hide-small">
<button class="w3-padding-large w3-button" title="More">MORE <i class="fa fa-caret-down"></i></button>
<div class="w3-dropdown-content w3-bar-block w3-card-4">
<a href="#" class="w3-bar-item w3-button">Merchandise</a>
<a href="#" class="w3-bar-item w3-button">Extras</a>
<a href="#" class="w3-bar-item w3-button">Media</a>
</div>
</div>
<a href="javascript:void(0)" class="w3-padding-large w3-hover-red w3-hide-small w3-right"><i class="fa fa-search"></i></a>
</div>
</div>
<script>
// Automatic Slideshow - change image every 4 seconds
var myIndex = 0;
carousel();
function carousel() {
var i;
var x = document.getElementsByClassName("mySlides");
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
myIndex++;
if (myIndex > x.length) {myIndex = 1}
x[myIndex-1].style.display = "block";
setTimeout(carousel, 4000);
}
// Used to toggle the menu on small screens when clicking on the menu button
function myFunction() {
var x = document.getElementById("navDemo");
if (x.className.indexOf("w3-show") == -1) {
x.className += " w3-show";
} else {
x.className = x.className.replace(" w3-show", "");
}
}
// When the user clicks anywhere outside of the modal, close it
var modal = document.getElementById('ticketModal');
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
</script>
<script>
/* Set the width of the side navigation to 250px and the left margin of the page content to 250px and add a black background color to body */
function openNav() {
document.getElementById("mySidenav").style.width = "250px";
document.getElementById("main").style.marginLeft = "250px";
document.body.style.backgroundColor = "rgba(0,0,0,0.4)";
}
/* Set the width of the side navigation to 0 and the left margin of the page content to 0, and the background color of body to white */
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
document.getElementById("main").style.marginLeft = "0";
document.body.style.backgroundColor = "white";
}
</script>
<div id="mySidenav" class="sidenav">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
<a href="#">About</a>
<a href="#">Services</a>
<a href="#">Clients</a>
<a href="#">Contact</a>
</div>
<!-- Use any element to open the sidenav -->
<span style="font-size:30px;cursor:pointer" onclick="openNav()">☰ </span>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<script src = 'd3.js'></script>
<script src = 'https://cdnjs.cloudflare.com/ajax/libs/d3-legend/2.25.6/d3-legend.min.js'></script>
<meta property='og:title' content='Best College Majors'/>
<meta property='og:image' content='https://github.com/cuthchow/college-majors-visualisation/blob/master/preview.png'/>
<meta property='og:description' content='This interactive, scrollable data visualisation will take you on a journey through all of the different college majors in the United States, and compare how they stack up in terms of median graduate salary, gender ratios, employability, and other factors. '/>
<meta property='og:url' content='https://cuthchow.github.io/college-majors-visualisation/'/>
<title>Best College Majors</title>
</head>
<body>
<!-- <div id="info">
a
</div> -->
<img src="https://github.com/cuthchow/college-majors-visualisation/blob/master/preview.png" alt="">
<div id="tooltip"></div>
<div id="graphic">
<div id="sections">
<section class="step">
<div class="title"></div>
<br><br>
<h1>Compound Pairing Efficacy in Disease Dimensions</h1>
<p>By <a href = 'https://hetzerk.com'>Transport to Hetzerk</a></p>
<p>
Most people want a degree which will enable them to make a lot of money upon graduation. Here
are (almost) all the available degrees, sorted by the median salary received by students upon graduation.
This graph gives us the ranking of each university major, based on the median salary of graduates. It gives us a rough
sense of which majors have the highest pay, but it's somewhat hard to read. Let's take a more detailed
journey through this data. Scroll down when you are ready! <br><br>
If you ever want to find out more about a bubble, just hover over it and a tooltip should appear.<br><br>
(Data was provided by FiveThirtyEight, and originally sourced from the American Community Survey 2010-2012 Public Use Microdata Series)
</p>
</section>
<section class="step">
<p>
Here, we have clustered the majors based on the broader category, of which there are 16 in total. The size
of the bubbles represent the median salary of graduates from the major.
When sorted like this, it's quite clear that engineering majors of all kinds have generally above-average median salaries. <br><br>
On the other end, it appears that majors in the field of psychology on average have the lowest graduate salaries. <br>
</p>
<svg id = 'legend' width = '400px' height = '500px'></svg>
</section>
<section class = 'step'>
<svg id = 'legend2' width = '400px' height = '450px'></svg><br><br>
Bear in mind that some of these figures may suffer from small sample sizes. If you hover over a bubble, you can see additional information,
including the number of students enrolled in a given major. Salary figures from degrees with lower
enrolment may be less accurate due to the smaller pool of student respondents
</section>
<section class="step">
<br><br><br><br><br><br>
<p>
If we rearrange all the data points into a histogram format, the salary potential of engineering majors becomes
even more stark, as almost all the points on the right of the graph are colored yellow, for engineering. As for all the
other majors, they follow a fairly diverse yet tightly spaced distribution, with the modal class being
salaries between $34,000 and $36,000.
</p>
</section>
<section class="step">
<p>
<h2>Does Gender Influence Chosen Majors?</h2>
Now what if we took those same categories, but coloured them based on the proportion of the students which are male or female?
In this chart, blue represents majors with > 60% male, and red represents > 60% female, and the grey bubbles represent the more gender
balanced courses.
<br><br>(Hover over the labels if you've forgotten the category)<br><br>
What is striking about this graphic is that almost every category grouping of majors are either decidedly more female-weighted or male-weighted,
with the exception of perhaps the business and physical sciences majors.
</p>
</section>
<section class="step">
When we plot the % of students in a major being female against the median salary of students in the major, a fairly clear trend emerges.
It appears that majors with a higher proportion of male students also produce students with higher median wages. <br><br> In fact, a linear model
would predict that for every added percentage of female students in a given major, the median annual salary drops by $306 USD.
</section>
<section class="step">
So we've seen the most 'profitable' majors, as well as the ones with the most uneven gender distributions. But what are students
actually enrolling in the most frequently? What can enrolment numbers tell us about actual interest in each major? This chart has the bubbles
sized based on the number of students enrolled in each major, and coloured by category.
<svg id = 'legend3' width = '400px' height = '350px'></svg>
Psychology is the clear leader in this regard, with over 390,000 students enrolled. Business related topics such as general business, business management,
accounting and finance are all also heavily enrolled.
</section>
<section class="step">
<h1>The End</h1>
<p>
Hopefully, this has helped you in deciding what major you hope to study. If you want to take a deeper look into the data for yourself, you can download
all the csv files <a href = 'https://www.kaggle.com/fivethirtyeight/fivethirtyeight-college-majors-dataset'>here</a>.
<br><br>
Special thanks to Jim Vallandingham for his article on <a href = 'https://vallandingham.me/scroller.html'>creating scrolling visualisations using D3.js</a>. All
of the code associated with this project can be found on its <a href = 'https://github.com/cuthchow/college-majors-visualisation'>Github page</a>.
<br><br>
I've also produced a full write-up of how I made this <a href = 'https://towardsdatascience.com/how-i-created-an-interactive-scrolling-visualisation-with-d3-js-and-how-you-can-too-e116372e2c73'>over at my blog</a>.
</p>
<span></span><span></span><span></span>
</section>
</div>
<div id="vis">
</div>
</div>
<script src = 'scroller.js'></script>
<script src = 'sections.js'></script>
<script>
// Automatic Slideshow - change image every 4 seconds
var myIndex = 0;
carousel();
function carousel() {
var i;
var x = document.getElementsByClassName("mySlides");
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
myIndex++;
if (myIndex > x.length) {myIndex = 1}
x[myIndex-1].style.display = "block";
setTimeout(carousel, 4000);
}
// Used to toggle the menu on small screens when clicking on the menu button
function myFunction() {
var x = document.getElementById("navDemo");
if (x.className.indexOf("w3-show") == -1) {
x.className += " w3-show";
} else {
x.className = x.className.replace(" w3-show", "");
}
}
// When the user clicks anywhere outside of the modal, close it
var modal = document.getElementById('ticketModal');
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
</script>
</body>
<footer class="w3-container w3-padding-64 w3-center w3-opacity w3-light-grey w3-xlarge">
<i class="fa fa-facebook-official w3-hover-opacity"></i>
<i class="fa fa-instagram w3-hover-opacity"></i>
<i class="fa fa-snapchat w3-hover-opacity"></i>
<i class="fa fa-pinterest-p w3-hover-opacity"></i>
<i class="fa fa-twitter w3-hover-opacity"></i>
<i class="fa fa-linkedin w3-hover-opacity"></i>
<p class="w3-medium">Transport To Tarradiddle <a href="https://www.oftarradiddle.github.io" target="_blank">w3.css</a></p>
</footer>
</html>