手绘风格 Excalidraw JSON 图表(架构图、流程图、序列图)。
通过编写标准 Excalidraw 元素 JSON 并保存为 .excalidraw 文件来创建图表。这些文件可以拖放到 excalidraw.com 进行查看和编辑。
write_file 创建 .excalidraw 文件
{
"type": "excalidraw",
"version": 2,
"elements": [ ...你的元素数组... ],
"appState": { "viewBackgroundColor": "#ffffff" }
}
{ "type": "rectangle", "id": "r1", "x": 100, "y": 100, "width": 200, "height": 100 }
{ "type": "rectangle", "id": "r1", "x": 100, "y": 100, "width": 200, "height": 80,
"boundElements": [{ "id": "t_r1", "type": "text" }] },
{ "type": "text", "id": "t_r1", "x": 105, "y": 110, "text": "Hello",
"containerId": "r1", "fontSize": 20, "fontFamily": 1 }
{ "type": "arrow", "id": "a1", "x": 300, "y": 150, "width": 200, "height": 0,
"points": [[0,0],[200,0]], "endArrowhead": "arrow" }
{
"type": "arrow", "id": "a1",
"startBinding": { "elementId": "r1", "fixedPoint": [1, 0.5] },
"endBinding": { "elementId": "r2", "fixedPoint": [0, 0.5] }
}
| 用途 | 填充颜色 | 十六进制 |
|---|---|---|
| 主要/输入 | 浅蓝 | #a5d8ff |
| 成功/输出 | 浅绿 | #b2f2bb |
| 警告/外部 | 浅橙 | #ffd8a8 |
| 处理/特殊 | 浅紫 | #d0bfff |
| 错误/关键 | 浅红 | #ffc9c9 |
fontSize:16 用于正文fontSize:20 用于标题
评论区