@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
Parameter | Type |
---|---|
_currentConfigService | IFormulaCurrentConfigService |
_runtimeService | IFormulaRuntimeService |
_otherFormulaManagerService | IOtherFormulaManagerService |
_featureCalculationManagerService | IFeatureCalculationManagerService |
_interpreter | Interpreter |
_astTreeBuilder | AstTreeBuilder |
_lexer | Lexer |
_dependencyManagerService | IDependencyManagerService |
Returns
Overrides
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_astTreeBuilder | readonly | AstTreeBuilder | undefined | - | submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:75 |
_currentConfigService | readonly | IFormulaCurrentConfigService | undefined | - | submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:69 |
_dependencyManagerService | readonly | IDependencyManagerService | undefined | - | submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:77 |
_dependencyRTreeCacheForAddressFunction | protected | RTree | undefined | - | submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:66 |
_disposed | protected | boolean | false | Disposable ._disposed | submodules/univer/packages/core/src/shared/lifecycle.ts:96 |
_lexer | readonly | Lexer | undefined | - | submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:76 |
_otherFormulaManagerService | readonly | IOtherFormulaManagerService | undefined | - | submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:71 |
_runtimeService | readonly | IFormulaRuntimeService | undefined | - | 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
Parameter | Type |
---|---|
treeDependencyCache | RTree |
tree | IFormulaDependencyTree |
Returns
Promise
<void
>
_calculateListByFunctionRefNode()
protected _calculateListByFunctionRefNode(treeList): Promise<void>
Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:857
Parameters
Parameter | Type |
---|---|
treeList | IFormulaDependencyTree [] |
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
Parameter | Type |
---|---|
treeList | IFormulaDependencyTree [] |
Returns
(
| FormulaDependencyTree
| FormulaDependencyTreeVirtual
)[]
_checkIsCycleDependency()
protected _checkIsCycleDependency(treeList): boolean
Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:301
Parameters
Parameter | Type |
---|---|
treeList | IFormulaDependencyTree [] |
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
Parameter | Type |
---|---|
dirtyRanges | IFeatureDirtyRangeType |
Returns
_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
Parameter | Type |
---|---|
unitId | string |
sheetId | string |
row | number |
column | number |
unitData | IUnitData |
formulaDataItem | IFormulaDataItem |
Returns
_createVirtualFDtree()
protected _createVirtualFDtree(tree, formulaDataItem): FormulaDependencyTreeVirtual
Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:639
Parameters
Parameter | Type |
---|---|
tree | FormulaDependencyTree |
formulaDataItem | IFormulaDataItem |
Returns
_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
Parameter | Type |
---|---|
formulaData | IFormulaData |
otherFormulaData | IOtherFormulaData |
unitData | IUnitData |
Returns
Promise
<IFormulaDependencyTree
[]>
_getAddressFunctionNodeList()
protected _getAddressFunctionNodeList(node): FunctionNode[]
Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:812
Parameters
Parameter | Type |
---|---|
node | Nullable <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
Parameter | Type |
---|---|
featureId | string |
treeId | Nullable <number > |
params | IFeatureCalculationManagerParam |
Returns
_getFirstCellOfRange()
protected _getFirstCellOfRange(ranges): {
firstColumn: number;
firstRow: number;
}
Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:528
Parameters
Parameter | Type |
---|---|
ranges | IRange [] |
Returns
{
firstColumn: number;
firstRow: number;
}
_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
Parameter | Type |
---|---|
referenceFunctionList | FunctionNode [] |
refOffsetX | number |
refOffsetY | number |
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
Parameter | Type |
---|---|
nodeData | IExecuteAstNodeData |
Returns
Promise
<IUnitRange
[]>
_getTreeById()
protected _getTreeById(treeId): Nullable<IFormulaDependencyTree>
Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:1011
Parameters
Parameter | Type |
---|---|
treeId | number |
Returns
Nullable
<IFormulaDependencyTree
>
_getTreeNode()
protected _getTreeNode(tree): AstRootNode
Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:824
Parameters
Parameter | Type |
---|---|
tree | IFormulaDependencyTree |
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
Parameter | Type |
---|---|
treeList | IFormulaDependencyTree [] |
Returns
_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
Parameter | Type |
---|---|
tree | IFormulaDependencyTree |
node | BaseAstNode |
Returns
boolean
_registerFeatureFormulas()
protected _registerFeatureFormulas(treeList): void
Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:405
Parameters
Parameter | Type |
---|---|
treeList | FormulaDependencyTree [] |
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
Parameter | Type |
---|---|
formulaDataKeys | string [] |
formulaData | IFormulaData |
unitData | IUnitData |
treeList | IFormulaDependencyTree [] |
Returns
void
_registerOtherFormulas()
protected _registerOtherFormulas(
otherFormulaData,
otherFormulaDataKeys,
treeList): void
Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:456
Parameters
Parameter | Type |
---|---|
otherFormulaData | IOtherFormulaData |
otherFormulaDataKeys | string [] |
treeList | IFormulaDependencyTree [] |
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
disposeWithMe()
disposeWithMe(disposable): IDisposable
Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:99
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
ensureNotDisposed()
protected ensureNotDisposed(): void
Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:103
Returns
void
Inherited from
generate()
generate(): Promise<(
| FormulaDependencyTree
| FormulaDependencyTreeVirtual)[]>
Defined in: submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:88
Returns
Promise
<(
| FormulaDependencyTree
| FormulaDependencyTreeVirtual
)[]>