{"name":"svgpath","version":"2.2.3","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 && mocha","coverage":"rm -rf coverage && istanbul cover _mocha","report-coveralls":"istanbul cover _mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage"},"devDependencies":{"ansi":"^0.3.1","benchmark":"^2.1.1","coveralls":"^3.0.3","eslint":"^5.16.0","istanbul":"^0.4.5","mocha":"^6.1.4"},"gitHead":"ed7194dc88f17034f153293728411ca046e0356e","bugs":{"url":"https://github.com/fontello/svgpath/issues"},"homepage":"https://github.com/fontello/svgpath#readme","_id":"svgpath@2.2.3","_nodeVersion":"10.17.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-xA0glXYpJ9SYT4JeMp3c0psbqdZsG1c0ywGvdJUPY2FKEgwJV7NgkeYuuQiOxMp+XsK9nCqjm3KDw0LkM1YLXw==","shasum":"749c673899f92c3a4fc2d5415cf85dec349d9512","tarball":"http://registry-npm.ywwl.com/svgpath/download/svgpath-2.2.3.tgz","fileCount":12,"unpackedSize":43181,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeJJT4CRA9TVsSAnZWagAA4voP/3L51M5DcTfKbop4EMNW\njzRRxgT5icFO+Husd2GoPQuueKVbKY4QLwrcU/6aNGBY0WHsZJqKlyqkwxTA\nylmO1X04W0X3/TllZ49qSONinBRacGwd+t7lmt5ZMIdAn6PTwcTFVP4BBruH\n//LY97FfYyxRFa6Uar1WnpAdlCoPtLIp/i6+ev5afHaPn9eFcnaDeeccJVAU\naDk63eB1XCZfAnlAiA2lAUsOpyRC8Mo5ORxsvHpiYhZLj/v4RFFIaeKm5sqs\nwQHc48QOe7mwm3ZGOSgv9HHyqBo7lOlJJo+ZO++h4WRxRfjdGwqr35u447yS\nD7whT30LlZEJEQ77YUGKBLVh4EAgSjvR47LG7wzjbsl4Elznm3oIpII9z/pj\nygZNrJKjYydq9XsFvcA8lpVdvkqqf3incGFDWIXWvWdyK2IakAYCMVRJQrjj\nj6nQA1WIacZfEvNISEseS7GVB3FojCqyQV4pCmetUdVzrtgqT5oESdBRf9rC\nuYXsZMFA8NDiLML2TNSNxOp5Ev5GFn82wShDbg4lwrRc1vgcSfal26BQ9ABM\n38vkMIp40ozXqMeait04vt9O1mwpyRwJ4Lq+a+dxpN0zFlGU6VBXHmumCtMR\nQ/0nt9GoOj0YsYqlwxpewET7wKr83RR8uRP/PzxfQ15tIJzQcYvt2xUuGBcb\nM1oC\r\n=CFXB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBdKJvN8KA4ZjmwGUK0YbGCh6Imxct+pEQjujVmkYQgiAiAv1ym+Zy4Lm5OyWKqnf1YIIncTXOQ/CBXVrC73tMJprA=="}],"size":13512,"noattachment":false,"key":"/svgpath/-/svgpath-2.2.3.tgz"},"maintainers":[{"name":"vitaly","email":"vitaly@rcdesign.ru"}],"_npmUser":{"name":"vitaly","email":"vitaly@rcdesign.ru"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/svgpath_2.2.3_1579455735539_0.6959950897122384"},"_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":1579455735808,"_cnpm_publish_time":1579455735808,"dist-tags":{"latest":"2.6.0"}}