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

Ability to change graph layout algorithm #141

Open
spacekitteh opened this issue Mar 25, 2021 · 3 comments
Open

Ability to change graph layout algorithm #141

spacekitteh opened this issue Mar 25, 2021 · 3 comments

Comments

@spacekitteh
Copy link

The default settings aren't always appropriate. The ability to change the parameters of the visualisation should be included.

@tefkah
Copy link
Collaborator

tefkah commented Apr 27, 2021

What kind of things do you want to change? You can change most of the parameters with org-roam-server-network-vis-options, althought it's a bit of a pain in the ass to manually write out the "escaped" json.

Here are some of my options as a reference

(setq org-roam-server-network-vis-options "{
  \"physics\": {
    \"enabled\": true, 
    \"barnesHut\":{
      \"gravitationalConstant\" : -6000, \"avoidOverlap\" : 0.5, \"springLength\" : 200
    }, 
    \"stabilization\": {
      \"enabled\": true, \"iterations\": 30
    }
  }, 
  \"edges\": {
     \"physics\": true, \"hidden\": false, \"smooth\": {
       \"enabled\": false, \"type\": \"continuous\"
        }
      }
  }"
)

@tefkah
Copy link
Collaborator

tefkah commented Apr 27, 2021

You can find the options you can specify here

I've been experimenting a bit with creating easier ways of doing via (setq)s, but that turned out to be kind of annoying to do, I might give it a go again soon.

@goktug97
Copy link
Member

You can find the options you can specify here

I've been experimenting a bit with creating easier ways of doing via (setq)s, but that turned out to be kind of annoying to do, I might give it a go again soon.

Hi,

You can use json-encode
For example (json-encode (list (cons 'physics (list (cons 'enabled json-false))))). It might be much easier than writing a json string by hand.

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

3 participants