Code Monkey home page Code Monkey logo

org-roam-ui's Introduction

Org-roam GitHub Release MELPA License GPL 3

Org-roam Logo

Org-roam is a plain-text knowledge management system. It brings some of Roam's more powerful features into the Org-mode ecosystem.

Org-roam borrows principles from the Zettelkasten method, providing a solution for non-hierarchical note-taking. It should also work as a plug-and-play solution for anyone already using Org-mode for their personal wiki.

  • Private and Secure: Edit your personal wiki completely offline, entirely in your control. Encrypt your notes with GPG. Take lasting notes in plain-text.
  • Networked Thought: Connect notes and thoughts together with ease using backlinks. Discover surprising and previously unseen connections in your notes with the built-in graph visualization.
  • Extensible and Powerful: Leverage Emacs' fantastic text-editing interface, and the mature Emacs and Org-mode ecosystem of packages.
  • Free and Open Source: Org-roam is licensed under the GNU General Public License version 3 or later.

Org-roam Screenshot

Installation

Down below you will find basic installation instructions for how to quickly install org-roam using various environments for various purposes. For more detailed information, please read the manual.

Using package.el

Toggle instructions

You can install org-roam from MELPA or MELPA Stable using package.el:

M-x package-install RET org-roam RET

Using straight.el

Toggle instructions

Installation from MELPA or MELPA Stable using straight.el:

(straight-use-package 'org-roam)

Or with use-package:

(use-package org-roam
  :straight t
  ...)

If you need to install the package directly from the source repository, instead of from MELPA, the next sample shows how to do so:

(use-package org-roam
  :straight (:host github :repo "org-roam/org-roam"
             :files (:defaults "extensions/*"))
  ...)

If you plan to use your own local fork for the development and contribution, the next sample will get you there:

(use-package org-roam
  :straight (:local-repo "/path/to/org-roam-fork"
             :files (:defaults "extensions/*")
             :build (:not compile))
  ...)

Using Doom Emacs

Toggle instructions

Doom's :lang org module comes with support for org-roam, but it's not enabled by default. To activate it pass +roam2 flag to org module in your $DOOMDIR/init.el (e.g. (org +roam2)), save the file and run doom sync -u in your shell.

To provide better stability, Doom pins the package to a specific commit. If you need to unpin it (not recommended doing that, request Doom to bump the package instead) use the next in your packages.el:

(unpin! org-roam)

If for some reasons you want to use a different recipe for org-roam, you can use the next form in your packages.el to install the package from a recipe repository (e.g. MELPA):

(package! org-roam)

You can pass :pin "commit hash" to pin the package to a specific commit.

With the next sample you can install the package directly from the source repository:

(package! org-roam
  :recipe (:host github :repo "org-roam/org-roam"
           :files (:defaults "extensions/*")))

And if you plan to use your own local fork for the development or contribution, the next sample will get you there:

(package! org-roam
  :recipe (:local-repo "/path/to/org-roam-fork"
           :files (:defaults "extensions/*")
           :build (:not compile)))

Without a package manager

Toggle instructions

To install the package without using a package manager you have the next two options:

  1. Install the package by cloning it with git from the source repository.
  2. Or install the package by downloading the latest release version.

In both of the cases you will need to ensure that you have all the required dependencies. These include:

  • dash
  • f
  • s
  • org (9.4 is the minimal required version!)
  • emacsql
  • emacsql-sqlite
  • magit-section
  • filenotify-recursive

After installing the package, you will need to properly setup load-path to the package:

(add-to-list 'load-path "/path/to/org-roam/")
(add-to-list 'load-path "/path/to-org-roam/extensions/")

After which you should be able to resolve (require 'org-roam) call without any problems.

Org-roam also comes with .texi files to integrate with Emacs' built-in Info system. Read the manual to find more details for how to install them manually.

Configuration

Here's a very basic sample for configuration of org-roam using use-package:

(use-package org-roam
  :ensure t
  :custom
  (org-roam-directory (file-truename "/path/to/org-files/"))
  :bind (("C-c n l" . org-roam-buffer-toggle)
         ("C-c n f" . org-roam-node-find)
         ("C-c n g" . org-roam-graph)
         ("C-c n i" . org-roam-node-insert)
         ("C-c n c" . org-roam-capture)
         ;; Dailies
         ("C-c n j" . org-roam-dailies-capture-today))
  :config
  ;; If you're using a vertical completion framework, you might want a more informative completion interface
  (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag)))
  (org-roam-db-autosync-mode)
  ;; If using org-roam-protocol
  (require 'org-roam-protocol))

Note that the file-truename function is only necessary when you use symbolic link to org-roam-directory. Org-roam won't automatically resolve symbolic link to the directory.

Getting Started

David Wilson of System Crafters has produced an introductory video that covers the basic commands:

Getting Started with Org Roam - Build a Second Brain in Emacs

Getting Help

Before creating a new topic/issue, please be mindful of our time and ensure that it has not already been addressed on GitHub or on Discourse.

  • If you are new to Emacs and have problem setting up Org-roam, please ask your question on Slack, channel #how-do-i.
  • For quick questions, please ask them on Slack, channel #troubleshooting.
  • If something is not working as it should, or if you would like to suggest a new feature, please create a new issue.
  • If you have questions about your workflow with the slip-box method, please find a relevant topic on Discourse, or create a new one.

Knowledge Bases using Org-roam

Contributing

To report bugs and suggest new feature use the issue tracker. If you have some code which you would like to be merged, then open a pull request. Please also see CONTRIBUTING.md.

License

Copyright © Jethro Kuan and contributors. Distributed under the GNU General Public License, Version 3.

org-roam-ui's People

Contributors

aloisjanicek avatar blester125 avatar bram85 avatar cdlm avatar danhuynhdev avatar egh avatar github-actions[bot] avatar gvelasq avatar hellseher avatar jwijenbergh avatar kirillrogovoy avatar nobiot avatar p4v4n avatar rasendubi avatar shaunsingh avatar tefkah avatar temporal avatar thedarktrumpet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

org-roam-ui's Issues

Allow excluding dailies from graph

**Have you checked whether this feature is not already on the project board?

Yes

Describe the solution you'd like
I'd like a toggle to filter dailies out of the graph. Typically, nodes being linked by dailies doesn't represent a meaningful connection, so these links are usually undesirable.

Describe alternatives you've considered
I've considered tagging dailies with daily and filtering that, but this seems like some unnecessary duplication. It'd be cleaner to determine whether a note is a daily depending on the location of the file (i.e. is the file inside the org-roam-dailies-directory?).

Literature note labels show up wrong

In my graph, literature nodes created with org-roam-bibtex are labeled with placeholders for author or title in front of the note title, as shown on this screenshot.

image

I also notice that it incorrectly corrects all-uppercase words to lowercase (the title of the note is "C III] Emission in Star-forming Galaxies Near and Far").

Org-roam-ui seems frozen

First kudos to the devs for making possible this new package.

Today I installed it, and once I entered to http://127.0.0.1:35901/ I observed a frozen ball of nodes without any connections,

image

If I click or try to drag any of the nodes, they simply disappear

image

I can help to debug this problem if you give some instructions.

Best

Error in readme instructions

The instructions recommend to add org-roam-ui-mode to the org-roam-mode hook. However, this causes errors when using the org-roam buffer. It will call org-roam-ui-mode every time you switch to the org-roam-buffer, echoing an error and causing the contents of the org-roam buffer to be erased.

I think the hook should be changed to after-init-hook instead.

Abbreviation and year of cites/refs not correctly rendered

When I add a cite:-link using helm-bibtex, they are rendered with %^{author-abbrev} %^{year} title, where only the title contains the actual text that it should be. I can confirm that the bibtex entry has the abbrev and date correctly set. A screenshot to illustrate this:

image

I'm wondering if this is a bug someone else can reproduce, or an error in my configuration?

doom/use-package: Org-roam-ui-mode isn't launching with org-roam

Hi, according to the use-package config for org-roam-ui, it should automatically launch it when org-roam is launched as well

(use-package! websocket
    :after org-roam)

(use-package! org-roam-ui
    :hook (org-roam . org-roam-ui-mode))

However, I need to manually run org-roam-ui-mode every time I startup org-roam. Is this the expected behavior? I also asked Henrik (creator of doom-emacs) and he mentioned it should automatically open it, and that its an org-roam-ui issue

Doom installation isn't working with `(package!)`

Hi, I'm getting the following error with doom

Installing plugins
  x There was an unexpected error
    Message: Wrong type argument
    Data: (wrong-type-argument . sequencep)
    Backtrace:
      (replace-regexp-in-string "^.+/" "" org-roam/org-roam-ui)
      (if host (replace-regexp-in-string "^.+/" "" repo) (let ((regexp "^.*/\\(.
      (let* ((--cl-rest-- recipe) (repo (car (cdr (plist-member --cl-rest-- ':re
      (straight-vc-git-local-repo-name (:host github :repo org-roam/org-roam-ui
      (apply straight-vc-git-local-repo-name (:host github :repo org-roam/org-ro
      (let ((func (intern (format "straight-vc-%S-%S" type method)))) (if (fboun
      (straight-vc local-repo-name git (:host github :repo org-roam/org-roam-ui
      (let* ((--cl-rest-- recipe) (type (car (cdr (plist-member --cl-rest-- ':ty
      (straight-vc-local-repo-name (:host github :repo org-roam/org-roam-ui :fil
      (or (straight-vc-local-repo-name plist) package)
  ! Extended backtrace logged to .emacs.d/.local/doom.error.log

SQL error on initial startup

I just installed this package (using doom emacs) and upon starting org-roam-ui-mode, I get the following error:

Error (websocket): in callback `on-open': EmacSQL had an unhandled condition: "near line 11: no such table: nodes"

Won't open the index page

I have installed the package, when I enable org-roam-ui-mode, and I navigate to http://127.0.0.1:35901, it shows:

Not Found
The requested URL was not found on this server.

Where should I check?

  • tried tweaking org-roam-ui-port - same results

Display graph and text side by side

Thanks for the great work!

I'm new to Emacs, so I apologize for the newbie question.

When I start up org-roam-ui, a browser window opens. How do I make the graph appear in Emacs itself, in the same window as the file I'm editing?

Thanks!

[BUG] Emacs 26 support: eq: Symbol’s function definition is void: seq-first

Describe the bug
Installed org-roam-ui using the manual instructions with fresh source code pulled at time of bug submission.
When running M-x: org-roam-ui-mode, I get the message:

eq: Symbol’s function definition is void: seq-first

This is due to the fact that seq-first is introduced since Emacs 27. Since org-roam is supporting Emacs 26 as well, I feel that org-roam-ui should also.

To Reproduce
Steps to reproduce the behavior:

  1. Use an Emacs 26 installation
  2. Install the org-roam-ui package using manual instructions (but this should not matter)
  3. execute org-roam-ui-mode
  4. See error

Expected behavior
The org-roam-ui server should start.

Additional context
I supplied the seq-first function in my init.el for now, and that fixes it.
It seems to be the only Emacs 27/26 compatibility problem (so far).

[BUG] Creating and linking a node at the same time breaks follow mode

Describe the bug
When you capture a new org-file, follow mode stops.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a random org-roam-node with org-roam-ui-follow-mode turned on.
  2. Do org-roam-insert-link
  3. Create a new node
  4. AAA

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

What browser were you using?
Firefox/Chrome/Webkit

Additional context
Add any other context about the problem here.

Feature Request: Link Metadata

Is Your Feature Request Related To A Problem? Please Describe.

With notes often having many branches to other notes in many different contexts, it can be difficult to relate data in a meaningful way, understand what relevance certain links may have had, or simply be lost in a glut of links.

Describe The Solution You'd Like

Some additional fields for link metadata. This could be useful if one wanted to expand the depth of a network, but filter for certain conceptual links across wider regions of the networks. In other words, this can be used to capture wider bodies of knowledge or research themes.

for example:
[[<link id>][<link title>][:tags <tag> :context <short description>]]

Describe Alternatives You've Considered

A link-note that contains all the information as a separate entity. This could be viewed as a pop-up by hovering over the link and provide additional context.

Additional Context

Links between notes are almost as important as the notes themselves. There should be some kind of additional features that reflect this.

Application error: a client-side exception has occurred (developer guidance).

Issue

In *httpd* buffer, I get:

(stop "Fri Aug 13 08:27:43 2021")
(start "Fri Aug 13 08:27:45 2021")
(request
 (date "Fri, 13 Aug 2021 03:57:46 GMT")
 (address "127.0.0.1")
 (get "/sw.js")
 (headers
  ("GET" "/sw.js" "HTTP/1.1")
  ("Host" "localhost:35901")
  ("Connection" "keep-alive")
  ("Cache-Control" "max-age=0")
  ("User-Agent" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.25 Safari/537.36")
  ("Accept" "*/*")
  ("Service-Worker" "script")
  ("Sec-Fetch-Site" "same-origin")
  ("Sec-Fetch-Mode" "same-origin")
  ("Sec-Fetch-Dest" "serviceworker")
  ("Referer" "http://localhost:35901/")
  ("Accept-Encoding" "gzip, deflate, br")
  ("Accept-Language" "en-US,en;q=0.9")
  ("If-None-Match" "\"7f5c2115c2377148\"")
  ("If-Modified-Since" "Thu, 12 Aug 2021 17:34:28 GMT")
  ("Content" "")))
(file "/home/colawithsauce/.emacs.d/.local/straight/build-28.0.50/org-roam-ui/out/sw.js" not-modified)
(request
 (date "Fri, 13 Aug 2021 03:57:46 GMT")
 (address "127.0.0.1")
 (get "/workbox-ea903bce.js")
 (headers
  ("GET" "/workbox-ea903bce.js" "HTTP/1.1")
  ("Host" "localhost:35901")
  ("Connection" "keep-alive")
  ("Cache-Control" "max-age=0")
  ("User-Agent" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.25 Safari/537.36")
  ("Accept" "*/*")
  ("Sec-Fetch-Site" "same-origin")
  ("Sec-Fetch-Mode" "no-cors")
  ("Sec-Fetch-Dest" "script")
  ("Referer" "http://localhost:35901/sw.js")
  ("Accept-Encoding" "gzip, deflate, br")
  ("Accept-Language" "en-US,en;q=0.9")
  ("If-None-Match" "\"79cad6c0758a52dd\"")
  ("If-Modified-Since" "Thu, 12 Aug 2021 17:34:28 GMT")
  ("Content" "")))
(file "/home/colawithsauce/.emacs.d/.local/straight/build-28.0.50/org-roam-ui/out/workbox-ea903bce.js" not-modified)
(request
 (date "Fri, 13 Aug 2021 03:57:46 GMT")
 (address "127.0.0.1")
 (get "/_next/static/chunks/4.2dee5d830195ddd06029.js")
 (headers
  ("GET" "/_next/static/chunks/4.2dee5d830195ddd06029.js" "HTTP/1.1")
  ("Host" "localhost:35901")
  ("Connection" "keep-alive")
  ("Pragma" "no-cache")
  ("Cache-Control" "no-cache")
  ("User-Agent" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.25 Safari/537.36")
  ("Accept" "*/*")
  ("Sec-Fetch-Site" "same-origin")
  ("Sec-Fetch-Mode" "cors")
  ("Sec-Fetch-Dest" "empty")
  ("Referer" "http://localhost:35901/sw.js")
  ("Accept-Encoding" "gzip, deflate, br")
  ("Accept-Language" "en-US,en;q=0.9")
  ("Content" "")))
(error 404 nil)
(stop "Fri Aug 13 08:30:24 2021")
(start "Fri Aug 13 08:30:26 2021")
(connection "127.0.0.1")
(request
 (date "Fri, 13 Aug 2021 04:00:29 GMT")
 (address "127.0.0.1")
 (get "/sw.js")
 (headers
  ("GET" "/sw.js" "HTTP/1.1")
  ("Host" "localhost:35901")
  ("Connection" "keep-alive")
  ("Cache-Control" "max-age=0")
  ("User-Agent" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.25 Safari/537.36")
  ("Accept" "*/*")
  ("Service-Worker" "script")
  ("Sec-Fetch-Site" "same-origin")
  ("Sec-Fetch-Mode" "same-origin")
  ("Sec-Fetch-Dest" "serviceworker")
  ("Referer" "http://localhost:35901/")
  ("Accept-Encoding" "gzip, deflate, br")
  ("Accept-Language" "en-US,en;q=0.9")
  ("If-None-Match" "\"7f5c2115c2377148\"")
  ("If-Modified-Since" "Thu, 12 Aug 2021 17:34:28 GMT")
  ("Content" "")))
(file "/home/colawithsauce/.emacs.d/.local/straight/build-28.0.50/org-roam-ui/out/sw.js" not-modified)
(request
 (date "Fri, 13 Aug 2021 04:00:29 GMT")
 (address "127.0.0.1")
 (get "/workbox-ea903bce.js")
 (headers
  ("GET" "/workbox-ea903bce.js" "HTTP/1.1")
  ("Host" "localhost:35901")
  ("Connection" "keep-alive")
  ("Cache-Control" "max-age=0")
  ("User-Agent" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.25 Safari/537.36")
  ("Accept" "*/*")
  ("Sec-Fetch-Site" "same-origin")
  ("Sec-Fetch-Mode" "no-cors")
  ("Sec-Fetch-Dest" "script")
  ("Referer" "http://localhost:35901/sw.js")
  ("Accept-Encoding" "gzip, deflate, br")
  ("Accept-Language" "en-US,en;q=0.9")
  ("If-None-Match" "\"79cad6c0758a52dd\"")
  ("If-Modified-Since" "Thu, 12 Aug 2021 17:34:28 GMT")
  ("Content" "")))
(file "/home/colawithsauce/.emacs.d/.local/straight/build-28.0.50/org-roam-ui/out/workbox-ea903bce.js" not-modified)
(request
 (date "Fri, 13 Aug 2021 04:00:29 GMT")
 (address "127.0.0.1")
 (get "/_next/static/chunks/4.2dee5d830195ddd06029.js")
 (headers
  ("GET" "/_next/static/chunks/4.2dee5d830195ddd06029.js" "HTTP/1.1")
  ("Host" "localhost:35901")
  ("Connection" "keep-alive")
  ("Pragma" "no-cache")
  ("Cache-Control" "no-cache")
  ("User-Agent" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.25 Safari/537.36")
  ("Accept" "*/*")
  ("Sec-Fetch-Site" "same-origin")
  ("Sec-Fetch-Mode" "cors")
  ("Sec-Fetch-Dest" "empty")
  ("Referer" "http://localhost:35901/sw.js")
  ("Accept-Encoding" "gzip, deflate, br")
  ("Accept-Language" "en-US,en;q=0.9")
  ("Content" "")))
(error 404 nil)

environment

  1. emacs-version: 28.0.50, doom-emacs develop branch.
  2. Distro: Archlinux
  3. DE: Gnome40

How to locate a specific node searching on titles?

I opened this issue in the org-roam-server (org-roam/org-roam-server#114) about how to locate specific nodes in the graph.

One of the workarounds was to establish a fixed random seed in the graph to always see the very same graph every time we refresh the browser.

I don't know if any of those solutions is possible. I just put it here to start a discussion.

Best.

Installation warnings

In toplevel form:
org-roam-ui.el:236:1:Warning: Unused lexical variable ‘list-nil’
org-roam-ui.el:338:1:Warning: Unused lexical argument ‘padding’
org-roam-ui.el:338:1:Warning: Unused lexical argument ‘speed’

Just bringing them to your attention so you don't forget about them.

Error on save: (void-function org-roam-ui)

Hi, thanks for the awesome package!

Whenever I'm saving an org roam file, I'm getting

Error (after-save-hook): Error running hook "org-roam-ui--on-save" because: (void-function org-roam-ui)

image

The graph itself is still updated

Application error, since pulling latest changes

I have been using org-roam-ui for the past few days and the only issue I had was this one

I've been following the issue and saw it was recently fixed so I updated to get the new changes.

Now when I run org-roam-ui-mode instead of a gorgeous graph I get white screen with the error "Application error: a client-side exception has occurred (developer guidance)."
I'm not really sure how to debug this further so let me know if there are any steps I can take to help debug the issue.
(I use doom emacs if that is relevant)
Cheers

Missing nodes cause breakage

If there's a link containing an ID that does not correspond to a node, we see an exception thrown:

node not found: uuid

which is not appropriately handled so the graph stops working.

Nodes not showing up after "Expand node"

First of all thank you for making this!

When poking around I found, that when clicking nodes once to "expand" them and to show only the network around them, they are invisible.
A "hack" around this is turning the 3D view on (and off if you only want to see 2D) – then the nodes show up.

[MINOR] Show node labels "more intelligently".

It would be nice to show node labels "more intelligently". Now we can have all labels shown or no labels shown, based on the "label appearance scale". It would be really cool, if it worked something like maps, where you see only the most important labels when zoomed out (big cities) and as you zoom in, more labels (villages, street names, ...) start appearing.
This could be done based on number of in/outcoming links, or perhaps user-specifiable node-importance function.

Originally posted by @serycjon in #6 (comment)

Custom theme not working

Hello! Sorry for all the issues

The following snippet of code is what I'm using to theme orui:

#+begin_src elisp
(setq org-roam-ui-custom-theme
      (list
        (bg . '#2E3440')
        (bg-alt . '#3B4252')
        (fg . '#D8DEE9')
        (fg-alt . '#E5E9F0')
        (red . '#BF616A')
        (orange . '#D08770')
        (yellow .'#EBCB8B')
        (green . '#A3BE8C')
        (cyan . '#88C0D0')
        (blue . '#81A1C1')
        (violet . '#B48EAD')
        (magenta . '#8FBCBB')))
#+end_src

However, that gives this error:

Error in private config: config.el, (invalid-read-syntax # 1 0)

At the 3rd line (in front of bg), any idea what I could be doing wrong?

Filter

How difficult would it be to add the ability to filter certain nodes based on a substring entered in a text field?

Moreover, what if that text field understood regexes? Like for example the user types something like: "Biology|Unread|Aerodynamics/r" - /r is to distinguish between vanilla and regex strings, and the UI shows all the nodes related to those topics?

[Documentation BUG]: straight install example code has empty hook

In README.md, there's the sample code:

(use-package org-roam-ui
  :straight
    (:host github :repo "org-roam/org-roam-ui" :branch "main" :files ("*.el" "out"))
    :after org-roam
    :hook
;;         normally we'd recommend hooking orui after org-roam, but since org-roam does not have
;;         a hookable mode anymore, you're advised to pick something yourself
;;         if you don't care about startup time, use
;;  :hook (after-init . org-roam-ui-mode)
    :config
    (setq org-roam-ui-sync-theme t
          org-roam-ui-follow t
          org-roam-ui-update-on-save t
          org-roam-ui-open-on-start t))

but this code doesn't work unless the top :hook directive is also commented out. With it in, there's an error message starting like so:

signal(error ("use-package: :hook wants a non-empty list"))

feature request: Hilight node which is opened in the emacs buffer

Hi, firs of all thank you for tis awesome package!

Would it be possible to make the node of the file opened in emacs highlighted? Maybe add an outer ring around it with a bright color.

I have a node with 30+ connections and when I open a child node is very hard to figure out which node I have opened in the graph.

[MINOR] Add the option to word-wrap the labels for long titles

Have you checked whether this feature is not already on the project board?

yes

Is your feature request related to a problem? Please describe.
If there are many nodes together, and the titles are long, the labels become unreadable.

Describe the solution you'd like

Maybe if the user could word-wrap the labels, then the collisions could be less.

Describe alternatives you've considered

Adjusting the fonts or the graph's physics, but any setting that I have tried does not solve the problem.

Additional context
Two examples

image
image

Error "Symbol's function definition is void: json-parse-string" in Emacs 27.2

Hi,

I'm using Emacs 27.2 and when double-clicking to a node, Org-roam UI failed to open the file in Emacs, and threw this error:

Error (websocket): in callback `on-message': Symbol's function definition is void: json-parse-string

I checked the library /usr/local/share/emacs/27.2/lisp/json.el.gz and couldn't find the function json-parse-string.

Could you advise where that function comes from?

Preview mode

Hi, does org-roam-ui support preview-mode when you hover a node like org-roam-server ?

citet:key and citep:key do not show up on graph

I have notices that while org-ref style citations like cite:citekey are shown well and nice in the graph as either cite- or ref-links (depending on whether there is an existin note on the cited paper or not), the same is not the case when I use citet:citekey or citep:citekey.

I have tested and org-roam-bibtex does pick up these citet: and citep: links, as they are showing up in the backlink buffers of papers that have notes, so it must be some subtlety in the database that org-roam-ui doesn't pick up on.

Define / clarify behaviors when sqlite databases are empty

Thanks for your time and help and for the excellent work on this project!

Expected

  • When running org-roam-ui-mode, when the sqlite databases are empty (this occurs when the directory specified byorg-roam-directory contains no org roam files), the UI renders without any visible frontend errors or console errors.

Actual

  • In the browser console, I see an error:
Uncaught TypeError: e.nodes is null
  • I receive this websocket data:
{"type":"graphdata","data":{"nodes":null,"links":null,"tags":null}}

I think this is something we could fix when serializing the data that we send via the websocket by ensuring that all alist entries have a non-nil value

Desired behavior

  • The UI works with an empty DB / empty directory without any kind of error to reduce friction for brand new users
  • In a perfect world, there might even be a UI notice / alert to the user that they have no notes created yet. IMO, this is outside of the scope here, but I'd be happy to work on this if anyone is interested.

Suggested change

Thanks to @kirillrogovoy for suggesting a backend change as a good path. I'm happy to contribute any change; below is my thinking from looking at the code a bit:

Ideally, we prevent this state from ever occurring via Elisp changes. When we have an empty sqlite db, this is the value of the response variable at

(websocket-send-text oru-ws (json-encode `((type . "graphdata") (data . ,response))))))
:

; response variable has this structure before we send it to the server when dbs are empty:
'((nodes) (links) (tags))
; this serializes like this:
(json-encode '((nodes) (links) (tags))
"{\"nodes\":null,\"links\":null,\"tags\":null}"

I was thinking we might be able to fix this issue by mapping over the response alist entries and sanitizing so that in the above example, we end up encoding this structure, instead of the original structure where nulls are possible:

(json-encode '((nodes . []) (links . []) (tags . [])))
"{\"nodes\":[],\"links\":[],\"tags\":[]}"

Repro steps

  1. Run the following Elisp snippet, which creates an empty directory, and then follows suggested org-roam setup and org-roam-ui setup, binding org-roam-directory to the empty directory.
(defun repro()
  ; org-roam
  (require 'org-roam)

  (let ((real-dir "~/Desktop/notes/org-roam") (empty-dir "~/Desktop/empty-dir"))
    (make-directory empty-dir t)
    (setq org-roam-directory empty-dir))
  (setq org-roam-v2-ack t)
  (org-roam-setup)

  ; org-roam-ui
  (add-to-list 'load-path "~/code/org-roam-ui")
  (load-library "org-roam-ui")
)
(repro)
  1. Run (org-roam-ui-mode) and navigate to the opened window.
  2. See a blank screen with a console error at http://localhost:35901/

Related issues or PRs

Service worker 404

Request this js file

http://localhost:35901/_next/static/chunks/4.2dee5d830195ddd06029.js

But no such file in out directory but have 4.c9fdfbcb8f8ce1720633.js

org-roam-ui-sync-theme not working as expected

org-roam-ui-sync-theme not syncing with doom-themes. When I toggle the theme in doom orui creates a new tab in my browser, which freezes my doom emacs, and still, orui theme remains unchanged.

org-roam-ui-mode crashing when "Expand Node" is changed to "Never"

Tested on Firefox 90.0.2 and Chromium 92.0.4515.107. When I expand the "Behavior" menu and switch Expand Node to "Never", the web interface crashes. It switches to a blank white screen that says "Application error: a client-side exception has occurred (developer guidance)."
Nothing is printed on the httpd buffer when this happens, and the UI can still be accessed by using an incognito window. It's not storing any cookies and refreshing the browser cache doesn't seem to help. Restarting org-roam-ui-mode and restarting emacs have no effect either. Once I change that setting in a browser, that browser can no longer access the UI unless I use a private browsing feature.
Screenshot of error message + web console output in Chromium:
image

  • The error messages don't show up until I toggle that setting to "Never".
  • It toggles to "Double click" and "Right click" without crashing.
  • Tested the "Open in Emacs" keybinding and got the same behavior. It switches to right and double clicking, but crashes when I set it to "Never"

Failed to load resource

org-roam-ui: 6f555f6
doom-emacs: develop dd55ebb67a51c73939a606159f55fffbd38bed47

.doom.d/package.el

(package! websocket)
(package! org-roam-ui
  :recipe
  (:host github
   :repo "org-roam/org-roam-ui"
   :files ("*.el" "out")))
  • Issue
Failed to load resource: the server responded with a status of 404 (Not Found)
_buildManifest.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
_ssgManifest.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
workbox-ea903bce.js:12 Uncaught (in promise) bad-precaching-response: bad-precaching-response :: [{"url":"http://localhost:35901/_next/static/chunks/4.2dee5d830195ddd06029.js","status":404}]
    at M.B (http://localhost:35901/workbox-ea903bce.js:710:15)
    at async M.U (http://localhost:35901/workbox-ea903bce.js:699:60)
    at async M.v (http://localhost:35901/workbox-ea903bce.js:392:19)

Children nodes do not correctly link to parent heading nodes.

When using the test file below, I am seeing some node are linking to nodes in other subtree, for example in the screenshot below we see that the Read Note 2 which has an olp of ("Headline" "Second Again") is being linked to the Another node with the :good: tag when it should be linked directly to the Headline node.

It seems there isn't a check for if the parent node is in the child notes olp.

Screenshot from 2021-08-16 11-37-16

Other than that, it seems to correctly handle the edges this file presents. There should probably be a test written based on this file to make sure there aren't regressions in the hierarchical inference.

:properties:
:ID:       18434726-762e-42d7-9042-3f71454248b5
:end:
#+title: test
#+startup: latexpreview inlineimages

#+begin_src elisp
(setq org-use-tag-inheritance 'nil)
#+end_src

* Headline
:properties:
:ID:       3d56e3ad-e9f1-405c-b308-306a86cac7b8
:end:
** Another :bad2:
:properties:
:ID:       a4e471b2-3dc3-4061-acde-f73bc7b73773
:end:
** Another :good:
:properties:
:ID:       7605a32c-81f8-45af-9496-702c803c16b1
:end:
*** Another :bad3:
:properties:
:ID:       72d7686f-ceed-47f6-98bb-59d5f5bfb94b
:end:
*** Real Note
:properties:
:ID:       1b242d67-5da1-4159-963b-137df2b03a5d
:end:
** Second Again
*** Read Note 2
:properties:
:ID:       28481dd7-ce04-4d8b-a264-f5933c119bf1
:end:
** Another :bad:
:properties:
:ID:       5004d23d-4c63-4930-9979-1fadd7a8ff65
:end:

Follow-mode broken

On my system, follow-mode has been broken since commit 10bc61c (i.e., the last commit where it works is e71c0af).

The graph does not show a highlighted Emacs node, and neither does it highlight and follow when navigating nodes in Emacs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.