summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/directives/graphs-v2/composition-graph/composition-graph.directive.ts
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/app/directives/graphs-v2/composition-graph/composition-graph.directive.ts')
-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);