Skip to content

jenksBreaks

jenksBreaks(sorted, classes): number[]

Defined in: packages/core/src/classify/breaks.ts:190

Jenks natural-breaks thresholds — the classes that minimise the summed squared deviation from each class mean (Fisher’s exact optimisation, which Jenks’ iterative procedure approximates).

ParameterType
sortedreadonly number[]
classesnumber

number[]

Computed with Wang & Song’s Ckmeans.1d.dp dynamic programme (2011), whose divide-and-conquer fill is O(k·n·log n): a 100 000-feature layer takes milliseconds, where the textbook Jenks matrices are O(k·n²). The fill follows simple-statistics’ ckmeans (ISC licence, Tom MacWright and contributors). Each threshold is the smallest value of its class.