<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rio</title>
    <description>The latest articles on DEV Community by Rio (@riojp_85).</description>
    <link>https://dev.to/riojp_85</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4274464%2F6cf9bb83-9401-4427-bbb0-00050c315e52.jpg</url>
      <title>DEV Community: Rio</title>
      <link>https://dev.to/riojp_85</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/riojp_85"/>
    <language>en</language>
    <item>
      <title>I kept forgetting PlantUML syntax, so I built a visual editor that edits the real diagram</title>
      <dc:creator>Rio</dc:creator>
      <pubDate>Mon, 30 Nov 2026 14:26:31 +0000</pubDate>
      <link>https://dev.to/riojp_85/i-kept-forgetting-plantuml-syntax-so-i-built-a-visual-editor-that-edits-the-real-diagram-3jhk</link>
      <guid>https://dev.to/riojp_85/i-kept-forgetting-plantuml-syntax-so-i-built-a-visual-editor-that-edits-the-real-diagram-3jhk</guid>
      <description>&lt;p&gt;I love PlantUML. Diagrams as text, versioned with Git, rendered anywhere. But I only write it occasionally — and every time, I forget the syntax. Which way does this arrow go? How do you write a fragment again? Half my "diagramming" time went to the reference docs.&lt;/p&gt;

&lt;p&gt;So I looked for a visual editor. Most of what exists is VS Code extensions, and the visual ones tend to redraw the diagram on their own canvas with their own shapes. What I wanted was simpler and stranger: &lt;strong&gt;edit the genuine PlantUML rendering itself&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That's what I built. It's called &lt;strong&gt;Trellis&lt;/strong&gt; — a free, open-source (MIT) desktop editor for Windows.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Website: &lt;a href="https://rio-jp.github.io/Trellis/" rel="noopener noreferrer"&gt;https://rio-jp.github.io/Trellis/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Source: &lt;a href="https://github.com/Rio-jp/Trellis" rel="noopener noreferrer"&gt;https://github.com/Rio-jp/Trellis&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F09zmaj1lnyq4bdkv0hzt.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F09zmaj1lnyq4bdkv0hzt.gif" alt="Demo" width="600" height="375"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg84hbtofi470yvz13z4k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg84hbtofi470yvz13z4k.png" alt="Direct editing of a sequence diagram" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Direct visual editing&lt;/strong&gt; for class, object, and sequence diagrams: add elements, rename inline (double-click / F2), delete with Delete, drag between elements to create relations and messages. On class diagrams, hover a class and connection points appear on its border; drag a relation's endpoint ● to rewire it. Drag elements in and out of packages and sequence-diagram boxes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Every other PlantUML diagram type renders too&lt;/strong&gt; — use case, activity, state, component, deployment, ER, mind map, WBS, Gantt, and more. Clicking text in any diagram jumps to the corresponding source line.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Four editing modes&lt;/strong&gt; (Ctrl+1–4): preview, split, code, direct editing. In split mode, clicking the diagram jumps to the source line.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;30+ categorized samples&lt;/strong&gt; and templates, multi-file tabs with per-tab undo history, notes edited on the diagram, multi-select, drag reordering.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fully offline&lt;/strong&gt;: the PlantUML MIT build is bundled and layout uses the built-in Smetana engine, so no Graphviz install is needed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Styling from the GUI&lt;/strong&gt; — theme, layout direction, line style, hand-drawn look, fonts, colors — written back into the source as &lt;code&gt;skinparam&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5865tcwnd505cw8rzuwi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5865tcwnd505cw8rzuwi.png" alt="Split view: code on the left, rendered diagram on the right" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbgw6e5rn2tojjjgp281x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbgw6e5rn2tojjjgp281x.png" alt="The style panel" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Requirements: Windows 10/11 (64-bit) and Java 11+.&lt;/p&gt;

&lt;h2&gt;
  
  
  The core design: source is the single source of truth
&lt;/h2&gt;

&lt;p&gt;The GUI holds no diagram model of its own. Everything works like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The source is parsed line by line into a model (entities, relations, participants, messages).&lt;/li&gt;
&lt;li&gt;Model elements are matched to the rendered SVG using PlantUML's &lt;code&gt;data-qualified-name&lt;/code&gt;, &lt;code&gt;data-entity-1/2&lt;/code&gt;, &lt;code&gt;data-participant-1/2&lt;/code&gt;, and &lt;code&gt;data-source-line&lt;/code&gt; attributes, with a fallback chain of name → line number → document order.&lt;/li&gt;
&lt;li&gt;Every GUI operation is converted into line edits — replace, insert, delete — and applied to the editor as a CodeMirror transaction.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Because of this, hand-editing the code always works: the GUI just follows. Undo/redo is shared across all modes. And since the preview &lt;em&gt;is&lt;/em&gt; PlantUML's own output, what you see is exactly what any other PlantUML tool will render.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making it fast
&lt;/h2&gt;

&lt;p&gt;A visual editor that lags behind your typing is worse than no editor, so rendering had to be quick. Measured with PlantUML 1.2025.10 / Java 11 / Windows 11:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Case&lt;/th&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;First render (including JVM startup, warmed up in the background at launch)&lt;/td&gt;
&lt;td&gt;~450–550 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Small class / sequence diagrams (warm)&lt;/td&gt;
&lt;td&gt;~6–13 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Class diagram with 60 classes and 79 relations&lt;/td&gt;
&lt;td&gt;~80 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sequence diagram with 12 participants and 150 messages&lt;/td&gt;
&lt;td&gt;~16 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;How:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PlantUML runs resident in &lt;code&gt;-pipe&lt;/code&gt; mode, so the JVM startup cost is paid once.&lt;/li&gt;
&lt;li&gt;The JIT is restricted to C1 (&lt;code&gt;-XX:TieredStopAtLevel=1&lt;/code&gt;) — for this workload it measured about 40% faster than letting C2 kick in.&lt;/li&gt;
&lt;li&gt;Representative diagrams are rendered at startup as a warm-up.&lt;/li&gt;
&lt;li&gt;While a render is in flight, at most one more render (the latest) is queued, so requests never pile up.&lt;/li&gt;
&lt;li&gt;Identical sources are cached, and on a syntax error the last good diagram stays on screen instead of flickering.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Trust, but verify: a system test that clicks everything
&lt;/h2&gt;

&lt;p&gt;An editor that rewrites your source has one unforgivable failure mode: corrupting it. So Trellis has a system test that drives the real UI — for every element of every bundled sample diagram, it exercises &lt;strong&gt;every context-menu item, Delete, every option in the side panels, and every palette part&lt;/strong&gt;, and after each operation checks three things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The resulting source is accepted by real PlantUML (nothing was corrupted).&lt;/li&gt;
&lt;li&gt;No JavaScript error occurred.&lt;/li&gt;
&lt;li&gt;Ctrl+Z restores the original source exactly.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Operations that are &lt;em&gt;supposed&lt;/em&gt; to be errors under PlantUML's spec are registered, with reasons, in an &lt;code&gt;EXPECTED_ERRORS&lt;/code&gt; list.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Trellis is MIT-licensed and open source. The installer is on the &lt;a href="https://rio-jp.github.io/Trellis/" rel="noopener noreferrer"&gt;website&lt;/a&gt; and in &lt;a href="https://github.com/Rio-jp/Trellis/releases" rel="noopener noreferrer"&gt;GitHub Releases&lt;/a&gt;, with automatic updates built in.&lt;/p&gt;

&lt;p&gt;If you like PlantUML but the syntax keeps slipping out of your head — this one's for you.&lt;/p&gt;

</description>
      <category>plantuml</category>
      <category>opensource</category>
      <category>rust</category>
      <category>tauri</category>
    </item>
  </channel>
</rss>
