xml-diagram
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseXML 图形生成器(drawio 格式)
XML Graphic Generator (drawio Format)
核心工作流
Core Workflow
用户描述 → 解析需求 → 设计图形 → 生成 drawio XML → 验证输出 → 保存文件详细流程如下:
- 接收用户描述
- 用户可能会描述需要的图类型(流程图、卡片、图表等)、布局(横向、纵向、网格等)、内容(文字、emoji)和风格(简约,专业、可爱等)。
- 解析用户输入,提取关键信息以指导后续的图形设计和生成。
- 解析用户需求
- 思考需要绘制的图类型、结构、元素、布局和配色,如果不清楚的情况,请用户确认。
- 评估元素数量,合理分组,避免单个图形承载过多内容
- 根据分析结果,设计图的布局和元素
- 确定图的整体结构和层次关系
- 设计每个元素的样式(颜色、形状、大小等)
- 确定元素之间的连接方式(线条、箭头等)
- 生成 drawio XML 代码
- 使用 drawio 的 mxGraph XML 格式构建图形
- 应用 CSS 样式内嵌到 SVG 中
- 根据风格选择应用滤镜和阴影效果
- 针对生成的图进行验证,确保其符合用户需求和预期的视觉效果
- 背景模式确认:
- 确认用户选择的背景模式(浅色/深色)
- 未明确时默认使用浅色背景
- 深色模式下文字和边框使用浅色系
- 基础结构验证(避免元素重叠和布局错乱):
- 检查图的结构和元素是否正确
- 确保所有节点坐标计算准确,无重叠
- 验证连接线起点/终点精确指向节点边缘
- 检查文字与图形边界间距 ≥8px,避免文字溢出
- 布局规约验证(避免空白过多和拥挤):
- 画布尺寸紧凑合理,利用率 60%-80% 为宜
- 节点间距合理,无过大或过小
- 分支路径清晰,无路径交叉
- 折线转折点不与节点重叠
- 显示完整性保障(避免显示不完整):
- 计算画布尺寸:
画布高度 = 标题高度 + 内容总高度 + 节点间距 × (节点数-1) + 图例说明区高度(如有) + 边距 - 确保所有节点、文字、连线、箭头都在画布范围内
- 各边保留 ≥30-40px 边距,避免内容被裁剪
- 计算画布尺寸:
- 箭头与连接验证(避免箭头混乱):
- 检查箭头样式统一
- 验证箭头指向准确,无偏移或错位
- 检查折线路径节点顺序正确,无交叉混乱
- 验证虚线仅用于异步流程,错误分支使用实线
- 稳健性设计检查:
- 避免使用嵌套坐标,所有坐标使用明确数值
- 确保菱形判断节点中心坐标准确,分支从底部中心出发
- 验证汇聚点位置在分支节点正下方,避免路径交叉
- 图例应置于图形底部,避免与主流程重叠,预留专用图例区域
- 样式与颜色验证:
- 确保颜色和样式符合选择的风格
- 验证 drawio XML 代码的正确性和兼容性
- 检查图的布局和元素之间的连接是否合理、线条是否清晰准确、图形是否清晰可读、颜色是否符合预期、排版是否整齐
- 检查图中箭头是否清晰、连接是否正常、大小是否合适
- 检查图片是否能够完整显示,是否有元素被截取
- 复杂流程图验证:
- 分支流程使用不同颜色区分(错误分支用红色,主线用灰色/蓝色)
- 条件判断节点使用菱形形状
- 异步流程使用虚线连接(仅用于异步场景)
- 汇聚点明确标注
- 可选区域用虚线框表示
- 背景模式确认:
- 输出最终的 drawio XML 文件,供用户使用和修改
- 将 drawio XML 保存到指定路径,文件名以 结尾
.drawio - 提供 drawio XML 代码字符串供用户复制使用
- 将 drawio XML 保存到指定路径,文件名以
核心原则:生成的 drawio 图形要简洁美观,符合现代设计规范,与 svg-generator 风格保持一致。
User Description → Parse Requirements → Design Graphics → Generate drawio XML → Validate Output → Save FileDetailed process as follows:
- Receive User Description
- Users may describe the required graph type (flowchart, card, chart, etc.), layout (horizontal, vertical, grid, etc.), content (text, emoji), and style (minimalist, professional, cute, etc.).
- Parse user input and extract key information to guide subsequent graphic design and generation.
- Parse User Requirements
- Determine the graph type, structure, elements, layout, and color scheme needed. If unclear, ask the user for confirmation.
- Evaluate the number of elements, group them reasonably, and avoid overloading a single graphic with too much content.
- Design Graphic Layout and Elements Based on Analysis Results
- Define the overall structure and hierarchical relationships of the graph
- Design the style of each element (color, shape, size, etc.)
- Determine the connection method between elements (lines, arrows, etc.)
- Generate drawio XML Code
- Build graphics using drawio's mxGraph XML format
- Embed CSS styles into SVG
- Apply filters and shadow effects according to the selected style
- Validate the Generated Graph to Ensure It Meets User Requirements and Expected Visual Effects
- Background Mode Confirmation:
- Confirm the background mode selected by the user (light/dark)
- Use light background by default if not specified
- Use light-colored text and borders in dark mode
- Basic Structure Validation (Avoid element overlap and layout distortion):
- Check if the graph structure and elements are correct
- Ensure all node coordinates are calculated accurately with no overlap
- Verify that connection line start/end points precisely point to node edges
- Check that the spacing between text and graphic borders is ≥8px to avoid text overflow
- Layout Specification Validation (Avoid excessive blank space and overcrowding):
- Canvas size should be compact and reasonable, with utilization rate ideally 60%-80%
- Node spacing should be reasonable, neither too large nor too small
- Branch paths should be clear with no path crossings
- Polyline turning points should not overlap with nodes
- Display Integrity Assurance (Avoid incomplete display):
- Calculate canvas size:
Canvas Height = Title Height + Total Content Height + Node Spacing × (Number of Nodes - 1) + Legend Area Height (if any) + Margins - Ensure all nodes, text, connections, and arrows are within the canvas range
- Reserve ≥30-40px margins on all sides to avoid content cropping
- Calculate canvas size:
- Arrow and Connection Validation (Avoid arrow chaos):
- Ensure consistent arrow styles
- Verify accurate arrow pointing with no offset or misalignment
- Check that polyline path node order is correct with no crossing chaos
- Verify that dashed lines are only used for asynchronous processes, and error branches use solid lines
- Robustness Design Check:
- Avoid nested coordinates; use explicit numerical values for all coordinates
- Ensure accurate center coordinates for diamond decision nodes, with branches starting from the bottom center
- Verify that convergence points are directly below branch nodes to avoid path crossings
- Legends should be placed at the bottom of the graphic, avoiding overlap with the main process, with a dedicated legend area reserved
- Style and Color Validation:
- Ensure colors and styles comply with the selected style
- Verify the correctness and compatibility of drawio XML code
- Check if the graph layout and element connections are reasonable, lines are clear and accurate, graphics are legible, colors meet expectations, and typesetting is neat
- Check if arrows in the graph are clear, connections are normal, and sizes are appropriate
- Check if the image can be displayed completely without elements being cropped
- Complex Flowchart Validation:
- Use different colors to distinguish branch processes (red for error branches, gray/blue for main lines)
- Use diamond shapes for conditional decision nodes
- Use dashed connections for asynchronous processes (only for asynchronous scenarios)
- Clearly mark convergence points
- Use dashed boxes to indicate optional areas
- Background Mode Confirmation:
- Output the Final drawio XML File for User Use and Modification
- Save the drawio XML to the specified path, with the filename ending in
.drawio - Provide the drawio XML code string for users to copy and use
- Save the drawio XML to the specified path, with the filename ending in
Core Principle: The generated drawio graphics should be concise and aesthetically pleasing, comply with modern design specifications, and maintain consistent style with svg-generator.
视觉风格规范
Visual Style Specifications
背景模式
Background Mode
重要:生成图形时必须明确用户需要的背景模式,未明确时默认使用浅色背景
Important: Must confirm the background mode required by the user when generating graphics; use light background by default if not specified
1. 浅色背景模式(默认)
1. Light Background Mode (Default)
适用于:浅色主题文档、PPT、网页等
参考示例:浅色流程图、浅色架构图
| 用途 | 颜色代码 |
|---|---|
| 背景色 | |
| 卡片背景 | |
| 标题文字 | |
| 正文文字 | |
| 边框色 | |
| 箭头颜色 | |
Applicable to: Light-themed documents, PPTs, web pages, etc.
Reference Examples: Light flowchart, light architecture diagram
| Purpose | Color Code |
|---|---|
| Background Color | |
| Card Background | |
| Title Text | |
| Body Text | |
| Border Color | |
| Arrow Color | |
2. 深色背景模式
2. Dark Background Mode
适用于:深色主题文档、演示文稿、代码编辑器主题等
参考示例:深色流程图、深色时间线
| 用途 | 颜色代码 |
|---|---|
| 背景色 | |
| 卡片背景 | |
| 标题文字 | |
| 正文文字 | |
| 边框色 | |
| 箭头颜色 | |
深色模式配色速查:
| 用途 | 颜色代码 |
|---|---|
| 主色(蓝) | |
| 成功(绿) | |
| 警告(橙) | |
| 错误(红) | |
| 紫色 | |
| 青色 | |
| 黄色 | |
| 青色2 | |
深色背景下的特殊处理:
- 文字使用浅色系确保对比度
- 节点边框适当加粗(2-3px)以增强可见性
- 建议使用圆角卡片提升视觉层次
Applicable to: Dark-themed documents, presentations, code editor themes, etc.
Reference Examples: Dark flowchart, dark timeline
| Purpose | Color Code |
|---|---|
| Background Color | |
| Card Background | |
| Title Text | |
| Body Text | |
| Border Color | |
| Arrow Color | |
Dark Mode Color Quick Reference:
| Purpose | Color Code |
|---|---|
| Primary Color (Blue) | |
| Success (Green) | |
| Warning (Orange) | |
| Error (Red) | |
| Purple | |
| Cyan | |
| Yellow | |
| Cyan 2 | |
Special Handling for Dark Background:
- Use light-colored text to ensure contrast
- Appropriately thicken node borders (2-3px) to enhance visibility
- Recommended to use rounded-corner cards to improve visual hierarchy
配色方案
Color Scheme
| 用途 | 颜色代码 |
|---|---|
| 主色(蓝色) | |
| 辅助色(绿色) | |
| 强调色(橙色) | |
| 警示色(红色) | |
| 背景色 | |
| 文字色 | |
| 边框色 | |
| 箭头颜色 | |
| Purpose | Color Code |
|---|---|
| Primary Color (Blue) | |
| Secondary Color (Green) | |
| Accent Color (Orange) | |
| Warning Color (Red) | |
| Background Color | |
| Text Color | |
| Border Color | |
| Arrow Color | |
图形规范
Graphic Specifications
| 项目 | 浅色模式默认值 | 深色模式默认值 |
|---|---|---|
| 画布尺寸 | 800×600 | 800×600 |
| 圆角半径 | 8px(卡片) | 8px(卡片) |
| 阴影 | 柔和阴影 | 无阴影或淡阴影 |
| 边框宽度 | 2px | 2-3px |
| 字体 | PingFang SC, Microsoft YaHei, sans-serif | PingFang SC, Microsoft YaHei, sans-serif |
| 线条粗细 | 2px | 2px |
| Item | Light Mode Default Value | Dark Mode Default Value |
|---|---|---|
| Canvas Size | 800×600 | 800×600 |
| Radius of Corners | 8px (Cards) | 8px (Cards) |
| Shadow | Soft Shadow | No Shadow or Light Shadow |
| Border Width | 2px | 2-3px |
| Font | PingFang SC, Microsoft YaHei, sans-serif | PingFang SC, Microsoft YaHei, sans-serif |
| Line Thickness | 2px | 2px |
布局规范(重要)
Layout Specifications (Important)
1. 形状拼接规范(避免圆弧不协调)
1. Shape Splicing Specification (Avoid不协调圆弧)
问题说明:当一个形状内部包含另一个形状(如带标题栏的卡片)时,如果分别设置圆角会导致边界不协调。
正确做法 - 使用单层结构:
xml
<!-- 推荐:使用单一圆角矩形,标题通过不同颜色或位置区分 -->
<mxCell id="node1" value="节点名称" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#3498db;strokeWidth=2;fontColor=#333333;fontSize=14;fontStyle=1;shadow=1;" vertex="1" parent="1">
<mxGeometry x="100" y="100" width="140" height="60" as="geometry" />
</mxCell>简化设计原则:
- 避免使用双层形状叠加(一个带圆角的矩形+一个矩形标题栏)
- 如需区分标题区域,使用颜色填充而非叠加形状
- 标题文字使用粗体或不同颜色区分,不单独创建标题块
- drawio 中直接使用 让文字加粗,或使用不同
fontStyle=1区分标题fontColor
Problem Description: When one shape contains another shape (such as a card with a title bar), setting rounded corners separately will lead to inconsistent borders.
Correct Approach - Use Single-Layer Structure:
xml
<!-- Recommended: Use a single rounded rectangle, distinguish title by different color or position -->
<mxCell id="node1" value="Node Name" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#3498db;strokeWidth=2;fontColor=#333333;fontSize=14;fontStyle=1;shadow=1;" vertex="1" parent="1">
<mxGeometry x="100" y="100" width="140" height="60" as="geometry" />
</mxCell>Simplified Design Principle:
- Avoid using double-layer shape overlay (a rounded rectangle + a rectangular title bar)
- If you need to distinguish the title area, use color filling instead of overlaying shapes
- Distinguish title text by using bold or different colors, do not create a separate title block
- Directly use in drawio to bold text, or use different
fontStyle=1to distinguish titlesfontColor
2. 线条布局规范(避免混乱与重叠)
2. Line Layout Specification (Avoid Chaos and Overlap)
节点间距规则:
- 横向节点间距:≥ 40px
- 纵向节点间距:≥ 30px
- 分支节点间距:分支点前垂直距离 ≥ 50px
连接线规范:
- 连接线端点距节点边界:≥ 5px
- 折线转折点:使用整数坐标
- 避免三条以上路径经过同一坐标点
- 优先使用直线,其次折线,谨慎使用曲线
- 使用 确保折线正交
edgeStyle=orthogonalEdgeStyle
分支路径规则:
- 双分支左右偏转角度:30-45°
- 分支展开角度合理,避免交叉
- 汇聚点位于所有分支节点的公共下方
防重叠检查:
- 连接线不穿过其他节点
- 文字与图形边界间距 ≥ 8px
- 图例与主流程保持 ≥ 30px 间距
Node Spacing Rules:
- Horizontal node spacing: ≥ 40px
- Vertical node spacing: ≥ 30px
- Branch node spacing: Vertical distance before branch point ≥ 50px
Connection Line Specifications:
- Distance between connection line endpoints and node borders: ≥ 5px
- Polyline turning points: Use integer coordinates
- Avoid three or more paths passing through the same coordinate point
- Prioritize straight lines, followed by polylines, and use curves cautiously
- Use to ensure polyline orthogonality
edgeStyle=orthogonalEdgeStyle
Branch Path Rules:
- Deflection angle for double branches: 30-45°
- Reasonable branch expansion angle to avoid crossings
- Convergence points are located directly below all branch nodes
Anti-Overlap Check:
- Connection lines do not pass through other nodes
- Spacing between text and graphic borders ≥ 8px
- Maintain ≥ 30px spacing between legend and main process
drawio XML 格式规范
drawio XML Format Specifications
基础结构
Basic Structure
xml
<mxfile host="app.diagrams.net">
<diagram name="页面-1">
<mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="800" pageHeight="600" math="0" shadow="1">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<!-- 图形元素 -->
</root>
</mxGraphModel>
</diagram>
</mxfile>xml
<mxfile host="app.diagrams.net">
<diagram name="Page-1">
<mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="800" pageHeight="600" math="0" shadow="1">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<!-- Graphic Elements -->
</root>
</mxGraphModel>
</diagram>
</mxfile>常用元素格式
Common Element Formats
1. 浅色模式圆角矩形卡片
1. Light Mode Rounded Rectangle Card
xml
<mxCell id="node1" value="节点名称" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#3498db;strokeWidth=2;fontColor=#333333;fontSize=14;fontStyle=1;shadow=1;" vertex="1" parent="1">
<mxGeometry x="100" y="100" width="140" height="60" as="geometry" />
</mxCell>xml
<mxCell id="node1" value="Node Name" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#3498db;strokeWidth=2;fontColor=#333333;fontSize=14;fontStyle=1;shadow=1;" vertex="1" parent="1">
<mxGeometry x="100" y="100" width="140" height="60" as="geometry" />
</mxCell>2. 深色模式圆角矩形卡片
2. Dark Mode Rounded Rectangle Card
xml
<mxCell id="node1" value="节点名称" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#16213e;strokeColor=#3498db;strokeWidth=2;fontColor=#aaaaaa;fontSize=14;fontStyle=1;" vertex="1" parent="1">
<mxGeometry x="100" y="100" width="140" height="60" as="geometry" />
</mxCell>xml
<mxCell id="node1" value="Node Name" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#16213e;strokeColor=#3498db;strokeWidth=2;fontColor=#aaaaaa;fontSize=14;fontStyle=1;" vertex="1" parent="1">
<mxGeometry x="100" y="100" width="140" height="60" as="geometry" />
</mxCell>3. 菱形判断节点
3. Diamond Decision Node
xml
<mxCell id="node2" value="判断?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e67e22;strokeWidth=2;fontColor=#333333;fontSize=12;" vertex="1" parent="1">
<mxGeometry x="200" y="200" width="80" height="80" as="geometry" />
</mxCell>xml
<mxCell id="node2" value="Decision?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e67e22;strokeWidth=2;fontColor=#333333;fontSize=12;" vertex="1" parent="1">
<mxGeometry x="200" y="200" width="80" height="80" as="geometry" />
</mxCell>4. 圆形节点
4. Circular Node
xml
<mxCell id="node3" value="开始" style="ellipse;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#3498db;strokeWidth=2;fontColor=#333333;fontSize=12;" vertex="1" parent="1">
<mxGeometry x="100" y="100" width="60" height="60" as="geometry" />
</mxCell>xml
<mxCell id="node3" value="Start" style="ellipse;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#3498db;strokeWidth=2;fontColor=#333333;fontSize=12;" vertex="1" parent="1">
<mxGeometry x="100" y="100" width="60" height="60" as="geometry" />
</mxCell>5. 箭头连接线
5. Arrow Connection Line
xml
<mxCell id="edge1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#999999;strokeWidth=2;endArrow=classic;endFill=1;" edge="1" parent="1" source="node1" target="node2">
<mxGeometry relative="1" as="geometry" />
</mxCell>xml
<mxCell id="edge1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#999999;strokeWidth=2;endArrow=classic;endFill=1;" edge="1" parent="1" source="node1" target="node2">
<mxGeometry relative="1" as="geometry" />
</mxCell>6. 虚线连接(异步/可选流程)
6. Dashed Connection (Asynchronous/Optional Process)
xml
<mxCell id="edge2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#9b59b6;strokeWidth=2;dashed=1;endArrow=classic;endFill=1;" edge="1" parent="1" source="node2" target="node3">
<mxGeometry relative="1" as="geometry" />
</mxCell>xml
<mxCell id="edge2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#9b59b6;strokeWidth=2;dashed=1;endArrow=classic;endFill=1;" edge="1" parent="1" source="node2" target="node3">
<mxGeometry relative="1" as="geometry" />
</mxCell>7. 红色箭头(错误分支)
7. Red Arrow (Error Branch)
xml
<mxCell id="edge3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#e74c3c;strokeWidth=2;endArrow=classic;endFill=1;" edge="1" parent="1" source="node2" target="node4">
<mxGeometry relative="1" as="geometry" />
</mxCell>xml
<mxCell id="edge3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#e74c3c;strokeWidth=2;endArrow=classic;endFill=1;" edge="1" parent="1" source="node2" target="node4">
<mxGeometry relative="1" as="geometry" />
</mxCell>8. 虚线框(可选区域)
8. Dashed Box (Optional Area)
xml
<mxCell id="optional" value="可选流程" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8f9fa;strokeColor=#999999;strokeWidth=1;dashed=1;fontColor=#999999;fontSize=10;" vertex="1" parent="1">
<mxGeometry x="50" y="200" width="200" height="120" as="geometry" />
</mxCell>xml
<mxCell id="optional" value="Optional Process" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8f9fa;strokeColor=#999999;strokeWidth=1;dashed=1;fontColor=#999999;fontSize=10;" vertex="1" parent="1">
<mxGeometry x="50" y="200" width="200" height="120" as="geometry" />
</mxCell>9. 汇聚点
9. Convergence Point
xml
<mxCell id="join" value="" style="ellipse;whiteSpace=wrap;html=1;fillColor=#666666;strokeColor=#666666;strokeWidth=0;" vertex="1" parent="1">
<mxGeometry x="300" y="400" width="12" height="12" as="geometry" />
</mxCell>xml
<mxCell id="join" value="" style="ellipse;whiteSpace=wrap;html=1;fillColor=#666666;strokeColor=#666666;strokeWidth=0;" vertex="1" parent="1">
<mxGeometry x="300" y="400" width="12" height="12" as="geometry" />
</mxCell>样式属性说明
Style Attribute Description
| 属性 | 说明 | 常用值 |
|---|---|---|
| rounded | 圆角 | 0=无, 1=有 |
| whiteSpace | 文本换行 | wrap |
| html | HTML渲染 | 1 |
| fillColor | 填充颜色 | #ffffff, #16213e 等 |
| strokeColor | 边框颜色 | #3498db, #e74c3c 等 |
| strokeWidth | 边框宽度 | 2 |
| fontColor | 文字颜色 | #333333, #aaaaaa 等 |
| fontSize | 字体大小 | 12, 14, 16 等 |
| fontStyle | 字体样式 | 0=普通, 1=粗体 |
| dashed | 虚线 | 0=实线, 1=虚线 |
| shadow | 阴影 | 0=无, 1=有 |
| edgeStyle | 连线样式 | orthogonalEdgeStyle=正交, elbowEdgeStyle=肘部 |
| Attribute | Description | Common Values |
|---|---|---|
| rounded | Rounded Corners | 0=none, 1=enabled |
| whiteSpace | Text Wrapping | wrap |
| html | HTML Rendering | 1 |
| fillColor | Fill Color | #ffffff, #16213e, etc. |
| strokeColor | Border Color | #3498db, #e74c3c, etc. |
| strokeWidth | Border Width | 2 |
| fontColor | Text Color | #333333, #aaaaaa, etc. |
| fontSize | Font Size | 12, 14, 16, etc. |
| fontStyle | Font Style | 0=normal, 1=bold |
| dashed | Dashed Line | 0=solid, 1=dashed |
| shadow | Shadow | 0=none, 1=enabled |
| edgeStyle | Connection Line Style | orthogonalEdgeStyle=orthogonal, elbowEdgeStyle=elbow |
分层架构图容器
Layered Architecture Diagram Container
xml
<!-- 容器背景 -->
<mxCell id="layer1" value="" style="rounded=1;whiteSpace=wrap=1;html=1;fillColor=#E3F2FD;strokeColor=#3498db;strokeWidth=1;" vertex="1" parent="1">
<mxGeometry x="100" y="80" width="900" height="80" as="geometry" />
</mxCell>
<!-- 图层标签 -->
<mxCell id="label1" value="① 接入层" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap=1;rounded=0;fontColor=#3498db;fontSize=14;fontStyle=1;" vertex="1" parent="1">
<mxGeometry x="110" y="85" width="100" height="20" as="geometry" />
</mxCell>xml
<!-- Container Background -->
<mxCell id="layer1" value="" style="rounded=1;whiteSpace=wrap=1;html=1;fillColor=#E3F2FD;strokeColor=#3498db;strokeWidth=1;" vertex="1" parent="1">
<mxGeometry x="100" y="80" width="900" height="80" as="geometry" />
</mxCell>
<!-- Layer Label -->
<mxCell id="label1" value="① Access Layer" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap=1;rounded=0;fontColor=#3498db;fontSize=14;fontStyle=1;" vertex="1" parent="1">
<mxGeometry x="110" y="85" width="100" height="20" as="geometry" />
</mxCell>执行步骤
Execution Steps
第 1 步:解析用户需求
Step 1: Parse User Requirements
用户可能提供:
- 图形类型:流程图、卡片、图表、图标、关系图、架构图
- 布局描述:横向、纵向、网格、环形
- 内容:文字、emoji、颜色偏好
- 风格:简约、专业、可爱
- 背景模式:浅色/深色(重要:必须明确,未明确时默认浅色)
Users may provide:
- Graph Type: Flowchart, card, chart, icon, relationship diagram, architecture diagram
- Layout Description: Horizontal, vertical, grid, circular
- Content: Text, emoji, color preferences
- Style: Minimalist, professional, cute
- Background Mode: Light/Dark (Important: Must be confirmed; light background by default if not specified)
背景模式确认
Background Mode Confirmation
关键步骤:生成前必须确认用户需要的背景模式
- 询问用户:「需要浅色背景还是深色背景的图?」
- 如用户未指定,默认使用浅色背景
- 适用场景参考:
- 浅色背景:文档、PPT、网页展示
- 深色背景:代码截图、IDE配套图、深色主题设计稿
Critical Step: Must confirm the required background mode with the user before generation
- Ask the user: "Do you need a light or dark background for the graph?"
- If not specified by the user, default to light background
- Application Scenario Reference:
- Light Background: Documents, PPTs, web page displays
- Dark Background: Code screenshots, IDE matching graphs, dark-themed design drafts
第 2 步:选择模板或新建
Step 2: Select Template or Create New
常用模板:
- 横向流程图 - 步骤从左到右排列
- 纵向流程图 - 步骤从上到下排列
- 循环流程图 - 首尾相连的闭环
- 卡片网格 - 多张卡片并列
- 对比图 - 左右对比布局
- 时间线 - 垂直或水平时间轴
- 饼图/柱状图 - 数据可视化
- 架构图 - 系统、部署、应用架构图,架构图要分层显示
- 表格对比 - 数据表格可视化
Common Templates:
- Horizontal Flowchart - Steps arranged from left to right
- Vertical Flowchart - Steps arranged from top to bottom
- Loop Flowchart - Closed loop with connected start and end
- Card Grid - Multiple cards arranged side by side
- Comparison Chart - Left-right comparison layout
- Timeline - Vertical or horizontal timeline
- Pie/Bar Chart - Data visualization
- Architecture Diagram - System, deployment, application architecture diagrams, which should be displayed in layers
- Table Comparison - Data table visualization
第 3 步:生成 drawio XML 代码
Step 3: Generate drawio XML Code
根据需求生成完整的 drawio 文件:
Generate complete drawio files based on requirements:
浅色背景模板
Light Background Template
xml
<mxfile host="app.diagrams.net">
<diagram name="页面-1">
<mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="800" pageHeight="600" math="0" shadow="1">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<!-- 背景 -->
<mxCell id="bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f8f9fa;strokeColor=#e0e0e0;" vertex="1" parent="1">
<mxGeometry x="0" y="0" width="800" height="600" as="geometry" />
</mxCell>
<!-- 标题 -->
<mxCell id="title" value="图形标题" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap=1;rounded=0;fontSize=20;fontStyle=1;fontColor=#333333;" vertex="1" parent="1">
<mxGeometry x="300" y="20" width="200" height="30" as="geometry" />
</mxCell>
<!-- 图形内容 -->
...
</root>
</mxGraphModel>
</diagram>
</mxfile>xml
<mxfile host="app.diagrams.net">
<diagram name="Page-1">
<mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="800" pageHeight="600" math="0" shadow="1">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<!-- Background -->
<mxCell id="bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f8f9fa;strokeColor=#e0e0e0;" vertex="1" parent="1">
<mxGeometry x="0" y="0" width="800" height="600" as="geometry" />
</mxCell>
<!-- Title -->
<mxCell id="title" value="Graphic Title" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap=1;rounded=0;fontSize=20;fontStyle=1;fontColor=#333333;" vertex="1" parent="1">
<mxGeometry x="300" y="20" width="200" height="30" as="geometry" />
</mxCell>
<!-- Graphic Content -->
...
</root>
</mxGraphModel>
</diagram>
</mxfile>深色背景模板
Dark Background Template
xml
<mxfile host="app.diagrams.net">
<diagram name="页面-1">
<mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="800" pageHeight="600" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<!-- 深色背景 -->
<mxCell id="bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#1a1a2e;strokeColor=#333333;" vertex="1" parent="1">
<mxGeometry x="0" y="0" width="800" height="600" as="geometry" />
</mxCell>
<!-- 标题 -->
<mxCell id="title" value="图形标题" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap=1;rounded=0;fontSize=20;fontStyle=1;fontColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="300" y="20" width="200" height="30" as="geometry" />
</mxCell>
<!-- 图形内容 -->
<!-- 卡片示例 -->
<mxCell id="node1" value="节点内容" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#16213e;strokeColor=#3498db;strokeWidth=2;fontColor=#aaaaaa;fontSize=12;" vertex="1" parent="1">
<mxGeometry x="100" y="80" width="140" height="60" as="geometry" />
</mxCell>
...
</root>
</mxGraphModel>
</diagram>
</mxfile>深色背景配色速查表:
| 元素 | 颜色代码 |
|---|---|
| 背景 | |
| 卡片背景 | |
| 标题文字 | |
| 正文文字 | |
| 边框 | |
| 箭头 | |
| 主色边框 | |
| 成功色 | |
| 错误色 | |
xml
<mxfile host="app.diagrams.net">
<diagram name="Page-1">
<mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="800" pageHeight="600" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<!-- Dark Background -->
<mxCell id="bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#1a1a2e;strokeColor=#333333;" vertex="1" parent="1">
<mxGeometry x="0" y="0" width="800" height="600" as="geometry" />
</mxCell>
<!-- Title -->
<mxCell id="title" value="Graphic Title" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap=1;rounded=0;fontSize=20;fontStyle=1;fontColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="300" y="20" width="200" height="30" as="geometry" />
</mxCell>
<!-- Graphic Content -->
<!-- Card Example -->
<mxCell id="node1" value="Node Content" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#16213e;strokeColor=#3498db;strokeWidth=2;fontColor=#aaaaaa;fontSize=12;" vertex="1" parent="1">
<mxGeometry x="100" y="80" width="140" height="60" as="geometry" />
</mxCell>
...
</root>
</mxGraphModel>
</diagram>
</mxfile>Dark Background Color Quick Reference:
| Element | Color Code |
|---|---|
| Background | |
| Card Background | |
| Title Text | |
| Body Text | |
| Border | |
| Arrow | |
| Primary Color Border | |
| Success Color | |
| Error Color | |
第 4 步:保存文件
Step 4: Save File
将生成的 drawio 保存到用户指定的位置,文件名以 结尾。
.drawioSave the generated drawio file to the location specified by the user, with the filename ending in .
.drawio箭头规范
Arrow Specifications
箭头样式
Arrow Styles
| 样式 | 属性值 |
|---|---|
| 灰色箭头(推荐) | strokeColor=#999999 |
| 蓝色箭头 | strokeColor=#3498db |
| 红色箭头 | strokeColor=#e74c3c |
| 紫色箭头 | strokeColor=#9b59b6 |
| Style | Attribute Value |
|---|---|
| Gray Arrow (Recommended) | strokeColor=#999999 |
| Blue Arrow | strokeColor=#3498db |
| Red Arrow | strokeColor=#e74c3c |
| Purple Arrow | strokeColor=#9b59b6 |
线条样式
Line Styles
| 样式 | 使用场景 | 属性 |
|---|---|---|
| 实线 | 主线流程、正确分支、错误分支 | dashed=0 |
| 虚线 | 异步/回调/可选流程 | dashed=1 |
重要原则:
- 错误分支必须使用实线,用颜色(红色)区分,不可用虚线
- 虚线仅用于表示异步、回调、定时任务等非同步场景
| Style | Application Scenario | Attribute |
|---|---|---|
| Solid Line | Main process, correct branch, error branch | dashed=0 |
| Dashed Line | Asynchronous/callback/optional process | dashed=1 |
Important Principle:
- Error branches must use solid lines, distinguished by color (red), not dashed lines
- Dashed lines are only used to represent asynchronous, callback, scheduled task, and other non-synchronous scenarios
箭头端点样式
Arrow Endpoint Styles
xml
<!-- 经典箭头 -->
endArrow=classic;endFill=1;
<!-- 空心箭头 -->
endArrow=classicEmpty;endFill=0;
<!-- 菱形端点 -->
endArrow=diamond;endFill=1;xml
<!-- Classic Arrow -->
endArrow=classic;endFill=1;
<!-- Hollow Arrow -->
endArrow=classicEmpty;endFill=0;
<!-- Diamond Endpoint -->
endArrow=diamond;endFill=1;流程图规范
Flowchart Specifications
画布尺寸计算规则
Canvas Size Calculation Rules
画布高度 = 标题高度 + 内容总高度 + 节点间距 × (节点数-1) + 边距
画布宽度 = 边距 + 最大节点宽度 × 列数 + 列间距 × (列数-1) + 边距Canvas Height = Title Height + Total Content Height + Node Spacing × (Number of Nodes - 1) + Margins
Canvas Width = Margins + Maximum Node Width × Number of Columns + Column Spacing × (Number of Columns - 1) + Margins节点排列
Node Arrangement
- 横向流程:节点水平排列,间距 40-60px
- 纵向流程:节点垂直排列,间距 30-50px
- Horizontal Process: Nodes arranged horizontally with spacing 40-60px
- Vertical Process: Nodes arranged vertically with spacing 30-50px
连接线类型
Connection Line Types
直线连接
Straight Connection
xml
<mxCell id="edge1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#999999;strokeWidth=2;endArrow=classic;" edge="1" parent="1" source="node1" target="node2">
<mxGeometry relative="1" as="geometry" />
</mxCell>xml
<mxCell id="edge1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#999999;strokeWidth=2;endArrow=classic;" edge="1" parent="1" source="node1" target="node2">
<mxGeometry relative="1" as="geometry" />
</mxCell>折线连接(路径转向)
Polyline Connection (Path Direction Change)
xml
<mxCell id="edge2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#999999;strokeWidth=2;endArrow=classic;" edge="1" parent="1" source="node2" target="node3">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<Object x="250" y="180" />
</Array>
</mxGeometry>
</mxCell>xml
<mxCell id="edge2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#999999;strokeWidth=2;endArrow=classic;" edge="1" parent="1" source="node2" target="node3">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<Object x="250" y="180" />
</Array>
</mxGeometry>
</mxCell>曲线连接(循环/回退)
Curve Connection (Loop/Backward)
xml
<mxCell id="edge3" style="edgeStyle=elbowEdgeStyle;rounded=1;html=1;strokeColor=#9b59b6;strokeWidth=2;dashed=1;endArrow=classic;" edge="1" parent="1" source="node3" target="node1">
<mxGeometry relative="1" as="geometry" />
</mxCell>xml
<mxCell id="edge3" style="edgeStyle=elbowEdgeStyle;rounded=1;html=1;strokeColor=#9b59b6;strokeWidth=2;dashed=1;endArrow=classic;" edge="1" parent="1" source="node3" target="node1">
<mxGeometry relative="1" as="geometry" />
</mxCell>分支与汇聚
Branching and Convergence
菱形判断节点
Diamond Decision Node
xml
<mxCell id="decision" value="判断条件" style="rhombus;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e67e22;strokeWidth=2;fontColor=#333333;fontSize=12;" vertex="1" parent="1">
<mxGeometry x="200" y="150" width="80" height="80" as="geometry" />
</mxCell>xml
<mxCell id="decision" value="Decision Condition" style="rhombus;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e67e22;strokeWidth=2;fontColor=#333333;fontSize=12;" vertex="1" parent="1">
<mxGeometry x="200" y="150" width="80" height="80" as="geometry" />
</mxCell>分支连线标注
Branch Connection Line Labeling
在连线旁边添加标注:
xml
<mxCell id="label1" value="是" style="text;html=1;strokeColor=none;fillColor=none;align=center;fontColor=#666666;fontSize=10;" vertex="1" parent="1">
<mxGeometry x="220" y="230" width="30" height="20" as="geometry" />
</mxCell>Add labels next to connection lines:
xml
<mxCell id="label1" value="Yes" style="text;html=1;strokeColor=none;fillColor=none;align=center;fontColor=#666666;fontSize=10;" vertex="1" parent="1">
<mxGeometry x="220" y="230" width="30" height="20" as="geometry" />
</mxCell>架构图规范
Architecture Diagram Specifications
分层结构
Layered Structure
架构图应采用分层设计,从上到下:
- 接入层(客户端、CDN、负载均衡、网关)
- 服务层(业务服务、认证服务、消息队列)
- 数据层(Redis、MySQL、MongoDB)
- 基础层(Docker、K8s、监控)
Architecture diagrams should adopt layered design, from top to bottom:
- Access Layer (Client, CDN, Load Balancer, Gateway)
- Service Layer (Business Service, Authentication Service, Message Queue)
- Data Layer (Redis, MySQL, MongoDB)
- Infrastructure Layer (Docker, K8s, Monitoring)
架构图组件模板
Architecture Diagram Component Templates
服务节点
Service Node
xml
<mxCell id="service1" value="服务名称" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#E8F5E9;strokeColor=#2ecc71;strokeWidth=2;fontColor=#333333;fontSize=12;shadow=1;" vertex="1" parent="1">
<mxGeometry x="150" y="100" width="100" height="40" as="geometry" />
</mxCell>xml
<mxCell id="service1" value="Service Name" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#E8F5E9;strokeColor=#2ecc71;strokeWidth=2;fontColor=#333333;fontSize=12;shadow=1;" vertex="1" parent="1">
<mxGeometry x="150" y="100" width="100" height="40" as="geometry" />
</mxCell>数据库节点
Database Node
xml
<mxCell id="db1" value="数据库" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=5;fillColor=#FCE4EC;strokeColor=#e74c3c;strokeWidth=2;fontColor=#333333;fontSize=12;" vertex="1" parent="1">
<mxGeometry x="300" y="350" width="60" height="50" as="geometry" />
</mxCell>xml
<mxCell id="db1" value="Database" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=5;fillColor=#FCE4EC;strokeColor=#e74c3c;strokeWidth=2;fontColor=#333333;fontSize=12;" vertex="1" parent="1">
<mxGeometry x="300" y="350" width="60" height="50" as="geometry" />
</mxCell>队列节点
Queue Node
xml
<mxCell id="queue1" value="消息队列" style="shape=hexagon;whiteSpace=wrap;html=1;fillColor=#F3E5F5;strokeColor=#9b59b6;strokeWidth=2;fontColor=#333333;fontSize=12;perimeter=hexagonPerimeter;" vertex="1" parent="1">
<mxGeometry x="400" y="200" width="100" height="40" as="geometry" />
</mxCell>xml
<mxCell id="queue1" value="Message Queue" style="shape=hexagon;whiteSpace=wrap;html=1;fillColor=#F3E5F5;strokeColor=#9b59b6;strokeWidth=2;fontColor=#333333;fontSize=12;perimeter=hexagonPerimeter;" vertex="1" parent="1">
<mxGeometry x="400" y="200" width="100" height="40" as="geometry" />
</mxCell>箭头使用规则
Arrow Usage Rules
分层架构图中箭头是可选的:
-
无箭头架构图:当重点展示系统层次结构和组件分层时,可以不加箭头。
-
带箭头架构图:当需要表示数据流向、调用关系或处理顺序时,可添加箭头。箭头应使用统一灰色(#999999)。
xml
<mxCell id="arrow1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#999999;strokeWidth=2;endArrow=classic;endFill=1;" edge="1" parent="1" source="layer1" target="layer2">
<mxGeometry relative="1" as="geometry" />
</mxCell>Arrows are optional in layered architecture diagrams:
-
Arrowless Architecture Diagram: When focusing on displaying system hierarchical structure and component layering, arrows can be omitted.
-
Arrowed Architecture Diagram: When it is necessary to represent data flow, call relationships, or processing order, arrows can be added. Arrows should use uniform gray (#999999).
xml
<mxCell id="arrow1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#999999;strokeWidth=2;endArrow=classic;endFill=1;" edge="1" parent="1" source="layer1" target="layer2">
<mxGeometry relative="1" as="geometry" />
</mxCell>验证清单
Validation Checklist
1. 背景模式确认
1. Background Mode Confirmation
生成前必须确认:
- 已询问用户需要浅色还是深色背景
- 背景色与内容颜色形成良好对比
- 深色模式下文字使用浅色系(#ffffff、#aaaaaa、#888888)
Must confirm before generation:
- Have asked the user whether they need a light or dark background
- Background color and content color form good contrast
- Use light-colored text (#ffffff, #aaaaaa, #888888) in dark mode
2. 基础结构验证
2. Basic Structure Validation
- 节点圆角一致(rounded=1)
- 边框宽度适中(strokeWidth=2)
- 文字清晰可读,与背景对比度足够
- 箭头样式统一
- 形状拼接验证:避免双层叠加导致的圆角不协调问题,使用单层结构
- 连接线验证:确保连接线端点精确指向节点边缘,不偏移
- Consistent node rounded corners (rounded=1)
- Moderate border width (strokeWidth=2)
- Text is clear and legible with sufficient contrast against background
- Consistent arrow styles
- Shape Splicing Validation: Avoid rounded corner inconsistency caused by double-layer overlay; use single-layer structure
- Connection Line Validation: Ensure connection line endpoints precisely point to node edges with no offset
3. 布局规约验证
3. Layout Specification Validation
- 画布尺寸合适,无过多空白(利用率 60%-80%)
- 节点间距合理,无拥挤或过大间距
- 分支路径清晰,无路径交叉
- 折线转折点不与节点重叠
- 防线条混乱验证:
- 避免三条以上路径经过同一坐标点
- 连接线不穿过其他节点
- 分支角度合理(30-45°),避免交叉
- 图例位于底部,与主流程无重叠
- Appropriate canvas size with no excessive blank space (utilization rate 60%-80%)
- Reasonable node spacing with no overcrowding or excessive spacing
- Clear branch paths with no path crossings
- Polyline turning points do not overlap with nodes
- Anti-Line Chaos Validation:
- Avoid three or more paths passing through the same coordinate point
- Connection lines do not pass through other nodes
- Reasonable branch angles (30-45°) to avoid crossings
- Legends are located at the bottom with no overlap with the main process
4. 图形完整显示验证
4. Graphic Complete Display Validation
- 图形能够完整显示,避免元素超出画布范围
- 所有节点在画布范围内
- 连接线端点距节点边界距离合适
- 文字与图形边界间距足够
- The graphic can be displayed completely with no elements exceeding the canvas range
- All nodes are within the canvas range
- Appropriate distance between connection line endpoints and node borders
- Sufficient spacing between text and graphic borders
5. 颜色与样式验证
5. Color and Style Validation
- 颜色符合配色规范
- 错误分支使用红色实线(非虚线)
- 异步流程使用虚线(紫色或灰色)
- 边框宽度合适(浅色模式:2px,深色模式:2-3px)
- Colors comply with color scheme specifications
- Error branches use red solid lines (not dashed lines)
- Asynchronous processes use dashed lines (purple or gray)
- Appropriate border width (light mode: 2px, dark mode: 2-3px)
输出说明
Output Description
生成的 drawio XML 文件可以直接:
- 在 drawio 中打开查看和编辑
- 保存为 .drawio 文件
- 导出为 PNG、SVG、PDF 等格式
- 嵌入到文档中使用
The generated drawio XML file can directly:
- Be opened, viewed, and edited in drawio
- Be saved as a .drawio file
- Be exported as PNG, SVG, PDF, and other formats
- Be embedded into documents for use
触发条件
Trigger Conditions
当用户提到以下内容时触发:
- XML、drawio、绘图
- 流程图、关系图、结构图、架构图
- 生成一个图、把文字变成图
- drawio 编辑
Triggered when users mention:
- XML, drawio, drawing
- Flowchart, relationship diagram, structure diagram, architecture diagram
- Generate a graph, turn text into a graph
- drawio editing
与 svg-generator 的对应关系
Corresponding Relationship with svg-generator
本 skill 与 svg-generator 功能完全一致,区别在于输出格式:
| svg-generator | xml-diagram |
|---|---|
| 输出 SVG 格式 | 输出 drawio XML 格式 |
| |
| 可在浏览器打开 | 可在 drawio 中编辑 |
| 相同配色方案 | 相同配色方案 |
| 相同布局规范 | 相同布局规范 |
| 相同验证清单 | 相同验证清单 |
This skill has exactly the same functionality as svg-generator, with the only difference being the output format:
| svg-generator | xml-diagram |
|---|---|
| Outputs SVG format | Outputs drawio XML format |
| |
| Can be opened in browsers | Can be edited in drawio |
| Same color scheme | Same color scheme |
| Same layout specifications | Same layout specifications |
| Same validation checklist | Same validation checklist |