| 80 | } |
| 81 | |
| 82 | function createdComponent(graphManager: GraphManager, componentName: string, node: Node) { |
| 83 | if (!node.adjacentNodes) { |
| 84 | return "" |
| 85 | } |
| 86 | |
| 87 | for (var nodeKey of node.adjacentNodes) { |
| 88 | var componentNode = graphManager.getNode(componentName, nodeKey); |
| 89 | // Node.Kind will be null for ComponentNodes |
| 90 | // Node.key == componentName for parent components |
| 91 | if (componentNode && !componentNode.kind && nodeKey != componentName) { |
| 92 | return nodeKey |
| 93 | } |
| 94 | } |
| 95 | return "" |
| 96 | } |
| 97 | |
| 98 | export function NodeSearch({ graphManager, weightService, nodeName }: SearchProps) { |
| 99 | //search for the top five choices the nodeName could be in the Graph based on the nodeName |