Closed curran closed 3 years ago
Remaining work:
I just realized that if https://github.com/d3/d3-selection/pull/285 lands in addition to this, then we will not need the following:
if (update) update = update.selection();
This is because the updated .merge
implementation from https://github.com/d3/d3-selection/pull/285 will do this internally.
I just realized that if #285 lands in addition to this, then we will not need the following:
if (update) update = update.selection();
This is because the updated
.merge
implementation from #285 will do this internally.
No, you’ll still want it because otherwise selection.join could return a transition if there’s no enter selection:
return enter && update ? enter.merge(update).order() : update;
Added tests and docs. Ready for review. Thanks!
Hooray! Thank you @mbostock 🙏
Related to #257, an alternative to https://github.com/d3/d3-selection/pull/285, this change would allow
.join
to handle the case that transitions are returned byonenter
and/oronupdate
. It would support the same simplified usage documented in #257, but leave the behavior of.merge
unchanged. Just putting this out there as an alternative to consider, as it targets the main pain point, rather than introducing new behavior in.merge
to accomplish the same goal.This works because of selection.selection.