Import an existing source

Keep the source. Redraw with ai-diagrams.

Start from Mermaid, BPMN XML, DDL, CSV or YAML. These examples are converted into the engine's native formats and rendered by its existing generators.

Mermaid flowchart

Parser and native source tests passed. Browser layout validation passed.

Import commandbash
npx ai-diagrams import examples/import/en/flowchart.mmd --out diagrams/flowchart --lang en
examples/import/en/flowchart.mmdmermaid
flowchart LR
A((Request)) --> B[Check order]
B --> C{Available?}
C -->|Yes| D[Reserve]
C -->|No| E[Reject]
D --> F((Completed))
E --> F

Generated by the ai-diagrams engine

examples/import/en/output/flowchart/flowchart.html

Unsupported syntax returns an error with its location. The importer keeps the engine's native source, then runs the regular generator and gate.

From file to checked diagram

The layout is rebuilt by the engine; original drawing coordinates are not preserved.

A Mermaid flowchart becomes BPMN. A flowchart with subgraph lanes becomes swimlanes. DDL can also produce a schema dependency matrix with --type matrix.

DDL to dependency matrixbash
npx ai-diagrams import examples/import/en/schema.sql --type matrix --out diagrams/matrix --lang en

Source and package

Made by Vinícius Coimbra

GitHub

ai-diagrams

Source, examples and issue tracking. MIT license.

Open repository ↗MIT license

npm

ai-diagrams

Published on npm. Zero npm dependencies.

npx ai-diagrams install --claudeOpen on npm ↗
Made by Vinícius Coimbra