commit/galaxy-central: carlfeberhard: Fix to 8f8341a
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/a83921df0dc2/ Changeset: a83921df0dc2 User: carlfeberhard Date: 2014-10-15 18:12:14+00:00 Summary: Fix to 8f8341a Affected #: 3 files diff -r 8f8341ac47cd276cf0a2aa3d1c1098f7d3d58c75 -r a83921df0dc2047c6874c6daeddbe3047c86cd4e client/galaxy/scripts/mvc/history/history-structure-view.js --- a/client/galaxy/scripts/mvc/history/history-structure-view.js +++ b/client/galaxy/scripts/mvc/history/history-structure-view.js @@ -48,7 +48,7 @@ }); // set the collection (HistoryContents) for the job to that json (setting historyId for proper ajax urls) job.outputCollection.reset( outputModels ); - job.outputCollection.historyId = structure.model.id; + job.outputCollection.historyId = view.model.id; //this.debug( job.outputCollection ); // create the bbone view for the job (to be positioned later accrd. to the layout) and cache diff -r 8f8341ac47cd276cf0a2aa3d1c1098f7d3d58c75 -r a83921df0dc2047c6874c6daeddbe3047c86cd4e static/scripts/mvc/history/history-structure-view.js --- a/static/scripts/mvc/history/history-structure-view.js +++ b/static/scripts/mvc/history/history-structure-view.js @@ -48,7 +48,7 @@ }); // set the collection (HistoryContents) for the job to that json (setting historyId for proper ajax urls) job.outputCollection.reset( outputModels ); - job.outputCollection.historyId = structure.model.id; + job.outputCollection.historyId = view.model.id; //this.debug( job.outputCollection ); // create the bbone view for the job (to be positioned later accrd. to the layout) and cache diff -r 8f8341ac47cd276cf0a2aa3d1c1098f7d3d58c75 -r a83921df0dc2047c6874c6daeddbe3047c86cd4e static/scripts/packed/mvc/history/history-structure-view.js --- a/static/scripts/packed/mvc/history/history-structure-view.js +++ b/static/scripts/packed/mvc/history/history-structure-view.js @@ -1,1 +1,1 @@ -define(["mvc/job/job-model","mvc/job/job-li","mvc/history/history-content-model","mvc/history/job-dag","mvc/base-mvc","utils/localization","libs/d3"],function(e,f,i,c,h,a){var b=Backbone.View.extend(h.LoggableMixin).extend({className:"history-structure-component",initialize:function(j){this.log(this+"(HistoryStructureComponent).initialize:",j);this.component=j.component;this._jobLiMap={};this._createJobModels();this.layout=this._createLayout(j.layoutOptions)},_createJobModels:function(){var j=this;j.component.eachVertex(function(o){var n=o.data.job,m=new e.Job(n);var l=_.map(m.get("outputs"),function(p){var r=p.src==="hda"?"dataset":"dataset_collection",q=i.typeIdStr(r,p.id);return j.model.contents.get(q)});m.outputCollection.reset(l);m.outputCollection.historyId=structure.model.id;var k=new f.JobListItemView({model:m,expanded:true});k.$el.appendTo(j.$el);j._jobLiMap[m.id]=k});return j.jobs},layoutDefaults:{paddingTop:8,paddingLeft:20,linkSpacing:16,jobHeight:308,jobWidthSpacing:320,linkAdjX:4,linkAdjY:0},_createLayout:function(l){l=_.defaults(_.clone(l||{}),this.layoutDefaults);var j=this,k=_.values(j.component.vertices),m=_.extend(l,{nodeMap:{},links:[],el:{width:0,height:0},svg:{width:0,height:0,top:0,left:0}});k.forEach(function(n,o){var p={name:n.name,x:0,y:0};m.nodeMap[n.name]=p});j.component.edges(function(o){var n={source:o.source,target:o.target};m.links.push(n)});return m},_updateLayout:function(){var k=this,l=k.layout;l.svg.height=l.paddingTop+(l.linkSpacing*_.size(l.nodeMap));l.el.height=l.svg.height+l.jobHeight;var j=l.paddingLeft,m=l.svg.height;_.each(l.nodeMap,function(o,n){o.x=j;o.y=m;j+=l.jobWidthSpacing});l.el.width=l.svg.width=Math.max(l.el.width,j);l.links.forEach(function(n){var o=l.nodeMap[n.source],p=l.nodeMap[n.target];n.x1=o.x+l.linkAdjX;n.y1=o.y+l.linkAdjY;n.x2=p.x+l.linkAdjX;n.y2=p.y+l.linkAdjY});return this.layout},render:function(k){this.log(this+".renderComponent:",k);var j=this;j.component.eachVertex(function(m){var l=j._jobLiMap[m.name];if(!l.$el.is(":visible")){l.render(0)}});j._updateLayout();j.$el.width(j.layout.el.width).height(j.layout.el.height);this.renderSVG();j.component.eachVertex(function(n){var m=j._jobLiMap[n.name],l=j.layout.nodeMap[m.model.id];m.$el.css({top:l.y,left:l.x})});return this},renderSVG:function(){var j=this,o=j.layout;var k=d3.select(this.el).select("svg");if(k.empty()){k=d3.select(this.el).append("svg")}k.attr("width",o.svg.width).attr("height",o.svg.height);function m(p){d3.select(this).classed("highlighted",true);j._jobLiMap[p.source].$el.addClass("highlighted");j._jobLiMap[p.target].$el.addClass("highlighted")}function l(p){d3.select(this).classed("highlighted",false);j._jobLiMap[p.source].$el.removeClass("highlighted");j._jobLiMap[p.target].$el.removeClass("highlighted")}var n=k.selectAll(".connection").data(o.links);n.enter().append("path").attr("class","connection").attr("id",function(p){return p.source+"-"+p.target}).on("mouseover",m).on("mouseout",l);n.transition().attr("d",function(p){return j._connectionPath(p)});return k.node()},_connectionPath:function(k){var l=0,j=((k.x2-k.x1)/this.layout.svg.width)*this.layout.svg.height;return["M",k.x1,",",k.y1," ","C",k.x1+l,",",k.y1-j," ",k.x2-l,",",k.y2-j," ",k.x2,",",k.y2].join("")},events:{"mouseover .job.list-item":function(j){this.highlightConnected(j.currentTarget,true)},"mouseout .job.list-item":function(j){this.highlightConnected(j.currentTarget,false)}},highlightConnected:function(p,k){k=k!==undefined?k:true;var j=this,l=j.component,n=k?jQuery.prototype.addClass:jQuery.prototype.removeClass,m=k?"connection highlighted":"connection";var o=n.call($(p),"highlighted"),q=o.attr("id").replace("job-","");l.edges({target:q}).forEach(function(r){n.call(j.$("#job-"+r.source),"highlighted");j.$("#"+r.source+"-"+q).attr("class",m)});l.vertices[q].eachEdge(function(r){n.call(j.$("#job-"+r.target),"highlighted");j.$("#"+q+"-"+r.target).attr("class",m)})},toString:function(){return"HistoryStructureComponent("+this.model.id+")"}});var g=b.extend({logger:console,className:b.prototype.className+" vertical",layoutDefaults:{paddingTop:8,paddingLeft:20,linkSpacing:16,jobWidth:308,jobHeight:308,initialSpacing:64,jobSpacing:16,linkAdjX:0,linkAdjY:4},_updateLayout:function(){var k=this,l=k.layout;l.svg.width=l.paddingLeft+(l.linkSpacing*_.size(l.nodeMap));l.el.width=l.svg.width+l.jobWidth;l.el.height=0;var j=l.svg.width,m=l.paddingTop;_.each(l.nodeMap,function(p,o){p.x=j;p.y=m;var n=k._jobLiMap[o];if(n.$el.is(":visible")){m+=n.$el.height()+l.jobSpacing}else{m+=l.initialSpacing+l.jobSpacing}});l.el.height=l.svg.height=Math.max(l.el.height,m);l.links.forEach(function(n){var o=l.nodeMap[n.source],p=l.nodeMap[n.target];n.x1=o.x+l.linkAdjX;n.y1=o.y+l.linkAdjY;n.x2=p.x+l.linkAdjX;n.y2=p.y+l.linkAdjY;k.debug("link:",n.x1,n.y1,n.x2,n.y2,n)});k.debug("el:",l.el);k.debug("svg:",l.svg);return l},_connectionPath:function(l){var k=0,j=((l.y2-l.y1)/this.layout.svg.height)*this.layout.svg.width;return["M",l.x1,",",l.y1," ","C",l.x1-j,",",l.y1+k," ",l.x2-j,",",l.y2-k," ",l.x2,",",l.y2].join("")},toString:function(){return"VerticalHistoryStructureComponent("+this.model.id+")"}});var d=Backbone.View.extend(h.LoggableMixin).extend({className:"history-structure",initialize:function(j){this.log(this+"(HistoryStructureView).initialize:",j,this.model);this.jobs=j.jobs;this._createDAG()},_createDAG:function(){this.dag=new c({historyContents:this.model.contents.toJSON(),jobs:this.jobs,excludeSetMetadata:true,excludeErroredJobs:true});this.log(this+".dag:",this.dag);this._createComponents()},_createComponents:function(){this.log(this+"._createComponents");var j=this;j.componentViews=j.dag.weakComponentGraphArray().map(function(k){return j._createComponent(k)})},_createComponent:function(j){this.log(this+"._createComponent:",j);return new b({model:this.model,component:j})},render:function(k){this.log(this+".render:",k);var j=this;j.$el.html(['<div class="controls"></div>','<div class="components"></div>'].join(""));j.componentViews.forEach(function(l){l.render().$el.appendTo(j.$components())});return j},$components:function(){return this.$(".components")},toString:function(){return"HistoryStructureView()"}});return d}); \ No newline at end of file +define(["mvc/job/job-model","mvc/job/job-li","mvc/history/history-content-model","mvc/history/job-dag","mvc/base-mvc","utils/localization","libs/d3"],function(e,f,i,c,h,a){var b=Backbone.View.extend(h.LoggableMixin).extend({className:"history-structure-component",initialize:function(j){this.log(this+"(HistoryStructureComponent).initialize:",j);this.component=j.component;this._jobLiMap={};this._createJobModels();this.layout=this._createLayout(j.layoutOptions)},_createJobModels:function(){var j=this;j.component.eachVertex(function(o){var n=o.data.job,m=new e.Job(n);var l=_.map(m.get("outputs"),function(p){var r=p.src==="hda"?"dataset":"dataset_collection",q=i.typeIdStr(r,p.id);return j.model.contents.get(q)});m.outputCollection.reset(l);m.outputCollection.historyId=j.model.id;var k=new f.JobListItemView({model:m,expanded:true});k.$el.appendTo(j.$el);j._jobLiMap[m.id]=k});return j.jobs},layoutDefaults:{paddingTop:8,paddingLeft:20,linkSpacing:16,jobHeight:308,jobWidthSpacing:320,linkAdjX:4,linkAdjY:0},_createLayout:function(l){l=_.defaults(_.clone(l||{}),this.layoutDefaults);var j=this,k=_.values(j.component.vertices),m=_.extend(l,{nodeMap:{},links:[],el:{width:0,height:0},svg:{width:0,height:0,top:0,left:0}});k.forEach(function(n,o){var p={name:n.name,x:0,y:0};m.nodeMap[n.name]=p});j.component.edges(function(o){var n={source:o.source,target:o.target};m.links.push(n)});return m},_updateLayout:function(){var k=this,l=k.layout;l.svg.height=l.paddingTop+(l.linkSpacing*_.size(l.nodeMap));l.el.height=l.svg.height+l.jobHeight;var j=l.paddingLeft,m=l.svg.height;_.each(l.nodeMap,function(o,n){o.x=j;o.y=m;j+=l.jobWidthSpacing});l.el.width=l.svg.width=Math.max(l.el.width,j);l.links.forEach(function(n){var o=l.nodeMap[n.source],p=l.nodeMap[n.target];n.x1=o.x+l.linkAdjX;n.y1=o.y+l.linkAdjY;n.x2=p.x+l.linkAdjX;n.y2=p.y+l.linkAdjY});return this.layout},render:function(k){this.log(this+".renderComponent:",k);var j=this;j.component.eachVertex(function(m){var l=j._jobLiMap[m.name];if(!l.$el.is(":visible")){l.render(0)}});j._updateLayout();j.$el.width(j.layout.el.width).height(j.layout.el.height);this.renderSVG();j.component.eachVertex(function(n){var m=j._jobLiMap[n.name],l=j.layout.nodeMap[m.model.id];m.$el.css({top:l.y,left:l.x})});return this},renderSVG:function(){var j=this,o=j.layout;var k=d3.select(this.el).select("svg");if(k.empty()){k=d3.select(this.el).append("svg")}k.attr("width",o.svg.width).attr("height",o.svg.height);function m(p){d3.select(this).classed("highlighted",true);j._jobLiMap[p.source].$el.addClass("highlighted");j._jobLiMap[p.target].$el.addClass("highlighted")}function l(p){d3.select(this).classed("highlighted",false);j._jobLiMap[p.source].$el.removeClass("highlighted");j._jobLiMap[p.target].$el.removeClass("highlighted")}var n=k.selectAll(".connection").data(o.links);n.enter().append("path").attr("class","connection").attr("id",function(p){return p.source+"-"+p.target}).on("mouseover",m).on("mouseout",l);n.transition().attr("d",function(p){return j._connectionPath(p)});return k.node()},_connectionPath:function(k){var l=0,j=((k.x2-k.x1)/this.layout.svg.width)*this.layout.svg.height;return["M",k.x1,",",k.y1," ","C",k.x1+l,",",k.y1-j," ",k.x2-l,",",k.y2-j," ",k.x2,",",k.y2].join("")},events:{"mouseover .job.list-item":function(j){this.highlightConnected(j.currentTarget,true)},"mouseout .job.list-item":function(j){this.highlightConnected(j.currentTarget,false)}},highlightConnected:function(p,k){k=k!==undefined?k:true;var j=this,l=j.component,n=k?jQuery.prototype.addClass:jQuery.prototype.removeClass,m=k?"connection highlighted":"connection";var o=n.call($(p),"highlighted"),q=o.attr("id").replace("job-","");l.edges({target:q}).forEach(function(r){n.call(j.$("#job-"+r.source),"highlighted");j.$("#"+r.source+"-"+q).attr("class",m)});l.vertices[q].eachEdge(function(r){n.call(j.$("#job-"+r.target),"highlighted");j.$("#"+q+"-"+r.target).attr("class",m)})},toString:function(){return"HistoryStructureComponent("+this.model.id+")"}});var g=b.extend({logger:console,className:b.prototype.className+" vertical",layoutDefaults:{paddingTop:8,paddingLeft:20,linkSpacing:16,jobWidth:308,jobHeight:308,initialSpacing:64,jobSpacing:16,linkAdjX:0,linkAdjY:4},_updateLayout:function(){var k=this,l=k.layout;l.svg.width=l.paddingLeft+(l.linkSpacing*_.size(l.nodeMap));l.el.width=l.svg.width+l.jobWidth;l.el.height=0;var j=l.svg.width,m=l.paddingTop;_.each(l.nodeMap,function(p,o){p.x=j;p.y=m;var n=k._jobLiMap[o];if(n.$el.is(":visible")){m+=n.$el.height()+l.jobSpacing}else{m+=l.initialSpacing+l.jobSpacing}});l.el.height=l.svg.height=Math.max(l.el.height,m);l.links.forEach(function(n){var o=l.nodeMap[n.source],p=l.nodeMap[n.target];n.x1=o.x+l.linkAdjX;n.y1=o.y+l.linkAdjY;n.x2=p.x+l.linkAdjX;n.y2=p.y+l.linkAdjY;k.debug("link:",n.x1,n.y1,n.x2,n.y2,n)});k.debug("el:",l.el);k.debug("svg:",l.svg);return l},_connectionPath:function(l){var k=0,j=((l.y2-l.y1)/this.layout.svg.height)*this.layout.svg.width;return["M",l.x1,",",l.y1," ","C",l.x1-j,",",l.y1+k," ",l.x2-j,",",l.y2-k," ",l.x2,",",l.y2].join("")},toString:function(){return"VerticalHistoryStructureComponent("+this.model.id+")"}});var d=Backbone.View.extend(h.LoggableMixin).extend({className:"history-structure",initialize:function(j){this.log(this+"(HistoryStructureView).initialize:",j,this.model);this.jobs=j.jobs;this._createDAG()},_createDAG:function(){this.dag=new c({historyContents:this.model.contents.toJSON(),jobs:this.jobs,excludeSetMetadata:true,excludeErroredJobs:true});this.log(this+".dag:",this.dag);this._createComponents()},_createComponents:function(){this.log(this+"._createComponents");var j=this;j.componentViews=j.dag.weakComponentGraphArray().map(function(k){return j._createComponent(k)})},_createComponent:function(j){this.log(this+"._createComponent:",j);return new b({model:this.model,component:j})},render:function(k){this.log(this+".render:",k);var j=this;j.$el.html(['<div class="controls"></div>','<div class="components"></div>'].join(""));j.componentViews.forEach(function(l){l.render().$el.appendTo(j.$components())});return j},$components:function(){return this.$(".components")},toString:function(){return"HistoryStructureView()"}});return d}); \ No newline at end of file Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org