mapbox / mapbox/supercluster

Caching SuperCluster Index

Open
#218 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
2.4k
Forks
304
PR merge metrics
No merged PRs in 30d

Description

Hi, is it possible to cache index generated by SuperCluster so that I can use it next time instead of calling new Supercluster({}).load() Again?

The code below takes time for large records. I am trying to get over this issue.

superclusterIndex = new Supercluster({
map: (props) => props,
radius: MapConfig.clusterRadius,
maxZoom: ClusterZoomLevel.maxZoom,
}).load(geoJsonData.features);

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the Supercluster construction and the .load(geoJsonData.features) entry point shown in the issue. Determine whether the generated index can be persisted and reused across instances, and define how cached data should handle the clustering options and input records. Done means large datasets can reuse a valid index instead of rebuilding it with load().

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.