From f8b7c32030b59309af24fa1e5c7c6548f4496d29 Mon Sep 17 00:00:00 2001 From: Lewis Sanchez <87730006+lewis-sanchez@users.noreply.github.com> Date: Fri, 4 Nov 2022 10:34:25 -0700 Subject: [PATCH] Centers selected node found by the expensive operation widget (#21103) --- package.json | 2 +- remote/package.json | 2 +- remote/web/package.json | 2 +- remote/web/yarn.lock | 6 +++--- remote/yarn.lock | 6 +++--- .../contrib/executionPlan/browser/azdataGraphView.ts | 2 +- .../browser/widgets/highlightExpensiveNodeWidget.ts | 7 ++++--- yarn.lock | 6 +++--- 8 files changed, 17 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index d8e792adc6..1c952ed8f2 100755 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "angular2-grid": "2.0.6", "ansi_up": "^5.1.0", "applicationinsights": "1.4.2", - "azdataGraph": "github:Microsoft/azdataGraph#0.0.56", + "azdataGraph": "github:Microsoft/azdataGraph#0.0.57", "chart.js": "^2.9.4", "chokidar": "3.5.1", "graceful-fs": "4.2.8", diff --git a/remote/package.json b/remote/package.json index e387b28f7a..93a0e24178 100755 --- a/remote/package.json +++ b/remote/package.json @@ -21,7 +21,7 @@ "applicationinsights": "1.4.2", "angular2-grid": "2.0.6", "ansi_up": "^5.1.0", - "azdataGraph": "github:Microsoft/azdataGraph#0.0.56", + "azdataGraph": "github:Microsoft/azdataGraph#0.0.57", "chart.js": "^2.9.4", "cookie": "^0.4.0", "graceful-fs": "4.2.8", diff --git a/remote/web/package.json b/remote/web/package.json index 98a9e94d82..8ceab38188 100755 --- a/remote/web/package.json +++ b/remote/web/package.json @@ -18,7 +18,7 @@ "@vscode/vscode-languagedetection": "1.0.21", "angular2-grid": "2.0.6", "ansi_up": "^5.1.0", - "azdataGraph": "github:Microsoft/azdataGraph#0.0.56", + "azdataGraph": "github:Microsoft/azdataGraph#0.0.57", "chart.js": "^2.9.4", "gridstack": "^3.1.3", "kburtram-query-plan": "2.6.1", diff --git a/remote/web/yarn.lock b/remote/web/yarn.lock index 1cc43cecc9..7331afdacf 100644 --- a/remote/web/yarn.lock +++ b/remote/web/yarn.lock @@ -181,9 +181,9 @@ array-uniq@^1.0.2: resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" integrity sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q== -"azdataGraph@github:Microsoft/azdataGraph#0.0.56": - version "0.0.56" - resolved "https://codeload.github.com/Microsoft/azdataGraph/tar.gz/7df642038282389a26efb92bf37bfa3450924ad0" +"azdataGraph@github:Microsoft/azdataGraph#0.0.57": + version "0.0.57" + resolved "https://codeload.github.com/Microsoft/azdataGraph/tar.gz/911884b2b347fcdc1d69a17207cec18940c6fb47" chalk@^2.3.0, chalk@^2.4.1: version "2.4.2" diff --git a/remote/yarn.lock b/remote/yarn.lock index f50666a387..11494931c1 100644 --- a/remote/yarn.lock +++ b/remote/yarn.lock @@ -246,9 +246,9 @@ async-listener@^0.6.0: semver "^5.3.0" shimmer "^1.1.0" -"azdataGraph@github:Microsoft/azdataGraph#0.0.56": - version "0.0.56" - resolved "https://codeload.github.com/Microsoft/azdataGraph/tar.gz/7df642038282389a26efb92bf37bfa3450924ad0" +"azdataGraph@github:Microsoft/azdataGraph#0.0.57": + version "0.0.57" + resolved "https://codeload.github.com/Microsoft/azdataGraph/tar.gz/911884b2b347fcdc1d69a17207cec18940c6fb47" base64-js@^1.3.1: version "1.5.1" diff --git a/src/sql/workbench/contrib/executionPlan/browser/azdataGraphView.ts b/src/sql/workbench/contrib/executionPlan/browser/azdataGraphView.ts index 692178c4ad..fa0af4933c 100644 --- a/src/sql/workbench/contrib/executionPlan/browser/azdataGraphView.ts +++ b/src/sql/workbench/contrib/executionPlan/browser/azdataGraphView.ts @@ -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); } diff --git a/src/sql/workbench/contrib/executionPlan/browser/widgets/highlightExpensiveNodeWidget.ts b/src/sql/workbench/contrib/executionPlan/browser/widgets/highlightExpensiveNodeWidget.ts index d81384f44f..135d8d6be9 100644 --- a/src/sql/workbench/contrib/executionPlan/browser/widgets/highlightExpensiveNodeWidget.ts +++ b/src/sql/workbench/contrib/executionPlan/browser/widgets/highlightExpensiveNodeWidget.ts @@ -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)); + } } } diff --git a/yarn.lock b/yarn.lock index b125714969..7373d4ffdc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2090,9 +2090,9 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== -"azdataGraph@github:Microsoft/azdataGraph#0.0.56": - version "0.0.56" - resolved "https://codeload.github.com/Microsoft/azdataGraph/tar.gz/7df642038282389a26efb92bf37bfa3450924ad0" +"azdataGraph@github:Microsoft/azdataGraph#0.0.57": + version "0.0.57" + resolved "https://codeload.github.com/Microsoft/azdataGraph/tar.gz/911884b2b347fcdc1d69a17207cec18940c6fb47" bach@^1.0.0: version "1.2.0"