transformation-matrix
Advanced tools
Comparing version 1.1.1 to 1.2.0
@@ -9,4 +9,5 @@ export * from './applyToPoint'; | ||
export * from './scale'; | ||
export * from './shear'; | ||
export * from './toString'; | ||
export * from './transform'; | ||
export * from './translate'; |
@@ -103,2 +103,14 @@ 'use strict'; | ||
var _shear = require('./shear'); | ||
Object.keys(_shear).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _shear[key]; | ||
} | ||
}); | ||
}); | ||
var _toString = require('./toString'); | ||
@@ -105,0 +117,0 @@ |
{ | ||
"name": "transformation-matrix", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "2d transformation matrix functions written in ES6 syntax. Tree shaking ready!", | ||
@@ -61,3 +61,4 @@ "main": "./lib/index.js", | ||
"npm-run-all": "^4.0.2" | ||
} | ||
}, | ||
"tonicExampleFilename": "misc/example.js" | ||
} |
@@ -20,10 +20,10 @@ <!-- THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. --> | ||
```sh | ||
import {scale, rotate, translate, transform} from 'transformation-matrix'; | ||
import {scale, rotate, translate, transform, applyToPoint} from 'transformation-matrix'; | ||
let matrix = transform( | ||
translate(40,40), | ||
rotate(Math.PI/2), | ||
scale(2, 4) | ||
translate(40,40), | ||
rotate(Math.PI/2), | ||
scale(2, 4) | ||
); | ||
let point = applyToPoint(matrix, {42, 42}); | ||
let point = applyToPoint(matrix, {x: 42, y: 42}); | ||
``` | ||
@@ -65,2 +65,5 @@ # Reference | ||
</dd> | ||
<dt><a href="#shear">shear(shx, shy)</a> ⇒ <code>Object</code></dt> | ||
<dd><p>Calculate a shear matrix</p> | ||
</dd> | ||
<dt><a href="#toCSS">toCSS(matrix)</a> ⇒ <code>string</code></dt> | ||
@@ -87,2 +90,3 @@ <dd><p>Serialize the matrix to a string that can be used with CSS or SVG</p> | ||
- **1.1** - Split lib into different files | ||
- **1.2** - Adds shear operation | ||
@@ -217,2 +221,15 @@ ## Contributing | ||
<a name="shear"></a> | ||
## shear(shx, shy) ⇒ <code>Object</code> | ||
Calculate a shear matrix | ||
**Kind**: global function | ||
**Returns**: <code>Object</code> - Affine matrix | ||
| Param | Description | | ||
| --- | --- | | ||
| shx | Shear on axis x | | ||
| shy | Shear on axis y | | ||
<a name="toCSS"></a> | ||
@@ -219,0 +236,0 @@ |
@@ -9,4 +9,5 @@ export * from './applyToPoint' | ||
export * from './scale' | ||
export * from './shear' | ||
export * from './toString' | ||
export * from './transform' | ||
export * from './translate' |
@@ -15,2 +15,3 @@ import * as lib from '../src/index'; | ||
assert.typeOf(lib.scale, 'function') | ||
assert.typeOf(lib.shear, 'function') | ||
assert.typeOf(lib.rotate, 'function') | ||
@@ -17,0 +18,0 @@ assert.typeOf(lib.rotateDEG, 'function') |
48529
56
1146
292