aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/directives/graphs-v2/composition-graph/utils/composition-graph-general-utils.ts
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2017-07-18 20:46:42 +0300
committerMichael Lando <ml636r@att.com>2017-07-18 20:46:42 +0300
commit39a4e0cb1b805470ad85ed4cf4fdeb69610ae98c (patch)
tree9faa499670544cce1ec5510c242ad984871ca32d /catalog-ui/src/app/directives/graphs-v2/composition-graph/utils/composition-graph-general-utils.ts
parentb8e2faf476202b6ffe61bc3a9a37df1304881d40 (diff)
[SDC] rebase 1710
Change-Id: I07fced02f40a57700d9d35ed3ba498bca351fb13 Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-ui/src/app/directives/graphs-v2/composition-graph/utils/composition-graph-general-utils.ts')
-rw-r--r--catalog-ui/src/app/directives/graphs-v2/composition-graph/utils/composition-graph-general-utils.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/catalog-ui/src/app/directives/graphs-v2/composition-graph/utils/composition-graph-general-utils.ts b/catalog-ui/src/app/directives/graphs-v2/composition-graph/utils/composition-graph-general-utils.ts
index 608031430b..0ea38af825 100644
--- a/catalog-ui/src/app/directives/graphs-v2/composition-graph/utils/composition-graph-general-utils.ts
+++ b/catalog-ui/src/app/directives/graphs-v2/composition-graph/utils/composition-graph-general-utils.ts
@@ -64,6 +64,14 @@ export class CompositionGraphGeneralUtils {
};
+ public zoomGraphTo = (cy:Cy.Instance, zoomLevel: number):void => {
+ let zy = cy.height() / 2;
+ let zx = cy.width() / 2;
+ cy.zoom({
+ level: zoomLevel,
+ renderedPosition: { x: zx, y: zy }
+ });
+ }
/**
* will return true/false if two nodes overlapping
*