SeBassTian23/CalendarHeatmap

Upper bounds do not always include largest value

Closed this issue · 1 comments

Add a data set with several items, some counts as 1 and some counts as 10. 10 should be rendered in the largest set, 4. It is rendered in set 0.

We fixed this by tweaking the code around line 80 (in the source);

var l = Math.round( i * stepWidth ) + 1;
var ll = Math.round( i * stepWidth + stepWidth );
//NEW CODE
if ( i === ( bins - 1 ) && ll < maxCount ) { 
  ll = maxCount;
}
//NEW CODE ENDS

I could add a PR for this, but I'm not exactly familiar with the build steps, if you want to outline them here I can submit a PR. We have a couple of small additions in terms of features if you'd be interested.

Sorry for the long silence... I was very busy and missed your reported issue and I appreciate you also posted a solution! The released minor update should fix your issue (see 2a72d01).