JSPM

scratch-svg-renderer

0.2.0-prerelease.20190125192231
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7416
  • Score
    100M100P100Q127444F
  • License BSD-3-Clause

SVG renderer for Scratch

Package Exports

  • scratch-svg-renderer

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (scratch-svg-renderer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

scratch-svg-renderer

Greenkeeper badge 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);

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!