开发者社区> 镜像站> NPM> turf-jenks
turf-jenks
turf jenks module
Last updated 6 years ago by morganherlocker .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install turf-jenks 
SYNC missed versions from official npm registry.

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

parameter type description
input FeatureCollection a FeatureCollection of any type
field string the property in input on which to calculate Jenks natural breaks
numberOfBreaks number number 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

Current Tags

  • 1.0.1                                ...           latest (6 years ago)

6 Versions

  • 1.0.1                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
  • 0.0.3                                ...           7 years ago
  • 0.0.2                                ...           7 years ago
Downloads
Today 0
This Week 28
This Month 15
Last Day 6
Last Week 0
Last Month 36
Dependencies (1)
Dev Dependencies (4)
Dependents (4)