vg.js
v0.6.24
Published
A JavaScript library for vector graphics.
Readme
vg.js
vg.js is a JavaScript library for vector graphics.
var i = 0;
var paths = [];
vg.grid(4, 4, 250, 250).map(function (pt, i) {
var p = vg.ellipse(pt, 75, 75);
return p.resampleByAmount(i + 3);
});
Installation
Directly
Download the latest ZIP and grab the files in the dist folder.
These are compiled.
Using Bower
To install using Bower, enter the following command in your project directory:
bower install vg.jsYou can then include them in your scripts using:
<script src="/bower_components/g.js/dist/g.js"></script>Using Browserify
To install using Browserify, enter the following command in your project directory:
npm install --save vg.jsDevelopment
We use a set of npm scripts to build releases:
During development
Running npm run watchify will automatically create new builds in the build directory whenever the source changes.
Updating the dist
Running npm run dist will build a complete and minified version of g.js in the dist folder. You can also run
npm run browserify and npm run uglify separately.
Publishing a release
- Update the version number in
package.jsonandbower.json. - Run
npm run distto update the files in thedistfolder. - Commit (
git commit -a) and create a tag (e.g.git tag 1.2.1). Push and push tags (git push && git push --tags). - Run
npm publishto publish the package to npm. You don't have to do anything for Bower.
Credits
vg.js is based on canvas.js (BSD). De Smedt T. & Daelemans W. (2012). Pattern for Python. Journal of Machine Learning Research.
- Stefan Gabriëls [email protected]
- Frederik De Bleser [email protected]
