Function area

  • Constructs a new area generator with the default settings.

    If x, y0 or y1 are specified, sets the corresponding accessors to the specified function or number and returns this area generator.

    The generic refers to the data type of an element in the input array passed into the area generator.

    Type Parameters

    • Datum = [number, number]

    Parameters

    • Optional x: number | ((d, index, data) => number)

      Sets the x accessor.

    • Optional y0: number | ((d, index, data) => number)

      Sets the y0 accessor.

    • Optional y1: number | ((d, index, data) => number)

      Sets the y1 accessor.

    Returns Area<Datum>