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
Updating scale domain does not remove old tick marks #10
Comments
Gist pulled out from a larger app which reproduces the issue |
Seems like the key for data binding is a possible culprit. If I use the identity function it updates correctly.
|
The values being used for the tick data were already being send through the scale function. Fixes issue d3#10
The data being used for the ticks was already being sent through the scale function. Fixes issue d3#10
I think the problem lies in how the exit selection is being computed. In this case the key function is returning the same key for all of the old ticks because you’ve enabled rounding. The old ticks values are [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1], and the new scale maps them all to the same values: [450, 450, 450, 450, 450, 450, 450, 450, 450, 450, 450]. So, this is probably a bug in d3-selection, where if there are multiple elements with the same key, the later ones are should be put into the exit selection and not ignored. |
Fixed in d3-selection 0.7.3. I will push a new alpha build of D3 4.0 shortly. |
This fix is now included in alpha 41. |
First time using an axis results in correct ticks, but upon modifying the underlying scale, selecting the same axis, and calling it again, what happens is new ticks are created, but the old ones are not removed.
EX:
The text was updated successfully, but these errors were encountered: