Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

turf-jenks

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turf-jenks - npm Package Compare versions

Comparing version 0.1.1 to 1.0.0

bench.js

12

index.js

@@ -1,15 +0,15 @@

var ss = require('simple-statistics')
var ss = require('simple-statistics');
module.exports = function(fc, field, num){
var vals = []
var breaks = []
var vals = [];
var breaks = [];
fc.features.forEach(function(feature){
if(!(feature.properties[field]===undefined)){
vals.push(feature.properties[field])
vals.push(feature.properties[field]);
}
})
breaks = ss.jenks(vals, num)
});
breaks = ss.jenks(vals, num);
return breaks;
}
{
"name": "turf-jenks",
"version": "0.1.1",
"version": "1.0.0",
"description": "turf jenks module",

@@ -27,2 +27,3 @@ "main": "index.js",

"devDependencies": {
"benchmark": "^1.0.0",
"tape": "^2.13.4"

@@ -29,0 +30,0 @@ },

@@ -1,14 +0,14 @@

var test = require('tape')
var jenks = require('./')
var fs = require('fs')
var test = require('tape');
var jenks = require('./');
var fs = require('fs');
test('jenks', function(t){
var points = JSON.parse(fs.readFileSync(__dirname+'/geojson/Points.geojson'))
var points = JSON.parse(fs.readFileSync(__dirname+'/geojson/Points.geojson'));
var jenked = jenks(points, 'elevation', 5)
var jenked = jenks(points, 'elevation', 5);
t.ok(jenked, 'should take a set of points and an array of percentiles and return a list of jenks breaks')
t.equal(jenked.length, 6)
t.ok(jenked, 'should take a set of points and an array of percentiles and return a list of jenks breaks');
t.equal(jenked.length, 6);
t.end()
})
t.end();
});
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc