Mind-Maps with PlantUML

1 minute read

When you work with PlantUML, you propably already noticed that it has some surprises deep down in its code. Some are experimental and some are quite useful.

Whenever I tried to draw Mind-Maps in the past, I noticed that the most important feature of a Mind-Map tool is that it is easy to use. It should start quickly and you should be able to dump your brain easily vida the keyboard.

Since I seldomly use Mind-Maps, the brain dump part is the hardest - I always forget which tool I used last and the keyboard shortcuts to use.

Now I discovered that PlantUML is also capable of drawing Mind-Maps. Put a List between @startmindmap and @endmindmap tags and it will be rendered as Mind-Map:

Source Code of a Mind-Map
@startmindmap

+ **myThoughts**
++ Thought 1
'tag::details[]
+++_ Thought 1.1
+++_ Thought 1.2
'end::details[]
++ Thought 2
++ Thought 3

'tag::left[]
-- Thought A
-- Thought B
-- Thought C
'end::left[]

@endmindmap

+-bullets will be rendered as thoughts to the right, --bullets to the left, add an underscore _ to omit the box. Take care that there is only one root-element, because PlantUML doesn’t know how to handle two roots (me either).

demo1
Figure 1. Rendered Mind-Map

These Mind-Maps quickly grow. This results in boxes getting smaller and smaller. But as you can already see from the source above, there is a solution. Tag some detail levels or parts of your Mind-Map and instruct Asciidoctor to render only the main part.

Only the right part of my map
[plantuml,mindmap2,svg]
----
include::demo.puml[tags=!left]
----
demo2
2nd Level omitted
[plantuml,mindmap3,svg]
----
include::demo.puml[tags=!details]
----
demo3