Skip to content

Commit

Permalink
Initial release of viewbox
Browse files Browse the repository at this point in the history
  • Loading branch information
mcous committed Jun 25, 2016
1 parent 8cb6b4c commit f2c1227
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
37 changes: 36 additions & 1 deletion API.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<a name="viewbox"></a>
# viewbox
should be able to create a new empty viewbox.
should be able to create a new viewbox.

```js
var result = viewbox.create()
Expand Down Expand Up @@ -72,3 +72,38 @@ expect(result).to.eql({
})
```

should output a 0 size rectangle for something falsey.

```js
var result = viewbox.rect()
expect(result).to.eql({
x: 0,
y: 0,
width: 0,
height: 0
})
```

should be able to generate a viewbox string.

```js
var box = [1, 2, 3, 4]
var result = viewbox.asString(box)
expect(result).to.equal('1 2 3 4')
```

should output a new viewbox as a 0 size viewbox string.

```js
var box = viewbox.create()
var result = viewbox.asString(box)
expect(result).to.equal('0 0 0 0')
```

should output something falsey as a 0 size viewbox string.

```js
var result = viewbox.asString()
expect(result).to.equal('0 0 0 0')
```

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "viewbox",
"version": "0.0.0",
"version": "1.0.0",
"description": "Library for dealing with SVG viewboxes as plain arrays",
"main": "index.js",
"directories": {
Expand Down

0 comments on commit f2c1227

Please sign in to comment.