@@ -5,10 +5,12 @@ angular.module("jsonDiscoverer").controller("CompositionCtrl", ["$scope", "$wind
5
5
$scope . name = "" ;
6
6
$scope . graph = "" ;
7
7
8
+ $scope . layoutPosible = false ;
8
9
$scope . sigmaGraph = new sigma ( 'sigma-container' ) ;
9
10
$scope . layoutButton = "Start Layout" ;
10
11
$scope . layoutRunning = false ;
11
12
13
+ $scope . pathPosible = false ;
12
14
$scope . sourcePath = { } ;
13
15
$scope . sourcePreviousColor = "" ;
14
16
$scope . targetPath = { } ;
@@ -83,50 +85,14 @@ angular.module("jsonDiscoverer").controller("CompositionCtrl", ["$scope", "$wind
83
85
} )
84
86
}
85
87
$scope . sigmaGraph . refresh ( ) ;
86
-
88
+ $scope . layoutPosible = true ;
87
89
} ,
88
90
function ( data , status , headers , config ) {
89
91
$scope . alertsGeneral . push ( { type : 'error' , msg : 'Oops, we found an error in the composition discovery process. Could you check your JSON and try again?' } ) ;
90
92
}
91
93
) ;
92
94
} ;
93
95
94
- $scope . test = function ( ) {
95
- $scope . sigmaGraph . graph . clear ( ) ;
96
- $scope . sigmaGraph . graph . addNode ( {
97
- id : "A" ,
98
- label : "labelA" ,
99
- x : Math . random ( ) ,
100
- y : Math . random ( ) ,
101
- size : 1 ,
102
- color : '#f00'
103
- } ) . addNode ( {
104
- id : "B" ,
105
- label : "labelB" ,
106
- x : Math . random ( ) ,
107
- y : Math . random ( ) ,
108
- size : 1 ,
109
- color : '#f00'
110
- } ) . addNode ( {
111
- id : "C" ,
112
- label : "labelC" ,
113
- x : Math . random ( ) ,
114
- y : Math . random ( ) ,
115
- size : 1 ,
116
- color : '#f00'
117
- } ) . addEdge ( {
118
- id : "EAB" ,
119
- source : "A" ,
120
- target : "B"
121
- } ) . addEdge ( {
122
- id : "EBC" ,
123
- source : "B" ,
124
- target : "C"
125
- } ) ;
126
- $scope . sigmaGraph . refresh ( ) ;
127
- } ;
128
-
129
-
130
96
$scope . updateCompositionPosible = function ( ) {
131
97
if ( typeof defs === "undefined" ) $scope . compositionPosible = false ;
132
98
for ( def in $scope . defs ) {
@@ -157,6 +123,7 @@ angular.module("jsonDiscoverer").controller("CompositionCtrl", ["$scope", "$wind
157
123
$scope . targetPath . color = $scope . targetPreviousColor ;
158
124
$scope . sourcePath = null ;
159
125
$scope . targetPath = null ;
126
+ $scope . pathPosible = false ;
160
127
}
161
128
162
129
if ( $scope . sourcePath === null ) {
@@ -165,6 +132,7 @@ angular.module("jsonDiscoverer").controller("CompositionCtrl", ["$scope", "$wind
165
132
} else {
166
133
$scope . targetPreviousColor = event . data . node . color ;
167
134
$scope . targetPath = event . data . node ;
135
+ $scope . pathPosible = true ;
168
136
}
169
137
event . data . node . color = '#000' ;
170
138
$scope . sigmaGraph . refresh ( ) ;
0 commit comments