UNPKG

@graphty/layout

Version:

graph layout algorithms based on networkx

22 lines 619 B
/** * Parameter processing utilities */ /** * Process and validate layout parameters * Helper function similar to _process_params in Python version * * @param G - Graph object or array of nodes * @param center - Center coordinates or null * @param dim - Dimension of layout * @returns Processed parameters */ export function _processParams(G, center, dim) { if (!center) { center = Array(dim).fill(0); } if (center.length !== dim) { throw new Error("length of center coordinates must match dimension of layout"); } return { G, center }; } //# sourceMappingURL=params.js.map