Hi, there! I want to ask how the color of the nodes in the graph view is determined? I see some nodes in the graph view are colored, I’m not familiar with clojure, from the source code it seems to be related to the node’s hash and parent. Want to ask for a more detailed explanation about this? And is it possible to manually control the colors?
Would be interesed in this as well!
I would be interested in how nodes are colored too. Manually controlling the colors of nodes is what I need for my use case!
Has anyone figured this out? I also want to know.
hi!
I do also look for being able to custom Graph nodes colorus.
My idea is that the files don’t exist yet on the graph nodes are different colors. and as more notes get in time the size of that node increases, and as I see these nodes “develop” and maybe need review or MOC creation.
I think i found the corresponding file, but one would need to formulate ‘human’ readable documentation out of the information https://github.com/logseq/logseq/blob/master/src/main/frontend/extensions/graph/pixi.cljs
hey Logseq developers!
Can you support us, please?
We (community) do see need of controlling nodes colors manualy.
My case is following:
- I used to create ongoing links very often, this act for me more as keyword. When I do use particular outoing keyword offen I would like to make that node bid and red - this would give me sign, thath hey! you have important keyword you need to update that empty page as this seems to be important for you.
Based on the code, it seems that the colour depends entirely on the current parent of the node. However, unless I’m mistaken, this seems to be only relevant strictly from a developer’s point of view and, as such, colours don’t present any valuable information to the user (aside from the current node which is white)
:color (fn [node]
(if-let [parent (gobj/get node "parent")]
(when-let [parent (if (= parent "ls-selected-nodes")
parent
(.-id node))]
(let [v (js/Math.abs (hash parent))]
(nth colors (mod v (count colors)))))
(.-color node)))