Permalink
Browse files

Merge branch 'release'

  • Loading branch information...
2 parents 6a9eda0 + 94f4ed2 commit e2346ad471673fddd9a023686c5fc884c66b6a8d @mbostock mbostock committed Jul 31, 2011
Showing with 24 additions and 9 deletions.
  1. +1 −1 d3.js
  2. +2 −2 d3.layout.js
  3. +1 −1 d3.layout.min.js
  4. +1 −1 d3.min.js
  5. +1 −1 src/core/core.js
  6. +2 −2 src/layout/treemap.js
  7. +7 −1 test/layout/test-treemap.js
  8. +9 −0 test/layout/test-treemap.out
View
2 d3.js
@@ -1,4 +1,4 @@
-(function(){d3 = {version: "1.28.0"}; // semver
+(function(){d3 = {version: "1.28.1"}; // semver
if (!Date.now) Date.now = function() {
return +new Date;
};
View
@@ -1795,13 +1795,13 @@ d3.layout.treemap = function() {
i = -1,
n = row.length;
while (++i < n) {
- r = row[i].area;
+ if (!(r = row[i].area)) continue;
if (r < rmin) rmin = r;
if (r > rmax) rmax = r;
}
s *= s;
u *= u;
- return rmin || rmax
+ return s
? Math.max((u * rmax * ratio) / s, s / (u * rmin * ratio))
: Infinity;
}
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1 +1 @@
-d3 = {version: "1.28.0"}; // semver
+d3 = {version: "1.28.1"}; // semver
View
@@ -86,13 +86,13 @@ d3.layout.treemap = function() {
i = -1,
n = row.length;
while (++i < n) {
- r = row[i].area;
+ if (!(r = row[i].area)) continue;
if (r < rmin) rmin = r;
if (r > rmax) rmax = r;
}
s *= s;
u *= u;
- return rmin || rmax
+ return s
? Math.max((u * rmax * ratio) / s, s / (u * rmin * ratio))
: Infinity;
}
@@ -60,6 +60,12 @@ console.log(" function(x) null ", log(treemap.padding(function(x) { ret
console.log(" null ", log(treemap.padding(null).nodes(tree)[1]));
console.log("");
+treemap.size([1000, 1000]);
+var tree = {children: [{value: 2}, {value: 260}, {value: 180}, {value: 2}, {value: 1}, {value: 0}]};
+console.log("zero-sized node:");
+treemap.nodes(tree).forEach(function(node) { console.log(new Array(node.depth + 2).join(" ") + log(node)); });
+console.log("");
+
function log(node) {
return node.x + "," + node.y + "," + node.dx + "," + node.dy;
-}
+}
@@ -41,3 +41,12 @@ padding:
function(x) null 0,0,10,10
null 0,0,10,10
+zero-sized node:
+ 0,0,1000,1000
+ 16,0,11,416
+ 0,416,1000,584
+ 27,0,973,416
+ 5,0,11,416
+ 0,0,5,416
+ 0,0,0,416
+

0 comments on commit e2346ad

Please sign in to comment.