@univerjs/engine-formula v0.5.4
Class: FFormula
Defined in: submodules/univer/packages/engine-formula/src/facade/f-formula.ts:25
This interface class provides methods to modify the behavior of the operation formula.
Extends
Extended by
Constructors
new FFormula()
new FFormula(
_commandService,
_injector,
_lexerTreeBuilder,
_configService): FFormula
Defined in: submodules/univer/packages/engine-formula/src/facade/f-formula.ts:26
Parameters
Parameter | Type |
---|---|
_commandService | ICommandService |
_injector | Injector |
_lexerTreeBuilder | LexerTreeBuilder |
_configService | IConfigService |
Returns
Overrides
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_commandService | readonly | ICommandService | undefined | - | submodules/univer/packages/engine-formula/src/facade/f-formula.ts:27 |
_configService | readonly | IConfigService | undefined | - | submodules/univer/packages/engine-formula/src/facade/f-formula.ts:30 |
_disposed | protected | boolean | false | FBase ._disposed | submodules/univer/packages/core/src/shared/lifecycle.ts:96 |
_injector | readonly | Injector | undefined | - | submodules/univer/packages/engine-formula/src/facade/f-formula.ts:28 |
Accessors
lexerTreeBuilder
Get Signature
get lexerTreeBuilder(): LexerTreeBuilder
Defined in: submodules/univer/packages/engine-formula/src/facade/f-formula.ts:44
The tree builder for formula string.
Returns
Methods
_initialize()
_initialize(): void
Defined in: submodules/univer/packages/engine-formula/src/facade/f-formula.ts:36
Returns
void
calculationEnd()
calculationEnd(callback): IDisposable
Defined in: submodules/univer/packages/engine-formula/src/facade/f-formula.ts:103
Listening calculation ends.
Parameters
Parameter | Type |
---|---|
callback | (functionsExecutedState ) => void |
Returns
calculationProcessing()
calculationProcessing(callback): IDisposable
Defined in: submodules/univer/packages/engine-formula/src/facade/f-formula.ts:136
Listening calculation processing.
Parameters
Parameter | Type |
---|---|
callback | (stageInfo ) => void |
Returns
calculationStart()
calculationStart(callback): IDisposable
Defined in: submodules/univer/packages/engine-formula/src/facade/f-formula.ts:90
Listening calculation starts.
Parameters
Parameter | Type |
---|---|
callback | (forceCalculation ) => void |
Returns
dispose()
dispose(): void
Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:109
Returns
void
Inherited from
disposeWithMe()
disposeWithMe(disposable): IDisposable
Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:99
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
ensureNotDisposed()
protected ensureNotDisposed(): void
Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:103
Returns
void
Inherited from
executeCalculation()
executeCalculation(): void
Defined in: submodules/univer/packages/engine-formula/src/facade/f-formula.ts:75
Start the calculation of the formula.
Returns
void
moveFormulaRefOffset()
moveFormulaRefOffset(
formulaString,
refOffsetX,
refOffsetY,
ignoreAbsolute?): string
Defined in: submodules/univer/packages/engine-formula/src/facade/f-formula.ts:58
Offsets the formula
Parameters
Parameter | Type | Description |
---|---|---|
formulaString | string | - |
refOffsetX | number | - |
refOffsetY | number | - |
ignoreAbsolute ? | boolean | default is false |
Returns
string
Example
const result = moveFormulaRefOffset('sum(a1,b2)',1,1)
// result is 'sum(b2,c3)'
onCalculationEnd()
onCalculationEnd(): Promise<void>
Defined in: submodules/univer/packages/engine-formula/src/facade/f-formula.ts:117
Returns
Promise
<void
>
sequenceNodesBuilder()
sequenceNodesBuilder(formulaString): (string | ISequenceNode)[]
Defined in: submodules/univer/packages/engine-formula/src/facade/f-formula.ts:68
Resolves the formula string to a ‘node’ node
Parameters
Parameter | Type |
---|---|
formulaString | string |
Returns
(string
| ISequenceNode
)[]
{((string | ISequenceNode)[])}
Memberof
FFormula
setMaxIteration()
setMaxIteration(maxIteration): void
Defined in: submodules/univer/packages/engine-formula/src/facade/f-formula.ts:161
When a formula contains a circular reference, set the maximum number of iterations for the formula calculation.
Parameters
Parameter | Type | Description |
---|---|---|
maxIteration | number | The maximum number of iterations. The default value is 1. |
Returns
void
Example
// Set the maximum number of iterations for the formula calculation to 5.
// The default value is 1.
const formulaEngine = univerAPI.getFormula();
formulaEngine.setMaxIteration(5);
stopCalculation()
stopCalculation(): void
Defined in: submodules/univer/packages/engine-formula/src/facade/f-formula.ts:82
Stop the calculation of the formula.
Returns
void
extend()
static extend(source): void
Defined in: submodules/univer/packages/core/src/facade/f-base.ts:26
Parameters
Parameter | Type |
---|---|
source | any |
Returns
void