图表生成

人工智能 社区

技能解读

当前原文的自动摘译,尚未人工审校。

何时使用

解释事物如何工作(负载路径、电路、管道、算法) 显示架构或结构(系统图、组件布局) 说明流程或流程(流程图、数据流、决策树) 建立抽象概念的直觉(注意力机制、梯度下降、递归)

SVG 设置

始终使用此模板:通过 viewBox 宽度始终为 680px。设置width="100%",使其能够响应式缩放。 H(高度)= 最底部元素的 y + 高度 + 40px 内边距。不要猜测——计算一下。安全内容区域:x=40 至 x=640,y=40 至 y=(H-40)。没有换行 div,没有 <html>、<head>、<body> 或 DOCTYPE。

版式

仅两种尺寸:标题/标签为 14 像素,字幕/描述为 12 像素。仅两种粗细:400(常规)、500(中号/粗体)。切勿使用 600 或 700。 字体:使用 font-family="system-ui, -apple-system, sans-serif" 或从主机继承。始终为框中的居中文本设置text-anchor="middle"和dominant-baseline="central"。句子总是大小写。切勿使用标题大写或全部大写。

文本宽度估计

14 像素时,每个字符约 8 像素宽。 12 像素时,每个字符约 7 像素宽。 “负载均衡器”(13 个字符)位于 14px ~ 104px -> 需要矩形 ~ 140px 宽(带填充)。始终计算:rect_width = max(title_chars x 8, subtitle_chars x 7) + 48px padding。

颜色(浅色/深色模式安全)

使用这些在两种模式下工作的语义颜色集:颜色含义,而不是顺序:不要彩虹循环。每个图表使用 2-3 种颜色。将颜色映射到类别或物理属性(暖色=热/能量,冷色=平静/冷,灰色=结构/中性)。如果您在支持 CSS 变量的系统内进行渲染,则首选: var(--color-text-primary) 用于主要文本 var(--color-text-secondary) 用于静音文本

流狐档案 运行与权限由流狐静态检查推断,不代表作者声明或实际测试结果。
领域
人工智能
作者声明的智能体
未找到明确声明;不据此推断已兼容或已测试
静态检查
88 / 100 · 启发式扫描,不代表运行安全
运行环境证据
未执行;当前没有隔离运行测试证据
作者 / 版本 / 许可证
@CopilotKit · 未声明许可证
上下文用量评级
低消耗
接入复杂程度
需简单配置
是否需要外部接口密钥
不需要
兼容的系统
macOS
运行环境要求
Node.js
检测到的文件与系统行为
  • 只读
  • 允许写入 / 修改
网络行为
仅限本地
安装命令数
无(仅作为资料)

需要注意: 未声明工具权限范围;实际权限由运行环境决定。

输出预览 svg-diagram-generation.preview
<svg width="100%" viewBox="0 0 680 260" 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>

  <!-- Step 1 -->
  <rect x="230" y="20" width="220" height="56" rx="8"
        fill="#E1F5EE" stroke="#0F6E56" stroke-width="0.5"/>
  <text x="340" y="38" text-anchor="middle" dominant-baseline="central"
        font-size="14" font-weight="500" fill="#085041">User request</text>
  <text x="340" y="56" text-anchor="middle" dominant-baseline="central"
        font-size="12" fill="#0F6E56">HTTP POST /api/data</text>

  <!-- Arrow 1->2 -->
  <line x1="340" y1="76" x2="340" y2="100" stroke="#534AB7"
        stroke-width="1.5" marker-end="url(#arrow)"/>

  <!-- Step 2 -->
  <rect x="230" y="106" width="220" height="56" rx="8"
        fill="#EEEDFE" stroke="#534AB7" stroke-width="0.5"/>
  <text x="340" y="124" text-anchor="middle" dominant-baseline="central"
        font-size="14" font-weight="500" fill="#3C3489">Server processing</text>
  <text x="340" y="142" text-anchor="middle" dominant-baseline="central"
        font-size="12" fill="#534AB7">Validate and transform</text>

  <!-- Arrow 2->3 -->
  <line x1="340" y1="162" x2="340" y2="186" stroke="#854F0B"
        stroke-width="1.5" marker-end="url(#arrow)"/>

  <!-- Step 3 -->
  <rect x="230" y="192" width="220" height="56" rx="8"
        fill="#FAEEDA" stroke="#854F0B" stroke-width="0.5"/>
  <text x="340" y="210" text-anchor="middle" dominant-baseline="central"
        font-size="14" font-weight="500" fill="#633806">Database write</text>
  <text x="340" y="228" text-anchor="middle" dominant-baseline="central"
        font-size="12" fill="#854F0B">INSERT into table</text>
</svg>

讨论

基于 GitHub Discussions。登录 GitHub 即可参与讨论、点赞、订阅更新。