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

[feature request] Is that possible to use a consistent color to highlight the selected node in the Buffer Network?

Open randomwangran opened this issue 3 years ago • 3 comments

Sorry for bother. Thanks for writing this package.

For example, the user shall define a purple color (#DED1EE) to every node s/he clicks.

I notice that every time the user clicks a node, the Buffer Network will update the network and the colors. If the Buffer Network has many nodes, the user could lose his thoughts.

This feature would help users to quickly find his/her previous thoughts.

randomwangran avatar Sep 14 '20 01:09 randomwangran

Sorry for bother. I will enhence my programming skills someday later myself to see if I can do a PR.

randomwangran avatar Sep 29 '20 14:09 randomwangran

If anyone is looking for a workaround, you can add this to your configuration .

Note that it will only work if you have the org-roam backlinks buffer open (i.e. run M-x org-roam).

(setq org-roam-server-extra-node-options
        (lambda (node)
          (let ((current-node-p (string= (car node) (buffer-file-name org-roam-buffer--current))))
            (when current-node-p
            ;; additional attributes for the current node.
            ;; this must be a list suitable for `json-encode'.
            ;; see https://github.com/visjs/vis-network/tree/master/examples/network/nodeStyles
            ;;   for additional information on available options
            (list (cons 'shape "box") 
                  (cons 'color (list (cons 'background "purple") 
                                     (cons 'border "white"))))))))

aizensoosuke avatar Mar 18 '21 21:03 aizensoosuke

If anyone is looking for a workaround, you can add this to your configuration .

Note that it will only work if you have the org-roam backlinks buffer open (i.e. run M-x org-roam).

(setq org-roam-server-extra-node-options
        (lambda (node)
          (let ((current-node-p (string= (car node) (buffer-file-name org-roam-buffer--current))))
            (when current-node-p
            ;; additional attributes for the current node.
            ;; this must be a list suitable for `json-encode'.
            ;; see https://github.com/visjs/vis-network/tree/master/examples/network/nodeStyles
            ;;   for additional information on available options
            (list (cons 'shape "box") 
                  (cons 'color (list (cons 'background "purple") 
                                     (cons 'border "white"))))))))

You can try using org-roam-server-current-buffer instead of (buffer-file-name org-roam-buffer--current)

goktug97 avatar Mar 18 '21 22:03 goktug97