Curve
Curve is a vector drawing library providing a layer of user interaction tools over SVG. It is used in an Electron-based vector drawing app called Curve.app.
Built on top of svg.js.
- Will load any svg file
- Will serialize (save!) the loaded svg file
- Can create paths (pen tool), rectangles, and ellipses
- Can select and modify paths, rectangles, and ellipses
Running the example
python -m SimpleHTTPServer 8080
- Load up http://localhost:8080/examples/example.html
Usage
Curve is built with browserify and works in the browser, and node.js and Electron applications.
In the browser
The only dependency is svg.js which is bundled in curve.js
and curve.min.js
. Download curve.js or curve.min.js, and include it in your page
Curve App
Then in your JS:
var doc = "canvas"var svgString = "<svg .....>...</svg>"docdoc
In a node/io.js or Electron app
npm install --save curve
And it works similarly
var SVGDocument = SVGDocument var canvas = documentvar doc = canvasvar svgString = "<svg .....>...</svg>"docdoc
Browser support
Officially tested on Chrome
Testing/Building
- Requires grunt
npm install -g grunt-cli
- Install grunt modules
npm install
- Automatically compile changes
grunt watch
- Run tests with
npm test
License
MIT License