foldkit-viz - v0.15.0
    Preparing search index...

    Function bin

    • Bins an array of data into consecutive non-overlapping intervals. Each bin contains the values that fall within its [x0, x1] range. The first bin's lower bound and last bin's upper bound are inclusive; interior boundaries are exclusive on the left, matching D3 parity.

      Type Parameters

      • T = number

      Parameters

      • data: readonly T[]
      • config: BinConfig<T> = {}

      Returns readonly Readonly<
          { values: readonly T[]; x0: number; x1: number; count: number },
      >[]