Skip to content

Commit

Permalink
Added target nodes of neighborhood query
Browse files Browse the repository at this point in the history
  • Loading branch information
SelbiEreshova committed Mar 17, 2023
1 parent e638191 commit 375e149
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/js/database-utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,7 @@ var databaseUtilities = {
var idList = [];
var newtIdList = []
await databaseUtilities.getIdOfLabeledNodes(labelOfNodes, idList, newtIdList);
var setOfSources = new Set(newtIdList);

if (idList.length == 0)
{
Expand Down Expand Up @@ -898,6 +899,7 @@ var databaseUtilities = {
}
var nodes = [];
var edges = [];
var targetNodes = [];
var nodesSet = new Set();
var edgesMap = new Map();
var records = data.records;
Expand All @@ -908,6 +910,10 @@ var databaseUtilities = {
if (!nodesSet.has(fields[0][j].properties.newtId)) {
nodes.push(fields[0][j]);
nodesSet.add(fields[0][j].properties.newtId);
if (!setOfSources.has(fields[0][j].properties.newtId) && !fields[0][j].properties.class.startsWith("process"))
{
targetNodes.push(fields[0][j].properties.newtId);
}
}
}

Expand Down Expand Up @@ -936,7 +942,7 @@ var databaseUtilities = {
}
}
}
await databaseUtilities.addNodesEdgesToCy(nodes, edges, newtIdList);
await databaseUtilities.addNodesEdgesToCy(nodes, edges, newtIdList, targetNodes);
},
error: function (req, status, err) {
console.error("Error running query", status, err);
Expand Down

0 comments on commit 375e149

Please sign in to comment.