Merge branch 'master' into scale-clone

This commit is contained in:
Mike Bostock 2011-08-19 13:56:02 -07:00
Родитель d2b152ce7f 402c2e4922
Коммит 434b9eedb9
8 изменённых файлов: 33 добавлений и 16 удалений

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;
};

Просмотреть файл

@ -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,

2
d3.layout.min.js поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

2
d3.min.js поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -1 +1 @@
d3 = {version: "1.29.5"}; // semver
d3 = {version: "1.29.6"}; // semver

Просмотреть файл

@ -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;

Просмотреть файл

@ -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,

21
test/layout/tree-test.js Normal file
Просмотреть файл

@ -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);