diff --git a/org-roam-graph.el b/org-roam-graph.el index 581333b..1da29f3 100644 --- a/org-roam-graph.el +++ b/org-roam-graph.el @@ -192,7 +192,7 @@ into a digraph." ",")))) (dolist (node nodes) (let* ((file (xml-escape-string (car node))) - (title (or (caadr node) + (title (or (cadr node) (org-roam--path-to-slug file))) (shortened-title (pcase org-roam-graph-shorten-titles (`truncate (s-truncate org-roam-graph-max-title-length title)) @@ -232,8 +232,9 @@ CALLBACK is passed the graph file as its sole argument." "Please adjust `org-roam-graph-executable'") org-roam-graph-executable)) (let* ((node-query (or node-query - `[:select [file titles] :from titles - ,@(org-roam-graph--expand-matcher 'file t)])) + `[:select [file title] :from titles + ,@(org-roam-graph--expand-matcher 'file t) + :group :by file])) (graph (org-roam-graph--dot node-query)) (temp-dot (make-temp-file "graph." nil ".dot" graph)) (temp-graph (make-temp-file "graph." nil ".svg"))) @@ -269,7 +270,7 @@ CALLBACK is passed to `org-roam-graph--build'." (org-roam-db--links-with-max-distance file max-distance) (org-roam-db--connected-component file)) (list file))) - (query `[:select [file titles] + (query `[:select [file title] :from titles :where (in file [,@files])])) (org-roam-graph--build query callback)))