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

[IMPROVEMENT] - Restoring position without a delay #5

Open
Yoksven opened this issue Apr 7, 2022 · 2 comments
Open

[IMPROVEMENT] - Restoring position without a delay #5

Yoksven opened this issue Apr 7, 2022 · 2 comments

Comments

@Yoksven
Copy link

Yoksven commented Apr 7, 2022

Currently position restores after a seconds of graph doing it's thing. It would be better if it would happen right away, before any graph animation could kick in. I don't know if there's any API limitation that prevents it, so if it's not possible, I understand, but otherwise, I'd like to request an improvement.

@Sanqui
Copy link
Owner

Sanqui commented Apr 7, 2022

The technical reason for the delay is the fact that Obsidian takes a while to load all nodes onto the graph, and if I restore positions too early, the nodes added later won't register their new position. Obsidian provides me with no API that would tell me whether all the nodes have loaded or not. So I wait a bit and use some heuristics to determine whether any new nodes were added in the last 600ms. I could potentially shorten this time, but I would need to test it on a vault with a lot of nodes, and/or a slow computer. Another thing I could attempt to do is to restore positions multiple times even while the graph is loading, but I suspect it might be just as jumpy...

@Yoksven
Copy link
Author

Yoksven commented Apr 7, 2022

Yeah. I suspected that something was in the way. Shortening the time for some milliseconds won't change much. I'm somewhat curious to see "the jumpy way" of loading over and over. If there isn't much of a performance penalty, it might be better, but emphasis on "might".

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

2 participants