diff --git a/content.js b/content.js index 7574e4d..e8bcd59 100644 --- a/content.js +++ b/content.js @@ -33,6 +33,7 @@ if (isIE()) { // manage page content addLegend(); + addExpandAndCollapseTreeButtons(); addInfoBoxResizeBar(); addSideNavLinks(); addAutoComplete(document.getElementById("search_input")); diff --git a/dag.js b/dag.js index 3b39048..65f0347 100644 --- a/dag.js +++ b/dag.js @@ -77,6 +77,14 @@ function initGraph() { } updateShownNodeMap(treeData); drawTree(currentTree,"init"); + if(zoomTransform === undefined) + { + zoomTransform = d3.zoomIdentity + } + zoomTransform.k = 2.2; + zoomTransform.x = -2000; + zoomTransform.y = 2000; + graph.attr('transform', zoomTransform); } /** @@ -275,7 +283,13 @@ function drawTree(drawData,state) // keepTopLayersNodesUp(); svgSelection = d3.select("svg"); svgSelection.selectAll('*').remove(); - svgSelection.attr("viewBox", [0, 0, 11000, 10000].join(" ")); + if(state === "expand tree") + { + svgSelection.attr("viewBox", [0, 0, width, (window.innerHeight)*sizeFactor].join(" ")); + } + else{ + svgSelection.attr("viewBox", [0, 0, 11000, 10000].join(" ")); + } svgSelection.call(zoom); graph = svgSelection.append("g"); @@ -699,11 +713,11 @@ function updateTreeGraph(drawData,currentNodeId) { generateTreeLayout(drawData); layout(dag); - let highlight = false; - if(currentHighlightedNodeId === currentNodeId) - { - highlight = true; - } + // let highlight = false; + // if(currentHighlightedNodeId === currentNodeId) + // { + // highlight = true; + // } // keepTopLayersNodesUp(); // Select nodes @@ -725,10 +739,10 @@ function updateTreeGraph(drawData,currentNodeId) { drawTree(drawData,"update"); graph.attr('transform', zoomTransform); - if(highlight) - { + // if(highlight) + // { updateGraphPlot(currentNodeId); - } + // } } }); } @@ -797,4 +811,40 @@ function keepTopLayersNodesUp() node.points[0].y = rootsNodesCoord[node.source.data.id][1]; } }) +} + +function expandTree() +{ + currentTree = structuredClone(treeData); + for(let i = 0;i