From b0676ac696453d3297b8236f275f6d0abdfe2a82 Mon Sep 17 00:00:00 2001 From: Andrew Chen Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com> Date: Tue, 3 Aug 2021 14:22:27 -0400 Subject: [PATCH] Add defaults for ContributionGraph (Fixes #425) --- src/contribution-graph/ContributionGraph.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/contribution-graph/ContributionGraph.tsx b/src/contribution-graph/ContributionGraph.tsx index 0a6033fc..62f7d742 100644 --- a/src/contribution-graph/ContributionGraph.tsx +++ b/src/contribution-graph/ContributionGraph.tsx @@ -166,8 +166,8 @@ class ContributionGraph extends AbstractChart< if (count) { const opacity = mapValue( count, - this.state.minValue, - this.state.maxValue, + this.state.maxValue === this.state.minValue ? 0: this.state.minValue, + isNaN(this.state.maxValue) ? 1 : this.state.maxValue, 0.15 + 0.05, // + 0.05 to make smaller values a bit more visible 1 );