MCPcopy Index your code
hub / github.com/mermaid-js/mermaid-live-editor

github.com/mermaid-js/mermaid-live-editor @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
177 symbols 449 edges 63 files 1 documented · 1% 33 cross-repo links updated 1d ago★ 6,66375 open issues

Browse by type

Functions 148 Types & classes 29
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Join our Discord! Netlify Status

Mermaid Live Editor

Edit, preview and share mermaid charts/diagrams.

Features

  • Edit and preview flowcharts, sequence diagrams, gantt diagrams in real time.
  • Save the result as a svg
  • Get a link to a viewer of the diagram so that you can share it with others.
  • Get a link to edit the diagram so that someone else can tweak it and send a new link back

Live demo

You can try out a live version.

Contributors are welcome!

If you want to speed up the progress for mermaid-live-editor, join the Discord channel and contact knsv.

Docker

Run published image

docker run --platform linux/amd64 --publish 8000:8080 ghcr.io/mermaid-js/mermaid-live-editor

The published docker image is built using our default environment variables. You cannot override them when running the image. If you need to customize them, you will need to build the image yourself.

To configure renderer URL

When building set the MERMAID_RENDERER_URL build argument to the rendering service. Example: Default ishttps://mermaid.ink. Set to empty string to disable PNG and SVG links under Actions

To configure Kroki Instance URL

When building set the MERMAID_KROKI_RENDERER_URL build argument to your Kroki instance. Default is https://kroki.io Set to empty string to disable Kroki link under Actions

To configure Analytics

When building set the MERMAID_ANALYTICS_URL build argument to your plausible instance, and MERMAID_DOMAIN to your domain.

Default is empty, disabling analytics.

To enable Mermaid Chart links and promotion

When building set the MERMAID_IS_ENABLED_MERMAID_CHART_LINKS build argument to true

Default is empty, disabling button to save to Mermaid Chart and promotional banner.

To update the Security modal

The modal shown on clicking the security link assumes analytics, renderer, Kroki and Mermaid chart are enabled. You can update it by modifying Privacy.svelte if you wish.

Development

docker compose up --build

Then open http://localhost:3000

Building and running images locally

Build

docker build -t mermaid-js/mermaid-live-editor .

Run

docker run --detach --name mermaid-live-editor --publish 8080:8080 mermaid-js/mermaid-live-editor

Visit: http://localhost:8080

Stop

docker stop mermaid-live-editor

Setup

Below link will help you making a copy of the repository in your local system.

https://docs.github.com/en/get-started/quickstart/fork-a-repo

Requirements

  • Node.js current LTS version
  • pnpm package manager. Install with corepack enable pnpm

Development

pnpm install
pnpm dev -- --open

This app is created with Svelte Kit.

Release

When a PR is created targeting master, it will be built and deployed by Netlify. The URL will be indicated in a Comment in the PR.

Once the PR is merged, it will automatically be released.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 115
Method 33
Interface 23
Class 6

Languages

TypeScript100%

Modules by API surface

tests/test.ts21 symbols
src/lib/components/History/historyState.svelte.ts20 symbols
src/lib/util/state.svelte.ts16 symbols
src/lib/util/util.ts14 symbols
src/lib/util/panZoom.ts11 symbols
src/lib/types.d.ts10 symbols
src/lib/util/stats.ts8 symbols
src/lib/util/fileLoaders/gist.ts8 symbols
src/lib/util/migration/domainMigration.ts7 symbols
src/lib/util/AIPromptViewZoneManager.ts7 symbols
src/lib/util/persist.svelte.ts6 symbols
src/lib/components/migration/editorChooserActions.ts6 symbols

Dependencies from manifests, versioned

@codemirror/lang-json6.0.2 · 1×
@codemirror/lang-markdown6.5.0 · 1×
@codemirror/lang-yaml6.1.3 · 1×
@codemirror/state6.6.0 · 1×
@codemirror/view6.43.1 · 1×
@eslint/compat2.1.0 · 1×
@eslint/eslintrc3.3.5 · 1×
@eslint/js10.0.1 · 1×
@fortawesome/fontawesome-free7.2.0 · 1×
@fsegurai/codemirror-theme-vscode-dark6.2.6 · 1×

For agents

$ claude mcp add mermaid-live-editor \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page