Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dommatrix

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dommatrix

ES6/ES7 shim for DOMMatrix

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
454K
decreased by-7.74%
Maintainers
1
Weekly downloads
 
Created
Source

DOMMatrix (Constructor) shim

An ES6/ES7 sourced DOMMatrix shim for Node.js apps and legacy browsers originally authored by Arian Stolwijk with his CSSMatrix.

The constructor should work as defined by the w3c CSS3 3d Transforms specification.

This version comes with the following changes:

  • removed afine property and replaced it with is2D to be more inline with DOMMatrix
  • added isIdentity property
  • removed inverse() instance method
  • removed transform() instance method
  • removed toFullString() instance method

Install

npm install dommatrix

Usage

It should be compatible with documentation defined at w3.org and WebKitCSSMatrix Safari documentation.

Examples

// ES6/ES7
import CSSMatrix from 'dommatrix'

// init
let myMatrix = new CSSMatrix('perspective(400px) rotateX(45deg)')

// call methods, also numeric values should work
myMatrix.translate(45)

OR

// Node.js
var CSSMatrix = require('dommatrix');

// init
let myMatrix = new CSSMatrix('rotate(45deg)')

Methods

  • translate(x, y, z)
  • scale(x, y, z)
  • rotate(rx, ry, rz)
  • rotateAxisAngle(x, y, z, angle)
  • skewX(angle)
  • skewY(angle)
  • toString()

License

DOMMatrix is MIT Licensed.

Keywords

FAQs

Package last updated on 11 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc