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

§Variables

scaleImplicit

A special value for ordinal.unknown that enables implicit domain construction: unknown values are implicitly added to the domain.

§Functions

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].

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.

scaleDivergingLog

A diverging scale with a logarithmic transform, analogous to a log scale.

scaleDivergingPow

A diverging scale with a exponential transform, analogous to a power scale.

scaleDivergingSqrt

A diverging scale with a square-root transform, analogous to a d3.scaleSqrt.

scaleDivergingSymlog

A diverging scale with a symmetric logarithmic transform, analogous to a symlog scale.

scaleIdentity

Constructs a new identity scale with the specified domain and range. If range is not specified, it defaults to [0, 1].

scaleLinear

Constructs a new continuous scale with the specified range, the default interpolator and clamping disabled. The domain defaults to [0, 1]. If range is not specified, it defaults to [0, 1].

scaleLog

Constructs a new continuous scale with the specified range, the base 10, the default interpolator and clamping disabled. The domain defaults to [1, 10]. If range is not specified, it defaults to [0, 1].

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.

scalePoint

Constructs a new point 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].

scalePow

Constructs a new continuous scale with the specified range, the exponent 1, the default interpolator and clamping disabled. The domain defaults to [0, 1]. If range is not specified, it defaults to [0, 1]. (Note that this is effectively a linear scale until you set a different exponent.)

scaleQuantile

Constructs a new quantile scale with the specified range. The domain defaults to the empty array. If range is not specified, it defaults to the empty array. The quantile scale is invalid until both a domain and range are specified.

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.

scaleRadial

Constructs a new radial scale with the specified range. The domain defaults to [0, 1].

scaleSequential

Constructs a new sequential scale with the specified interpolator function or array. The domain defaults to [0, 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 minimum value and 1 represents the maximum value.

scaleSequentialLog

A sequential scale with a logarithmic transform, analogous to a log scale.

scaleSequentialPow

A sequential scale with a exponential transform, analogous to a power scale.

scaleSequentialQuantile

A sequential scale using a p-quantile transform, analogous to a quantile scale.

scaleSequentialSqrt

A sequential scale with a square-root transform, analogous to a d3.scaleSqrt.

scaleSequentialSymlog

A sequential scale with a symmetric logarithmic transform, analogous to a symlog scale.

scaleSqrt

Constructs a new continuous power scale with the specified range, the exponent 0.5, the default interpolator and clamping disabled. The domain defaults to [0, 1]. If range is not specified, it defaults to [0, 1]. This is a convenience method equivalent to d3.scalePow().exponent(0.5).

scaleSymlog

Constructs a new continuous scale with the specified range, the constant 1, the default interpolator and clamping disabled. The domain defaults to [0, 1]. If range is not specified, it defaults to [0, 1].

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.

scaleTime

Constructs a new time scale with the specified range, the default interpolator and clamping disabled. The domain defaults to [2000-01-01, 2000-01-02]. If range is not specified, it defaults to [0, 1].

scaleUtc

Constructs a new time scale using Coordinated Universal Time (UTC) with the specified range, the default interpolator and clamping disabled. The domain defaults to [2000-01-01, 2000-01-02]. If range is not specified, it defaults to [0, 1].

tickFormat

Returns a number format function suitable for displaying a tick value, automatically computing the appropriate precision based on the fixed interval between tick values, as determined by d3.tickStep.

§Interfaces

InterpolatorFactory

An Interpolator factory returns an interpolator function.

ScaleBand

Band scales are like ordinal scales except the output range is continuous and numeric. Discrete output values are automatically computed by the scale by dividing the continuous range into uniform bands. Band scales are typically used for bar charts with an ordinal or categorical dimension. The unknown value of a band scale is effectively undefined: they do not allow implicit domain construction.

ScaleContinuousNumeric

A helper interface for a continuous scale defined over a numeric domain.

ScaleDiverging

Diverging scales, like sequential scales, are similar to continuous scales in that they map a continuous, numeric input domain to a continuous output range. However, unlike continuous scales, the input domain and output range of a diverging scale always has exactly three elements, and the output range is typically specified as an interpolator rather than an array of values. These scales do not expose invert and interpolate methods.

ScaleIdentity

Identity scales are a special case of linear scales where the domain and range are identical; the scale and its invert method are thus the identity function. These scales are occasionally useful when working with pixel coordinates, say in conjunction with an axis.

ScaleLinear

A linear continuous scale defined over a numeric domain.

ScaleLogarithmic

A continuous logarithmic scale defined over a numeric domain.

ScaleOrdinal

Unlike continuous scales, ordinal scales have a discrete domain and range. For example, an ordinal scale might map a set of named categories to a set of colors, or determine the horizontal positions of columns in a column chart.

ScalePoint

Point scales are a variant of band scales with the bandwidth fixed to zero. Point scales are typically used for scatterplots with an ordinal or categorical dimension. The unknown value of a point scale is always undefined: they do not allow implicit domain construction.

ScalePower

A continuous power scale defined over a numeric domain.

ScaleQuantile

Quantile scales map a sampled input domain to a discrete range. The domain is considered continuous and thus the scale will accept any reasonable input value; however, the domain is specified as a discrete set of sample values. The number of values in (the cardinality of) the output range determines the number of quantiles that will be computed from the domain. To compute the quantiles, the domain is sorted, and treated as a population of discrete values; see d3-array’s quantile.

ScaleQuantize

Quantize scales are similar to linear scales, except they use a discrete rather than continuous range. The continuous input domain is divided into uniform segments based on the number of values in (i.e., the cardinality of) the output range.

ScaleRadial
ScaleSequential
ScaleSequentialBase

Sequential scales are similar to continuous scales in that they map a continuous, numeric input domain to a continuous output range. However, unlike continuous scales, the input domain and output range of a sequential scale always has exactly two elements, and the output range is typically specified as an interpolator rather than an array of values. These scales do not expose invert and interpolate methods.

ScaleSequentialQuantile
ScaleSymLog

A bi-symmetric log transformation for wide-range data by Webber scale defined over a numeric domain.

ScaleThreshold

Threshold scales are similar to quantize scales, except they allow you to map arbitrary subsets of the domain to discrete values in the range. The input domain is still continuous, and divided into slices based on a set of threshold values.

ScaleTime

A linear scale defined over a temporal domain.

§Type Aliases

NumberValue
UnknownReturnType