From 26e1494b48960494c0d761a00d51f87a3f5a003f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionic=C4=83=20Biz=C4=83u?= Date: Tue, 10 Feb 2015 09:51:15 +0200 Subject: [PATCH] Different algorithm to normalize the graph data. --- lib/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index bc7c436..af2438e 100644 --- a/lib/index.js +++ b/lib/index.js @@ -253,13 +253,13 @@ GitStats.calendar = function (data, callback) { } }); - levels = Math.ceil(cal.max / (LEVELS.length * 3)); + levels = cal.max / (LEVELS.length * 2); days.forEach(function (c) { cDay = graph[c]; cal.days[c] = { c: cDay.c , level: !levels - ? 0 : (cLevel = Math.floor(cDay.c / levels )) >= 5 + ? 0 : (cLevel = Math.round(cDay.c / levels)) >= 4 ? 4 : !cLevel && cDay.c > 0 ? 1 : cLevel }; });