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

turf-quantile

build status

turf quantile module

turf.quantile(input, field, percentiles)

Takes a FeatureCollection, a property name, and a set of percentiles and returns a quantile array.

Parameters

parameter type description
input FeatureCollection a FeatureCollection of any type
field String the property on which to retrieve quantile values
percentiles Array.<number> an Array of percentiles on which to calculate quantile values

Example

var points = turf.featurecollection([
  turf.point([5,5], {population: 5}),
  turf.point([1,3], {population: 40}),
  turf.point([14,2], {population: 80}),
  turf.point([13,1], {population: 90}),
  turf.point([19,7], {population: 100})
]);

var breaks = turf.quantile(
  points, 'population', [25, 50, 75, 99]);

//=breaks

Installation

Requires nodejs.

$ npm install turf-quantile

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.0.4                                ...           7 years ago
  • 0.0.3                                ...           7 years ago
  • 0.0.2                                ...           7 years ago
Downloads
Today 0
This Week 6
This Month 6
Last Day 0
Last Week 0
Last Month 3
Dependencies (1)
Dev Dependencies (4)
Dependents (2)