Graph Node Colors

approvedunreviewed

by shousi18

Select multiple notes and give their graph nodes the same color.

★ 1 starsUpdated todayMIT

Graph Node Colors

在 Obsidian 里搜索并勾选多篇笔记,为它们创建一个共享颜色的原生图谱颜色组。搜索可以随时切换,已经勾选的笔记会留在「已选」列表。

Graph Node Colors lets you search for multiple notes and assign them one color in Obsidian’s global or local graph. The picker uses a Simplified Chinese interface.

安装

  1. 确认使用 Obsidian 桌面版 1.13.7 或更新版本,并启用「关系图谱」核心插件。
  2. 在 Vault 配置目录的 plugins 下创建 graph-node-colors 文件夹。默认的完整位置是 <Vault>/.obsidian/plugins/graph-node-colors/。
  3. 将 main.js、manifest.json 和 styles.css 复制到该文件夹,重启 Obsidian,然后在「设置 → 第三方插件」中启用「Graph Node Colors」。

给两篇笔记设置同一个颜色

  1. 打开命令面板,运行「全局图谱批量着色」。
  2. 搜索 项目计划,勾选示例笔记 项目/项目计划.md。
  3. 搜索 会议纪要,勾选示例笔记 项目/会议纪要.md。
  4. 使用默认蓝色 #3b82f6,点击「应用颜色」。在全局关系图谱里查看结果。

如果你在使用局部图谱,先选中该图谱窗格,再运行「当前局部图谱批量着色」。局部颜色组随该窗格的设置保存,节点是否可见仍取决于图谱的连接深度和筛选条件。

配置可在对应关系图谱的「设置 → 颜色组」里修改、排序或删除。插件会把新建或重新设置的颜色组放到最上方,因为 Obsidian 使用从上往下第一个匹配的颜色组。颜色组按笔记的完整路径匹配,移动或重命名笔记后可在图谱设置里更新查询,或重新选择笔记并删除旧组。

插件使用 Obsidian 原生图谱的内部接口,版本升级后可能需要适配。全局颜色组写入 Vault 的原生图谱配置,停用插件后仍可使用。

插件在本地运行。它会读取当前 Vault 的笔记名称和路径,并更新对应图谱的颜色组配置。

开发

源码可直接加载,无需构建。运行 node --check main.js 检查 JavaScript 语法。

许可证

MIT

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.