Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions commits.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="d3.v2.js"></script>
<style type="text/css">
body {
Expand Down
14 changes: 7 additions & 7 deletions commits.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ svg.append("rect")
.attr("height", h)
.style("fill", "#fff");

d3.json("https://api.github.com/orgs/" + orgName + "/repos", function(repos) {
$.getJSON("https://api.github.com/orgs/" + orgName + "/repos?callback=?", function(response) {
var allCommits = [];
var timelines = [];
repos.forEach(function(repo, i, array) {
$.each(response.data, function(i, repo) {
function gitSource(repo) {
return repo.url + "/commits";
return repo.url + "/commits?callback=?";
}
d3.json(gitSource(repo), function(results) {
var commits = results.map(function(r) {
$.getJSON(gitSource(repo), function(response) {
var commits = response.data.map(function(r) {
return {
repo: repo.name,
message: r.commit.message,
Expand All @@ -61,7 +61,7 @@ d3.json("https://api.github.com/orgs/" + orgName + "/repos", function(repos) {
};
allCommits.push.apply(allCommits, commits);
timelines.push(timeline);
if (timelines.length == array.length) drawChart(allCommits, timelines);
if (timelines.length == response.data.length) drawChart(allCommits, timelines);
});
});
});
Expand Down Expand Up @@ -154,4 +154,4 @@ function drawChart(allCommits, timelines) {
message.exit().remove();
}

}
}
Loading