@univerjsengine-formulaindexclassesFormuladependencygenerator

@univerjs/engine-formula v0.5.0-beta.1 • Docs


Class: FormulaDependencyGenerator

Extends

Constructors

new FormulaDependencyGenerator()

new FormulaDependencyGenerator(
   _currentConfigService, 
   _runtimeService, 
   _otherFormulaManagerService, 
   _featureCalculationManagerService, 
   _interpreter, 
   _astTreeBuilder, 
   _lexer, 
   _dependencyManagerService): FormulaDependencyGenerator

Parameters

ParameterType
_currentConfigServiceIFormulaCurrentConfigService
_runtimeServiceIFormulaRuntimeService
_otherFormulaManagerServiceIOtherFormulaManagerService
_featureCalculationManagerServiceIFeatureCalculationManagerService
_interpreterInterpreter
_astTreeBuilderAstTreeBuilder
_lexerLexer
_dependencyManagerServiceIDependencyManagerService

Returns

FormulaDependencyGenerator

Overrides

Disposable.constructor

Defined in

submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:65

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_astTreeBuilderreadonlyAstTreeBuilderundefined-submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:72
_currentConfigServicereadonlyIFormulaCurrentConfigServiceundefined-submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:66
_dependencyManagerServicereadonlyIDependencyManagerServiceundefined-submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:74
_disposedprotectedbooleanfalseDisposable._disposedsubmodules/univer/packages/core/src/shared/lifecycle.ts:93
_lexerreadonlyLexerundefined-submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:73
_otherFormulaManagerServicereadonlyIOtherFormulaManagerServiceundefined-submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:68
_runtimeServicereadonlyIFormulaRuntimeServiceundefined-submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:67

Methods

_calculateRunList()

protected _calculateRunList(treeList): (FormulaDependencyTree | FormulaDependencyTreeVirtual)[]

Generate the final formula calculation order array by traversing the dependency tree established via depth-first search.

Parameters

ParameterType
treeListIFormulaDependencyTree[]

Returns

(FormulaDependencyTree | FormulaDependencyTreeVirtual)[]

Defined in

submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:989


_checkIsCycleDependency()

protected _checkIsCycleDependency(treeList): boolean

Parameters

ParameterType
treeListIFormulaDependencyTree[]

Returns

boolean

Defined in

submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:294


_convertDirtyRangesToUnitRange()

protected _convertDirtyRangesToUnitRange(dirtyRanges): IUnitRange[]

TODO @DR-Univer: The next step will be to try changing the incoming dirtyRanges to an array, thus avoiding conversion.

Parameters

ParameterType
dirtyRangesIFeatureDirtyRangeType

Returns

IUnitRange[]

Defined in

submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:222


_createFDtree()

protected _createFDtree(
   unitId, 
   sheetId, 
   row, 
   column, 
   unitData, 
   formulaDataItem): FormulaDependencyTree

Parameters

ParameterType
unitIdstring
sheetIdstring
rownumber
columnnumber
unitDataIUnitData
formulaDataItemIFormulaDataItem

Returns

FormulaDependencyTree

Defined in

submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:605


_createVirtualFDtree()

protected _createVirtualFDtree(tree, formulaDataItem): FormulaDependencyTreeVirtual

Parameters

ParameterType
treeFormulaDependencyTree
formulaDataItemIFormulaDataItem

Returns

FormulaDependencyTreeVirtual

Defined in

submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:630


_generateTreeList()

protected _generateTreeList(
   formulaData, 
   otherFormulaData, 
unitData): Promise<IFormulaDependencyTree[]>

Generate nodes for the dependency tree, where each node contains all the reference data ranges included in each formula.

Parameters

ParameterType
formulaDataIFormulaData
otherFormulaDataIOtherFormulaData
unitDataIUnitData

Returns

Promise<IFormulaDependencyTree[]>

Defined in

submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:315


_getFeatureFormulaTree()

protected _getFeatureFormulaTree(
   featureId, 
   treeId, 
   params): FormulaDependencyTree

Parameters

ParameterType
featureIdstring
treeIdNullable<number>
paramsIFeatureCalculationManagerParam

Returns

FormulaDependencyTree

Defined in

submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:413


_getFirstCellOfRange()

protected _getFirstCellOfRange(ranges): {
  firstColumn: range.startColumn;
  firstRow: range.startRow;
}

Parameters

ParameterType
rangesIRange[]

Returns

{
  firstColumn: range.startColumn;
  firstRow: range.startRow;
}
NameTypeDefault valueDefined in
firstColumnnumberrange.startColumnsubmodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:523
firstRownumberrange.startRowsubmodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:522

Defined in

submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:519


_getRangeListByNode()

protected _getRangeListByNode(nodeData): Promise<IUnitRange[]>

Calculate the range required for collection in advance, including references and location functions (such as OFFSET, INDIRECT, INDEX, etc.).

Parameters

ParameterType
nodeDataIExecuteAstNodeData

Returns

Promise<IUnitRange[]>

Defined in

submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:764


_getUpdateTreeListAndMakeDependency()

protected _getUpdateTreeListAndMakeDependency(treeList): IFormulaDependencyTree[]

Build a formula dependency tree based on the dependency relationships.

Parameters

ParameterType
treeListIFormulaDependencyTree[]

Returns

IFormulaDependencyTree[]

Defined in

submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:817


_includeTree()

protected _includeTree(tree, node): boolean

Determine whether all ranges of the current node exist within the dirty area. If they are within the dirty area, return true, indicating that this node needs to be calculated.

Parameters

ParameterType
treeIFormulaDependencyTree
nodeBaseAstNode

Returns

boolean

Defined in

submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:921


_registerFeatureFormulas()

protected _registerFeatureFormulas(treeList): void

Parameters

ParameterType
treeListFormulaDependencyTree[]

Returns

void

Defined in

submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:396


_registerFormulas()

protected _registerFormulas(
   formulaDataKeys, 
   formulaData, 
   unitData, 
   treeList): void

Parameters

ParameterType
formulaDataKeysstring[]
formulaDataIFormulaData
unitDataIUnitData
treeListIFormulaDependencyTree[]

Returns

void

Defined in

submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:527


_registerOtherFormulas()

protected _registerOtherFormulas(
   otherFormulaData, 
   otherFormulaDataKeys, 
   treeList): void

Parameters

ParameterType
otherFormulaDataIOtherFormulaData
otherFormulaDataKeysstring[]
treeListIFormulaDependencyTree[]

Returns

void

Defined in

submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:447


_updateRangeFlatten()

protected _updateRangeFlatten(): void

Break down the dirty areas into ranges for subsequent matching.

Returns

void

Defined in

submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:644


dispose()

dispose(): void

Returns

void

Overrides

Disposable.dispose

Defined in

submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:79


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:96


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

Disposable.ensureNotDisposed

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:100


generate()

generate(): Promise<(FormulaDependencyTree | FormulaDependencyTreeVirtual)[]>

Returns

Promise<(FormulaDependencyTree | FormulaDependencyTreeVirtual)[]>

Defined in

submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:83