Source of demo: spreadsheet/run.astro.
Model: createSpreadsheetQuoteModel.ts.
A quote as a spreadsheet: column letters, row numbers, a formula bar and cell formulas with A1 references –
=B2*C2*(1-D2), =SUM(E2:E6), =IF(E8>=1000,0,49). Change a quantity and everything that depends on it calculates
again. One call builds the sheet; MIT-licensed, no dependencies.
const { tableModel, tableOptions } = SpreadsheetFactory.create({ data: [ ["Item", "Qty", "Price", "Net"], ["Laptop", 4, 1299, "=B2*C2"], ["Monitor", 8, 349, "=B3*C3"], ["Total", "", "", "=SUM(D2:D3)"] ]});const tableScope = new TableScope(host, tableModel, new SimpleDomService(), tableOptions, new EventAdapter());tableScope.firstInit();new FormulaBar(barHost, tableScope.getApi()); // optional: address box + formula input$A$1, ranges, #DIV/0! and #CIRC!; while typing, references are
colored and arrow keys or the mouse point at cells (F4 toggles $). Formulas are parsed, never run as JavaScript.#REF!.Docs: instructions.md 6.20 – 6.25 · API: SpreadsheetFactory, FormulaBar, TableApi.insertRows.