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

selecting transitioning objects #80

Closed
SumNeuron opened this issue May 22, 2018 · 1 comment
Closed

selecting transitioning objects #80

SumNeuron opened this issue May 22, 2018 · 1 comment

Comments

@SumNeuron
Copy link

As I have used d3 more and more, I have written my own collection of functions built on top of d3 and even modularized them, where is when I have come across this issues.

The issue is as follows.

I have a selection (of objects that I am fairly confident have already been added to the DOM), to which I apply a transition (it could even be for 0ms). Some other function - after the transition is invoked - would like to add something to this selection.

However, when I try to select these objects, they do not exist.

I am now aware of the transition end option; however, this does not really solve my problem.

Is there a way to select objects that have a transition and edit the transitioning selection?

Alternatively, is there a way to try and select something and then ask when the selection ends? (after the transition has been invoked?)

I have found that transitions can be quite problematic, when data changes mid transition.

Please see the comments here
https://stackoverflow.com/questions/50400352/svg-html-getbbox-and-getboundingclientrect-not-the-same-as-when-hover-over-no/50401806?noredirect=1#comment87884972_50401806

@mbostock
Copy link
Member

You can reselect and modify a transition by passing it into selection.transition. For example:

https://beta.observablehq.com/d/e0ede4a95638d022

You can listen to the end of a transition using transition.on. See also #77.

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

2 participants