point-cluster
Advanced tools
Comparing version
{ | ||
"name": "point-cluster", | ||
"version": "3.1.4", | ||
"version": "3.1.5", | ||
"description": "Fast nd point clustering.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -20,2 +20,3 @@ /** | ||
const MAX_GROUP_ID = 1073741824 | ||
@@ -60,3 +61,3 @@ module.exports = function cluster (srcPoints, options) { | ||
// point indexes for levels [0: [a,b,c,d], 1: [a,b,c,d,e,f,...], ...] | ||
// representative point indexes for levels | ||
let levels = [] | ||
@@ -67,3 +68,3 @@ | ||
// unique group ids, sorted in z-curve fashion within levels | ||
// unique group ids, sorted in z-curve fashion within levels by shifting bits | ||
let groups = [] | ||
@@ -114,3 +115,4 @@ | ||
// max depth reached - put all items into a first group | ||
if (level > maxDepth) { | ||
// alternatively - if group id overflow - avoid proceeding | ||
if (level > maxDepth || group > MAX_GROUP_ID) { | ||
for (let i = 0; i < ids.length; i++) { | ||
@@ -148,2 +150,3 @@ levelItems.push(ids[i]) | ||
group <<= 2 | ||
sublevel.push( | ||
@@ -150,0 +153,0 @@ sort(x, y, d2, lolo, level, group), |
@@ -40,3 +40,3 @@ 'use strict' | ||
t.only('quad: lod method', t => { | ||
t('quad: lod method', t => { | ||
let points = [0,0, 1,1, 2,2, 3,3, 4,4, 5,5, 6,6, 7,7] | ||
@@ -43,0 +43,0 @@ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
30969
0.34%723
0.28%1
Infinity%