VPasCode: A Guide to Diagram-as-Code From Mermaid to PlantUML

Read this post in:

Tooling: Visual Paradigm VPasCode

Diagram-as-code changes how teams create and maintain visual documentation. Instead of dragging shapes and connectors, you write a text definition and let a renderer produce the diagram. This approach keeps diagrams versionable, reviewable, and consistent with the rest of your technical artifacts. Visual Paradigm’s VPasCode brings this workflow into a browser-based editor that supports Mermaid, PlantUML, and other text-to-diagram engines side by side .

VPasCode: A Guide to Diagram-as-Code From Mermaid to PlantUML

What VPasCode Is

VPasCode is Visual Paradigm’s unified text-to-diagram platform. It runs entirely in a web browser—no desktop installation, no local Java runtime, no Node.js configuration. You open the editor, select a diagram language, write or paste your definition, and watch the diagram render in real time beside your code .

The platform supports three primary open-source diagramming engines:

  • Mermaid: Compact syntax ideal for flowcharts, sequence diagrams, Gantt charts, and diagrams embedded in Markdown documentation.

  • PlantUML: A richer language suited to formal UML diagrams, C4 architecture models, ArchiMate, and detailed technical documentation.

  • Graphviz: Best for network structures, dependency maps, and large relationship graphs where automatic layout matters more than notation-specific styling.

Beyond these, VPasCode also recognizes D2, Markmap, and ECharts syntax, automatically detecting the engine from your code .

Why Use a Unified Editor for Mermaid and PlantUML

Teams rarely standardize on a single diagramming language. A quick flowchart in a README might use Mermaid because it renders natively on GitHub. A detailed component diagram for architecture review might use PlantUML because it supports stereotypes, notes, and C4 extensions. Switching between separate tools for each language creates friction: different interfaces, different export workflows, different sharing mechanisms.

VPasCode removes that friction by providing one workspace that handles both. You can maintain a Mermaid flowchart and a PlantUML sequence diagram in adjacent tabs, preview both live, and export either as SVG or PNG without leaving the browser .

Core Workflow: Write, Preview, Refine, Share

The VPasCode workflow follows four straightforward steps.

1. Select your engine. Choose Mermaid for lightweight, Markdown-friendly diagrams, or PlantUML when you need formal UML notation, C4 models, or more expressive styling options. Graphviz is available for relationship-heavy graphs where layout automation is the priority .

2. Write or paste your definition. The left panel is a syntax-highlighted code editor with line numbers and error detection. Start with a minimal skeleton—actors and a few interactions for a sequence diagram, or a handful of containers for a C4 view—and expand incrementally. For complex diagrams, building in small sections makes syntax errors easier to isolate .

3. Review the live preview. The right panel renders your diagram as you type. If the visual output does not match your intent, adjust labels, relationship names, or grouping before adding more complexity. Specific, descriptive labels make diagrams more useful than generic ones like “Service A” or “Step 1” .

4. Export or share. VPasCode supports SVG export for scalable diagrams suitable for wikis and documentation, PNG export for quick sharing in chat or presentations, and shareable URLs that encode the diagram source directly in the link. Because the URL contains the code, anyone who opens it can view and edit the diagram immediately .

AI Assistance Inside the Editor

VPasCode includes native AI features that reduce the two biggest friction points in diagram-as-code: starting from scratch and fixing syntax errors.

AI diagram generation lets you describe a diagram in plain language and receive rendered code in your chosen engine. A prompt like “Generate a PlantUML sequence diagram for a user login flow with two-factor authentication” produces an editable definition that you can refine further .

AI error fixing addresses the most common frustration with text-based diagramming: a single misplaced character or invalid keyword that prevents rendering. When VPasCode detects a syntax error, it identifies the problematic line and offers a one-click fix. The AI analyzes the error against valid syntax patterns, corrects the code, and re-renders the diagram automatically .

AI refinement lets you modify existing diagrams through natural-language instructions rather than manual code edits. You can ask the AI to add a step, rename an element, or restructure a section, and the underlying code updates accordingly .

These AI features do not replace the need to understand your diagram’s content. They accelerate the mechanical work of writing and debugging syntax so you can focus on accuracy and clarity.

Practical Example: Mermaid and PlantUML in the Same Workflow

Consider a team documenting a microservices system. They need two views:

A high-level flow for the project README, showing how a request moves through the API gateway, authentication service, and order service. Mermaid handles this well:

graph TD
    A[Client] --> B[API Gateway]
    B --> C{Auth Service}
    C -->|Valid| D[Order Service]
    C -->|Invalid| E[401 Unauthorized]
    D --> F[(Orders DB)]

A detailed sequence diagram for the architecture decision record, showing the exact message flow and error branches for order placement. PlantUML provides the precision needed:

@startuml
actor Customer
participant "API Gateway" as GW
participant "Order Service" as OS
database "Orders DB" as DB

Customer -> GW: POST /orders
GW -> OS: createOrder(request)
OS -> DB: INSERT order
DB --> OS: orderId
OS --> GW: 201 Created
GW --> Customer: orderId
@enduml

With VPasCode, the team keeps both definitions in the same workspace. The Mermaid diagram exports as SVG for the README. The PlantUML diagram exports as PNG for the ADR and links to the shareable URL so reviewers can inspect the source. When the order flow changes, they update the text, re-render, and export new versions—no redrawing required.

Version Control and Collaboration Benefits

Storing diagrams as text unlocks workflows that image-based diagrams cannot support. Mermaid and PlantUML source files can live in the same Git repository as the code they describe. Changes to a diagram appear in pull request diffs alongside code changes, making architectural updates reviewable rather than hidden in binary files .

VPasCode’s shareable URLs support this workflow by providing a quick way to share a diagram state without committing it. A developer can prototype a diagram, share the URL in a pull request comment, and incorporate feedback before committing the final source to the repository .

When to Use Mermaid vs. PlantUML in VPasCode

Consideration Mermaid PlantUML
Primary use Markdown-embedded diagrams, quick flowcharts Formal UML, C4 models, detailed architecture
Syntax style Compact, Markdown-like More verbose, explicitly object-oriented
Diagram types Flowcharts, sequence, Gantt, class, ERD Full UML suite, C4, ArchiMate, component, deployment
Best for READMEs, wikis, lightweight documentation ADRs, technical specs, formal modeling

A team can use both within VPasCode: Mermaid for diagrams that live close to prose, PlantUML for diagrams that require modeling rigor. The editor’s format detection means you do not need to configure anything—paste the code and the correct renderer activates .

Getting Started

VPasCode is available as a free browser-based tool with real-time preview, URL sharing, and SVG/PNG export. Premium features unlock AI code fixing, AI diagram generation, and translation capabilities. To begin, navigate to the VPasCode workspace, choose a syntax, and paste a minimal example. The live preview confirms that your environment is working before you invest time in a complex diagram .

For teams already using Visual Paradigm’s broader ecosystem, VPasCode integrates with the AI Diagramming Chatbot and OpenDocs. Diagrams generated or refined in VPasCode can be imported into Visual Paradigm Desktop for deeper modeling or embedded into OpenDocs pages for project documentation .

The core value of VPasCode is not any single feature but the consolidation: one browser tab, multiple diagram languages, live preview, AI assistance, and export options that fit documentation workflows. For teams moving from image-based diagrams to diagram-as-code, it offers a low-friction entry point without sacrificing the ability to handle complex PlantUML models when the need arises.