Skip to content

Commit ebdffc0

Browse files
committed
Remove deprecated support for wrapping data.
1 parent 4e32681 commit ebdffc0

3 files changed

Lines changed: 16 additions & 31 deletions

File tree

d3.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4630,10 +4630,8 @@
46304630
}
46314631
d3.layout.hierarchy = function() {
46324632
var sort = d3_layout_hierarchySort, children = d3_layout_hierarchyChildren, value = d3_layout_hierarchyValue;
4633-
function recurse(data, depth, nodes) {
4634-
var childs = children.call(hierarchy, data, depth), node = d3_layout_hierarchyInline ? data : {
4635-
data: data
4636-
};
4633+
function recurse(node, depth, nodes) {
4634+
var childs = children.call(hierarchy, node, depth);
46374635
node.depth = depth;
46384636
nodes.push(node);
46394637
if (childs && (n = childs.length)) {
@@ -4647,7 +4645,7 @@
46474645
if (sort) c.sort(sort);
46484646
if (value) node.value = v;
46494647
} else if (value) {
4650-
node.value = +value.call(hierarchy, data, depth) || 0;
4648+
node.value = +value.call(hierarchy, node, depth) || 0;
46514649
}
46524650
return node;
46534651
}
@@ -4657,7 +4655,7 @@
46574655
var i = -1, n, j = depth + 1;
46584656
while (++i < n) v += revalue(children[i], j);
46594657
} else if (value) {
4660-
v = +value.call(hierarchy, d3_layout_hierarchyInline ? node : node.data, depth) || 0;
4658+
v = +value.call(hierarchy, node, depth) || 0;
46614659
}
46624660
if (value) node.value = v;
46634661
return v;
@@ -4690,11 +4688,8 @@
46904688
};
46914689
function d3_layout_hierarchyRebind(object, hierarchy) {
46924690
d3.rebind(object, hierarchy, "sort", "children", "value");
4691+
object.nodes = object;
46934692
object.links = d3_layout_hierarchyLinks;
4694-
object.nodes = function(d) {
4695-
d3_layout_hierarchyInline = true;
4696-
return (object.nodes = object)(d);
4697-
};
46984693
return object;
46994694
}
47004695
function d3_layout_hierarchyChildren(d) {
@@ -4716,7 +4711,6 @@
47164711
});
47174712
}));
47184713
}
4719-
var d3_layout_hierarchyInline = false;
47204714
d3.layout.pack = function() {
47214715
var hierarchy = d3.layout.hierarchy().sort(d3_layout_packSort), padding = 0, size = [ 1, 1 ];
47224716
function pack(d, i) {

0 commit comments

Comments
 (0)