Skip to content

Commit

Permalink
fix: fixed stars count #39 & fixed progressbar percentage
Browse files Browse the repository at this point in the history
  • Loading branch information
anuraghazra committed Jul 15, 2020
1 parent 3a24ad6 commit 96d37c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/fetchStats.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const fetcher = (variables, token) => {
followers {
totalCount
}
repositories(first: 100, orderBy: { direction: DESC, field: STARGAZERS }) {
repositories(first: 100, ownerAffiliations: OWNER, isFork: false, orderBy: {direction: DESC, field: STARGAZERS}) {
totalCount
nodes {
stargazers {
Expand Down
11 changes: 3 additions & 8 deletions src/renderStatsCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,9 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => {
</text>
</g>`;

// re-adjust circle progressbar's value until the ranking algo is improved
let progress = rank.score;
if (rank.score > 86) {
progress = (40 + rank.score) * 0.6;
}
if (rank.score < 40) {
progress = 40 + rank.score;
}
// the better user's score the the rank will be closer to zero so
// subtracting 100 to get the progress in 100%
let progress = 100 - rank.score;

const styles = getStyles({
titleColor,
Expand Down

0 comments on commit 96d37c7

Please sign in to comment.