From 96d37c706fd0d1df0845ac09763cde026e515c1b Mon Sep 17 00:00:00 2001 From: anuraghazra Date: Wed, 15 Jul 2020 20:00:22 +0530 Subject: [PATCH] fix: fixed stars count #39 & fixed progressbar percentage --- src/fetchStats.js | 2 +- src/renderStatsCard.js | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/fetchStats.js b/src/fetchStats.js index f8bb715..24ecfa9 100644 --- a/src/fetchStats.js +++ b/src/fetchStats.js @@ -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 { diff --git a/src/renderStatsCard.js b/src/renderStatsCard.js index 1713ac0..75259de 100644 --- a/src/renderStatsCard.js +++ b/src/renderStatsCard.js @@ -127,14 +127,9 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => { `; - // 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,