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

call graph is generated based on branch navigation changes #173

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
22 changes: 13 additions & 9 deletions src/visualization/call-graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ export class CallGraph {

d3.select(divElement).html("");

let margin = {top: 20, right: 20, bottom: 30, left: 40},
width = 400 - margin.left - margin.right,
height = 250 - margin.top - margin.bottom;
let margin = {top: 20, right: 20, bottom: 30, left: 40};
let width = $("#right-splitter").width() - margin.left - margin.right;
let height = $(".tab-content").height() - 300 - margin.top - margin.bottom;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call graph height fills up nearly the entirety of "tab-content" heigh


let rectWidth = 100,
rectHeight = 40;
Expand All @@ -139,11 +139,14 @@ export class CallGraph {
}))
.append("g");

svg.attr("transform","translate(150,0)");
$(window).resize(function() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call graph resizes with window

d3.select(divElement).select("svg").attr("width", $("#right-splitter").width() - margin.left - margin.right);
d3.select(divElement).select("svg").attr("height", $(".tab-content").height() - 300 - margin.top - margin.bottom);
});

let root = d3.hierarchy(branches),
nodes = root.descendants(),
links = root.descendants().slice(1);
let root = d3.hierarchy(branches);
let nodes = root.descendants();
let links = root.descendants().slice(1);

tree(root);
let link = svg.selectAll(".link")
Expand Down Expand Up @@ -263,10 +266,11 @@ export class CallGraph {

updatePins();

svg.selectAll(".node").selectAll("*").attr("transform","translate(" + (width/2 - rectWidth/2) + ",5)");
svg.selectAll(".node").selectAll("text").attr("transform","translate(" + width/2 + ",5)");
svg.selectAll(".link").attr("transform","translate(" + width/2 + ",5)");
}

d3.select(self.frameElement).style("height", 200 + "px");

}

createBranchHierarchy(branches) {
Expand Down