Interface Lane<NodeDatum, LinkDatum>

An operator for assigning nodes to a lane.

Before calling this operator, all nodes will have their y set to their topological order. After, each node should also have an x set to its non-negative lane assignment.

Example

It's probably not necessary to implement your own lane operator as the defaults should cover most circumstances. To illustrate how you would though, the most trivial lane assignment just assigns each node to a unique lane:

function trivialLane(ordered: readonly GraphNode[]): void {
for (const [i, node] in ordered.entries()) {
node.x = i;
}
}

Type Parameters

  • in NodeDatum = never

  • in LinkDatum = never

Hierarchy

  • assign lanes to ordered nodes

    Parameters

    • ordered: readonly GraphNode<NodeDatum, LinkDatum>[]

      the nodes in to assign lanes to in order from top to bottom

    Returns void

Generated using TypeDoc