Customize Graph node appearance via YAML frontmatter

Now that Obsidian supports a YAML frontmatter, I thought it would be cool if we could use it to customize the appearance of the note’s appearance in Graph View.

For instance, imagine I have a MOC note for currently on going projects. I would like to have this note to stand out in the Graph View, for instance, by having this note’s node colored red in the Graph View. I could write something on the frontmatter like:

---
node_color: #FF0000
---

And Obsidian will fill this node with a bright red. Similarly, we could have a graph_hidden: true to hide the node from Graph View. You get the idea.

8 Likes

I had the same idea as thek3nger, using YAML frontmatter to condition appearances in the graph view. The above post was written a while ago and no one has replied, is there good reason for this approach to be discounted, or is it addressed elsewhere?

In addition, I thought you could also apply special conditions to the forces and display settings that certain nodes exerted. For example something like:

node_repelforce: 0.75 global setting
node_size: 2 x global setting

2 Likes

Yeah, this feature would also be a game-changer for me!

Interesting idea. What if there was a way to wrap these YAML parameters into something kind of like a CSS class? Like if we could define any note that has #fooHashtag also obeys our appearance customizations in the graph view.

For example, what if the UI in Graph had an extra dropdown menu under Filters, Display, and Forces called something like Groups.

Then within Groups there would be an add Group button. Each custom group would have a customizable “filter” like Has Tag:. And if it matches that filter then the group would add whatever customizable appearance changes you made like node_color: #FF0000 You could even add multiple appearance changes to the same group. Then any note that matches that filter query (e.g. any note that has #fooHashtag) now would automatically get all of those appearance changes within the graph.