{"_id":"snap-points-2d","_rev":"62-e1534cd8d6223ec1a3feb8eee7de80d6","name":"snap-points-2d","dist-tags":{"latest":"4.0.0"},"versions":{"1.0.0":{"name":"snap-points-2d","version":"1.0.0","keywords":["snap","round","iterated","plot","2d","data","vis"],"author":{"name":"Mikola Lysenko"},"license":"MIT","_id":"snap-points-2d@1.0.0","maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}],"homepage":"https://github.com/mikolalysenko/snap-points-2d#readme","bugs":{"url":"https://github.com/mikolalysenko/snap-points-2d/issues"},"dist":{"shasum":"6796fd576dde3e5c3a0c03aaf4f73512452da812","tarball":"https://registry.npmjs.org/snap-points-2d/-/snap-points-2d-1.0.0.tgz","integrity":"sha512-vjxIsWcRyfx5tYD7fiCqbecu0pNwMo+uSvC/nQXs89rpyu0XyH52iXUdqgLYdAo9lx7p2dcQ0MVLzJTN1TXiZg==","signatures":[{"sig":"MEUCIBd/prmLHmCaods1Z/7m9Nu1ZuyIukp1a9yyq4T2MWPeAiEAkFLhVqd2TT/OlfKZ2PZMa/3Qyhu6pt+yXBs3iSWaTsY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"snap.js","_from":".","_shasum":"6796fd576dde3e5c3a0c03aaf4f73512452da812","gitHead":"5e6a3314786b99b768fb56fe0890f08006d0d790","scripts":{"test":"tape test/*.js"},"_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"repository":{"url":"git+https://github.com/mikolalysenko/snap-points-2d.git","type":"git"},"_npmVersion":"2.13.1","description":"snap round 2d points","directories":{},"_nodeVersion":"0.12.2","dependencies":{"typedarray-pool":"^1.1.0"}},"1.0.1":{"name":"snap-points-2d","version":"1.0.1","keywords":["snap","round","iterated","plot","2d","data","vis"],"author":{"name":"Mikola Lysenko"},"license":"MIT","_id":"snap-points-2d@1.0.1","maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}],"homepage":"https://github.com/mikolalysenko/snap-points-2d#readme","bugs":{"url":"https://github.com/mikolalysenko/snap-points-2d/issues"},"dist":{"shasum":"8a679a47e195fa31405b03dc6e0c03e18228dcf4","tarball":"https://registry.npmjs.org/snap-points-2d/-/snap-points-2d-1.0.1.tgz","integrity":"sha512-p39WtYU/m+PaFVQObSbqAfmUlFTsImEOj9RxMkcJghnm7WDVOy5vZ14mPkNzrHhbC1o1UoJzukbBBK4ToDYdZA==","signatures":[{"sig":"MEUCIFHaHw8ncupNxXLb3SJZVyKvgW8YppdXTcN/kWD5V1LxAiEA5t7Hfxv/XZzqN/GO4H1EoP5l1S10+wPiXcfS1jeOscU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"snap.js","_from":".","_shasum":"8a679a47e195fa31405b03dc6e0c03e18228dcf4","gitHead":"db573702bc5ba7707fbf94f1115ca4766923548e","scripts":{"test":"tape test/*.js"},"_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"repository":{"url":"git+https://github.com/mikolalysenko/snap-points-2d.git","type":"git"},"_npmVersion":"2.13.1","description":"snap round 2d points","directories":{},"_nodeVersion":"0.12.2","dependencies":{"typedarray-pool":"^1.1.0"}},"2.0.0":{"name":"snap-points-2d","version":"2.0.0","keywords":["snap","round","iterated","plot","2d","data","vis"],"author":{"name":"Mikola Lysenko"},"license":"MIT","_id":"snap-points-2d@2.0.0","maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}],"homepage":"https://github.com/mikolalysenko/snap-points-2d#readme","bugs":{"url":"https://github.com/mikolalysenko/snap-points-2d/issues"},"dist":{"shasum":"19415ac5677a401695f0183639935b81649db60f","tarball":"https://registry.npmjs.org/snap-points-2d/-/snap-points-2d-2.0.0.tgz","integrity":"sha512-N67BwP7e7HeU0jhBuaSl3Kqy/xEeqWkN2r/xh9IxYLOSoTEPPhHIxAXJmy4cweZAsLdkCi/Fq3xQ2BDU+J0MOQ==","signatures":[{"sig":"MEUCIFMN9JN1s98oGfYQyY8oYw5KNAF8Z+CCV3uJ09qHcRUnAiEAnHCxvpRfsMl+RWfaiUxK97m9ZhnEihy+uTLaEMmKQOA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"snap.js","_from":".","_shasum":"19415ac5677a401695f0183639935b81649db60f","gitHead":"b700c1a441e5f997b4011a78198255310974a926","scripts":{"test":"tape test/*.js"},"_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"repository":{"url":"git+https://github.com/mikolalysenko/snap-points-2d.git","type":"git"},"_npmVersion":"2.13.1","description":"snap round 2d points","directories":{},"_nodeVersion":"0.12.2","dependencies":{"typedarray-pool":"^1.1.0"},"devDependencies":{"gauss-random":"^1.0.1"}},"3.0.0":{"name":"snap-points-2d","version":"3.0.0","keywords":["snap","round","iterated","plot","2d","data","vis"],"author":{"name":"Mikola Lysenko"},"license":"MIT","_id":"snap-points-2d@3.0.0","maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}],"homepage":"https://github.com/mikolalysenko/snap-points-2d#readme","bugs":{"url":"https://github.com/mikolalysenko/snap-points-2d/issues"},"dist":{"shasum":"c96499bcf8c40ce2e7590305a98ca93b17f0675e","tarball":"https://registry.npmjs.org/snap-points-2d/-/snap-points-2d-3.0.0.tgz","integrity":"sha512-/8ZgSixx49RfST2aF3EKJPHGvF/MiuVGspzEg8qGC1g1AsWndIgn1/CTo2ZK5SFp3tzBv+wsw0M6tG7el5xgng==","signatures":[{"sig":"MEUCIEKoW08v4mYatNlgOaR/OOkaaJM9eUrRd/hN22DY7qDgAiEAvWfFZWNOQ3kq8r7qPGCNS10WFnyI0kLbNSTLzsFNzBA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"snap.js","_from":".","_shasum":"c96499bcf8c40ce2e7590305a98ca93b17f0675e","gitHead":"fccdceda5b5e741cd2ece1e8e18a5d32a1645a00","scripts":{"test":"tape test/*.js"},"_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"repository":{"url":"git+https://github.com/mikolalysenko/snap-points-2d.git","type":"git"},"_npmVersion":"2.13.1","description":"snap round 2d points","directories":{},"_nodeVersion":"0.12.2","dependencies":{"typedarray-pool":"^1.1.0"},"devDependencies":{"gauss-random":"^1.0.1"}},"3.1.0":{"name":"snap-points-2d","version":"3.1.0","keywords":["snap","round","iterated","plot","2d","data","vis"],"author":{"name":"Mikola Lysenko"},"license":"MIT","_id":"snap-points-2d@3.1.0","maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}],"homepage":"https://github.com/mikolalysenko/snap-points-2d#readme","bugs":{"url":"https://github.com/mikolalysenko/snap-points-2d/issues"},"dist":{"shasum":"6dcfc2a3c5de9dab02c2724b8577b907e463cf1a","tarball":"https://registry.npmjs.org/snap-points-2d/-/snap-points-2d-3.1.0.tgz","integrity":"sha512-xfTJ00/5hHIL9tPS2DR8mJjVttJjVmGzOYr0iAofZL+9Px4RT11ookeOt0Hik4E/R08DN6/0knCRuGOZUQAgsQ==","signatures":[{"sig":"MEUCIAcxh9DZ/RTz2j6BJOhtQJvUZWM/EV/8gdNwdiHI5dMFAiEA0OqpWXFsXSonq0toHu2WqkQtDQx5AZ8m+DMuu4tO/tw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"snap.js","_from":".","_shasum":"6dcfc2a3c5de9dab02c2724b8577b907e463cf1a","gitHead":"7bb63265677d565b62e66cb2b5571edf0e040a2e","scripts":{"test":"tape test/*.js"},"_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"repository":{"url":"git+https://github.com/mikolalysenko/snap-points-2d.git","type":"git"},"_npmVersion":"2.13.1","description":"snap round 2d points","directories":{},"_nodeVersion":"0.12.2","dependencies":{"typedarray-pool":"^1.1.0"},"devDependencies":{"tape":"^4.2.0","almost-equal":"^1.0.0","gauss-random":"^1.0.1"}},"3.2.0":{"name":"snap-points-2d","version":"3.2.0","keywords":["snap","round","iterated","plot","2d","data","vis"],"author":{"name":"Mikola Lysenko"},"license":"MIT","_id":"snap-points-2d@3.2.0","maintainers":[{"name":"bpostlethwaite","email":"post.ben.here@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"etpinard","email":"etienne.t.pinard@gmail.com"},{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},{"name":"monfera","email":"monfera.robert@gmail.com"},{"name":"rreusser","email":"rsreusser@gmail.com"}],"homepage":"https://github.com/mikolalysenko/snap-points-2d#readme","bugs":{"url":"https://github.com/mikolalysenko/snap-points-2d/issues"},"dist":{"shasum":"0e19e22a3a0e96bce21cdf5c7f1d7ed5b96745f0","tarball":"https://registry.npmjs.org/snap-points-2d/-/snap-points-2d-3.2.0.tgz","integrity":"sha512-3k44JUKntCpnBZzjACtPbJ84wfzG+U+sfmllctemfcy3No9mX5G+vuf5ElF0NN8Wmk85y0Vn4H3WGPbTcOCoOA==","signatures":[{"sig":"MEYCIQCdmEkfgID6xodyKWWgp94HsyL5YSocXyIqZk3MI2XWXQIhAMAAAA1wwCTmwwvz74LQenTKAe6ha4f9sa0TG5MA4hsr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"snap.js","_from":".","_shasum":"0e19e22a3a0e96bce21cdf5c7f1d7ed5b96745f0","gitHead":"50f307e90af7ce29c93689c7a9f1f99dd168c150","scripts":{"test":"tape test/*.js"},"_npmUser":{"name":"dfcreative","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/mikolalysenko/snap-points-2d.git","type":"git"},"_npmVersion":"4.6.1","description":"snap round 2d points","directories":{},"_nodeVersion":"8.1.2","dependencies":{"array-bounds":"^1.0.1"},"devDependencies":{"tape":"^4.2.0","almost-equal":"^1.0.0","gauss-random":"^1.0.1","typedarray-pool":"^1.1.0"},"_npmOperationalInternal":{"tmp":"tmp/snap-points-2d-3.2.0.tgz_1503944076011_0.2895423586014658","host":"s3://npm-registry-packages"}},"4.0.0":{"name":"snap-points-2d","version":"4.0.0","keywords":["snap","round","iterated","plot","2d","data","vis"],"author":{"name":"Mikola Lysenko"},"license":"MIT","_id":"snap-points-2d@4.0.0","maintainers":[{"name":"alexcjohnson","email":"alex@plot.ly"},{"name":"andrefarzat","email":"andrefarzat@gmail.com"},{"name":"antrg","email":"antoine@plot.ly"},{"name":"archmoj","email":"arch.mojtaba.samimi@gmail.com"},{"name":"bpostlethwaite","email":"post.ben.here@gmail.com"},{"name":"chriddyp","email":"chris@plot.ly"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dmt0","email":"dmt.shvedov@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"},{"name":"etpinard","email":"etienne.t.pinard@gmail.com"},{"name":"jackluo","email":"net.webjoy@gmail.com"},{"name":"jackparmer","email":"jack@plot.ly"},{"name":"jmmease","email":"jon.mease@gmail.com"},{"name":"marivet","email":"marcandre.rivet@gmail.com"},{"name":"maxkfranz","email":"maxkfranz@gmail.com"},{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},{"name":"monfera","email":"monfera.robert@gmail.com"},{"name":"nicolaskruchten","email":"nicolas@kruchten.com"},{"name":"rmarren1","email":"rymarr@tuta.io"},{"name":"rreusser","email":"rsreusser@gmail.com"},{"name":"shannon-lal","email":"shannonlal@hotmail.com"},{"name":"t4rk","email":"t4rk@outlook.com"},{"name":"verazabeida","email":"vera.zabeida@gmail.com"},{"name":"vnieman","email":"valentijn@plot.ly"},{"name":"wilzbach","email":"sebi.wilzbach@gmail.com"},{"name":"xhlu","email":"xing.han.lu@mail.mcgill.ca"}],"homepage":"https://github.com/mikolalysenko/snap-points-2d#readme","bugs":{"url":"https://github.com/mikolalysenko/snap-points-2d/issues"},"dist":{"shasum":"4a8155685595bd095d9693585688fe7ee9d27406","tarball":"https://registry.npmjs.org/snap-points-2d/-/snap-points-2d-4.0.0.tgz","fileCount":9,"integrity":"sha512-5lQJB9L+WwMIcMXQq3yAYRPUO80mZ5xpS2gSdTtg3FZnTAgzDx/Qk5GCCF53G27o2Z8kQN5qhseTcvURcI8PxQ==","signatures":[{"sig":"MEQCIB/+SoZLzRv9Vx9cxK8217vIBlrzbkkN3P6ZKy/Ld4tSAiBJAUhA4fE0/ipUN7xvKrB39HjgL66G74Qh64FPa4Bb+w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22027,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8ItVCRA9TVsSAnZWagAAHdkQAKNMspXH8e9DhTn8R9ns\nd4KGoWZnolbkRQkg4Qxsp5mJXI2rpJ+gWMre1XbgPIG1ZMJAMpnXWYqLfh0+\nAYtNettv8+rgTaa3RRIANxnBbolltyhd4IVCI7XqIKTdy91BH9GnwcCdEHmc\n9zzD7wz1Yd/+9TN7Ir5ORVttubEBVcY/IRZ6GKEth1pHJPv9fai77dZGtl87\ndKFffXjX2ZkENZDmTj5c81pXSfV1NPup6kodlO6u4VbJ88l6iDI1AhzZO+WM\nySaogrj+6brPq0qlDTInnIqVNgbGnYibTRE0jJMdeESYd+UnMKjyjYG2HfCy\nuHhhp9DuTjZNAdRG9MoP+WQ0GRbGVXuTrn7BClTIdoPeh2IwDvpNhOnVS9kD\nqattBD+c8lopX9EodtbN7c6rD/sa3zBGCp06LR8bCQQsjk60j1jZjmVQoHh8\neytXg5EfqkGXBKxHuQFW9sad9GQXI/V67g5Kgz6RsIe0hvsVplL/QTE77gvR\no26KX6sxsMrTapxsYA5IemSHcNc2mRARKFiUenGjs4oupabzxvWyLxfS1T3k\njk0w6W1wbmBYcSsN48ezmg7iezuKbQSjepL7gzd1e7ggHdxibHyhRxuBYDQp\nZcBPxsKFZ8qwAv2FYJUHG2rdBU6a3M2MHe6YCqwXct7F2fAL+EhnEnmFP/6X\n8xpe\r\n=ouyX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"snap.js","gitHead":"002f3908b4f0e647c9080c6148c74da222e9905a","scripts":{"test":"tape test.js"},"_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/mikolalysenko/snap-points-2d.git","type":"git"},"_npmVersion":"6.4.1","description":"snap round 2d points","directories":{},"_nodeVersion":"8.11.1","dependencies":{"array-bounds":"^1.0.1"},"_hasShrinkwrap":false,"devDependencies":{"tape":"^4.2.0","almost-equal":"^1.0.0","gauss-random":"^1.0.1","typedarray-pool":"^1.1.0","math-float64-bits":"^1.0.1"},"_npmOperationalInternal":{"tmp":"tmp/snap-points-2d_4.0.0_1542490964687_0.20263849185668992","host":"s3://npm-registry-packages"}}},"time":{"created":"2015-08-10T15:34:40.141Z","modified":"2026-09-14T15:42:25.458Z","1.0.0":"2015-08-10T15:34:40.141Z","1.0.1":"2015-08-10T20:04:28.635Z","2.0.0":"2015-08-21T19:47:30.205Z","3.0.0":"2015-09-02T15:31:51.601Z","3.1.0":"2015-09-26T03:40:07.361Z","3.2.0":"2017-08-28T18:14:36.959Z","4.0.0":"2018-11-17T21:42:44.847Z"},"bugs":{"url":"https://github.com/mikolalysenko/snap-points-2d/issues"},"author":{"name":"Mikola Lysenko"},"license":"MIT","homepage":"https://github.com/mikolalysenko/snap-points-2d#readme","keywords":["snap","round","iterated","plot","2d","data","vis"],"repository":{"url":"git+https://github.com/mikolalysenko/snap-points-2d.git","type":"git"},"description":"snap round 2d points","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"},{"email":"mikolalysenko@gmail.com","name":"mikolalysenko"},{"email":"net.webjoy@gmail.com","name":"jackluo"},{"email":"andrefarzat@gmail.com","name":"andrefarzat"},{"email":"df.creative@gmail.com","name":"dfcreative"},{"email":"nicolas@kruchten.com","name":"nicolaskruchten"},{"email":"maxkfranz@gmail.com","name":"maxkfranz"},{"email":"code@etpinard.xyz","name":"etpinard"},{"email":"rsreusser@gmail.com","name":"rreusser"},{"email":"sebi.wilzbach@gmail.com","name":"wilzbach"},{"email":"monfera.robert@gmail.com","name":"monfera"},{"email":"marcandre.rivet@gmail.com","name":"marivet"},{"email":"jack@plot.ly","name":"jackparmer"},{"email":"shannonlal@hotmail.com","name":"shannon-lal"},{"email":"rymarr@tuta.io","name":"rmarren1"},{"email":"vera.zabeida@gmail.com","name":"verazabeida"},{"email":"npm@xinghanlu.com","name":"xhlu"},{"email":"jon.mease@gmail.com","name":"jmmease"},{"email":"valentijn@plot.ly","name":"vnieman"},{"email":"dmt.shvedov@gmail.com","name":"dmt0"},{"email":"arch.mojtaba.samimi@gmail.com","name":"archmoj"},{"email":"df.creative@gmail.com","name":"dy"}],"readme":"# snap-points-2d\r\n\r\nRuns iterative snap rounding on a set of 2D coordinates to produce a hierarchical level of detail for optimizing online rendering of huge 2D plots.\r\n\r\n# Install\r\n\r\n```\r\nnpm i snap-points-2d\r\n```\r\n\r\n# API\r\n\r\n#### `{levels, ids, weights, points} = require('snap-points-2d')(points, bounds?)`\r\n\r\nReorders the `points` hierarchically such that those which are drawn at the same pixel coordinate are grouped together.\r\n\r\n##### Inputs\r\n* `points` is an input array of 2*n coordinate values. It is kept untouched.\r\n* `bounds` is an optional array of 4 bounding box values of the points.\r\n\r\n##### Outputs\r\n* `points` is an output float64 array with reordered an normalized to `bounds` point values.\r\n* `ids` is an output uint32 array which gets the reordered index of the points.\r\n* `weights` is an output uint32 array of point weights (number of points at the same pixel), which can be used for transparent rendering.\r\n* `levels` is an array of LOD scales.  Each record is an object with the following properties:\r\n\t* `pixelSize` the pixel size of this level of detail in data units\r\n\t* `offset` the offset of this lod within the output array\r\n\t* `count` the number of items in the lod\r\n\r\n# License\r\n(c) 2015 Mikola Lysenko. MIT License\r\n","readmeFilename":"README.md"}