You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2017/04/06 18:58:17 UTC
[28/50] ambari git commit: AMBARI-20413.The Zoom feature in WFM,
hides the WF completely either with Maximum and Min(M Madhan Nohan
Reddy via padmapriyanitt)
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/e0e8a041
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e0e8a041
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e0e8a041
Branch: refs/heads/branch-feature-AMBARI-12556
Commit: e0e8a041be2fa8896ba429ad481be3935efe1e1e
Parents: 4004ee8
Author: padmapriyanitt <pa...@gmail.com>
Authored: Tue Apr 4 16:26:18 2017 +0530
Committer: padmapriyanitt <pa...@gmail.com>
Committed: Tue Apr 4 16:26:18 2017 +0530
----------------------------------------------------------------------
.../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/e0e8a041/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){