Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: chrvadala/transformation-matrix
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.16.1
Choose a base ref
...
head repository: chrvadala/transformation-matrix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.0.0
Choose a head ref
  • 11 commits
  • 12 files changed
  • 3 contributors

Commits on Nov 29, 2024

  1. add "react-supergrid" to "Some projects using transformation-matrix" (#…

    seveibar authored Nov 29, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    8f14f12 View commit details

Commits on Jan 21, 2025

  1. upgrades deps

    chrvadala committed Jan 21, 2025
    Copy the full SHA
    54e4aff View commit details
  2. upgrades example

    chrvadala committed Jan 21, 2025
    Copy the full SHA
    c659e8e View commit details

Commits on Feb 8, 2025

  1. upgrades deps

    chrvadala committed Feb 8, 2025
    Copy the full SHA
    8ab08fe View commit details
  2. improves badges

    chrvadala committed Feb 8, 2025
    Copy the full SHA
    31aba56 View commit details
  3. improves documentation

    chrvadala committed Feb 8, 2025
    Copy the full SHA
    a716492 View commit details

Commits on Feb 10, 2025

  1. Refactors fromString implementation (#107)

    * prepare unit test for new implementation
    
    * adds new fromString implementation
    
    * fromString: handles Infinity
    
    * lint cleanup
    
    * improves doc
    
    * improves documentation
    chrvadala authored Feb 10, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    1179dd7 View commit details
  2. upgrades gh-actions

    chrvadala committed Feb 10, 2025
    Copy the full SHA
    9234f3a View commit details
  3. Updates doc

    chrvadala committed Feb 10, 2025
    Copy the full SHA
    66479a7 View commit details
  4. Update README.md

    chrvadala authored Feb 10, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    b49be54 View commit details
  5. 3.0.0

    Automation committed Feb 10, 2025
    Copy the full SHA
    cc2042d View commit details
Showing with 4,563 additions and 6,152 deletions.
  1. +1 −1 .github/workflows/release.yml
  2. +4 −4 .github/workflows/test.yml
  3. +5 −2 README.md
  4. +26 −4 docs/api.md
  5. +1,188 −1,417 examples/gestures/package-lock.json
  6. +1 −1 examples/gestures/package.json
  7. +3,202 −4,673 package-lock.json
  8. +14 −14 package.json
  9. +41 −0 src/fromString.js
  10. +35 −19 src/fromTransformAttribute.autogenerated.js
  11. +1 −2 src/fromTransformAttribute.js
  12. +45 −15 test/fromString.spec.js
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ on:

jobs:
build_and_release:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
if: ${{ github.event.inputs.REPOSITORY_NAME == github.repository }}
steps:
- uses: actions/checkout@v4
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ jobs:
build:
strategy:
matrix:
os: [ ubuntu-22.04 ]
os: [ ubuntu-24.04 ]
node: [ 16, 18, 20 ]
name: Test Nodejs v${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
@@ -19,7 +19,7 @@ jobs:
with:
NODE_VERSION: ${{ matrix.node }}
- name: Publish Coveralls
uses: coverallsapp/github-action@v2.2.3
uses: coverallsapp/github-action@v2.3.6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-nodejs-v${{ matrix.node }}-${{ matrix.os }}
@@ -28,10 +28,10 @@ jobs:
finish:
name: Finish
needs: build
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2.2.3
uses: coverallsapp/github-action@v2.3.6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,11 +2,12 @@
Javascript isomorphic 2D affine transformations written in ES6 syntax. Manipulate transformation matrices with this totally tested library!

[![chrvadala](https://img.shields.io/badge/website-chrvadala-orange.svg)](https://chrvadala.github.io)
[![Test](https://github.com/chrvadala/transformation-matrix/workflows/Test/badge.svg)](https://github.com/chrvadala/transformation-matrix/actions)
[![Donate](https://img.shields.io/badge/donate-Paypal-lightgrey.svg)](https://www.paypal.com/paypalme/chrvadala/15)

[![Test](https://github.com/chrvadala/transformation-matrix/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/chrvadala/transformation-matrix/actions/workflows/test.yml)
[![Coverage Status](https://coveralls.io/repos/github/chrvadala/transformation-matrix/badge.svg?branch=master)](https://coveralls.io/github/chrvadala/transformation-matrix?branch=master)
[![npm](https://img.shields.io/npm/v/transformation-matrix.svg?maxAge=2592000?style=plastic)](https://www.npmjs.com/package/transformation-matrix)
[![Downloads](https://img.shields.io/npm/dm/transformation-matrix.svg)](https://www.npmjs.com/package/transformation-matrix)
[![Donate](https://img.shields.io/badge/donate-GithubSponsor-green.svg)](https://github.com/sponsors/chrvadala)

# Features
Transformations, i.e. *linear invertible automorphisms*, are used to map a picture into another one with different size, position and orientation. Given a basis, transformations are represented by means of squared invertible matrices, called **transformation matrices**.
@@ -130,6 +131,7 @@ applyToPoint(matrix, [16, 24]);
- **2.14** - Upgrades deps; Adds `fromOneMovingPoint` and `fromTwoMovingPoints` functions [#95](https://github.com/chrvadala/transformation-matrix/pull/95)
- **2.15** - Removes circular dependencies [#97](https://github.com/chrvadala/transformation-matrix/pull/97); Upgrades gh-actions and deps
- **2.16** - Upgrades deps; Upgrades gh-actions deps;
- **3.0.0** - Refactors fromString [#107](https://github.com/chrvadala/transformation-matrix/pull/107) (⚠️ Breaking Changes described [here](https://github.com/chrvadala/transformation-matrix/pull/107#issue-2840194716)); Upgrades gh-actions and deps;

# Contributors
- [chrvadala](https://github.com/chrvadala) (author)
@@ -153,5 +155,6 @@ applyToPoint(matrix, [16, 24]);
- [**React SVG Pan Zoom**](https://github.com/chrvadala/react-svg-pan-zoom)
- [**ngx-graph**](https://github.com/swimlane/ngx-graph)
- [**learn-anything**](https://github.com/learn-anything/learn-anything)
- [**react-supergrid**](https://github.com/tscircuit/supergrid)
- [**Others...**](https://github.com/chrvadala/transformation-matrix/network/dependents)
- Pull request your project!
30 changes: 26 additions & 4 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -53,9 +53,12 @@ Any value could be a float or a string that contains a float</p>
<dt><a href="#fromString">fromString(string)</a> ⇒ <code>Matrix</code></dt>
<dd><p>Parse a string formatted as matrix(a,b,c,d,e,f)</p>
</dd>
<dt><del><a href="#fromStringLegacy">fromStringLegacy(string)</a> ⇒ <code>Matrix</code></del></dt>
<dd><p>Parse a string formatted as matrix(a,b,c,d,e,f) - Legacy implementation of <code>fromString(matrix)</code>;
Read this PR for details <a href="https://github.com/chrvadala/transformation-matrix/pull/107">https://github.com/chrvadala/transformation-matrix/pull/107</a></p>
</dd>
<dt><a href="#fromTransformAttribute">fromTransformAttribute(transformString)</a> ⇒ <code>Array.&lt;MatrixDescriptor&gt;</code></dt>
<dd><p>Parser for SVG Trasform Attribute <a href="http://www.w3.org/TR/SVG/coords.html#TransformAttribute">http://www.w3.org/TR/SVG/coords.html#TransformAttribute</a> <br/>
Warning: This should be considered BETA until it is released a stable version of pegjs.</p>
<dd><p>Parser for SVG Trasform Attribute <a href="http://www.w3.org/TR/SVG/coords.html#TransformAttribute">http://www.w3.org/TR/SVG/coords.html#TransformAttribute</a></p>
</dd>
<dt><a href="#fromTriangles">fromTriangles(t1, t2)</a> ⇒ <code>Matrix</code></dt>
<dd><p>Returns a matrix that transforms a triangle t1 into another triangle t2, or throws an exception if it is impossible.</p>
@@ -288,11 +291,30 @@ Parse a string formatted as matrix(a,b,c,d,e,f)
> fromString('matrix(1,2,3,4,5,6)')
{a: 1, b: 2, c: 3, d: 4, c: 5, e: 6}
```
<a name="fromStringLegacy"></a>

## ~~fromStringLegacy(string) ⇒ <code>Matrix</code>~~
***Deprecated***

Parse a string formatted as matrix(a,b,c,d,e,f) - Legacy implementation of `fromString(matrix)`;
Read this PR for details [https://github.com/chrvadala/transformation-matrix/pull/107](https://github.com/chrvadala/transformation-matrix/pull/107)

**Kind**: global function
**Returns**: <code>Matrix</code> - Affine Matrix

| Param | Type | Description |
| --- | --- | --- |
| string | <code>string</code> | String with an affine matrix |

**Example**
```js
> fromStringLegacy('matrix(1,2,3,4,5,6)')
{a: 1, b: 2, c: 3, d: 4, c: 5, e: 6}
```
<a name="fromTransformAttribute"></a>

## fromTransformAttribute(transformString) ⇒ <code>Array.&lt;MatrixDescriptor&gt;</code>
Parser for SVG Trasform Attribute http://www.w3.org/TR/SVG/coords.html#TransformAttribute <br/>
Warning: This should be considered BETA until it is released a stable version of pegjs.
Parser for SVG Trasform Attribute http://www.w3.org/TR/SVG/coords.html#TransformAttribute

**Kind**: global function
**Returns**: <code>Array.&lt;MatrixDescriptor&gt;</code> - Array of MatrixDescriptor
Loading