createMermaidDiagram

See source code

Parse mermaid text and create tldraw shapes for supported diagram types. Returns the SVG string for supported diagrams, or null when the diagram type is unsupported (after calling onUnsupportedDiagram if provided). Throws MermaidDiagramError if parsing fails.

function createMermaidDiagram(
  editor: Editor,
  text: string,
  options?: MermaidDiagramOptions,
): Promise<void>;

Parameters

NameDescription

editor

Editor;

text

string;

options

Returns

Promise<void>;
Prev
useViewportHeight
Next
defaultCreateMermaidNodeFromBlueprint