1.0.1 • Published 9 years ago

turf-jenks v1.0.1

Weekly downloads
1,923
License
MIT
Repository
github
Last release
9 years ago

turf-jenks

build status

turf jenks module

turf.jenks(input, field, numberOfBreaks)

Given a FeatureCollection, return the Jenks Natural breaks of a given property

Parameters

parametertypedescription
inputFeatureCollectiona FeatureCollection of any type
fieldstringthe property in input on which to calculate Jenks natural breaks
numberOfBreaksnumbernumber of classes in which to group the data

Example

var points = turf.featurecollection([
  turf.point([49.859733, 40.400424], {population: 200}),
  turf.point([49.83879, 40.401209], {population: 600}),
  turf.point([49.817848, 40.376889], {population: 100}),
  turf.point([49.840507, 40.386043], {population: 200}),
  turf.point([49.854583, 40.37532], {population: 300})]);
var breaks = turf.jenks(points, 'population', 3);
//=breaks

Installation

Requires nodejs.

$ npm install turf-jenks

Tests

$ npm test
1.0.1

9 years ago

1.0.0

9 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago