Observed since 20 Oct, 19:10 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Module that parse a 2D css transform matrix into a 3x3 array. Also the module allow you get the matrix array from a specified element
Converts css transform matrix to an 2D array of 6 values(3x3 matrix).
The parse function takes a matrix string representation like matrix(1.1, 0, 0, 1.1, 0, 0) and parse it to an array of floats.
var matrixTransform = require('./index.js');
var matrix = "matrix(1.1, 0, 0, 1.1, 0, 0)";
matrixTransform.parse(matrix);
// -> [1.1, 0, 0, 1.1, 0, 0]
The fromElement function tries to help you to get the transform string matrix representation and let you pass instead of the string the HTML element itself.
var matrixTransform = require('./index.js');
var element = document.createElement('div');
element.style.transform = "scale(1.5)";
document.body.appendChild(element);
matrixTransform.fromElement(element);
// -> [1.5,0,0,1.5,0,0]
Important Note:
Doesn't matter if the transform is not formatted as a matrix, in the above example we are setting to element the value scale instead of the current matrix.
matrixTransform.parse(string)It takes a string matrix representation and gives you an array.
matrixTransform.fromElement(HtmlElement)It takes an Html Element and gives you an array with the element transformation.
MIT, see LICENSE.md for details.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.0.0Registry latest | 7 Dec 2015 | 2 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 20 Oct, 19:10 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:c16d2b7328b8c8eb5e93e4a847560be1df0ed2ecd949c5a8eef893b52e945dd0