Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

[Enhancement] Bump supercluster version (#590)

Adam Krebs7ed6b7b9ee7e
diff --git a/package.json b/package.json
index 76868d3a9..279123af9 100644
--- a/package.json
+++ b/package.json
@@ -116,7 +116,7 @@
"redux": "^3.0.4",
"redux-actions": "^2.2.1",
"reselect": "^3.0.1",
- "supercluster": "^3.0.0",
+ "supercluster": "^6.0.1",
"type-analyzer": "0.2.1",
"uber-licence": "^3.1.1",
"viewport-mercator-project": "^6.0.0",
diff --git a/src/deckgl-layers/layer-utils/cluster-utils.js b/src/deckgl-layers/layer-utils/cluster-utils.js
index 3c6de4439..1cd4292b7 100644
--- a/src/deckgl-layers/layer-utils/cluster-utils.js
+++ b/src/deckgl-layers/layer-utils/cluster-utils.js
@@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-import supercluster from 'supercluster';
+import Supercluster from 'supercluster';
import memoize from 'lodash.memoize';
export function getGeoJSON(data, getPosition) {
@@ -41,11 +41,9 @@ export function getGeoJSON(data, getPosition) {
const clusterResolver = ({clusterRadius}) => `${clusterRadius}`;
const getClusterer = memoize(({clusterRadius, geoJSON}) => {
- return supercluster({
+ return new Supercluster({
maxZoom: 20,
radius: clusterRadius,
- initial: () => ({points: []}),
- map: props => props.data,
reduce: (accumulated, props) => {
if (props.points) {
// avoid using spread to prevent max call stack exceeded error
diff --git a/yarn.lock b/yarn.lock
index f4cf5e8e1..a6a6cb434 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5442,10 +5442,6 @@ just-curry-it@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/just-curry-it/-/just-curry-it-3.1.0.tgz#ab59daed308a58b847ada166edd0a2d40766fbc5"
-kdbush@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/kdbush/-/kdbush-1.0.1.tgz#3cbd03e9dead9c0f6f66ccdb96450e5cecc640e0"
-
kdbush@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/kdbush/-/kdbush-3.0.0.tgz#f8484794d47004cc2d85ed3a79353dbe0abc2bf0"
@@ -8698,12 +8694,6 @@ subarg@^1.0.0:
dependencies:
minimist "^1.1.0"
-supercluster@^3.0.0:
- version "3.0.3"
- resolved "https://registry.yarnpkg.com/supercluster/-/supercluster-3.0.3.tgz#3b7c86bbc8f56ecf35b923a4f5675676ed52e2cb"
- dependencies:
- kdbush "^1.0.1"
-
supercluster@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/supercluster/-/supercluster-6.0.1.tgz#4c0177d96daa195d58a5bad9f55dbf12fb727a4c"