summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/directives/graphs-v2/composition-graph
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2017-07-22 17:10:02 +0300
committerMichael Lando <ml636r@att.com>2017-07-22 17:10:02 +0300
commit9db4052423f34a76296ffdcda896cdeba2b4aead (patch)
tree7c3b779c6d09be40283158382dee2cf02767761e /catalog-ui/src/app/directives/graphs-v2/composition-graph
parent3c3c833897dbfc0e85feaf36086a505f990ecb76 (diff)
[sdc] 1710 rebase code
Change-Id: Icedeac71c0a9d27518969effcd5d5519de9955a6 Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-ui/src/app/directives/graphs-v2/composition-graph')
-rw-r--r--catalog-ui/src/app/directives/graphs-v2/composition-graph/composition-graph.directive.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/catalog-ui/src/app/directives/graphs-v2/composition-graph/composition-graph.directive.ts b/catalog-ui/src/app/directives/graphs-v2/composition-graph/composition-graph.directive.ts
index 9aa7941272..8b3a59ec1f 100644
--- a/catalog-ui/src/app/directives/graphs-v2/composition-graph/composition-graph.directive.ts
+++ b/catalog-ui/src/app/directives/graphs-v2/composition-graph/composition-graph.directive.ts
@@ -158,7 +158,7 @@ export class CompositionGraph implements ng.IDirective {
container: graphEl,
style: ComponentInstanceNodesStyle.getCompositionGraphStyle(),
zoomingEnabled: true,
- maxZoom: 2.5,
+ maxZoom: 1.2,
minZoom: .1,
userZoomingEnabled: false,
userPanningEnabled: true,
@@ -295,6 +295,10 @@ export class CompositionGraph implements ng.IDirective {
//Zooms to fit all of the nodes in the collection passed in. If no nodes are passed in, will zoom to fit all nodes on graph
scope.zoomAll = (nodes?:Cy.CollectionNodes) => {
+ if (!nodes || !nodes.length) {
+ nodes = this._cy.nodes();
+ }
+
scope.withSidebar = false;
this._cy.animate({
fit: { eles: nodes, padding: 20 },
@@ -311,9 +315,7 @@ export class CompositionGraph implements ng.IDirective {
}
};
- scope.highlightSearchMatches = (searchTerm: string) => {
- if (searchTerm === undefined) return; //dont zoom & highlight if click on Search initially (searchTerm will be undefined). However, allow highlights to be cleared after subsequent search (searchTerm will be "")
-
+ scope.highlightSearchMatches = (searchTerm: string) => {
this.NodesGraphUtils.highlightMatchingNodesByName(this._cy, searchTerm);
let matchingNodes: Cy.CollectionNodes = this.NodesGraphUtils.getMatchingNodesByName(this._cy, searchTerm);
scope.zoomAll(matchingNodes);