Interface TreemapLayout<Datum>

interface TreemapLayout {
    padding(): ((node) => number);
    padding(padding): TreemapLayout<Datum>;
    padding(padding): TreemapLayout<Datum>;
    paddingBottom(): ((node) => number);
    paddingBottom(padding): TreemapLayout<Datum>;
    paddingBottom(padding): TreemapLayout<Datum>;
    paddingInner(): ((node) => number);
    paddingInner(padding): TreemapLayout<Datum>;
    paddingInner(padding): TreemapLayout<Datum>;
    paddingLeft(): ((node) => number);
    paddingLeft(padding): TreemapLayout<Datum>;
    paddingLeft(padding): TreemapLayout<Datum>;
    paddingOuter(): ((node) => number);
    paddingOuter(padding): TreemapLayout<Datum>;
    paddingOuter(padding): TreemapLayout<Datum>;
    paddingRight(): ((node) => number);
    paddingRight(padding): TreemapLayout<Datum>;
    paddingRight(padding): TreemapLayout<Datum>;
    paddingTop(): ((node) => number);
    paddingTop(padding): TreemapLayout<Datum>;
    paddingTop(padding): TreemapLayout<Datum>;
    round(): boolean;
    round(round): TreemapLayout<Datum>;
    size(): [number, number];
    size(size): TreemapLayout<Datum>;
    tile(): ((node, x0, y0, x1, y1) => void);
    tile(tile): TreemapLayout<Datum>;
    (root): HierarchyRectangularNode<Datum>;
}

Type Parameters

  • Datum

  • Lays out the specified root hierarchy. You must call root.sum before passing the hierarchy to the treemap 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 inner padding function.

    Returns ((node) => number)

  • Sets the inner and outer padding to the specified number and returns this treemap layout.

    Parameters

    • padding: number

      The specified padding value.

    Returns TreemapLayout<Datum>

  • Sets the inner and outer padding to the specified function and returns this treemap layout.

    Parameters

    • padding: ((node) => number)

      The specified padding function.

    Returns TreemapLayout<Datum>

  • Returns the current bottom padding function, which defaults to the constant zero.

    Returns ((node) => number)

      • (node): number
      • Returns the current bottom padding function, which defaults to the constant zero.

        Parameters

        Returns number

  • Sets the bottom padding to the specified number and returns this treemap layout. The bottom padding is used to separate the bottom edge of a node from its children.

    Parameters

    • padding: number

      The specified bottom padding value.

    Returns TreemapLayout<Datum>

  • Sets the bottom padding to the specified function and returns this treemap layout. The function is invoked for each node with children, being passed the current node. The bottom padding is used to separate the bottom edge of a node from its children.

    Parameters

    • padding: ((node) => number)

      The specified bottom padding function.

    Returns TreemapLayout<Datum>

  • Returns the current inner padding function, which defaults to the constant zero.

    Returns ((node) => number)

      • (node): number
      • Returns the current inner padding function, which defaults to the constant zero.

        Parameters

        Returns number

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

    Parameters

    • padding: number

      The specified inner padding value.

    Returns TreemapLayout<Datum>

  • Sets the inner padding to the specified function and returns this treemap layout. The function is invoked for each node with children, being passed the current node. The inner padding is used to separate a node’s adjacent children.

    Parameters

    • padding: ((node) => number)

      The specified inner padding function.

    Returns TreemapLayout<Datum>

  • Returns the current left padding function, which defaults to the constant zero.

    Returns ((node) => number)

      • (node): number
      • Returns the current left padding function, which defaults to the constant zero.

        Parameters

        Returns number

  • Sets the left padding to the specified number and returns this treemap layout. The left padding is used to separate the left edge of a node from its children.

    Parameters

    • padding: number

      The specified left padding value.

    Returns TreemapLayout<Datum>

  • Sets the left padding to the specified function and returns this treemap layout. The function is invoked for each node with children, being passed the current node. The left padding is used to separate the left edge of a node from its children.

    Parameters

    • padding: ((node) => number)

      The specified left padding function.

    Returns TreemapLayout<Datum>

  • Returns the current top padding function.

    Returns ((node) => number)

  • Sets the top, right, bottom and left padding to the specified function and returns this treemap layout.

    Parameters

    • padding: number

      The specified padding outer value.

    Returns TreemapLayout<Datum>

  • Sets the top, right, bottom and left padding to the specified function and returns this treemap layout.

    Parameters

    • padding: ((node) => number)

      The specified padding outer function.

    Returns TreemapLayout<Datum>

  • Returns the current right padding function, which defaults to the constant zero.

    Returns ((node) => number)

      • (node): number
      • Returns the current right padding function, which defaults to the constant zero.

        Parameters

        Returns number

  • Sets the right padding to the specified number and returns this treemap layout. The right padding is used to separate the right edge of a node from its children.

    Parameters

    • padding: number

      The specified right padding value.

    Returns TreemapLayout<Datum>

  • Sets the right padding to the specified function and returns this treemap layout. The function is invoked for each node with children, being passed the current node. The right padding is used to separate the right edge of a node from its children.

    Parameters

    • padding: ((node) => number)

      The specified right padding function.

    Returns TreemapLayout<Datum>

  • Returns the current top padding function, which defaults to the constant zero.

    Returns ((node) => number)

      • (node): number
      • Returns the current top padding function, which defaults to the constant zero.

        Parameters

        Returns number

  • Sets the top padding to the specified number and returns this treemap layout. The top padding is used to separate the top edge of a node from its children.

    Parameters

    • padding: number

      The specified top padding value.

    Returns TreemapLayout<Datum>

  • Sets the top padding to the specified function and returns this treemap layout. The function is invoked for each node with children, being passed the current node. The top padding is used to separate the top edge of a node from its children.

    Parameters

    • padding: ((node) => number)

      The specified top padding function.

    Returns TreemapLayout<Datum>

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

    Returns boolean

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

    Parameters

    • round: boolean

      The specified boolean flag.

    Returns TreemapLayout<Datum>

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

    Returns [number, number]

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

    Parameters

    • size: [number, number]

      The specified two-element size array.

    Returns TreemapLayout<Datum>

  • Returns the current tiling method, which defaults to d3.treemapSquarify with the golden ratio.

    Returns ((node, x0, y0, x1, y1) => void)

      • (node, x0, y0, x1, y1): void
      • Returns the current tiling method, which defaults to d3.treemapSquarify with the golden ratio.

        Parameters

        Returns void

  • Sets the tiling method to the specified function and returns this treemap layout.

    Parameters

    • tile: ((node, x0, y0, x1, y1) => void)

      The specified tiling function.

        • (node, x0, y0, x1, y1): void
        • Parameters

          Returns void

    Returns TreemapLayout<Datum>