Skip to content

Instantly share code, notes, and snippets.

@arfon
Last active August 29, 2015 13:55
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 arfon/8786799 to your computer and use it in GitHub Desktop.
Save arfon/8786799 to your computer and use it in GitHub Desktop.
Ember.js PR merge fraction

Fraction of pull requests to Ember.js merged over time (grouped by month). The size of the dot is proportional to the number of pull requests in that time period (mouseover to see the count).

Data pulled from the GitHub API:

date unix_date merged_count not_merged_count count merge_fraction
2011-05-23 1306108800000 1 1 2 0.5
2011-05-30 1306713600000 5 0 5 1.0
2011-06-06 1307318400000 0 1 1 0.0
2011-06-13 1307923200000 3 1 4 0.75
2011-06-20 1308528000000 8 3 11 0.7272727272727273
2011-06-27 1309132800000 7 4 11 0.6363636363636364
2011-07-04 1309737600000 3 1 4 0.75
2011-07-11 1310342400000 5 6 11 0.45454545454545453
2011-07-18 1310947200000 7 1 8 0.875
2011-07-25 1311552000000 5 1 6 0.8333333333333334
2011-08-01 1312156800000 1 1 2 0.5
2011-08-08 1312761600000 3 3 6 0.5
2011-08-15 1313366400000 2 0 2 1.0
2011-08-29 1314576000000 1 2 3 0.3333333333333333
2011-09-05 1315180800000 0 1 1 0.0
2011-09-12 1315785600000 2 1 3 0.6666666666666666
2011-09-19 1316390400000 1 1 2 0.5
2011-09-26 1316995200000 0 3 3 0.0
2011-10-03 1317600000000 1 1 2 0.5
2011-10-10 1318204800000 2 0 2 1.0
2011-10-17 1318809600000 4 0 4 1.0
2011-10-24 1319414400000 1 1 2 0.5
2011-10-31 1320019200000 1 3 4 0.25
2011-11-07 1320624000000 3 1 4 0.75
2011-11-14 1321228800000 5 0 5 1.0
2011-11-28 1322438400000 5 1 6 0.8333333333333334
2011-12-05 1323043200000 9 3 12 0.75
2011-12-12 1323648000000 9 6 15 0.6
2011-12-19 1324252800000 10 3 13 0.7692307692307693
2011-12-26 1324857600000 8 6 14 0.5714285714285714
2012-01-02 1325462400000 16 5 21 0.7619047619047619
2012-01-09 1326067200000 12 9 21 0.5714285714285714
2012-01-16 1326672000000 7 3 10 0.7
2012-01-23 1327276800000 6 4 10 0.6
2012-01-30 1327881600000 2 1 3 0.6666666666666666
2012-02-06 1328486400000 1 1 2 0.5
2012-02-13 1329091200000 11 2 13 0.8461538461538461
2012-02-20 1329696000000 11 5 16 0.6875
2012-02-27 1330300800000 6 1 7 0.8571428571428571
2012-03-05 1330905600000 2 6 8 0.25
2012-03-12 1331510400000 6 0 6 1.0
2012-03-19 1332115200000 7 4 11 0.6363636363636364
2012-03-26 1332720000000 10 1 11 0.9090909090909091
2012-04-02 1333324800000 9 1 10 0.9
2012-04-09 1333929600000 5 3 8 0.625
2012-04-16 1334534400000 14 5 19 0.7368421052631579
2012-04-23 1335139200000 5 4 9 0.5555555555555556
2012-04-30 1335744000000 10 6 16 0.625
2012-05-07 1336348800000 4 3 7 0.5714285714285714
2012-05-14 1336953600000 12 4 16 0.75
2012-05-21 1337558400000 22 11 33 0.6666666666666666
2012-05-28 1338163200000 17 6 23 0.7391304347826086
2012-06-04 1338768000000 16 10 26 0.6153846153846154
2012-06-11 1339372800000 8 7 15 0.5333333333333333
2012-06-18 1339977600000 11 4 15 0.7333333333333333
2012-06-25 1340582400000 13 6 19 0.6842105263157895
2012-07-02 1341187200000 6 4 10 0.6
2012-07-09 1341792000000 14 3 17 0.8235294117647058
2012-07-16 1342396800000 9 5 14 0.6428571428571429
2012-07-23 1343001600000 3 2 5 0.6
2012-07-30 1343606400000 2 2 4 0.5
2012-08-06 1344211200000 15 4 19 0.7894736842105263
2012-08-13 1344816000000 8 6 14 0.5714285714285714
2012-08-20 1345420800000 8 4 12 0.6666666666666666
2012-08-27 1346025600000 6 0 6 1.0
2012-09-03 1346630400000 3 1 4 0.75
2012-09-10 1347235200000 7 3 10 0.7
2012-09-17 1347840000000 4 2 6 0.6666666666666666
2012-09-24 1348444800000 4 1 5 0.8
2012-10-01 1349049600000 3 1 4 0.75
2012-10-08 1349654400000 2 1 3 0.6666666666666666
2012-10-15 1350259200000 17 7 24 0.7083333333333334
2012-10-22 1350864000000 6 4 10 0.6
2012-10-29 1351468800000 6 5 11 0.5454545454545454
2012-11-05 1352073600000 2 1 3 0.6666666666666666
2012-11-12 1352678400000 4 5 9 0.4444444444444444
2012-11-19 1353283200000 1 2 3 0.3333333333333333
2012-11-26 1353888000000 0 1 1 0.0
2012-12-03 1354492800000 7 4 11 0.6363636363636364
2012-12-10 1355097600000 3 1 4 0.75
2012-12-17 1355702400000 3 4 7 0.42857142857142855
2012-12-24 1356307200000 4 2 6 0.6666666666666666
2012-12-31 1356912000000 20 11 31 0.6451612903225806
2013-01-07 1357516800000 24 10 34 0.7058823529411765
2013-01-14 1358121600000 9 5 14 0.6428571428571429
2013-01-21 1358726400000 23 11 34 0.6764705882352942
2013-01-28 1359331200000 22 7 29 0.7586206896551724
2013-02-04 1359936000000 12 5 17 0.7058823529411765
2013-02-11 1360540800000 24 9 33 0.7272727272727273
2013-02-18 1361145600000 11 8 19 0.5789473684210527
2013-02-25 1361750400000 18 8 26 0.6923076923076923
2013-03-04 1362355200000 22 8 30 0.7333333333333333
2013-03-11 1362960000000 15 3 18 0.8333333333333334
2013-03-18 1363564800000 21 9 30 0.7
2013-03-25 1364169600000 15 7 22 0.6818181818181818
2013-04-01 1364774400000 12 5 17 0.7058823529411765
2013-04-08 1365379200000 29 11 40 0.725
2013-04-15 1365984000000 33 5 38 0.868421052631579
2013-04-22 1366588800000 36 6 42 0.8571428571428571
2013-04-29 1367193600000 31 1 32 0.96875
2013-05-06 1367798400000 11 7 18 0.6111111111111112
2013-05-13 1368403200000 22 3 25 0.88
2013-05-20 1369008000000 22 6 28 0.7857142857142857
2013-05-27 1369612800000 17 4 21 0.8095238095238095
2013-06-03 1370217600000 13 2 15 0.8666666666666667
2013-06-10 1370822400000 14 5 19 0.7368421052631579
2013-06-17 1371427200000 17 4 21 0.8095238095238095
2013-06-24 1372032000000 24 3 27 0.8888888888888888
2013-07-01 1372636800000 19 3 22 0.8636363636363636
2013-07-08 1373241600000 10 8 18 0.5555555555555556
2013-07-15 1373846400000 21 2 23 0.9130434782608695
2013-07-22 1374451200000 10 3 13 0.7692307692307693
2013-07-29 1375056000000 16 7 23 0.6956521739130435
2013-08-05 1375660800000 12 6 18 0.6666666666666666
2013-08-12 1376265600000 12 1 13 0.9230769230769231
2013-08-19 1376870400000 15 4 19 0.7894736842105263
2013-08-26 1377475200000 50 15 65 0.7692307692307693
2013-09-02 1378080000000 33 8 41 0.8048780487804879
2013-09-09 1378684800000 23 13 36 0.6388888888888888
2013-09-16 1379289600000 15 0 15 1.0
2013-09-23 1379894400000 16 2 18 0.8888888888888888
2013-09-30 1380499200000 22 3 25 0.88
2013-10-07 1381104000000 16 8 24 0.6666666666666666
2013-10-14 1381708800000 23 0 23 1.0
2013-10-21 1382313600000 20 4 24 0.8333333333333334
2013-10-28 1382918400000 13 2 15 0.8666666666666667
2013-11-04 1383523200000 13 4 17 0.7647058823529411
2013-11-11 1384128000000 17 5 22 0.7727272727272727
2013-11-18 1384732800000 19 3 22 0.8636363636363636
2013-11-25 1385337600000 11 7 18 0.6111111111111112
2013-12-02 1385942400000 28 9 37 0.7567567567567568
2013-12-09 1386547200000 28 6 34 0.8235294117647058
2013-12-16 1387152000000 30 3 33 0.9090909090909091
2013-12-23 1387756800000 10 5 15 0.6666666666666666
2013-12-30 1388361600000 49 2 51 0.9607843137254902
2014-01-06 1388966400000 19 11 30 0.6333333333333333
2014-01-13 1389571200000 15 10 25 0.6
2014-01-20 1390176000000 24 9 33 0.7272727272727273
2014-01-27 1390780800000 22 11 33 0.6666666666666666
2014-02-03 1391385600000 0 1 1 0.0
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 12px sans-serif;
}
.axis path,
.axis line {
fill: none;
stroke: #000;
shape-rendering: crispEdges;
}
.dot {
stroke: red;
fill: red;
}
h1{
padding-left:25px;
}
</style>
<body>
<script src="http://d3js.org/d3.v3.js"></script>
<script>
var margin = {top: 20, right: 20, bottom: 30, left: 50},
width = 960 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
var parseDate = d3.time.format("%Y-%m-%d").parse;
var x = d3.time.scale()
.range([0, width]);
var y = d3.scale.linear()
.range([height, 0]);
var xAxis = d3.svg.axis()
.scale(x)
.orient("bottom");
var yAxis = d3.svg.axis()
.scale(y)
.orient("left");
var svg = d3.select("body").append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
d3.tsv("ember_merge_fraction.tsv", function(error, data) {
data.forEach(function(d) {
d.date = parseDate(d.date);
d.unix_date = +d.unix_date;
d.merged_count = +d.merged_count;
d.not_merged_count = +d.not_merged_count;
d.count = +d.count;
d.merge_fraction = +d.merge_fraction;
});
x.domain(d3.extent(data, function(d) { return d.date; }));
y.domain(d3.extent(data, function(d) { return d.merge_fraction; }));
var median_pull_count = d3.median(data, function(d) { return d.count; });
svg.append("g")
.attr("class", "x axis")
.attr("transform", "translate(0," + height + ")")
.call(xAxis);
svg.append("g")
.attr("class", "y axis")
.call(yAxis)
.append("text")
.attr("transform", "rotate(-90)")
.attr("y", 6)
.attr("dy", ".71em")
.style("text-anchor", "end")
.text("Merge fraction");
svg.selectAll(".dot")
.data(data)
.enter().append("circle")
.attr("class", "dot")
.attr("r", function(d) { return 3 * d.count/median_pull_count; })
.attr("cx", function(d) { return x(d.date); })
.attr("cy", function(d) { return y(d.merge_fraction); })
.append("svg:title")
.text(function(d) { return d.count; });
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment