词元之母TOK.MOM - 平台充值汇率 1:1 即 1 人民币充值到账 1 美元,支持一个 Key 调用近 600+ 海内外模型,限时特价模型低至 1 折,欢迎上岸!
| 来源 | 内置(默认安装) |
| 路径 | skills/creative/excalidraw |
| 版本 | 1.0.0 |
| 作者 | Hermes Agent |
| 许可证 | MIT |
| 平台 | linux, macos, windows |
| 标签 | Excalidraw, Diagrams, Flowcharts, Architecture, Visualization, JSON |
.excalidraw 文件来创建图表。这些文件可以直接拖放到 excalidraw.com 进行查看和编辑。无需账号、无需 API 密钥、无需渲染库——只需 JSON。.excalidraw 文件,用于架构图、流程图、时序图、概念图等。文件可在 excalidraw.com 打开,或上传以获取可分享链接。write_file 创建 .excalidraw 文件terminal 运行 scripts/upload.py 获取可分享链接.excalidraw 信封中,并使用 write_file 保存:{
"type": "excalidraw",
"version": 2,
"source": "hermes-agent",
"elements": [ ...your elements array here... ],
"appState": {
"viewBackgroundColor": "#ffffff"
}
}~/diagrams/my_diagram.excalidraw。scripts/ 目录中的上传脚本:cryptography pip 包(pip install cryptography)。type、id(唯一字符串)、x、y、width、heightstrokeColor: "#1e1e1e"backgroundColor: "transparent"fillStyle: "solid"strokeWidth: 2roughness: 1(手绘风格)opacity: 100{ "type": "rectangle", "id": "r1", "x": 100, "y": 100, "width": 200, "height": 100 }roundness: { "type": 3 } 表示圆角backgroundColor: "#a5d8ff", fillStyle: "solid" 表示填充色{ "type": "ellipse", "id": "e1", "x": 100, "y": 100, "width": 150, "height": 150 }{ "type": "diamond", "id": "d1", "x": 100, "y": 100, "width": 150, "height": 150 }警告: 不要在形状上使用 "label": { "text": "..." }。这不是有效的 Excalidraw 属性,会被静默忽略,导致形状显示为空白。必须使用下方的容器绑定方式。
boundElements 中列出文本,文本需要通过 containerId 反向指向形状:{ "type": "rectangle", "id": "r1", "x": 100, "y": 100, "width": 200, "height": 80,
"roundness": { "type": 3 }, "backgroundColor": "#a5d8ff", "fillStyle": "solid",
"boundElements": [{ "id": "t_r1", "type": "text" }] },
{ "type": "text", "id": "t_r1", "x": 105, "y": 110, "width": 190, "height": 25,
"text": "Hello", "fontSize": 20, "fontFamily": 1, "strokeColor": "#1e1e1e",
"textAlign": "center", "verticalAlign": "middle",
"containerId": "r1", "originalText": "Hello", "autoResize": true }containerId 后,Excalidraw 会自动将文本居中x/y/width/height 为近似值——Excalidraw 加载时会重新计算originalText 应与 text 保持一致fontFamily: 1(Virgil 手绘字体){ "type": "arrow", "id": "a1", "x": 300, "y": 150, "width": 200, "height": 0,
"points": [[0,0],[200,0]], "endArrowhead": "arrow",
"boundElements": [{ "id": "t_a1", "type": "text" }] },
{ "type": "text", "id": "t_a1", "x": 370, "y": 130, "width": 60, "height": 20,
"text": "connects", "fontSize": 16, "fontFamily": 1, "strokeColor": "#1e1e1e",
"textAlign": "center", "verticalAlign": "middle",
"containerId": "a1", "originalText": "connects", "autoResize": true }{ "type": "text", "id": "t1", "x": 150, "y": 138, "text": "Hello", "fontSize": 20,
"fontFamily": 1, "strokeColor": "#1e1e1e", "originalText": "Hello", "autoResize": true }x 为左边缘。若要在位置 cx 处居中:x = cx - (text.length * fontSize * 0.5) / 2textAlign 或 width 来定位{ "type": "arrow", "id": "a1", "x": 300, "y": 150, "width": 200, "height": 0,
"points": [[0,0],[200,0]], "endArrowhead": "arrow" }points:相对于元素 x、y 的 [dx, dy] 偏移量endArrowhead:null | "arrow" | "bar" | "dot" | "triangle"strokeStyle:"solid"(默认)| "dashed" | "dotted"{
"type": "arrow", "id": "a1", "x": 300, "y": 150, "width": 150, "height": 0,
"points": [[0,0],[150,0]], "endArrowhead": "arrow",
"startBinding": { "elementId": "r1", "fixedPoint": [1, 0.5] },
"endBinding": { "elementId": "r2", "fixedPoint": [0, 0.5] }
}fixedPoint 坐标:top=[0.5,0]、bottom=[0.5,1]、left=[0,0.5]、right=[1,0.5]fontSize:16fontSize:20fontSize:14(谨慎使用)fontSizereferences/colors.md。快速参考:| 用途 | 填充色 | 十六进制 |
|---|---|---|
| 主要 / 输入 | 浅蓝色 | #a5d8ff |
| 成功 / 输出 | 浅绿色 | #b2f2bb |
| 警告 / 外部 | 浅橙色 | #ffd8a8 |
| 处理 / 特殊 | 浅紫色 | #d0bfff |
| 错误 / 关键 | 浅红色 | #ffc9c9 |
| 备注 / 决策 | 浅黄色 | #fff3bf |
| 存储 / 数据 | 浅青色 | #c3fae8 |
#757575references/dark-mode.mdreferences/examples.md