immutable-transform-matrix

0.6.0 • Public • Published

Build Status Coverage Status Dependancy Status

immutable-transform-matrix

A library for creating affine transform matrix (3x3) that extend an Immutable Map.

These matrices can be used for matrix calcuations on SVG CTMs (current transform matrix).

Inspired by transformation-matrix-js

API Documentation

Install

yarn add immutable-transform-matrix

Examples

import { Matrix } from 'immutable-transform-matrix'
import { isImmutable } from 'immutable'
 
const m1 = new Matrix()
const m2 = m1.translate(10, 20)
 
isImmutable(m1) // true
m1.get('e') // 0
m2.get('e') // 10
 
const transform = new Matrix()
  .scale(2)
  .toString()
 
const ViewPort = () => <g transform={transform} />

Readme

Keywords

Package Sidebar

Install

npm i immutable-transform-matrix

Weekly Downloads

55

Version

0.6.0

License

MIT

Last publish

Collaborators

  • harrygogonis