Skip to content

Latest commit

 

History

History

sheets-formula

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

@univerjs/sheets-formula

npm version license downloads

@univerjs/sheets-formula connects the formula engine to Univer Sheets, including formula data services, dependency handling, and sheet-aware calculation.

Package Overview

Package UMD global CSS Locales Facade entry Worker entry
@univerjs/sheets-formula UniverSheetsFormula No Yes Yes Yes

Installation

pnpm add @univerjs/sheets-formula
# or
npm install @univerjs/sheets-formula

Usage

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 EnUS from '@univerjs/sheets-formula/locale/en-US';
import { UniverSheetsFormulaPlugin } from '@univerjs/sheets-formula';

univer.registerPlugin(UniverSheetsFormulaPlugin);

// Merge EnUS into your Univer locale map when this package contributes UI text.

Main-thread plugin classes:

  • UniverSheetsFormulaPlugin

Worker usage

On the main thread, import UniverSheetsFormulaPlugin from @univerjs/sheets-formula. Set notExecuteFormula: true to delegate calculation to the worker.

In the worker entry, import UniverRemoteSheetsFormulaPlugin from @univerjs/sheets-formula/worker:

import { UniverRemoteSheetsFormulaPlugin } from '@univerjs/sheets-formula/worker';

univer.registerPlugin(UniverRemoteSheetsFormulaPlugin);

Integration Notes

Register this package with @univerjs/engine-formula and @univerjs/sheets before adding formula UI packages.

  • Import @univerjs/sheets-formula/facade when using this package through Univer Facade APIs.

Resources