cur

curve

Vector drawing library

Showing:

Popularity

Downloads/wk

5

GitHub Stars

43

Maintenance

Last Commit

5yrs ago

Contributors

2

Package

Dependencies

4

Size (min+gzip)

1.8KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

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.

shot

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

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Curve App</title>
  <script src="curve.min.js"></script>
</head>
<body>
  <div id="canvas"></div>
</body>
</html>

Then in your JS:

var doc = new Curve.SVGDocument("canvas")
var svgString = "<svg .....>...</svg>"
doc.deserialize(svgString)
doc.initializeTools()

In a node/io.js or Electron app

npm install --save curve

And it works similarly

var SVGDocument = require('curve').SVGDocument

var canvas = document.createElement('div')
var doc = new Curve.SVGDocument(canvas)
var svgString = "<svg .....>...</svg>"
doc.deserialize(svgString)
doc.initializeTools()

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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial