UNPKG

@graphty/layout

Version:

graph layout algorithms based on networkx

22 lines (21 loc) 790 B
/** * Layout rescaling utilities */ import { PositionMap } from '../types'; /** * Returns scaled position array/dict to (-scale, scale) in all axes. * * @param pos - Position dictionary or array * @param scale - Scale factor for positions * @param center - Coordinate pair around which to center the layout * @returns Rescaled positions dictionary */ export declare function rescaleLayout(pos: PositionMap | number[][], scale?: number, center?: number[] | null): PositionMap | number[][]; /** * Return a dictionary of scaled positions centered at (0, 0). * * @param pos - Dictionary of positions * @param scale - Scale factor for positions * @returns Dictionary of scaled positions */ export declare function rescaleLayoutDict(pos: PositionMap, scale?: number): PositionMap;