UNPKG

@delove/reaflow

Version:

Node-based Visualizations for React

22 lines (21 loc) 757 B
import { EdgeData, NodeData } from '../types'; /** * Helper function to determine if edge already has a link. */ export declare function hasLink(edges: EdgeData[], from: NodeData, to: NodeData): boolean; /** * Detect if there is a circular reference from the from to the source node. */ export declare function detectCircular(nodes: NodeData[], edges: EdgeData[], fromNode: NodeData, toNode: NodeData): boolean; /** * Given a node id, get all the parent nodes recursively. */ export declare const getParentsForNodeId: (nodes: NodeData[], edges: EdgeData[], startId: string) => any[]; /** * Get edge data given a node. */ export declare function getEdgesByNode(edges: EdgeData[], node: NodeData): { to: any[]; from: any[]; all: any[]; };