@univerjs/engine-formula v0.5.4


Class: CalculateFormulaService

Defined in: submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:74

Extends

Constructors

new CalculateFormulaService()

new CalculateFormulaService(
   _configService, 
   _lexer, 
   _currentConfigService, 
   _runtimeService, 
   _formulaDependencyGenerator, 
   _interpreter, 
   _astTreeBuilder): CalculateFormulaService

Defined in: submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:83

Parameters

ParameterType
_configServiceIConfigService
_lexerLexer
_currentConfigServiceIFormulaCurrentConfigService
_runtimeServiceIFormulaRuntimeService
_formulaDependencyGeneratorIFormulaDependencyGenerator
_interpreterInterpreter
_astTreeBuilderAstTreeBuilder

Returns

CalculateFormulaService

Overrides

Disposable.constructor

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_astTreeBuilderreadonlyAstTreeBuilderundefined-submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:90
_configServicereadonlyIConfigServiceundefined-submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:84
_currentConfigServicereadonlyIFormulaCurrentConfigServiceundefined-submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:86
_disposedprotectedbooleanfalseDisposable._disposedsubmodules/univer/packages/core/src/shared/lifecycle.ts:96
_executionCompleteListener$readonlySubject<IAllRuntimeData>undefined-submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:79
_executionInProgressListener$readonlySubject<IExecutionInProgressParams>undefined-submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:75
_formulaDependencyGeneratorreadonlyIFormulaDependencyGeneratorundefined-submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:88
_interpreterreadonlyInterpreterundefined-submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:89
_lexerreadonlyLexerundefined-submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:85
_runtimeServicereadonlyIFormulaRuntimeServiceundefined-submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:87
executionCompleteListener$readonlyObservable<IAllRuntimeData>undefined-submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:81
executionInProgressListener$readonlyObservable<IExecutionInProgressParams>undefined-submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:77

Methods

_apply()

protected _apply(isArrayFormulaState): Promise<undefined | IAllRuntimeData>

Defined in: submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:238

Parameters

ParameterTypeDefault value
isArrayFormulaStatebooleanfalse

Returns

Promise<undefined | IAllRuntimeData>


calculate()

calculate(formulaString, transformSuffix): undefined | ErrorNode

Defined in: submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:358

Parameters

ParameterTypeDefault value
formulaStringstringundefined
transformSuffixbooleantrue

Returns

undefined | ErrorNode


dispose()

dispose(): void

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:109

Returns

void

Inherited from

Disposable.dispose


disposeWithMe()

disposeWithMe(disposable): IDisposable

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:99

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe


ensureNotDisposed()

protected ensureNotDisposed(): void

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:103

Returns

void

Inherited from

Disposable.ensureNotDisposed


execute()

execute(formulaDatasetConfig): Promise<void>

Defined in: submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:117

Parameters

ParameterType
formulaDatasetConfigIFormulaDatasetConfig

Returns

Promise<void>


setRuntimeFeatureCellData()

setRuntimeFeatureCellData(featureId, featureData): void

Defined in: submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:109

When the feature is loading, the pre-calculated content needs to be input to the formula engine in advance, so that the formula can read the correct values.

Parameters

ParameterType
featureIdstring
featureDataIRuntimeUnitDataType

Returns

void


setRuntimeFeatureRange()

setRuntimeFeatureRange(featureId, featureRange): void

Defined in: submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:113

Parameters

ParameterType
featureIdstring
featureRangeIFeatureDirtyRangeType

Returns

void


stopFormulaExecution()

stopFormulaExecution(): void

Defined in: submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:98

Stop the execution of the formula.

Returns

void