Lightweight Javascript (TypeScript, really) library for classification. Dependency free, tested, and type safe.
- π₯ supports 6 classification types
- βοΈ: Small!
- π 4.4kb minifed, 1.7kb gzipped
- 0οΈβ£ zero dependencies
- π² tree-shakeable
- π§ͺ fully tested
- π·οΈ fully typed
- πͺ¨ asynchronous and non-blocking
- Equal Intervals (EQI)
equalIntervalBuckets
- Standard Deviation (STD)
standardDeviationBuckets
- Arithmetic Progression (APG)
arithmeticProgressionBuckets
- Geometric Progression (GPG)
geometricProgressionBuckets
- Quantiles (QNT)
quantileBuckets
- Jenks (JNK)
jenksBuckets
Install through NPM
npm install geobuckets
All outward facing functions are async and must be called with await XXX
Explicit import:
import { jenksBuckets } from "geobuckets";
const data: Array<number> = [60, 26, 20, 17, 10, 27, 98, 42, 55, 35];
const numClasses: number = 3;
const buckets: Array<number> = await jenksBuckets(data, numClasses);
console.log(buckets) >> [10, 35, 60, 98];
Helper function and type
import { generateBuckets, BucketTypes } from "geobuckets";
const data: Array<number> = [60, 26, 20, 17, 10, 27, 98, 42, 55, 35];
const numClasses: number = 3;
const buckets: Array<number> = await generateBuckets(
BucketTypes.JNK,
data,
numClasses
);
console.log(buckets) >> [10, 35, 60, 98];
A modern implementation of the GeoStats library by Simon Georget (MIT license)