Skip to content

Commit

Permalink
Fix scale color in ContributionChart
Browse files Browse the repository at this point in the history
  • Loading branch information
MrOrz committed Oct 20, 2021
1 parent a1d799b commit 157a563
Show file tree
Hide file tree
Showing 2 changed files with 229 additions and 227 deletions.
4 changes: 3 additions & 1 deletion components/ContributionChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ function Legend({ count }) {

function scaleColor(count, maxContribution) {
const varingScalingFactor =
count < 10 ? 10 / MAX_SCALE : maxContribution.count / MAX_SCALE;
maxContribution.count < 10
? 10 / MAX_SCALE
: maxContribution.count / MAX_SCALE;
return Math.max(
Math.min(Math.ceil(count / varingScalingFactor), MAX_SCALE),
0
Expand Down
Loading

0 comments on commit 157a563

Please sign in to comment.