Browse Source

getNeighbors now also accepts 'in' and 'out', besides '>' and '<' for consistency reasons

Simon Van Mierlo 8 years ago
parent
commit
1f7f345922
2 changed files with 4 additions and 4 deletions
  1. 2 2
      mmmk.js
  2. 2 2
      mt/ptcal/dapi.py

+ 2 - 2
mmmk.js

@@ -728,12 +728,12 @@ with AToMPM.  If not, see <http://www.gnu.org/licenses/>.
 				{
 					var edge = self.model.edges[i];
 					if( edge['src'] == _id && 
-						 (_dir == '>' || _dir == '*') &&
+						 (_dir == '>' || _dir == '*' || _dir == "out") &&
 						 (_type == '*' || self.model.nodes[edge['dest']]['$type'] == _type) &&
 						 ! _utils.contains(ids,edge['dest']) )
 						ids.push(edge['dest']);
 					else if( edge['dest'] == _id && 
-								(_dir == '<' || _dir == '*') &&
+								(_dir == '<' || _dir == '*' || _dir == "in") &&
 	  							(_type == '*' || self.model.nodes[edge['src']]['$type'] == _type) &&
 								! _utils.contains(ids,edge['src']) )
 						ids.push(edge['src']);

+ 2 - 2
mt/ptcal/dapi.py

@@ -214,11 +214,11 @@ class DesignerAPI :
 			idx   = self._pl2gi[pLabel]
 			for e in self._graph.get_edgelist() :
 				if e[0] == idx and \
-					(dir == '>' or dir == '*') and \
+					(dir == '>' or dir == '*' or dir == "out") and \
 					(type == '*' or self._graph.vs[e[1]][HC.FULLTYPE] == type) :
 					pLabels.add(gi2pl[e[1]])
 				elif e[1] == idx and \
-					  (dir == '<' or dir == '*') and \
+					  (dir == '<' or dir == '*' or dir == "in") and \
 					  (type == '*' or self._graph.vs[e[0]][HC.FULLTYPE] == type) :
 					pLabels.add(gi2pl[e[0]])
 		return list(pLabels)