UNPKG

d3-dag

Version:

Layout algorithms for visualizing directed acylic graphs.

51 lines (50 loc) 1.65 kB
/** * A {@link CoordTopological} for assigning coordinates to a topological * layering. * * @packageDocumentation */ import { Coord } from "."; /** * a {@link Coord} for positioning edges of a topological layout * * This operator can position nodes similar to {@link coordSimplex} or {@link * coordQuad} but is tailored to topological layouts. * * Create with {@link coordTopological}. */ export interface CoordTopological extends Coord<unknown, unknown> { /** * set whether to use straight edges * * If using straight edges, they'll tend to go straight down, where as curved * edges will have gentle slopes. `true` corresponds to {@link coordSimplex} * while `false` corresponds to {@link coordQuad}. * * (default: `true`) */ straight(val: boolean): CoordTopological; /** get the current simplex setting. */ straight(): boolean; /** @internal flag indicating that this is built in to d3dag and shouldn't error in specific instances */ readonly d3dagBuiltin: true; } /** * create a new {@link CoordTopological} * * The topological coordinate assignment operator requires a topological * layering created by {@link layeringTopological}. It assigns all real nodes * the same x coordinate, and curves the links around the column of nodes. * * It may also be worth considering {@link zherebko} as a layout as it's * created entirely for layouts like this. * * @example * * ```ts * const layout = sugiyama() * .layering(layeringTopological()) * .coord(coordTopological()); * ``` */ export declare function coordTopological(...args: never[]): CoordTopological;