UNPKG

@graphty/layout

Version:

graph layout algorithms based on networkx

15 lines (14 loc) 535 B
/** * Random layout algorithm */ import { Graph, Node, PositionMap } from '../../types'; /** * Position nodes uniformly at random in the unit square. * * @param G - Graph or list of nodes * @param center - Coordinate pair around which to center the layout * @param dim - Dimension of layout * @param seed - Random seed for reproducible layouts * @returns Positions dictionary keyed by node */ export declare function randomLayout(G: Graph | Node[], center?: number[] | null, dim?: number, seed?: number | null): PositionMap;