org-roam / org-roam-server

A Web Application to Visualize the Org-Roam Database
MIT License
639 stars 51 forks source link

Dashes option and general options to cite edges #149

Closed tefkah closed 3 years ago

tefkah commented 3 years ago

Solves #147 to bring the same level of edge customization to the citation edges, plus provides a simpler variable which makes the citation edges dashes to further visually distinguish them from "normal".

(setq org-roam-server-cite-edge-dashes t
      org-roam-server-extra-cite-edge-options (list (cons 'width 3))

yield what you would expect:

image

Should not break anything, as the code is exactly the same as the one for edges.

thriveth commented 3 years ago

Great idea!

goktug97 commented 3 years ago

Hello, thank you for this feature! Unfortunately, doesn't work for me. image image

tefkah commented 3 years ago

Hmmm that's very strange! I do remember getting this result as well, but I can't remember what caused it. Do you have any options set for cite edges?

goktug97 commented 3 years ago

Nope, cloned your repository and started the server.

tefkah commented 3 years ago

Ah I see what the problem is. It seems like it was a bug in vis.js. It claim to accept booleans or arrays for the "dashes" options, but does not seem to like false for some reason. I just added a rather ugly check for when org-roam-server-extra-edge-options is false, seemed to fix it.

goktug97 commented 3 years ago

It works now, thank you. Can you update the doc string to pass checkdoc.

For example;

(defcustom org-roam-server-cite-edge-dashes nil
  "When non-nil, change citation edges to dashes.
Changes edges that are created through org-roam-bibtex citations
to more easily distinguish them from other edges."
  :group 'org-roam-server
  :type 'boolean)
tefkah commented 3 years ago

Done!

goktug97 commented 3 years ago

Awesome!!