npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jsyg/matrix

v1.0.0

Published

Matrix constructor for JSYG

Readme

@jsyg/matrix

matrix constructor for JSYG framework

Installation

npm install @jsyg/matrix

Example with webpack

import Matrix from "@jsyg/matrix"

const mtx = new Matrix()

console.log( mtx.translate(50,50).rotate(90).inverse().toString() )

API

Table of Contents

Matrix

Constructeur de matrices

Parameters

  • arg optionnel, si défini reprend les coefficients de l'argument. arg peut être une instance de SVGMatrix (DOM SVG) ou de Matrix. On peut également passer 6 arguments numériques pour définir chacun des coefficients.

Returns Matrix

a

Coefficients de la matrice

mtx

Objet SVGMatrix original

transformPoint

Transforme un point par cette matrice. On peut passer en argument un objet avec les propriétés x et y.

Parameters
  • x abcisse
  • y ordonnée

Returns Vect

clone

Crée une matrice identique

Returns Matrix

isIdentity

Teste si la matrice est la matrice identité (pas de transformation)

Returns Boolean

multiply

Multiplie la matrice par celle passée en argument

Parameters
  • mtx instance de Matrix (ou SVGMatrix)

Returns Matrix nouvelle instance

inverse

Inverse la matrice

Returns Matrix nouvelle instance

scale

Applique un coefficient d'échelle

Parameters
  • scale
  • originX optionnel, abcisse du point fixe lors du changement d'échelle
  • originY optionnel, ordonnée du point fixe lors du changement d'échelle

Returns Matrix nouvelle instance

scaleX

Applique un coefficient d'échelle horizontale / Renvoie l'échelle horizontale (appel sans argument).

Parameters
  • scale
  • originX optionnel, abcisse du point fixe lors du changement d'échelle
  • originY optionnel, ordonnée du point fixe lors du changement d'échelle

Returns Matrix nouvelle instance

scaleY

Applique un coefficient d'échelle verticale / Renvoie l'échelle verticale (appel sans argument).

Parameters
  • scale
  • originX optionnel, abcisse du point fixe lors du changement d'échelle
  • originY optionnel, ordonnée du point fixe lors du changement d'échelle

Returns Matrix nouvelle instance

scaleNonUniform

Applique un coefficient d'échelle non uniforme en x et en y

Parameters
  • scaleX échelle horizontale
  • scaleY échelle verticale
  • originX optionnel, abcisse du point fixe lors du changement d'échelle
  • originY optionnel, ordonnée du point fixe lors du changement d'échelle

Returns Matrix nouvelle instance

translate

Translation

Parameters
  • x translation horizontale
  • y translation verticale

Returns Matrix nouvelle instance

translateX

Translation horizontale / Renvoie la translation horizontale (appel sans argument).

Parameters
  • x translation horizontale

Returns Matrix nouvelle instance

translateY

Translation verticale / Renvoie la translation verticale (appel sans argument).

Parameters
  • y translation verticale

Returns Matrix nouvelle instance

rotate

Rotation / Renvoie la rotation

Parameters
  • angle en degrés
  • originX optionnel, abcisse du point fixe lors de la rotation
  • originY optionnel, ordonnée du point fixe lors de la rotation

Returns Matrix nouvelle instance

decompose

Décomposition de la matrice

Parameters
  • originX optionnel, abcisse du point fixe lors des transformations
  • originY optionnel, ordonnée du point fixe lors des transformations

Returns Object avec les propriétés translateX,translateY,rotate,skew,scaleX,scaleY

recompose

Renvoie une matrice à partir d'un objet décrivant les transformations.

Parameters
  • transf objet contenant les propriétés possibles suivantes : translateX,translateY,rotate,skew,scaleX,scaleY.
  • originX optionnel, abcisse du point fixe lors des transformations
  • originY optionnel, ordonnée du point fixe lors des transformations

Returns Matrix

toString

Convertit la matrice en chaîne de caractères (de type attribut transform : matrix(a,b,c,d,e,f) )

Parameters
  • precision nombre de décimales pour les coefficients (5 par défaut)

Returns String