@@ -28,16 +28,15 @@ function resetAll() {
2828 resetGraphUI ( ) ;
2929 resetAdjList ( ) ;
3030 removeVisitedArray ( ) ;
31+ manager . clear ( ) ;
3132 nodes = 0 ;
3233 edges = 0 ;
3334 manager = new eventManager ( ) ;
3435}
3536
3637function checkOverlap ( x : number , y : number ) {
37- console . log ( "overlap check" ) ;
3838 let overlap = false ;
3939 $ ( "#graphUI" ) . children ( ) . each ( function ( ) {
40- console . log ( this ) ;
4140 if ( this . id !== "edgeSvg" ) {
4241 let pos = $ ( "#" + this . id ) . position ( ) ;
4342 if ( pos . left - 35 < x && pos . left + 115 > x && pos . top - 35 < y && pos . top + 115 > y ) {
@@ -50,11 +49,11 @@ function checkOverlap(x: number, y: number) {
5049
5150
5251/*************************************************************** */
53-
5452/******************* Example Graphs ****************************/
5553/*************************************************************** */
5654
5755function exampleGraphStar ( ) {
56+ resetAll ( ) ;
5857 graphUIClicked ( 287 , 230 ) ;
5958 graphUIClicked ( 73 , 98 ) ;
6059 graphUIClicked ( 266 , 49 ) ;
@@ -75,15 +74,16 @@ function exampleGraphStar() {
7574}
7675
7776function exampleGraphAllConnected ( ) {
77+ resetAll ( ) ;
7878 graphUIClicked ( 66 , 71 ) ;
7979 graphUIClicked ( 337 , 158 ) ;
8080 graphUIClicked ( 571 , 64 ) ;
81- graphUIClicked ( 77 , 278 )
82- graphUIClicked ( 233 , 306 )
83- graphUIClicked ( 420 , 303 )
84- graphUIClicked ( 437 , 454 )
85- graphUIClicked ( 134 , 437 )
86- graphUIClicked ( 577 , 184 )
81+ graphUIClicked ( 77 , 278 ) ;
82+ graphUIClicked ( 233 , 306 ) ;
83+ graphUIClicked ( 420 , 303 ) ;
84+ graphUIClicked ( 437 , 454 ) ;
85+ graphUIClicked ( 134 , 437 ) ;
86+ graphUIClicked ( 577 , 184 ) ;
8787 twoNodesClicked ( 0 , 1 ) ;
8888 twoNodesClicked ( 2 , 1 ) ;
8989 twoNodesClicked ( 2 , 0 ) ;
0 commit comments