A rank accessor assigns a numeric rank to some nodes. In general, nodes with
a lower rank come before nodes with a higher rank. Layering operators that
take a rank accessor additionally guarantee that nodes with the same rank
will share the same layer (if possible).
Example
This example demonstrates passing through a rank value that might exist on a
node.
functionmemberRank({ data }: GraphNode<{ rank?: number }>): number | undefined { returndata.rank; }
a way to enforce specific rankings of nodes
A rank accessor assigns a numeric rank to some nodes. In general, nodes with a lower rank come before nodes with a higher rank. Layering operators that take a rank accessor additionally guarantee that nodes with the same rank will share the same layer (if possible).
Example
This example demonstrates passing through a rank value that might exist on a node.