@graphty/layout
Version:
graph layout algorithms based on networkx
13 lines (12 loc) • 574 B
TypeScript
import type { Graph, Node, PositionMap } from '../../types';
/**
* Position nodes according to breadth-first search algorithm.
*
* @param G - Graph
* @param start - Starting node for bfs
* @param align - The alignment of layers: 'vertical' or 'horizontal'
* @param scale - Scale factor for positions
* @param center - Coordinate pair around which to center the layout
* @returns Positions dictionary keyed by node
*/
export declare function bfsLayout(G: Graph, start: Node, align?: 'vertical' | 'horizontal', scale?: number, center?: number[] | null): PositionMap;