Skip to content

Instantly share code, notes, and snippets.

@Visgean
Last active January 18, 2016 11:26
Show Gist options
  • Save Visgean/af9224cc63a46d47c13b to your computer and use it in GitHub Desktop.
Save Visgean/af9224cc63a46d47c13b to your computer and use it in GitHub Desktop.
date commits
2014-08-29 7
2013-07-21 1
2013-02-08 2
2015-05-14 12
2013-10-09 3
2013-04-29 4
2014-05-27 18
2014-11-05 3
2013-04-05 44
2015-07-27 26
2014-08-24 6
2015-07-06 6
2015-04-28 1
2013-02-22 6
2012-12-05 2
2015-06-30 20
2013-11-25 2
2014-05-13 18
2014-01-20 8
2013-06-16 4
2013-08-10 7
2015-12-08 14
2011-07-01 4
2013-12-30 1
2014-02-10 22
2015-07-15 5
2015-04-22 21
2013-12-07 3
2014-06-13 8
2013-09-09 1
2012-09-10 5
2015-07-02 7
2011-07-03 1
2014-01-18 2
2015-07-14 2
2015-06-28 2
2014-03-10 1
2013-11-28 1
2015-05-23 12
2013-03-09 3
2015-05-24 10
2013-08-12 11
2014-10-17 13
2014-03-25 6
2014-04-19 11
2013-06-23 4
2014-11-07 10
2014-04-22 21
2011-04-10 4
2013-04-17 21
2013-04-16 21
2015-03-16 2
2014-01-21 2
2013-09-06 2
2014-02-16 5
2015-08-19 12
2013-03-26 2
2014-11-28 8
2015-04-05 4
2015-04-03 1
2015-08-10 14
2013-12-26 2
2015-01-07 4
2015-07-16 3
2015-04-24 13
2014-09-25 2
2015-06-15 17
2013-11-10 3
2015-03-26 12
2012-07-15 8
2012-09-06 3
2014-03-30 5
2015-09-10 10
2015-05-02 1
2014-05-01 8
2013-10-10 1
2015-02-11 1
2014-08-05 6
2011-05-23 1
2012-10-03 3
2013-05-02 2
2014-11-03 1
2014-10-23 17
2015-06-14 3
2015-04-02 14
2013-06-25 2
2013-07-28 17
2011-10-27 1
2014-11-01 1
2013-04-04 20
2015-05-03 12
2014-01-13 2
2015-09-22 7
2012-08-10 3
2014-05-18 5
2012-07-24 1
2013-02-10 3
2013-06-02 9
2013-03-23 6
2013-02-17 1
2014-04-02 3
2015-06-03 17
2015-03-17 27
2014-03-24 2
2012-10-28 2
2013-10-22 5
2013-11-18 6
2013-10-23 2
2014-05-03 7
2013-03-15 2
2013-10-05 1
2013-06-30 3
2014-05-29 6
2013-08-31 10
2013-03-18 1
2015-09-21 10
2015-04-07 1
2015-06-01 1
2014-12-01 5
2015-09-02 6
2014-11-04 2
2013-01-27 1
2014-11-09 3
2013-02-18 5
2013-05-23 2
2014-04-28 13
2015-07-12 4
2014-05-22 12
2014-11-02 2
2014-01-19 9
2015-07-18 10
2015-11-16 2
2014-10-04 3
2012-08-16 3
2014-04-10 1
2013-09-10 4
2011-04-09 1
2015-10-26 6
2015-12-21 7
2015-07-07 8
2015-07-29 6
2015-10-05 3
2014-02-14 6
2015-05-21 1
2015-07-09 3
2013-04-03 12
2015-05-19 1
2011-05-15 3
2013-04-12 5
2013-05-13 11
2013-03-22 7
2014-07-28 1
2015-10-11 1
2015-10-20 4
2014-01-14 8
2013-07-08 10
2013-03-24 5
2015-05-11 5
2013-12-01 3
2014-11-08 11
2013-08-29 19
2014-09-18 4
2015-08-04 12
2015-04-21 19
2011-05-16 1
2015-06-25 4
2013-07-26 19
2014-11-19 6
2015-12-26 6
2014-11-25 4
2012-10-25 14
2014-01-04 2
2014-04-27 5
2014-02-05 8
2015-04-15 11
2013-10-08 1
2012-01-19 1
2013-06-26 8
2013-09-03 3
2013-12-06 2
2015-04-19 1
2015-09-24 8
2014-05-26 4
2015-11-09 8
2015-08-17 3
2013-04-24 7
2015-06-26 5
2012-09-26 1
2013-02-27 4
2015-10-15 5
2014-02-03 26
2014-11-24 10
2014-02-04 7
2013-07-23 21
2015-11-23 7
2015-02-12 6
2014-09-10 5
2013-07-17 2
2012-08-27 3
2014-04-01 2
2012-10-16 1
2012-12-03 1
2015-06-24 4
2013-03-20 2
2014-01-23 1
2013-03-25 10
2013-02-06 1
2013-04-13 33
2012-10-23 1
2015-01-26 5
2013-06-20 2
2013-04-28 4
2015-12-13 4
2014-04-17 29
2013-06-22 6
2015-03-24 2
2013-06-04 1
2015-04-09 16
2013-01-11 1
2013-05-20 4
2014-09-03 1
2014-10-27 12
2014-09-06 1
2014-05-10 3
2015-07-13 8
2015-09-09 10
2013-05-22 11
2013-07-04 4
2011-08-10 3
2015-07-10 13
2014-06-11 2
2015-03-20 2
2015-08-26 7
2015-07-01 8
2015-12-16 1
2012-11-01 2
2014-01-16 4
2014-01-28 2
2015-08-13 6
2015-06-16 13
2012-10-15 2
2015-06-13 1
2014-05-15 5
2013-07-09 2
2014-02-23 1
2013-10-03 3
2015-09-18 21
2015-06-22 8
2011-05-18 5
2013-04-11 8
2015-04-04 1
2013-06-18 2
2015-06-20 6
2013-08-09 3
2015-06-02 10
2014-09-04 12
2015-12-25 2
2013-08-21 13
2013-03-21 2
2014-02-17 16
2015-08-24 2
2012-10-11 1
2013-07-30 4
2014-03-28 1
2015-11-19 4
2013-11-15 1
2013-07-01 9
2013-03-31 3
2013-05-09 4
2011-07-20 2
2013-09-08 3
2015-10-19 6
2012-08-09 4
2015-05-04 6
2014-01-12 1
2013-07-22 11
2013-05-21 1
2013-08-15 6
2015-12-22 9
2014-05-16 2
2015-02-09 2
2013-06-29 9
2014-11-27 3
2015-04-06 2
2014-07-27 6
2015-11-25 17
2013-11-07 4
2014-09-16 2
2015-05-09 16
2014-01-22 5
2015-08-08 9
2015-11-24 9
2015-04-23 31
2014-05-31 1
2012-07-23 1
2013-09-04 1
2015-10-21 4
2013-07-15 17
2012-08-05 2
2015-08-31 5
2014-04-29 14
2014-10-01 5
2015-08-14 6
2015-07-28 14
2013-12-21 2
2015-04-27 3
2013-12-11 7
2014-09-19 1
2014-02-19 5
2015-05-13 24
2015-11-29 6
2014-10-20 5
2015-01-15 2
2015-06-05 1
2014-10-29 1
2015-02-03 7
2015-07-30 6
2015-11-18 1
2014-02-02 18
2013-07-16 2
2015-02-17 1
2015-03-29 3
2015-12-10 11
2015-03-13 12
2014-02-11 7
2013-04-01 3
2015-08-03 7
2015-08-28 14
2013-07-29 5
2014-10-06 6
2013-10-20 1
2013-10-24 1
2013-05-29 9
2013-08-16 1
2012-07-30 1
2015-09-01 8
2014-10-22 11
2015-06-09 2
2015-07-24 23
2014-10-30 12
2011-03-27 2
2013-11-24 3
2015-01-12 1
2013-06-21 2
2015-03-14 18
2012-10-18 1
2014-04-24 5
2012-07-26 2
2015-07-21 3
2014-04-14 6
2014-09-29 2
2013-07-25 10
2015-09-30 4
2013-07-03 3
2015-05-12 7
2014-02-25 4
2012-12-10 1
2013-11-12 9
2014-08-27 1
2014-05-04 3
2015-07-31 7
2014-09-22 7
2015-10-08 7
2013-07-10 8
2015-05-15 5
2014-04-09 4
2014-07-02 1
2012-07-14 4
2015-06-17 6
2012-07-17 3
2013-07-24 1
2014-10-13 12
2015-07-23 1
2014-12-23 1
2013-11-03 2
2014-05-11 2
2015-11-28 3
2013-05-27 1
2013-11-20 19
2015-02-16 4
2015-04-25 9
2014-09-08 6
2014-09-02 3
2013-03-17 3
2012-11-12 1
2014-11-23 2
2014-11-22 7
2014-09-11 6
2015-08-21 3
2014-05-21 2
2013-08-03 1
2015-11-13 1
2014-01-15 2
2013-03-10 6
2013-08-11 22
2015-08-02 13
2014-01-27 2
2013-03-30 17
2015-06-29 10
2014-10-16 9
2013-05-07 1
2015-04-10 10
2014-10-14 2
2014-04-04 2
2013-07-11 1
2015-08-12 11
2014-02-09 1
2015-09-03 1
2014-12-10 2
2015-10-09 2
2013-11-14 1
2013-07-12 9
2012-08-22 6
2015-12-02 22
2013-08-08 6
2013-12-19 1
2013-09-02 2
2015-02-08 3
2014-05-02 5
2015-12-11 13
2013-08-25 2
2013-10-31 7
2013-08-01 4
2015-11-10 4
2013-12-31 1
2015-08-05 17
2015-09-07 10
2015-09-17 16
2015-07-25 4
2012-10-02 13
2013-12-04 13
2014-05-09 9
2013-12-03 2
2013-04-30 3
2013-01-09 3
2012-07-25 2
2015-08-22 6
2013-03-06 6
2012-10-24 2
2015-07-05 23
2013-08-22 4
2013-02-05 2
2013-11-29 1
2013-11-27 4
2015-09-04 4
2013-11-08 5
2014-04-08 12
2015-08-06 15
2013-04-08 9
2014-06-17 1
2015-09-11 12
2015-10-14 6
2014-08-04 1
2014-10-31 23
2015-09-16 4
2013-03-19 7
2013-08-14 7
2015-10-24 4
2013-10-01 3
2014-01-08 3
2013-05-28 2
2014-05-12 5
2015-05-22 23
2015-11-26 11
2013-12-12 2
2013-12-17 18
2013-04-02 6
2012-08-12 1
2013-12-09 12
2013-03-28 4
2014-02-15 1
2015-06-07 5
2013-07-06 1
2014-02-21 2
2015-10-03 1
2015-10-22 13
2014-08-19 3
2014-03-26 2
2013-05-12 4
2014-10-15 5
2014-01-06 3
2013-05-10 2
2013-03-11 3
2013-04-06 30
2012-09-03 32
2014-09-17 2
2013-11-17 6
2013-12-10 12
2015-10-27 10
2015-08-07 3
2013-11-06 2
2015-12-04 3
2012-06-19 7
2012-07-16 10
2013-08-20 22
2015-03-18 1
2012-12-30 1
2014-09-07 2
2015-07-03 7
2012-09-28 9
2015-08-25 5
2012-07-27 3
2014-10-08 9
2011-05-13 2
2014-04-20 12
2015-07-20 7
2014-08-07 2
2015-07-22 8
2015-07-26 42
2015-04-01 2
2014-07-26 4
2014-05-08 1
2014-08-26 3
2014-02-18 4
2013-12-18 6
2015-01-27 2
2015-11-30 21
2014-04-03 3
2013-04-10 6
2013-07-02 7
2015-08-11 8
2013-01-10 1
2013-06-28 7
2014-10-12 2
2014-01-29 3
2013-04-07 12
2014-08-22 2
2012-07-20 1
2015-04-26 4
2015-10-12 15
2012-07-22 1
2013-12-23 6
2014-04-21 2
2014-04-23 5
2015-12-09 5
2015-06-08 8
2014-07-22 1
2014-11-10 22
2014-08-25 10
2015-06-06 13
2013-02-04 2
2014-07-25 2
2013-08-13 7
2013-09-07 5
2014-04-18 23
2015-07-08 14
2015-04-20 10
2013-08-30 5
2013-07-31 2
2013-08-23 4
2014-10-24 9
2015-10-01 6
2014-06-09 1
2013-12-08 6
2013-04-09 12
2014-09-12 2
2012-03-07 1
2015-06-12 24
2011-07-13 1
2014-02-20 17
2015-07-19 23
2015-10-06 6
2015-12-01 8
2015-03-07 3
2014-08-21 3
2014-01-30 2
2014-01-11 3
2015-09-14 6
2013-04-26 2
2013-07-19 10
2015-06-18 24
2015-07-17 5
2014-02-13 9
2014-11-12 7
2015-11-12 7
2014-08-23 4
2015-05-05 7
2013-04-15 15
2013-09-29 2
2015-12-23 7
2014-03-06 3
2013-05-01 8
2013-01-13 2
2013-11-02 4
2011-05-10 8
2015-10-13 2
2014-04-13 3
2015-12-07 36
2013-09-30 5
2013-02-20 1
2013-11-19 2
2013-08-02 1
2015-09-23 8
2015-05-28 9
2015-10-07 1
2015-05-27 5
2013-07-27 5
2014-09-23 3
2013-04-14 5
2013-05-08 2
2012-08-23 1
2013-03-16 3
2014-11-14 3
2012-12-04 1
2014-09-15 5
2015-08-18 1
2015-11-02 3
2013-08-07 2
2014-07-17 1
2013-11-30 1
2013-03-29 6
2013-02-13 2
2015-05-25 7
2013-11-21 6
2015-07-11 1
2015-01-22 4
2013-04-23 4
2014-05-19 4
2013-07-07 4
2013-06-01 15
2012-08-15 1
2013-05-30 15
2013-10-27 5
2014-06-10 3
2014-11-26 1
2014-07-14 1
2013-04-18 22
2012-09-27 1
2014-06-02 5
2012-06-20 2
2015-06-19 17
2014-06-03 4
2015-09-08 7
2013-11-13 1
2014-08-30 4
2011-06-12 1
2015-03-25 3
2014-09-30 4
2015-09-15 8
2015-10-31 1
2015-09-29 5
2013-04-21 2
2015-11-11 16
2015-12-03 12
2014-06-05 4
2014-11-17 4
2015-04-29 5
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Commit stats</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<h1><a href='https://github.com/Visgean/commitstats'>Commitstats for Visgean</a></h1>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.12/d3.js"></script>
<script src="main.js"></script>
</body>
</html>
body {
font: 10px sans-serif;
shape-rendering: crispEdges;
}
.day {
fill: #eeeeee;
stroke: #ccc;
}
.month {
fill: none;
stroke: rgba(0, 0, 0, 0.6);
}
.label {
}
/* Intensity definitions */
.year .intensity0 {
fill: #d6e685;
}
.year .intensity1 {
fill: #8cc665;
}
.year .intensity2 {
fill: #44a340;
}
.year .intensity3 {
fill: #1e6823;
}
.year .intensity4 {
fill: #1c5821;
}
.year .intensity5 {
fill: #1a4b1f;
}
.year .intensity6 {
fill: #133d18;
}
var width = 960,
height = 136,
cellSize = 17; // cell size
var percent = d3.format(".1%"),
format = d3.time.format("%Y-%m-%d");
// Determines color range, turns continuous values to deterministic, we have only 11 colors
var color = d3.scale.quantize()
.domain([0, 30])
.range(d3.range(7).map(function (d) {
return "intensity" + d;
}));
// Create year elements
var svg = d3.select("body").selectAll("svg")
.data(d3.range(2011, 2016))
.enter().append("svg")
.attr("width", width)
.attr("height", height)
.attr("class", "year")
.append("g")
.attr("transform", "translate(" + ((width - cellSize * 53) / 2) + "," + (height - cellSize * 7 - 1) + ")");
// add year label
svg.append("text")
.attr("transform", "translate(-6," + cellSize * 3.5 + ")rotate(-90)")
.attr("class", "label")
.style("text-anchor", "middle")
.text(function (year) {
return year;
});
// add days definitions
var rect = svg.selectAll(".day")
.data(function (d) {
return d3.time.days(new Date(d, 0, 1), new Date(d + 1, 0, 1));
})
.enter().append("rect")
.attr("class", "day")
.attr("width", cellSize)
.attr("height", cellSize)
.attr("x", function (d) {
return d3.time.weekOfYear(d) * cellSize;
})
.attr("y", function (d) {
return d.getDay() * cellSize;
})
.datum(format);
// labels for title
rect.append("title")
.text(function (d) {
return d;
});
svg.selectAll(".month")
.data(function (year) {
return d3.time.months(new Date(year, 0, 1), new Date(year + 1, 0, 1));
})
.enter().append("path")
.attr("class", "month")
.attr("d", monthPath);
d3.csv("daily_stats.csv", function (error, csv) {
if (error) throw error;
var data = d3.nest()
.key(function (row) {
return row.date;
})
.map(csv);
rect.filter(function (d) {
return d in data;
})
.attr("class", function (d) {
return "day " + color(data[d][0].commits);
})
.select("title")
.text(function (d) {
return d + ': ' + data[d][0].commits;
});
});
function monthPath(t0) {
var d0 = t0.getDay();
var w0 = d3.time.weekOfYear(t0);
var t1 = new Date(t0.getFullYear(), t0.getMonth() + 1, 0);
var d1 = t1.getDay();
var w1 = d3.time.weekOfYear(t1);
return "M" + (w0 + 1) * cellSize + "," + d0 * cellSize
+ "H" + w0 * cellSize + "V" + 7 * cellSize
+ "H" + w1 * cellSize + "V" + (d1 + 1) * cellSize
+ "H" + (w1 + 1) * cellSize + "V" + 0
+ "H" + (w0 + 1) * cellSize + "Z";
}
d3.select(self.frameElement).style("height", "2910px");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment