Diagram Bake-off - review tổng hợp

6 tech x 2 mode (A = LLM-pure / B = skill-assisted) vẽ CÙNG 1 concept NEXA SDLC 22-node. Render thật + codex judge pixel-review độc lập. Mở từng cặp ảnh A|B để so trực tiếp. Mục tiêu: chọn giải pháp diagram tốt nhất cho LLM.

Khuyến nghị cuối (codex judge)

  1. Format LLM author + eval + SoT = Mermaid .mmd (text, diff, round-trip tốt nhất)
  2. Render polished sơ đồ phức tạp = D2 (container + auto-layout, visual #1)
  3. Export tùy chọn = draw.io XML khi human cần sửa tiếp trong diagrams.net
  4. KHÔNG default: Excalidraw / raw HTML-SVG / PlantUML-activity cho lớp 22-node feedback-loop

★ Golden swimlane canvas

RENDER MỚI - golden style Hand-built HTML/SVG theo style golden workflow-canvas-quan-ly-san-xuat (paper/ink/rust, lane theo actor, chip STD/EXT/CUS, gate diamond, feedback dashed). Cùng 22-node NEXA. Đây là HTML/SVG LÀM ĐÚNG TEMPLATE - đẹp hơn hẳn html-svg worker tự bịa layout.
golden-canvas · LLM + golden templatestyle ref
golden swimlane
file: golden-canvas/index.html (data-driven SVG, sửa mảng N/E là đổi sơ đồ)
Vì sao quan trọng: chứng minh raw HTML/SVG KHÔNG xấu cố hữu - vấn đề là LLM tự bịa toạ độ. Cho LLM 1 template golden + layout-engine (lane×col → x,y) thì HTML/SVG ra chất lượng presentation. Đây là hướng cho nexa-design --explain: data (node/edge) + golden renderer, không bắt LLM đặt pixel.

Scorecard (Fid · Vis · Auth · RoundTrip → Avg)

#Tech / modeFidVisAuthRTAvgPixel note
1D2 (skill)99898.75spine sạch, group BA+validator, JP rõ, feedback arc rõ
2draw.io (LLM-pure XML)99778.00routing waypoint tốt nhất, không overlap
3PlantUML (component)85997.75source tốt, render crossing + clip dark section
4Mermaid (skill HTML)97777.50đủ content + legend, vài label truncate
5Mermaid (LLM-pure .mmd)75897.25source chuẩn, visual hẹp/nhỏ
6HTML/SVG (skill)78597.25đẹp nhưng geometry thủ công, thiếu edge (23/26)
7Graphviz DOT (LLM-pure)84897.25strip siêu rộng, label nhỏ - layout trap
8draw.io (skill CLI)75866.50routing đỏ đè spine, label mơ hồ
9HTML/SVG (LLM-pure)76596.75bezier thủ công, label nhỏ, thiếu edge
10Excalidraw (skill)86676.75readable nhưng group-label clip, loop-label đè
11PlantUML (LLM-pure activity)67586.50activity đổi semantic, back-edge thành note
12Excalidraw (LLM-pure)85676.50label trái clip + đè, margin chật

10 thư viện tham khảo thêm (research GitHub, sao thật)

Ngoài 8 giải pháp đã test ở trên, đây là 10 library/tool khác đáng tham khảo cho nhu cầu "LLM vẽ + người sửa + save-as + round-trip eval". Sao GitHub kiểm chứng từ repo (06/2026). Xếp hạng theo độ hợp.

#TênRepoSaoLoạiLLM authorSửa + saveRound-tripLicenseVerdict
1tldrawtldraw/tldraw47.9kcanvas-libJSON shape + API sanitize + llms.txtYes · .tldr JSONCaoMITHợp nhất overall: AI API riêng + canvas sửa + JSON persist
2xyflow / React Flowxyflow/xyflow37.1kcanvas-lib{nodes,edges} JSONYes · toObject() JSONCaoMITTốt nhất cho workflow UI code-owned, JSON tối giản
3bpmn-jsbpmn-io/bpmn-js9.6kcanvas-libBPMN XML / JSON moddleYes · .bpmn XMLTBbpmn.ioChuẩn ngành cho process/swimlane; modeler chín
4GoJSNorthwoodsSoftware/GoJS8.4kcanvas-libJSON model bindingYes · JSON+SVGCao⚠ ProprietaryMạnh nhưng license thương mại = blocker
5JointJSclientIO/joint5.3kcanvas-libJSON {cells}Yes · JSON+SVGCaoMPL-2.0Canvas OSS chắc, ít LLM-native hơn tldraw
6Krokiyuzutech/kroki4.2krender-serviceChọn DSL bất kỳ (D2/...) → 1 APISource DSL là artifactCaoMITGateway render 30+ loại; sửa = sửa text DSL, không canvas
7flowchart-funtone-row/flowchart-fun3.4ktext-DSLDSL indent siêu gọn (A goes to: B)Yes · webapp, export SVGRất caoMITLLM→flowchart dễ nhất, gần-zero lỗi cú pháp
8Cytoscape.jscytoscape/cytoscape.js11.1kcanvas-lib{elements} JSONMột phần (cần plugin sửa)CaoMITTốt cho graph/network; flowchart được, swimlane không sẵn
9mingrammer/diagramsmingrammer/diagrams42.4ktext-DSL (Python)Code Python with Diagram()Không sửa in-browser, PNG tĩnhCao (source)MITHợp generate-rồi-render; thiên infra arch, không swimlane
10Pintorahikerpig/pintora1.3ktext-DSLDSL kiểu Mermaid/PlantUMLYes · live editor, SVGCaoMITMermaid-alt có Activity diagram; community nhỏ = risk

Top pick trong 10 lib này

tldraw hợp nhất: lib duy nhất có AI authoring API chính thức (typed action + sanitize layer + llms.txt) + canvas người sửa + save .tldr JSON + maintain tích cực. Cho process/swimlane chuẩn ngành thì bpmn-js. Cho đường LLM→flowchart nhẹ nhất, gần-zero lỗi cú pháp thì flowchart-fun. Kroki đáng dùng làm render-gateway 1-API cho mọi DSL.

Render thật của từng lib (cùng concept NEXA - để check tận mắt)

7/10 lib render được headless + nomnoml (bonus). 3 lib (tldraw / React Flow / flowchart-fun) cần build/webapp - link live demo để tự thử.

So sánh từng tech đã test (A = LLM-pure · B = skill-assisted)