Skip to content
Sheetwrite

Releases

Sheetwrite 0.7.0

Sheetwrite 0.7.0: dashboards, a data model with measures, in-place sort, linked workbooks, saved queries, version history and Excel's editing tools, and what to change when you upgrade.

Edit on GitHubReport a problem

On this page
npm install @sheetwrite/core@0.7.0
Update each adapter and add-on you use to 0.7.0 too: all packages release together.

Sheetwrite 0.7.0 turns a workbook into an analysis tool. Tables relate to each other in a data model, measures calculate over it, and dashboards put pivots, slicers, PivotCharts and KPI cards on one sheet. Sort moves the cells, as Excel's Sort does. Formulas read other workbooks, saved queries refresh tables from your sources, and version history saves, compares and restores versions. Editing works as in Excel: AutoFilter, cut and paste that moves cells, Paste Special, Data Validation, Format Cells, Excel's keys with a panel to change them, and AutoComplete. Formula assist suggests the rest of a formula in the formula bar. Every add-on now installs through one call. Read the breaking changes before you upgrade.

A dashboard sheet with three KPI cards for revenue, units sold and target attainment, a Region slicer with Americas and EMEA selected, a column chart of revenue by month and a pivot of revenue and share by product.A dashboard sheet with three KPI cards for revenue, units sold and target attainment, a Region slicer with Americas and EMEA selected, a column chart of revenue by month and a pivot of revenue and share by product.A dashboard with a Region slicer set to Americas and EMEA, KPI cards for revenue, units sold and target in a column, and a column chart of revenue by month beside them.A dashboard with a Region slicer set to Americas and EMEA, KPI cards for revenue, units sold and target in a column, and a column chart of revenue by month beside them.A dashboard laid out in one column: a Region slicer set to Americas and EMEA, a Revenue KPI card, Units sold and Target cards side by side, and a column chart of revenue by month.A dashboard laid out in one column: a Region slicer set to Americas and EMEA, a Revenue KPI card, Units sold and Target cards side by side, and a column chart of revenue by month.
A dashboard over the data model: KPI cards, a region slicer, a PivotChart and a pivot with a share-of-total measure.A dashboard over the data model, filtered by the Region slicer: KPI cards beside a PivotChart of revenue by month.A dashboard over the data model, filtered by the Region slicer: KPI cards above a PivotChart of revenue by month.

Highlights

Sheetwrite 0.7.0 at a glanceDashboards: 12 columns. Pivots, slicers, PivotCharts and KPI cards on one sheet Data model: CALCULATE. Related tables, and measures in pivots Sort: In place. Moves the cells, as Excel's Sort does Linked workbooks: [Budget.xlsx]. Formulas read the values a link saved Saved queries: Power Query M. Refresh tables from CSV, JSON or your data Version history: Restore. Save, compare and restore versionsDashboards12 columnsPivots, slicers, PivotCharts andKPI cards on one sheetData modelCALCULATERelated tables, andmeasures in pivotsSortIn placeMoves the cells, asExcel's Sort doesLinked workbooks[Budget.xlsx]Formulas read thevalues a link savedSaved queriesPower Query MRefresh tables fromCSV, JSON or your dataVersion historyRestoreSave, compare andrestore versions
Sheetwrite 0.7.0 at a glanceDashboards: 12 columns. Pivots, slicers, PivotCharts and KPI cards on one sheet Data model: CALCULATE. Related tables, and measures in pivots Sort: In place. Moves the cells, as Excel's Sort does Linked workbooks: [Budget.xlsx]. Formulas read the values a link saved Saved queries: Power Query M. Refresh tables from CSV, JSON or your data Version history: Restore. Save, compare and restore versionsDashboards12 columnsPivots, slicers, PivotCharts andKPI cards on one sheetData modelCALCULATERelated tables, andmeasures in pivotsSortIn placeMoves the cells, asExcel's Sort doesLinked workbooks[Budget.xlsx]Formulas read thevalues a link savedSaved queriesPower Query MRefresh tables fromCSV, JSON or your dataVersion historyRestoreSave, compare andrestore versions
A PivotChart of revenue by month and a pivot of revenue and share by product, both filtered to the APAC region by a slicer.A PivotChart of revenue by month and a pivot of revenue and share by product, both filtered to the APAC region by a slicer.Dashboards

Pivots, slicers, PivotCharts and KPI cards on a 12-column dashboard sheet. Slicers filter every pivot they reach through relationships.

The Data Model panel: the relationship from Orders[Region] to Regions[Region], and its check that every key matches.The Data Model panel: the relationship from Orders[Region] to Regions[Region], and its check that every key matches.Data model and measures

Relate tables one-to-many, pivot over related tables, and write measures with CALCULATE and ALL.

The Sort panel: the range A1:E12, My data has headers checked, and a sort level by Month.The Sort panel: the range A1:E12, My data has headers checked, and a sort level by Month.Sort in place

Sort commands move the cells in Excel's sort order, as one undoable, synced change. The display-only sort is now the view sort.

The Edit Links panel: Update All, and the linked Budget 2027.xlsx with its location and status.The Edit Links panel: Update All, and the linked Budget 2027.xlsx with its location and status.Linked workbooks

Formulas such as [Budget.xlsx]Annual!C10 read the values a link saved. Update, change or break links from Edit Links.

The Queries and Connections panel: Refresh All, and the saved Regional targets query from a CSV source.The Queries and Connections panel: Refresh All, and the saved Regional targets query from a CSV source.Saved queries

The optional @sheetwrite/queries engine refreshes tables from CSV, JSON or host data, and XLSX keeps queries as Power Query M.

The Version History panel: Save a version, and the saved Quarter plan by Avery Brooks.The Version History panel: Save a version, and the saved Quarter plan by Avery Brooks.Version history

Save named versions, compare two versions cell by cell with authors, and restore a workbook, sheet or range.

A SUMIFS formula typed in the formula bar, and the argument guide under it with the current argument in bold.A SUMIFS formula typed in the formula bar, and the argument guide under it with the current argument in bold.Formula help

Formula AutoComplete, an argument guide, live syntax errors, reference colours and Explain Formula in the cell editor and the formula bar.

The compact ribbon: each group is a menu, and the Number menu is open under it.The compact ribbon: each group is a menu, and the Number menu is open under it.Compact ribbon

One command model drives the toolbar, the full ribbon and a new compact ribbon for narrow layouts.

The Region filter dropdown: a search box and the values Americas, APAC, EMEA and LATAM, each with its row count.The Region filter dropdown: a search box and the values Americas, APAC, EMEA and LATAM, each with its row count.AutoFilter

Filter buttons on a header row open Excel's dropdown: sort, a searchable value list with row counts, and Number, Text and Date Filters.

Cut cells in columns C to E inside a moving dashed border, and the cell beside them where the paste moves them.Cut cells in columns C to E inside a moving dashed border, and the cell beside them where the paste moves them.Cut and paste moves cells

A paste moves the cut cells, and every formula, name and chart that refers to them follows, as in Excel.

The Paste Special dialog: All, Formulas, Values, Formats and the other Paste choices.The Paste Special dialog: All, Formulas, Values, Formats and the other Paste choices.Paste Special

Excel's dialog: every Paste choice, Add, Subtract, Multiply and Divide, Skip blanks, Transpose and Paste Link.

The Data Validation dialog: Settings, Input Message and Error Alert tabs, and a List rule with its source.The Data Validation dialog: Settings, Input Message and Error Alert tabs, and a List rule with its source.Data Validation

Excel's dialog and every rule type, a dropdown arrow on list cells, and Excel's error alerts.

The Format Cells dialog's Category list with Currency selected, and the sample $4,047,955.The Format Cells dialog's Category list with Currency selected, and the sample $4,047,955.Format Cells

Ctrl+1 opens Excel's dialog, and the selected cells preview the new format while it is open.

The Keyboard shortcuts dialog: a search box that also takes keys, and the Copy and Cut commands with their keys.The Keyboard shortcuts dialog: a search box that also takes keys, and the Copy and Cut commands with their keys.Keyboard shortcuts

Excel's keys by default, and a dialog where users find, record and reset their own.

A cell in the Region column with Am typed and the rest of Americas selected after it.A cell in the Region column with Am typed and the rest of Americas selected after it.AutoComplete

Typing a text entry completes it from the entries above and below in the column.

The formula bar with an equals sign typed and the rest of a SUM over the March column shown dimmed after it, and that column faintly filled in the grid.The formula bar with an equals sign typed and the rest of a SUM over the March column shown dimmed after it, and that column faintly filled in the grid.Formula assist

The formula bar shows the likely rest of a formula as ghost text, learned from your workbook, and Tab takes it. On real workbooks it saves 62.2% of keystrokes, against 5.8% for Excel's function-name completion.

Analysis

Data model

  • Workbook tables relate one-to-many by stable table and column IDs, with undoable, synced setRelationship and removeRelationship operations. SheetwriteStore.getRelationshipStatus(id) reports unmatched keys, duplicate lookup keys, type mismatches and removed columns.
  • Pivot tables use fields from related tables with the { model: { table, fields } } source. The pivot field list shows the columns of related tables, and adding one turns a table pivot into a model pivot in one undo step.
  • Data › Data Tools has Data Model, Relationships and Measures panels.

Measures

  • Measures are formulas over model columns, calculated in the filter context of each pivot cell, with a { measure } value field and setMeasure / removeMeasure operations.
  • Measures read related tables, refer to other measures by [Name], follow renames, and GETPIVOTDATA reads them by name.
  • CALCULATE(expression, filter, …) with column comparisons and ALL(Table[Column]) changes the filter context.

Dashboards

  • Dashboard sheets (kind: "dashboard") hold pivot, slicer, chart and KPI items on a 12-column grid. Items move and resize with the mouse and the keyboard, and Insert › New Dashboard adds one.
  • Slicers filter every pivot whose table reaches the slicer column through relationships, and dim or hide values that no row has under the other slicers.
  • PivotCharts and KPI cards: a chart item charts a pivot, and a KPI card shows one measure in the slicers' filter context.
  • XLSX export writes each dashboard as a worksheet of its current values, with PivotCharts as native charts, and the dashboard opens as a dashboard again.

Charts

  • Charts over a pivot plot its leaf items, as Excel PivotCharts do, and can plot only some of its values, measures included.
  • Multi-level category labels, as Excel draws them, kept in XLSX as c:multiLvlStrRef.
  • XLSX import and export read and write Excel column, bar, line, area, pie, doughnut and scatter charts.
  • XLSX export marks spilling formulas as dynamic arrays, so Excel spills them instead of showing =@SEQUENCE(3), and a text column round-trips in Excel's Text format @.

Data

Sort in place

  • store.sortRange and grid.sortRange sort the cells, as Excel does: one undoable, synced change with the permuteRows operation and the "sort" commit reason. Formulas, merged cells, spill ranges and tables follow Excel's rules.
  • Sort A to Z and Sort Z to A sort in place from the ribbon, the toolbar and the column menu. Data › Custom Sort (Excel's Data › Sort) opens a Sort panel with sort levels, a header row and a "Sort view only" option.
  • Sorts use Excel's sort order: case-insensitive text in Excel's character order, errors after logical values, and blanks last in both directions.

Linked workbooks

  • Formulas accept references to other workbooks, such as [Budget.xlsx]Annual!C10, and to their defined names, such as Budget.xlsx!Total. They show the values the link saved, or #REF! without them.
  • XLSX import keeps external links and the values Excel saved, and export writes them back.
  • externalLinksAddon({ resolve }) updates links from your resolver, points them at another workbook or breaks them into values, as one undoable change. Data › Queries & Connections › Edit Links runs the same commands.

Saved queries

  • The optional @sheetwrite/queries package is a columnar query engine for CSV, JSON and typed host batches, in a lazily loaded WebAssembly module of 85 KiB gzipped.
  • Saved workbook queries refresh into workbook tables through queriesAddon({ fetchSource }): one undoable, synced transaction per refresh, with sources loaded only through your callback.
  • Data › Get Data, Refresh All and Queries & Connections in the ribbon and toolbar. XLSX keeps saved queries as Power Query M.

Version history

  • historyAddon() adds Review › Version History and Save Version: save named versions, compare a version with the current document, preview it read-only, and restore the workbook, a sheet or a range.
  • HistoryArchive stores versions in content-addressed chunks through a HistoryStorageAdapter or the built-in IndexedDB adapter. diffVersions pages changed cells with their authors. A 17 KB gzip WebAssembly kernel computes the comparison and loads only when one opens.
  • SyncCoordinatorOptions.authorId records who made each change.

Formulas

  • Defined-name formulas, named LAMBDAs and a Name Manager.
  • Formula help in the cell editor and the formula bar: Formula AutoComplete, an argument guide, live syntax errors, reference colours and Formulas › Explain Formula, a Sheetwrite command that Excel doesn't have. Alt+Enter adds a line break, and both editors grow to eight lines.
  • Formula assist, the new @sheetwrite/formula-assist package installed with initSheetwrite({ addons: [formulaAssistAddon()] }), shows the likely rest of a formula as ghost text in the formula bar. It learns from the neighbouring cells, the column's pattern and the formulas of the workbook's visible sheets, in memory only. It shows a suggestion only when the benchmark measured it right at least 90% of the time, and 98% for suggestions from the rest of the workbook. Tab takes it, Ctrl+→ (⌥→ on macOS) takes one word, Esc hides it, the suggestion stays while you type it, and the ranges it names get a faint fill. On a held-out set of real workbooks it saves 62.2% of keystrokes, with 0.7% of suggestions wrong. See Formula assist.
  • Custom JavaScript functions with metadata install with functionsAddon([...]) and appear in Formulas › Insert Function.
  • The full engine adds Excel's engineering, complex number, Bessel, CONVERT, remaining financial, Excel 2007 statistics, byte-width text and GETPIVOTDATA functions. Both engines add 30 math functions, LOOKUP, TRIMRANGE, the A statistics and the information functions. See Excel function coverage.

Grid and editing

  • The toolbar, the full ribbon and a new compact ribbon (config.ribbon: { mode: "compact" }) render one command model.
  • File › Import XLSX opens a workbook in the current grid, and grid.importWorkbook replaces the document without recreating the grid.
  • grid.trimMemory() gives back memory an open grid can build again.
  • Moving rows or columns moves the cells, as Excel's Insert Cut Cells does, and every reference follows them.
  • grid.sheetRowOf and grid.viewRowOf map between displayed rows and data rows, and the edit-begin, edit-commit and selection events carry the cell's data-row address too.

Excel editing

Filter, cut and paste

  • AutoFilter: Data › Filter or Ctrl+Shift+L puts filter buttons on a header row. A button, or Alt+Down on a header cell, opens Excel's dropdown: sort, Number, Text and Date Filters with custom conditions, and a searchable value list with row counts. Date columns group by year, month and day. Each change is one undo step that syncs, and XLSX keeps the filter.
  • Cut and paste moves cells: cut marks the cells with a moving border, and the paste moves their values, formulas, formats, notes, links, merged cells and rules. Every formula, name and chart that refers to them follows, as one undo step and one moveCells operation.
  • Paste Special: Ctrl+Alt+V, Home › Paste and the context menu open Excel's dialog, with every Paste choice, Add, Subtract, Multiply, Divide, Skip blanks, Transpose and Paste Link. Paste Options paste Values, Formulas, Formatting, Transpose or Paste Link in one click.
  • Fill: the fill handle continues Excel's series, shows each new value while it drags, and offers Auto Fill Options after the fill.
  • Paste over hidden rows: a pasted block over a filtered range or hidden rows writes into every sheet row, the hidden rows included, as in Excel, and says how many hidden rows it wrote. Paste Options › Paste into visible rows only (grid.actions.pasteVisibleRows()) pastes on the shown rows instead.
  • Insert and Delete shift cells right, down, left or up, as in Excel.
  • Delete and grid.actions.clearContents() clear values and keep the cells' formats, as Excel's Delete does.

Validation and formats

  • Data Validation: Data › Data Validation opens Excel's dialog with Settings, Input Message and Error Alert. Rules take every Excel type, lists from a range or a defined name, and formula bounds. A list cell shows a dropdown arrow, typing filters its list, and a rejected value shows Excel's Stop, Warning or Information alert.
  • Format Cells: Ctrl+1 opens a dialog with Number, Alignment, Font, Border and Fill, and the selected cells preview the new format until OK or Cancel. Fraction, Text and elapsed-time formats work as in Excel.
  • General: new sheets, addSheet without columns, XLSX imports and adapter columns without type use the new general column type, which reads typing as Excel does. A number with no format shows as Excel's General: 2026, not 2,026, and 1.23457E+11 for a long number.

Keys and typing

  • Excel's keys: the active cell, Enter and Tab, the editor's Enter, Edit and Point modes, and Excel's format, fill, hide, insert and sheet keys.
  • Keyboard shortcuts dialog: config.keyboardSettings: true adds a dialog where users search commands by name or keys, record, swap and reset keys, and export them. The grid emits key-bindings-change for you to store.
  • AutoComplete: typing a text entry completes it from the column, and several matches show in a list. Alt+Down opens Excel's Pick From Drop-down List.
  • Find: Excel's wildcards and Find Options, Find All and workbook search. Find matches a number by the text the cell shows ($4.50, 15%), selects each match, and previews what Replace all will change.
  • Formula editor: the formula list offers names, tables, columns and argument values; a formula that doesn't parse is refused with Excel's message; live errors offer a one-click fix.

Performance

On the release commit, recalculation takes about a third of 0.6.1's time: 2.8× faster on Linux and 3.1× on the Mac. XLSX import takes 0.64–0.65 of 0.6.1's time on both machines, and 100,000 loaded formulas hold 24–39% less memory on Linux. The engine download is 28% (default) and 32% (full) larger. Large INDEX/MATCH lookups are up to 125 times faster than before the change that sped them up.

0.7.0 against 0.6.1

Every figure in this section compares 0.7.0 with 0.6.1 on the same machine: Linux is an i9-12900H, Mac an M5 Pro.

Release comparison

The release capture ran on the release commit, with the published 0.6.1 packages beside it on both machines. Of 1,133 rows measured on both versions, 691 are at least 5% faster or smaller, 403 are within 5%, and 34 are slower beyond their noise, each with a stated reason below.

0.7.0 against 0.6.1, by user action

  • LinuxIntel Core i9-12900H
  • MacApple M5 Pro

Speed against 0.6.1 on the same machine, log scale: right of 1× is faster, left of 1× is slower. "0.5 of the time" plots at 2× faster.

  • First load and startupFirst load and startupLinux: 0.93 of the timeLinux 0.93 of the time
  • Opening a workbook or XLSX fileOpening a workbook or XLSX fileLinux: 0.54 of the time; Mac: 0.66 of the timeLinux 0.54 of the timeMac 0.66 of the time
  • ExportExportLinux: 0.81 of the time; Mac: 0.77 of the timeLinux 0.81 of the timeMac 0.77 of the time
  • ScrollingScrollingLinux: 0.33 of the time; Mac: 0.44 of the timeLinux 0.33 of the timeMac 0.44 of the time
  • Selecting and editingSelecting and editingLinux: 0.57 of the time; Mac: 0.83 of the timeLinux 0.57 of the timeMac 0.83 of the time
  • Typing formulas and recalculationTyping formulas and recalculationLinux: 0.22 of the time; Mac: 0.39 of the timeLinux 0.22 of the timeMac 0.39 of the time
  • Filters, sorts and pivotsFilters, sorts and pivotsLinux: 0.49 of the time; Mac: 0.11 of the timeLinux 0.49 of the timeMac 0.11 of the time
  • ChartsChartsLinux: 0.24 of the timeLinux 0.24 of the time
  • Collaboration and historyCollaboration and historyLinux: 0.32 of the timeLinux 0.32 of the time
  • Memory over a long sessionMemory over a long sessionLinux: 0.80 of the time; Mac: 0.73 of the timeLinux 0.80 of the timeMac 0.73 of the time

Each mark is the geometric mean of the 0.7.0 / 0.6.1 ratios of that action's rows.

Version comparison, 0.7.0 against 0.6.1

  • LinuxIntel Core i9-12900H
  • MacApple M5 Pro

Speed against 0.6.1 on the same machine, log scale: right of 1× is faster, left of 1× is slower. "0.5 of the time" plots at 2× faster.

  • Recalculation, geomean of the shared rows, default engineRecalculation, geomean of the shared rows, default engineLinux: 0.099 ms instead of 0.273 ms; Mac: 0.029 ms instead of 0.089 msLinux 0.099 ms instead of 0.273 msMac 0.029 ms instead of 0.089 ms
  • Recalculation, geomean of the shared rows, full engineRecalculation, geomean of the shared rows, full engineLinux: 0.101 ms instead of 0.278 ms; Mac: 0.029 ms instead of 0.089 msLinux 0.101 ms instead of 0.278 msMac 0.029 ms instead of 0.089 ms
  • Recalculate a fan-out over 100,000 formulasRecalculate a fan-out over 100,000 formulasLinux: 7.24 ms instead of 33.30 ms; Mac: 2.75 ms instead of 16.47 msLinux 7.24 ms instead of 33.30 msMac 2.75 ms instead of 16.47 ms
  • XLSX import, 50,000 rows, default engineXLSX import, 50,000 rows, default engineLinux: 2,272 ms instead of 3,488 ms; Mac: 736 ms instead of 1,149 msLinux 2,272 ms instead of 3,488 msMac 736 ms instead of 1,149 ms
  • XLSX export, default engineXLSX export, default engineLinux: 1,454 ms instead of 1,763 ms; Mac: 438 ms instead of 520 msLinux 1,454 ms instead of 1,763 msMac 438 ms instead of 520 ms
  • Retained memory after loading 100,000 formulas: 40.4 MiB instead of 53.4 MiB (default) and 34.5 MiB instead of 56.2 MiB (full) on Linux, and 38.0 MiB instead of 63.8 MiB (full) on the Mac. The Mac's default-engine change, and its peak memory, are within its noise.
  • Engine download, Brotli: 389 KiB instead of 304 KiB (default) and 557 KiB instead of 423 KiB (full).
  • The method, the noise and every row are in the comparison results.

Measured by each change

Before the release, a speed pass took the workloads that were slower than in 0.6.1 back below it where it could. Each change measured its own rows against 0.6.1 on Linux.

Speed pass, 0.7.0 against 0.6.1

  • LinuxIntel Core i9-12900H
  • RangeLowest to highest across machines and engines

Speed against 0.6.1 on the same machine, log scale: right of 1× is faster, left of 1× is slower. "0.5 of the time" plots at 2× faster.

  • RANK over 4,000 formulasRANK over 4,000 formulasLinux: 0.005 of the timeLinux 0.005 of the time
  • INDIRECT over 100,000 formulasINDIRECT over 100,000 formulasRange: 0.305–0.309 of the timeRange 0.305–0.309 of the time
  • Load 100,000 formulas with sheet-qualified referencesLoad 100,000 formulas with sheet-qualified referencesRange: 0.373–0.395 of the timeRange 0.373–0.395 of the time
  • ROUND over 10,000 formulasROUND over 10,000 formulasRange: 0.669–0.748 of the timeRange 0.669–0.748 of the time
  • OFFSET over 100,000 formulasOFFSET over 100,000 formulasRange: 0.516–0.522 of the timeRange 0.516–0.522 of the time
  • Conditional-format window, 100,000 rowsConditional-format window, 100,000 rowsRange: 0.441–0.453 of the timeRange 0.441–0.453 of the time
  • Build a 100,000-row pivotBuild a 100,000-row pivotLinux: 0.680 of the timeLinux 0.680 of the time
  • Paste 1,000 rows × 10 columnsPaste 1,000 rows × 10 columnsLinux: 8.98 ms instead of 18.59 msLinux 8.98 ms instead of 18.59 ms
  • CSV import, 200,000 rows × 10 columnsCSV import, 200,000 rows × 10 columnsLinux: 333.9 ms instead of 440.3 msLinux 333.9 ms instead of 440.3 ms
  • Select a range, with a command-state handlerSelect a range, with a command-state handlerLinux: 3.20 ms instead of 10.86 msLinux 3.20 ms instead of 10.86 ms
  • Multi-key sort of 10,000 rowsMulti-key sort of 10,000 rowsLinux: 1.673 ms instead of 5.518 msLinux 1.673 ms instead of 5.518 ms
  • One filter over 1,000,000 rowsOne filter over 1,000,000 rowsLinux: 5.8 ms instead of 6.6 msLinux 5.8 ms instead of 6.6 ms
  • Filter 100,000 rows by a list of 50,000 valuesFilter 100,000 rows by a list of 50,000 valuesLinux: 30.3 ms instead of 85.1 msLinux 30.3 ms instead of 85.1 ms
  • Create a 1,000,000-row paged storeCreate a 1,000,000-row paged storeLinux: 0.877–0.914 of the timeLinux 0.877–0.914 of the time
  • Read a window of cellsRead a window of cellsLinux: 0.869–0.891 of the timeLinux 0.869–0.891 of the time
  • Scroll sidewaysScroll sidewaysLinux: 0.42 of the timeLinux 0.42 of the time
  • Scroll downScroll downLinux: 0.19–0.25 of the timeLinux 0.19–0.25 of the time
  • Refuse a hostile XLSX file, in a fresh processRefuse a hostile XLSX file, in a fresh processLinux: 0.829–0.837 of the timeLinux 0.829–0.837 of the time
  • Every row of the pivot benchmark is faster than in 0.6.1, and two filters take 0.70 of 0.6.1's time.
  • After an XLSX import, 1.07 MB stays in memory, against 1.10 MB in 0.6.1.
  • XLSX export peaks at 0.90–0.94 of 0.6.1's memory.
  • The engine's JavaScript glue is 4.4 KB smaller than in 0.6.1.

Still slower than 0.6.1

The release capture finds these rows slower than 0.6.1 beyond their noise:

  • Engine download: 28% larger on the default engine and 32% on the full engine. A cold start in Node without a cached engine is 23% slower for the same reason. Loading the code a page needs first and the rest after it is planned for 0.8.0.
  • Cell editor: opening it takes 1.02–1.09× of 0.6.1's time, about 0.03 ms more at most, and committing an edit at 1,000 rows on Linux 1.08×, about 0.07 ms more.
  • XLSX export memory on the Mac: after a collection, the rich and shared-style exports hold 2.60× and 1.62× of 0.6.1's memory. JavaScriptCore's pending background compilation holds it, not Sheetwrite's objects; with that compilation off, they hold 1.11–1.13×.
  • Refusing a compression bomb: allocates 101 KB instead of 52 KB, three 16 KB heap blocks that the first call sets up.
  • Small fixed rows: two formula retained-memory rows (+99 B and +3.8 KB), the 1,000-row data edit, a cold first-edit formula row (1.05×), and one core-paths row of two samples, which an isolated rerun puts at 0.76× of 0.6.1.

Each change against the code before it

The groups below give each change's own gain, measured against the code just before it, not against 0.6.1. "0.25 of the time" means four times faster. A range covers both machines, or the default and the full engine.

Formulas and recalculation

INDEX/MATCH lookups read only the cell they return: 200 lookups over 100,000 rows take 0.008 of the time on the Mac and 0.011 on Linux.

Formulas and recalculation, each change against the code before it

  • LinuxIntel Core i9-12900H
  • MacApple M5 Pro
  • RangeLowest to highest across machines and engines

Speed against the code before the change on the same machine, log scale: right of 1× is faster, left of 1× is slower. "0.5 of the time" plots at 2× faster.

  • 200 INDEX/MATCH lookups over 100,000 rows200 INDEX/MATCH lookups over 100,000 rowsLinux: 0.011 of the time; Mac: 0.008 of the timeLinux 0.011 of the timeMac 0.008 of the time
  • Append a table rowAppend a table rowRange: about 60× fasterRange about 60× faster
  • Redefine a name 100,000 formulas useRedefine a name 100,000 formulas useLinux: 19 ms instead of 491 msLinux 19 ms instead of 491 ms
  • COUNTIF with a number criterion, 100k cellsCOUNTIF with a number criterion, 100k cellsRange: 11.5–18× fasterRange 11.5–18× faster
  • SUM over two 100k rangesSUM over two 100k rangesRange: 2.15–6.62× fasterRange 2.15–6.62× faster
  • A LET in every rowA LET in every rowRange: 0.17–0.22 of the timeRange 0.17–0.22 of the time
  • MAP, REDUCE, BYROW and named LAMBDA callsMAP, REDUCE, BYROW and named LAMBDA callsRange: 0.41–0.64 of the timeRange 0.41–0.64 of the time
  • The dependency index for 100k formulas shrinks from 7.67 MB to 1.21 MB.

Charts and pivots

With 20,000 formula-backed charts, an unrelated edit and the chart refresh take 0.006 ms instead of 20.2 ms on the Mac and 0.016 ms instead of 47.3 ms on Linux.

Charts and pivots, each change against the code before it

  • LinuxIntel Core i9-12900H
  • MacApple M5 Pro
  • RangeLowest to highest across machines and engines

Speed against the code before the change on the same machine, log scale: right of 1× is faster, left of 1× is slower. "0.5 of the time" plots at 2× faster.

  • Unrelated edit with 20,000 formula-backed chartsUnrelated edit with 20,000 formula-backed chartsLinux: 0.016 ms instead of 47.3 ms; Mac: 0.006 ms instead of 20.2 msLinux 0.016 ms instead of 47.3 msMac 0.006 ms instead of 20.2 ms
  • Edit on another sheet, PivotTable field list openEdit on another sheet, PivotTable field list openMac: 12.95 µs instead of 1.629 msMac 12.95 µs instead of 1.629 ms
  • Pivot of measures over 100,000 rowsPivot of measures over 100,000 rowsRange: 0.66–0.71 of the timeRange 0.66–0.71 of the time
  • GETPIVOTDATA recalculates only when its pivot changes, as in Excel.

Paged and large data

A row insert in a 1,000,000-row paged sheet takes 0.0136–0.0221 of the time.

Paged and large data, each change against the code before it

  • LinuxIntel Core i9-12900H
  • MacApple M5 Pro
  • RangeLowest to highest across machines and engines

Speed against the code before the change on the same machine, log scale: right of 1× is faster, left of 1× is slower. "0.5 of the time" plots at 2× faster.

  • Row insert, 1,000,000-row paged sheetRow insert, 1,000,000-row paged sheetRange: 0.0136–0.0221 of the timeRange 0.0136–0.0221 of the time
  • Drain 10,000 acknowledged editsDrain 10,000 acknowledged editsMac: 0.246 ms instead of 4.004 msMac 0.246 ms instead of 4.004 ms
  • Admit a 1,000,000-cell setBlockAdmit a 1,000,000-cell setBlockLinux: 65 ms instead of 617 ms; Mac: 17 ms instead of 212 msLinux 65 ms instead of 617 msMac 17 ms instead of 212 ms
  • Range formulas over loaded pagesRange formulas over loaded pagesRange: 3.0–3.1× fasterRange 3.0–3.1× faster
  • After a fast fling, cells show "loading" up to 74% less.

Grid and editing

Setting 100,000 row heights one at a time takes 0.49 s instead of 151.8 s on the Mac and 2.05 s instead of 340.8 s on Linux.

Grid and editing, each change against the code before it

  • LinuxIntel Core i9-12900H
  • MacApple M5 Pro
  • RangeLowest to highest across machines and engines

Speed against the code before the change on the same machine, log scale: right of 1× is faster, left of 1× is slower. "0.5 of the time" plots at 2× faster.

  • Set 100,000 row heights one at a timeSet 100,000 row heights one at a timeLinux: 2.05 s instead of 340.8 s; Mac: 0.49 s instead of 151.8 sLinux 2.05 s instead of 340.8 sMac 0.49 s instead of 151.8 s
  • Paint a wrapped cell of 20,000 charactersPaint a wrapped cell of 20,000 charactersMac: 0.175 ms instead of 0.887 msMac 0.175 ms instead of 0.887 ms
  • Sort command on 1,000–4,000 numbersSort command on 1,000–4,000 numbersRange: 0.329–0.509 of the workRange 0.329–0.509 of the work
  • Scrolling with the cell editor open forces no style or layout work.

Import and export

CSV import takes 7.3% less time on the Mac and 11.0% less on Linux.

Import and export, each change against the code before it

  • LinuxIntel Core i9-12900H
  • MacApple M5 Pro
  • RangeLowest to highest across machines and engines

Speed against the code before the change on the same machine, log scale: right of 1× is faster, left of 1× is slower. "0.5 of the time" plots at 2× faster.

  • Load formulasLoad formulasRange: 1.21–1.46× fasterRange 1.21–1.46× faster
  • CSV importCSV importLinux: 11.0% less time; Mac: 7.3% less timeLinux 11.0% less timeMac 7.3% less time
  • XLSX export of 100,000 formulasXLSX export of 100,000 formulasLinux: 1,030 ms instead of 1,126 ms; Mac: 481 ms instead of 519 msLinux 1,030 ms instead of 1,126 msMac 481 ms instead of 519 ms

Download size

grid.css, the one stylesheet part every grid needs, is 4,666 B, where the old stylesheet was 89,452 B.

  • Shared sorts make the engines 13,307 B (default) and 16,248 B (full) Brotli smaller, and writing number text without Rust's float formatting saves 6,784–7,113 B (default) and 5,561–5,563 B (full).
  • The query engine (85,351 B gzip) and the version comparison kernel (16,646 B gzip) load only when they are used.

Breaking changes

The 0.7.0 upgrade guide lists every change with its replacement. The changes most apps meet:

Add-ons install through initSheetwrite

0.6

import "@sheetwrite/charts/register";
import "@sheetwrite/xlsx/register";
import * as formulas from "@sheetwrite/formulas";
await initSheetwrite(undefined, formulas);

0.7.0

import { chartsAddon } from "@sheetwrite/charts";
import { initSheetwrite } from "@sheetwrite/core";
import * as formulas from "@sheetwrite/formulas";
import { xlsxAddon } from "@sheetwrite/xlsx";
});

registerChartsBackend, registerXlsxBackends, the chart and XLSX backend setters and the positional initSheetwrite(source, engine) are removed with the /register imports.

Sort moves the cells

0.6

// Sorted the view only.
grid.sortBy(2, true);
grid.setSort([{ col: 2, ascending: true }]);

0.7.0

import type { Grid } from "@sheetwrite/core";
export function sortByRegion(grid: Grid) {
// Sorts the cells, as Excel does.
grid.sortBy(2, true);
// The display-only sort.
grid.setViewSort([{ col: 2, ascending: true }]);
}

store.sortBy, store.sortByMulti, grid.setSort and grid.sortByMulti are removed. An imported worksheet sortState is kept, not applied as a view sort.

Revisions move to version history

0.6

const revisions = new RevisionCoordinator(adapter, { documentId, serverVersion });
const [latest] = await revisions.list();
await revisions.restore(latest.version, crypto.randomUUID());

0.7.0

import type { Grid, SyncCoordinator } from "@sheetwrite/core";
import { HistoryArchive, type HistoryStorageAdapter } from "@sheetwrite/core/history";
export async function restoreLatest(
grid: Grid,
) {
const archive = await HistoryArchive.open({ documentId: "workbook-42", storage });
const { versions } = await archive.listVersions({ maxEntries: 20 });
const latest = versions[0];
if (latest === undefined) return;
return archive.restoreVersion(grid, latest.id, { kind: "workbook" }, { sync });
}

Chart views are read-only

ChartView.chart is now the store's own definition, typed ReadonlyChartDefinition, and development builds freeze it. Edit a copy from grid.getCharts(sheet) and commit it with grid.setChart. The result of rebaseDocumentOperations can hold your own operations, so treat it as read-only too. See Chart views are read-only.

Removed engine bindings

Direct @sheetwrite/wasm and @sheetwrite/formulas users must replace these bindings:

RemovedReplacement
CellStore.setColumnNumbers, setColumnStrings, setColumnStringsPackedFrom 0.7.2, setColumnBlockCells, setBlockCells or setSparseCells, which take one string per cell; on 0.7.0 and 0.7.1, the raw setColumnBlockPacked, setBlockPacked or setSparseBlock
DiffKernel.clearPageConsume the page arrays; the next compare starts a new page
DiffKernel.pageLengthRead the length of a returned page array

The scalar setters and clearCell, CellStore.rowCount / colCount, and WindowView.nRows / nCols remain public APIs.

setSheetName now returns whether it named the sheet. Like renameSheet, it refuses an empty name, a name another sheet holds in any case, and another sheet's id.

Excel's keys, search, paste and validation

  • A host key that uses a new default key, such as Ctrl+B, Ctrl+1 or Ctrl+Alt+V, now throws shortcut-conflict. Rebind the action or set it to null. See Keyboard defaults.
  • A selection's active cell is the cell it started from, reported as active.
  • Cut no longer empties its cells; the paste moves them with the new moveCells operation, and the "cut" commit reason is gone. Servers that check operation kinds must accept it.
  • Search treats * and ? as wildcards, looks in formulas unless lookIn: "values", and searches only a selection of more than one cell. A number in a number format matches by its text, and Find selects the match.
  • A paste brings the copied cells' validation rules. paste.keepValidation: true keeps the target's rules, as 0.6 did.
  • DataValidationCondition, ColumnFilter and SheetNameIssueCode have new members.

New general column type

Columns Sheetwrite makes are general, not text, and read typing as Excel's General format does. Handle general where your code switches on Column.type, and update collaborating clients together: a 0.6 peer refuses a snapshot or patch with a general column. See Editing, filters and sheets.

Errors and cancellation

  • Bad input and passed limits throw a SheetwriteError (invalid-argument, not-found, invalid-limits) instead of RangeError, TypeError or Error.
  • Aborted XLSX, CSV, comment and sync calls reject with the signal's reason.
  • A WebAssembly trap throws engine-failed and makes every grid on that engine read-only.

Direct XLSX formula conversion

From 0.7.2, direct callers of @sheetwrite/wasm or @sheetwrite/formulas convert a list of formulas with one call, which returns every formula in input order:

Convert formulas for an XLSX file, from 0.7.2
import { createEngine, formulasToXlsx } from "@sheetwrite/wasm";
const engine = await createEngine();
// ["=SUM(A1:A3)", "=_xlfn.CONCAT(A1, B1)"]
export const saved = formulasToXlsx(engine, ["=SUM(A1:A3)", "=CONCAT(A1, B1)"]);
engine.retire();

formulasFromXlsx reads them back, and setSparseCells takes one string per entry, as setSparseBlock did in 0.6. The raw convertXlsxFormulas stays as the low-level transport: it takes joined sources, cumulative UTF-16 ends and a changed-index buffer, and returns only the changed formulas; 0.7.0 and 0.7.1 have only the raw call. The scalar formulaToXlsx and formulaFromXlsx exports are removed; pass a list of one formula instead. Core's XlsxFormulaEngine.convert keeps its array interface. See Direct engine calls.

Upgrade to 0.7.0

Every removed and changed API with its replacement, the document operations to accept on your server, and the behavior changes you will notice.

Open the guide