{"name":"lineclip","version":"2.0.0","description":"A fast polyline and polygon clipping library.","main":"index.js","type":"module","exports":"./index.js","devDependencies":{"benchmark":"^2.1.4","eslint":"^9.31.0","eslint-config-mourner":"^4.1.0"},"scripts":{"pretest":"eslint *.js","test":"node test.js","cov":"node --experimental-test-coverage test.js"},"repository":{"type":"git","url":"git+https://github.com/mapbox/lineclip.git"},"keywords":["algorithm","line","polyline","polygon","geometry","clip","geo","cohen-sutherland"],"author":{"name":"Vladimir Agafonkin"},"license":"ISC","bugs":{"url":"https://github.com/mapbox/lineclip/issues"},"homepage":"https://github.com/mapbox/lineclip#readme","_id":"lineclip@2.0.0","gitHead":"54165c748dd114e2c17a2cfe119f1905caea7f7e","_nodeVersion":"20.15.1","_npmVersion":"11.3.0","dist":{"integrity":"sha512-PosanfyLckGXZbCX+aWmfmHWWhVPnLf9iKcUefaSGGw2IBOef5XdBdyl175LEqRy/sEOZ2SEz/l7K5S93BZlYQ==","shasum":"f15b135dc6cb5373b3a7afeae9e93d6d85e3bae3","tarball":"http://registry-npm.ywwl.com/lineclip/download/lineclip-2.0.0.tgz","fileCount":8,"unpackedSize":10413,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDEkW36L/HBIacYJpjlKOjZkOECOpsogl9wQ+7Rua2dOAiEAxrzNzDVhNudgtQxEy33KSpY8bGgPRGFLBj5R8nHYoQY="}],"size":4000,"noattachment":false,"key":"/lineclip/-/lineclip-2.0.0.tgz"},"_npmUser":{"name":"mbx-npm-02-production","email":"yannick.meeus+npm+prod+02@mapbox.com"},"directories":{},"maintainers":[{"name":"mapbox-npm-01","email":"accounts+npmjs-01@mapbox.com"},{"name":"mapbox-npm-02","email":"accounts+npmjs-02@mapbox.com"},{"name":"mapbox-npm-07","email":"accounts+npmjs-07@mapbox.com"},{"name":"mapbox-npm-03","email":"accounts+npmjs-03@mapbox.com"},{"name":"mapbox-npm-04","email":"accounts+npmjs-04@mapbox.com"},{"name":"mapbox-npm-09","email":"accounts+npmjs-09@mapbox.com"},{"name":"mapbox-npm-05","email":"accounts+npmjs-05@mapbox.com"},{"name":"mapbox-npm-06","email":"accounts+npmjs-06@mapbox.com"},{"name":"mapbox-npm-08","email":"accounts+npmjs-08@mapbox.com"},{"name":"mapbox-npm-advanced-actions","email":"accounts+npmjs-advanced-actions@mapbox.com"},{"name":"mapbox-npm-ci","email":"accounts+npmjs-npm-ci@mapbox.com"},{"name":"mapbox-npm","email":"accounts+npmjs@mapbox.com"},{"name":"mapbox-admin","email":"accounts@mapbox.com"},{"name":"mapbox-machine-user","email":"accounts+npm-mapbox-machine-user@mapbox.com"},{"name":"mbx-npm-ci-staging","email":"yannick.meeus+npm+staging+ci@mapbox.com"},{"name":"mbx-npm-ci-production","email":"yannick.meeus+npm+production+ci@mapbox.com"},{"name":"mbx-npm-01-production","email":"yannick.meeus+npm+prod+01@mapbox.com"},{"name":"mbx-npm-02-production","email":"yannick.meeus+npm+prod+02@mapbox.com"},{"name":"mbx-npm-03-production","email":"yannick.meeus+npm+prod+03@mapbox.com"},{"name":"mbx-npm-04-production","email":"yannick.meeus+npm+prod+04@mapbox.com"},{"name":"mbx-npm-05-production","email":"yannick.meeus+npm+prod+05@mapbox.com"},{"name":"mbx-npm-06-production","email":"yannick.meeus+npm+prod+06@mapbox.com"},{"name":"mbx-npm-07-production","email":"yannick.meeus+npm+prod+07@mapbox.com"},{"name":"mbx-npm-08-production","email":"yannick.meeus+npm+prod+08@mapbox.com"},{"name":"mbx-npm-09-production","email":"yannick.meeus+npm+prod+09@mapbox.com"},{"name":"mbx-npm-02-staging","email":"yannick.meeus@mapbox.com"},{"name":"mbx-npm-advanced-actions-staging","email":"yannick.meeus+npm+staging+advanced+actions@mapbox.com"},{"name":"mbx-npm-advanced-actions-production","email":"yannick.meeus+npm+prod+advanced+actions@mapbox.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/lineclip_2.0.0_1752675314034_0.17226789844025414"},"_hasShrinkwrap":false,"readme":"## lineclip\n\n[![Build Status](https://travis-ci.org/mapbox/lineclip.svg?branch=master)](https://travis-ci.org/mapbox/lineclip)\n[![Coverage Status](https://coveralls.io/repos/mapbox/lineclip/badge.svg?branch=master&service=github)](https://coveralls.io/github/mapbox/lineclip?branch=master)\n\nA very fast JavaScript library for clipping polylines and polygons by a bounding box.\n\n- uses [Cohen-Sutherland algorithm](https://en.wikipedia.org/wiki/Cohen%E2%80%93Sutherland_algorithm) for line clipping\n- uses [Sutherland-Hodgman algorithm](https://en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman_algorithm) for polygon clipping\n\n```js\nlineclip(\n    [[-10, 10], [10, 10], [10, -10]], // line\n    [0, 0, 20, 20]); // bbox\n// returns [[[0, 10], [10, 10], [10, 0]]]\n```\n\n\n### API\n\n#### lineclip.polyline(points, bbox[, result])\n\n- `points` — an array of `[x, y]` points\n- `bbox` — a bounding box as `[xmin, ymin, xmax, ymax]`\n- `result` — an array to append the results to\n\nReturns an array of clipped lines.\n\n`lineclip` is an alias to `lineclip.polyline`.\n\n#### lineclip.polygon(points, bbox)\n\nReturns a clipped polygon.\n\n### Changelog\n\n#### 1.1.5 (Sep 23, 2015)\n\n- Fixed a bug where polygon clip broke on out-of-bbox polygons.\n\n#### 1.1.4 (Sep 22, 2015)\n\n- Fixed a bug where last point was omitted if the last two points are in bbox.\n- Fixed a bug where a line outside of bbox would produce `[[]]` instead of `[]`.\n\n#### 1.1.3 (Sep 12, 2015)\n\n- Fixed a polygon clipping race condition.\n\n#### 1.1.2 (Sep 11, 2015)\n\n- Fixed a bug that completely broke the clipping on many cases. Sorry!\n\n#### 1.1.1 (Sep 11, 2015)\n\n- Fixed a polyline clipping edge case.\n\n#### 1.1.0 (Sep 11, 2015)\n\n- Added Sutherland-Hodgeman polygon clipping (`lineclip.polygon`).\n\n#### 1.0.1 (Sep 11, 2015)\n\n- Minor code cleanup and optimizations.\n\n#### 1.0.0 (Sep 8, 2015)\n\n- Initial release.\n","publish_time":1752675314258,"_cnpm_publish_time":1752675314258,"dist-tags":{"latest":"2.0.0"}}