Scratch SVG renderer
Find a file
Christopher Willis-Ford d7e78f44b6 Add .npmignore to fix deploy
If `.npmignore` is absent, NPM uses `.gitignore` to decide what to
ignore during publish. Since `dist` is in `.gitignore` this means that
NPM wasn't publishing the build output.
2018-01-16 10:25:03 -05:00
.github Add GitHub template files 2018-01-12 13:39:25 -08:00
src Merge latest changes from scratch-render 2018-01-12 10:36:53 -08:00
.editorconfig Update Webpack and Babel config 2018-01-09 01:06:10 -08:00
.eslintignore package for svg renderer 2017-09-05 11:57:48 -04:00
.eslintrc.js package for svg renderer 2017-09-05 11:57:48 -04:00
.gitattributes package for svg renderer 2017-09-05 11:57:48 -04:00
.gitignore package for svg renderer 2017-09-05 11:57:48 -04:00
.npmignore Add .npmignore to fix deploy 2018-01-16 10:25:03 -05:00
.travis.yml Simplify Travis CI scripts, fix deploy 2018-01-15 15:34:49 -08:00
LICENSE package for svg renderer 2017-09-05 11:57:48 -04:00
package.json Add 'json' as a devDep for the deploy script 2018-01-12 15:20:00 -08:00
README.md add readme 2017-09-06 14:41:21 -04:00
TRADEMARK package for svg renderer 2017-09-05 11:57:48 -04:00
webpack.config.js Merge code changes from scratch-render, CWF 2018-01-09 14:56:30 -08:00

scratch-svg-renderer

A class built for importing SVGs into Scratch. Imports an SVG string to a DOM element or an HTML canvas. Handles some of the quirks with Scratch 2.0 SVGs, which sometimes misreport their width, height and view box.

Installation

This requires you to have Git and Node.js installed.

To install as a dependency for your own application:

npm install scratch-svg-renderer

To set up a development environment to edit scratch-svg-renderer yourself:

git clone https://github.com/LLK/scratch-svg-renderer.git
cd scratch-svg-renderer
npm install

How to include in a Node.js App

import SvgRenderer from 'scratch-svg-renderer';

var svgRenderer = new SvgRenderer();
svgRenderer.fromString(svgData, callback);

Donate

We provide Scratch free of charge, and want to keep it that way! Please consider making a donation to support our continued engineering, design, community, and resource development efforts. Donations of any size are appreciated. Thank you!