quantize.range()

quantize.range([range]) If range is specified, sets the scale’s range to the specified array of values. The array may contain any number of discrete values. The elements in the given array need not be numbers; any value or type will work. If range is not specified, returns the scale’s current range.

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()

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.

quantize.copy()

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

quantile()

quantile(value) Given a value in the input domain, returns the corresponding value in the output range.

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