org-roam-server icon indicating copy to clipboard operation
org-roam-server copied to clipboard

Jittery behavior of nodes in browser

Open ewag01 opened this issue 3 years ago • 11 comments

Hi: First of all, thank you so much for creating this. It's added a whole new dimension of usefulness to my org-roam files, fantastic work. I have a small issue with the visualization of the server in my browser. The bouncy animation repeats every few seconds, and the nodes kind of 'jitter' around. Any idea what could be behind this? Occurs in both Firefox and Chrome. Thank you!

ewag01 avatar Oct 11 '20 00:10 ewag01

Hi: First of all, thank you so much for creating this. It's added a whole new dimension of usefulness to my org-roam files, fantastic work.

Thank you!!

I have a small issue with the visualization of the server in my browser. The bouncy animation repeats every few seconds, and the nodes kind of 'jitter' around. Any idea what could be behind this? Occurs in both Firefox and Chrome. Thank you!

Currently the server checks for modification date on db file to update the graph. Can you check if your org-roam db file updates when the jitter happens. During development I had that jitter too but as far as I remember I fixed it before pushing it to the github but I might have pushed it, can you check your org-roam-server, it should be 20201005.1521

goktug97 avatar Oct 11 '20 10:10 goktug97

I fixed it before pushing it to the github but I might have pushed it, can you check your org-roam-server, it should be 20201005.1521

Yeah this is the version of org-roam-server I've got.

Can you check if your org-roam db file updates when the jitter happens

From what I can tell it's not updating when the jitter happens, at least there's no message in the minibuffer indicating that. Is there a better way to see if this is what's happening?

ewag01 avatar Oct 11 '20 11:10 ewag01

You can use watch -n 0.1 ls -lh org-roam.db command to run ls -lh on org-roam.db automatically and wait for jitter.

goktug97 avatar Oct 11 '20 11:10 goktug97

Thanks, followed your suggestion, but the jitter seems to be happening independently of org-roam.db updates

ewag01 avatar Oct 12 '20 03:10 ewag01

Can you check org-roam-server-db-last-modification, it should has the same value with your db file when converted to the date format. int -> date

goktug97 avatar Oct 12 '20 04:10 goktug97

So the org-roam-server-db-last-modification variable is updating every few seconds in sync with the jitter, but it doesn't look like the org-roam.db file is being modified: it updates after I make an edit, and remains unchanged after that.

ewag01 avatar Oct 13 '20 12:10 ewag01

Can you try to dig a little bit more to find out why is it changing constantly. On my side, it always stays constant if the db is not changing.

goktug97 avatar Oct 13 '20 12:10 goktug97

Yeah I'll look into that and let you know. Thanks!

ewag01 avatar Oct 13 '20 12:10 ewag01

I had the same problem here and found out the source of jittery. C-h v org-roam-db-location

Documentation:
The full path to file where the Org-roam database is stored.
If this is non-nil, the Org-roam sqlite database is saved here.

It is the user’s responsibility to set this correctly, especially
when used with multiple Org-roam instances.

I had not explicitly defined the value of this variable, so it was nil, when I informed the right path, I got all working fine.

wandersoncferreira avatar Oct 16 '20 01:10 wandersoncferreira

I had the same problem here and found out the source of jittery. C-h v org-roam-db-location

Documentation:
The full path to file where the Org-roam database is stored.
If this is non-nil, the Org-roam sqlite database is saved here.

It is the user’s responsibility to set this correctly, especially
when used with multiple Org-roam instances.

I had not explicitly defined the value of this variable, so it was nil, when I informed the right path, I got all working fine.

Yes, setting org-roam-db-directory fixes the problem. I didn't set org-roam-db-directory while developing and haven't had any issues but today I experienced the same jittering and when I check org-roam-db-directory, it was nil

Maybe instead of using org-roam-db-location

(require 'f)
(defvar org-roam-server-db-location)
(setq org-roam-server-db-location
 (concat (f-full org-roam-directory) "org-roam.db"))

can be used.

goktug97 avatar Oct 17 '20 11:10 goktug97

After "C-h v org-roam-db-location", the value is nil, I modified it as “~/Library/Mobile Documents/iCloud~com~appsonthemove~beorg/Documents/org/org-roam.db” within double qutoes, it worked well. Then it displays as follow: Its value is

""/Users/myusername/Library/Mobile Documents/iCloud~com~appsonthemove~beorg/Documents/org/org-roam.db"" Original value was nil

You can customize this variable.

zukmos avatar Oct 20 '20 02:10 zukmos