Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

The JavaScript library for modern SVG graphics.

License

NotificationsYou must be signed in to change notification settings

adobe-webplatform/Snap.svg

Repository files navigation

A JavaScript SVG library for the modern web. Learn more atsnapsvg.io.

Follow us on Twitter.

Install

Learn

Use

In your HTML file, load simply by:

<scriptsrc="snap.svg-min.js"></script>

No other scripts are needed. Both the minified and uncompressed (for development) versions are in the/dist folder.

webpack

To load with webpack 2.x and 3.x, installImports Loader (npm i -D imports-loader), and add the following to your webpack config:

module:{rules:[{test:require.resolve('snapsvg/dist/snap.svg.js'),use:'imports-loader?this=>window,fix=>module.exports=0',},],},resolve:{alias:{snapsvg:'snapsvg/dist/snap.svg.js',},},

Then, in any module you’d like to require Snap, use:

import Snap from 'snapsvg';

Build

Build Status

Snap.svg usesGrunt to build.

  • Open the terminal from the Snap.svg directory:
cd Snap.svg
  • Install its command line interface (CLI) globally:
npm install -g grunt-cli

*You might need to usesudo npm, depending on your configuration.

  • Install dependencies with npm:
npm install

*Snap.svg uses Grunt 0.4.0. You might want toread more on their website if you haven’t upgraded since a lot has changed.

  • To build the files run
grunt
  • The results will be built into thedist folder.
  • Alternatively typegrunt watch to have the build run automatically when you make changes to source files.

Testing

Tests are located intest folder. To run tests, simply opentest.html in there. Automatic tests use PhantomJS to scrap this file, so you can use it as a reference.

Alternatively, installPhantomJS and run command

grunttest

Contribute

git checkout -b my_branch
  • Add your changes.
  • Check that tests are passing
  • Commit your changes:
git commit -am"Added some awesome stuff"
  • Push your branch:
git push origin my_branch

Note: Pull requests to other branches thandev or without filled CLA wouldn’t be accepted.


[8]ページ先頭

©2009-2025 Movatter.jp