Fix tree graph when there are many branches and they do not have a common root node. Also adds a test repo to check this case

This commit is contained in:
Joseph Schorr 2014-01-20 17:38:33 -05:00
parent 0bfa172543
commit 4054ead45d
2 changed files with 24 additions and 3 deletions

View file

@ -26,7 +26,7 @@ if (!Function.prototype.bind) {
}
var DEPTH_HEIGHT = 100;
var DEPTH_WIDTH = 132;
var DEPTH_WIDTH = 140;
/**
* Based off of http://mbostock.github.io/d3/talk/20111018/tree.html by Mike Bostock (@mbostock)
@ -387,7 +387,7 @@ ImageHistoryTree.prototype.buildRoot_ = function() {
// Determine the maximum number of nodes at a particular level. This is used to size
// the width of the tree properly.
var maxChildCount = 0;
var maxChildCount = roots.length;
for (var i = 0; i < this.images_.length; ++i) {
var image = this.images_[i];
var imageNode = imageByDBID[image.dbid];