{"_id":"@plotly/point-cluster","_rev":"44-a3ebb5dbacc8c1d943a40d14f833c26f","name":"@plotly/point-cluster","dist-tags":{"latest":"4.0.0"},"versions":{"3.1.9":{"name":"@plotly/point-cluster","version":"3.1.9","keywords":["snap-points-2d","supercluster","quadtree","quad-tree","kdtree","kd-tree","ann-tree","point","scatter","point2d","2d","cluster","clustering","geospatial","markers","round","data","vis","gl-vis"],"author":{"name":"Dmitry Yv","email":"df.creative@gmail.com"},"license":"MIT","_id":"@plotly/point-cluster@3.1.9","maintainers":[{"name":"rpkyle","email":"ryan@plotly.com"},{"name":"emmanuelle","email":"emmanuelle.gouillart@nsup.org"},{"name":"dmt0","email":"dmt.shvedov@gmail.com"},{"name":"jody_plotly","email":"jody@plot.ly"},{"name":"xhlu","email":"xing.han.lu@mail.mcgill.ca"},{"name":"archmoj","email":"arch.mojtaba.samimi@gmail.com"},{"name":"jmmease","email":"jon.mease@gmail.com"},{"name":"chriddyp","email":"chris@plot.ly"},{"name":"verazabeida","email":"vera.zabeida@gmail.com"},{"name":"bpostlethwaite","email":"post.ben.here@gmail.com"},{"name":"alexcjohnson","email":"alex@plot.ly"},{"name":"nicolaskruchten","email":"nicolas@kruchten.com"},{"name":"antrg","email":"antoine@plot.ly"}],"homepage":"https://github.com/plotly/point-cluster#readme","bugs":{"url":"https://github.com/plotly/point-cluster/issues"},"dist":{"shasum":"8ffec77fbf5041bf15401079e4fdf298220291c1","tarball":"https://registry.npmjs.org/@plotly/point-cluster/-/point-cluster-3.1.9.tgz","fileCount":10,"integrity":"sha512-MwaI6g9scKf68Orpr1pHZ597pYx9uP8UEFXLPbsCmuw3a84obwz6pnMXGc90VhgDNeNiLEdlmuK7CPo+5PIxXw==","signatures":[{"sig":"MEUCIQCjCaHWmsfbVl7SjhdGCo5kitZyes0KBfzF7lCSDFjBfQIgE84DRrEkzyo+4ZRBzxOiqOgJTAvtDdo3oZAihpGkagA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":29758,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOqv4CRA9TVsSAnZWagAAzH8P/RVvUUe2Vg2/p2kDx0jm\nDMXeIClD+ZKzwYZI/3beftwRqElhBZj8Cs+gKK6HQ0l7DuHpf4CeMZ4LFWX+\nw2x5Sk4k2vQaKGVHacVjReygT0dgAd6tZbnMeEr4VMHkolo2dNGHDttfxJRd\nd6/xKq61Cf0GWu5iCQKYxsFPx4IWhjpIa+2pMxsYgJACuK7u80eoj3YSLYtz\nPH2O3ENRQVtV8P5pQNgrHvwM4xIBrZrKojcST+hB1Py5ZXYkCaOpPZcAsA5x\nyL4RyxUGQFc8ueeG5T/t5P7CVj0aho0syt1Fp/JC2jkr1ysOAQ1F5WLVwAZx\nnUorsrZYa5U408LHFeJYrMWtLVAK0gS+HMRGNBE14Rbe9rtgGhVC+Hmt5OCt\nDjFN8vR0luKb6NPh5V6kxUOHxausRbllO0RfSeOOcB5ElVR2/a03l7+7oeNx\nmKmuHK/gxuVJbXuc2MATRIqc7y0Ob/GxF1y8zWC3X/cETSnvRZSgaJ/f4ij+\nynFey+MuDADNSdr5AXOC6X0Hak4X8g2UyFwGUwglxjBtTrHVCc/cR5Ru/qzN\nOlfwu7gdyw7WakYzY9w9+i7dHlcX5G0cz2OUCbC30qOdnBCT/HcAf6LZ3SPK\n01T7v8YG/dLVO6CV737cyVBKWBiyQ5shjpw+wiC1PH5Uvf7D+ktaY+iNrI0s\nkQNI\r\n=i35b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"f3bdebf95a27c5927cea52da9a2c4a2f5034caa1","scripts":{"test":"node test","build":"browserify demo.js -g bubleify | indexhtmlify | metadataify | github-cornerify > demo/index.html"},"_npmUser":{"name":"archmoj","email":"arch.mojtaba.samimi@gmail.com"},"browserify":{"transform":["bubleify"]},"repository":{"url":"git://github.com/plotly/point-cluster.git","type":"git"},"_npmVersion":"6.14.7","description":"Fast nd point clustering.","directories":{},"_nodeVersion":"12.13.1","dependencies":{"clamp":"^1.0.1","dtype":"^2.0.0","is-obj":"^1.0.1","defined":"^1.0.0","math-log2":"^1.0.1","parse-rect":"^1.2.0","array-bounds":"^1.0.1","pick-by-alias":"^1.2.0","flatten-vertex-data":"^1.0.2","binary-search-bounds":"^2.0.4"},"_hasShrinkwrap":false,"devDependencies":{"tape":"^4.8.0","bubleify":"^2.0.0","canvas-fit":"^1.5.0","almost-equal":"^1.1.0","gauss-random":"^1.0.1","snap-points-2d":"^3.2.0","math-float64-from-bits":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/point-cluster_3.1.9_1597680630925_0.5902296119165966","host":"s3://npm-registry-packages"}},"4.0.0":{"name":"@plotly/point-cluster","version":"4.0.0","keywords":["snap-points-2d","supercluster","quadtree","quad-tree","kdtree","kd-tree","ann-tree","point","scatter","point2d","2d","cluster","clustering","geospatial","markers","round","data","vis","gl-vis"],"author":{"name":"Dmitry Yv","email":"df.creative@gmail.com"},"license":"MIT","_id":"@plotly/point-cluster@4.0.0","maintainers":[{"name":"jmmease","email":"jon.mease@gmail.com"},{"name":"chriddyp","email":"chris@plot.ly"},{"name":"verazabeida","email":"vera.zabeida@gmail.com"},{"name":"bpostlethwaite","email":"post.ben.here@gmail.com"},{"name":"alexcjohnson","email":"alex@plot.ly"},{"name":"nicolaskruchten","email":"nicolas@kruchten.com"},{"name":"antrg","email":"antoine@plot.ly"},{"name":"archmoj","email":"arch.mojtaba.samimi@gmail.com"},{"name":"xhlu","email":"xing.han.lu@mail.mcgill.ca"},{"name":"jody_plotly","email":"jody@plot.ly"},{"name":"dmt0","email":"dmt.shvedov@gmail.com"},{"name":"emmanuelle","email":"emmanuelle.gouillart@nsup.org"},{"name":"rpkyle","email":"ryan@plotly.com"},{"name":"andrefarzat","email":"andrefarzat@gmail.com"},{"name":"harryturr","email":"harrisonn@plot.ly"},{"name":"hammadtheone","email":"hammadtheone@gmail.com"}],"homepage":"https://github.com/plotly/point-cluster#readme","bugs":{"url":"https://github.com/plotly/point-cluster/issues"},"dist":{"shasum":"18621565f04c38897a5a6e46081a6d2f20f7b7f6","tarball":"https://registry.npmjs.org/@plotly/point-cluster/-/point-cluster-4.0.0.tgz","fileCount":10,"integrity":"sha512-6M5QVU6/uH2E1PmIJ46a2GKRgX1lBUxkEblRosOQ6APmr6vvWh0irinvWCAcGyN0EWfQrvpeAEvYn6rOpC5x6A==","signatures":[{"sig":"MEQCID5RW1vLJFqW+6i9cVW/mrUoeO2N+jvMXHe4+wMbxYoWAiBTh0NuTnsQtFb/C1Og7V0vkixBQm7Fkjs50aBfv4v+lA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":28009,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBfMCCRA9TVsSAnZWagAAqioQAKSc4fBDUYpRWTD0xhrm\nmZGvDqqTg/n49BgBlYfKiEJjeGr318Ob2xOfJLh8ThoenQgNKZHHD0wce0wf\nfDPRegRfUnU1Pnx8RE37UVeL6EdtpghxgLwk+vbN66uYTqJlyj8FPXatQ/XN\npV8UsQ4jub3q166P3SiIDqfSkYoWbH0N/cCXWQCW9yQKiTsDa3l7T/UdfzX0\n64Wk/sb9+n47xNJ2+aUxRSJcbsotBM1crfCDQxvMODQYka1mInnhiZDWrW2+\nr0YEoBkfs4HilFKxAjHuxzbgaFnULE8mfCAwVcJeL3sGdrOIXFSs+ccrBVMt\nALnxDoBhiIzvoD+f7t1PY0keYIsI45e7ORoA9BmBzuVScGSO51Qr8rp3kQ2h\nFf2Nrz912kMCc1OrVXRklJrzlvFA5NUuo6ZMZwNorLB1lAsw7u1bGHAtoEiK\nxPseCLSFtSd154AhxfmBvzCPdGbtzdsTbLMIIx+YDaFHvTCW0Xh6/SnGrVsE\n8muvL0ErN42c0ekEaoulB/5i5/Vaxud/RzgPbMdyj9n7lJUvCpE1lu+T7k9o\nUL8UueD2GFbF0DioyFZ2iXjdkyssxMJhUryrhBOyzwk8ge3PULwzHSNU+K+V\nHZTxNNyfENr2JOGFkM4jrhPDk6+h27lrK2pYl9o2xnBZA/0aQPeG5BubFe2R\nOPIJ\r\n=Nfi8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"c590c6be83915f1d7a33e1018868a8d88c7225fd","scripts":{"test":"node test","build":"browserify demo.js -g bubleify | indexhtmlify | metadataify | github-cornerify > demo/index.html"},"_npmUser":{"name":"archmoj","email":"arch.mojtaba.samimi@gmail.com"},"browserify":{"transform":["bubleify"]},"repository":{"url":"git://github.com/plotly/point-cluster.git","type":"git"},"_npmVersion":"6.14.10","description":"Fast nd point clustering.","directories":{},"_nodeVersion":"12.13.1","dependencies":{"clamp":"^1.0.1","dtype":"^2.0.0","is-obj":"^1.0.1","defined":"^1.0.0","math-log2":"^1.0.1","parse-rect":"^1.2.0","array-bounds":"^1.0.1","pick-by-alias":"^1.2.0","flatten-vertex-data":"^1.0.2"},"_hasShrinkwrap":false,"devDependencies":{"tape":"^4.8.0","bubleify":"^2.0.0","canvas-fit":"^1.5.0","almost-equal":"^1.1.0","gauss-random":"^1.0.1","snap-points-2d":"^3.2.0","math-float64-from-bits":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/point-cluster_4.0.0_1611002625684_0.47850806163929294","host":"s3://npm-registry-packages"}}},"time":{"created":"2020-08-17T16:10:30.764Z","modified":"2026-09-14T15:41:51.273Z","3.1.9":"2020-08-17T16:10:31.065Z","4.0.0":"2021-01-18T20:43:45.836Z"},"bugs":{"url":"https://github.com/plotly/point-cluster/issues"},"author":{"name":"Dmitry Yv","email":"df.creative@gmail.com"},"license":"MIT","homepage":"https://github.com/plotly/point-cluster#readme","keywords":["snap-points-2d","supercluster","quadtree","quad-tree","kdtree","kd-tree","ann-tree","point","scatter","point2d","2d","cluster","clustering","geospatial","markers","round","data","vis","gl-vis"],"repository":{"url":"git://github.com/plotly/point-cluster.git","type":"git"},"description":"Fast nd point clustering.","maintainers":[{"email":"chris@plot.ly","name":"chriddyp"},{"email":"post.ben.here@gmail.com","name":"bpostlethwaite"},{"email":"antoine@plot.ly","name":"antrg"},{"email":"chuck@plot.ly","name":"bronsolo"},{"email":"t4rk@outlook.com","name":"t4rk"},{"email":"roman@plot.ly","name":"roman-nb"},{"email":"cameron.decoster@gmail.com","name":"camdecoster"},{"email":"alex@plot.ly","name":"alexcjohnson"},{"email":"adrian.borrmann@plot.ly","name":"aborrmann"},{"email":"emily@plot.ly","name":"emilykl-plotly"},{"email":"packages@plot.ly","name":"packages-team-plotly"}],"readme":"# point-cluster [![Build Status](https://travis-ci.org/dy/point-cluster.svg?branch=master)](https://travis-ci.org/dy/point-cluster) [![experimental](https://img.shields.io/badge/stability-experimental-yellow.svg)](http://github.com/badges/stability-badges)\n\nPoint clustering for 2D spatial indexing. Incorporates optimized quad-tree data structure.\n\n<!--\n* [ ] quad-tree, kd-tree, ann-tree and other tree types.\n* [x] splatting by zoom layers.\n* [x] point selection/hover by range.\n* [ ] point radius and weight.\n* [ ] reverse z-index order mode to keep visible points in reclustering.\n* [ ] appending/removing points.\n* [x] no visually noticeable clustering artifacts.\n* [x] high performance (faster than [snap-points-2d](https://github.com/gl-vis/snap-points-2d)).\n* [x] no memory overuse.\n\n[DEMO](https://github.com/dy/point-cluster)\n-->\n\n\n```js\nconst cluster = require('point-cluster')\n\nlet ids = cluster(points)\n\n// get point ids in the indicated range\nlet selectedIds = ids.range([10, 10, 20, 20])\n\n// get levels of details: list of ids subranges for rendering purposes\nlet lod = ids.range([10, 10, 20, 20], { lod: true })\n```\n\n## API\n\n### `ids = cluster(points, options?)`\n\nCreate index for the set of 2d `points` based on `options`.\n\n* `points` is an array of `[x,y, x,y, ...]` or `[[x,y], [x,y], ...]` coordinates.\n* `ids` is _Uint32Array_ with point ids sorted by zoom levels, suitable for WebGL buffer, subranging or alike.\n* `options`\n\nOption | Default | Description\n---|---|---\n`bounds` | `'auto'` | Data range, if different from `points` bounds, eg. in case of subdata.\n`depth` | `256` | Max number of levels. Points below the indicated level are grouped into single level.\n`output` | `'array'` | Output data array or data format. For available formats see [dtype](https://npmjs.org/package/dtype).\n<!-- `node` | `1` | Min size of node, ie. tree traversal is stopped once the node contains less than the indicated number of points. -->\n<!-- `sort` | `'z'` | Sort values within levels by `x`-, `y`-coordinate, `z`-curve or `r` - point radius. `z` is the fastest for init, `x` or `y` are faster for `lod` and `r` is the most data-relevant. -->\n<!-- `pick` | `'first'` | `'first'`, `'last'` or a function, returning point id for the level. -->\n\n---\n\n\n### `result = ids.range(box?, options?)`\n\nGet point ids from the indicated range.\n\n* `box` can be any rectangle object, eg. `[l, t, r, b]`, see [parse-rect](https://github.com/dy/parse-rect).\n* `options`\n\nOption | Default | Description\n---|---|---\n`lod` | `false` | Makes result a list of level details instead of ids, useful for obtaining subranges to render.\n`px` | `0` | Min pixel size in data dimension (number or `[width, height]` couple) to search for, to ignore lower levels.\n`level` | `null` | Max level to limit search.\n\n```js\nlet levels = ids.range([0,0, 100, 100], { lod: true, d: dataRange / canvas.width })\n\nlevels.forEach([from, to] => {\n\t// offset and count point to range in `ids` array\n\trender( ids.subarray( from, to ) )\n})\n```\n\n\n### Related\n\n* [snap-points-2d](https://github.com/gl-vis/snap-points-2d) − grouping points by pixels.\n* [kdgrass](https://github.com/dy/kdgrass) − minimal kd-tree implementation.\n* [regl-scatter2d](https://github.com/dfreative/regl-scatter2d) − highly performant scatter2d plot.\n\n\n## License\n\n© 2017 Dmitry Yv. MIT License\n\nDevelopment supported by [plot.ly](https://github.com/plotly/).\n","readmeFilename":"README.md"}