pivotick - v3.0.0
    Preparing search index...

    Interface StructuredLayoutOptions

    Lays a small graph out the way a person would draw it, and pins it there. Computed once per change rather than simulated, so the same graph always gives the same picture.

    • Each connected component is laid out on its own, and the components are packed side by side to fit the canvas at the largest zoom.
    • Leaves of one type hanging off the same one or two nodes line up as a block, beside the nodes they hang from.
    • Everything else is placed so its distances follow the edges: a hub's neighbours come out on a ring, a chain on a line.
    • Nodes with no edge at all go in a tray beside the rest.

    Meant for graphs of up to a few hundred nodes.

    interface StructuredLayoutOptions {
        direction?: "auto" | "row" | "column";
        gap?: number;
        groupMin?: number;
        labelSides?: boolean;
        trayPosition?: "bottom" | "right";
        type: "structured";
    }

    Hierarchy (View Summary)

    Index

    Properties

    direction?: "auto" | "row" | "column"

    How a block lines up. 'auto' stands it across the line to the nodes it hangs from; 'row' and 'column' force one way.

    'auto'
    
    gap?: number

    Clear space between two nodes, in graph units. An edge is drawn twice this long, and components and the tray sit three times this apart.

    30
    
    groupMin?: number

    The fewest leaves sharing a type and their neighbours that line up as a block; fewer are placed one by one. A leaf has two neighbours at most.

    3
    
    labelSides?: boolean

    Move each floated label (see textVerticalShift) to the side of its node that its edges leave free; a block's members all take the side away from the nodes they hang from. The style still decides how far out the label sits.

    true
    
    trayPosition?: "bottom" | "right"

    Where the nodes with no edge go: under the rest, or to their right.

    'bottom'
    
    type: "structured"
    'force'