{"_id":"@bokeh/canvas2svg","_rev":"9-9e6988bc3bd818c3805e1f1a38c4e00f","name":"@bokeh/canvas2svg","dist-tags":{"latest":"1.0.22"},"versions":{"1.0.21":{"name":"@bokeh/canvas2svg","version":"1.0.21","description":"canvas2svg","module":"canvas2svg.js","types":"canvas2svg.d.ts","homepage":"https://github.com/bokeh/canvas2svg","directories":{"test":"test"},"scripts":{"test":"karma start --browsers Firefox --single-run"},"keywords":["canvas","svg","canvas2svg"],"author":{"name":"Kerry Liu"},"license":"MIT","dependencies":{},"devDependencies":{"chai":"^2.1.1","cheerio":"^0.19.0","gulp":"^3.9.0","gulp-bump":"^0.3.1","karma":"^0.12.36","karma-chai":"^0.1.0","karma-chrome-launcher":"^0.1.12","karma-firefox-launcher":"^0.1.6","karma-mocha":"^0.1.10","karma-mocha-reporter":"^1.0.2","mocha":"^2.2.5","resemblejs":"^1.2.1"},"gitHead":"1f020608bedce25d1415e281037077226d1b66bb","_id":"@bokeh/canvas2svg@1.0.21","_nodeVersion":"12.14.1","_npmVersion":"6.14.2","dist":{"integrity":"sha512-pQ9TlLQDHQf//aOr77Ri5UKly0ES0L/JCACqVh0e8ssC4BL4lpZ/6URGf6vS8M5NDt7aLCqWxnuFVTgoNw9Lig==","shasum":"83375f748824d9c3357f62e3033d4c1a09887c1b","tarball":"https://registry.npmjs.org/@bokeh/canvas2svg/-/canvas2svg-1.0.21.tgz","fileCount":32,"unpackedSize":382591,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeX/diCRA9TVsSAnZWagAAWRgQAIOeetgHoZlWLGIG4aQM\nwac5FBR/RfXY3kbpqoiRBjg3Tyt8PGFhzIZy8YBP8Pjy5ZfNOQ+gzLX7uI9x\nFnlSil7gOMn/Xm0LecNRfSgdvqk+fpxt4KzxUsMMZOfOnkcdcaRu5YlypOo3\nIF5nXM1D7CSfMM5D1tGWxl4bLHez4O34b082GPuGestLJAHrKN4iVErQvRF4\nHmuw0YJeHfUoU5biRkfa2JCt8rBg7g/j7PTDoADY5wXIx8nO0T8s6sbEU3e3\nfzwRVSKToDUaBeoyMYUj1WxKKXg+6ZYiUrLhXu9flftTwb+nuPcbkFrFT3ZD\nBmjrudAoRVhLDup+XSn6hel92EC/cQNwIeOxWo8owOHWpJDDp80f8YR0/Nj/\nqr2VU6brR5Pq9MzSPsRsK2tUpvRtZj7GkbOXprqbKVkg7xpIPpoYnQZnEJ/z\nXtK4Ot+jWC6+RGbuhymH68KgeYDR5IJ+3qt3oqTgxba1qDSm1LMFPqjnAtiL\nZXRsJAVlny5biPyU1o/lRuCwNgAOFOqGDThqFLqEeswCgyYF3KGjWeB8egWc\nUaft58JnrYoc8/ZwWVDfiCZY8cWuprcOiY31cnRdzaj8TzvnXdQNR/977ssu\nfmCKgY9Je5Sl4we+K7gywfHleAxNomDrNznAeiSFr6gnHYoHPo4BhxtHe8qk\nbYru\r\n=lhn5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICPDhp0gMnxFBB4dAEGJweKqHc0w+e/29K3yYfpiQFpLAiEAh2NHUnXHKjktxVg6dOfeHYcUFgPwOAAs+lYO7wYbyWs="}]},"maintainers":[{"name":"bokeh","email":"service@bokeh.org"}],"_npmUser":{"name":"bokeh","email":"service@bokeh.org"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/canvas2svg_1.0.21_1583347553634_0.7252917822391121"},"_hasShrinkwrap":false},"1.0.22":{"name":"@bokeh/canvas2svg","version":"1.0.22","description":"canvas2svg","module":"canvas2svg.js","types":"canvas2svg.d.ts","homepage":"https://github.com/bokeh/canvas2svg","directories":{"test":"test"},"scripts":{"test":"karma start --browsers Firefox --single-run"},"keywords":["canvas","svg","canvas2svg"],"author":{"name":"Kerry Liu"},"license":"MIT","dependencies":{},"devDependencies":{"chai":"^2.1.1","cheerio":"^0.19.0","gulp":"^3.9.0","gulp-bump":"^0.3.1","karma":"^0.12.36","karma-chai":"^0.1.0","karma-chrome-launcher":"^0.1.12","karma-firefox-launcher":"^0.1.6","karma-mocha":"^0.1.10","karma-mocha-reporter":"^1.0.2","mocha":"^2.2.5","resemblejs":"^1.2.1"},"gitHead":"55f75bd10e05ce42d91168b4a6915cb5423be9cf","_id":"@bokeh/canvas2svg@1.0.22","_nodeVersion":"12.14.1","_npmVersion":"6.14.2","dist":{"integrity":"sha512-jLA/AmmQEjpCJq5U838exrWR/EtnBqfy5qaG/oKpnGXYKj3VcJIUL0WgYMVMHxRZmEUk1GO7SChaUk0Gz4h/vA==","shasum":"6d8f49efb20be6e0584b68de4bbadc60df4d2b83","tarball":"https://registry.npmjs.org/@bokeh/canvas2svg/-/canvas2svg-1.0.22.tgz","fileCount":32,"unpackedSize":382598,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeX/keCRA9TVsSAnZWagAAT5YQAIbisgTM46NtCMIQRO0D\n6JhZ/6y5KpsWwX7WjJp6mohBzuGTeNyaNtSJpmjdzJSjnsoWiWLIq2mdYtjd\nPZtSDCpejEsppPGXWyfFb9KCrlgB+5REnf+URzT/3hyrEjzzudrtInTutnlx\nbzOI8ZfrzRzLVmPjBNgLJRa7bqQh3r/ujOQoozS3QVWg7uDgJVaiLne+XQzK\nCck4+csZZoBzyYFNb6i31uNYJqLawKq4PE1b7wXCNI0oQcLM7JFq9xnEQ0Pu\n+e0R6VAEfi7zHKbYnj9kXLDhHnu2i6uRPsYVsXIrCS3MeuGpZJkdjeq+Q531\neuJ++pZBo3AwVSinArOZUQ3ufKHS2vcp1OZSZZoG8mGiZcuGv0b7j5zciaIt\nLBKjAu+MfvuZURuomXxiTdj4Yg/vEeRm10JfoVZeJ0pmeCIC2kVbP8cLRGoq\n0NFwVeDi18KOuI4fAX90EGpn+6oOFebRvB5ugWsTS29PIMqiJOtdnJb5Kgz8\nLi+C1V1hnDpH4svM4GGPyJQ+8J63qzHjvKhS/fj8ijsFkZdr63oXN+S0iafL\nDrySNdHAFBTxDTHuECGEMD6ey0LI+17MdJcmMzbUom1pW6o6Y3XKl9eIw/Xd\nYxQ5MN15IZXzj4HQSjQjs8KKGP7NpkFATu/lLiDBEf5Sa+xtdXt8aYrLKATN\n3tqJ\r\n=u60r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzTO1KPaY+7gOmEFwV2QEzfEncdD2BrWVKjh+dnSjbWwIhANxLM362wINq3PRIUyI/xccXyuHzFWBFb65YJ0ROQEVw"}]},"maintainers":[{"name":"bokeh","email":"service@bokeh.org"}],"_npmUser":{"name":"bokeh","email":"service@bokeh.org"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/canvas2svg_1.0.22_1583347997635_0.6030348740826892"},"_hasShrinkwrap":false}},"time":{"created":"2020-03-04T18:45:53.413Z","1.0.21":"2020-03-04T18:45:53.822Z","modified":"2022-04-04T19:59:23.412Z","1.0.22":"2020-03-04T18:53:17.723Z"},"maintainers":[{"email":"prudiger@anaconda.com","name":"philippjfr"},{"email":"service-backup@bokeh.org","name":"bokeh-service-backup"},{"email":"mattpap@gmail.com","name":"mattpap"},{"email":"bryan@bokeh.org","name":"bigreddot"},{"email":"service@bokeh.org","name":"bokeh-service"}],"description":"canvas2svg","homepage":"https://github.com/bokeh/canvas2svg","keywords":["canvas","svg","canvas2svg"],"author":{"name":"Kerry Liu"},"license":"MIT","readme":"Canvas2Svg [![Build Status](https://travis-ci.org/gliffy/canvas2svg.svg?branch=master)](https://travis-ci.org/gliffy/canvas2svg)\n==========\nThis library turns your Canvas into SVG using javascript. In other words, this library lets you build an SVG document\nusing the canvas api. Why use it?\n* You have a canvas drawing you want to persist as an SVG file.\n* You like exporting things.\n* Because you didn't want to transform your custom file format to SVG.\n\nDemo\n==========\nhttp://gliffy.github.io/canvas2svg/\n\nHow it works\n==========\nWe create a mock 2d canvas context. Use the canvas context like you would on a normal canvas. As you call methods, we\nbuild up a scene graph in SVG. Yay!\n\nUsage\n==========\n```javascript\n//Create a new mock canvas context. Pass in your desired width and height for your svg document.\nvar ctx = new C2S(500,500);\n\n//draw your canvas like you would normally\nctx.fillStyle=\"red\";\nctx.fillRect(100,100,100,100);\n//etc...\n\n//serialize your SVG\nvar mySerializedSVG = ctx.getSerializedSvg(); //true here, if you need to convert named to numbered entities.\n\n//If you really need to you can access the shadow inline SVG created by calling:\nvar svg = ctx.getSvg();\n```\n\nTests\n==========\nTo run tests:\n```\nnpm install\nnpm test\n```\n\nTo run tests against Chrome and Firefox, call karma directly. This is not the default npm test due to the limited\nbrowser selection in travis.\n```\nnpm install karma-cli -g\nkarma start\n```\n\nDebug\n=========\nPlay with canvas2svg in the provided test/playground.html or run test locally in your browser in test/testrunner.html\n\n\nAdd An Example Case\n=========\nAdd a test file to the test/example folder. In your file make sure to add the drawing function to the global `C2S_EXAMPLES`,\nwith your filename as a key. For example `test\\example\\linewidth.js` should look something like:\n```javascript\nwindow.C2S_EXAMPLES['linewidth'] = function(ctx) {\n    for (var i = 0; i < 10; i++){\n        ctx.lineWidth = 1+i;\n        ctx.beginPath();\n        ctx.moveTo(5+i*14,5);\n        ctx.lineTo(5+i*14,140);\n        ctx.stroke();\n    }\n};\n```\ninstall gulp globally if you haven't done so already\n```\nnpm install -g gulp\n```\nThen run the following to update playground.html and testrunner.html\n```\ngulp\n```\nYou should now be able to select your new example from playground.html or see it run in testrunner.html\n\nIf you find a bug, or want to add functionality, please add a new test case and include it with your pull request.\n\nUsing with node.js\n==================\n\nYou can use `canvas2svg` with node.js using [jsdom](https://github.com/tmpvar/jsdom) with [node-canvas](https://github.com/Automattic/node-canvas). To do this first create a new document object, and then create a new instance of `C2S` based on that document:\n\n```javascript\nvar canvas = require('canvas'),\n    jsdom = require('jsdom'),\n    C2S = require('canvas2svg');\n\nvar document = jsdom.jsdom();\nvar ctx = new C2S({document: document});\n\n// ... drawing code goes here ...\n```\n\nN.B. You may not need node-canvas for some simple operations when using jsdom >= 6.3.0, but it's still recommended that you install it.\n\nUpdates\n==========\n- v1.0.21 Fix issue ctx.drawImage incorrectly smoothing the image and allow user to pass in ctx argument\n- v1.0.20 Fix issue with mixing transforms with path commands\n- v1.0.19 Fix __parseFont to not crash\n- v1.0.18 clip was not working, the path never made it to the clip area\n- v1.0.17 Fix bug with drawing in an empty context. Fix image translation problem. Fix globalAlpha issue.\n- v1.0.16 Add npm publishing support, bower file and optimize for arcs with no angles.\n- v1.0.15 Setup travis, add testharness and debug playground, and fix regression for __createElement refactor\n- v1.0.14 bugfix for gradients, move __createElement to scoped createElement function, so all classes have access.\n- v1.0.13 set paint order before stroke and fill to make them behavior like canvas\n- v1.0.12 Implementation of ctx.prototype.arcTo.\n- v1.0.11 call lineTo instead moveTo in ctx.arc, fixes closePath issue and straight line issue\n- v1.0.10 when lineTo called, use M instead of L unless subpath exists\n- v1.0.9 use currentDefaultPath instead of <path>'s d attribute, fixes stroke's different behavior in SVG and canvas.\n- v1.0.8 reusing __createElement and adding a properties undefined check\n- v1.0.7 fixes for multiple transforms and fills and better text support from stafyniaksacha\n- v1.0.6 basic support for text baseline (contribution from KoKuToru)\n- v1.0.5 fixes for #5 and #6 (with contributions from KoKuToru)\n- v1.0.4 generate ids that start with a letter\n- v1.0.3 fixed #4 where largeArcFlag was set incorrectly in some cases\n- v1.0.2 Split up rgba values set in fill/stroke to allow illustrator import support.\n- v1.0.1 Allow C2S to be called as a function. https://github.com/gliffy/canvas2svg/issues/2\n- v1.0.0 Initial release\n\nMisc\n==========\nSome canvas 2d context methods are not implemented yet. Watch out for setTransform and arcTo.\n\nReleasing\n=========\n\nTo release a new version:\n\n* Run `gulp bump` to update the version number\n* Add a new entry to the [Updates](#Updates) table\n* `git commit -am v1.0.xx`\n* `git push`\n* `npm publish`\n\nLicense\n==========\nThis library is licensed under the MIT license.\n","readmeFilename":"README.md"}