词元之母TOK.MOM - 平台充值汇率 1:1 即 1 人民币充值到账 1 美元,支持一个 Key 调用近 600+ 海内外模型,限时特价模型低至 1 折,欢迎上岸!
| 来源 | 可选 — 通过 hermes skills install official/creative/concept-diagrams 安装 |
| 路径 | optional-skills/creative/concept-diagrams |
| 版本 | 0.1.0 |
| 作者 | v1k22(原始 PR),移植至 hermes-agent |
| 许可证 | MIT |
| 平台 | linux, macos, windows |
| 标签 | diagrams, svg, visualization, education, physics, chemistry, engineering |
| 相关 skills | architecture-diagram, excalidraw, generative-widgets |
architecture-diagram 可用,优先使用)excalidraw 可用,优先使用)templates/template.html 作为包装器编写完整 HTML 页面——将 SVG 粘贴到模板中 <!-- PASTE SVG HERE --> 的位置。.html 文件(例如 ~/my-diagram.html 或 ./my-diagram.html)。skill_view(name="concept-diagrams", file_path="templates/template.html")c-* 颜色类、文本类、明暗变量、箭头标记样式)。你生成的 SVG 依赖这些类存在于宿主页面中。<g> 或形状元素上;模板 CSS 自动处理明暗两种模式。| 类名 | 50(最浅) | 100 | 200 | 400 | 600 | 800 | 900(最深) |
|---|---|---|---|---|---|---|---|
c-purple | #EEEDFE | #CECBF6 | #AFA9EC | #7F77DD | #534AB7 | #3C3489 | #26215C |
c-teal | #E1F5EE | #9FE1CB | #5DCAA5 | #1D9E75 | #0F6E56 | #085041 | #04342C |
c-coral | #FAECE7 | #F5C4B3 | #F0997B | #D85A30 | #993C1D | #712B13 | #4A1B0C |
c-pink | #FBEAF0 | #F4C0D1 | #ED93B1 | #D4537E | #993556 | #72243E | #4B1528 |
c-gray | #F1EFE8 | #D3D1C7 | #B4B2A9 | #888780 | #5F5E5A | #444441 | #2C2C2A |
c-blue | #E6F1FB | #B5D4F4 | #85B7EB | #378ADD | #185FA5 | #0C447C | #042C53 |
c-green | #EAF3DE | #C0DD97 | #97C459 | #639922 | #3B6D11 | #27500A | #173404 |
c-amber | #FAEEDA | #FAC775 | #EF9F27 | #BA7517 | #854F0B | #633806 | #412402 |
c-red | #FCEBEB | #F7C1C1 | #F09595 | #E24B4A | #A32D2D | #791F1F | #501313 |
c-gray。c-purple、c-teal、c-coral、c-pink。c-blue、c-green、c-amber、c-red 保留用于语义含义(信息、成功、警告、错误)。| 类名 | 大小 | 字重 | 用途 |
|---|---|---|---|
th | 14px | 500 | 节点标题、区域标签 |
ts | 12px | 400 | 副标题、描述、箭头标签 |
t | 14px | 400 | 通用文本 |
<text> 必须带有类名(t、ts 或 th),不得有无类名的文本。dominant-baseline="central"。text-anchor="middle"。box_width >= (字符数 × px/字符) + 48(每侧 24px 内边距)viewBox="0 0 680 H",其中 H = 内容高度 + 40px 缓冲。rx="8",内层容器使用 rx="12",外层容器使用 rx="16" 至 rx="20"。fill="none",否则 SVG 默认填充为黑色。<defs> 块:<defs>
<marker id="arrow" viewBox="0 0 10 10" refX="8" refY="5"
markerWidth="6" markerHeight="6" orient="auto-start-reverse">
<path d="M2 1L8 5L2 9" fill="none" stroke="context-stroke"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</marker>
</defs>marker-end="url(#arrow)"。箭头通过 context-stroke 继承线条颜色。.t、.ts、.th.box、.arr、.leader、.node.c-purple、.c-teal、.c-coral、.c-pink、.c-gray、.c-blue、.c-green、.c-amber、.c-red(均自动支持明暗模式)<svg width="100%" viewBox="0 0 680 {HEIGHT}" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="arrow" viewBox="0 0 10 10" refX="8" refY="5"
markerWidth="6" markerHeight="6" orient="auto-start-reverse">
<path d="M2 1L8 5L2 9" fill="none" stroke="context-stroke"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</marker>
</defs>
<!-- Diagram content here -->
</svg>{HEIGHT} 替换为实际计算高度(最后一个元素底部 + 40px)。<g class="node c-blue">
<rect x="100" y="20" width="180" height="44" rx="8" stroke-width="0.5"/>
<text class="th" x="190" y="42" text-anchor="middle" dominant-baseline="central">Service name</text>
</g><g class="node c-teal">
<rect x="100" y="20" width="200" height="56" rx="8" stroke-width="0.5"/>
<text class="th" x="200" y="38" text-anchor="middle" dominant-baseline="central">Service name</text>
<text class="ts" x="200" y="56" text-anchor="middle" dominant-baseline="central">Short description</text>
</g><line x1="200" y1="76" x2="200" y2="120" class="arr" marker-end="url(#arrow)"/><g class="c-purple">
<rect x="40" y="92" width="600" height="300" rx="16" stroke-width="0.5"/>
<text class="th" x="66" y="116">Container label</text>
<text class="ts" x="66" y="134">Subtitle info</text>
</g><path>,锥形用 <polygon>,圆柱部件用 <ellipse>/<circle>,隔间用嵌套 <rect>。参见 references/physical-shape-cookbook.md。.data-line、.power-line、.water-pipe、.road)。参见 references/infrastructure-patterns.md。references/dashboard-patterns.md。<text> 都有类名 t、ts 或 th。<text> 都有 dominant-baseline="central"。<path> 或 <line> 都有 fill="none"。box_width >= (最长标签字符数 × 8) + 48。box_width >= (最长标签字符数 × 6.5) + 48。c-*)放在 <g> 或形状元素上,不得放在 <path> 连接线上。<defs> 块存在。.html 文件,用户可直接打开。无需服务器,无需依赖,离线可用。模式:# macOS
open ./sn2-mechanism.html
# Linux
xdg-open ./sn2-mechanism.html127.0.0.1,绝不使用 0.0.0.0。在共享网络上将图表暴露在所有网络接口上存在 安全风险。127.0.0.1:<port>——仍然不得使用 0.0.0.0。说明如何停止服务器(kill %1 或 pkill -f "http.server")。examples/ 目录内置 15 个完整、经过测试的图表。在编写同类型新图表之前,先浏览这些示例以获取可用模式:| 文件 | 类型 | 演示内容 |
|---|---|---|
hospital-emergency-department-flow.md | 流程图 | 带语义颜色的优先级路由 |
feature-film-production-pipeline.md | 流程图 | 分阶段工作流、水平子流程 |
automated-password-reset-flow.md | 流程图 | 带错误分支的认证流程 |
autonomous-llm-research-agent-flow.md | 流程图 | 回环箭头、决策分支 |
place-order-uml-sequence.md | 时序图 | UML 时序图风格 |
commercial-aircraft-structure.md | 实物图 | 使用路径、多边形、椭圆绘制真实形状 |
wind-turbine-structure.md | 实物截面图 | 地下/地上分离、颜色编码 |
smartphone-layer-anatomy.md | 爆炸视图 | 左右交替标签、分层组件 |
apartment-floor-plan-conversion.md | 平面图 | 墙体、门、虚线红色标注改造方案 |
banana-journey-tree-to-smoothie.md | 叙事流程 | 蜿蜒路径、渐进状态变化 |
cpu-ooo-microarchitecture.md | 硬件流水线 | 扇出、内存层次侧边栏 |
sn2-reaction-mechanism.md | 化学图 | 分子、弯曲箭头、能量曲线 |
smart-city-infrastructure.md | 中心辐射图 | 每个系统使用语义线型 |
electricity-grid-flow.md | 多阶段流程图 | 电压层次、流向标记 |
ml-benchmark-grouped-bar-chart.md | 图表 | 分组柱状图、双轴 |
skill_view(name="concept-diagrams", file_path="examples/<filename>")| 用户说 | 图表类型 | 建议颜色 |
|---|---|---|
| "展示流水线" | 流程图 | 灰色起止点,紫色步骤,红色错误,青色部署 |
| "画数据流" | 数据流水线(从左到右) | 灰色数据源,紫色处理,青色数据汇 |
| "可视化系统" | 结构图(包含关系) | 紫色容器,青色服务,珊瑚色数据 |
| "映射端点" | API 树状图 | 紫色根节点,每个资源组一种色阶 |
| "展示服务" | 微服务拓扑 | 灰色入口,青色服务,紫色总线,珊瑚色 worker |
| "画飞机/交通工具" | 实物图 | 路径、多边形、椭圆绘制真实形状 |
| "智慧城市/IoT" | 中心辐射集成图 | 每个子系统使用语义线型 |
| "展示仪表盘" | UI 原型 | 深色屏幕,图表颜色:青色、紫色、珊瑚色告警 |
| "电网/电力" | 多阶段流程图 | 电压层次(高/中/低压线宽) |
| "风力涡轮机/涡轮机" | 实物截面图 | 基础 + 塔筒截面 + 机舱颜色编码 |
| "X 的旅程/生命周期" | 叙事流程 | 蜿蜒路径,渐进状态变化 |
| "X 的层次/爆炸图" | 爆炸分层视图 | 垂直堆叠,交替标签 |
| "CPU/流水线" | 硬件流水线 | 垂直阶段,扇出到执行端口 |
| "平面图/公寓" | 平面图 | 墙体、门,虚线红色标注改造方案 |
| "反应机制" | 化学图 | 原子、化学键、弯曲箭头、过渡态、能量曲线 |