JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 82
  • Score
    100M100P100Q105783F
  • License MIT

turf quantile module

Package Exports

  • turf-quantile

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (turf-quantile) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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. 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