AgentSkillsCN

Json Canvas

Json Canvas

中文原作
SKILL.md

json-canvas — JSON Canvas 參考

Obsidian Canvas (.canvas 檔案) 的完整參考。Canvas 是視覺化的筆記連結圖。

檔案格式

.canvas 檔案使用 JSON 格式。

基本結構

json
{
  "nodes": [],
  "edges": []
}

節點類型

文字節點

json
{
  "id": "unique-id",
  "type": "text",
  "x": 0, "y": 0,
  "width": 250, "height": 120,
  "text": "Markdown 內容"
}

檔案節點

json
{
  "id": "unique-id",
  "type": "file",
  "x": 300, "y": 0,
  "width": 250, "height": 120,
  "file": "20_專案/專案名稱.md"
}

連結節點

json
{
  "id": "unique-id",
  "type": "link",
  "x": 600, "y": 0,
  "width": 250, "height": 120,
  "url": "https://example.com"
}

群組節點

json
{
  "id": "unique-id",
  "type": "group",
  "x": -50, "y": -50,
  "width": 600, "height": 300,
  "label": "群組名稱"
}

邊(連線)

json
{
  "id": "edge-id",
  "fromNode": "node-1",
  "toNode": "node-2",
  "fromSide": "right",
  "toSide": "left",
  "label": "關係描述"
}

邊的端點: top, bottom, left, right

顏色

預設顏色: "0" 無色, "1" 紅, "2" 橙, "3" 黃, "4" 綠, "5" 青, "6"

也可用十六進位: "#FF0000"