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

Simple zoom-in with interpolateZoom gives negative duration #101

Open
jjhembd opened this issue Mar 4, 2022 · 0 comments
Open

Simple zoom-in with interpolateZoom gives negative duration #101

jjhembd opened this issue Mar 4, 2022 · 0 comments

Comments

@jjhembd
Copy link

jjhembd commented Mar 4, 2022

If the starting and ending views are centered on the same point, but the ending width is smaller, the .duration property of the returned interpolator is negative. See https://observablehq.com/d/fa1442202b6a7936

Comparing to van Wijk and Nuij, the current code is missing the absolute value on the path length S.

image

Skipping the absolute value does simplify the interpolator (no need to track the k factor). I think it would be enough to take the absolute value when computing the duration.

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