Comparing version 0.1.1 to 1.0.0
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 @@ }, |
18
test.js
@@ -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(); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
8380
9
35
0
2
2