Function line

  • Constructs a new line generator with the default settings.

    If x or y are specified, sets the corresponding accessors to the specified function or number and returns this line generator.

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

    Type Parameters

    • Datum = [number, number]

    Parameters

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

      Sets the x accessor

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

      Sets the y accessor

    Returns Line<Datum>