@danmeon/univer-engine-formula
v1.5.2-carenode.7
Published
Unofficial Carenode fork of @univerjs/engine-formula 1.5.2 (Univer by DreamNum), not an official Univer release. Formula parsing, function registration, dependency management, and calculation engine for Univer.
Maintainers
Readme
Unofficial build.
@danmeon/[email protected]is a Carenode fork of@univerjs/engine-formula1.5.2 from Univer by DreamNum. It is not an official Univer release and DreamNum does not support it. It is distributed under the same Apache-2.0 license (see LICENSE).Built from
DanMeon/univerbranchcarenode/v1.5.2, commit47617674e922d90bb50e1dd62b6efc6106193dd0.
Source files changed from upstream v1.5.2 in this package (each changed file carries a "Modified by Carenode" header):
packages/engine-formula/src/engine/ast-node/function-node.tspackages/engine-formula/src/engine/interpreter/interpreter.tspackages/engine-formula/src/engine/value-object/array-value-object.tspackages/engine-formula/src/engine/value-object/base-value-object.tspackages/engine-formula/src/functions/base-function.tspackages/engine-formula/src/functions/logical/if/index.tspackages/engine-formula/src/functions/lookup/xlookup/index.tspackages/engine-formula/src/functions/math/sum/index.tspackages/engine-formula/src/functions/statistical/average/index.tspackages/engine-formula/src/functions/statistical/countifs/index.ts
@univerjs/engine-formula
@univerjs/engine-formula is Univer's formula runtime. It parses formulas, registers functions and descriptions, manages dependencies, calculates results, and exposes shared formula editor helpers.
Package Overview
| Package | UMD global | CSS | Locales | Facade entry | Worker entry |
| --- | --- | :---: | :---: | :---: | :---: |
| @univerjs/engine-formula | UniverEngineFormula | No | Yes | Yes | Yes |
Installation
pnpm add @univerjs/engine-formula
# or
npm install @univerjs/engine-formulaUsage
Start with the integration setup for your document type, including its required plugins, styles, and locale resources. The snippet below assumes that setup is complete.
import { UniverFormulaEnginePlugin } from '@univerjs/engine-formula';
univer.registerPlugin(UniverFormulaEnginePlugin);Worker usage
On the main thread, import UniverFormulaEnginePlugin from @univerjs/engine-formula. Set notExecuteFormula: true to delegate calculation to the worker.
In the worker entry, import UniverFormulaEnginePlugin from @univerjs/engine-formula/worker:
import { UniverFormulaEnginePlugin } from '@univerjs/engine-formula/worker';
univer.registerPlugin(UniverFormulaEnginePlugin, { notExecuteFormula: false });Integration Notes
- Load the locale resources from
@univerjs/engine-formula/locale/<language>for each language enabled by your application. - Import
@univerjs/engine-formula/facadewhen using this package through Univer Facade APIs. - Custom calculation engines must await
FormulaResultServicebefore emitting completion. Subclasses ofCalculateFormulaServicemust pass this service to the base constructor.
