in src/utilities/graph-util.js [186:211]
static findNodesWithinArea(
start: IPoint,
end: IPoint,
nodes: INode[],
nodeKey: string
): Map<string, INode> {
const smallerX = Math.min(start.x, end.x);
const smallerY = Math.min(start.y, end.y);
const largerX = Math.max(end.x, start.x);
const largerY = Math.max(end.y, start.y);
const foundNodesMap = new Map();
nodes.forEach(node => {
if (
node.x >= smallerX &&
node.x <= largerX &&
node.y >= smallerY &&
node.y <= largerY
) {
foundNodesMap.set(node[nodeKey], node);
}
});
return foundNodesMap;
}