@univerjs/engine-formula v0.4.2 • Docs
Class: CalculateFormulaService
Extends
Constructors
new CalculateFormulaService()
new CalculateFormulaService(
_configService,
_lexer,
_currentConfigService,
_runtimeService,
_formulaDependencyGenerator,
_interpreter,
_astTreeBuilder): CalculateFormulaService
Parameters
Parameter | Type |
---|---|
_configService | IConfigService |
_lexer | Lexer |
_currentConfigService | IFormulaCurrentConfigService |
_runtimeService | IFormulaRuntimeService |
_formulaDependencyGenerator | FormulaDependencyGenerator |
_interpreter | Interpreter |
_astTreeBuilder | AstTreeBuilder |
Returns
Overrides
Defined in
packages/engine-formula/src/services/calculate-formula.service.ts:66 (opens in a new tab)
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_disposed | protected | boolean | false | Disposable ._disposed | packages/core/src/shared/lifecycle.ts:93 (opens in a new tab) |
executionCompleteListener$ | readonly | Observable <IAllRuntimeData > | undefined | - | packages/engine-formula/src/services/calculate-formula.service.ts:64 (opens in a new tab) |
executionInProgressListener$ | readonly | Observable <IExecutionInProgressParams > | undefined | - | packages/engine-formula/src/services/calculate-formula.service.ts:60 (opens in a new tab) |
Methods
calculate()
calculate(formulaString, transformSuffix): undefined | ErrorNode
Parameters
Parameter | Type | Default value |
---|---|---|
formulaString | string | undefined |
transformSuffix | boolean | true |
Returns
undefined
| ErrorNode
Defined in
packages/engine-formula/src/services/calculate-formula.service.ts:339 (opens in a new tab)
dispose()
dispose(): void
Returns
void
Inherited from
Defined in
packages/core/src/shared/lifecycle.ts:106 (opens in a new tab)
disposeWithMe()
disposeWithMe(disposable): IDisposable
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
Defined in
packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)
ensureNotDisposed()
protected ensureNotDisposed(): void
Returns
void
Inherited from
Defined in
packages/core/src/shared/lifecycle.ts:100 (opens in a new tab)
execute()
execute(formulaDatasetConfig): Promise<void>
Parameters
Parameter | Type |
---|---|
formulaDatasetConfig | IFormulaDatasetConfig |
Returns
Promise
<void
>
Defined in
packages/engine-formula/src/services/calculate-formula.service.ts:100 (opens in a new tab)
setRuntimeFeatureCellData()
setRuntimeFeatureCellData(featureId, featureData): void
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
Parameter | Type |
---|---|
featureId | string |
featureData | IRuntimeUnitDataType |
Returns
void
Defined in
packages/engine-formula/src/services/calculate-formula.service.ts:92 (opens in a new tab)
setRuntimeFeatureRange()
setRuntimeFeatureRange(featureId, featureRange): void
Parameters
Parameter | Type |
---|---|
featureId | string |
featureRange | IFeatureDirtyRangeType |
Returns
void
Defined in
packages/engine-formula/src/services/calculate-formula.service.ts:96 (opens in a new tab)
stopFormulaExecution()
stopFormulaExecution(): void
Stop the execution of the formula.
Returns
void
Defined in
packages/engine-formula/src/services/calculate-formula.service.ts:81 (opens in a new tab)