mirror of
https://github.com/IonicaBizau/git-stats.git
synced 2024-09-29 19:51:29 +02:00
Different algorithm to normalize the graph data.
This commit is contained in:
parent
093ce0d9ce
commit
26e1494b48
@ -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) {
|
days.forEach(function (c) {
|
||||||
cDay = graph[c];
|
cDay = graph[c];
|
||||||
cal.days[c] = {
|
cal.days[c] = {
|
||||||
c: cDay.c
|
c: cDay.c
|
||||||
, level: !levels
|
, 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
|
? 4 : !cLevel && cDay.c > 0 ? 1 : cLevel
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user