{"name":"supercluster","version":"4.1.1","description":"A very fast geospatial point clustering library.","main":"dist/supercluster.js","module":"index.js","jsdelivr":"dist/supercluster.min.js","unpkg":"dist/supercluster.min.js","scripts":{"pretest":"eslint index.js bench.js test/test.js demo/index.js demo/worker.js","test":"tap --node-arg=-r --node-arg=esm test","cov":"tap  --node-arg=-r --node-arg=esm test --cov","bench":"node --expose-gc -r esm bench.js","build":"mkdirp dist && rollup -c","prepublishOnly":"npm run test && npm run build"},"files":["index.js","dist/supercluster.js","dist/supercluster.min.js"],"repository":{"type":"git","url":"git://github.com/mapbox/supercluster.git"},"keywords":["clustering","geospatial","markers"],"author":{"name":"Vladimir Agafonkin"},"license":"ISC","dependencies":{"kdbush":"^2.0.1"},"devDependencies":{"eslint":"^5.2.0","eslint-config-mourner":"^2.0.3","esm":"^3.0.72","mkdirp":"^0.5.1","rollup":"^0.63.4","rollup-plugin-node-resolve":"^3.3.0","rollup-plugin-uglify":"^4.0.0","tap":"^12.0.1"},"eslintConfig":{"extends":"mourner","parserOptions":{"sourceType":"module"},"rules":{"camelcase":0,"indent":["error",4,{"flatTernaryExpressions":true}]}},"gitHead":"575d32dd106885d9e05cbc9c89e372757d2f012e","bugs":{"url":"https://github.com/mapbox/supercluster/issues"},"homepage":"https://github.com/mapbox/supercluster#readme","_id":"supercluster@4.1.1","_npmVersion":"6.1.0","_nodeVersion":"8.11.3","_npmUser":{"name":"mourner","email":"agafonkin@gmail.com"},"dist":{"integrity":"sha512-sF0FfUOPFp96DKzwWFLeQOEqqKu2PpcesxAFeFsknA/q7g7igVVn/p3NI2XHEghNSyDAqunKNKqAbqNO8+7NDQ==","shasum":"cf13c3b28a3fb3db5290bfad7f524e244bd4ce78","tarball":"http://registry-npm.ywwl.com/supercluster/download/supercluster-4.1.1.tgz","fileCount":6,"unpackedSize":43015,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbVuguCRA9TVsSAnZWagAAnUMQAIuvvr0sXW+jOodad1lb\n4Ewx+JPwhGKm6saRGaLEScGca9yBQOTVSyKPuyL4tc5c3NtUSYngdcdt9i8p\n+k7K3mPTJYuWGk0BCQlp7fKehIcFrf6/mx0NK/X5b7N++43K3b03uFss7TWy\ndLiMTntfkA+pP+ZWresbHQ++Zhx7zRiEGlScaNf82ME0oyb0+cXb95UtmdLl\n9VEHWhw0fKmtoVbN2Oa1bighk7+/sI/XQpEiwOFLtn1LaYEfad6+cpj2Vvuh\nV6sHLqRN8CgqbW8q+4JFO6KQ9RwxIWg8upO1FZc79xavL4SomzgLskPS3kDc\ng40AqBOczoSr5WH2lbxf4xyMHF9apL7dGHKoNxMgjGkkJ3LWMZUSiXx2W7tS\nAyE2XyJwXnhz3srwbrsY5RjcHt+rzskJaEK7rrR4pQsVGbaNB4NJB2Fa4Zxv\n9TayeApGMpJ0V7Asg36JizNrr93Mr9oUotXwtbOmOdU1SjcUyeu+ZlYML5pV\n6Bvn1HK2Dp0zJWFY+PAqhZzQZXMVVVvd4sFJh3bEp2froY7+fxZXk/qz2phw\nq5Ydy1bA64KvaHg9PZPRqZnSBD4RXiuLMIVQCOnQtrSAQGgt5YJ/KGu/Pidk\nR37hTWUnxwaQX+DF/sm/d4W7wgIEPqzR/oNzPGrpnG6W8KlsgwYhBsB8065i\ng5Ci\r\n=vhJW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlDPSUUvZTl3nPJA/QBDU7cAVpSn2cy15QvgYQNpcuNAIhANRPRL4A4nX3WhGCLsnBvcJgZDS7UsBRZgr0O+YrAfnX"}],"size":10061,"noattachment":false,"key":"/supercluster/-/supercluster-4.1.1.tgz"},"maintainers":[{"email":"accounts@mapbox.com","name":"mapbox-admin"},{"email":"accounts+npm-mapbox-machine-user@mapbox.com","name":"mapbox-machine-user"},{"email":"accounts+npmjs@mapbox.com","name":"mapbox-npm"},{"email":"accounts+npmjs-01@mapbox.com","name":"mapbox-npm-01"},{"email":"accounts+npmjs-02@mapbox.com","name":"mapbox-npm-02"},{"email":"accounts+npmjs-03@mapbox.com","name":"mapbox-npm-03"},{"email":"accounts+npmjs-04@mapbox.com","name":"mapbox-npm-04"},{"email":"accounts+npmjs-05@mapbox.com","name":"mapbox-npm-05"},{"email":"accounts+npmjs-06@mapbox.com","name":"mapbox-npm-06"},{"email":"accounts+npmjs-07@mapbox.com","name":"mapbox-npm-07"},{"email":"accounts+npmjs-08@mapbox.com","name":"mapbox-npm-08"},{"email":"accounts+npmjs-09@mapbox.com","name":"mapbox-npm-09"},{"email":"accounts+npmjs-advanced-actions@mapbox.com","name":"mapbox-npm-advanced-actions"},{"email":"accounts+npmjs-npm-ci@mapbox.com","name":"mapbox-npm-ci"},{"email":"agafonkin@gmail.com","name":"mourner"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/supercluster_4.1.1_1532422190250_0.8348437946625229"},"_hasShrinkwrap":false,"readme":"# supercluster [![Simply Awesome](https://img.shields.io/badge/simply-awesome-brightgreen.svg)](https://github.com/mourner/projects) [![Build Status](https://travis-ci.com/mapbox/supercluster.svg?branch=main)](https://travis-ci.com/mapbox/supercluster)\n\nA very fast JavaScript library for geospatial point clustering for browsers and Node.\n\n```js\nconst index = new Supercluster({radius: 40, maxZoom: 16});\nindex.load(points);\n\nconst clusters = index.getClusters([-180, -85, 180, 85], 2);\n```\n\nClustering 6 million points in Leaflet:\n\n![clustering demo on an interactive Leaflet map](https://cloud.githubusercontent.com/assets/25395/11857351/43407b46-a40c-11e5-8662-e99ab1cd2cb7.gif)\n\nSupercluster was built to power clustering in [Mapbox GL JS](https://www.mapbox.com/mapbox-gljs). Read about how it works [on the Mapbox blog](https://blog.mapbox.com/clustering-millions-of-points-on-a-map-with-supercluster-272046ec5c97).\n\n## Install\n\nInstall using NPM (`npm install supercluster`) or Yarn (`yarn add supercluster`), then:\n\n```js\n// import as a ES module in Node\nimport Supercluster from 'supercluster';\n\n// import from a CDN in the browser:\nimport Supercluster from 'https://esm.run/supercluster';\n```\n\nOr use it with an ordinary script tag in the browser:\n\n```html\n<script src=\"https://unpkg.com/supercluster@8.0.0/dist/supercluster.min.js\"></script>\n```\n\n## Methods\n\n#### `load(points)`\n\nLoads an array of [GeoJSON Feature](https://tools.ietf.org/html/rfc7946#section-3.2) objects. Each feature's `geometry` must be a [GeoJSON Point](https://tools.ietf.org/html/rfc7946#section-3.1.2). Once loaded, index is immutable.\n\n#### `getClusters(bbox, zoom)`\n\nFor the given `bbox` array (`[westLng, southLat, eastLng, northLat]`) and integer `zoom`, returns an array of clusters and points as [GeoJSON Feature](https://tools.ietf.org/html/rfc7946#section-3.2) objects.\n\n#### `getTile(z, x, y)`\n\nFor a given zoom and x/y coordinates, returns a [geojson-vt](https://github.com/mapbox/geojson-vt)-compatible JSON tile object with cluster/point features.\n\n#### `getChildren(clusterId)`\n\nReturns the children of a cluster (on the next zoom level) given its id (`cluster_id` value from feature properties).\n\n#### `getLeaves(clusterId, limit = 10, offset = 0)`\n\nReturns all the points of a cluster (given its `cluster_id`), with pagination support:\n`limit` is the number of points to return (set to `Infinity` for all points),\nand `offset` is the amount of points to skip (for pagination).\n\n#### `getClusterExpansionZoom(clusterId)`\n\nReturns the zoom on which the cluster expands into several children (useful for \"click to zoom\" feature) given the cluster's `cluster_id`.\n\n## Options\n\n| Option     | Default | Description                                                       |\n|------------|---------|-------------------------------------------------------------------|\n| minZoom    | 0       | Minimum zoom level at which clusters are generated.               |\n| maxZoom    | 16      | Maximum zoom level at which clusters are generated.               |\n| minPoints  | 2       | Minimum number of points to form a cluster.                       |\n| radius     | 40      | Cluster radius, in pixels.                                        |\n| extent     | 512     | (Tiles) Tile extent. Radius is calculated relative to this value. |\n| nodeSize   | 64      | Size of the KD-tree leaf node. Affects performance.               |\n| log        | false   | Whether timing info should be logged.                             |\n| generateId | false   | Whether to generate ids for input features in vector tiles.       |\n\n### Property map/reduce options\n\nIn addition to the options above, Supercluster supports property aggregation with the following two options:\n\n- `map`: a function that returns cluster properties corresponding to a single point.\n- `reduce`: a reduce function that merges properties of two clusters into one.\n\nExample of setting up a `sum` cluster property that accumulates the sum of `myValue` property values:\n\n```js\nconst index = new Supercluster({\n    map: (props) => ({sum: props.myValue}),\n    reduce: (accumulated, props) => { accumulated.sum += props.sum; }\n});\n```\n\nThe `map`/`reduce` options must satisfy these conditions to work correctly:\n\n- `map` must return a new object, not existing `properties` of a point, otherwise it will get overwritten.\n- `reduce` must not mutate the second argument (`props`).\n\n## TypeScript\n\nInstall `@types/supercluster` for the TypeScript type definitions:\n\n```\nnpm install @types/supercluster --save-dev \n```\n\n## Developing Supercluster\n\n```\nnpm install       # install dependencies\nnpm run build     # generate dist/supercluster.js and dist/supercluster.min.js\nnpm test          # run tests\n```\n","publish_time":1532422190685,"_cnpm_publish_time":1532422190685,"dist-tags":{"latest":"9.1.0"}}