Compute the radius of the pie

This commit is contained in:
Ionică Bizău 2015-05-28 19:56:41 +03:00
parent 25ad4f7afd
commit 03190c52d0

View file

@ -83,14 +83,18 @@ if (!options.end || !options.end.isValid()) {
if (authorsOpt.is_provided) {
options.repo = process.cwd();
options.no_ansi = noAnsiOpt.is_provided;
options.radius = (process.stdout.rows / 2) - 4;
}
// Show the graphs
GitStats[authorsOpt.is_provided ? "authorsPie" : "ansiCalendar"](options, function (err, data) {
if (err) { return Logger.log(err, "error"); }
data = AnsiParser.removeAnsi(data);
if (!noAnsiOpt.is_provided) {
data = GitStatsColors(data, lightOpt.is_provided ? "LIGHT": "DARK");
if (!authorsOpt.is_provided) {
data = AnsiParser.removeAnsi(data);
if (!noAnsiOpt.is_provided) {
data = GitStatsColors(data, lightOpt.is_provided ? "LIGHT": "DARK");
}
}
process.stdout.write(data + "\n");
});