Skip to content
CAI
Software that uses CAICheck a score

mermaid-js/mermaid

49.1

Weak · 14 November 2026

123.6k

lines of production code

TypeScript

with JavaScript

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add ABNF front-end for railroad diagrams

This change introduces a new parser front-end for ABNF-based railroad diagrams within the parser package. It adds a Langium grammar definition (\railroad-abnf.langium\) that parses ABNF rule definitions, including support for titles, accessibility metadata, and standard ABNF syntax elements like strings, numbers, and groups. The implementation includes a custom token builder and value converter to handle specific formatting requirements, such as stripping quotes from titles and string literals. This enables the system to process and render ABNF syntax as visual railroad diagrams.

packages/parser/src/language/railroad-abnf, packages/parser/src/language/railroad-ebnf, packages/parser/src/language/railroad-peg · high confidence

Add Cynefin framework diagram support

The parser now supports the Cynefin framework diagram type. Users can define diagrams using the 'cynefin-beta' keyword, specifying domain blocks (complex, complicated, clear, chaotic, confusion) with items, and transitions between domains. This adds a new language definition, module, and token builder to the parser's language capabilities.

packages/parser/src/language/cynefin · high confidence

Add Cynefin framework diagram type

Users can now create Cynefin framework diagrams by starting a diagram with \cynefin-beta\. This new diagram type supports five domains (complex, complicated, clear, chaotic, and confusion) with items, labeled transitions between domains, and accessibility metadata (title, description). The renderer displays domain backgrounds, wavy boundaries, a central confusion ellipse, and a 'cliff' boundary, with styling driven by the current theme. Boundary waviness is deterministic via a configurable seed to ensure reproducible renders.

packages/mermaid/src/diagrams/cynefin · high confidence

Add Info diagram to render Mermaid version

The Info diagram is now available, allowing users to display the current Mermaid version in their diagrams. This new diagram type includes a parser, renderer, and database module that outputs the version string (e.g., 'v1.0.0') centered in an SVG element. The implementation supports basic 'info' and 'info showInfo' syntaxes, while rejecting unsupported grammar with clear lexer error messages.

packages/mermaid/src/diagrams/info · high confidence

Add Ishikawa (fishbone) diagram support

Mermaid now supports creating Ishikawa (fishbone) diagrams using the \ishikawa\ or \ishikawa-beta\ keyword. This new diagram type allows users to define a root effect and hierarchical causes using indentation, with the renderer automatically handling layout, padding, and arrow markers. The implementation includes a dedicated parser, database layer for hierarchy management, and a renderer that supports both standard and hand-drawn visual styles.

packages/mermaid/src/diagrams/ishikawa · high confidence

Add Jison grammar linting script

A new linting script has been added to the project to validate Jison grammar files. This tool scans all \.jison\ files within the packages directory, compiles them into JavaScript using the Jison generator, and runs ESLint on the generated code to catch syntax or style errors. Additionally, it checks for parser conflicts within the grammar definitions, ensuring that the generated parsers are valid and conflict-free.

scripts/jison · high confidence

Add Langium-based railroad diagram parser

Introduces a new parser for railroad diagrams within the parser package, built on Langium. This adds a dedicated grammar (railroad.langium) and supporting services (token builder, value converter) to parse a specific 'railroad-beta' syntax that uses function-call style expressions (e.g., 'sequence', 'choice') rather than EBNF. The parser handles specific terminals for titles and accessibility metadata, and includes logic to decode escaped strings in titles and values.

packages/parser/src/language/railroad · high confidence

Add Railroad diagram support with EBNF, ABNF, and PEG front-ends

Users can now visualize grammar rules as railroad diagrams using three distinct input syntaxes: the generic \railroad-beta\ keyword, \railroad-ebnf-beta\ for Extended Backus-Naur Form, \railroad-abnf-beta\ for Augmented Backus-Naur Form, and \railroad-peg-beta\ for Parsing Expression Grammar. This change introduces the core infrastructure for this feature within the railroad module, including the database layer with input sanitization to prevent XSS, a renderer that correctly handles SVG viewboxes and choice/loop orientations, and a theming system that derives diagram colors from the active Mermaid theme while allowing granular style overrides.

packages/mermaid/src/diagrams/railroad · high confidence

Add Wardley Maps diagram type (beta)

Introduces a new Wardley Maps diagram type, accessible via the \wardley-beta\ identifier, allowing users to visualize strategic evolution on axes of visibility and evolution. This feature includes a Langium-based parser supporting components, links, pipelines, annotations, notes, and custom evolution stages, along with a renderer that respects theme variables and configurable dimensions.

packages/mermaid/src/diagrams/wardley · high confidence

Add example-diagram as a lazy-loaded template diagram

Introduces a new 'example-diagram' type that users can render by starting their definition with \example-diagram\. This diagram is implemented as a lazy-loaded plugin (detector, loader, parser, renderer, and styles) and serves as a structural template for creating new diagram types within Mermaid. It includes a basic renderer that draws colored sections and a version label, along with the necessary database and utility injection infrastructure.

packages/mermaid-example-diagram/src · high confidence

Add explicit flowchart-elk diagram type

Users can now explicitly request the ELK layout engine for flowcharts by using the \flowchart-elk\ keyword in their diagram code. This new diagram type automatically configures the layout to use ELK, providing a distinct alternative to the default flowchart renderer without requiring manual configuration changes.

packages/mermaid/src/diagrams/flowchart/elk · high confidence

Add parser support for Pie charts

Introduces a new parser for the Pie chart language, including the grammar definition, a custom token builder, and a value converter that trims quotes from section labels. This enables the application to parse and understand Pie chart syntax.

packages/parser/src/language/pie · high confidence

Add parser support for Radar chart syntax

Users can now define Radar charts using a new grammar (radar.langium) that supports axes, curves with numeric or detailed entries, and configuration options such as legend visibility, tick counts, min/max values, and graticule style. This change introduces the necessary Langium v4 services, token builder, and module wiring in the parser package to enable parsing of this new chart type.

packages/parser/src/language/radar · high confidence

Add parser support for Treemap diagrams

The parser now supports the Treemap diagram type, allowing users to define hierarchical visualizations using the 'treemap' or 'treemap-beta' keywords. This change introduces a new grammar that handles indentation-based nesting, numeric values for sizing, and optional metadata including titles and accessibility descriptions (accTitle, accDescr). It also supports class definitions (classDef) to apply custom styling to nodes. The implementation includes a validator that enforces a single root node structure and ensures proper indentation hierarchy.

packages/parser/src/language/packet, packages/parser/src/language/treemap · high confidence

Add parser support for the Info language

Introduces a new parser for the 'info' language, defined by the \InfoGrammar\ in \info.langium\. This grammar recognizes an entry point starting with the 'info' keyword, optionally followed by 'showInfo' and a title with accessibilities. The implementation includes a dedicated \InfoTokenBuilder\ to handle tokenization for 'info' and 'showInfo' keywords, and a \module.ts\ file that wires these services into the Langium framework, making the parser available for use.

packages/parser/src/language/info · high confidence

Add quadrant chart diagram support

Mermaid now supports rendering quadrant charts, allowing users to visualize data points across four quadrants with customizable axes, titles, and point styling. This new diagram type includes a parser, database layer for state management, and a renderer that draws quadrants, axis labels, and data points using D3. Configuration options allow control over chart dimensions, axis visibility, padding, and font sizes, while style validation ensures valid inputs for point colors, radii, and stroke properties.

packages/mermaid-zenuml/src, packages/mermaid/src/diagrams/quadrant-chart · high confidence

Add radar chart diagram support

Users can now create radar charts using the \radar-beta\ syntax. This new diagram type supports defining multiple axes and curves, with options to customize the number of ticks, min/max values, legend visibility, and graticule shape (circle or polygon). The implementation includes a database layer for state management, a parser for the new syntax, a renderer that draws the chart with proper axis label alignment to prevent clipping, and styling support that integrates with the existing theme system.

packages/mermaid/src/diagrams/radar · high confidence

Added GitGraph language support to the parser

The parser now includes a new language definition for GitGraph diagrams. This change introduces the Langium grammar (gitGraph.langium) and supporting TypeScript modules (module.ts, tokenBuilder.ts, reference.langium) required to parse GitGraph syntax, including commits, branches, merges, checkouts, and cherry-picks with specified directions and attributes.

packages/parser/src/language/gitGraph · high confidence

Block diagram now supports composite color theming and runtime configuration

The block diagram implementation has been refactored to support nested composite blocks with distinct color theming, mirroring the flowchart's subgraph behavior. Composites are now assigned sequential palette slots (via \colorIndex\) and styled using \data-color-id\ attributes, allowing themes with color arrays to apply alternating borders and fills to nested groups. Additionally, the diagram now reads configuration values (such as padding) at call time rather than module load time, ensuring that dynamic config changes are respected during rendering. The diagram is also registered under the stable 'block' ID, removing the previous 'beta' suffix.

packages/mermaid/src/diagrams/block · high confidence

Block diagram parser now supports compound blocks, styled edges, and class definitions

The block diagram parser has been updated to support more complex diagram structures. Users can now define compound blocks (nested blocks with IDs, titles, and types), apply styling via classDef and style statements, and create directed edges with labels and specific directions (left, right, up, down, x, y). The parser also handles column-based layouts, sanitizes node labels using the current DOMPurify configuration, and allows equal signs in node IDs.

packages/mermaid/src/diagrams/block/parser · high confidence

Dev Explorer now supports Mermaid syntax highlighting, version comparison, and performance profiling

The Dev Explorer has been rebuilt with a new code editor that provides syntax highlighting for Mermaid diagrams, a Compare tab that renders diagrams side-by-side across different Mermaid versions with a pixel-diff overlay, and a Console panel with optimized log rendering. It also includes a Profiler view that breaks down render times by phase (parse, layout, paint) and distinguishes between external library and wrapper execution time, along with benchmarking capabilities for diagram sets.

.esbuild/dev-explorer · high confidence

ELK layout engine bundled and set as the default

The ELK layout engine is now bundled with Mermaid and used as the default layout algorithm for diagrams. This replaces the previous default (Dagre) and introduces new layout capabilities, including improved cycle breaking for nested containers, better handling of cardinality labels and edge routing, and support for additional ELK algorithms (stress, force, mrtree, sporeOverlap, box, rectpacking). Users will see changes in diagram rendering, particularly in how subgraphs, edges, and labels are positioned.

packages/mermaid/src/rendering-util/layout-algorithms/elk · high confidence

ER diagram parser rewritten with new syntax features

The ER diagram parser has been replaced with a new Jison-based implementation (erDiagram.jison) that expands the supported syntax. Users can now define entity aliases using square brackets (e.g., \Entity\[Alias\]\), group entities into logical domains using \subgraph\ blocks, and apply CSS classes to entities using the \:::\ separator. The parser also supports more flexible entity and attribute naming, including leading underscores, backtick-escaped names, and various special characters when quoted. Cardinality constraints are now recognized through multiple aliases (e.g., \1+\, \0+\, \one or more\) and the parser handles relationships between subgraphs and external entities.

packages/mermaid/src/diagrams/er/parser · high confidence

ER diagrams now support subgraphs for grouping entities

ER diagrams now support subgraphs, allowing you to group entities into logical domains. The \ErDB\ data model has been updated to track subgraph membership, ensuring that nodes are correctly assigned to their parent groups and that relationships can connect to subgraph boundaries. The unified renderer (\erRenderer-unified\) and styles (\styles.ts\) have been adjusted to render these nested clusters with proper visual hierarchy, including correct paint order so that edges appear above cluster backgrounds. Also in this area: 14 commits (6 fixes) modifying packages/mermaid/src.

packages/mermaid/src/diagrams/er · medium confidence · unverified

Event Modeling DSL parser and validation

The parser now supports the Event Modeling DSL, allowing users to define frames (timeframes and reset frames) with specific entity types (commands, events, read models, processors, UI) and enforce connection invariants. A new Langium grammar defines the syntax, including support for multiple source frames and reset relations, while a validator ensures that frames only connect to allowed source types (e.g., commands can only receive from UI or processors), providing immediate feedback on invalid model structures.

packages/parser/src/language/eventmodeling · high confidence

Expanded demo pages for architecture, block, C4, class, ER, and flowchart diagrams

The demos directory now includes dedicated HTML pages for several diagram types, providing users with concrete examples of syntax and rendering. The new architecture.html page demonstrates the architecture-beta syntax, including nested groups, split-direction edges, junction nodes, and edge labels. The block.html page showcases block diagram features such as node shapes, styling, and column layouts. The c4context.html page provides examples for C4 diagrams (Context, Container, Component, Dynamic, and Deployment), including accessibility attributes and relationship styling. The classchart.html page illustrates class diagram capabilities, including generic types, namespaces, and inheritance. The er.html and er-multiline.html pages demonstrate entity-relationship diagram syntax, supporting complex attribute definitions, multi-line labels, and special characters. Additionally, new pages for dataflowchart.html, eventmodeling.html, flowchart-elk.html, and flowchart\_expanded\_node\_shapes.html offer examples for data flow diagrams, event modeling, ELK-based flowchart layout, and expanded node shapes respectively.

demos · high confidence

Expanded developer diagram fixtures for agentflow, sequence, state, and xychart

The dev-explorer now includes a comprehensive set of new diagram fixtures to validate rendering and support theme development. The \agentflow\ directory adds 15 examples covering the \agentflow-beta\ syntax, including node shapes, containers (with collapsed views), global-scoped nodes, connectors, and input-value patterns. The \sequence-fixes\ directory provides six diagrams testing actor types, note positioning, rect backgrounds, and loop/label rendering. Additionally, \state-diagram\ adds 11 examples for both \stateDiagram\ and \stateDiagram-v2\ (including fork/join and composite states), while \xychart\ adds two examples for title and legend scaling. These files serve as the working set for the \redux-color\ and \neo\ theme work.

e2e/platform/dev-diagrams/diagrams · high confidence

Expanded example library with new diagram types and syntax updates

The examples package now includes dedicated example files for a wide range of diagram types, including Architecture, Block, C4, Class, Cynefin, ER, Event Modeling, Gantt, Git Graph, Ishikawa, Kanban, Mindmap, Packet, Pie, Quadrant Chart, Radar, Requirement, Sankey, Sequence, State, Timeline, Tree View, Treemap, Use Case, User Journey, Venn, Wardley Maps, and XY Chart. Several diagram types have been updated to use beta syntax variants (e.g., \architecture-beta\, \cynefin-beta\, \railroad-beta\, \wardley-beta\, \treeView-beta\, \venn-beta\, \xychart-beta\, \radar-beta\, \sankey-beta\, \ishikawa-beta\, \usecase-beta\). New diagram types introduced include Cynefin, Ishikawa, Packet, Quadrant Chart, Radar, Requirement, Treemap, Use Case, and Venn. The Tree View examples now demonstrate icon support via configuration maps and annotations. The Kanban example has been updated to point to the Mermaid repository for its ticket base URL. The Git Graph examples now use stable commit IDs.

packages/examples/src/examples · high confidence

Initial Venn diagram parser implementation

Adds the initial parser for Venn diagrams (\venn.jison\), enabling users to define sets, unions, text nodes, and styles using a syntax similar to Flowcharts. The parser supports defining sets with optional labels and sizes, creating unions of multiple sets, adding text annotations to specific regions, and applying visual styles (fill, color, RGB/RGBA) to sets and text nodes.

packages/mermaid/src/diagrams/venn/parser · high confidence

Initial support for Architecture diagrams

Mermaid now supports a new Architecture diagram type, identified by the \architecture-beta\ keyword. This feature introduces a dedicated data model (ArchitectureDB) for managing services, groups, and junctions, along with a parser that populates this model from the diagram definition. The renderer utilizes Cytoscape with the fcose layout engine to position elements, supporting features such as nested groups, directional edge connections (L, R, T, B), edge labels, and configurable layout parameters like node separation and edge elasticity. The implementation includes specific handling for deterministic layouts via seeded randomization, accessibility titles and descriptions, and dedicated SVG icons for common infrastructure components like databases, servers, and clouds.

packages/mermaid/src/diagrams/architecture · high confidence

Introduce Dev Explorer with multi-version comparison and dark theme

The Dev Explorer is now available at the public entry point, featuring a new Compare tab that allows users to render and visually diff Mermaid diagrams across different library versions side-by-side. The interface utilizes a dark theme with a dedicated canvas, supports ELK layout loading, and handles icon rendering via Font Awesome and Iconify packs to ensure consistent visualization across versions.

.esbuild/dev-explorer/public · high confidence

Introduce Event Modeling diagram type

Adds a new Event Modeling diagram type to Mermaid, enabling users to visualize event-driven architectures with namespaces, swimlanes, and data entities. The implementation includes a dedicated parser for the Event Modeling DSL, a data store (db.ts) that handles frame positioning, swimlane grouping by namespace, and relation inference (including support for reset frames and multiple source frames), and a renderer that draws boxes, swimlanes, and directional relations using D3. The feature also includes unit tests for parsing, duplicate ID rejection, and relation preservation, along with a diagram detector and loader for integration.

packages/mermaid/src/diagrams/eventmodeling · high confidence

Introduce Treemap diagram support

Mermaid now supports rendering treemap diagrams. Users can define hierarchical data using the \treemap\ keyword, with support for nested sections, leaf nodes with numeric values, and custom styling via \classDef\. The implementation includes a dedicated database (\TreeMapDB\) for state management, a parser that builds a hierarchical structure from flat input, and a D3-based renderer that handles layout, padding, and theme-aware styling (including dark mode readability). Configuration options allow control over padding, node dimensions, and value formatting.

packages/mermaid/src/diagrams/treemap, packages/mermaid/src/diagrams/venn · high confidence

Introduce bidirectional tidy-tree layout for tree diagrams

A new \mermaid-layout-tidy-tree\ package has been added, providing a bidirectional tidy-tree layout algorithm. This layout positions nodes in a symmetric, balanced structure by splitting children into left and right trees that grow horizontally in opposite directions from a central root, making it suitable for mindmaps and organizational charts. The package includes the layout logic, rendering implementation, and type definitions, and is registered as a separate layout loader.

packages/mermaid-layout-tidy-tree/src · high confidence

Introduce common layout renderer infrastructure

Added a new common layout rendering framework in the \common\ layout algorithms module, providing a standardized interface for layout algorithms to prepare, measure, run core logic, and paint results. This includes the \createCommonLayoutRenderer\ factory, supporting types for render and paint contexts, and a comprehensive test suite to verify the rendering pipeline. This change establishes the foundation for refactoring existing layout algorithms (like Dagre and ELK) to use this shared rendering path, improving consistency and maintainability of the diagram rendering process.

packages/mermaid/src/rendering-util/layout-algorithms/common · high confidence

Introduce new pie chart diagram

Mermaid now supports pie charts. Users can create pie charts using the \pie\ keyword, with support for titles, accessibility attributes, and data labels. The implementation includes configuration options for legend position, inner hole (donut style), and slice highlighting on hover. The renderer preserves the input order of slices and maintains consistent colors even when small slices are filtered out. Negative values are rejected with a clear error message, and slices representing less than 1% of the total are hidden to prevent rendering issues.

packages/mermaid/src/diagrams/pie · high confidence

Introduce packet diagram for visualizing bit-level data structures

Users can now create packet diagrams to visualize bit-level data structures, such as network packet headers or hardware register maps. The diagram supports defining fields by bit ranges (e.g., \0-7: "DATA"\) or by count (e.g., \+8: "byte"\), and automatically wraps fields into rows based on a configurable \bitsPerRow\. Rendering options include \showBits\ to display bit indices and \bitOrder\ to control whether bits are numbered ascending (0 to N) or descending (N to 0). The diagram also supports titles and accessibility attributes.

packages/mermaid/src/diagrams/packet · high confidence

Introduce standalone local Mermaid diagram editor

A new local editor package is available that allows users to create, edit, and preview Mermaid diagrams entirely offline. The editor runs from the dist directory with no external CDN dependencies, bundling Mermaid and DOMPurify locally. It provides a split-pane interface with a source text area and an SVG preview, supporting features such as saving and loading multiple diagrams via localStorage, keyboard-based node navigation, zooming and panning, and exporting diagrams as SVG files.

packages/mermaid-local-editor · high confidence

Introduce standalone swimlane diagram with theme-aware styling

Mermaid now supports a dedicated swimlane diagram type (detected via the \swimlane-beta\ keyword) that reuses the flowchart parser and renderer but applies a swimlane-specific layout engine and CSS styling. The new implementation includes a dedicated styles module that adapts lane borders and fills to the active color theme (including specific handling for Redux color themes and hand-drawn looks) and ensures lane palette rules do not conflict with generic cluster styles. Tests verify that the swimlane layout is the default for this diagram type while respecting global or diagram-scoped layout overrides.

packages/mermaid/src/diagrams/swimlanes · high confidence

New Jison parser for xychart diagrams

The xychart diagram type now uses a dedicated Jison grammar file (xychart.jison) to parse Mermaid syntax, replacing previous ad-hoc parsing. This parser supports chart orientation (vertical/horizontal), diagram titles, and accessibility metadata (accTitle, accDescr). It handles x-axis and y-axis definitions, including optional axis titles, numeric ranges (e.g., 45.5 --\> 33), and categorical bands (e.g., \[cat1, cat2\]). It also parses line and bar data points, which consist of numeric values and optional text labels. The implementation includes comprehensive unit tests verifying the parsing of these various syntax elements.

packages/mermaid/src/diagrams/xychart/parser · high confidence

New Kanban diagram support

Mermaid now supports Kanban diagrams. Users can define a board using the \kanban\ keyword, organizing tasks into hierarchical sections and items. The implementation includes a JISON parser, a database layer for managing nodes and sections, and a renderer that draws sections as clusters and items as nodes. The diagram supports styling via CSS classes, icons, and YAML-based metadata for properties like assigned users, priority, and ticket IDs.

packages/mermaid/src/diagrams/kanban · high confidence

New Sankey diagram support with customizable styling and layout

Mermaid now supports Sankey diagrams, allowing users to visualize flows between nodes with configurable node widths, padding, and alignment (left, right, center, justify). The implementation includes smart label positioning, custom node colors, and value display options with configurable prefixes and suffixes. Users can also control the visual style of labels (legacy or outlined) and benefit from improved text parsing that handles whitespace and empty lines more robustly.

packages/mermaid/src/diagrams/sankey · high confidence

New agentflow-beta diagram type with semantic model and diagnostics

Mermaid now supports a new \agentflow-beta\ diagram type, detected by the \agentflow-beta\ keyword. This diagram type includes a dedicated semantic model (\getSemanticModel\) that exposes vertices, edges, subgraphs, and connectors while stripping presentation-only metadata (such as icons, images, and styling) to provide a clean data representation for downstream tooling. It also features a structured diagnostics system (\emitWarning\, \emitError\, \getDiagnostics\) that reports issues like unsupported shapes or prototype pollution attempts directly from the parser, enabling better error reporting in editor integrations. The implementation uses a JISON parser to maintain syntax parity with flowchart while supporting agentflow-specific features like connectors and domain-specific shapes.

packages/mermaid/src/diagrams/agentflow · high confidence

New axis component architecture for X/Y charts

The X/Y chart builder now uses a dedicated axis component system located in \packages/mermaid/src/diagrams/xychart/chartBuilder/components/axis\. This introduces a \BaseAxis\ abstract class that handles space calculation, label rotation, and padding for both vertical and horizontal orientations. Two concrete implementations are provided: \BandAxis\ for categorical data using d3's \scaleBand\, and \LinearAxis\ for numerical data using d3's \scaleLinear\. The \index.ts\ file exports a factory function \getAxis\ that instantiates the correct axis type based on the data configuration, enabling more robust rendering of axes with configurable labels, ticks, and titles.

packages/mermaid/src/diagrams/xychart/chartBuilder/components/axis · high confidence

New cose-bilkent layout algorithm for mindmaps

A new layout algorithm implementation using Cytoscape with the cose-bilkent algorithm has been added to the mindmap rendering pipeline. This change introduces a new rendering flow where nodes are first inserted into the DOM to calculate actual dimensions, then the cose-bilkent algorithm calculates optimal positions, and finally nodes and edges are positioned based on the layout results. The implementation includes helper functions for creating Cytoscape instances, adding nodes and edges, extracting positioned elements, and validating layout data. Unit tests have been added to verify the Cytoscape setup, layout execution, and data validation logic.

packages/mermaid/src/rendering-util/layout-algorithms/cose-bilkent · high confidence

New development playground and architecture randomization demo

The development environment now includes a live-editing playground (demos/dev/example.html) that allows users to type Mermaid code and see the rendered diagram, errors, and render time in real-time, with layout support via the ELK layout engine. Additionally, a new architecture diagram demo (demos/dev/architecture-randomize.html) has been added to test layout randomization behavior, and a live-reload script (demos/dev/reload.js) has been introduced to automatically refresh the page when source files change.

demos/dev · high confidence

New documentation and configuration type generation scripts

The \packages/mermaid/scripts\ directory now includes new tooling to automate documentation and configuration type generation. \create-types-from-json-schema.mts\ generates the \MermaidConfig\ TypeScript definitions from the JSON schema, ensuring type safety and consistency. \docs.mts\ and \docs.cli.mts\ handle the transformation of documentation source files, including building shape documentation tables and managing version placeholders. Additionally, \update-release-version.mts\ automates the replacement of version placeholders in documentation, and \loadHook.mjs\ provides a Node.js load hook to handle schema imports. Tests have been added to verify the documentation build order and transformation logic.

packages/mermaid/scripts · high confidence

New mindmap diagram parser implementation

Added a new Jison-based parser for the mindmap diagram type, enabling the rendering of mindmaps with support for various node shapes (clouds, explosions, etc.), icons, and class styling. This change introduces the core parsing logic required to interpret mindmap syntax, including handling of node descriptions and structural elements.

packages/mermaid/src/diagrams/mindmap/parser · high confidence

New modular XY chart builder with theme-aware layout and scaled text measurement

The XY chart rendering logic has been restructured into a new \chartBuilder\ module that orchestrates the layout of chart components (title, axes, legend, and plots) and applies theme configurations for colors and fonts. This change introduces support for both vertical and horizontal chart orientations, allowing users to rotate the layout of their XY charts. Additionally, text dimensions are now measured in SVG user units, ensuring that labels and titles scale correctly when the chart is resized to fit its container, and the builder supports configurable themes for axis lines, ticks, labels, and data point colors.

packages/mermaid/src/diagrams/xychart/chartBuilder · high confidence

New plot rendering components for bar and line charts with horizontal orientation support

The xychart builder now includes dedicated components for rendering bar and line plots, introducing support for horizontal chart orientations. The new BarPlot component draws rectangular bars based on axis scales and orientation, while the LinePlot component uses D3 to generate paths and supports per-point text labels. The BasePlot orchestrator manages these plot types, allowing users to create bar and line charts that can be oriented horizontally or vertically.

packages/mermaid/src/diagrams/xychart/chartBuilder/components/plot · high confidence

New rendering engine introduces dozens of new shapes and unified styling

The rendering engine in this location has been rewritten to support a new 'look' system (including 'handDrawn' and 'neo' styles) and introduces a wide array of new node shapes such as anchor, bang, blockArrow, bowTieRect, browser, bucket, card, choice, cloud, and collapsedGroup. This update also adds specialized label handling for C4 diagrams via \c4LabelHelper\ and implements specific intersection logic for the new geometries, allowing users to create diagrams with these new visual styles and node types.

packages/mermaid/src/rendering-util/rendering-elements/shapes · high confidence

New scripts for scoped e2e testing, screenshot compositing, and build tooling

This change introduces a suite of new scripts to the \scripts/\ directory to support the migration from Cypress to Playwright and improve build workflows. \e2e-diagram-scope.mjs\ and \e2e-tier-scope.mjs\ enable CI to run only the relevant Playwright e2e specs based on changed source files or test tiers, while \run-e2e-scoped.ts\ provides a local development runner for this scoped execution. Screenshot handling is updated with \screenshot-sheets.ts\ and \screenshot-order.ts\ to batch Playwright screenshots into composite sheets for Argos upload, and \argos-upload-sheets.ts\ manages the upload process with metadata verification. Build and maintenance tooling includes \editor.bash\ for building the live editor, \coverage.ts\ for merging test coverage, \fixCSpell.ts\ for sorting spell-check dictionaries, \size.ts\ for bundle size diffing, \swimlanes-size.ts\ for layout algorithm size analysis, and \tsc-check.ts\ for verifying out-of-tree TypeScript compatibility. A new test \codemirror-dedupe.spec.ts\ ensures CodeMirror dependencies are not duplicated in the lockfile.

scripts · high confidence

New swimlane layout algorithm with improved edge routing and validation

Mermaid introduces a new swimlane layout algorithm that significantly improves the visual quality of swimlane diagrams. The new layout engine automatically orders lanes to reduce edge crossings, preserves the source order of disconnected nodes within lanes, and handles complex routing scenarios such as edges passing through obstacles, tight terminal stubs, and same-axis back-edges more robustly. It also supports automatic lane ordering, better handling of edge labels as waypoints, and improved visual clarity for edges exiting crowded ports. These changes result in cleaner, more readable swimlane diagrams with fewer visual artifacts and crossings.

packages/mermaid/src/rendering-util/layout-algorithms/swimlanes · high confidence

New treeView diagram with box-drawing input and icon support

Mermaid now supports a treeView diagram type (triggered by the treeView-beta keyword) that renders file-system-style trees. The diagram accepts both standard indentation and box-drawing characters (such as ├── and │), which are automatically converted to indents for parsing. Nodes can be annotated with CSS classes (:::class), custom icons (icon(pack:name)), and descriptions (\#\# text). Icons are rendered using the Iconify system, with built-in file/folder defaults and the ability to map file extensions or names to specific icon packs via configuration.

packages/mermaid/src/diagrams/treeView · high confidence

New utility modules for state, rendering, and configuration sanitization

This change introduces several new utility modules in the \packages/mermaid/src/utils\ directory. It adds \ImperativeState\ for resettable state management and \getDiagramRoot\ to centralize sandbox iframe handling for diagram rendering. It also introduces \sanitizeDirective\ to validate and clean configuration objects (including dictionary-style configs like node colors and icon maps) and \getSubGraphTitleMargins\ to calculate subgraph title spacing. Additionally, \lineWithOffset\ provides logic for adjusting edge line offsets based on arrow markers, and \base64\ ensures correct UTF-8 encoding for Base64 conversion.

packages/mermaid/src/utils · high confidence

New verify-diagram script for rendering Mermaid diagrams to screenshots

A new CLI tool at scripts/verify-diagram/verify.mjs allows users to render Mermaid diagram files (.mmd) into PNG screenshots. The script requires a running dev server (default port 9000) and uses Playwright to load the diagram, render it via the Mermaid library, and capture the output. Users can specify the input file (-f), output path (-o), theme (--theme), server port (--port), and render timeout (--timeout).

scripts/verify-diagram · high confidence

Per-diagram appearance defaults and enhanced accessibility

Mermaid now supports diagram-specific appearance defaults, allowing certain diagram types (such as flowchart, class, and state diagrams) to automatically use the 'redux-color' theme and 'neo' look unless overridden by user configuration, frontmatter, or directives. Additionally, rendered SVGs now include ARIA roles ('graphics-document document') and descriptions to improve screen-reader accessibility.

packages/mermaid/src · high confidence

Railroad diagrams now support ABNF, EBNF, and PEG input syntaxes

Users can now define railroad diagrams using three additional grammar syntaxes: ABNF (RFC 5234), EBNF (ISO/IEC 14977), and PEG. The parser in this location now includes dedicated front-ends for each syntax, allowing users to write rules using standard notation (e.g., \rule = "a" / "b"\ for ABNF/PEG or \rule = "a" \| "b"\ for EBNF) alongside the existing IR function-call syntax. These parsers leverage Langium to transform the respective grammar definitions into the internal railroad AST, enabling more natural and familiar grammar definitions for railroad diagram generation.

packages/mermaid/src/diagrams/railroad/parser · high confidence

Requirement diagram parser gains support for classes, styling, and direction

The requirement diagram parser has been updated to support new syntax features, including class definitions (\classDef\, \class\), styling via the \style\ keyword, and diagram direction statements (\TB\, \BT\, \RL\, \LR\). The grammar now also handles element definitions with type and docref attributes, and supports accessibility titles and descriptions. These changes allow users to define more complex requirement diagrams with visual styling and structural relationships.

packages/mermaid/src/diagrams/requirement/parser · high confidence

Requirement diagram support added

The requirement diagram type is now available for detection and rendering. This change introduces the core data model (RequirementDB), parser, renderer, and styling logic required to visualize requirement diagrams, including support for requirement types, risk levels, verification methods, and relationships between requirements and elements.

packages/mermaid/src/diagrams/requirement · high confidence

Sankey diagrams now support CSV syntax

Users can now define Sankey diagrams using a CSV format (source, target, value) in addition to the existing syntax. The parser in \packages/mermaid/src/diagrams/sankey/parser\ has been updated to recognize both \sankey\ and \sankey-beta\ keywords, followed by CSV data lines. This change includes a new grammar file (\sankey.jison\) that implements RFC 4180-compliant CSV parsing, handling quoted strings, escaped quotes, and comments. A sample dataset (\energy.csv\) and corresponding tests (\sankey.spec.ts\) demonstrate the new capability, allowing users to paste standard CSV data directly into their diagram definitions.

packages/mermaid/src/diagrams/sankey/parser · high confidence

State diagrams now support composite states with distinct container coloring

The state diagram renderer has been updated to support nested composite states (subgraphs) and concurrency regions. This change introduces a color slot system that assigns distinct palette colors to each nested container, ensuring that deeply nested states are visually distinguishable. Concurrency regions within a single composite share the parent's color to maintain visual cohesion, while plain states remain uncolored to preserve the existing look. The implementation includes a new data fetching layer, a unified renderer, and specific handling for note edges and tooltips to ensure compatibility with the new structure.

packages/mermaid/src/diagrams/state · high confidence

Unified rendering engine for clusters, edges, and markers

The rendering logic for clusters, edges, and markers has been consolidated into a new \rendering-elements\ module. This introduces a unified approach to drawing subgraphs (clusters) with support for hand-drawn styles and theme-based color slots, standardizes edge rendering with configurable curve types and terminal labels, and implements a new marker system that supports colored arrowheads and margin offsets. Additionally, a new line-jump system detects and visualizes edge crossings in orthogonal layouts (like swimlanes) using arcs or gaps, ensuring clearer diagram readability.

packages/mermaid/src/rendering-util/rendering-elements · high confidence

User Journey diagram parser implementation and tests

The user-journey diagram parser has been implemented in \packages/mermaid/src/diagrams/user-journey/parser/journey.jison\, defining the grammar for parsing journey diagrams including titles, sections, tasks, and accessibility metadata (accTitle/accDescr). Corresponding unit tests in \journey.spec.js\ verify that the parser correctly handles these elements, including multiline descriptions and task scoring.

packages/mermaid/src/diagrams/user-journey/parser · high confidence

API

Unified language exports and AST types in parser/src/language

The \packages/parser/src/language\ module now provides a consolidated entry point that exports the Abstract Syntax Tree (AST) types and grammar modules for all supported diagram and language parsers. Users can import definitions for Info, Mermaid, Packet, Pie, Architecture, GitGraph, Radar, Railroad (including EBNF, ABNF, and PEG variants), Treemap, Wardley, Cynefin, TreeView, and Event Modeling from this single location. This change centralizes access to the parser's internal structures, ensuring that all language-specific types (such as \EmFrame\, \Branch\, \Commit\, \DomainBlock\, etc.) and their corresponding generated grammar modules are available through a consistent public API.

packages/parser/src/language · high confidence

Architecture

Extract swimlane cluster rendering to dedicated module

The rendering logic for swimlane clusters has been extracted from the shared clusters module into a new dedicated file (swimlane.js). This change isolates the specific SVG generation, layout calculations (for both Left-to-Right and Top-to-Bottom directions), and hand-drawn style handling for swimlanes, making the codebase more modular and easier to maintain without altering the visual output for users.

packages/mermaid/src/rendering-util/rendering-elements/clusters · high confidence

Introduce shared parser infrastructure for common language constructs

A new \common\ directory in the parser package now centralizes shared language definitions and utilities. This includes a \common.langium\ grammar file defining base terminals (such as \TITLE\, \ACC\_TITLE\, \ACC\_DESCR\, \NUMBER\, and \STRING\) and fragments for handling accessible metadata. The package also exports \CommonTokenBuilder\ and \CommonValueConverter\ classes, which provide standardized logic for building keyword tokens and converting parsed values (specifically handling whitespace normalization and multi-line support for accessibility attributes). This refactoring consolidates previously scattered logic into a reusable component for other language parsers.

packages/parser/src/language/common · high confidence

Repository restructured with new tooling, configuration, and documentation standards

The repository has been reorganized to support a modern development workflow. Key changes include the introduction of a pnpm monorepo structure (pnpm-workspace.yaml), a new TypeScript configuration (tsconfig.json) targeting ES2024, and a migration to Vitest for unit testing and Playwright for end-to-end testing. Development tooling has been updated with a new ESLint flat config (eslint.config.js), Prettier settings, and a custom run script for Docker-based local development. Documentation standards are enforced via a new Code of Conduct, CITATION file, and updated Contributing guidelines. Additionally, dependency management is automated via Renovate, and security updates are handled with a minimum release age policy.

(repo-wide) · high confidence

Behavioural changes

106 commits (29 fixes) modifying packages/mermaid/src/docs/.vitepress/theme

A change to existing behaviour in packages/mermaid/src/docs/.vitepress/theme — 106 commits (29 fixs), 15 files: “WIP: Contributors”; “Merge branch 'develop' of https://github.com/NicolasNewman/mermaid into feature/2776\_katex\_math”; “Address review comments”; and 102 more (refs \#6944, \#4055, \#4676, \#8198, \#4903).

packages/mermaid/src/docs/.vitepress/theme · medium confidence · unverified

11 commits (4 fixes) modifying packages/mermaid/src/\_\_mocks\_\_

A change to existing behaviour in packages/mermaid/src/\_\mocks\\_ — 11 commits (4 fixs), 1 file: “refactor: Move directive processing before parsing”; “fix: Optimize diagram loading”; “fix(mermaid): error if lazyLoadedDiagrams fails”; and 8 more.

packages/mermaid/src/\\mocks\\_ · medium confidence · unverified_

110 commits (51 fixes) modifying packages/mermaid/src/rendering-util/layout-algorithms/grid

A change to existing behaviour in packages/mermaid/src/rendering-util/layout-algorithms/grid — 110 commits (51 fixs), 41 files: “refactor(grid): derive adjacency cap”; “test: cover label gutter clearance during edge rerouting”; “test(grid): cover labels clipping and curves”; and 106 more.

packages/mermaid/src/rendering-util/layout-algorithms/grid · medium confidence · unverified

158 commits (28 fixes) modifying packages/mermaid/src/docs/.vitepress

A change to existing behaviour in packages/mermaid/src/docs/.vitepress — 158 commits (28 fixs), 22 files: “fix linting”; “WIP: Contributors”; “feat: Add og tags”; and 153 more (refs \#4055, \#7320, \#7535, \#7526, \#3358).

packages/mermaid/src/docs/.vitepress · medium confidence · unverified

16 commits (2 fixes) modifying packages/mermaid/src/docs/.vitepress/scripts

A change to existing behaviour in packages/mermaid/src/docs/.vitepress/scripts — 16 commits (2 fixs), 2 files: “WIP: Contributors”; “Merge branch 'develop' of https://github.com/NicolasNewman/mermaid into feature/2776\_katex\_math”; “Fix download”; and 12 more.

packages/mermaid/src/docs/.vitepress/scripts · medium confidence · unverified

16 commits (5 fixes) modifying e2e/platform/dev-diagrams/layout-tests

A change to existing behaviour in e2e/platform/dev-diagrams/layout-tests — 16 commits (5 fixs), 185 files: “test(e2e): migrate Cypress suite to Playwright”; “fix(swimlane): seed cycle removal DFS from source nodes”; “test(grid): cover wide-label routing trade-offs”; and 13 more (refs \#8667).

e2e/platform/dev-diagrams/layout-tests · medium confidence · unverified

17 commits (5 fixes) modifying packages/mermaid/src/rendering-util/layout-algorithms/layered

A change to existing behaviour in packages/mermaid/src/rendering-util/layout-algorithms/layered — 17 commits (5 fixs), 23 files: “fix(layered): round edge bends by default”; “chore(layered): keep the Pele attribution in the third-party notice only”; “test(layered): pin kanban layout independence and fallback label sanitising”; and 14 more.

packages/mermaid/src/rendering-util/layout-algorithms/layered · medium confidence · unverified

23 commits (4 fixes) modifying e2e/diagrams

A change to existing behaviour in e2e/diagrams — 23 commits (4 fixs), 2270 files: “Renamed directories, updated CI and added doc”; “test(grid): cover basis ports and crowded labelled loops”; “test(grid): add browser fixtures for routing regressions”; and 20 more.

e2e/diagrams · medium confidence · unverified

24 commits (6 fixes) modifying packages/mermaid/src/rendering-util/layout-algorithms/ddlt

A change to existing behaviour in packages/mermaid/src/rendering-util/layout-algorithms/ddlt — 24 commits (6 fixs), 22 files: “test(e2e): migrate Cypress suite to Playwright”; “fix(layered): round edge bends by default”; “fix(layered): address review on the layered layout PR”; and 21 more (refs \#2028).

packages/mermaid/src/rendering-util/layout-algorithms/ddlt · medium confidence · unverified

25 commits (11 fixes) modifying packages/mermaid/src/rendering-util/layout-algorithms/layout-utils

A change to existing behaviour in packages/mermaid/src/rendering-util/layout-algorithms/layout-utils — 25 commits (11 fixs), 9 files: “fix compile error”; “feat(grid): add internal placement model”; “fix: keep swimlane rails out of title sections”; and 22 more (refs \#2028).

packages/mermaid/src/rendering-util/layout-algorithms/layout-utils · medium confidence · unverified

28 commits (10 fixes) modifying e2e/rendering

A change to existing behaviour in e2e/rendering — 28 commits (10 fixs), 111 files: “test(flowchart): add e2e spec for the step animation”; “Renamed directories, updated CI and added doc”; “fix(layered): round edge bends by default”; and 25 more.

e2e/rendering · medium confidence · unverified

4 commits (0 fixes) modifying packages/mermaid/src/docs/landing

A change to existing behaviour in packages/mermaid/src/docs/landing — 4 commits, 8 files: “chore: Prettier”; “Add book landing page back”; “Relocation of files”; and 1 more.

packages/mermaid/src/docs/landing · medium confidence · unverified

4 commits (1 fix) modifying packages/mermaid/src/docs/diagrams

A change to existing behaviour in packages/mermaid/src/docs/diagrams — 4 commits (1 fix), 3 files: “fix: restore edgePaths class on the edge group (\#8125)”; “added mermaid files for documentation”; “chore: mermaid diagrams for flowchart, mindmap and mermaidAPI files”; and 1 more (refs \#8125).

packages/mermaid/src/docs/diagrams · medium confidence · unverified

7 commits (3 fixes) modifying packages/mermaid/src/docs/public

A change to existing behaviour in packages/mermaid/src/docs/public — 7 commits (3 fixs), 27 files: “update styling and add assets”; “chore: UI refactor”; “docs: use a PNG og:image”; and 4 more.

packages/mermaid/src/docs/public · medium confidence · unverified

91 commits (9 fixes) modifying packages/mermaid/src/docs/.vitepress/components

A change to existing behaviour in packages/mermaid/src/docs/.vitepress/components — 91 commits (9 fixs), 4 files: “WIP: Contributors”; “chore: Update announcement bar”; “additional updates”; and 84 more (refs \#7365, \#7497).

packages/mermaid/src/docs/.vitepress/components · medium confidence · unverified

Architecture diagrams now use the 'architecture-beta' keyword with Langium-based parsing

The parser for architecture diagrams has been migrated to Langium v4, introducing a new grammar file (architecture.langium) and a custom value converter that correctly preserves quotes and apostrophes in titles. Users must now use the 'architecture-beta' keyword to define diagrams, which support groups, services, junctions, edges with labels, and declarative row/column alignment. The token builder registers the language as 'architecture' for internal identification, while the grammar explicitly handles icon syntax and quoted title strings.

packages/parser/src/language/architecture · high confidence

Automated TypeScript declaration bundling via api-extractor

The parser package now includes a prepack script that automatically bundles TypeScript declaration files into a single \dist/src/index.d.ts\ using \@microsoft/api-extractor\ and cleans up unused declaration artifacts. This ensures consumers receive a consolidated type definition file rather than a scattered set of declarations, simplifying type resolution for users of the parser library.

packages/parser/scripts · high confidence

Build system refactored with new configuration and generation scripts

The build infrastructure has been reorganized into a new \.build\ directory containing shared configuration and generation scripts. A new \common.ts\ file defines package options for the parser, mermaid core, and layout engines (ELK, tidy-tree), and explicitly sets the minimum supported runtime targets to ES2024, Node.js 22.12, and Safari 17.4. New scripts handle specific build tasks: \generateLangium.ts\ uses \langium-cli\ to generate parsers, \jisonTransformer.ts\ processes Jison grammar outputs, \jsonSchema.ts\ generates default configuration values from JSON schemas, and \types.ts\ orchestrates TypeScript declaration generation for all packages.

.build · high confidence

C4 diagram rendering now uses unified shapes

The C4 diagram renderer in \packages/mermaid/src/diagrams/c4\ has been refactored to draw elements through the shared unified shapes system. This change introduces a new \c4ShapeAdapter\ that converts legacy C4 shape data into the unified renderer's node format, ensuring that C4 diagrams benefit from the consistent styling and rendering logic used by other diagram types. The database layer (\c4Db\) and type definitions (\c4Types\) have been updated to TypeScript, and the renderer now correctly handles text wrapping and attribute assignment for C4 elements.

packages/mermaid/src/diagrams/c4 · high confidence

Class diagrams now use scoped SVG IDs to prevent duplicates

Class diagram elements now have unique IDs scoped to the diagram instance, preventing conflicts when multiple class diagrams are rendered on the same page. This is achieved by prefixing all DOM element IDs with the diagram's unique identifier, ensuring that CSS styles and JavaScript interactions target the correct elements even in complex layouts with multiple diagrams.

packages/mermaid/src/diagrams/class · high confidence

ELK layout is now bundled with Mermaid and set as the default

The \@mermaid-js/layout-elk\ package is no longer required for standard Mermaid builds because ELK is now bundled directly with the main \mermaid\ library and registered automatically as the default layout engine. Most users can remove the \@mermaid-js/layout-elk\ dependency and the \registerLayoutLoaders\ call from their code. The package remains available for the \mermaid.tiny.js\ build, which omits ELK to reduce size, allowing users to add it back if they need ELK features in that specific build. This change also includes several layout improvements: a new \elk.preset\ configuration option to easily switch between layout strategies (like \legacy\ or \depthFirst\), visual line hops where edges cross, tighter and more even subgraph frames, and fixes for edge routing on non-rectangular shapes and small nodes.

packages/mermaid-layout-elk · high confidence

Error diagram now displays the actual error message with smart wrapping

The error diagram has been refactored to show the specific error message that caused the failure, rather than a generic placeholder. The renderer now includes logic to wrap long error messages intelligently: it normalizes whitespace, hard-wraps words that exceed the line length, and safely handles Unicode surrogate pairs (such as emojis) so they are never split in half. Additionally, messages that are too long are capped at four lines with an ellipsis, and the diagram's height adjusts dynamically to accommodate the wrapped text, ensuring the full error context is visible to the user.

packages/mermaid/src/diagrams/error · high confidence

Flowchart diagram re-architected with unified renderer and ELK layout

The flowchart diagram implementation has been completely rewritten to use a new unified rendering pipeline (flowRenderer-v3-unified) and a new data model (FlowDB). The default layout algorithm has changed from dagre to ELK, though users can still explicitly configure dagre. This change introduces support for new node shapes (such as hexagon, stadium, and lean shapes), collapsible subgraphs, and per-edge curve styling. The diagram is now registered as 'flowchart-v2' and includes comprehensive unit tests for the new database, layout resolution, and shape rendering logic.

packages/mermaid/src/diagrams/flowchart · high confidence

Gantt diagram logic and data layer refactored into new modular files

The Gantt diagram's internal structure has been reorganized: the database logic is now in \ganttDb.js\ (replacing the previous monolithic implementation), the renderer is in \ganttRenderer.js\, and the diagram definition is in \ganttDiagram.ts\. This change introduces support for a new \vert\ tag to draw vertical markers, allows configuring the week start day via the \weekday\ option, and switches the date handling library from \moment\ to \dayjs\ with specific plugins (isoWeek, customParseFormat, advancedFormat, duration) for improved accuracy and performance. The \ganttDb.spec.ts\ file adds comprehensive tests for these new capabilities, including duration parsing, relative date handling, and clearing state.

packages/mermaid/src/diagrams/gantt · high confidence

Gantt parser now supports special characters and new configuration directives

The Gantt diagram parser has been updated to allow hashtags and semicolons within titles, sections, and task names, which previously caused parsing errors. Additionally, the parser now recognizes new configuration directives including \tickInterval\ for custom tick spacing, \includes\ and \excludes\ for specifying multiple date ranges or weekdays to include or exclude, and \weekday\ to define which day the week starts on.

packages/mermaid/src/diagrams/gantt/parser · high confidence

GitGraph diagram re-architected with Langium parser and new rendering engine

The GitGraph diagram implementation has been completely rewritten to use a new Langium-based parser (\@mermaid-js/parser\) and a new AST/state management system (\gitGraphAst.ts\). This change introduces support for new syntax features such as commit types (NORMAL, REVERSE, HIGHLIGHT), tags, and cherry-picking, while also fixing previous rendering issues with branch orientations (LR, TB, BT) and merge logic. The new renderer (\gitGraphRenderer.ts\) and styles (\styles.js\) provide improved visual consistency across themes, including specific geometry adjustments for Redux and Neo themes, and better handling of multi-line labels and branch colors.

packages/mermaid/src/diagrams/git · high confidence

Improved XY chart title placement and added legend support

The XY chart builder now includes a dedicated legend component that renders markers and labels for named plots, respecting the \showLegend\ configuration. Additionally, the chart title logic has been refined to center the title over the plot area (excluding the legend's width when present) and to measure text dimensions accurately in SVG units; titles that are too wide are now constrained to the chart boundaries, and titles are omitted if the chart height is insufficient to accommodate them without overflow.

packages/mermaid/src/diagrams/xychart/chartBuilder/components · high confidence

Introduce Langium-based parser for treeView-beta syntax

The tree view parser has been rewritten to use Langium, replacing the previous implementation with a new grammar (treeView.langium) and associated services. This change enables support for the 'treeView-beta' syntax, allowing nodes to have both quoted and bare labels, and introduces parsing for annotations such as class styles (:::class), icons (icon()), and descriptions (\#\# text). The parser now converts indentation into length values and handles whitespace preservation in labels, providing a more structured foundation for tree view rendering.

packages/parser/src/language/treeView · high confidence

Mermaid 12.1.0: ELK layout defaults, new themes, and parser upgrades

This release updates the Mermaid package to version 12.1.0, introducing several significant changes for users. The ELK layout engine is now bundled by default and used for diagrams that do not specify a layout, replacing dagre; users can revert to the previous layout by explicitly setting \layout: dagre\. The default theme has changed to \redux-color\ with the \neo\ look for ten diagram types (including flowchart, class, and sequence), altering the visual appearance of diagrams without explicit theme settings. Additionally, the parser has been upgraded to langium 4.4 and chevrotain 13, which removes the vulnerable \lodash-es@4.17.23\ dependency and fixes several parsing issues, such as allowing whitespace in sequence diagram actor configurations and handling hyphenated actor names. Minor features include a new \bitOrder\ option for packet diagrams and improved error messages in the error diagram.

packages/mermaid · high confidence

Migrate build system to esbuild with IIFE output and live-reload dev server

The build pipeline has been replaced with esbuild, changing the distribution format of \mermaid.min.js\ and \mermaid.js\ from UMD to IIFE. This migration introduces a new live-reload development server that supports configurable ports, file watching, and a Dev Explorer for comparing rendering across versions. The build system now supports multiple output variants (core, minified, tiny) and externalizes peer dependencies in core builds to prevent duplicate bundling. Additionally, custom esbuild plugins handle Jison grammar and JSON Schema files, and the \@mermaid-js/tiny\ package is generated as a separate artifact.

.esbuild · high confidence

Migrate end-to-end testing suite to Playwright

The end-to-end testing infrastructure has been migrated from Cypress to Playwright. This change introduces a new Playwright-based test configuration (e2e/tsconfig.json) targeting ES2024 and Node.js 22.12, and implements a global teardown process (e2e/global-teardown.ts) that aggregates V8 coverage data into an Istanbul lcov report for CI upload. Additionally, a new snapshot baseline file (e2e/sheet-order.json) has been added to pin and verify the deterministic rendering order of sheet tiles across various diagram types.

e2e · high confidence

Migrated use case diagram parser to Chevrotain

The use case diagram parser has been rewritten from ANTLR to Chevrotain, introducing a new lexer, parser, and visitor architecture. This change enables support for identifiers starting with digits, explicit IDs and inline metadata on system boundaries, and markdown punctuation in unquoted labels. It also adds new arrow types, class definitions, and styles, while improving error reporting with precise line and column information and fixing issues with label clipping and boundary color derivation.

packages/mermaid/src/diagrams/usecase · high confidence

Migration to Vite-based build and development server

The project has replaced its previous build system with a new Vite-based infrastructure located in the \.vite\ directory. This change introduces a custom build script (\.vite/build.ts\) that configures Vite for library builds, integrates custom plugins for Jison grammar and JSON Schema processing, and supports bundle visualization and code coverage. A new development server (\.vite/server.ts\) is provided, which uses Express to serve static assets from the built packages and demos, enabling local development and testing.

.vite · high confidence

Mindmap diagram restructured with depth-based coloring and layout defaults

The mindmap diagram implementation has been refactored to support coloring by hierarchy depth (configurable via \mindmap.colorBy: 'depth'\), allowing nodes to be visually distinguished by their structural level rather than just branch. The default layout algorithm for mindmaps is now \cose-bilkent\ (previously relying on the global default), ensuring consistent rendering independent of other diagram settings. Additionally, node labels are now centered for all shapes when HTML labels are disabled, and padding has been adjusted for circle, rounded rectangle, and bang shapes to prevent visual clipping and snapshot failures.

packages/mermaid/src/diagrams/mindmap · high confidence

New color theming system and security hardening in diagram rendering

This change introduces a centralized color theming system (\colorThemeGate\) that allows diagrams to opt-in to per-item palette coloring (currently for \redux-color\ and \redux-dark-color\ themes) via a \data-color-id\ slot mechanism, ensuring stylesheets only emit rules for supported themes and that user styling is not overridden. It also hardens security by refining DOMPurify hooks to properly secure \target="\_blank"\ links with \rel="noopener"\, removing script tags more robustly, and validating the \look\ configuration to prevent CSS injection via malicious attribute selectors. Additionally, it improves text handling by correctly parsing malformed \\<br\>\ tags as line breaks and adds comprehensive tests for these behaviors.

packages/mermaid/src/diagrams/common · high confidence

New diagram orchestration, beta policy, and linear-time comment/frontmatter parsing

The diagram-api module has been restructured to centralize diagram registration and detection. A new \diagram-orchestration.ts\ file registers all built-in diagrams, enforcing a beta policy where new diagram types require a \-beta\ suffix in their syntax (e.g., \swimlane-beta\) while graduated diagrams accept both the stable and beta keywords. Comment and frontmatter parsing have been replaced with linear-time scanners (\stripAnyComments\ and \matchFrontMatter\) to prevent quadratic performance degradation on deeply indented or whitespace-heavy inputs, ensuring consistent rendering speed. Additionally, a new \diagramAPI.ts\ provides a public interface for third-party diagrams to register custom types, and \detectType.ts\ now handles diagram detection with support for YAML frontmatter and directive stripping.

packages/mermaid/src/diagram-api · high confidence

New e2e test helpers for Playwright, Argos, and Applitools

The e2e/helpers directory now provides a new suite of Playwright-based utilities to replace the previous Cypress setup. This includes argos-metadata.ts and applitools.ts, which generate and manage screenshot metadata sidecars for Argos visual testing and batch Applitools checks by diagram folder. The mmd-snapshots.ts helper reads YAML frontmatter from Mermaid fixtures and ensures unique snapshot names to prevent baseline collisions. Additionally, coverage.ts enables native V8 code coverage collection for the Mermaid bundle, and iconShapeTests.ts registers a comprehensive matrix of icon shape visual tests.

e2e/helpers · high confidence

New sequence diagram parser with expanded syntax support

The sequence diagram parser has been replaced with a new Jison-based grammar that significantly expands supported syntax. Users can now use decimal values for sequence numbers, create and destroy participants explicitly, and utilize new arrow types including bidirectional arrows and various dotted/solid variants. The parser also supports new structural elements like boxes, allows whitespace before participant configuration objects, and permits specific keywords (such as 'link', 'properties', 'details') as participant IDs. Additionally, it handles participant names with spaces and hyphens more robustly and supports the 'on-behalf-of' message syntax.

packages/mermaid/src/diagrams/sequence/parser · high confidence

Parser package restructured to use Langium with async parsing

The parser package has been restructured to use Langium instead of the previous jison-based implementation, introducing an asynchronous \parse\ function that supports lazy loading of diagram-specific parsers (Info, Packet, Pie, TreeView, Architecture, GitGraph, EventModeling, Radar, Railroad, Treemap, Wardley, and Cynefin). This change also updates error reporting to include specific line and column numbers for lexer and parser errors, improving the debugging experience for users encountering syntax issues.

packages/parser/src · high confidence

Pre-commit hook configured to run lint-staged via pnpm with increased memory limits

A new pre-commit hook has been added to the project, ensuring that linting tasks are executed before every commit. The hook is implemented as a shell script that invokes \pnpm run pre-commit\, explicitly setting the \NODE\_OPTIONS\ environment variable to increase the V8 heap size to 8192 MB. This configuration addresses previous out-of-memory issues during linting and standardizes the pre-commit workflow to use pnpm.

.husky · high confidence

Quadrant chart parser now supports Unicode text and flexible styling

The quadrant chart parser has been updated to handle non-ASCII characters (including CJK, emoji, and accented Latin) in axis labels, quadrant titles, and point text, and to allow class definitions and point styles to appear in any order and be optional. This enables users to use international text and emojis in their diagrams without parsing errors and to format points with styles more flexibly.

packages/mermaid/src/diagrams/quadrant-chart/parser · high confidence

Refactored Dagre layout into a unified, shared-paint renderer with improved self-loop handling

The Dagre layout algorithm has been restructured into a new modular implementation that separates measurement from the core layout logic and integrates with the unified renderer's shared paint system. This change significantly improves the rendering of self-referential edges (self-loops) across flowcharts, class diagrams, ER diagrams, and state diagrams by merging layout segments and generating compact, single-path loops instead of relying on Dagre's default dummy-node routing. The update also introduces better handling of subgraph paddings, cluster external connections, and node spacing normalization, ensuring that diagram-specific spacing preferences take precedence over flowchart defaults.

packages/mermaid/src/rendering-util/layout-algorithms/dagre · high confidence

Refactored swimlane layout engine with improved edge routing and geometry handling

The swimlane layout algorithm has been refactored to improve edge routing, reduce visual clutter, and fix several layout defects. New modules handle detour simplification, endpoint clipping, label anchoring, and port swapping, resulting in cleaner diagrams with fewer edge crossings and better handling of crowded swimlanes. The layout now correctly positions title bands relative to rails, separates crowded exit rails, and optimizes crossing cleanup for improved readability.

packages/mermaid/src/rendering-util/layout-algorithms/swimlanes/direction · high confidence

State diagram parser now enforces single-word state names and allows colons in descriptions

The state diagram parser now rejects state names containing multiple words (e.g., 'state invalid syntax { Y }' throws an error), ensuring only single-word identifiers are accepted. Additionally, colons are now permitted within state descriptions and transition labels (e.g., 'myState : status: active' or 'locked --\> pending : recoverable error (ex: timeout)'), resolving previous parsing conflicts. The parser also supports defining and applying CSS styles via classDef and class statements, including the ::: syntax for inline styling.

packages/mermaid/src/diagrams/state/parser · high confidence

Theme system overhaul with new variables and override fixes

The theme system has been restructured to use a centralized registry (index.js) and a new helper-based configuration model. This introduces new theme variables, including \flowContainerStroke\ for agentflow diagrams and \rowOdd\/\rowEven\ for ER diagram row striping. It also fixes a bug where overriding \nodeBorder\ in the base theme was silently ignored due to gradient logic, ensuring explicit overrides now take precedence. Additionally, the \theme-dark\ and \theme-neo-dark\ themes have been updated to improve contrast for Gantt chart text and rect section bands.

packages/mermaid/src/themes · high confidence

Timeline diagram now supports vertical layout and enhanced parsing

The timeline diagram now supports a vertical layout (TD) in addition to the existing horizontal (LR) orientation, allowing users to choose the direction that best fits their content. The parser has been updated to allow colons and hashtags within event titles, sections, and tasks, enabling more flexible and expressive timeline definitions. Additionally, the diagram now respects the leftMargin configuration option, ensuring consistent spacing across different themes and layouts.

packages/mermaid/src/diagrams/timeline · high confidence

Timeline parser now supports colons in event titles

The timeline parser grammar has been updated to allow colons within event titles. Previously, colons were treated as delimiters, but the new regex pattern for the 'event' token (\:\ followed by non-colon characters or double colons not followed by whitespace) permits colons in the text, enabling more descriptive event labels without breaking the parse.

packages/mermaid/src/diagrams/timeline/parser · high confidence

Unified rendering pipeline with ELK layout and improved text handling

The rendering engine has been refactored to use a unified \createGraphWithElements\ path that integrates the ELK layout algorithm as the default, replacing the previous Dagre-only approach. This change improves the layout of complex diagrams, including proper handling of cluster labels and direction-sensitive shapes like fork/join bars. Text rendering has been enhanced with better markdown support via the \marked\ library, optional auto-wrapping, and improved icon handling through the Iconify system. Additionally, the rendering process now ensures unique SVG element IDs across multiple diagrams on the same page, preventing conflicts and improving reliability in multi-diagram scenarios.

packages/mermaid/src/rendering-util · high confidence

Updated diagram examples to use dagre layout and new Mermaid syntax

The diagram examples in the e2e/platform/dev-diagrams/knsv directory have been refreshed to demonstrate updated Mermaid syntax and layout engines. Most flowchart examples now explicitly use the dagre layout engine (via config: layout: dagre) instead of the previous elk default, and include new features such as animated edges, varied node shapes (rounded, square, circle, diamond), icons, and subgraph nesting. Additionally, new sequence, treemap, radar, class, requirement, mindmap, and kanban diagram examples have been added to showcase these capabilities.

e2e/platform/dev-diagrams/knsv · high confidence

User Journey diagram refactored with improved text wrapping and title styling

The User Journey diagram implementation has been restructured into a new modular layout (journeyDb, journeyDetector, journeyDiagram, journeyRenderer, styles, svgDraw) within the user-journey package. This change introduces dynamic text wrapping for actor names in the legend using a knuth-plass algorithm to respect the maxLabelWidth configuration, preventing overflow. It also adds support for configuring the diagram title's font family, size, and color via the config schema. The refactoring consolidates shared SVG drawing components and standardizes the diagram loader interface, while ensuring proper application of fill styles to icons and fixing edge path class assignments.

packages/mermaid/src/diagrams/user-journey · high confidence

XY Chart data validation and label rendering improvements

The XY chart diagram now automatically truncates bar and line data points to match the number of X-axis categories, preventing orphaned data from rendering and ensuring the Y-axis range is calculated only from visible points. Additionally, data labels are sanitized to remove surrounding whitespace for cleaner legends, and the renderer now supports dynamic text adjustment for data labels, automatically resizing fonts to fit within bars in both horizontal and vertical orientations.

packages/mermaid/src/diagrams/xychart · high confidence

Fixes

9 commits (5 fixes) fixing packages/mermaid/src/rendering-util/layout-algorithms/swimlanes/orthogonalRouter

A fix in packages/mermaid/src/rendering-util/layout-algorithms/swimlanes/orthogonalRouter — 9 commits (5 fixs), 7 files: “refactor(swimlanes): keep the drawnSize doc comment on drawnSize”; “fix(swimlanes): keep sibling edges that leave one face from running side by side”; “refactor(swimlanes): rename raykovGemini/ -\> orthogonalRouter/”; and 6 more.

packages/mermaid/src/rendering-util/layout-algorithms/swimlanes/orthogonalRouter · medium confidence · unverified

Add TypeScript declaration for cytoscape-cose-bilkent

Added a TypeScript declaration file for the cytoscape-cose-bilkent module to resolve build issues related to missing type definitions.

packages/mermaid/src/types · high confidence

C4 parser: support for boundaries as relationship endpoints and named attribute handling

The C4 diagram parser now correctly resolves boundary aliases (Boundary, System\_Boundary, Container\_Boundary) as valid endpoints for relationships (Rel, BiRel, etc.), ensuring that relations targeting a boundary are rendered without error. Additionally, the parser fixes how named attributes (like $tags, $sprite, $link) are stored when they land in positional slots due to omitted arguments, preventing data loss or incorrect wrapping (e.g., ensuring $tags remains a plain string rather than being wrapped in { text }). New unit tests cover these scenarios for all C4 element types (Person, System, Container, Component, Boundary) and their variants.

packages/mermaid/src/diagrams/c4/parser · high confidence

Class diagram parser now supports backtick-quoted identifiers and unsafe prototype names

The class diagram parser has been updated to handle edge cases in class and namespace naming. Users can now use backticks to quote identifiers containing special characters (e.g., \namespace \A::B\\), and the parser no longer throws errors when using reserved JavaScript prototype names like \\_\proto\\_\ or \constructor\ as class or namespace names.

packages/mermaid/src/diagrams/class/parser · high confidence

Fix module compatibility for fastdom and roughjs

Applied patches to resolve module resolution issues for two dependencies. For fastdom, the patch converts CommonJS/AMD exports to ES modules (adding \export default\ and named exports) and sets \type: module\ in package.json, ensuring it works correctly in modern bundlers without polluting the global scope. For roughjs, the patch changes the TypeScript declaration from \export default\ to \export =\, fixing type compatibility for consumers expecting CommonJS-style default exports.

patches · high confidence

Fixes half-pixel bias in shape intersection calculations

The rendering engine now calculates the exact intersection point between lines and shapes (rectangles, ellipses, polygons) without the previous half-pixel displacement error. This correction ensures that connection lines attach precisely to the edges of non-rectangular nodes (such as diamonds or hexagons) and prevents orthogonal edges from appearing slightly diagonal or pushing attachment points inside the node boundary.

packages/mermaid/src/rendering-util/rendering-elements/intersect · high confidence

Fixes palette CSS generation bugs in ER, Requirement, and Use Case diagrams

Resolves issues where diagram stylesheets generated invalid CSS (such as \undefined\ values or empty declarations) when palette arrays were shorter, longer, or empty relative to the theme limit. The fix ensures that CSS rules are emitted only for available palette colors, preventing shapes from rendering unstyled due to discarded browser declarations. Additionally, a new global stylesheet consolidates Font Awesome icon styling for labels.

packages/mermaid/src/diagrams · high confidence

Sequence diagram layout and rendering fixes

The sequence diagram rendering has been updated to fix several layout and visual issues. A new 'band model' ensures that participant lifelines start at a consistent vertical position across all actor types, preventing misalignment. The rendering of actor icons, particularly the stick figure, has been corrected to display at the proper size and position. Additionally, fixes address issues with note text font weight being incorrectly forced to bold by certain themes, ensure section background fills are visible against the diagram background, and correct the color palette indexing to prevent missing actor fills.

packages/mermaid/src/diagrams/sequence · high confidence

Unified error reporting for lexer and parser failures

The common parser module now includes a new \runChevrotainParse\ utility that standardizes how lexing and parsing errors are reported to users. Previously, lexer errors were not enriched with position data in the same way parser errors were; this change ensures that both failure modes throw errors containing consistent line and column information, improving the clarity of error messages for invalid diagram syntax.

packages/mermaid/src/diagrams/common/parser · high confidence

Wardley Maps parser rewritten using Langium

The Wardley Maps parser has been replaced with a new grammar-based implementation using Langium, replacing the previous regex-based approach. This change introduces a formal grammar (wardley.langium) that defines terminals and rules for components, links, evolution stages, and other map elements, along with a custom value converter to handle specific parsing nuances like link labels. Users benefit from more robust parsing, support for multi-word component names, decimal coordinates, and corrected handling of arrow operators and special characters in names.

packages/parser/src/language/wardley · high confidence

Test coverage

93 commits adding/updating tests in packages/mermaid/src/rendering-util/layout-algorithms/swimlanes/\_\tests\\_; Add regression and audit diagrams for flowchart layout fixes; Added end-to-end tests for configuration, security, and interaction behaviors; Added parser tests for multiple diagram types; Added performance baseline data for dev-diagrams; Added release verification harness for packaged artifacts; Added test coverage for ELK layout algorithm internals; Added test utilities for SVG rendering and ID validation; Added webpack-based test harness for Mermaid integration; Centralized example registry and validation tests for all diagram types; Flowchart parser test suite reorganization and expansion; New e2e test pages for security, external diagrams, and layout engines.

Dependencies

Mermaid 12.1.0 release with Node 22 requirement and new layout packages

This release updates the core \mermaid\ package to version 12.1.0 and introduces two new layout packages: \@mermaid-js/layout-elk\ (v1.0.1) and \@mermaid-js/layout-tidy-tree\ (v1.0.1), which are now decoupled from the main build to support smaller bundle sizes like \mermaid.tiny.js\. The project now requires Node.js \>=22.12.0 across all packages. The \@mermaid-js/parser\ has been updated to version 2.0.1, and the \@mermaid-js/mermaid-example-diagram\ is now a private package. Additionally, a new \@mermaid-js/examples\ package (v2.0.0) has been added to distribute example diagrams, and a \@mermaid-js/tiny\ package (v12.1.0) is provided for minimal builds.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 51 → 49 (-2.0)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 57 → 44 (-13.5)
  • Architecture 90 → 91 (+0.6)
  • Maturity 75 → 75 (-0.3)
  • Readiness 57 → 59 (+1.7)
  • Security 64 → 66 (+2.3)
  • Accessibility 41 → 43 (+2.2)
  • Performance 60 → 60 (+0.0)

Resolved (137)

  • Change coupling: flowDb.ts ↔ imageSquare.ts (packages/mermaid/src/diagrams/flowchart/flowDb.ts)
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Critical vulnerability: [GHSA redacted] (pnpm-lock.yaml)
  • Cross-context type DiagramAST (parser → mermaid) (packages/mermaid/src/diagrams/common/populateCommonDb.ts)
  • FunctionTooLong: erMarkers.insertMarkers (packages/mermaid/src/diagrams/er/erMarkers.js)
  • FunctionTooLong: erRenderer.drawAttributes (packages/mermaid/src/diagrams/er/erRenderer.js)
  • FunctionTooLong: validateLayout.validateLayout (packages/mermaid/src/rendering-util/layout-algorithms/layout-utils/validateLayout.ts)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • …and 117 more

New (260)

  • ClassTooLong: GridEdgeRoutingSession (packages/mermaid/src/rendering-util/layout-algorithms/grid/routerSession.ts)
  • ClassTooLong: layered (packages/mermaid/src/rendering-util/layout-algorithms/layered/layered.ts)
  • FileTooLong: direction/geometry.ts (packages/mermaid/src/rendering-util/layout-algorithms/swimlanes/direction/geometry.ts)
  • FileTooLong: grid/edgeLabels.ts (packages/mermaid/src/rendering-util/layout-algorithms/grid/edgeLabels.ts)
  • FileTooLong: grid/routerCompatibility.ts (packages/mermaid/src/rendering-util/layout-algorithms/grid/routerCompatibility.ts)
  • FileTooLong: grid/routerPlanning.ts (packages/mermaid/src/rendering-util/layout-algorithms/grid/routerPlanning.ts)
  • FileTooLong: grid/routerSearch.ts (packages/mermaid/src/rendering-util/layout-algorithms/grid/routerSearch.ts)
  • FileTooLong: grid/routerSession.ts (packages/mermaid/src/rendering-util/layout-algorithms/grid/routerSession.ts)
  • FileTooLong: grid/routerSparse.ts (packages/mermaid/src/rendering-util/layout-algorithms/grid/routerSparse.ts)
  • FileTooLong: grid/routerTopology.ts (packages/mermaid/src/rendering-util/layout-algorithms/grid/routerTopology.ts)
  • FileTooLong: layered/compound.ts (packages/mermaid/src/rendering-util/layout-algorithms/layered/compound.ts)
  • FileTooLong: layered/layered.ts (packages/mermaid/src/rendering-util/layout-algorithms/layered/layered.ts)
  • FunctionTooLong: compound.compoundLayout (packages/mermaid/src/rendering-util/layout-algorithms/layered/compound.ts)
  • FunctionTooLong: compound.routeCrossings (packages/mermaid/src/rendering-util/layout-algorithms/layered/compound.ts)
  • FunctionTooLong: index.run (packages/mermaid/src/rendering-util/layout-algorithms/layered/index.ts)
  • FunctionTooLong: layered.assignTracks (packages/mermaid/src/rendering-util/layout-algorithms/layered/layered.ts)
  • FunctionTooLong: layered.layered (packages/mermaid/src/rendering-util/layout-algorithms/layered/layered.ts)
  • FunctionTooLong: layered.position (packages/mermaid/src/rendering-util/layout-algorithms/layered/layered.ts)
  • FunctionTooLong: layered.reduceCrossings (packages/mermaid/src/rendering-util/layout-algorithms/layered/layered.ts)
  • FunctionTooLong: layered.settle (packages/mermaid/src/rendering-util/layout-algorithms/layered/layered.ts)
  • …and 240 more

Changes since last survey

  • 300 commits — 209 feature/other, 91 fixes

By area

  • packages/mermaid — 147 commits
  • (repo) — 89 commits
  • docs/config — 21 commits
  • e2e/diagrams — 16 commits
  • (root) — 5 commits
  • docs/syntax — 4 commits
  • e2e/platform — 4 commits
  • docs/intro — 3 commits
  • .changeset/nested-group-in-lane.md — 2 commits
  • .github/workflows — 2 commits
  • demos/flowchart-grid.html — 2 commits
  • e2e/rendering — 2 commits
  • .changeset/grid-layout.md — 1 commit
  • e2e/snapshots — 1 commit
  • e2e/helpers — 1 commit

Notable commits

  • fix: Additional fix since one flowchart diagram failed with crossing edges
  • fix: Merge branch 'develop' into bug/8580_elk-bidirectional-label-overlap
  • fix: Merge branch 'develop' into fix/8327_label-ranks-stack
  • fix: Merge branch 'develop' into fix/8327_label-ranks-stack
  • fix: Merge branch 'develop' into fix/swimlane-diamond-edge-start
  • fix: Merge branch 'develop' into fix/swimlane-lr-label-stretch-anchored
  • fix: Merge branch 'develop' into fix/swimlane-straight-connector-lane-separation
  • fix: Merge branch 'develop' into pebr/fix-flaky-gantt-screenshot-test
  • fix: Merge pull request #8385 from filipsajdak/fix/8327_label-ranks-stack
  • fix: Merge pull request #8532 from Devehab/fix/8507-bump-elkjs-0.12
  • fix: Merge pull request #8566 from mermaid-js/pebr/fix-flaky-gantt-screenshot-test
  • fix: Merge pull request #8581 from lrharboe/bug/8580_elk-bidirectional-label-overlap
  • fix: Merge pull request #8617 from mermaid-js/docs/site-fixes
  • fix: Merge pull request #8659 from lazerg/bug/8658_escape-numeric-svg-id
  • fix: Merge pull request #8668 from filipsajdak/fix/swimlane-lr-label-stretch-anchored
  • fix: Merge pull request #8670 from filipsajdak/fix/swimlane-diamond-edge-start
  • fix: Merge pull request #8693 from filipsajdak/fix/swimlane-straight-connector-lane-separation
  • fix: Merge remote-tracking branch 'origin/fix/8327_label-ranks-stack'
  • fix: [autofix.ci] apply automated fixes
  • fix: [autofix.ci] apply automated fixes
  • …and 280 more

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

mermaid-js/mermaid was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 14 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 2b1e7f66c2bafcfa2cf5cfe1fdf5db569d7ffddb — the exact code this score is about.
  • Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-e1a3b69fc8ee.