The options for the hierarchical layout

interface HierarchicalOptions {
    clusterBy?: ClusterByFn;
    direction?:
        | "left"
        | "right"
        | "up"
        | "down";
    packing?: "bin" | "stack";
}

Properties

clusterBy?: ClusterByFn

Optional function to group nodes into semantic clusters based on a custom identifier. Nodes returning the same string or number will be grouped together in the layout via dagre compound subgraphs. Nodes returning undefined will be treated as independent.

Ensure this function has a stable reference to avoid evaluation on every render.

direction?:
    | "left"
    | "right"
    | "up"
    | "down"

The direction in which the layout should be oriented

packing?: "bin" | "stack"

The packing method to be used