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

Some of the animations are really long #7

Open
kingfisher13 opened this issue Dec 14, 2015 · 3 comments
Open

Some of the animations are really long #7

kingfisher13 opened this issue Dec 14, 2015 · 3 comments

Comments

@kingfisher13
Copy link

Could be perhaps speed up the animation for distances over a certain length?

@kingfisher13
Copy link
Author

There is a maxDuration option (set at 5 seconds), but some of the animations are not respecting this. See May 30th, 1760, #4 for an example (it takes 8.3 seconds).

@kingfisher13
Copy link
Author

Looking deeper, each frame (using example from above) is calculated to take 2.8 ms and there are 1741 of them, resulting in an estimated 4.9 seconds (rounding accounts for the 0.1 diff from 5 second max). However, each frame is actually taking (according to console.time) anywhere from 4.5-5.5 ms resulting in an actual time of 8.3 seconds for the animation.

The AnimatedMarker.js (ditto AnimatedLine.js) code looks fine to me, so I'm not sure where the delay is coming from. @awoodruff I'd appreciate some help when you have time.

awoodruff added a commit that referenced this issue Apr 12, 2016
@awoodruff
Copy link
Member

The above commit is an improvement, though it looks it may have sped up the long ones just a bit too much. The idea is to increase the distance option (which controls the number of interpolated coordinates in a line) on an animated line if the total distance divided by distance is greater than some maximum number of animation frames. I chose 20ms as the fastest allowable framerate, hence this._maxFrames = Math.round(options.maxDuration / 20);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants