Component adds an ability to parse and modify formula expressions. It is designed for translating cell
coordinates and cell ranges in any direction. By default, component translates only relative coordinates but this
behavior can be overwritten by passing custom modifier which controls translating process.



Extracted cells and cells ranges.

customModifiernull function

Function which can modify default behaviour of how cells and cell ranges will be translated.


Formula expression to modify.



Set formula expression to modify.

Name Type Description
expression string

Formula expression to process.

Returns: {ExpressionModifier}


Translate object into string representation.

Returns: {string}

translate(delta, startFrom){ExpressionModifier}

Translate formula expression cells.

Name Type Description
delta object

Distance to move in proper direction.

startFrom object optional

Coordinates which translation will be applied from.

Returns: {ExpressionModifier}


Set function which can modify default behavior of how cells and cell ranges will be translated.
The passed function will be called with 4 arguments:

  • cell, A cell object with structure
    like this: {start: {row, column}, end: {row, column}, origLabel, type: 'cell|range', refError, toLabel: () => {}}
  • axis, Type of currently processing axis ('row' or 'column')
  • delta, Number as distance to translate. Can be positive or negative.
  • startFromIndex, Base index which translation will be applied from.

The function must return an array with 3 items, where:
deltaStart, Number as a delta to translate first part of coordinates.
DeltaEnd, Number as a delta to translate second part of coordinates (if cell range is modified).
RefError, Defines an error which refers to the situation when translated cell overcrossed the data boundary.

Name Type Description
customModifier function

Function with custom logic.

Class: ExpressionModifier