You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

point-cluster

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

point-cluster - npm Package Compare versions

Comparing version

to
3.1.5

2

package.json
{
"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 @@