@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
Parameter | Type |
---|---|
_currentConfigService | IFormulaCurrentConfigService |
_runtimeService | IFormulaRuntimeService |
_otherFormulaManagerService | IOtherFormulaManagerService |
_featureCalculationManagerService | IFeatureCalculationManagerService |
_interpreter | Interpreter |
_astTreeBuilder | AstTreeBuilder |
_lexer | Lexer |
_dependencyManagerService | IDependencyManagerService |
Returns
Overrides
Defined in
submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:65
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:72 |
_currentConfigService | readonly | IFormulaCurrentConfigService | undefined | - | submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:66 |
_dependencyManagerService | readonly | IDependencyManagerService | undefined | - | submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:74 |
_disposed | protected | boolean | false | Disposable ._disposed | submodules/univer/packages/core/src/shared/lifecycle.ts:93 |
_lexer | readonly | Lexer | undefined | - | submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:73 |
_otherFormulaManagerService | readonly | IOtherFormulaManagerService | undefined | - | submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:68 |
_runtimeService | readonly | IFormulaRuntimeService | undefined | - | 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
Parameter | Type |
---|---|
treeList | IFormulaDependencyTree [] |
Returns
(FormulaDependencyTree
| FormulaDependencyTreeVirtual
)[]
Defined in
submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:989
_checkIsCycleDependency()
protected _checkIsCycleDependency(treeList): boolean
Parameters
Parameter | Type |
---|---|
treeList | IFormulaDependencyTree [] |
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
Parameter | Type |
---|---|
dirtyRanges | IFeatureDirtyRangeType |
Returns
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
Parameter | Type |
---|---|
unitId | string |
sheetId | string |
row | number |
column | number |
unitData | IUnitData |
formulaDataItem | IFormulaDataItem |
Returns
Defined in
submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:605
_createVirtualFDtree()
protected _createVirtualFDtree(tree, formulaDataItem): FormulaDependencyTreeVirtual
Parameters
Parameter | Type |
---|---|
tree | FormulaDependencyTree |
formulaDataItem | IFormulaDataItem |
Returns
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
Parameter | Type |
---|---|
formulaData | IFormulaData |
otherFormulaData | IOtherFormulaData |
unitData | IUnitData |
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
Parameter | Type |
---|---|
featureId | string |
treeId | Nullable <number > |
params | IFeatureCalculationManagerParam |
Returns
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
Parameter | Type |
---|---|
ranges | IRange [] |
Returns
{
firstColumn: range.startColumn;
firstRow: range.startRow;
}
Name | Type | Default value | Defined in |
---|---|---|---|
firstColumn | number | range.startColumn | submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:523 |
firstRow | number | range.startRow | submodules/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
Parameter | Type |
---|---|
nodeData | IExecuteAstNodeData |
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
Parameter | Type |
---|---|
treeList | IFormulaDependencyTree [] |
Returns
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
Parameter | Type |
---|---|
tree | IFormulaDependencyTree |
node | BaseAstNode |
Returns
boolean
Defined in
submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:921
_registerFeatureFormulas()
protected _registerFeatureFormulas(treeList): void
Parameters
Parameter | Type |
---|---|
treeList | FormulaDependencyTree [] |
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
Parameter | Type |
---|---|
formulaDataKeys | string [] |
formulaData | IFormulaData |
unitData | IUnitData |
treeList | IFormulaDependencyTree [] |
Returns
void
Defined in
submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:527
_registerOtherFormulas()
protected _registerOtherFormulas(
otherFormulaData,
otherFormulaDataKeys,
treeList): void
Parameters
Parameter | Type |
---|---|
otherFormulaData | IOtherFormulaData |
otherFormulaDataKeys | string [] |
treeList | IFormulaDependencyTree [] |
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
Defined in
submodules/univer/packages/engine-formula/src/engine/dependency/formula-dependency.ts:79
disposeWithMe()
disposeWithMe(disposable): IDisposable
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
Defined in
submodules/univer/packages/core/src/shared/lifecycle.ts:96
ensureNotDisposed()
protected ensureNotDisposed(): void
Returns
void
Inherited from
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