render_mermaid_chart
Convert Mermaid diagram code into high-quality PNG, SVG, or PDF files with customizable dimensions, themes, and background colors. Ideal for creating and saving visual diagrams locally or via HTTP URLs.
Instructions
将 Mermaid 代码渲染为高质量图片文件
Input Schema
Name | Required | Description | Default |
---|---|---|---|
backgroundColor | No | 背景颜色,默认为 white | white |
format | No | 输出格式(png, svg, pdf),默认为 png | png |
height | No | 图片高度(像素),默认为 800 | |
mermaidCode | Yes | Mermaid 图表代码 | |
outputPath | Yes | 输出文件路径(包含文件名和扩展名) | |
theme | No | Mermaid 主题,默认为 default | default |
width | No | 图片宽度(像素),默认为 1200 |
Input Schema (JSON Schema)
{
"properties": {
"backgroundColor": {
"default": "white",
"description": "背景颜色,默认为 white",
"type": "string"
},
"format": {
"default": "png",
"description": "输出格式(png, svg, pdf),默认为 png",
"enum": [
"png",
"svg",
"pdf"
],
"type": "string"
},
"height": {
"default": 800,
"description": "图片高度(像素),默认为 800",
"type": "number"
},
"mermaidCode": {
"description": "Mermaid 图表代码",
"type": "string"
},
"outputPath": {
"description": "输出文件路径(包含文件名和扩展名)",
"type": "string"
},
"theme": {
"default": "default",
"description": "Mermaid 主题,默认为 default",
"enum": [
"default",
"dark",
"forest",
"neutral"
],
"type": "string"
},
"width": {
"default": 1200,
"description": "图片宽度(像素),默认为 1200",
"type": "number"
}
},
"required": [
"mermaidCode",
"outputPath"
],
"type": "object"
}