Skip to content

Instantly share code, notes, and snippets.

@idelem
Last active August 14, 2018 02:37
Show Gist options
  • Save idelem/5160ff03e658f6ec680311dc03bf3700 to your computer and use it in GitHub Desktop.
Save idelem/5160ff03e658f6ec680311dc03bf3700 to your computer and use it in GitHub Desktop.
include structure viewer
<!DOCTYPE html>
<head>
<meta charset="utf-8">
</head>
<body>
<svg width='100%' height='100%'></svg>
</body>
<script src="https://d3js.org/d3.v5.min.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="viewer.js">
</script>
// get git repo structure
$.ajax({
type: "GET",
url: "https://api.github.com/users/google/repos",
dataType: "json",
success: function(result) {
for(var i in result ) {
$("#repo_list").append(
"<li><a href='" + result[i].html_url + "' target='_blank'>" +
result[i].name + "</a></li>"
);
console.log("i: " + i);
}
console.log(result);
$("#repo_count").append("Total Repos: " + result.length);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment