@@ -43,37 +43,6 @@ function alreadyInGraph(userID)
4343}
4444
4545
46- /**
47- * adds a person to the nodes list
48- *
49- * @param profileData
50- */
51- function addSelfAsOrg ( orgData ) {
52- nodes . push ( {
53- id :0 ,
54- name :orgData . login ,
55- image :orgData . avatar_url ,
56- background : '#eeeeee' ,
57- size :100 ,
58- label : orgData . name ,
59- } ) ;
60- console . log ( orgData . name ) ;
61- }
62-
63- function addSelfAsRepo ( repoData ) {
64- nodes . push ( {
65- id :repoData . id ,
66- name :repoData . name ,
67- label : repoData . name ,
68- } ) ;
69-
70- edges . push (
71- {
72- to : 0 ,
73- from : repoData . id
74- } ) ;
75- }
76-
7746
7847/**
7948 * Adds the followers/following of a person
@@ -262,33 +231,6 @@ function updateProgress()
262231 console . log ( ) ;
263232}
264233
265- /**
266- * Adds the base person to the graph.
267- *
268- * @param username
269- * @returns {Promise<any> }
270- */
271- function addOrgToGraph ( orgname ) {
272- return new Promise ( function ( resolve , reject ) {
273- queryAPIByOrg ( "" , orgname , function ( data ) {
274- total = ( data . public_repos ) * 2 ;
275- addSelfAsOrg ( data ) ;
276- resolve ( ) ;
277- } ,
278- function ( error ) {
279- reject ( error ) ;
280- } ) ;
281-
282- } ) ;
283- }
284-
285- function addRepoToGraph ( repo ) {
286- return new Promise ( function ( resolve , reject ) {
287- console . log ( repo ) ;
288- addSelfAsRepo ( repo ) ;
289- resolve ( ) ;
290- } ) ;
291- }
292234
293235
294236function bringUpProfileView ( id )
@@ -377,31 +319,26 @@ function createOrgRepoGraph(orgname, containerName, graphsTitle)
377319
378320 nodes = [ ] ;
379321 edges = [ ] ;
380- addOrgToGraph ( orgname ) . then ( function ( ) {
381- addRepos ( orgname , API_REPOS , 1 ) . then ( function ( )
382- {
383- addOrgUsers ( orgname , 1 ) . then ( function ( )
384- {
385- $ ( "#" + progressID ) . html ( "" ) ;
386-
387- createConnections ( ) . then ( ( ) => {
388- var container = document . getElementById ( containerName ) ;
389- var data = {
390- nodes : nodes ,
391- edges : edges
392- } ;
393- var network = new vis . Network ( container , data , options ) ;
394-
395- network . on ( "click" , function ( params ) {
396- params . event = "[original event]" ;
397- if ( Number ( this . getNodeAt ( params . pointer . DOM ) ) !== NaN ) {
398- bringUpProfileView ( Number ( this . getNodeAt ( params . pointer . DOM ) ) ) ;
399- }
400- } ) ;
401- } ) ;
322+
323+ addOrgUsers ( orgname , 1 ) . then ( function ( )
324+ {
325+ $ ( "#" + progressID ) . html ( "" ) ;
326+
327+ createConnections ( ) . then ( ( ) => {
328+ var container = document . getElementById ( containerName ) ;
329+ var data = {
330+ nodes : nodes ,
331+ edges : edges
332+ } ;
333+ var network = new vis . Network ( container , data , options ) ;
334+
335+ network . on ( "click" , function ( params ) {
336+ params . event = "[original event]" ;
337+ if ( Number ( this . getNodeAt ( params . pointer . DOM ) ) !== NaN ) {
338+ bringUpProfileView ( Number ( this . getNodeAt ( params . pointer . DOM ) ) ) ;
339+ }
402340 } ) ;
403-
404- } )
341+ } ) ;
405342 } ) . catch ( function ( error ) {
406343 alert ( "Invalid Organization" ) ;
407344 } ) ;
0 commit comments