Function scaleQuantize

  • Constructs a new quantize scale with the specified range. The domain defaults to [0, 1]. If range is not specified, it defaults to [0, 1]. Thus, the default quantize scale is equivalent to the Math.round function.

    The range must be set corresponding to the type of the range elements.

    The first generic corresponds to the data type of the range elements. The second generic corresponds to the data type of the unknown value.

    Type Parameters

    • Range = number

    • Unknown = never

    Parameters

    • Optional range: Iterable<Range>

      Array of range values.

    Returns ScaleQuantize<Range, Unknown>

  • Constructs a new quantize scale with the specified domain and range. Thus, the default quantize scale is equivalent to the Math.round function.

    The range must be set corresponding to the type of the range elements.

    The first generic corresponds to the data type of the range elements. The second generic corresponds to the data type of the unknown value.

    Type Parameters

    • Range

    • Unknown = never

    Parameters

    • domain: Iterable<NumberValue>

      A two-element array of numeric values defining the domain.

    • range: Iterable<Range>

      Array of range values.

    Returns ScaleQuantize<Range, Unknown>