equal
deleted
inserted
replaced
|
1 d3_selectionPrototype.select = function(selector) { |
|
2 var subgroups = [], |
|
3 subgroup, |
|
4 subnode, |
|
5 group, |
|
6 node; |
|
7 |
|
8 if (typeof selector !== "function") selector = d3_selection_selector(selector); |
|
9 |
|
10 for (var j = -1, m = this.length; ++j < m;) { |
|
11 subgroups.push(subgroup = []); |
|
12 subgroup.parentNode = (group = this[j]).parentNode; |
|
13 for (var i = -1, n = group.length; ++i < n;) { |
|
14 if (node = group[i]) { |
|
15 subgroup.push(subnode = selector.call(node, node.__data__, i)); |
|
16 if (subnode && "__data__" in node) subnode.__data__ = node.__data__; |
|
17 } else { |
|
18 subgroup.push(null); |
|
19 } |
|
20 } |
|
21 } |
|
22 |
|
23 return d3_selection(subgroups); |
|
24 }; |
|
25 |
|
26 function d3_selection_selector(selector) { |
|
27 return function() { |
|
28 return d3_select(selector, this); |
|
29 }; |
|
30 } |