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

Ordinal axis may generate invalid transforms when interrupting transitions. #24

Closed
Paulskit opened this issue Jan 24, 2017 · 4 comments
Closed

Comments

@Paulskit
Copy link

Paulskit commented Jan 24, 2017

If calling axis in transition while another axis transition is in place, there are errors in console:
Error: attribute transform: Expected number, "translate(NaN,0)".

Here is the example (click Different data button and see console errors output):
http://plnkr.co/edit/6dFgUrzAk3PMpaCTVhkq?p=preview

@mbostock
Copy link
Member

Per Reporting an Issue, please use bl.ocks.org, RunKit or a pull request to post your test case. The use of sites such as Plnkr interfere with debugging, and make it impossible for me to investigate without first migrating your example to another site. Which I have done, and also substantially reduced your test case:

https://bl.ocks.org/mbostock/d23a97cb8ac3674f87a26724e526a0ed

It appears that when the second axis transition starts, and the first axis transition is still running, that the second transition sees exiting ticks from the first transition. The position of the first transition’s exiting ticks is undefined in both the new scale and the old scale for the second transition. (Their position was only defined in the old scale of the first transition.)

@mbostock mbostock changed the title Console errors during transition Ordinal axis may generate invalid transforms when interrupting transitions. Jan 24, 2017
@Paulskit
Copy link
Author

Sorry for plnkr, I didn't found the link to Reporting an Issue doc.
You are correct about cause of this issue. Another thing is that __axis values is being written just before transition starts. So when second transition starts and first is not yet finished, it sees old ticks and updated __axis with new scale values instead of old ones.
I was able to fix this setting __axis to new scale only after transition end. Please see my pull request.

@kamiua
Copy link

kamiua commented Feb 28, 2017

Is it possible to have new patch version of this lib published in npm?

@mbostock
Copy link
Member

Yes. Doing that now. Sorry for the delay.

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

3 participants