Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

scaleThreshold

Constructs a new threshold scale with the specified range. The domain defaults to [0.5]. If range is not specified, it defaults to [0, 1]. Thus, the default threshold scale is equivalent to the Math.round function for numbers; for example threshold(0.49) returns 0, and threshold(0.51) returns 1.

The first generic corresponds to the data type of domain values. The second generic corresponds to the data type of range values. The third generic corresponds to the data type of the unknown value.

function scaleThreshold<Domain extends number | string | Date = number, Range = number, Unknown = never>(range?: Iterable<Range>): ScaleThreshold<Domain, Range, Unknown>;
function scaleThreshold<Domain extends number | string | Date, Range, Unknown = never>(domain: Iterable<Domain>, range: Iterable<Range>): ScaleThreshold<Domain, Range, Unknown>;
§
scaleThreshold<Domain extends number | string | Date = number, Range = number, Unknown = never>(range?: Iterable<Range>): ScaleThreshold<Domain, Range, Unknown>
[src]

Constructs a new threshold scale with the specified range. The domain defaults to [0.5]. If range is not specified, it defaults to [0, 1]. Thus, the default threshold scale is equivalent to the Math.round function for numbers; for example threshold(0.49) returns 0, and threshold(0.51) returns 1.

The first generic corresponds to the data type of domain values. The second generic corresponds to the data type of range values. The third generic corresponds to the data type of the unknown value.

§Type Parameters

§
Domain extends number | string | Date = number
[src]
§
Range = number
[src]
§
Unknown = never
[src]

§Parameters

§
range?: Iterable<Range> optional
[src]

Array of range values.

§Return Type

§
ScaleThreshold<Domain, Range, Unknown>
[src]
§
scaleThreshold<Domain extends number | string | Date, Range, Unknown = never>(domain: Iterable<Domain>, range: Iterable<Range>): ScaleThreshold<Domain, Range, Unknown>
[src]

Constructs a new threshold scale with the specified domain and range. Thus, the default threshold scale is equivalent to the Math.round function for numbers; for example threshold(0.49) returns 0, and threshold(0.51) returns 1.

The first generic corresponds to the data type of domain values. The second generic corresponds to the data type of range values. The third generic corresponds to the data type of the unknown value.

§Type Parameters

§
Domain extends number | string | Date
[src]
§
Range
[src]
§
Unknown = never
[src]

§Parameters

§
domain: Iterable<Domain>
[src]

Array of domain values.

§
range: Iterable<Range>
[src]

Array of range values.

§Return Type

§
ScaleThreshold<Domain, Range, Unknown>
[src]