github lukilabs/beautiful-mermaid v1.0.0

latest releases: v1.1.3, v1.1.2, v1.1.1...
one month ago

beautiful-mermaid v1.0.0

Layout Engine

  • ELK.js replaces dagre — fully synchronous layout via FakeWorker bypass, better edge routing and subgraph handling
  • Shape-aware edge clipping — edges terminate at actual shape boundaries (e.g. diamond vertices), not bounding boxes
  • New layout optionsnodeSpacing, layerSpacing, componentSpacing, thoroughness for fine-grained control
  • Disconnected component support — graphs with unconnected subgraphs now lay out properly
  • Per-subgraph direction overrides — nested subgraphs can have independent LR/TD/BT/RL direction

Multi-line Labels & Formatting

  • <br> tags in node labels, edge labels, and subgraph headers — line breaks work everywhere
  • Inline formatting<b>, <i>, <u>, <s> tags render as bold/italic/underline/strikethrough in SVG
  • Variable-width text measurement — character-class buckets (narrow, wide, CJK, emoji) instead of fixed-ratio estimation

Themeable ASCII

  • ANSI color modesnone, ansi16, ansi256, truecolor, and html (for browser rendering)
  • AsciiTheme type — customize colors per role: fg, border, line, arrow, corner, junction
  • colorMode: 'auto' — auto-detects terminal capabilities

ASCII Shapes

12+ distinct node shapes in terminal output:
rectangle, rounded, diamond, circle, hexagon, stadium, cylinder, doublecircle, subroutine, asymmetric, trapezoid, state-start, state-end

ASCII Rendering Improvements

  • Edge bundling — fan-in/fan-out patterns merge into visual junctions (TD direction)
  • Multi-line labels in both nodes and edges
  • Multi-section boxes for class diagrams (name / attributes / methods) and ER diagrams
  • Canvas role tracking — each character tagged with semantic role for accurate colorization
  • Diagonal line validationassertNoDiagonals() for test assertions

SVG Renderer

  • Semantic data attributes on all elements (data-id, data-from, data-to, data-style, data-label)
  • Improved arrow markers — combined fill + stroke for crisp rendering at small sizes
  • Better edge label pills — increased stroke width, improved contrast

Breaking Changes

  • dagre removed — replaced by ELK.js (API unchanged, layout results differ)
  • tsup.config.ts removed (no longer bundled separately)

Don't miss a new beautiful-mermaid release

NewReleases is sending notifications on new releases.