Socket
Socket
Sign inDemoInstall

@types/supercluster

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/supercluster

TypeScript definitions for supercluster


Version published
Weekly downloads
270K
decreased by-17.46%
Maintainers
1
Weekly downloads
 
Created

What is @types/supercluster?

@types/supercluster provides TypeScript type definitions for the supercluster library, which is a fast geospatial point clustering library for browsers and Node.js.

What are @types/supercluster's main functionalities?

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);

Other packages similar to @types/supercluster

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

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.

Install

Related posts

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