CellInterface
Common interface for cell-like objects (Cell and DefinedName). Defines the shared properties and methods between cells in sheets and defined names.
Properties
Section titled “Properties”_ast:
ASTRootNode
Cached abstract syntax tree, if this.f has been parsed.
Slight wart: an ASTNode can be a literal cell value, including null, but in this attribute, null means that the cell does not have an AST, not that it has an AST consisting of a single null node. This does not cause serious ambiguity in practice, because a null AST node only really makes sense in particular contexts, i.e. as elements of arrays and function call arguments, not as the root of an abstract syntax tree.
_container
Section titled “_container”_container:
null|CellContainer
_spill
Section titled “_spill”_spill:
null|RTreeMatrixNode
R-Tree node of the spill range containing this cell. Null for defined names.
f:
null|string
formula, if any
optionalft:null|"a"
Formula type, ‘a’ for array formula, absent for single-cell formula.
id:
string
this cell’s address ID in A1 format (unprefixed), or defined name
neutralizedFormula
Section titled “neutralizedFormula”neutralizedFormula:
null|string
Formula which was neutralized by a write to/overlapping this cell
state:
number
State for recalcWithMarkAndEvalQueue. The delta cell.state - wb._recalcState.upToDateState is what’s meaningful:
- +1 == DIRTY - may require recomputation (because an ancestor changed) but has not been enqueued for recomputation (because the recalculation has not propagated to this cell or another that depends transitively on it)
- +2 == ENQUEUEING - the cell’s dependencies are being enqueued (state used to detect static circular dependencies)
- +3 == ENQUEUED_MAYBE - enqueued to ensure correct evaluation order because some other cell that depends transitively on this cell has been enqueued for recalculation, but this cell is not yet known to require recomputation, because we have not observed a change in a direct dependency of this cell
- +3 == ENQUEUED_CALC - enqueued and known to require recomputation, because some direct dependency of this cell has changed
- +5 == the new UPTODATE, during a recalculation (at the end of which
wb._recalcState.upToDateStategets set to this) -
+5 can’t happen
- <= 0 == UPTODATE - the cell value is known to be up-to-date (it may have been dirtied in an earlier recalculation which then did not propagate to it, because each actual dependency path from a recalculation root to this cell included a cell that evaluated to the same value as before)
At the end of a recalculation, wb._recalcState.upToDateState is
incremented by NUM_STATES, so any cells that were not reached by the
recalculation (because all their dependencies were unchanged) will then
have this delta < 0 and thus be automatically deemed up-to-date at the next
recalculation.
vertexId
Section titled “vertexId”vertexId:
CellVertexId|NameVertexId
Cached vertex ID for dependency graph operations
Accessors
Section titled “Accessors”formulaZ
Section titled “formulaZ”Get Signature
Section titled “Get Signature”get formulaZ():
null|string
The cell’s formula-assigned number format, if present.
Returns
Section titled “Returns”null | string
sheetIndex
Section titled “sheetIndex”Get Signature
Section titled “Get Signature”get sheetIndex():
null|number
Returns
Section titled “Returns”null | number
Get Signature
Section titled “Get Signature”get v():
null|string|number|boolean|FormulaError|Lambda|Reference|Matrix
Returns
Section titled “Returns”null | string | number | boolean | FormulaError | Lambda | Reference | Matrix
Set Signature
Section titled “Set Signature”set v(
value):void
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
valueBoxed
Section titled “valueBoxed”Get Signature
Section titled “Get Signature”get valueBoxed():
MaybeBoxedFormulaValue
The value of the cell. If the cell’s value has a formula-assigned number format, the value will be a boxed value containing that number format.
Returns
Section titled “Returns”workbookKey
Section titled “workbookKey”Get Signature
Section titled “Get Signature”get workbookKey():
number
Returns
Section titled “Returns”number
Get Signature
Section titled “Get Signature”get z():
null|string
The effective number format of the cell.
The effective number format is the user-assigned number format, if present. Otherwise, it is the formula-assigned number format.
Returns
Section titled “Returns”null | string
Methods
Section titled “Methods”clear()
Section titled “clear()”clear():
void
Returns
Section titled “Returns”void
edit()
Section titled “edit()”edit(
cellData):void
Parameters
Section titled “Parameters”cellData
Section titled “cellData”JSFCellExpanded
Returns
Section titled “Returns”void
hasValue()
Section titled “hasValue()”hasValue():
boolean
Returns
Section titled “Returns”boolean
hasValueOrFormula()
Section titled “hasValueOrFormula()”hasValueOrFormula():
boolean
Returns
Section titled “Returns”boolean
isBlank()
Section titled “isBlank()”isBlank():
boolean
Returns
Section titled “Returns”boolean
isSpillAnchor()
Section titled “isSpillAnchor()”isSpillAnchor():
boolean
Returns
Section titled “Returns”boolean
isSpilled()
Section titled “isSpilled()”isSpilled():
this is Cell & { _spill: { valid: true }; F: string; sheetIndex: number }
Returns
Section titled “Returns”this is Cell & { _spill: { valid: true }; F: string; sheetIndex: number }
spillHeight()
Section titled “spillHeight()”spillHeight():
number
Returns
Section titled “Returns”number
spillWidth()
Section titled “spillWidth()”spillWidth():
number
Returns
Section titled “Returns”number
toString()
Section titled “toString()”toString():
string
Returns
Section titled “Returns”string