Skip to content

Instantly share code, notes, and snippets.

@sajudson
Last active September 23, 2017 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sajudson/159113faca3611883a34bdaf460c020a to your computer and use it in GitHub Desktop.
Save sajudson/159113faca3611883a34bdaf460c020a to your computer and use it in GitHub Desktop.
CS Degrees Awarded 1971-2011
license: mit

This shows total number of bachelors, masters, and doctoral degrees in computer science (and related fields) awarded each year between 1971 and 2011.

The data comes from National Center for Education Statistics - Table 349. The table shows the number of bachelors, masters, amd doctoral degrees awarde to men and women.

Data set file (in MS Excel format) can be found here Original data set was reformated (unstacked) in excel to facilitate visualization.

ORIGINAL DATA SOURCE: U.S. Department of Education, National Center for Education Statistics, Higher Education General Information Survey (HEGIS), "Degrees and Other Formal Awards Conferred" surveys, 1970-71 through 1985-86; Integrated Postsecondary Education Data System (IPEDS), "Completions Survey" (IPEDS-C:87-99); and IPEDS Fall 2000 through Fall 2011, Completions component. (This table was prepared July 2012.)

forked from curran's block: Stylized Scatter Plot with Color Legend

forked from sajudson's block: Women in Comp Sci

Year Degree Men Women
1971 BS 2064 324
1972 BS 2941 461
1973 BS 3664 640
1974 BS 3976 780
1975 BS 4080 953
1976 BS 4534 1118
1977 BS 4876 1531
1978 BS 5349 1852
1979 BS 6272 2447
1980 BS 7782 3372
1981 BS 10202 4919
1982 BS 13218 7049
1983 BS 15641 8924
1984 BS 20416 12023
1985 BS 24737 14384
1986 BS 27208 15129
1987 BS 25962 13805
1988 BS 23414 11237
1989 BS 21143 9417
1990 BS 19159 8188
1991 BS 17771 7388
1992 BS 17685 7136
1993 BS 17606 6913
1994 BS 17528 6999
1995 BS 17684 7053
1996 BS 17757 6749
1997 BS 18527 6895
1998 BS 20372 7457
1999 BS 22289 8263
2000 BS 27185 10603
2001 BS 31923 12219
2002 BS 36462 13903
2003 BS 41950 15483
2004 BS 44585 14903
2005 BS 42125 11986
2006 BS 37705 9775
2007 BS 34342 7828
2008 BS 31694 6782
2009 BS 31215 6779
2010 BS 32410 7179
2011 BS 35478 7594
1971 MS 1424 164
1972 MS 1752 225
1973 MS 1888 225
1974 MS 1983 293
1975 MS 1961 338
1976 MS 2226 377
1977 MS 2332 466
1978 MS 2471 567
1979 MS 2480 575
1980 MS 2883 764
1981 MS 3247 971
1982 MS 3625 1310
1983 MS 3813 1508
1984 MS 4379 1811
1985 MS 5064 2037
1986 MS 5658 2412
1987 MS 5985 2496
1988 MS 6726 2471
1989 MS 6775 2639
1990 MS 6960 2717
1991 MS 6563 2761
1992 MS 6980 2675
1993 MS 7557 2796
1994 MS 7836 2732
1995 MS 7805 2790
1996 MS 7729 2850
1997 MS 7526 2987
1998 MS 8343 3422
1999 MS 8866 3977
2000 MS 9978 5012
2001 MS 11195 5716
2002 MS 11447 5726
2003 MS 13267 6242
2004 MS 13868 6275
2005 MS 13136 5280
2006 MS 12470 4585
2007 MS 11985 4247
2008 MS 12513 4574
2009 MS 13063 4844
2010 MS 13017 4936
2011 MS 13956 5490
1971 PhD 125 3
1972 PhD 155 12
1973 PhD 181 15
1974 PhD 189 9
1975 PhD 199 14
1976 PhD 221 23
1977 PhD 197 19
1978 PhD 181 15
1979 PhD 206 30
1980 PhD 213 27
1981 PhD 227 25
1982 PhD 230 21
1983 PhD 228 34
1984 PhD 225 26
1985 PhD 223 25
1986 PhD 299 45
1987 PhD 322 52
1988 PhD 380 48
1989 PhD 466 85
1990 PhD 534 93
1991 PhD 584 92
1992 PhD 669 103
1993 PhD 689 116
1994 PhD 685 125
1995 PhD 726 161
1996 PhD 743 126
1997 PhD 721 136
1998 PhD 718 140
1999 PhD 656 150
2000 PhD 648 131
2001 PhD 632 136
2002 PhD 581 171
2003 PhD 648 168
2004 PhD 709 200
2005 PhD 905 214
2006 PhD 1109 307
2007 PhD 1267 328
2008 PhD 1323 375
2009 PhD 1226 354
2010 PhD 1250 349
2011 PhD 1267 321
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3-legend/2.24.0/d3-legend.min.js"></script>
<title>Women in Computer Science: Degrees Awarded 1971-2011</title>
<style>
body {
margin: 0px;
}
.domain {
display: none;
}
.tick line {
stroke: #C0C0BB;
}
.tick text, .legendCells text {
fill: #8E8883;
font-size: 8pt;
font-family: sans-serif;
}
.axis-label, .legend-label {
fill: #635F5D;
font-size: 12pt;
font-family: sans-serif;
}
</style>
</head>
<body>
<svg width="960" height="500"></svg>
<script>
const xValue = d => d.Year;
const xLabel = 'Year';
const fValue = d => (d.Women / d.Men);
const yValue = d => (d.Women +d.Men);
const yLabel = 'Degrees Awarded';
//const xValue = d => d.Year;
//const xLabel = 'Year';
///onst yValue = d => d.Men + d.Women;
//const y2Value = d => d.Men;
//const y3Value = d => d.Women;
//const yLabel = 'CS Degrees Awarded';
const colorValue = d => d.Degree;
const colorLabel = 'Degree';
const margin = { left: 120, right: 300, top: 20, bottom: 120 };
const svg = d3.select('svg');
const width = svg.attr('width');
const height = svg.attr('height');
const innerWidth = width - margin.left - margin.right;
const innerHeight = height - margin.top - margin.bottom;
const g = svg.append('g')
.attr('transform', `translate(${margin.left},${margin.top})`);
const xAxisG = g.append('g')
.attr('transform', `translate(0, ${innerHeight})`);
const yAxisG = g.append('g');
const colorLegendG = g.append('g')
.attr('transform', `translate(${innerWidth + 60}, 150)`);
xAxisG.append('text')
.attr('class', 'axis-label')
.attr('x', innerWidth / 2)
.attr('y', 75)
.text(xLabel);
yAxisG.append('text')
.attr('class', 'axis-label')
.attr('x', -innerHeight / 2)
.attr('y', -60)
.attr('transform', `rotate(-90)`)
.style('text-anchor', 'middle')
.text(yLabel);
colorLegendG.append('text')
.attr('class', 'legend-label')
.attr('x', -30)
.attr('y', -40)
.text(colorLabel);
const xScale = d3.scaleLinear();
const yScale = d3.scaleLinear();
const rScale = d3.scaleSqrt();
const colorScale = d3.scaleOrdinal()
.range(d3.schemeCategory10);
const xAxis = d3.axisBottom()
.scale(xScale)
.tickPadding(15)
.tickFormat(d3.format('0'))
.tickSize(-innerHeight);
const yAxis = d3.axisLeft()
.scale(yScale)
.ticks(5)
.tickPadding(15)
.tickSize(-innerWidth);
const colorLegend = d3.legendColor()
.scale(colorScale)
.shape('rect');
const row = d => {
d.Men = +d.Men;
d.Women = +d.Women;
d.Year = +d.Year;
return d;
};
d3.csv("dataCS.csv", row, data => {
xScale
.domain(d3.extent(data, xValue))
.range([0, innerWidth])
.nice();
yScale
.domain(d3.extent(data, yValue))
.range([innerHeight, 0])
.nice();
g.selectAll('rect').data(data)
.enter().append('rect')
.attr('x', d => xScale(xValue(d)))
.attr('y', d => yScale(yValue(d)))
.attr('fill', d => colorScale(colorValue(d)))
.attr('fill-opacity', .75)
.attr('height', 10)
.attr('width', 10);
xAxisG.call(xAxis);
yAxisG.call(yAxis);
colorLegendG.call(colorLegend)
.selectAll('.cell text')
.attr('dy', '0.1em');
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment