4.0.10 • Published 2 years ago

@oglabs/calc v4.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Calc

A calculation module for spreadsheet

Targeted features

  1. Runs asynchronously
  2. Able to run on web workers
  3. Able to return multiple results based on cell-dependency
  4. Able to run multiple calculations (batch)
  5. Able to run single calculation
  6. Ability to run in cloudflare workers (Todo)
import { CalcEngine } from '@oglabs/spreadsheet'

// Initialize
const calcEngine = new CalcEngine()

// Optional - Dump all sheets to calculation engine during initial load
const changes = calcEngine.initialize(changes, getCellConfig)

// Single cell calculation
const results = await calcEngine.calculate(value, sheet, cell, getCellConfig)

// Multiple batch
const results = await calcEngine.calculateBatch(changes, getCellConfig)