Class: Matrix

Matrix

handsontable-pro/src/plugins/formulas/matrix.js, line 4

This component is responsible for storing all calculated cells which contain formula expressions (CellValue) and
register for all cell references (CellReference).

CellValue is an object which represents a formula expression. It contains a calculated value of that formula,
an error if applied and cell references. Cell references are CellReference object instances which represent a cell
in a spreadsheet. One CellReference can be assigned to multiple CellValues as a precedent cell. Each cell
modification triggers a search through CellValues that are dependent of the CellReference. After
the match, the cells are marked as 'out of date'. In the next render cycle, all CellValues marked with
that state are recalculated.

Members

cellReferencesArray

List of all created and registered cell references.

dataArray

List of all cell values with theirs precedents.

Record translator for translating visual records into psychical and vice versa.

Methods

handsontable-pro/src/plugins/formulas/matrix.js, line 75

add(cellValue)

Add cell value to the collection.

Parameters:
Name Type Description
cellValue CellValue | Object

Cell value object.

handsontable-pro/src/plugins/formulas/matrix.js, line 47

getCellAt(row, column){CellValue|null}

Get cell value at given row and column index.

Parameters:
Name Type Description
row Number

Physical row index.

column Number

Physical column index.

Returns: {CellValue|null} Returns CellValue instance or null if cell not found.
handsontable-pro/src/plugins/formulas/matrix.js, line 113

getDependencies(cellCoord)

Get cell dependencies using visual coordinates.

Parameters:
Name Type Description
cellCoord Object

Visual cell coordinates object.

handsontable-pro/src/plugins/formulas/matrix.js, line 66

getOutOfDateCells(){Array}

Get all out of date cells.

Returns: {Array}
handsontable-pro/src/plugins/formulas/matrix.js, line 147

registerCellRef(cellReference)

Register cell reference to the collection.

Parameters:
Name Type Description
cellReference CellReference | Object

Cell reference object.

handsontable-pro/src/plugins/formulas/matrix.js, line 86

remove(cellValue)

Remove cell value from the collection.

Parameters:
Name Type Description
cellValue CellValue | Object | Array

Cell value object.

handsontable-pro/src/plugins/formulas/matrix.js, line 160

removeCellRefsAtRange(start, end){Array}

Remove cell references from the collection.

Parameters:
Name Type Description
start Object

Start visual coordinate.

end Object

End visual coordinate.

Returns: {Array} Returns removed cell references.
handsontable-pro/src/plugins/formulas/matrix.js, line 182

reset()

Reset matrix data.