@univerjsengine-formulaindexclassesFormuladependencygenerator

@univerjs/engine-formula v0.5.4


Class: FormulaDependencyGenerator

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:63

Extends

Constructors

new FormulaDependencyGenerator()

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

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:68

Parameters

ParameterType
_currentConfigServiceIFormulaCurrentConfigService
_runtimeServiceIFormulaRuntimeService
_otherFormulaManagerServiceIOtherFormulaManagerService
_featureCalculationManagerServiceIFeatureCalculationManagerService
_interpreterInterpreter
_astTreeBuilderAstTreeBuilder
_lexerLexer
_dependencyManagerServiceIDependencyManagerService

Returns

FormulaDependencyGenerator

Overrides

Disposable.constructor

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_astTreeBuilderreadonlyAstTreeBuilderundefined-submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:75
_currentConfigServicereadonlyIFormulaCurrentConfigServiceundefined-submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:69
_dependencyManagerServicereadonlyIDependencyManagerServiceundefined-submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:77
_dependencyRTreeCacheForAddressFunctionprotectedRTreeundefined-submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:66
_disposedprotectedbooleanfalseDisposable._disposedsubmodules/univer/packages/core/src/shared/lifecycle.ts:96
_lexerreadonlyLexerundefined-submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:76
_otherFormulaManagerServicereadonlyIOtherFormulaManagerServiceundefined-submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:71
_runtimeServicereadonlyIFormulaRuntimeServiceundefined-submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:70

Methods

_buildDirtyRangesByAddressFunction()

protected _buildDirtyRangesByAddressFunction(treeDependencyCache, tree): Promise<void>

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:828

Parameters

ParameterType
treeDependencyCacheRTree
treeIFormulaDependencyTree

Returns

Promise<void>


_calculateListByFunctionRefNode()

protected _calculateListByFunctionRefNode(treeList): Promise<void>

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:857

Parameters

ParameterType
treeListIFormulaDependencyTree[]

Returns

Promise<void>


_calculateRunList()

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

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:1236

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

Parameters

ParameterType
treeListIFormulaDependencyTree[]

Returns

( | FormulaDependencyTree | FormulaDependencyTreeVirtual)[]


_checkIsCycleDependency()

protected _checkIsCycleDependency(treeList): boolean

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:301

Parameters

ParameterType
treeListIFormulaDependencyTree[]

Returns

boolean


_convertDirtyRangesToUnitRange()

protected _convertDirtyRangesToUnitRange(dirtyRanges): IUnitRange[]

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:229

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[]


_createFDtree()

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

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:614

Parameters

ParameterType
unitIdstring
sheetIdstring
rownumber
columnnumber
unitDataIUnitData
formulaDataItemIFormulaDataItem

Returns

FormulaDependencyTree


_createVirtualFDtree()

protected _createVirtualFDtree(tree, formulaDataItem): FormulaDependencyTreeVirtual

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:639

Parameters

ParameterType
treeFormulaDependencyTree
formulaDataItemIFormulaDataItem

Returns

FormulaDependencyTreeVirtual


_generateTreeList()

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

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:322

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[]>


_getAddressFunctionNodeList()

protected _getAddressFunctionNodeList(node): FunctionNode[]

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:812

Parameters

ParameterType
nodeNullable<BaseAstNode>

Returns

FunctionNode[]


_getFeatureFormulaTree()

protected _getFeatureFormulaTree(
   featureId, 
   treeId, 
   params): FormulaDependencyTree

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:422

Parameters

ParameterType
featureIdstring
treeIdNullable<number>
paramsIFeatureCalculationManagerParam

Returns

FormulaDependencyTree


_getFirstCellOfRange()

protected _getFirstCellOfRange(ranges): {
  firstColumn: number;
  firstRow: number;
}

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:528

Parameters

ParameterType
rangesIRange[]

Returns

{
  firstColumn: number;
  firstRow: number;
}
NameTypeDefault valueDefined in
firstColumnnumberrange.startColumnsubmodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:532
firstRownumberrange.startRowsubmodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:531

_getRangeListByFunctionRefNode()

protected _getRangeListByFunctionRefNode(
   referenceFunctionList, 
   refOffsetX, 
refOffsetY): Promise<IUnitRange[]>

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:1037

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

Parameters

ParameterType
referenceFunctionListFunctionNode[]
refOffsetXnumber
refOffsetYnumber

Returns

Promise<IUnitRange[]>


_getRangeListByNode()

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

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:780

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[]>


_getTreeById()

protected _getTreeById(treeId): Nullable<IFormulaDependencyTree>

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:1011

Parameters

ParameterType
treeIdnumber

Returns

Nullable<IFormulaDependencyTree>


_getTreeNode()

protected _getTreeNode(tree): AstRootNode

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:824

Parameters

ParameterType
treeIFormulaDependencyTree

Returns

AstRootNode


_getUpdateTreeListAndMakeDependency()

protected _getUpdateTreeListAndMakeDependency(treeList): IFormulaDependencyTree[]

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:1060

Build a formula dependency tree based on the dependency relationships.

Parameters

ParameterType
treeListIFormulaDependencyTree[]

Returns

IFormulaDependencyTree[]


_includeTree()

protected _includeTree(tree, node): boolean

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:1168

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


_registerFeatureFormulas()

protected _registerFeatureFormulas(treeList): void

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:405

Parameters

ParameterType
treeListFormulaDependencyTree[]

Returns

void


_registerFormulas()

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

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:536

Parameters

ParameterType
formulaDataKeysstring[]
formulaDataIFormulaData
unitDataIUnitData
treeListIFormulaDependencyTree[]

Returns

void


_registerOtherFormulas()

protected _registerOtherFormulas(
   otherFormulaData, 
   otherFormulaDataKeys, 
   treeList): void

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:456

Parameters

ParameterType
otherFormulaDataIOtherFormulaData
otherFormulaDataKeysstring[]
treeListIFormulaDependencyTree[]

Returns

void


_updateRangeFlatten()

protected _updateRangeFlatten(): void

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:653

Break down the dirty areas into ranges for subsequent matching.

Returns

void


dispose()

dispose(): void

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:82

Returns

void

Overrides

Disposable.dispose


disposeWithMe()

disposeWithMe(disposable): IDisposable

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:99

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe


ensureNotDisposed()

protected ensureNotDisposed(): void

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:103

Returns

void

Inherited from

Disposable.ensureNotDisposed


generate()

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

Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:88

Returns

Promise<( | FormulaDependencyTree | FormulaDependencyTreeVirtual)[]>