diff options
| author | kj_sh604 | 2026-03-15 16:19:35 -0400 |
|---|---|---|
| committer | kj_sh604 | 2026-03-15 16:19:35 -0400 |
| commit | bc297e5e496d9f48ef77581b7fb41fdf328a62cf (patch) | |
| tree | 66192466eef76ee4c5cf71a9788ae9fe947514d4 /dev-docs/docs/@excalidraw/mermaid-to-excalidraw/installation.mdx | |
| parent | f6538b8f1a78a7d72a41916ac79376f8c2d30193 (diff) | |
refactor: dev-docs/
Diffstat (limited to 'dev-docs/docs/@excalidraw/mermaid-to-excalidraw/installation.mdx')
| -rw-r--r-- | dev-docs/docs/@excalidraw/mermaid-to-excalidraw/installation.mdx | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/dev-docs/docs/@excalidraw/mermaid-to-excalidraw/installation.mdx b/dev-docs/docs/@excalidraw/mermaid-to-excalidraw/installation.mdx new file mode 100644 index 0000000..1860fdf --- /dev/null +++ b/dev-docs/docs/@excalidraw/mermaid-to-excalidraw/installation.mdx @@ -0,0 +1,42 @@ +# Installation + +`@excalidraw/mermaid-to-excalidraw` is published to npm. This library is used in [excalidraw](https://excalidraw.com) to transform mermaid syntax to Excalidraw diagrams. + +Using `npm` + +```bash +npm install @excalidraw/mermaid-to-excalidraw +``` + +Using `yarn` + +```bash +yarn add @excalidraw/mermaid-to-excalidraw +``` + +## Usage + +Once the library is installed, its ready to use. + +```js +import { parseMermaidToExcalidraw } from "@excalidraw/mermaid-to-excalidraw"; +import { convertToExcalidrawElements} from "@excalidraw/excalidraw" + +try { + const { elements, files } = await parseMermaid(diagramDefinition, { + fontSize: DEFAULT_FONT_SIZE, + }); + // currently the elements returned from the parser are in a "skeleton" format + // which we need to convert to fully qualified excalidraw elements first + const excalidrawElements = convertToExcalidrawElements(elements); + + // Render elements and files on Excalidraw +} catch (e) { + // Error handling +} +``` + +## Playground + + Try it out [here](https://mermaid-to-excalidraw.vercel.app) + |
