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

Force directed layout slower on 60hz displays #16

Closed
mdegans opened this issue Jun 15, 2024 · 1 comment
Closed

Force directed layout slower on 60hz displays #16

mdegans opened this issue Jun 15, 2024 · 1 comment

Comments

@mdegans
Copy link
Owner

mdegans commented Jun 15, 2024

This is caused because the time step is currently a constant and every frame is a simulation tick. Fixing this will require keeping track of the actual frame rate, or perhaps the average over several frames. Then we use that as a time step. The simulation should then be consistent regardless of screen.

We could also somehow get the display refresh rate and use that, but it wouldn't be guaranteed to match the actual frame rate so there might be jank, which is bad. If the application can't render at the native frame rate, if it drops frames, this should not affect the simulation.

mdegans added a commit that referenced this issue Jun 15, 2024
Fix Force directed layout slower on 60hz displays #16

The time step of the force-directed layout is now based on the current frame rate.

Dragging a window between a 60hz display and a 120hz display now works propertly. This should even account for frame dropping.

The time step is smoothed with each new step being averaged with the last acounting for frame pacing issues and jitter.

Additionally, a speed slider has been added to the UI to control a multiplier to the time step.
mdegans added a commit that referenced this issue Jun 15, 2024
Fix Force directed layout slower on 60hz displays #16

The time step of the force-directed layout is now based on the current frame rate.

Dragging a window between a 60hz display and a 120hz display now works propertly. This should even account for frame dropping.

The time step is smoothed with each new step being averaged with the last acounting for frame pacing issues and jitter.

Additionally, a speed slider has been added to the UI to control a multiplier to the time step.
@mdegans
Copy link
Owner Author

mdegans commented Aug 28, 2024

Fixed with version 0.0.3

@mdegans mdegans closed this as completed Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant