{"name":"svgpath","version":"2.5.0","description":"Low level toolkit for SVG paths transformations.","keywords":["svg","path","transform","scale","translate","rotate","matrix"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/fontello/svgpath.git"},"scripts":{"lint":"eslint .","test":"npm run lint && nyc mocha","covreport":"nyc report --reporter html && nyc report --reporter lcov","benchmark":"benchmark/benchmark.js","benchmark-prepare":"mkdir -p benchmark/implementations/2.4.1 && git checkout 2.4.1 && cp index.js benchmark/implementations/2.4.1 && cp -R --parents **/*.js benchmark/implementations/2.4.1 && git checkout master"},"devDependencies":{"benchmark":"^2.1.1","eslint":"^8.5.0","mocha":"^9.1.0","nyc":"^15.0.1"},"types":"./index.d.ts","gitHead":"287c612ad84c00e0604fcfa6ffa6557da423868d","bugs":{"url":"https://github.com/fontello/svgpath/issues"},"homepage":"https://github.com/fontello/svgpath#readme","_id":"svgpath@2.5.0","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-o/vohwqjUO9nDAh4rcjE3KaW/v//At8UJu2LJMybXidf5QLQLVA4bxH0//4YCsr+1H4Gw1Wi/Jc62ynzSBYidw==","shasum":"d57434641d9aa9abae02a4038ebf281fa3005b10","tarball":"http://registry-npm.ywwl.com/svgpath/download/svgpath-2.5.0.tgz","fileCount":11,"unpackedSize":43163,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3d2RCRA9TVsSAnZWagAAAooP/2mPKge/fQ+rws3viUjk\nBAVSPIMmyUt2W+xmetuxHE1kwwHJKUOy0aPtthNQQHAs/+dNTVevqFKavuE0\nYzu8jE6Zk+Y2kYA34xuNAJL7Jo3ZCbFefSMv6Kk/IZUTYsjgje0o8onbx+ZK\nBu5uqPh7WxgqgyW7FIieRyh81Ji9aCuXPbTwVuP3e2F9P4O1VV8/fIZpb7cr\nRnBP7WgQXww5OtGR7qA4av3J3oS3yBZQAH7cjmyy4E9AODUa/tCZ4J51rdvn\n4I3Zckn/FxvO/5jVhAFc1M0dLO/AOJFT2dvdugbPFYIHkEo98v3DlqI9mzHE\n06zln6URdm9vSABqKsHNLqJ4Wejvvq6K3kvrSs7jCmJW6p56NaX1YS1uQdS6\nTo7kGPMJYWIOQkRn6aWRBgai/5S02ujOuPRDoiJ23KcNl8weYomHXmpRT6oD\nr+vMSRJhvmdniFX8fumqblVeWTKTJssxFYXvT78OjqZGZ4n46pUgza+5YJAF\nCbNivYo/S1/JdRjiN3/vW3WLrnD6CD2jqUW1kwCo5jR8EQ/UbBlNJVMx8cZ/\nSuusEXpz4hX3NFtzIbSci540xaIrnyzNXcYMoM3Ci6CWdotXm55k0TFkoSsh\nj4+GAJZHXMSLCpjZqF8OVOt+nQ9EijeSEkIdMb/cIJ6MVfMrqViaR2u9ZATk\nCYVU\r\n=3NBQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCx0E9WGcbPZN/DpdXZkkp3jpJF8ATZsGWWpvBhUWvNqAIhAPJpgdufSfk1J8jXrQW/E2R2X1pdnjuvsWZHFChuHyVd"}],"size":13016,"noattachment":false,"key":"/svgpath/-/svgpath-2.5.0.tgz"},"_npmUser":{"name":"vitaly","email":"vitaly@rcdesign.ru"},"directories":{},"maintainers":[{"name":"vitaly","email":"vitaly@rcdesign.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/svgpath_2.5.0_1641930129475_0.515224719416852"},"_hasShrinkwrap":false,"readme":"svgpath\n=======\n\n[![CI](https://github.com/fontello/svgpath/workflows/CI/badge.svg)](https://github.com/fontello/svgpath/actions)\n[![NPM version](https://img.shields.io/npm/v/svgpath.svg?style=flat)](https://www.npmjs.org/package/svgpath)\n[![Coverage Status](https://img.shields.io/coveralls/fontello/svgpath/master.svg?style=flat)](https://coveralls.io/r/fontello/svgpath?branch=master)\n\n\n> Low level toolkit for SVG paths transformations.\nSometimes you can't use `transform` attributes and have to apply changes to svg paths directly.\nThen this package is for you :) !\n\nNote: this package works with [path data](https://www.w3.org/TR/SVG11/paths.html#PathData) strings,\nnot with full svg xml sources.\n\n\nInstall\n-------\n\n```bash\nnpm install svgpath\n```\n\n\nExample\n-------\n\n```js\nvar svgpath = require('svgpath');\n\nvar transformed = svgpath(__your_path__)\n                    .scale(0.5)\n                    .translate(100,200)\n                    .rel()\n                    .round(1)\n                    .toString();\n```\n\n\nAPI\n---\n\nAll methods are chainable (return self).\n\n\n### new SvgPath(path) -> self\n\nConstructor. Creates new `SvgPath` class instance with chainable methods.\n`new` can be omited.\n\n\n### SvgPath.from(path|SvgPath) -> self\n\nSimilar to `Array.from()`. Creates `SvgPath` instance from string or another\ninstance (data will be cloned).\n\n\n### .abs() -> self\n\nConverts all path commands to absolute.\n\n\n### .rel() -> self\n\nConverts all path commands to relative. Useful to reduce output size.\n\n\n### .scale(sx [, sy]) -> self\n\nRescale path (the same as SVG `scale` transformation). `sy` = `sx` by default.\n\n\n### .translate(x [, y]) -> self\n\nRescale path (the same as SVG `translate` transformation). `y` = 0 by default.\n\n\n### .rotate(angle [, rx, ry]) -> self\n\nRotate path to `angle` degrees around (rx, ry) point. If rotation center not set,\n(0, 0) used. The same as SVG `rotate` transformation.\n\n\n### .skewX(degrees) -> self\n\nSkew path along the X axis by `degrees` angle.\n\n\n### .skewY(degrees) -> self\n\nSkew path along the Y axis by `degrees` angle.\n\n\n### .matrix([ m1, m2, m3, m4, m5, m6 ]) -> self\n\nApply 2x3 affine transform matrix to path. Params - array. The same as SVG\n`matrix` transformation.\n\n\n### .transform(string) -> self\n\nAny SVG transform or their combination. For example `rotate(90) scale(2,3)`.\nThe same format, as described in SVG standard for `transform` attribute.\n\n\n### .unshort() -> self\n\nConverts smooth curves `T`/`t`/`S`/`s` with \"missed\" control point to\ngeneric curves (`Q`/`q`/`C`/`c`).\n\n\n### .unarc() -> self\n\nReplaces all arcs with bezier curves.\n\n\n### .toString() -> string\n\nReturns final path string.\n\n\n### .round(precision) -> self\n\nRound all coordinates to given decimal precision. By default round to integer.\nUseful to reduce resulting output string size.\n\n\n### .iterate(function(segment, index, x, y) [, keepLazyStack]) -> self\n\nApply iterator to all path segments.\n\n- Each iterator receives `segment`, `index`, `x` and `y` params.\n  Where (x, y) - absolute coordinates of segment start point.\n- Iterator can modify current segment directly (return nothing in this case).\n- Iterator can return array of new segments to replace current one (`[]` means\n  that current segment should be delated).\n\nIf second param `keepLazyStack` set to `true`, then iterator will not evaluate\nstacked transforms prior to run. That can be useful to optimize calculations.\n\n\nSupport svgpath\n---------------\n\nYou can support this project via [Tidelift subscription](https://tidelift.com/subscription/pkg/npm-svgpath?utm_source=npm-svgpath&utm_medium=referral&utm_campaign=readme).\n","publish_time":1641930129666,"_cnpm_publish_time":1641930129666,"dist-tags":{"latest":"2.6.0"}}