Centers selected node found by the expensive operation widget (#21103)

This commit is contained in:
Lewis Sanchez
2022-11-04 10:34:25 -07:00
committed by GitHub
parent 1159301483
commit f8b7c32030
8 changed files with 17 additions and 16 deletions

View File

@@ -273,7 +273,7 @@ export class AzdataGraphView extends Disposable {
this._diagram.clearExpensiveOperatorHighlighting();
}
public highlightExpensiveOperator(predicate: (cell: AzDataGraphCell) => number): boolean {
public highlightExpensiveOperator(predicate: (cell: AzDataGraphCell) => number): string {
return this._diagram.highlightExpensiveOperator(predicate);
}

View File

@@ -301,9 +301,10 @@ export class HighlightExpensiveOperationAction extends Action {
const expensiveOperationDelegate: (cell: AzDataGraphCell) => number | undefined = context.getExpensiveOperationDelegate();
context.executionPlanDiagram.clearExpensiveOperatorHighlighting();
context.executionPlanDiagram.highlightExpensiveOperator(expensiveOperationDelegate);
// lewissanchez TODO: Add focus logic to center the highlighted node. Removed the error message logic since the expensive operation widget
// is only populated with plan metrics that are contained in a plan.
const elementId = context.executionPlanDiagram.highlightExpensiveOperator(expensiveOperationDelegate);
if (elementId) {
context.executionPlanDiagram.centerElement(context.executionPlanDiagram.getElementById(elementId));
}
}
}