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

scaleOrdinal

Constructs a new ordinal scale with the specified range. The domain defaults to the empty array. If range is not specified, it defaults to the empty array; an ordinal scale always returns undefined until a non-empty range is defined.

The generic corresponds to the data type of range elements.

function scaleOrdinal<Range>(range?: Iterable<Range>): ScaleOrdinal<string, Range>;
function scaleOrdinal<Domain extends {
toString(): string;
}
, Range, Unknown = never>
(range?: Iterable<Range>): ScaleOrdinal<Domain, Range, Unknown>;
function scaleOrdinal<Domain extends {
toString(): string;
}
, Range, Unknown = never>
(domain: Iterable<Domain>, range: Iterable<Range>): ScaleOrdinal<Domain, Range, Unknown>;
§
scaleOrdinal<Range>(range?: Iterable<Range>): ScaleOrdinal<string, Range>
[src]

Constructs a new ordinal scale with the specified range. The domain defaults to the empty array. If range is not specified, it defaults to the empty array; an ordinal scale always returns undefined until a non-empty range is defined.

The generic corresponds to the data type of range elements.

§Type Parameters

§
Range
[src]

§Parameters

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

An optional array of range values to initialize the scale with.

§Return Type

§
ScaleOrdinal<string, Range>
[src]
§
scaleOrdinal<Domain extends {
toString(): string;
}
, Range, Unknown = never>
(range?: Iterable<Range>): ScaleOrdinal<Domain, Range, Unknown>
[src]

Constructs a new ordinal scale with the specified range. The domain defaults to the empty array. If range is not specified, it defaults to the empty array; an ordinal scale always returns undefined until a non-empty range is defined.

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

§Type Parameters

§
Domain extends {
toString(): string;
}
[src]
§
Range
[src]
§
Unknown = never
[src]

§Parameters

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

An optional array of range values to initialize the scale with.

§Return Type

§
ScaleOrdinal<Domain, Range, Unknown>
[src]
§
scaleOrdinal<Domain extends {
toString(): string;
}
, Range, Unknown = never>
(domain: Iterable<Domain>, range: Iterable<Range>): ScaleOrdinal<Domain, Range, Unknown>
[src]

Constructs a new ordinal scale with the specified domain and range.

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

§Type Parameters

§
Domain extends {
toString(): string;
}
[src]
§
Range
[src]
§
Unknown = never
[src]

§Parameters

§
domain: Iterable<Domain>
[src]

Array of domain values.

§
range: Iterable<Range>
[src]

An optional array of range values to initialize the scale with.

§Return Type

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