Workspace engine (ORIXWorkspace)
A workspace is an ordered list of cells. Formula cells may define a variable (NPV = …) or a function (f(x) = …);
live parameters define a variable driven by a slider; tables and graphs read variables.
flowchart LR
Investment --> NPV
DiscountRate(("DiscountRate<br/>live parameter")) --> NPV
CashFlow1 --> NPV
CashFlow2 --> NPV
CashFlow3 --> NPV
NPV --> Decision
DiscountRate --> Graph["graph cell"]
DiscountRate --> Table["table cell"]
Recalculation
- Parse every cell (two passes: function names are collected first so that
f(2)in another cell is a call). - Resolve names: the first definition of a name wins; a later duplicate is an error on that cell.
- Topological order (Kahn's algorithm in document order). Cells that cannot be ordered are in a cycle: each gets a
circularReferenceerror with the actual path (a → b → c → a). Nothing loops. - Evaluate in order. A cell whose dependency failed gets "Depends on “x”, which has an error".
- Incremental updates: editing a cell or moving a slider re-evaluates only that cell and its transitive dependents
(
lastRecalculatedlists them). Changes that alter names, the set of functions or the error structure trigger a full pass.
Cell order in the document does not matter for evaluation: c = a + b may appear above a = 5.
Exports
Plain text, Markdown, CSV (machine-readable full-precision values), LaTeX (a complete article document using amsmath),
and the native .orixcalc file. Every export ends with the assumptions that the numbers depend on: angle mode, percent
convention, complex mode, arithmetic model. Unit labels travel with their cells.
File format
.orixcalc is JSON: { checksum, format, version, workspace }. The checksum is the SHA-256 of the canonical encoding of
the document. On load: wrong format → rejected; newer version → rejected with a clear message; checksum mismatch → reported
as damaged, with the readable content returned for recovery; truncated file → reported as damaged.