File tree Expand file tree Collapse file tree 4 files changed +72
-3
lines changed Expand file tree Collapse file tree 4 files changed +72
-3
lines changed Original file line number Diff line number Diff line change 1
1
# README
2
2
3
- Source files for [ coderstats.net] ( https://coderstats.net/ ) .
3
+ Source files for [ coderstats.net] ( https://coderstats.net/ ) .
4
+
5
+ # GitHub API Calls
6
+
7
+ * https://api.github.com/search/issues?q=user:yaph&sort=created&order=desc
8
+ * https://api.github.com/users/yaph/events/public
9
+ * https://api.github.com/users/yaph/received_events/public
Original file line number Diff line number Diff line change @@ -57,6 +57,36 @@ let coder = new Vue({
57
57
forks : function ( ) {
58
58
return this . repoRanking ( 'forks_count' ) ;
59
59
} ,
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
+ } ,
60
90
stars : function ( ) {
61
91
return this . repoRanking ( 'stargazers_count' ) ;
62
92
} ,
@@ -99,6 +129,10 @@ let coder = new Vue({
99
129
this . rankingGraph ( this . issues . slice ( 0 , 10 ) , 'open_issues_count' , '#issues-ranking' ) ;
100
130
this . rankingGraph ( this . forks . slice ( 0 , 10 ) , 'forks_count' , '#forks-ranking' ) ;
101
131
this . 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 } ) ;
102
136
} ,
103
137
methods : {
104
138
fetchRepos : function ( ) {
Original file line number Diff line number Diff line change 32
32
stroke : $color2 ;
33
33
}
34
34
35
+ .ct-chart-pie {
36
+ min-height : 250px ;
37
+ }
38
+
39
+ .ct-chart-pie .ct-label {
40
+ fill : #222 ;
41
+ }
42
+
43
+ .ct-series-a .ct-slice-pie {
44
+ fill :rgb (141 ,211 ,199 )
45
+ }
46
+ .ct-series-b .ct-slice-pie {
47
+ fill :rgb (255 ,255 ,179 )
48
+ }
49
+ .ct-series-c .ct-slice-pie {
50
+ fill :rgb (190 ,186 ,218 )
51
+ }
52
+ .ct-series-d .ct-slice-pie {
53
+ fill :rgb (251 ,128 ,114 )
54
+ }
55
+ .ct-series-e .ct-slice-pie {
56
+ fill :rgb (128 ,177 ,211 )
57
+ }
58
+
35
59
.meta {
36
60
background-color : $color4 ;
37
61
}
Original file line number Diff line number Diff line change 22
22
{% raw %}
23
23
< div id ="coder ">
24
24
< div v-if ="user " class ="row ">
25
- < div class ="col-12 col-2-xl col-2 -l col-4-m meta ">
25
+ < div class ="col-12 col-2-xl col-3 -l col-4-m meta ">
26
26
< div class ="padh ">
27
27
< header >
28
28
< h3 > {{ user.name }}</ h3 >
@@ -34,12 +34,17 @@ <h3>{{ user.name }}</h3>
34
34
< span v-if ="user.location " class ="block "> < i class ="fa fa-globe " aria-hidden ="true "> </ i > {{ user.location }}</ span >
35
35
< span v-if ="user.company " class ="block "> < i class ="fa fa-money " aria-hidden ="true "> </ i > {{ user.company }}</ span >
36
36
< blockquote v-if ="user.bio "> < p > {{ user.bio }}</ p > </ blockquote >
37
+
38
+ < div v-if ="repo_types " class ="padv ">
39
+ < h3 > Repo types</ h3 >
40
+ < div id ="repo-types-chart "> </ div >
41
+ </ div >
37
42
</ div >
38
43
</ div >
39
44
< div v-if ="repos_pushed.length < 2 " class ="col-12 error ">
40
45
{{ user.name }} has not pushed changes to enough public repositories to show any interesting data here.
41
46
</ div >
42
- < div v-else class ="col-12 col-10-xl col-10 -l col-8-m no-padding main ">
47
+ < div v-else class ="col-12 col-10-xl col-9 -l col-8-m no-padding main ">
43
48
< div class ="flex flex-wrap boxes ">
44
49
< div class ="box-stat " title ="The number of loaded repositories this user has pushed to. ">
45
50
< i class ="fa fa-code " aria-hidden ="true "> </ i > Pushed to repos
You can’t perform that action at this time.
0 commit comments