equalIntervalBreaks
equalIntervalBreaks(
x,nClasses):number[]
Defined in: src/equal_interval_breaks.js:17
Given an array of x, this will find the extent of the x and return an array of breaks that can be used to categorize the x into a number of classes. The returned array will always be 1 longer than the number of classes because it includes the minimum value.
Parameters
Section titled “Parameters”number[]
an array of number values
nClasses
Section titled “nClasses”number
number of desired classes
Returns
Section titled “Returns”number[]
array of class break positions
Example
Section titled “Example”equalIntervalBreaks([1, 2, 3, 4, 5, 6], 4); // => [1, 2.25, 3.5, 4.75, 6]