You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling the .size() method on an enter selection throws:
Uncaught TypeError: undefined is not a function
This appears to be due to the fact that the selection.each() method is undefined for enter selections, and is used internally by the selection.size() method.
The problem can be resolved by having d3_selection_enterPrototype inherit the .each method from d3_selectionPrototype in src/selection/enter.js as is being done with the other methods available to enter selections, including the .size method.
However, I'm not sure if doing this will introduce other issues. The tests pass. Is there a specific reason that the each method should not be inherited by the enter selection prototype?
The text was updated successfully, but these errors were encountered:
Thanks for the report! Strange that selection.enter.size is not documented at the moment, but it should indeed be supported it seems from looking at the code. The code does rely erroneously on .each being present, but this has been discussed previously in #824, and I think it was decided it shouldn’t be added.
I have proposed an alternative fix using the private d3_selection_each method in #2046.
Patched a minor merge conflict in fix-format
caused by jasondavies commit 519f258.
Confirmed to pass tests including new tests in
test/format/format-test.js
Merge branch 'master' into fix-format
* master:
Fix for JSDOM update.
Add d3.zip target.
Bump version.
Save two minified bytes.
Fixd3#2043: selection.enter.size.
Update to JSDom 1.0.0
Fixd3#2040: parsing time zone offsets.
Workaround for Chrome touchmove issue 412723.
Replace substring with slice.
Fix a few imports.
Fix InvalidStateError for non-text local files.
Conflicts:
d3.js
d3.min.js
src/locale/number-format.js
Calling the
.size()
method on an enter selection throws:This appears to be due to the fact that the
selection.each()
method is undefined for enter selections, and is used internally by theselection.size()
method.The problem can be resolved by having
d3_selection_enterPrototype
inherit the.each
method fromd3_selectionPrototype
in src/selection/enter.js as is being done with the other methods available to enter selections, including the.size
method.However, I'm not sure if doing this will introduce other issues. The tests pass. Is there a specific reason that the
each
method should not be inherited by the enter selection prototype?The text was updated successfully, but these errors were encountered: