UNPKG

@graphty/layout

Version:

graph layout algorithms based on networkx

16 lines (15 loc) 810 B
import type { Graph, PositionMap } from '../../types'; import type { DistanceMap } from '../../algorithms/optimization'; /** * Position nodes using Kamada-Kawai path-length cost-function. * * @param G - NetworkX graph or list of nodes * @param dist - A two-level dictionary of optimal distances between nodes * @param pos - Initial positions for nodes * @param weight - The edge attribute used for edge weights * @param scale - Scale factor for positions * @param center - Coordinate pair around which to center the layout * @param dim - Dimension of layout * @returns Positions dictionary keyed by node */ export declare function kamadaKawaiLayout(G: Graph, dist?: DistanceMap | null, pos?: PositionMap | null, weight?: string, scale?: number, center?: number[] | null, dim?: number): PositionMap;