Function scaleBand

  • Constructs a new band scale with the specified range, no padding, no rounding and center alignment. The domain defaults to the empty domain. If range is not specified, it defaults to the unit range [0, 1].

    The generic corresponds to the data type of domain elements.

    Type Parameters

    • Domain extends {
          toString(): string;
      } = string

    Parameters

    • Optional range: Iterable<NumberValue>

      A two-element array of numeric values.

    Returns ScaleBand<Domain>

  • Constructs a new band scale with the specified domain and range, no padding, no rounding and center alignment.

    The generic corresponds to the data type of domain elements.

    Type Parameters

    • Domain extends {
          toString(): string;
      }

    Parameters

    • domain: Iterable<Domain>

      Array of domain values.

    • range: Iterable<NumberValue>

      A two-element array of numeric values.

    Returns ScaleBand<Domain>