Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
timqian committed Sep 24, 2015
1 parent 5774ac6 commit 37a9c5e
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 23 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
## star History of github project
## [The missing star history graph of github projects](http://www.timqian.com/star_history/)

### locash vs underscore

![lodash vs underscore](lodash_underscore.png)

### meteor vs rails vs django
![](rails_meteor.png)
26 changes: 13 additions & 13 deletions bundle.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions generateUrls.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default async function(repo) {
const initUrl = `https://api.github.com/repos/${repo}/stargazers`;
const res = await axios.get(initUrl, getConfig).catch(e => {
console.log(e); // throw don't workalert(`Sorry, Git API rate limit exceeded for your ip address, please wait for an hour`);
alert(`Sorry, Git API rate limit exceeded for your ip address, please wait for an hour`);
});
const link = res.headers.link;

Expand All @@ -36,8 +37,8 @@ export default async function(repo) {
samplePageUrls.push(initUrl + '?page=' + i);
}
} else {
for (let i = 1; i < sampleNum; i++) {
let pageIndex = Math.round(i / sampleNum * pageNum);
for (let i = 1; i <= sampleNum; i++) {
let pageIndex = Math.round(i / sampleNum * pageNum) - 1; //for bootstrap bug
pageIndexes.push(pageIndex);
samplePageUrls.push(initUrl + '?page=' + pageIndex);
}
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@

<body>
<div class="nav">
<input type="text" id="repo" placeholder="twbs/bootstrap">
<button type="button" name="button" id="theBtn" >Get star history</button>
<input type="text" id="repo" placeholder="torvalds/linux">
<button type="button" name="button" id="theBtn" >See star history</button>
<img src="loadinfo.net.gif" alt="Loding..." id="theGif" style="display: none;">
</div>
<iframe src="https://ghbtns.com/github-btn.html?user=timqian&repo=star_history&type=star&count=true" frameborder="0" scrolling="0" width="100px" height="30px"></iframe>
Expand Down
10 changes: 7 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ d3.select("button").on("click", async function() {
document.getElementById('theGif').style.display = 'inline';

let repo = document.getElementById('repo').value
repo = repo == '' ? 'twbs/bootstrap' : repo;
repo = repo == '' ? 'torvalds/linux' : repo;
console.log(repo);

const starHistory = await getStarHistory(repo).catch(function(err) {
console.log(err);
alert(`Sorry, Git API rate limit exceeded for your ip address, please wait for an hour`);
});
console.log(starHistory);
document.getElementById('thebtn').removeAttribute("disabled");
document.getElementById('theGif').style.display = 'none';

// 新数据集
data.push({
key: repo,
Expand Down Expand Up @@ -76,4 +76,8 @@ d3.select("button").on("click", async function() {

return chart;
});

document.getElementById('theBtn').removeAttribute("disabled");
document.getElementById('theGif').style.display = 'none';
console.log('hi');
});
Binary file added lodash_underscore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
},
"dependencies": {
"axios": "^0.5.4",
"bluebird": "^2.10.0",
"d3": "^3.5.6",
"nvd3": "^1.8.1"
}
Expand Down
Binary file added rails_meteor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion test/getStarHistory_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import getStarHistory from '../getStarHistory';

// getStarHistory('timqian/jsCodeStructure');
(async function() {
const history = await getStarHistory('jquery/jquery')
const history = await getStarHistory('twbs/bootstrap')
.catch(err => {
console.log(err);
});
Expand Down

0 comments on commit 37a9c5e

Please sign in to comment.