Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic height canvas changes, Updated pathwayviz.js #547

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/app/core/assets/pathway/pathwayviz.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ schemeUtil.showReagents=true;
schemeUtil.showReagentsRoles=false;
schemeUtil.approvalCode="UNII";
schemeUtil.width=1100;
schemeUtil.height=2000;
schemeUtil.height=600;
schemeUtil.maxTextLen=19;
schemeUtil.maxTitleTextLen=50;
schemeUtil.showProcessNames=true;
Expand Down Expand Up @@ -138,6 +138,7 @@ schemeUtil.makeMaterialNode = function(smat, pidArr){
}
return nn;
};
var totalSteps = 0; // this is to get the total number of steps from each process
schemeUtil.makeDisplayGraph = function(g4, maxSteps, showReagents) {
if(!maxSteps)maxSteps = schemeUtil.maxContinuousSteps;
if(!showReagents)showReagents = schemeUtil.showReagents;
Expand All @@ -160,7 +161,7 @@ schemeUtil.makeDisplayGraph = function(g4, maxSteps, showReagents) {

var lax=schemeUtil.getGapAxis();
var oax=schemeUtil.getOtherGapAxis();

totalSteps = 0;// reinitializing the steps
for (var i = 0; i < g4.specifiedSubstanceG4m.process.length; i++) {
var p = g4.specifiedSubstanceG4m.process[i];
var processName = p.processName.trim();
Expand All @@ -174,6 +175,7 @@ schemeUtil.makeDisplayGraph = function(g4, maxSteps, showReagents) {
var maxReagents=0;
var addedNodes=[];
var arrows=[];
totalSteps = totalSteps + stg.length;
for (ii = 0; ii < stg.length; ii++) {
maxReagents=Math.max(stg[ii].startingMaterials.length,maxReagents);
maxReagents=Math.max(stg[ii].resultingMaterials.length,maxReagents);
Expand Down Expand Up @@ -599,7 +601,7 @@ schemeUtil.renderScheme=function(nn2, selector, iter, ddx, ddy) {
return n.y - hh / 2 + pad + dy;
};
d3.select(selector).select('svg').remove();

height=schemeUtil.height * totalSteps;
var d3cola = cola.d3adaptor(d3)
.avoidOverlaps(true)
.size([width, height]);
Expand Down
Loading