1.0.8 • Published 7 months ago

useful-matrix v1.0.8

Weekly downloads
-
License
ISC
Repository
-
Last release
7 months ago

useful-matrix v1.0.8

Library for easy work with Two-Dimensional Arrays

NPM Version

Usage

Creating new matrix

import { Matrix } from "useful-matrix" 
// for now (v1.0.8) only esm available

const matrixFrom2dArray = new Matrix([
    [1, 2, 3, 4],
    [1, 2, 3, 4],
    [1, 2, 3, 4],
    [1, 2, 3, 4]
])

const matrixFromOptions = new Matrix({
    width: 4,
    height: 4
}) // returns new Matrix([
//     [0, 0, 0, 0],
//     [0, 0, 0, 0],
//     [0, 0, 0, 0],
//     [0, 0, 0, 0]
// ])

Now (v1.0.8) available this methods

  • validX
  • validY
  • validPos
  • validMatrixSource
  • validRow
  • validCol
  • randomX
  • randomY
  • randomPos
  • get
  • getAllCols
  • getRow
  • getCol
  • getItem
  • getAllItems
  • getFirstRow
  • getFirstCol
  • getFirstItem
  • getLastRow
  • getLastCol
  • getLastItem
  • set
  • setAllCols
  • setRow
  • setCol
  • setItem
  • swapRows
  • swapCols
  • swapItems
  • reverseX
  • reverseY
  • reverseXY
  • rotateLeft
  • rotateRight
  • fillAll
  • mapItems

full documentation will soon appear on the website

1.0.8

7 months ago

1.0.7

7 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago