Socket
Socket
Sign inDemoInstall

turf-quantile

Package Overview
Dependencies
1
Maintainers
8
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    turf-quantile

turf quantile module


Version published
Weekly downloads
45
decreased by-6.25%
Maintainers
8
Created
Weekly downloads
 

Readme

Source

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

parametertypedescription
inputFeatureCollectiona FeatureCollection of any type
fieldStringthe property on which to retrieve quantile values
percentilesArray.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

Keywords

FAQs

Last updated on 06 Feb 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc