move .exit before .enter to fix removal of bubbles on redraw #1466
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I am having the same issue with the bubble chart as was fixed with the scatter chart in this pr: https://github.com/dc-js/dc.js/pull/1463/files. Basically when I would call
redraw()
on a bubble chart and pass in a new group it would update the existing bubbles, but if any were removed from the group... they would not be removed.This pr moves the removeNodes before the update and it resolves the issue.
I did notice it doesn't seem to be an issue here: https://dc-js.github.io/dc.js/, but I tried 1000 different ways in my code base and each time the bubbles would not be removed until I reordered the .exit and .enter. My only guess is that I'm calling .redraw() on a chart and in the demo that's somehow happening internally? Not really sure.
Related issue (scatter plots) #1460