SVGMatrix
This is a fork of DOMMatrix...
DOMMatrix








A TypeScript sourced
DOMMatrix shim for
Node.js apps and legacy browsers. Since this source is modernized, legacy browsers might need some additional shims.
The constructor is close to the
DOMMatrix Interface in many respects, but tries to keep a sense of simplicity. In that note, we haven't implemented
DOMMatrixReadOnly methods like
flipX() or
inverse() or aliases for the main methods like
translateSelf or the old
rotate3d.
DOMMatrix shim is meant to be a light pocket tool for
many things, for a complete polyfill you might want to also consider more
geometry-interfaces
and
geometry-polyfill.
This library implements a full transform string parsing via the static method
.fromString(), which produce results inline with the DOMMatrix Interface as well as a very
elegant method to determine
is2D. Before moving to the
technical details of this script, have a look at the demo.
Demo
See DOMMatrix shim in action,
click me and start transforming.
Installation
``
js
npm install @thednp/svgmatrix
`
Download the latest version and copy the dist/svgmatrix.js
file to your project assets folder, then load the file in your front-end:
`
html