Skip to content
프로젝트

excalidraw/mermaid-to-excalidraw

GitHub에서 보기

소개

Mermaid에서 Excalidraw 다이어그램 생성

디자인 및 미디어

이 수치를 측정하는 방법

What you can do

  • ✏️ Editable result: nodes become shapes, edges become arrows bound to them, labels stay where the layout put them.
  • 📊 Many diagram types: flowcharts (including swimlane-beta), sequence, class, ER and state diagrams, Gantt charts, quadrant charts and timelines. Other types are inserted as an image.
  • 🎨 Styles carry over: style, classDef and class colors, click links, and edges as elbow arrows on request.
  • ⚡ No Mermaid runtime: Pele parses and lays diagrams out without rendering them into the page, and each diagram type's code loads on first use.

측정된 스타 증가

in 24h
+1
in 7 days
+1
in 15 days
+3
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Mermaid to Excalidraw: turn Mermaid diagrams into shapes, arrows and text you can keep editing

Documentation · Playground · npm · Excalidraw+ · Excalidraw

npm license

Convert Mermaid diagram definitions into Excalidraw elements: shapes, arrows and text you can keep editing, not a picture of the diagram. It's what excalidraw.com runs when you paste a Mermaid definition onto the canvas.

Features

  • ✏️ Editable result: nodes become shapes, edges become arrows bound to them, labels stay where the layout put them.
  • 📊 Many diagram types: flowcharts (including swimlane-beta), sequence, class, ER and state diagrams, Gantt charts, quadrant charts and timelines. Other types are inserted as an image.
  • 🎨 Styles carry over: style, classDef and class colors, click links, and edges as elbow arrows on request.
  • ⚡ No Mermaid runtime: Pele parses and lays diagrams out without rendering them into the page, and each diagram type's code loads on first use.

Install

npm install @excalidraw/mermaid-to-excalidraw @excalidraw/excalidraw

It needs DOM APIs (DOMParser), so run it in a browser or with jsdom.

Quick start

import { parseMermaidToExcalidraw } from "@excalidraw/mermaid-to-excalidraw";
import { convertToExcalidrawElements } from "@excalidraw/excalidraw";

const definition = `flowchart LR
  A[Write the definition] --> B{Valid?}
  B -->|yes| C[Excalidraw elements]
  B -->|no| D[Parse error]`;

try {
  const { elements, files } = await parseMermaidToExcalidraw(definition, {
    elbow: true, // optional: draw edges as elbow arrows
  });

  excalidrawAPI.updateScene({
    elements: convertToExcalidrawElements(elements),
  });
  if (files) {
    excalidrawAPI.addFiles(Object.values(files));
  }
} catch (error) {
  // Not valid Mermaid syntax: show the error to the user
}

No code needed? The Excalidraw CLI runs it from your terminal: npx @excalidraw/cli mermaid flow.mmd --out flow.excalidraw.

Documentation

📚 plus.excalidraw.com/docs/mermaid-to-excalidraw

What changed in each release is in the changelog.

Contributing

See CONTRIBUTING.md for running the playground and the tests.

License

MIT

관련 프로젝트 살펴보기

불러오는 중…