Skip to content

org-roam-graph

Org-roam provides basic graphing capabilities to explore interconnections between notes, in org-roam-graph. This is done by performing SQL queries and generating images using Graphviz. The graph can also be navigated: see org-roam-protocol.

The entry point to graph creation is org-roam-graph.

Function: org-roam-graph & optional arg node

Build and display a graph for NODE. ARG may be any of the following values:

  • nil show the full graph.
  • integer an integer argument N will show the graph for the connected components to node up to N steps away.

User Option: org-roam-graph-executable

Path to the graphing executable (in this case, Graphviz). Set this if Org-roam is unable to find the Graphviz executable on your system.

You may also choose to use neato in place of dot, which generates a more compact graph layout.

User Option: org-roam-graph-viewer

Org-roam defaults to using Firefox (located on PATH) to view the SVG, but you may choose to set it to:

  1. A string, which is a path to the program used
  2. a function accepting a single argument: the graph file path.

nil uses view-file to view the graph.

If you are using WSL2 and would like to open the graph in Windows, you can use the second option to set the browser and network file path:

emacs-lisp
(setq org-roam-graph-viewer
    (lambda (file)
      (let ((org-roam-graph-viewer "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"))
        (org-roam-graph--open (concat "file://///wsl$/Ubuntu" file)))))