xml-diagram

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

XML 图形生成器(drawio 格式)

XML Graphic Generator (drawio Format)

核心工作流

Core Workflow

用户描述 → 解析需求 → 设计图形 → 生成 drawio XML → 验证输出 → 保存文件
详细流程如下:
  1. 接收用户描述
    • 用户可能会描述需要的图类型(流程图、卡片、图表等)、布局(横向、纵向、网格等)、内容(文字、emoji)和风格(简约,专业、可爱等)。
    • 解析用户输入,提取关键信息以指导后续的图形设计和生成。
  2. 解析用户需求
    • 思考需要绘制的图类型、结构、元素、布局和配色,如果不清楚的情况,请用户确认。
    • 评估元素数量,合理分组,避免单个图形承载过多内容
  3. 根据分析结果,设计图的布局和元素
    • 确定图的整体结构和层次关系
    • 设计每个元素的样式(颜色、形状、大小等)
    • 确定元素之间的连接方式(线条、箭头等)
  4. 生成 drawio XML 代码
    • 使用 drawio 的 mxGraph XML 格式构建图形
    • 应用 CSS 样式内嵌到 SVG 中
    • 根据风格选择应用滤镜和阴影效果
  5. 针对生成的图进行验证,确保其符合用户需求和预期的视觉效果
    • 背景模式确认
      • 确认用户选择的背景模式(浅色/深色)
      • 未明确时默认使用浅色背景
      • 深色模式下文字和边框使用浅色系
    • 基础结构验证(避免元素重叠和布局错乱):
      • 检查图的结构和元素是否正确
      • 确保所有节点坐标计算准确,无重叠
      • 验证连接线起点/终点精确指向节点边缘
      • 检查文字与图形边界间距 ≥8px,避免文字溢出
    • 布局规约验证(避免空白过多和拥挤):
      • 画布尺寸紧凑合理,利用率 60%-80% 为宜
      • 节点间距合理,无过大或过小
      • 分支路径清晰,无路径交叉
      • 折线转折点不与节点重叠
    • 显示完整性保障(避免显示不完整):
      • 计算画布尺寸:
        画布高度 = 标题高度 + 内容总高度 + 节点间距 × (节点数-1) + 图例说明区高度(如有) + 边距
      • 确保所有节点、文字、连线、箭头都在画布范围内
      • 各边保留 ≥30-40px 边距,避免内容被裁剪
    • 箭头与连接验证(避免箭头混乱):
      • 检查箭头样式统一
      • 验证箭头指向准确,无偏移或错位
      • 检查折线路径节点顺序正确,无交叉混乱
      • 验证虚线仅用于异步流程,错误分支使用实线
    • 稳健性设计检查
      • 避免使用嵌套坐标,所有坐标使用明确数值
      • 确保菱形判断节点中心坐标准确,分支从底部中心出发
      • 验证汇聚点位置在分支节点正下方,避免路径交叉
      • 图例应置于图形底部,避免与主流程重叠,预留专用图例区域
    • 样式与颜色验证
      • 确保颜色和样式符合选择的风格
      • 验证 drawio XML 代码的正确性和兼容性
      • 检查图的布局和元素之间的连接是否合理、线条是否清晰准确、图形是否清晰可读、颜色是否符合预期、排版是否整齐
      • 检查图中箭头是否清晰、连接是否正常、大小是否合适
      • 检查图片是否能够完整显示,是否有元素被截取
    • 复杂流程图验证
      • 分支流程使用不同颜色区分(错误分支用红色,主线用灰色/蓝色)
      • 条件判断节点使用菱形形状
      • 异步流程使用虚线连接(仅用于异步场景)
      • 汇聚点明确标注
      • 可选区域用虚线框表示
  6. 输出最终的 drawio XML 文件,供用户使用和修改
    • 将 drawio XML 保存到指定路径,文件名以
      .drawio
      结尾
    • 提供 drawio XML 代码字符串供用户复制使用
核心原则:生成的 drawio 图形要简洁美观,符合现代设计规范,与 svg-generator 风格保持一致。
User Description → Parse Requirements → Design Graphics → Generate drawio XML → Validate Output → Save File
Detailed process as follows:
  1. 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.
  2. 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.
  3. 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.)
  4. 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
  5. 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
    • 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
  6. 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
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、网页等
参考示例:浅色流程图、浅色架构图
用途颜色代码
背景色
#f8f9fa
卡片背景
#ffffff
标题文字
#333333
正文文字
#666666
#999999
边框色
#e0e0e0
箭头颜色
#999999
#666
Applicable to: Light-themed documents, PPTs, web pages, etc.
Reference Examples: Light flowchart, light architecture diagram
PurposeColor Code
Background Color
#f8f9fa
Card Background
#ffffff
Title Text
#333333
Body Text
#666666
or
#999999
Border Color
#e0e0e0
Arrow Color
#999999
or
#666

2. 深色背景模式

2. Dark Background Mode

适用于:深色主题文档、演示文稿、代码编辑器主题等
参考示例:深色流程图、深色时间线
用途颜色代码
背景色
#1a1a2e
卡片背景
#16213e
标题文字
#ffffff
正文文字
#aaaaaa
#888888
边框色
#333333
箭头颜色
#666666
#555555
深色模式配色速查
用途颜色代码
主色(蓝)
#3498db
成功(绿)
#2ecc71
警告(橙)
#e67e22
错误(红)
#e74c3c
紫色
#9b59b6
青色
#1abc9c
黄色
#f39c12
青色2
#00cec9
深色背景下的特殊处理
  • 文字使用浅色系确保对比度
  • 节点边框适当加粗(2-3px)以增强可见性
  • 建议使用圆角卡片提升视觉层次
Applicable to: Dark-themed documents, presentations, code editor themes, etc.
Reference Examples: Dark flowchart, dark timeline
PurposeColor Code
Background Color
#1a1a2e
Card Background
#16213e
Title Text
#ffffff
Body Text
#aaaaaa
or
#888888
Border Color
#333333
Arrow Color
#666666
or
#555555
Dark Mode Color Quick Reference:
PurposeColor Code
Primary Color (Blue)
#3498db
Success (Green)
#2ecc71
Warning (Orange)
#e67e22
Error (Red)
#e74c3c
Purple
#9b59b6
Cyan
#1abc9c
Yellow
#f39c12
Cyan 2
#00cec9
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

用途颜色代码
主色(蓝色)
#3498db
辅助色(绿色)
#2ecc71
强调色(橙色)
#e67e22
警示色(红色)
#e74c3c
背景色
#f8f9fa
文字色
#333333
#666666
边框色
#e0e0e0
箭头颜色
#999999
#3498db
(灰色/蓝色)
PurposeColor Code
Primary Color (Blue)
#3498db
Secondary Color (Green)
#2ecc71
Accent Color (Orange)
#e67e22
Warning Color (Red)
#e74c3c
Background Color
#f8f9fa
Text Color
#333333
or
#666666
Border Color
#e0e0e0
Arrow Color
#999999
or
#3498db
(Gray/Blue)

图形规范

Graphic Specifications

项目浅色模式默认值深色模式默认值
画布尺寸800×600800×600
圆角半径8px(卡片)8px(卡片)
阴影柔和阴影无阴影或淡阴影
边框宽度2px2-3px
字体PingFang SC, Microsoft YaHei, sans-serifPingFang SC, Microsoft YaHei, sans-serif
线条粗细2px2px
ItemLight Mode Default ValueDark Mode Default Value
Canvas Size800×600800×600
Radius of Corners8px (Cards)8px (Cards)
ShadowSoft ShadowNo Shadow or Light Shadow
Border Width2px2-3px
FontPingFang SC, Microsoft YaHei, sans-serifPingFang SC, Microsoft YaHei, sans-serif
Line Thickness2px2px

布局规范(重要)

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
    fontStyle=1
    in drawio to bold text, or use different
    fontColor
    to distinguish titles

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
    edgeStyle=orthogonalEdgeStyle
    to ensure polyline orthogonality
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
htmlHTML渲染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=肘部
AttributeDescriptionCommon Values
roundedRounded Corners0=none, 1=enabled
whiteSpaceText Wrappingwrap
htmlHTML Rendering1
fillColorFill Color#ffffff, #16213e, etc.
strokeColorBorder Color#3498db, #e74c3c, etc.
strokeWidthBorder Width2
fontColorText Color#333333, #aaaaaa, etc.
fontSizeFont Size12, 14, 16, etc.
fontStyleFont Style0=normal, 1=bold
dashedDashed Line0=solid, 1=dashed
shadowShadow0=none, 1=enabled
edgeStyleConnection Line StyleorthogonalEdgeStyle=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

关键步骤:生成前必须确认用户需要的背景模式
  1. 询问用户:「需要浅色背景还是深色背景的图?」
  2. 如用户未指定,默认使用浅色背景
  3. 适用场景参考:
    • 浅色背景:文档、PPT、网页展示
    • 深色背景:代码截图、IDE配套图、深色主题设计稿
Critical Step: Must confirm the required background mode with the user before generation
  1. Ask the user: "Do you need a light or dark background for the graph?"
  2. If not specified by the user, default to light background
  3. 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

常用模板:
  1. 横向流程图 - 步骤从左到右排列
  2. 纵向流程图 - 步骤从上到下排列
  3. 循环流程图 - 首尾相连的闭环
  4. 卡片网格 - 多张卡片并列
  5. 对比图 - 左右对比布局
  6. 时间线 - 垂直或水平时间轴
  7. 饼图/柱状图 - 数据可视化
  8. 架构图 - 系统、部署、应用架构图,架构图要分层显示
  9. 表格对比 - 数据表格可视化
Common Templates:
  1. Horizontal Flowchart - Steps arranged from left to right
  2. Vertical Flowchart - Steps arranged from top to bottom
  3. Loop Flowchart - Closed loop with connected start and end
  4. Card Grid - Multiple cards arranged side by side
  5. Comparison Chart - Left-right comparison layout
  6. Timeline - Vertical or horizontal timeline
  7. Pie/Bar Chart - Data visualization
  8. Architecture Diagram - System, deployment, application architecture diagrams, which should be displayed in layers
  9. 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>
深色背景配色速查表
元素颜色代码
背景
#1a1a2e
卡片背景
#16213e
标题文字
#ffffff
正文文字
#aaaaaa
/
#888888
边框
#333333
箭头
#666
主色边框
#3498db
成功色
#2ecc71
错误色
#e74c3c
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:
ElementColor Code
Background
#1a1a2e
Card Background
#16213e
Title Text
#ffffff
Body Text
#aaaaaa
/
#888888
Border
#333333
Arrow
#666
Primary Color Border
#3498db
Success Color
#2ecc71
Error Color
#e74c3c

第 4 步:保存文件

Step 4: Save File

将生成的 drawio 保存到用户指定的位置,文件名以
.drawio
结尾。
Save 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
StyleAttribute Value
Gray Arrow (Recommended)strokeColor=#999999
Blue ArrowstrokeColor=#3498db
Red ArrowstrokeColor=#e74c3c
Purple ArrowstrokeColor=#9b59b6

线条样式

Line Styles

样式使用场景属性
实线主线流程、正确分支、错误分支dashed=0
虚线异步/回调/可选流程dashed=1
重要原则
  • 错误分支必须使用实线,用颜色(红色)区分,不可用虚线
  • 虚线仅用于表示异步、回调、定时任务等非同步场景
StyleApplication ScenarioAttribute
Solid LineMain process, correct branch, error branchdashed=0
Dashed LineAsynchronous/callback/optional processdashed=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

架构图应采用分层设计,从上到下:
  1. 接入层(客户端、CDN、负载均衡、网关)
  2. 服务层(业务服务、认证服务、消息队列)
  3. 数据层(Redis、MySQL、MongoDB)
  4. 基础层(Docker、K8s、监控)
Architecture diagrams should adopt layered design, from top to bottom:
  1. Access Layer (Client, CDN, Load Balancer, Gateway)
  2. Service Layer (Business Service, Authentication Service, Message Queue)
  3. Data Layer (Redis, MySQL, MongoDB)
  4. 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

分层架构图中箭头是可选的
  1. 无箭头架构图:当重点展示系统层次结构和组件分层时,可以不加箭头。
  2. 带箭头架构图:当需要表示数据流向、调用关系或处理顺序时,可添加箭头。箭头应使用统一灰色(#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:
  1. Arrowless Architecture Diagram: When focusing on displaying system hierarchical structure and component layering, arrows can be omitted.
  2. 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 文件可以直接:
  1. 在 drawio 中打开查看和编辑
  2. 保存为 .drawio 文件
  3. 导出为 PNG、SVG、PDF 等格式
  4. 嵌入到文档中使用
The generated drawio XML file can directly:
  1. Be opened, viewed, and edited in drawio
  2. Be saved as a .drawio file
  3. Be exported as PNG, SVG, PDF, and other formats
  4. 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-generatorxml-diagram
输出 SVG 格式输出 drawio XML 格式
.svg
文件
.drawio
文件
可在浏览器打开可在 drawio 中编辑
相同配色方案相同配色方案
相同布局规范相同布局规范
相同验证清单相同验证清单
This skill has exactly the same functionality as svg-generator, with the only difference being the output format:
svg-generatorxml-diagram
Outputs SVG formatOutputs drawio XML format
.svg
file
.drawio
file
Can be opened in browsersCan be edited in drawio
Same color schemeSame color scheme
Same layout specificationsSame layout specifications
Same validation checklistSame validation checklist