# curve

> Vector drawing library

Latest version **0.1.1** (published 2015-08-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install curve
pnpm add curve
yarn add curve
bun add curve
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2015-08-18 |
| First published | 2015-08-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 46 |
| Maintainers | benogle |

## Links

- npm: https://www.npmjs.com/package/curve
- Repository: https://github.com/benogle/curve
- Homepage: https://github.com/benogle/curve#readme
- Issues: https://github.com/benogle/curve/issues
- npm.io page: https://npm.io/package/curve

## Dependencies (4)

- [mixto](https://npm.io/package/mixto.md) ^1.0.0
- [delegato](https://npm.io/package/delegato.md) ^1.0.0
- [event-kit](https://npm.io/package/event-kit.md) ^1.2.0
- [object-assign](https://npm.io/package/object-assign.md) ^3.0.0

## Recent versions

- 0.1.1 (latest) — 2015-08-18
- 0.1.0 — 2015-08-17
- 0.0.5 — 2015-08-17
- 0.0.4 — 2015-08-17
- 0.0.3 — 2015-08-17
- 0.0.2 — 2015-08-17

## README

# Curve

Curve is a vector drawing library providing a layer of user interaction tools over SVG. It is used in an [Electron][electron]-based vector drawing app called [Curve.app][app].

![shot](https://cloud.githubusercontent.com/assets/69169/9297079/56f79f34-444e-11e5-82ad-f36889ee524f.png)

Built on top of [svg.js][svg].

* 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][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

```html
<!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:

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

### In a node/io.js or Electron app

```bash
npm install --save curve
```

And it works similarly

```js
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

[electron]:http://electron.atom.io
[app]:https://github.com/benogle/curve-app
[svg]:https://github.com/wout/svg.js
[browserify]:http://browserify.org/

---
_Source: https://npm.io/package/curve · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
