mapbox / mapbox/supercluster

getClusters returns 0 or 1 points when given 2

Open
#165 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I am trying to represent random points on a map using superclusters and mapbox.

I ran into an issue while testing for the two points: [ -60.44, -1.77] and [-55.44, -5.77]; running getClusters with a supercluster instance set up as follows:

const index = new Supercluster({
  log: true,
  radius: 20,
  extent: 256,
  maxZoom: 3
})

Returns a single point (not cluster of 2) at zoom > 5

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 by reproducing getClusters with the two coordinates and the shown Supercluster options, including the reported zoom levels. Then inspect the clustering implementation and determine why two points produce zero or one result; done means the behavior is explained and a focused regression test confirms the expected result.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.