How to save and load Graph View groups
Published with Share Note 🔸 Part of Obsidian guides
Getting your current groups
Put this code into a note to retrieve your current group settings:
It will show you something like this:
Youi can change any of the settings here. For our demo, we’re just going to be updating the groups, which are in the colorGroups
property.
Updating the groups
Take the code below and put it into a note. It will update all your graph groups to be the two groups specified, #this-is-the-new-query
and #another-new-query
.
If you follow the structure inside the settings.colorGroups
section, you can update the groups as you wish.
To change between different groups profiles, you just need to launch the Javascript code above. You could:
- Create a couple of different notes with the groups that you want, and just load one of the notes to change all your groups.
- Put the code in a Templater script and launch it from a hotkey.
- Or one of the many other plugins which let you run arbitrary Javascript in Obsidian.