Interface PartitionLayout<Datum>

interface PartitionLayout {
    padding(): number;
    padding(padding): PartitionLayout<Datum>;
    round(): boolean;
    round(round): PartitionLayout<Datum>;
    size(): [number, number];
    size(size): PartitionLayout<Datum>;
    (root): HierarchyRectangularNode<Datum>;
}

Type Parameters

  • Datum

  • Lays out the specified root hierarchy. You must call root.sum before passing the hierarchy to the partition layout. You probably also want to call root.sort to order the hierarchy before computing the layout.

    Parameters

    Returns HierarchyRectangularNode<Datum>

Methods

  • Returns the current padding, which defaults to zero.

    Returns number

  • Sets the padding to the specified number and returns this partition layout. The padding is used to separate a node’s adjacent children.

    Parameters

    • padding: number

      The specified padding value.

    Returns PartitionLayout<Datum>

  • Returns the current rounding state, which defaults to false.

    Returns boolean

  • Enables or disables rounding according to the given boolean and returns this partition layout.

    Parameters

    • round: boolean

      The specified boolean flag.

    Returns PartitionLayout<Datum>

  • Returns the current size, which defaults to [1, 1].

    Returns [number, number]

  • Sets this partition layout’s size to the specified [width, height] array and returns this partition layout.

    Parameters

    • size: [number, number]

      The specified two-element size array.

    Returns PartitionLayout<Datum>