AMBARI-20413.The Zoom feature in WFM, hides the WF completely either with Maximum and Min(M Madhan Nohan Reddy via padmapriyanitt)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/be230392 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/be230392 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/be230392 Branch: refs/heads/branch-3.0-perf Commit: be2303927e30ccab0ec70ff5823a17204eaf2644 Parents: cc88312 Author: padmapriyanitt <[email protected]> Authored: Tue Apr 4 16:26:18 2017 +0530 Committer: Andrew Onishuk <[email protected]> Committed: Thu Apr 6 12:32:56 2017 +0300 ---------------------------------------------------------------------- .../resources/ui/app/domain/cytoscape-flow-renderer.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/be230392/contrib/views/wfmanager/src/main/resources/ui/app/domain/cytoscape-flow-renderer.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/domain/cytoscape-flow-renderer.js b/contrib/views/wfmanager/src/main/resources/ui/app/domain/cytoscape-flow-renderer.js index bfe59e2..af84f86 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/domain/cytoscape-flow-renderer.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/domain/cytoscape-flow-renderer.js @@ -48,8 +48,6 @@ var CytoscapeRenderer= Ember.Object.extend({ }; this.cy.panzoom( defaults ); - //this.cy.center(); - this.cy.pan({x:200,y:50}); this._addEvents(this.cy); var self = this; this.get("context").$('.overlay-transition-content').popover({ @@ -69,6 +67,14 @@ var CytoscapeRenderer= Ember.Object.extend({ _setCyOverflow() { Ember.set(this.get("cyOverflow"), "overflown", this.cy.elements().renderedBoundingBox().y2 > this.cy.height()); }, + _setGraphCenter() { + var startDataNode = this.get("dataNodes").filterBy("data.type", "start"); + if (startDataNode[0] && startDataNode[0].data.id) { + var startNode = this.cy.$("#" + startDataNode[0].data.id); + this.cy.center(); + this.cy.pan({y:50}); + } + }, _getShape(nodeType) { switch(nodeType) { case 'start' : @@ -394,6 +400,7 @@ var CytoscapeRenderer= Ember.Object.extend({ this.cy.endBatch(); this.cy.layout(this.get("layoutConfigs")); this._setCyOverflow(); + this._setGraphCenter(); }, initRenderer(callback, settings){
