-
Notifications
You must be signed in to change notification settings - Fork 67
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
Improve timeout handling #104
base: master
Are you sure you want to change the base?
Conversation
This allows the layout to be stopped in a more timely manner on large networks.
If not animated (requestAnimationFrame), the loop can never be interrupted by the maxSimulationTime timeout. Solve this by running the layout in a timeout as well.
This issue has been automatically marked as stale, because it has not had activity within the past 30 days. It will be closed if no further activity occurs within the next 30 days. If a feature request is important to you, please consider making a pull request. Thank you for your contributions. |
This is a pull request 🤷 |
Using setTimeout will slow down the performance of the layout when it's non-animated. It would be better to monitor the time in the regular loop. It would also be a smaller change. |
The problem I'm trying to solve, is that with larger graphs (~1000 nodes) the timeout does not kick in at all when not animated. So instead of using a timeout at all you mean to keep checking the elapsed time in the loop and then exit once it exceeded the limit? |
Yes, that’s rightOn Dec 3, 2024, at 08:51, Marco Pfatschbacher ***@***.***> wrote:
The problem I'm trying to solve, is that with larger graphs (~1000 nodes) the timeout does not kick in at all when not animated.
I think this is because the single main thread is blocked until completion.
So instead of using a timeout at all you mean to keep checking the elapsed time in the loop and then exit once it exceeded the limit?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Register timeout before starting the algorithm
This allows the layout to be stopped in a more timely manner
on large networks.
Obey maxSimulationTime when not animated
If not animated (requestAnimationFrame),
the loop can never be interrupted by the maxSimulationTime timeout.
Solve this by running the layout in a timeout as well.