|
@@ -6,9 +6,14 @@ export const getOutgoers = (
|
|
): [NodeData[], string[]] => {
|
|
): [NodeData[], string[]] => {
|
|
const outgoerNodes: NodeData[] = [];
|
|
const outgoerNodes: NodeData[] = [];
|
|
const matchingNodes: string[] = [];
|
|
const matchingNodes: string[] = [];
|
|
-
|
|
|
|
const runner = (nodeId: string) => {
|
|
const runner = (nodeId: string) => {
|
|
const outgoerIds = edges.filter(e => e.from === nodeId).map(e => e.to);
|
|
const outgoerIds = edges.filter(e => e.from === nodeId).map(e => e.to);
|
|
|
|
+
|
|
|
|
+ if (parent.includes(nodeId)) {
|
|
|
|
+ const initialParentNode = nodes.find(n => n.id === nodeId);
|
|
|
|
+ if (initialParentNode) outgoerNodes.push(initialParentNode);
|
|
|
|
+ }
|
|
|
|
+
|
|
const nodeList = nodes.filter(n => {
|
|
const nodeList = nodes.filter(n => {
|
|
if (parent.includes(n.id) && !matchingNodes.includes(n.id))
|
|
if (parent.includes(n.id) && !matchingNodes.includes(n.id))
|
|
matchingNodes.push(n.id);
|
|
matchingNodes.push(n.id);
|