Permalink
Browse files

Fix a NodeList bug in transition.selectAll.

  • Loading branch information...
1 parent caefcaa commit cd3d236015cc2206186b359227f54c4fc761a648 @mbostock mbostock committed Sep 29, 2011
Showing with 15 additions and 11 deletions.
  1. +6 −4 d3.js
  2. +2 −2 d3.min.js
  3. +1 −1 package.json
  4. +1 −1 src/core/core.js
  5. +5 −3 src/core/transition-selectAll.js
View
10 d3.js
@@ -10,7 +10,7 @@ try {
d3_style_setProperty.call(this, name, value + "", priority);
};
}
-d3 = {version: "2.3.0"}; // semver
+d3 = {version: "2.3.1"}; // semver
var d3_array = d3_arraySlice; // conversion for NodeLists
function d3_arrayCopy(pseudoarray) {
@@ -1899,16 +1899,18 @@ d3_transitionPrototype.select = function(selector) {
d3_transitionPrototype.selectAll = function(selector) {
var subgroups = [],
subgroup,
+ subnodes,
node;
if (typeof selector !== "function") selector = d3_selection_selectorAll(selector);
for (var j = -1, m = this.length; ++j < m;) {
for (var group = this[j], i = -1, n = group.length; ++i < n;) {
if (node = group[i]) {
- subgroups.push(subgroup = selector.call(node.node, node.node.__data__, i));
- for (var k = -1, o = subgroup.length; ++k < o;) {
- subgroup[k] = {node: subgroup[k], delay: node.delay, duration: node.duration};
+ subnodes = selector.call(node.node, node.node.__data__, i);
+ subgroups.push(subgroup = []);
+ for (var k = -1, o = subnodes.length; ++k < o;) {
+ subgroup.push({node: subnodes[k], delay: node.delay, duration: node.duration});
}
}
}
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,6 +1,6 @@
{
"name": "d3",
- "version": "2.3.0",
+ "version": "2.3.1",
"description": "A small, free JavaScript library for manipulating documents based on data.",
"keywords": [
"dom",
View
@@ -1 +1 @@
-d3 = {version: "2.3.0"}; // semver
+d3 = {version: "2.3.1"}; // semver
@@ -1,16 +1,18 @@
d3_transitionPrototype.selectAll = function(selector) {
var subgroups = [],
subgroup,
+ subnodes,
node;
if (typeof selector !== "function") selector = d3_selection_selectorAll(selector);
for (var j = -1, m = this.length; ++j < m;) {
for (var group = this[j], i = -1, n = group.length; ++i < n;) {
if (node = group[i]) {
- subgroups.push(subgroup = selector.call(node.node, node.node.__data__, i));
- for (var k = -1, o = subgroup.length; ++k < o;) {
- subgroup[k] = {node: subgroup[k], delay: node.delay, duration: node.duration};
+ subnodes = selector.call(node.node, node.node.__data__, i);
+ subgroups.push(subgroup = []);
+ for (var k = -1, o = subnodes.length; ++k < o;) {
+ subgroup.push({node: subnodes[k], delay: node.delay, duration: node.duration});
}
}
}

0 comments on commit cd3d236

Please sign in to comment.