
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@types/supercluster
Advanced tools
TypeScript definitions for supercluster
@types/supercluster provides TypeScript type definitions for the supercluster library, which is a fast geospatial point clustering library for browsers and Node.js.
Creating a Supercluster instance
This feature allows you to create a new Supercluster instance with specific options such as radius and maxZoom.
const supercluster = require('supercluster');
const index = supercluster({
radius: 40,
maxZoom: 16
});
Loading points into the cluster
This feature allows you to load an array of GeoJSON Feature objects into the Supercluster instance.
index.load([{
type: 'Feature',
properties: {},
geometry: {
type: 'Point',
coordinates: [0, 0]
}
}]);
Getting clusters for a specific area and zoom level
This feature allows you to retrieve clusters for a given bounding box and zoom level.
const clusters = index.getClusters([-180, -85, 180, 85], 2);
Getting the children of a cluster
This feature allows you to get the children of a specific cluster by its cluster ID.
const children = index.getChildren(clusterId);
Getting the leaves of a cluster
This feature allows you to get the leaves (original points) of a specific cluster, with optional limit and offset parameters.
const leaves = index.getLeaves(clusterId, limit, offset);
kdbush is a fast static spatial index for 2D points based on a flat KD-tree. It is used internally by supercluster for spatial indexing but can be used independently for fast nearest neighbor queries.
rbush is a high-performance JavaScript library for 2D spatial indexing of points and rectangles. It is similar to supercluster in that it provides fast spatial queries, but it uses an R-tree data structure instead of a KD-tree.
geocluster is a simple clustering library for geospatial points. It is less feature-rich compared to supercluster but can be used for basic clustering needs.
npm install --save @types/supercluster
This package contains type definitions for supercluster (https://github.com/mapbox/supercluster).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/supercluster.
These definitions were written by Denis Carriere, and Nick Zahn.
FAQs
TypeScript definitions for supercluster
The npm package @types/supercluster receives a total of 1,349,905 weekly downloads. As such, @types/supercluster popularity was classified as popular.
We found that @types/supercluster demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.