Bug: Bar-2 Tutorial Incorrectly states that operating on the Enter Selection does not affect the Update Selection #954

Closed
MihaiB opened this Issue Dec 10, 2012 · 1 comment

Comments

2 participants

MihaiB commented Dec 10, 2012

The Bar-2 Tutorial at http://mbostock.github.com/d3/tutorial/bar-2.html incorrectly states:

"Note that operations on the entering or exiting selection do not affect the updating selection. Thus, the transition defined on rect on L14 above includes only the updating bars, not any of the entering bars that are appended on L7."

The "General Update Patterns 2" Tutorial at http://bl.ocks.org/3808221 states that:
"Appending to the enter selection expands the update selection to include entering elements"
which I can confirm by fiddling with the code in the Bar 2 tutorial.

I believe the Bar 2 tutorial's explanation should be corrected and the code updated accordingly: the .transition() on .enter() is useless as long as the ".enter().insert(...)" block is before the Update transition.

Owner

mbostock commented Dec 10, 2012

Yep, that tutorial is old and predates the 2.0.0 release, where this behavior changed.

@mbostock mbostock closed this Jan 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment