开源 AI 图表生成器(Draw.io, Mermaid)
1 分•作者: twwch•6 个月前
大家好,
最近我一直在研究 AI Agent,并注意到一个常见的痛点:大多数 AI 绘图工具生成的都是静态图片(PNG/JPG)。如果 AI 在某个细节上出错,你很难直接修复——你必须重新生成整个图表。
我想要一个能生成可编辑代码并进行交互式渲染的工具。所以我构建了 DeepDiagram。
它是一个开源的 Web 平台,使用多 Agent 架构。它不是用单个提示词尝试完成所有任务,而是通过一个路由器分析你的意图,并将其导向一个专业的 Agent(例如,Draw.io 专家、数据可视化专家或流程图专家)。
演示
思维导图和数据图表 (ECharts):
Draw.io 生成 (基于 XML):
Mermaid 图表:
技术栈
编排:LangGraph (Python),用于 ReAct 循环和状态管理。
前端:React 19, Vite, TailwindCSS, Zustand。
后端:FastAPI (Python 3.10+)。
流式传输:使用 SSE (Server-Sent Events) 实现实时预览(打字机效果)。
渲染引擎:React Flow, Apache ECharts, Mermaid.js, 和 Draw.io (Atlas 主题)。
主要功能
Draw.io Agent:生成兼容的 XML。你可以在画布中直接编辑结果。
数据图表 Agent:粘贴原始数据 (CSV/JSON/文本),它会使用 ECharts 将其可视化(柱状图/折线图/饼图)。
分支和时间旅行:由于 AI 并非完美,我实现了一个类似 Git 的分支系统。你可以“重试”一条消息,创建一个新分支,或者回溯到之前的状态,查看 Agent 的思考过程。
自托管:包含 Docker Compose 支持。与 OpenAI 或 DeepSeek V3 配合使用效果极佳(强烈推荐,性价比高)。
链接
GitHub (AGPL-3.0): https://github.com/twwch/DeepDiagram
它仍处于早期阶段,但我很乐意听取你的反馈或查看你的 PR!
查看原文
Hi everyone,<p>I've been working on AI Agents recently and noticed a common frustration: most AI diagramming tools generate static images (PNG/JPG). If the AI gets one detail wrong, you can't easily fix it—you have to regenerate the whole thing.<p>I wanted a tool that generates editable code and renders it interactively. So I built DeepDiagram.<p>It’s an open-source web platform that uses a Multi-Agent architecture. Instead of a single prompt trying to do everything, a Router analyzes your intent and directs it to a specialized agent (e.g., a Draw.io expert, a Data Visualization expert, or a Flowchart expert).<p>Demos
Mind Map & Data Charts (ECharts):<p>Draw.io Generation (XML based):<p>Mermaid Diagrams:<p>Tech Stack
Orchestration: LangGraph (Python) for the ReAct loop and state management.<p>Frontend: React 19, Vite, TailwindCSS, Zustand.<p>Backend: FastAPI (Python 3.10+).<p>Streaming: Uses SSE (Server-Sent Events) for real-time preview (typewriter effect).<p>Rendering Engines: React Flow, Apache ECharts, Mermaid.js, and Draw.io (Atlas theme).<p>Key Features
Draw.io Agent: Generates compatible XML. You can edit the result directly in the canvas.<p>Data Chart Agent: Paste raw data (CSV/JSON/Text), and it visualizes it using ECharts (Bar/Line/Pie).<p>Branching & Time Travel: Since AI isn't perfect, I implemented a Git-like branching system. You can "retry" a message, creating a new branch, or navigate back to previous states to see the agent's thought process.<p>Self-Hosted: Docker Compose support included. Works great with OpenAI or DeepSeek V3 (highly recommended for cost/performance).<p>Links
GitHub (AGPL-3.0): https://github.com/twwch/DeepDiagram<p>It's still in the early stages, but I'd love to hear your feedback or see your PRs!