Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easier removal on exit transition. #27

Closed
mbostock opened this issue Nov 8, 2010 · 1 comment
Closed

Easier removal on exit transition. #27

mbostock opened this issue Nov 8, 2010 · 1 comment

Comments

@mbostock
Copy link
Member

mbostock commented Nov 8, 2010

Currently, it's a bit of a pain to remove elements after an exit transition:

selection.exit()
  .transition()
    …
    .each("end", function() { d3.select(this).remove(); });

I could see this being easier if either the this context was a singleton selection, in which case you could say:

.each("end", function() { this.remove(); })

Or, if there were a unified transition end event, in which case you might say:

.on("end", function() { this.remove(); })

where this refers to selection, rather than a singleton selection. I suppose if we had unified transition events, that trigger individually for staggered transitions (variable delay or duration) or collectively for non-staggered transitions (uniform delay and duration), then we could use the later on("end", …) in either case, which seems nice.

@mbostock
Copy link
Member Author

mbostock commented Dec 9, 2010

Transition supports remove, now. So fixed.

murtada58 pushed a commit to murtada58/d3 that referenced this issue Mar 16, 2022
murtada58 pushed a commit to murtada58/d3 that referenced this issue Mar 16, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant