diff --git a/static/js/controllers.js b/static/js/controllers.js index 0935611e7..6b7599d59 100644 --- a/static/js/controllers.js +++ b/static/js/controllers.js @@ -785,7 +785,10 @@ function BuildPackageCtrl($scope, Restangular, ApiService, $routeParams, $rootSc }; $scope.initializeTree = function() { - if ($scope.drawn) { return; } + if ($scope.drawn) { + $scope.tree.notifyResized(); + return; + } $scope.drawn = true; $timeout(function() { diff --git a/static/js/graphing.js b/static/js/graphing.js index d73844ceb..b796fd8a4 100644 --- a/static/js/graphing.js +++ b/static/js/graphing.js @@ -857,10 +857,10 @@ FileTreeBase.prototype.calculateDimensions_ = function(container) { var margin = { top: 40, right: 00, bottom: 20, left: 20 }; var m = [margin.top, margin.right, margin.bottom, margin.left]; - var w = cw - m[1] - m[3]; - var h = ch - m[0] - m[2]; + var w = Math.max(0, cw - m[1] - m[3]); + var h = Math.max(0, ch - m[0] - m[2]); - var barWidth = cw * 0.8 - m[1] - m[3]; + var barWidth = Math.max(0, cw * 0.8 - m[1] - m[3]); return { 'w': w,