Permalink
Browse files

Merge branch 'release'

  • Loading branch information...
2 parents 377e9e6 + 3c0f299 commit 402c2e49221ceca40fa43ca542ba8b0d9ac03632 @mbostock mbostock committed Aug 19, 2011
Showing with 33 additions and 16 deletions.
  1. +1 −1 d3.js
  2. +4 −6 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 −4 src/layout/force.js
  7. +2 −2 src/layout/tree.js
  8. +21 −0 test/layout/tree-test.js
View
2 d3.js
@@ -1,4 +1,4 @@
-(function(){d3 = {version: "1.29.5"}; // semver
+(function(){d3 = {version: "1.29.6"}; // semver
if (!Date.now) Date.now = function() {
return +new Date;
};
View
@@ -529,11 +529,9 @@ function d3_layout_forceDragUp() {
if (d3_layout_forceDragMoved) {
d3_layout_forceStopClick = true;
d3_layout_forceCancel();
- }
- // Don't trigger this for touchend.
- if (d3.event.type === "mouseup") {
- d3_layout_forceDragMove();
+ // Don't trigger mousemove for touchend.
+ if (d3.event.type === "mouseup") d3_layout_forceDragMove();
}
d3_layout_forceDragNode.fixed = false;
@@ -1486,8 +1484,8 @@ d3.layout.tree = function() {
function firstWalk(node, previousSibling) {
var children = node.children,
layout = node._tree;
- if (children) {
- var n = children.length,
+ if (children && (n = children.length)) {
+ var n,
firstChild = children[0],
previousChild,
ancestor = firstChild,
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.29.5"}; // semver
+d3 = {version: "1.29.6"}; // semver
View
@@ -323,11 +323,9 @@ function d3_layout_forceDragUp() {
if (d3_layout_forceDragMoved) {
d3_layout_forceStopClick = true;
d3_layout_forceCancel();
- }
- // Don't trigger this for touchend.
- if (d3.event.type === "mouseup") {
- d3_layout_forceDragMove();
+ // Don't trigger mousemove for touchend.
+ if (d3.event.type === "mouseup") d3_layout_forceDragMove();
}
d3_layout_forceDragNode.fixed = false;
View
@@ -11,8 +11,8 @@ d3.layout.tree = function() {
function firstWalk(node, previousSibling) {
var children = node.children,
layout = node._tree;
- if (children) {
- var n = children.length,
+ if (children && (n = children.length)) {
+ var n,
firstChild = children[0],
previousChild,
ancestor = firstChild,
View
@@ -0,0 +1,21 @@
+require("../env");
+require("../../d3");
+require("../../d3.layout");
+
+var vows = require("vows"),
+ assert = require("assert");
+
+var suite = vows.describe("d3.layout.tree");
+
+suite.addBatch({
+ "tree": {
+ topic: d3.layout.tree,
+ "can handle an empty children array": function(tree) {
+ assert.deepEqual(tree.nodes({children: []}), [
+ {children: [], depth: 0, x: 0.5, y: 0}
+ ]);
+ }
+ }
+});
+
+suite.export(module);

0 comments on commit 402c2e4

Please sign in to comment.