@@ -1175,15 +1175,15 @@ GitStats.prototype.authors = function (options, callback) {
11751175 */
11761176GitStats . prototype . authorsPie = function ( options , callback ) {
11771177
1178- const radius = Math . round ( process . stdout . rows / 2 ) || 20 ;
1179-
11801178 if ( typeof options === "string" ) {
11811179 options = {
11821180 repo : options
11831181 } ;
11841182 }
11851183
1186- options = Ul . merge ( options , { radius } ) ;
1184+ options = Ul . merge ( options , {
1185+ radius : process . stdout . rows / 2 || 20
1186+ } ) ;
11871187
11881188 if ( ! IsThere ( options . repo ) ) {
11891189 return callback ( new Error ( "The repository folder doesn't exist." ) ) ;
@@ -1196,15 +1196,16 @@ GitStats.prototype.authorsPie = function (options, callback) {
11961196 ;
11971197
11981198 self . authors ( options , function ( err , authors ) {
1199+ const maxAuthors = 2 * options . radius ;
11991200 if ( err ) { return callback ( err ) ; }
1200- if ( authors . length > radius ) {
1201+ if ( authors . length > maxAuthors ) {
12011202 var others = {
1202- value : authors . slice ( radius ) . reduce ( function ( a , b ) {
1203+ value : authors . slice ( maxAuthors ) . reduce ( function ( a , b ) {
12031204 return a + b . value ;
12041205 } , 0 )
12051206 , label : "Others"
12061207 } ;
1207- authors = authors . slice ( 0 , radius ) ;
1208+ authors = authors . slice ( 0 , maxAuthors ) ;
12081209 authors . push ( others ) ;
12091210 }
12101211
0 commit comments