Use tags for coloring in graph view

Hi there!

I’m trying to have mt graph view in obsidian colored by tag. For some reason all mt tags are green? I’m trying to get all files with the ‘wiskunde’ (math) tag red. It however does not work.

I’ve been trying to do it using CSS, or other tag options but nothing seems to work…
Does anyone have an idea ?
I really dont want to color only based on file location…

Please see the image for the visual representation of my problem…

I’ve been looking trough the css settings but nothing seems to fit…

Thank you n advance…

If you have this toggled on:

the #tags themselves will show up in the Graph in their default green. This color can be changed with CSS, but it’s for all tags.


I thought maybe the nested wiskunde/Matrix tag was causing an issue, but it seems working on my end with a Group using only tag:#wiskunde.

Can you try making a few more groups of your other tags, tag:#zettle, tag:#statica, etc., to see if they are working?

You can also check the Tags tab to see if they are showing up there:

Screenshot 2024-12-07 at 11.13.30

If they aren’t showing up here, there may be something strange about your YAML/Properties and Obsidian isn’t registering them as tags.

Hey there!

Thank you for there repy!

Here you go! Unfortunately nothing works :frowning:

Are you sure you don’t have an order of coloring issue? What happens if you remove the coloring of the path which currently are at the top? Will your tagged notes then get color?

If that works, re-add the path coloring at the bottom.

1 Like

You can click-hold-drag on the color circles to reorder the groups as well.

1 Like

I can reorder and the color changes. But i want to have the colors from the tags changed… that way one can more easily navigate the graph using tags.

As I mentioned above, you can change the color of the #tags themselves that show in the Graph (with a CSS snippet or two), but it’s for all tags. You can’t individually color specific #tags.

For both light and dark color schemes:

body {
    --graph-node-tag: hotpink; /* default: var(--color-green); */
}

Separate light and dark color schemes:

.theme-light {
    --graph-node-tag: hotpink;
}

.theme-dark {
    --graph-node-tag: #0000FF;
}

Obsidian_qvzlgVFoP0

Hi there!

Thanx for the reply! Sorry I did not consider that only being able to change the color of all the tags to be a solution… I would for example want to be able to search for a tab and then see all the items connected to it, being either tags or pages.

Does anyone maybe have a solution for this? Maybe there’s some functionality I’m overseeing?

Kind regards.

The trick, if I understand you correctly, is to setup the graph view like you want to, and reserve the first line for the tag you want to search for.

That way it’ll always be colored the colour you want, and that color you can choose to be whatever you want it to be.