mirror of
https://github.com/logseq/logseq.git
synced 2026-04-29 00:24:51 +00:00
feat: added property exclude-in-graph
- Like this thread https://discuss.logseq.com/t/option-to-ignore-certain-nodes-in-the-graph/1312, I added the ability to exclude a page in graph by adding the property exclude-in-graph:: true - added property exclude-in-graph - added settings paramenter :excluded-pages - added "Excluded pages" toggle in in graph filters
This commit is contained in:
@@ -81,7 +81,7 @@
|
||||
:links links}))
|
||||
|
||||
(defn build-global-graph
|
||||
[theme {:keys [journal? orphan-pages? builtin-pages?]}]
|
||||
[theme {:keys [journal? orphan-pages? builtin-pages? excluded-pages?]}]
|
||||
(let [dark? (= "dark" theme)
|
||||
current-page (or (:block/name (db/get-current-page)) "")]
|
||||
(when-let [repo (state/get-current-repo)]
|
||||
@@ -95,12 +95,17 @@
|
||||
pages-after-journal-filter (if-not journal?
|
||||
(remove :block/journal? full-pages)
|
||||
full-pages)
|
||||
|
||||
pages-after-exclude-filter (cond->> pages-after-journal-filter
|
||||
(not excluded-pages?)
|
||||
(remove (fn [p] (= true (:exclude-in-graph (:block/properties p))))))
|
||||
|
||||
links (concat (seq relation)
|
||||
(seq tagged-pages)
|
||||
(seq namespaces))
|
||||
linked (set (flatten links))
|
||||
build-in-pages (set (map string/lower-case default-db/built-in-pages-names))
|
||||
nodes (cond->> (map :block/name pages-after-journal-filter)
|
||||
nodes (cond->> (map :block/name pages-after-exclude-filter)
|
||||
(not builtin-pages?)
|
||||
(remove (fn [p] (contains? build-in-pages (string/lower-case p))))
|
||||
(not orphan-pages?)
|
||||
|
||||
Reference in New Issue
Block a user