MCPcopy Index your code
hub / github.com/excalidraw/mermaid-to-excalidraw

github.com/excalidraw/mermaid-to-excalidraw @v1.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.1.0 ↗ · + Follow
82 symbols 196 edges 34 files 0 documented · 0% 3 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

mermaid-to-excalidraw

Convert mermaid diagrams to excalidraw

Set up

Install packages:

yarn

Start development playground:

yarn start

Build command:

yarn build

Get started

parseMermaidToExcalidraw(diagramDefinition: string, config?: MermaidConfig)

The diagramDefinition is the mermaid diagram definition. and config is the mermaid config. You can use the config param when you want to pass some custom config to mermaid.

Currently mermaid-to-excalidraw only supports the :point_down: config params

{
  /**
   * Whether to start the diagram automatically when the page loads.
   * @default false
   */
  startOnLoad?: boolean;
  /**
   * The flowchart curve style.
   * @default "linear"
   */
  flowchart?: {
    curve?: "linear" | "basis";
  };
  /**
   * Theme variables
   * @default { fontSize: "20px" }
   */
  themeVariables?: {
    fontSize?: string;
  };
  /**
   * Maximum number of edges to be rendered.
   * @default 500
   */
  maxEdges?: number;
  /**
   * Maximum number of characters to be rendered.
   * @default 50000
   */
  maxTextSize?: number;
}

Example code:

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

try {
  const { elements, files } = await parseMermaidToExcalidraw(
    diagramDefinition,
    {
      themeVariables: {
        fontSize: "25px",
      },
    }
  );
  // Render elements and files on Excalidraw
} catch (e) {
  // Parse error, displaying error message to users
}

Playground

Try out here.

API

Head over to the docs.

Support new Diagram type

Head over to the docs.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 56
Interface 20
Enum 3
Class 2
Method 1

Languages

TypeScript100%

Modules by API surface

src/parser/sequence.ts11 symbols
src/parser/class.ts8 symbols
src/interfaces.ts8 symbols
src/parser/flowchart.ts7 symbols
src/utils.ts6 symbols
src/elementSkeleton.ts6 symbols
src/converter/helpers.ts6 symbols
src/converter/transformToExcalidrawSkeleton.ts5 symbols
src/index.ts3 symbols
src/converter/GraphConverter.ts3 symbols
playground/SingleTestCase.tsx3 symbols
playground/MermaidDiagram.tsx3 symbols

For agents

$ claude mcp add mermaid-to-excalidraw \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page