quantize.nice()

quantize.nice() Equivalent to continuous.nice.

quantize.invertExtent()

quantize.invertExtent(value) Returns the extent of values in the domain [x0, x1] for the corresponding value in the range: the inverse of quantize. This method is useful for interaction, say to determine the value in the domain that corresponds to the pixel location under the mouse. var width = d3.scaleQuantize() .domain([10, 100]) .range([1, 2, 4]); width.invertExtent(2); // [40, 70]

quantize.domain()

quantize.domain([domain]) If domain is specified, sets the scale’s domain to the specified two-element array of numbers. If the elements in the given array are not numbers, they will be coerced to numbers. If domain is not specified, returns the scale’s current domain.

quantize.copy()

quantize.copy() Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa.

quantize()

quantize(value) Given a value in the input domain, returns the corresponding value in the output range. For example, to apply a color encoding: var color = d3.scaleQuantize() .domain([0, 1]) .range(["brown", "steelblue"]); color(0.49); // "brown" color(0.51); // "steelblue" Or dividing the domain into three equally-sized parts with different range values to compute an appropriate stroke width: var width = d3.scaleQuantize() .domain([10, 100]) .range([1, 2, 4]); width(20); /

quantile.range()

quantile.range([range]) If range is specified, sets the discrete values in the range. The array must not be empty, and may contain any type of value. The number of values in (the cardinality, or length, of) the range array determines the number of quantiles that are computed. For example, to compute quartiles, range must be an array of four elements such as [0, 1, 2, 3]. If range is not specified, returns the current range.

quantile.quantiles()

quantile.quantiles() Returns the quantile thresholds. If the range contains n discrete values, the returned array will contain n - 1 thresholds. Values less than the first threshold are considered in the first quantile; values greater than or equal to the first threshold but less than the second threshold are in the second quantile, and so on. Internally, the thresholds array is used with bisect to find the output quantile associated with the given input value.

quantile.invertExtent()

quantile.invertExtent(value) Returns the extent of values in the domain [x0, x1] for the corresponding value in the range: the inverse of quantile. This method is useful for interaction, say to determine the value in the domain that corresponds to the pixel location under the mouse.

quantile.domain()

quantile.domain([domain]) If domain is specified, sets the domain of the quantile scale to the specified set of discrete numeric values. The array must not be empty, and must contain at least one numeric value; NaN, null and undefined values are ignored and not considered part of the sample population. If the elements in the given array are not numbers, they will be coerced to numbers. A copy of the input array is sorted and stored internally. If domain is not specified, returns the scale’s

quantile.copy()

quantile.copy() Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa.