vis-rails 0.0.6 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vis/rails/version.rb +1 -1
- data/vendor/assets/javascripts/vis.js +2 -9
- data/vendor/assets/vis/DataSet.js +17 -9
- data/vendor/assets/vis/graph/Edge.js +49 -24
- data/vendor/assets/vis/graph/Graph.js +268 -64
- data/vendor/assets/vis/graph/Groups.js +1 -1
- data/vendor/assets/vis/graph/Node.js +18 -67
- data/vendor/assets/vis/graph/Popup.js +40 -13
- data/vendor/assets/vis/graph/css/graph-navigation.css +18 -14
- data/vendor/assets/vis/graph/graphMixins/ClusterMixin.js +7 -5
- data/vendor/assets/vis/graph/graphMixins/HierarchicalLayoutMixin.js +20 -5
- data/vendor/assets/vis/graph/graphMixins/ManipulationMixin.js +33 -33
- data/vendor/assets/vis/graph/graphMixins/MixinLoader.js +30 -32
- data/vendor/assets/vis/graph/graphMixins/NavigationMixin.js +33 -1
- data/vendor/assets/vis/graph/graphMixins/SectorsMixin.js +2 -2
- data/vendor/assets/vis/graph/graphMixins/SelectionMixin.js +72 -60
- data/vendor/assets/vis/graph/graphMixins/physics/BarnesHut.js +43 -18
- data/vendor/assets/vis/graph/graphMixins/physics/HierarchialRepulsion.js +8 -8
- data/vendor/assets/vis/graph/graphMixins/physics/PhysicsMixin.js +309 -129
- data/vendor/assets/vis/graph/graphMixins/physics/Repulsion.js +10 -10
- data/vendor/assets/vis/module/exports.js +1 -2
- data/vendor/assets/vis/module/header.js +2 -2
- data/vendor/assets/vis/timeline/Range.js +53 -93
- data/vendor/assets/vis/timeline/Timeline.js +328 -224
- data/vendor/assets/vis/timeline/component/Component.js +17 -95
- data/vendor/assets/vis/timeline/component/CurrentTime.js +54 -59
- data/vendor/assets/vis/timeline/component/CustomTime.js +55 -83
- data/vendor/assets/vis/timeline/component/Group.js +398 -75
- data/vendor/assets/vis/timeline/component/ItemSet.js +662 -403
- data/vendor/assets/vis/timeline/component/Panel.js +118 -60
- data/vendor/assets/vis/timeline/component/RootPanel.js +80 -132
- data/vendor/assets/vis/timeline/component/TimeAxis.js +191 -277
- data/vendor/assets/vis/timeline/component/css/item.css +16 -23
- data/vendor/assets/vis/timeline/component/css/itemset.css +25 -4
- data/vendor/assets/vis/timeline/component/css/labelset.css +34 -0
- data/vendor/assets/vis/timeline/component/css/panel.css +15 -1
- data/vendor/assets/vis/timeline/component/css/timeaxis.css +8 -8
- data/vendor/assets/vis/timeline/component/item/Item.js +48 -26
- data/vendor/assets/vis/timeline/component/item/ItemBox.js +156 -230
- data/vendor/assets/vis/timeline/component/item/ItemPoint.js +118 -166
- data/vendor/assets/vis/timeline/component/item/ItemRange.js +135 -187
- data/vendor/assets/vis/timeline/component/item/ItemRangeOverflow.js +29 -92
- data/vendor/assets/vis/timeline/stack.js +112 -0
- data/vendor/assets/vis/util.js +136 -38
- metadata +4 -18
- data/vendor/assets/vis/.gitignore +0 -1
- data/vendor/assets/vis/EventBus.js +0 -89
- data/vendor/assets/vis/events.js +0 -116
- data/vendor/assets/vis/graph/ClusterMixin.js +0 -1019
- data/vendor/assets/vis/graph/NavigationMixin.js +0 -245
- data/vendor/assets/vis/graph/SectorsMixin.js +0 -547
- data/vendor/assets/vis/graph/SelectionMixin.js +0 -515
- data/vendor/assets/vis/graph/img/downarrow.png +0 -0
- data/vendor/assets/vis/graph/img/leftarrow.png +0 -0
- data/vendor/assets/vis/graph/img/rightarrow.png +0 -0
- data/vendor/assets/vis/graph/img/uparrow.png +0 -0
- data/vendor/assets/vis/timeline/Controller.js +0 -183
- data/vendor/assets/vis/timeline/Stack.js +0 -190
- data/vendor/assets/vis/timeline/component/ContentPanel.js +0 -113
- data/vendor/assets/vis/timeline/component/GroupSet.js +0 -580
- data/vendor/assets/vis/timeline/component/css/groupset.css +0 -59
@@ -11,7 +11,7 @@ var graphMixinLoaders = {
|
|
11
11
|
* @param {Object} sourceVariable | this object has to contain functions.
|
12
12
|
* @private
|
13
13
|
*/
|
14
|
-
_loadMixin
|
14
|
+
_loadMixin: function (sourceVariable) {
|
15
15
|
for (var mixinFunction in sourceVariable) {
|
16
16
|
if (sourceVariable.hasOwnProperty(mixinFunction)) {
|
17
17
|
Graph.prototype[mixinFunction] = sourceVariable[mixinFunction];
|
@@ -26,7 +26,7 @@ var graphMixinLoaders = {
|
|
26
26
|
* @param {Object} sourceVariable | this object has to contain functions.
|
27
27
|
* @private
|
28
28
|
*/
|
29
|
-
_clearMixin
|
29
|
+
_clearMixin: function (sourceVariable) {
|
30
30
|
for (var mixinFunction in sourceVariable) {
|
31
31
|
if (sourceVariable.hasOwnProperty(mixinFunction)) {
|
32
32
|
Graph.prototype[mixinFunction] = undefined;
|
@@ -40,15 +40,13 @@ var graphMixinLoaders = {
|
|
40
40
|
*
|
41
41
|
* @private
|
42
42
|
*/
|
43
|
-
_loadPhysicsSystem
|
43
|
+
_loadPhysicsSystem: function () {
|
44
44
|
this._loadMixin(physicsMixin);
|
45
45
|
this._loadSelectedForceSolver();
|
46
46
|
if (this.constants.configurePhysics == true) {
|
47
47
|
this._loadPhysicsConfiguration();
|
48
48
|
}
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
},
|
52
50
|
|
53
51
|
|
54
52
|
/**
|
@@ -56,7 +54,7 @@ var graphMixinLoaders = {
|
|
56
54
|
*
|
57
55
|
* @private
|
58
56
|
*/
|
59
|
-
_loadClusterSystem
|
57
|
+
_loadClusterSystem: function () {
|
60
58
|
this.clusterSession = 0;
|
61
59
|
this.hubThreshold = 5;
|
62
60
|
this._loadMixin(ClusterMixin);
|
@@ -68,26 +66,26 @@ var graphMixinLoaders = {
|
|
68
66
|
*
|
69
67
|
* @private
|
70
68
|
*/
|
71
|
-
_loadSectorSystem
|
72
|
-
this.sectors = {
|
69
|
+
_loadSectorSystem: function () {
|
70
|
+
this.sectors = {};
|
73
71
|
this.activeSector = ["default"];
|
74
|
-
this.sectors["active"] = {
|
75
|
-
this.sectors["active"]["default"] = {"nodes":{},
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
this.sectors["frozen"] = {}
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
72
|
+
this.sectors["active"] = {};
|
73
|
+
this.sectors["active"]["default"] = {"nodes": {},
|
74
|
+
"edges": {},
|
75
|
+
"nodeIndices": [],
|
76
|
+
"formationScale": 1.0,
|
77
|
+
"drawingNode": undefined };
|
78
|
+
this.sectors["frozen"] = {};
|
79
|
+
this.sectors["support"] = {"nodes": {},
|
80
|
+
"edges": {},
|
81
|
+
"nodeIndices": [],
|
82
|
+
"formationScale": 1.0,
|
83
|
+
"drawingNode": undefined };
|
86
84
|
|
87
85
|
this.nodeIndices = this.sectors["active"]["default"]["nodeIndices"]; // the node indices list is used to speed up the computation of the repulsion fields
|
88
86
|
|
89
87
|
this._loadMixin(SectorMixin);
|
90
|
-
|
88
|
+
},
|
91
89
|
|
92
90
|
|
93
91
|
/**
|
@@ -95,11 +93,11 @@ var graphMixinLoaders = {
|
|
95
93
|
*
|
96
94
|
* @private
|
97
95
|
*/
|
98
|
-
_loadSelectionSystem
|
99
|
-
this.selectionObj = { };
|
96
|
+
_loadSelectionSystem: function () {
|
97
|
+
this.selectionObj = {nodes: {}, edges: {}};
|
100
98
|
|
101
99
|
this._loadMixin(SelectionMixin);
|
102
|
-
|
100
|
+
},
|
103
101
|
|
104
102
|
|
105
103
|
/**
|
@@ -107,10 +105,10 @@ var graphMixinLoaders = {
|
|
107
105
|
*
|
108
106
|
* @private
|
109
107
|
*/
|
110
|
-
_loadManipulationSystem
|
108
|
+
_loadManipulationSystem: function () {
|
111
109
|
// reset global variables -- these are used by the selection of nodes and edges.
|
112
110
|
this.blockConnectingEdgeSelection = false;
|
113
|
-
this.forceAppendSelection = false
|
111
|
+
this.forceAppendSelection = false;
|
114
112
|
|
115
113
|
if (this.constants.dataManipulation.enabled == true) {
|
116
114
|
// load the manipulator HTML elements. All styling done in css.
|
@@ -170,7 +168,7 @@ var graphMixinLoaders = {
|
|
170
168
|
this._clearMixin(manipulationMixin);
|
171
169
|
}
|
172
170
|
}
|
173
|
-
|
171
|
+
},
|
174
172
|
|
175
173
|
|
176
174
|
/**
|
@@ -178,7 +176,7 @@ var graphMixinLoaders = {
|
|
178
176
|
*
|
179
177
|
* @private
|
180
178
|
*/
|
181
|
-
_loadNavigationControls
|
179
|
+
_loadNavigationControls: function () {
|
182
180
|
this._loadMixin(NavigationMixin);
|
183
181
|
|
184
182
|
// the clean function removes the button divs, this is done to remove the bindings.
|
@@ -186,7 +184,7 @@ var graphMixinLoaders = {
|
|
186
184
|
if (this.constants.navigation.enabled == true) {
|
187
185
|
this._loadNavigationElements();
|
188
186
|
}
|
189
|
-
|
187
|
+
},
|
190
188
|
|
191
189
|
|
192
190
|
/**
|
@@ -194,8 +192,8 @@ var graphMixinLoaders = {
|
|
194
192
|
*
|
195
193
|
* @private
|
196
194
|
*/
|
197
|
-
_loadHierarchySystem
|
195
|
+
_loadHierarchySystem: function () {
|
198
196
|
this._loadMixin(HierarchicalLayoutMixin);
|
199
197
|
}
|
200
198
|
|
201
|
-
}
|
199
|
+
};
|
@@ -30,6 +30,9 @@ var NavigationMixin = {
|
|
30
30
|
|
31
31
|
this.navigationDivs['wrapper'] = document.createElement('div');
|
32
32
|
this.navigationDivs['wrapper'].id = "graph-navigation_wrapper";
|
33
|
+
this.navigationDivs['wrapper'].style.position = "absolute";
|
34
|
+
this.navigationDivs['wrapper'].style.width = this.frame.canvas.clientWidth + "px";
|
35
|
+
this.navigationDivs['wrapper'].style.height = this.frame.canvas.clientHeight + "px";
|
33
36
|
this.containerElement.insertBefore(this.navigationDivs['wrapper'],this.frame);
|
34
37
|
|
35
38
|
for (var i = 0; i < navigationDivs.length; i++) {
|
@@ -81,10 +84,12 @@ var NavigationMixin = {
|
|
81
84
|
* @private
|
82
85
|
*/
|
83
86
|
_moveUp : function(event) {
|
84
|
-
console.log("here")
|
85
87
|
this.yIncrement = this.constants.keyboard.speed.y;
|
86
88
|
this.start(); // if there is no node movement, the calculation wont be done
|
87
89
|
this._preventDefault(event);
|
90
|
+
if (this.navigationDivs) {
|
91
|
+
this.navigationDivs['up'].className += " active";
|
92
|
+
}
|
88
93
|
},
|
89
94
|
|
90
95
|
|
@@ -96,6 +101,9 @@ var NavigationMixin = {
|
|
96
101
|
this.yIncrement = -this.constants.keyboard.speed.y;
|
97
102
|
this.start(); // if there is no node movement, the calculation wont be done
|
98
103
|
this._preventDefault(event);
|
104
|
+
if (this.navigationDivs) {
|
105
|
+
this.navigationDivs['down'].className += " active";
|
106
|
+
}
|
99
107
|
},
|
100
108
|
|
101
109
|
|
@@ -107,6 +115,9 @@ var NavigationMixin = {
|
|
107
115
|
this.xIncrement = this.constants.keyboard.speed.x;
|
108
116
|
this.start(); // if there is no node movement, the calculation wont be done
|
109
117
|
this._preventDefault(event);
|
118
|
+
if (this.navigationDivs) {
|
119
|
+
this.navigationDivs['left'].className += " active";
|
120
|
+
}
|
110
121
|
},
|
111
122
|
|
112
123
|
|
@@ -118,6 +129,9 @@ var NavigationMixin = {
|
|
118
129
|
this.xIncrement = -this.constants.keyboard.speed.y;
|
119
130
|
this.start(); // if there is no node movement, the calculation wont be done
|
120
131
|
this._preventDefault(event);
|
132
|
+
if (this.navigationDivs) {
|
133
|
+
this.navigationDivs['right'].className += " active";
|
134
|
+
}
|
121
135
|
},
|
122
136
|
|
123
137
|
|
@@ -129,6 +143,9 @@ var NavigationMixin = {
|
|
129
143
|
this.zoomIncrement = this.constants.keyboard.speed.zoom;
|
130
144
|
this.start(); // if there is no node movement, the calculation wont be done
|
131
145
|
this._preventDefault(event);
|
146
|
+
if (this.navigationDivs) {
|
147
|
+
this.navigationDivs['zoomIn'].className += " active";
|
148
|
+
}
|
132
149
|
},
|
133
150
|
|
134
151
|
|
@@ -140,6 +157,9 @@ var NavigationMixin = {
|
|
140
157
|
this.zoomIncrement = -this.constants.keyboard.speed.zoom;
|
141
158
|
this.start(); // if there is no node movement, the calculation wont be done
|
142
159
|
this._preventDefault(event);
|
160
|
+
if (this.navigationDivs) {
|
161
|
+
this.navigationDivs['zoomOut'].className += " active";
|
162
|
+
}
|
143
163
|
},
|
144
164
|
|
145
165
|
|
@@ -149,6 +169,10 @@ var NavigationMixin = {
|
|
149
169
|
*/
|
150
170
|
_stopZoom : function() {
|
151
171
|
this.zoomIncrement = 0;
|
172
|
+
if (this.navigationDivs) {
|
173
|
+
this.navigationDivs['zoomIn'].className = this.navigationDivs['zoomIn'].className.replace(" active","");
|
174
|
+
this.navigationDivs['zoomOut'].className = this.navigationDivs['zoomOut'].className.replace(" active","");
|
175
|
+
}
|
152
176
|
},
|
153
177
|
|
154
178
|
|
@@ -158,6 +182,10 @@ var NavigationMixin = {
|
|
158
182
|
*/
|
159
183
|
_yStopMoving : function() {
|
160
184
|
this.yIncrement = 0;
|
185
|
+
if (this.navigationDivs) {
|
186
|
+
this.navigationDivs['up'].className = this.navigationDivs['up'].className.replace(" active","");
|
187
|
+
this.navigationDivs['down'].className = this.navigationDivs['down'].className.replace(" active","");
|
188
|
+
}
|
161
189
|
},
|
162
190
|
|
163
191
|
|
@@ -167,6 +195,10 @@ var NavigationMixin = {
|
|
167
195
|
*/
|
168
196
|
_xStopMoving : function() {
|
169
197
|
this.xIncrement = 0;
|
198
|
+
if (this.navigationDivs) {
|
199
|
+
this.navigationDivs['left'].className = this.navigationDivs['left'].className.replace(" active","");
|
200
|
+
this.navigationDivs['right'].className = this.navigationDivs['right'].className.replace(" active","");
|
201
|
+
}
|
170
202
|
}
|
171
203
|
|
172
204
|
|
@@ -286,7 +286,7 @@ var SectorMixin = {
|
|
286
286
|
// console.log("the node is part of the active sector");
|
287
287
|
// }
|
288
288
|
// else {
|
289
|
-
// console.log("I dont know what
|
289
|
+
// console.log("I dont know what happened!!");
|
290
290
|
// }
|
291
291
|
|
292
292
|
// when we switch to a new sector, we remove the node that will be expanded from the current nodes list.
|
@@ -549,4 +549,4 @@ var SectorMixin = {
|
|
549
549
|
this._drawSectorNodes(ctx,"active");
|
550
550
|
this._loadLatestSector();
|
551
551
|
}
|
552
|
-
};
|
552
|
+
};
|
@@ -131,7 +131,13 @@ var SelectionMixin = {
|
|
131
131
|
* @private
|
132
132
|
*/
|
133
133
|
_addToSelection : function(obj) {
|
134
|
-
|
134
|
+
if (obj instanceof Node) {
|
135
|
+
this.selectionObj.nodes[obj.id] = obj;
|
136
|
+
}
|
137
|
+
else {
|
138
|
+
this.selectionObj.edges[obj.id] = obj;
|
139
|
+
}
|
140
|
+
|
135
141
|
},
|
136
142
|
|
137
143
|
|
@@ -142,7 +148,12 @@ var SelectionMixin = {
|
|
142
148
|
* @private
|
143
149
|
*/
|
144
150
|
_removeFromSelection : function(obj) {
|
145
|
-
|
151
|
+
if (obj instanceof Node) {
|
152
|
+
delete this.selectionObj.nodes[obj.id];
|
153
|
+
}
|
154
|
+
else {
|
155
|
+
delete this.selectionObj.edges[obj.id];
|
156
|
+
}
|
146
157
|
},
|
147
158
|
|
148
159
|
|
@@ -156,13 +167,18 @@ var SelectionMixin = {
|
|
156
167
|
if (doNotTrigger === undefined) {
|
157
168
|
doNotTrigger = false;
|
158
169
|
}
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
170
|
+
for(var nodeId in this.selectionObj.nodes) {
|
171
|
+
if(this.selectionObj.nodes.hasOwnProperty(nodeId)) {
|
172
|
+
this.selectionObj.nodes[nodeId].unselect();
|
173
|
+
}
|
174
|
+
}
|
175
|
+
for(var edgeId in this.selectionObj.edges) {
|
176
|
+
if(this.selectionObj.edges.hasOwnProperty(edgeId)) {
|
177
|
+
this.selectionObj.edges[edgeId].unselect();
|
163
178
|
}
|
164
179
|
}
|
165
|
-
|
180
|
+
|
181
|
+
this.selectionObj = {nodes:{},edges:{}};
|
166
182
|
|
167
183
|
if (doNotTrigger == false) {
|
168
184
|
this.emit('select', this.getSelection());
|
@@ -180,13 +196,11 @@ var SelectionMixin = {
|
|
180
196
|
doNotTrigger = false;
|
181
197
|
}
|
182
198
|
|
183
|
-
for (var
|
184
|
-
if (this.selectionObj.hasOwnProperty(
|
185
|
-
if (this.selectionObj[
|
186
|
-
|
187
|
-
|
188
|
-
this._removeFromSelection(this.selectionObj[objectId]);
|
189
|
-
}
|
199
|
+
for (var nodeId in this.selectionObj.nodes) {
|
200
|
+
if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
|
201
|
+
if (this.selectionObj.nodes[nodeId].clusterSize > 1) {
|
202
|
+
this.selectionObj.nodes[nodeId].unselect();
|
203
|
+
this._removeFromSelection(this.selectionObj.nodes[nodeId]);
|
190
204
|
}
|
191
205
|
}
|
192
206
|
}
|
@@ -205,11 +219,9 @@ var SelectionMixin = {
|
|
205
219
|
*/
|
206
220
|
_getSelectedNodeCount : function() {
|
207
221
|
var count = 0;
|
208
|
-
for (var
|
209
|
-
if (this.selectionObj.hasOwnProperty(
|
210
|
-
|
211
|
-
count += 1;
|
212
|
-
}
|
222
|
+
for (var nodeId in this.selectionObj.nodes) {
|
223
|
+
if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
|
224
|
+
count += 1;
|
213
225
|
}
|
214
226
|
}
|
215
227
|
return count;
|
@@ -222,11 +234,9 @@ var SelectionMixin = {
|
|
222
234
|
* @private
|
223
235
|
*/
|
224
236
|
_getSelectedNode : function() {
|
225
|
-
for (var
|
226
|
-
if (this.selectionObj.hasOwnProperty(
|
227
|
-
|
228
|
-
return this.selectionObj[objectId];
|
229
|
-
}
|
237
|
+
for (var nodeId in this.selectionObj.nodes) {
|
238
|
+
if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
|
239
|
+
return this.selectionObj.nodes[nodeId];
|
230
240
|
}
|
231
241
|
}
|
232
242
|
return null;
|
@@ -241,11 +251,9 @@ var SelectionMixin = {
|
|
241
251
|
*/
|
242
252
|
_getSelectedEdgeCount : function() {
|
243
253
|
var count = 0;
|
244
|
-
for (var
|
245
|
-
if (this.selectionObj.hasOwnProperty(
|
246
|
-
|
247
|
-
count += 1;
|
248
|
-
}
|
254
|
+
for (var edgeId in this.selectionObj.edges) {
|
255
|
+
if (this.selectionObj.edges.hasOwnProperty(edgeId)) {
|
256
|
+
count += 1;
|
249
257
|
}
|
250
258
|
}
|
251
259
|
return count;
|
@@ -260,8 +268,13 @@ var SelectionMixin = {
|
|
260
268
|
*/
|
261
269
|
_getSelectedObjectCount : function() {
|
262
270
|
var count = 0;
|
263
|
-
for
|
264
|
-
if
|
271
|
+
for(var nodeId in this.selectionObj.nodes) {
|
272
|
+
if(this.selectionObj.nodes.hasOwnProperty(nodeId)) {
|
273
|
+
count += 1;
|
274
|
+
}
|
275
|
+
}
|
276
|
+
for(var edgeId in this.selectionObj.edges) {
|
277
|
+
if(this.selectionObj.edges.hasOwnProperty(edgeId)) {
|
265
278
|
count += 1;
|
266
279
|
}
|
267
280
|
}
|
@@ -275,8 +288,13 @@ var SelectionMixin = {
|
|
275
288
|
* @private
|
276
289
|
*/
|
277
290
|
_selectionIsEmpty : function() {
|
278
|
-
for(var
|
279
|
-
if(this.selectionObj.hasOwnProperty(
|
291
|
+
for(var nodeId in this.selectionObj.nodes) {
|
292
|
+
if(this.selectionObj.nodes.hasOwnProperty(nodeId)) {
|
293
|
+
return false;
|
294
|
+
}
|
295
|
+
}
|
296
|
+
for(var edgeId in this.selectionObj.edges) {
|
297
|
+
if(this.selectionObj.edges.hasOwnProperty(edgeId)) {
|
280
298
|
return false;
|
281
299
|
}
|
282
300
|
}
|
@@ -291,12 +309,10 @@ var SelectionMixin = {
|
|
291
309
|
* @private
|
292
310
|
*/
|
293
311
|
_clusterInSelection : function() {
|
294
|
-
for(var
|
295
|
-
if(this.selectionObj.hasOwnProperty(
|
296
|
-
if (this.selectionObj[
|
297
|
-
|
298
|
-
return true;
|
299
|
-
}
|
312
|
+
for(var nodeId in this.selectionObj.nodes) {
|
313
|
+
if(this.selectionObj.nodes.hasOwnProperty(nodeId)) {
|
314
|
+
if (this.selectionObj.nodes[nodeId].clusterSize > 1) {
|
315
|
+
return true;
|
300
316
|
}
|
301
317
|
}
|
302
318
|
}
|
@@ -477,11 +493,9 @@ var SelectionMixin = {
|
|
477
493
|
*/
|
478
494
|
getSelectedNodes : function() {
|
479
495
|
var idArray = [];
|
480
|
-
for(var
|
481
|
-
if(this.selectionObj.hasOwnProperty(
|
482
|
-
|
483
|
-
idArray.push(objectId);
|
484
|
-
}
|
496
|
+
for(var nodeId in this.selectionObj.nodes) {
|
497
|
+
if(this.selectionObj.nodes.hasOwnProperty(nodeId)) {
|
498
|
+
idArray.push(nodeId);
|
485
499
|
}
|
486
500
|
}
|
487
501
|
return idArray
|
@@ -495,14 +509,12 @@ var SelectionMixin = {
|
|
495
509
|
*/
|
496
510
|
getSelectedEdges : function() {
|
497
511
|
var idArray = [];
|
498
|
-
for(var
|
499
|
-
if(this.selectionObj.hasOwnProperty(
|
500
|
-
|
501
|
-
idArray.push(objectId);
|
502
|
-
}
|
512
|
+
for(var edgeId in this.selectionObj.edges) {
|
513
|
+
if(this.selectionObj.edges.hasOwnProperty(edgeId)) {
|
514
|
+
idArray.push(edgeId);
|
503
515
|
}
|
504
516
|
}
|
505
|
-
return idArray
|
517
|
+
return idArray;
|
506
518
|
},
|
507
519
|
|
508
520
|
|
@@ -538,17 +550,17 @@ var SelectionMixin = {
|
|
538
550
|
* @private
|
539
551
|
*/
|
540
552
|
_updateSelection : function () {
|
541
|
-
for(var
|
542
|
-
if(this.selectionObj.hasOwnProperty(
|
543
|
-
if (this.
|
544
|
-
|
545
|
-
delete this.selectionObj[objectId];
|
546
|
-
}
|
553
|
+
for(var nodeId in this.selectionObj.nodes) {
|
554
|
+
if(this.selectionObj.nodes.hasOwnProperty(nodeId)) {
|
555
|
+
if (!this.nodes.hasOwnProperty(nodeId)) {
|
556
|
+
delete this.selectionObj.nodes[nodeId];
|
547
557
|
}
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
558
|
+
}
|
559
|
+
}
|
560
|
+
for(var edgeId in this.selectionObj.edges) {
|
561
|
+
if(this.selectionObj.edges.hasOwnProperty(edgeId)) {
|
562
|
+
if (!this.edges.hasOwnProperty(edgeId)) {
|
563
|
+
delete this.selectionObj.edges[edgeId];
|
552
564
|
}
|
553
565
|
}
|
554
566
|
}
|