@@ -57,6 +57,36 @@ let coder = new Vue({
5757forks :function ( ) {
5858return this . repoRanking ( 'forks_count' ) ;
5959} ,
60+ repo_types :function ( ) {
61+ let labels = [ ] ;
62+ let values = [ ] ;
63+ let types = {
64+ active_sources :0 ,
65+ archived :0 ,
66+ disabled :0 ,
67+ forked :0 ,
68+ mirrors :0
69+ } ;
70+ for ( let repo of this . repos_pushed ) {
71+ if ( repo . archived )
72+ types . archived ++ ;
73+ else if ( repo . disabled )
74+ types . disabled ++ ;
75+ else if ( repo . fork )
76+ types . forked ++ ;
77+ else if ( repo . mirror )
78+ types . mirrors ++ ;
79+ else
80+ types . active_sources ++ ;
81+ }
82+ for ( let [ label , value ] of Object . entries ( types ) ) {
83+ if ( value > 0 ) {
84+ labels . push ( label ) ;
85+ values . push ( value ) ;
86+ }
87+ }
88+ return { labels :labels , values :values } ;
89+ } ,
6090stars :function ( ) {
6191return this . repoRanking ( 'stargazers_count' ) ;
6292} ,
@@ -99,6 +129,10 @@ let coder = new Vue({
99129this . rankingGraph ( this . issues . slice ( 0 , 10 ) , 'open_issues_count' , '#issues-ranking' ) ;
100130this . rankingGraph ( this . forks . slice ( 0 , 10 ) , 'forks_count' , '#forks-ranking' ) ;
101131this . rankingGraph ( this . stars . slice ( 0 , 10 ) , 'stargazers_count' , '#stars-ranking' ) ;
132+
133+ new Chartist . Pie ( '#repo-types-chart' , {
134+ labels :this . repo_types . labels . map ( d => d . replace ( '_' , ' ' ) ) ,
135+ series :this . repo_types . values } ) ;
102136} ,
103137methods :{
104138fetchRepos :function ( ) {