How to make org-roam-ui work for more than one org-roam dir

I use two org-roam dirs by setting “.dir-locals.el” in one dir, and then I have two org-roam db files. It works fine with creating notes, refering nodes, etc.

I tried to M-x org-roam-ui-mode in the dir with .dir-locals.el, the whole gragh is empty. There is no problem for my major dir, i.e. with org-roam-directory set in my emacs config.el.

As the title suggests, is it possible to make org-roam-ui work for more than one org-roam dir?

Or, if org-roam-ui could have a configurable filter when calling, I am ok to combe both dir as subdirs in org-roam-directory , and use subdir names as filter for graph display.

Dont use org-roam-ui, but pertinent questions may be: how are two directories being set? Does this way update all relevant location variables?

Try doing (org-roam-db-sync) before opening the graph.

(org-roam-db-sync) won’t affect because I have no problem to perform find node in my local roam dir.

For the two dirs setting, I metioned in my first post, i.e. one dir is defined by my config.el with

(setq org-roam-directory dir1)
(setq org-roam-db-location (expand-file-name "org-roam1.db" org-roam-directory))

and the other dir is defined in .dir-locals.el in that dir with:

((nil . ((org-roam-directory . full-path-dir2)
         (org-roam-db-location . full-path-dir2-org-roam2.db))))