AiLounge Tools

Mermaid Diagram Studio

Flowcharts, sequence diagrams, class diagrams and Gantt charts: local parsing, strict security filtering, and exportable SVG / PNG plans.Processed locally (works offline)

Class diagram

Parse classDiagram classes, members, direction and inheritance/composition/association relations into class boxes and relation lines.

Run in browser

Inputs and parameters

Real example

classDiagram
  direction TB
  class Diagram {
    +String kind
    +validate()
    +exportSVG()
  }
  class StrictPolicy {
    +allowDirective()
    -rejectScript()
  }
  class ExportPlan {
    +String filename
    +assertNonBlankPNG()
  }
  Diagram <|-- Flowchart
  Diagram --> StrictPolicy : filters
  Diagram --> ExportPlan : emits
→ class: 4 classes / 3 relations; CJK class and member names, +/- visibility and <|-- inheritance are preserved; SVG contains class-box and relation groups.

Limits and failure handling

Only class declarations, single-line members and common relation operators are covered; namespaces are recorded but not laid out, and annotations/generics/lollipop interfaces are out of scope this run.

FAQ

What if a class block is not closed?

UNCLOSED_CLASS_BLOCK is returned at the class declaration line and the input is preserved.

Are generics supported?

This subset escapes generic characters as ordinary text without semantic parsing; real Mermaid generics rendering is untested.