MAIDR JavaScript API
    Preparing search index...
    • Converts a parsed diagram against its rendered SVG.

      Separate from createMaidrFromMermaid so a caller that already holds the parsed diagram -- or a test with a stand-in database -- need not parse again.

      Parameters

      • diagram: { type: string; db: unknown; text?: string }

        The parsed diagram: its type and database

        • type: string

          The diagram type Mermaid detected

        • db: unknown

          The diagram's database

        • Optionaltext?: string

          The text it was parsed from

      • svg: SVGSVGElement

        The SVG Mermaid rendered from the same text

      • options: MermaidAdapterOptions = {}

        Figure options

      Returns Maidr

      The MAIDR figure

      Error when the diagram type is not one the adapter reads. A diagram of a type it reads but with nothing in it becomes a figure with no layers, which MAIDR announces as empty