{"name":"roughjs","version":"4.2.2","description":"Create graphics using HTML Canvas or SVG with a hand-drawn, sketchy, appearance.","main":"bundled/rough.cjs.js","module":"bundled/rough.esm.js","browser":"bundled/rough.js","types":"bin/rough.d.ts","scripts":{"build":"rm -rf bin && tsc && rollup -c","lint":"tslint -p tsconfig.json","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/pshihn/rough.git"},"keywords":["canvas","svg","graphics","sketchy","hand drawn","hand-drawn"],"author":{"name":"Preet Shihn","email":"preetshihn@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/pshihn/rough/issues"},"homepage":"https://roughjs.com","devDependencies":{"@rollup/plugin-typescript":"^2.1.0","rollup":"^1.32.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-terser":"^5.3.0","tslint":"^5.20.1","typescript":"^3.8.3"},"dependencies":{"path-data-parser":"^0.1.0","points-on-curve":"^0.2.0","points-on-path":"^0.2.0"},"gitHead":"8c139bacff84f5b62abc5aa6b58f949a110b2a8f","_id":"roughjs@4.2.2","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-cvYZlcAzP9oP7pJqnaGowsHm0RJHXctjsuHhnmlp2bLB9b5OYhx1mAf8MoNrZ1lWFxkLUjawMbLRiWS1F+GvlQ==","shasum":"2b32f53b81f68cc5f974edde4016596697208342","tarball":"http://registry-npm.ywwl.com/roughjs/download/roughjs-4.2.2.tgz","fileCount":42,"unpackedSize":150799,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeniOBCRA9TVsSAnZWagAARfUP/RY3yhIiQE2nFQ0VrZOF\neUNLW99AnkwplFfVWqLFZjdwVJYx/hWZ4BiKMYmflO8MjQVoPAQrIymMvPfz\nLvKKpMatJq7NP5ldtayIiB+xr0XJIo7TV+A5Ak4R0t+f8B7eiBjYSbHk3/sQ\n5WNPLjWahMklFXIrZL9l+MOcFOl0QDO3/mWqH89fgXO6N/qc1UhXsx/E5aLa\nXKx9+1wFLUTcOz2nTjfWK/vK4PxYzd++Qx5VbJbppTdApudBokm8cyA+ybnw\nRq3A21YLRkUE6LVg8QX+CTR+rLbCe787qeEn2Il9eNtXuf+2Qb+JmfIhNlk8\nLCqIgy+AcgV1QpjbfvZ9wk+hOdR0qn6ZHjHu5xm/TZvx6yBuMaV7GGMBzkql\nmBdw9ZtblNmJqIxuTmrEKAVLUNYhy3EKOA7lj3AHLBs7c6CpB7TKhWgAltGe\nWcVtsmuxwH10CLFLwYapqvD3clZ8xRcU3L8llfc5M/Ea2UJwAMqvJdduPFxl\n25+ocXPeUOR6BKVuEjadeV7YQ0LUpJJHV1vHAVP9Vck7t+aHOhE5kSQnpnGg\neFoUclu6/VyXMZRGh55C2YsLYCyXZ6kCC0MttnYL2qSMITE13IQbwp7M2uqq\nBUbI+Ev5LSDl6F53ocN40BXAKxjPFRBAjG9kC9iS8QbBcgAYcNnDuJUZ+Fy+\nZdF7\r\n=qYp7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXUH3QlldlQt4vlPyIs0APsKM7uUTUb+vV7gY9TP0f6gIhAPV+NP0Meh+HD/SLyDSHaHFOOQO9p3spyQwGkaZzW0Hc"}],"size":31990,"noattachment":false,"key":"/roughjs/-/roughjs-4.2.2.tgz"},"maintainers":[{"name":"shihn","email":"preetshihn@gmail.com"}],"_npmUser":{"name":"shihn","email":"preetshihn@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/roughjs_4.2.2_1587422080878_0.06554991079543693"},"_hasShrinkwrap":false,"readme":"# Rough.js\n\n<b>Rough.js</b> is a small (\\<9 kB) graphics library that lets you draw in a _sketchy_, _hand-drawn-like_, style.\nThe library defines primitives to draw lines, curves, arcs, polygons, circles, and ellipses. It also supports drawing [SVG paths](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths).\n\nRough.js works with both [Canvas](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API) and [SVG](https://developer.mozilla.org/en-US/docs/Web/SVG).\n\n![Rough.js sample](https://roughjs.com/images/cap_demo.png)\n\n[@RoughLib](https://twitter.com/RoughLib) on Twitter.\n\n## Install\n\nfrom npm:\n\n```\nnpm install --save roughjs\n```\n\nOr get the latest using unpkg: https://unpkg.com/roughjs@latest/bundled/rough.js\n\n\nIf you are looking for bundled version in different formats, the npm package will have these in the following locations:\n\nCommonJS: `roughjs/bundled/rough.cjs.js`\n\nESM: `roughjs/bundled/rough.esm.js`\n\nBrowser IIFE: `roughjs/bundled/rough.js`\n\n\n## Usage\n\n![Rough.js rectangle](https://roughjs.com/images/m1.png)\n\n```js\nconst rc = rough.canvas(document.getElementById('canvas'));\nrc.rectangle(10, 10, 200, 200); // x, y, width, height\n```\n\nor SVG\n\n```js\nconst rc = rough.svg(svg);\nlet node = rc.rectangle(10, 10, 200, 200); // x, y, width, height\nsvg.appendChild(node);\n```\n\n### Lines and Ellipses\n\n![Rough.js rectangle](https://roughjs.com/images/m2.png)\n\n```js\nrc.circle(80, 120, 50); // centerX, centerY, diameter\nrc.ellipse(300, 100, 150, 80); // centerX, centerY, width, height\nrc.line(80, 120, 300, 100); // x1, y1, x2, y2\n```\n\n### Filling\n\n![Rough.js rectangle](https://roughjs.com/images/m3.png)\n\n```js\nrc.circle(50, 50, 80, { fill: 'red' }); // fill with red hachure\nrc.rectangle(120, 15, 80, 80, { fill: 'red' });\nrc.circle(50, 150, 80, {\n  fill: \"rgb(10,150,10)\",\n  fillWeight: 3 // thicker lines for hachure\n});\nrc.rectangle(220, 15, 80, 80, {\n  fill: 'red',\n  hachureAngle: 60, // angle of hachure,\n  hachureGap: 8\n});\nrc.rectangle(120, 105, 80, 80, {\n  fill: 'rgba(255,0,200,0.2)',\n  fillStyle: 'solid' // solid fill\n});\n```\n\nFill styles can be: **hachure**(default), **solid**, **zigzag**, **cross-hatch**, **dots**, **dashed**, or **zigzag-line**\n\n![Rough.js fill examples](https://roughjs.com/images/m14.png)\n\n### Sketching style\n\n![Rough.js rectangle](https://roughjs.com/images/m4.png)\n\n```js\nrc.rectangle(15, 15, 80, 80, { roughness: 0.5, fill: 'red' });\nrc.rectangle(120, 15, 80, 80, { roughness: 2.8, fill: 'blue' });\nrc.rectangle(220, 15, 80, 80, { bowing: 6, stroke: 'green', strokeWidth: 3 });\n```\n\n### SVG Paths\n\n![Rough.js paths](https://roughjs.com/images/m5.png)\n\n```js\nrc.path('M80 80 A 45 45, 0, 0, 0, 125 125 L 125 80 Z', { fill: 'green' });\nrc.path('M230 80 A 45 45, 0, 1, 0, 275 125 L 275 80 Z', { fill: 'purple' });\nrc.path('M80 230 A 45 45, 0, 0, 1, 125 275 L 125 230 Z', { fill: 'red' });\nrc.path('M230 230 A 45 45, 0, 1, 1, 275 275 L 275 230 Z', { fill: 'blue' });\n```\n\nSVG Path with simplification:\n\n![Rough.js texas map](https://roughjs.com/images/m9.png) ![Rough.js texas map](https://roughjs.com/images/m10.png)\n\n## Examples\n\n![Rough.js US map](https://roughjs.com/images/m6.png)\n\n[View examples here](https://github.com/pshihn/rough/wiki/Examples)\n\n## API & Documentation\n\n[Full Rough.js API](https://github.com/pshihn/rough/wiki)\n\n## Credits\n\nSome of the core algorithms were adapted from [handy](https://www.gicentre.net/software/#/handy/) processing lib.\n\nAlgorithm to convert SVG arcs to Canvas [described here](https://www.w3.org/TR/SVG/implnote.html) was adapted from [Mozilla codebase](https://hg.mozilla.org/mozilla-central/file/17156fbebbc8/content/svg/content/src/nsSVGPathDataParser.cpp#l887)\n\n## Contributors\n\n### Financial Contributors\n\nBecome a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/rough/contribute)]\n\n#### Individuals\n\n<a href=\"https://opencollective.com/rough\"><img src=\"https://opencollective.com/rough/individuals.svg?width=890\"></a>\n\n#### Organizations\n\nSupport this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/rough/contribute)]\n\n<a href=\"https://excalidraw.com/\"><img src=\"https://avatars.githubusercontent.com/u/59452120?s=64&v=4\"></a>\n<a href=\"https://www.diagrams.net/\"><img src=\"https://avatars.githubusercontent.com/u/1769238?s=64&v=4\"></a>\n<a href=\"https://terrastruct.com/\"><img width=\"64\" height=\"64\" src=\"https://roughjs.com/images/sponsors/terrastruct.png\"></a>\n<a href=\"https://opencollective.com/rough/organization/0/website\"><img src=\"https://opencollective.com/rough/organization/0/avatar.svg\"></a>\n<a href=\"https://opencollective.com/rough/organization/1/website\"><img src=\"https://opencollective.com/rough/organization/1/avatar.svg\"></a>\n<a href=\"https://opencollective.com/rough/organization/2/website\"><img src=\"https://opencollective.com/rough/organization/2/avatar.svg\"></a>\n<a href=\"https://opencollective.com/rough/organization/3/website\"><img src=\"https://opencollective.com/rough/organization/3/avatar.svg\"></a>\n<a href=\"https://opencollective.com/rough/organization/4/website\"><img src=\"https://opencollective.com/rough/organization/4/avatar.svg\"></a>\n<a href=\"https://opencollective.com/rough/organization/5/website\"><img src=\"https://opencollective.com/rough/organization/5/avatar.svg\"></a>\n<a href=\"https://opencollective.com/rough/organization/6/website\"><img src=\"https://opencollective.com/rough/organization/6/avatar.svg\"></a>\n<a href=\"https://opencollective.com/rough/organization/7/website\"><img src=\"https://opencollective.com/rough/organization/7/avatar.svg\"></a>\n<a href=\"https://opencollective.com/rough/organization/8/website\"><img src=\"https://opencollective.com/rough/organization/8/avatar.svg\"></a>\n<a href=\"https://opencollective.com/rough/organization/9/website\"><img src=\"https://opencollective.com/rough/organization/9/avatar.svg\"></a>\n\n## License\n[MIT License](https://github.com/pshihn/rough/blob/master/LICENSE) (c) [Preet Shihn](https://twitter.com/preetster)\n","publish_time":1587422081022,"_cnpm_publish_time":1587422081022,"dist-tags":{"latest":"4.6.6"}}