
Embracing the Modern Era of Diagramming with D2 in VPasCode
Welcome, developers and architects. As we navigate the ever-evolving landscape of software design, the “Diagram as Code” philosophy has become a cornerstone for teams seeking agility and version control. For years, Visual Paradigm has led this charge with robust support for PlantUML and Mermaid. However, the demand for a more modern, declarative approach has brought a new contender to the forefront: D2 (Declarative Diagramming).
In this session, we will explore how Visual Paradigm’s VPasCode tool has expanded its capabilities to include D2, offering you a seamless bridge between complex logic and clean visual representation.
The VPasCode Ecosystem: One Tool, Multiple Languages
If you have used VPasCode before, you are likely familiar with its intuitive interface. The latest update reinforces Visual Paradigm’s commitment to flexibility. Instead of forcing you to choose a single diagramming language, VPasCode now unifies them under one roof.
Looking at the VPasCode interface, you will notice a distinct tab structure at the top. You can effortlessly toggle between PlantUML, Mermaid, Graphviz, and the newly added D2. This integration means you don’t need to switch contexts or open external editors to switch your workflow. Whether you are defining a Java class hierarchy or mapping a network topology, the environment remains consistent.
Understanding the D2 Workflow in Visual Paradigm
D2 distinguishes itself with a focus on readability and modern aesthetics. Unlike some older DSLs (Domain Specific Languages) that can feel verbose, D2 is designed to be concise. When you select the D2 tab in VPasCode, you are presented with a suite of diagramming capabilities designed to handle various architectural needs.
Let’s break down the specific diagram types available to you within the VPasCode editor:
- Basic Shapes: The foundation of any diagram. D2 allows you to quickly define simple relationships and nodes, perfect for brainstorming sessions where speed is essential.
- Containers: Visual Paradigm understands that software is built in layers. The Container capability allows you to group related elements, providing a clear hierarchy that mimics real-world system architecture.
- Sequence: For those who need to visualize logic flow, D2’s sequence diagrams offer a clean way to depict interactions over time, essential for backend developers designing API flows.
- Styled: Aesthetics matter. The Styled option in D2 lets you apply visual flair to your diagrams without writing complex CSS or SVG code. It ensures your documentation looks professional right out of the box.
- Network: Infrastructure architects will find this particularly useful. You can model network topologies, showing how servers, databases, and users connect in a distributed environment.
Why Visual Paradigm is the Ideal Partner for D2
The introduction of D2 into VPasCode is not just about adding a new language; it is about empowering you to choose the right tool for the job. Visual Paradigm acts as the facilitator here. By integrating D2, they are acknowledging that different projects require different modeling languages.
This capability allows your team to maintain a single source of truth for your documentation. You can write D2 scripts to define your high-level architecture while using PlantUML for detailed class diagrams, all within the familiar Visual Paradigm interface. This reduces friction, improves collaboration, and ensures that your documentation remains as up-to-date as your code.
In conclusion, the addition of D2 to VPasCode represents a significant step forward in modernizing the diagramming experience. It invites developers to embrace a cleaner, more declarative syntax while retaining the power and stability of the Visual Paradigm ecosystem.




