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

scaleDiverging

Constructs a new diverging scale with the specified interpolator function or array. The domain defaults to [0, 0.5, 1]. If interpolator is not specified, it defaults to the identity function. When the scale is applied, the interpolator will be invoked with a value typically in the range [0, 1], where 0 represents the extreme negative value, 0.5 represents the neutral value, and 1 represents the extreme positive value.

If interpolator is an array, it represents the scale’s three-element output range and is converted to an interpolator function using d3.interpolate and d3.piecewise.

The first generic corresponds to the data type of the interpolator return type. The second generic corresponds to the data type of the unknown value.

function scaleDiverging<Output = number, Unknown = never>(interpolator?: ((t: number) => Output) | Iterable<Output>): ScaleDiverging<Output, Unknown>;
function scaleDiverging<Output, Unknown = never>(domain: Iterable<NumberValue>, interpolator: ((t: number) => Output) | Iterable<Output>): ScaleDiverging<Output, Unknown>;
§
scaleDiverging<Output = number, Unknown = never>(interpolator?: ((t: number) => Output) | Iterable<Output>): ScaleDiverging<Output, Unknown>
[src]

Constructs a new diverging scale with the specified interpolator function or array. The domain defaults to [0, 0.5, 1]. If interpolator is not specified, it defaults to the identity function. When the scale is applied, the interpolator will be invoked with a value typically in the range [0, 1], where 0 represents the extreme negative value, 0.5 represents the neutral value, and 1 represents the extreme positive value.

If interpolator is an array, it represents the scale’s three-element output range and is converted to an interpolator function using d3.interpolate and d3.piecewise.

The first generic corresponds to the data type of the interpolator return type. The second generic corresponds to the data type of the unknown value.

§Type Parameters

§
Output = number
[src]
§
Unknown = never
[src]

§Parameters

§
interpolator?: ((t: number) => Output) | Iterable<Output> optional
[src]

The scale’s interpolator function or array.

§Return Type

§
ScaleDiverging<Output, Unknown>
[src]
§
scaleDiverging<Output, Unknown = never>(domain: Iterable<NumberValue>, interpolator: ((t: number) => Output) | Iterable<Output>): ScaleDiverging<Output, Unknown>
[src]

Constructs a new diverging scale with the specified domain and interpolator function or array. When the scale is applied, the interpolator will be invoked with a value typically in the range [0, 1], where 0 represents the extreme negative value, 0.5 represents the neutral value, and 1 represents the extreme positive value.

If interpolator is an array, it represents the scale’s three-element output range and is converted to an interpolator function using d3.interpolate and d3.piecewise.

The first generic corresponds to the data type of the interpolator return type. The second generic corresponds to the data type of the unknown value.

§Type Parameters

§
Output
[src]
§
Unknown = never
[src]

§Parameters

§
domain: Iterable<NumberValue>
[src]

Array of three numeric domain values.

§
interpolator: ((t: number) => Output) | Iterable<Output>
[src]

The scale’s interpolator function or array.

§Return Type

§
ScaleDiverging<Output, Unknown>
[src]