mirror of
https://github.com/IonicaBizau/git-stats.git
synced 2024-12-22 13:22:11 +01:00
Distort the contribution values a little bit.
This commit is contained in:
parent
2f83ab4aee
commit
7c94d1865e
1 changed files with 4 additions and 6 deletions
10
lib/index.js
10
lib/index.js
|
@ -7,8 +7,7 @@ var Ul = require("ul")
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
const STORE_PATH = Ul.USER_DIR + "/.git-stats"
|
const STORE_PATH = Ul.USER_DIR + "/.git-stats"
|
||||||
, LEVELS = 5
|
, LEVELS = [
|
||||||
, SQUARES = [
|
|
||||||
"⬚"
|
"⬚"
|
||||||
, "▢"
|
, "▢"
|
||||||
, "▤"
|
, "▤"
|
||||||
|
@ -191,14 +190,13 @@ GitStats.calendar = function (data, callback) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
levels = Math.ceil(cal.max / LEVELS);
|
levels = Math.ceil(cal.max / (LEVELS.length * 3));
|
||||||
|
|
||||||
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.floor(cDay.c / levels )) >= 5
|
||||||
? 4 : !cLevel && cDay.c > 0 ? 1 : cLevel
|
? 4 : !cLevel && cDay.c > 0 ? 1 : cLevel
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -243,7 +241,7 @@ GitStats.ansiCalendar = function (data, callback) {
|
||||||
cWeek = [" ", " ", " ", " ", " ", " ", " "];
|
cWeek = [" ", " ", " ", " ", " ", " ", " "];
|
||||||
}
|
}
|
||||||
|
|
||||||
cWeek[DAYS.indexOf(sDay)] = SQUARES[cDayObj.level];
|
cWeek[DAYS.indexOf(sDay)] = LEVELS[cDayObj.level];
|
||||||
});
|
});
|
||||||
|
|
||||||
if (cWeek.length) {
|
if (cWeek.length) {
|
||||||
|
|
Loading…
Reference in a new issue